HP 3000 Manuals

Using a Wrapper DBEnvironment [ ALLBASE/Replicate User's Guide ] MPE/iX 5.0 Documentation


ALLBASE/Replicate User's Guide

Using a Wrapper DBEnvironment 
[REV BEG]

When a failure occurs on a master DBEnvironment, there may be log files
that contain transactions not yet replicated on the slave DBEnvironment.
You can use a wrapper DBEnvironment to rescue log file information that
is inaccessible, if the necessary log files are intact and accessible.
The SQLUtil WRAPDBE command is used to "wrap" a dummy DBEnvironment
around the accessible log files.  Then use soft resynchronization
to transfer the remaining unapplied transactions to the slave
DBEnvironment.[REV END]


NOTE [REV BEG] If you are not familiar with the WRAPDBE command, review the section, "Setting up a Wrapper DBEnvironment" and the appropriate sections that follow in the "Backup and Recovery" chapter of the ALLBASE/SQL Database Administration Guide. Also review the SQLUtil command, WRAPDBE, in the SQLUtil appendix of the same manual.[REV END]
Recovering Orphaned Log Files [REV BEG] These are the steps for recovering orphaned log files using the SQLUtil WRAPDBE command: 1. Selecting the usable log files. 2. Creating a dummy DBEnvironment using the START DBE NEW command. 3. Using SQLUtil WRAPDBE to associate the orphaned log files with the dummy DBEnvironment. 4. Using soft resynchronization to replicate the remaining log files from the dummy DBEnvironment to the slave. [REV END] Selecting Usable Log Files. [REV BEG] If the DBEConFile is still intact and accessible, use the SQLUtil SHOWLOG command to determine which log files are usable. Use the option that does not connect to the DBEnvironment. If the DBEConFile is not intact or accessible, and if you are using single logging, use the log files that are displayed when you issue a LISTF, 2 command. If a log file has been damaged, the operation of the DBEnvironment stopped at the time the log file was damaged, and you can recover any transactions up to the point where the damage occurred. If the DBEConFile is not intact or accessible, and if you are using dual logging, list the log files from each leg of the dual log. Determine which log file of each pair was written to most recently. If one leg of the log was damaged, files in that leg have time stamps that are much earlier than files that are undamaged. Use the log files from the leg with the latest time stamps.[REV END] Creating a Dummy DBEnvironment. In this next step, create a dummy DBEnvironment using the SQLUtil START DBE NEW command.[REV BEG] For this discussion, it is assumed that your log files are in a group separate from the one that contains the DBEConFile and DBEFile0 and that you are doing dual logging. This is done to insure that you will have usable log files if the device containing the DBEConFile fails, or that you will have one set of usable log files if the device containing the other set of log files fails. Go to the group containing the usable set of log files. Create a dummy DBEnvironment using the START DBE NEW statement. Pay careful attention to the following points: * The AUDIT LOG clause must be specified. * The DEFAULT partition must be specified, but it may have a different partition number than in the original DBEnvironment. * MAXPARTITIONS must have the same value as in the original DBEnvironment. * The AUDIT NAME must be specified and be unique. * The DBEFile0, logfile, and DBEnvironment names must not conflict with any other file names in the same group. * The value for MAXTRANSACTIONS must be specified, and must be the same value as in the original DBEnvironment. For example, a START DBE NEW statement for a wrapper DBEnvironment could appear as shown below: isql=>START DBE 'WRAPDBE1' MULTI NEW >AUDIT LOG, >TRANSACTION = 5, >DEFAULT PARTITION = 1, >MAXPARTITIONS = 30, >AUDIT NAME = 'WRAP1', >DBEFILE0 DBEFILE WRAPF0 >WITH PAGES = 200, >NAME = 'WRAPF0', >LOG DBEFILE TEMPLOG1 >WITH PAGES = 1000, >NAME = 'TEMPLOG1'; [REV END] Using WRAPDBE to Rescue Orphaned Log Files. [REV BEG] The following steps are used to associate the orphaned log files with the dummy DBEnvironment: * Log on as a user with SM capability in order to use the SQLUtil WRAPDBE command. * Go to the group containing the log files to be rescued and the dummy DBEnvironment. * Invoke the SQLUtil WRAPDBE command and enter the appropriate information in reply to the prompts. For this example, assume that the usable log files are PTSLGB1, PTSLGB2, and PTSLGB3. The WRAPDBE command could appear as follows: :SQLUTIL >>WRAPDBE DBEnvironment Name: WRAPDBE1 Maintenance Word: [Return] Wrapper Mode ([log]) (opt): [Return] Enter Log File Name (RETURN to finish):PTSLGB1 Enter Log File Name (RETURN to finish):PTSLGB2 Enter Log File Name (RETURN to finish):PTSLGB3 Enter Log File Name (RETURN to finish):[Return] Convert to Wrapper DBEnvironment (y/n)?Y Wrapper DBEnvironment converted. >>// The specified log files are now associated with the wrapper DBEnvironment and can be accessed by the ALLBASE/Replicate application to transfer to the slave any remaining transactions that have not yet been replicated from the master. * Log off as a user with SM capability. [REV END] Replicating the Remaining Log Files. [REV BEG] These are the steps for replicating the remaining log files: * Log on to the slave system as a regular user and go to the group where the DBEConFile for the slave DBEnvironment is located. * Invoke the ALLBASE/Replicate slave application, and supply the necessary information at the prompts. For example, the invocation of REPSLAVE might appear as follows: :REPSLAVE Enter Slave DBE Name>> PARTSDBE Enter Partition Number (RETURN to finish)>>1 Enter Partition Number (RETURN to finish)>>2 Enter Partition Number (RETURN to finish)>>10 Enter Partition Number (RETURN to finish)>>-2 Enter Partition Number (RETURN to finish)>>-3 Enter Partition Number (RETURN to finish)>>-4 Enter Partition Number (RETURN to finish)>>-5 Enter Partition Number (RETURN to finish)>>[Return] Enter the Socket Name you wish to use (max 16 chars)>>MA1TOSL1 Attempting to establish connection. * Log on to the master system as a regular user and go to the group containing the DBEConFile for the master DBEnvironment. * Specify desired soft resynchronization application options by setting the environment variables. The variable RESYNCrptnotrx, set to 1, causes the master resynchronization application to send a message to the console when it is unable to find any more transactions to send to the slave. The variable RESYNCstoplog, set to 1, causes the master application to stop the resynchronization process when it runs out of transactions to send to the slave. The environment variable could be set as follows:[REV END] : SETJCW RESYNCrptnotrx 1 [REV BEG] * Invoke the ALLBASE/Replicate master application. For example, invoke REPMAST as follows: :REPMAST Enter Slave DBE Name>>WRAPDBE1 Enter the Socket Name you wish to use>>MA1TOSL1 Enter the Node Name of the slave DBE>>CALVIN Attempting to establish connection. Have established connection with slave resynch application. Specify the name of the dummy DBEnvironment, not the original DBEnvironment, when replying to the above prompts. Assuming the log history goes back far enough to contain the next transaction needed by the slave, soft resynchronization will now continue until all the untransmitted transactions have been replicated on the slave. Now the slave can be used as a temporary master until the master is placed back in service. [REV END]


MPE/iX 5.0 Documentation