The following sections provide information about performing the additional Apply program functions of scheduling copies and initiating a forward recovery.
You can include an event name in your replication subscription. Your subscription cycles can run according to a timer, an event occurrence, or both. See "Setting the Copying Schedule: Time or Event Based" for more information about the purpose and usage of event scheduling.
You can schedule a subscription by manipulating the event table. The DDL statement for the event table appears as follows:
CREATE TABLE ASN.IBMSNAP_SUBS_EVENT ( EVENT_NAME CHAR(18) NOT NULL, EVENT_TIME TIMESTAMP NOT NULL, END_OF_PERIOD TIMESTAMP);
For example, to start the Apply program at 6:00 p.m. on 9/24/97 and copy changes from the source server up to 4:00 p.m. on the same date, you would insert the following values in ASN.IBMSNAP_SUBS_EVENT:
('EVENTA','1997-09-24-18.00.00.00000','1997-09-24-16.00.00.00000'),
A subscription becomes eligible for processing when EVENT_TIME falls between LASTSUCCESS and the control server's CURRENT TIMESTAMP. The END_OF_PERIOD column enables you to specify a timestamp upper limit for change data.
As an alternative to using the LOADX option when running the Apply program program, you can automate the loading of many DB2 copies by using the following technique to perform your own full refresh on behalf of Apply for MVS. By doing so, Apply for MVS assumes that it has initialized your large point-in-time copies. You must use this technique to fully refresh tables with referential integrity constraints in order to bypass referential integrity checking.
The following example assumes that you want to perform a load of the tables within the replication subscription SET001 with an Apply program qualifier of APPLY001.
UPDATE ASN.IBMSNAP_REGISTER SET DISABLE_REFRESH = 1 WHERE SOURCE_OWNER = 'source owner' AND SOURCE_TABLE = 'source table'
UPDATE ASN.IBMSNAP_SUBS_SET SET ACTIVATE = 0 WHERE SET_NAME = 'SET001' AND APPLY_QUAL = 'APPLY001'
UPDATE ASN.IBMSNAP_PRUNCNTL SET SYNCHPOINT = x'000000000000000000000', SYNCHTIME = CURRENT TIMESTAMP WHERE SET_NAME = 'SET001' AND APPLY_QUAL = 'APPLY001'
UPDATE ASN.IBMSNAP_SUBS_SET SET LASTRUN = CURRENT TIMESTAMP, LASTSUCCESS = CURRENT TIMESTAMP, SYNCHPOINT = CURRENT TIMESTAMP WHERE SET_NAME = 'SET001' AND APPLY_QUAL = 'APPLY001'
UPDATE ASN.IBMSNAP_SUBS_SET SET ACTIVATE = 1 WHERE SET_NAME = 'SET001' AND APPLY_QUAL = 'APPLY001'
ASNDONE is a user exit program that the Apply program invokes after set subscription processing completes, regardless of success or failure. You can modify ASNDONE to meet the requirements of your installation. For example, the user exit can examine the UOW table to discover rejected transactions and inititiate further actions, such as issuing a message or generating an alert.
To use ASNDONE:
The parameters passed to ASNDONE are as follows:
In cases of an incomplete rollback or partially restored backup, you might need to copy a "window" of changes for completion.
To use the Apply program to limit the range of changes to those excluded from the rollback:
Check the IBMSNAP_LOGMARKER value in the target table. The highest value is the most recently committed change.
or
For example, if your timestamp shows the last committed change to be 941106174322, your SQL should reflect changes that occur after that time.