HP 3000 Manuals

Sample Job Streams [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.5 Documentation


TurboIMAGE/XL Database Management System Reference Manual

Sample Job Streams 

This section shows a sample job stream which can be used to initiate a
logging cycle.  Prior to using this job stream, you should check the
MPE/iX logging configuration for adequate capacity.  Also shown in this
section are sample job streams which can be used to recover a database
using either roll-forward recovery or roll-back recovery.  You must
decide which recovery method to use and how often the database should be
stored.


NOTE You must have logging (LG) or operator (OP) capability to use the following MPE/iX commands: GETLOG, RELLOG, ALTLOG, CHANGELOG, LISTLOG, and SHOWLOGSTATUS. You must have LG or OP capability also if you intend to open a database with logging enabled. Logging capability is acquired through the MPE system manager and account manager commands.
[REV BEG] In the following example, roll-forward recovery is being used and DBSTORE is used to backup the database. If using roll-back recovery, replace the line >>ENABLE ORDERS FOR LOGGING with >>ENABLE ORDERS FOR ROLLBACK. This enables the database for logging and for roll-back recovery.[REV END] _________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :GETLOG ORDERLOG;LOG=ORDER001,DISC Acquire | | log | | identifier. | | | | | | :BUILD ORDER001;DISC=200000,20,7;CODE=LOG Build | | new | | log | | file. | | | | | | :RUN DBUTIL.PUB.SYS | | SET ORDERS LOGID=ORDERLOG | | Response | | to | | logid | | password | | prompt. | | | | | | ENABLE ORDERS FOR LOGGING Set | | the | | database | | flags | | in | | | | DISABLE ORDERS FOR ACCESS the | | root | | file. | | | | ENABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :RUN DBSTORE.PUB.SYS Store | | the | | database. | | | | ORDERS | | | | :LOG ORDERLOG,START Start | | the | | logging | | process; | | | | logid | | is | | ORDERLOG. | | | | | | | | :RUN DBUTIL.PUB.SYS | | ENABLE ORDERS FOR ACCESS Set | | the | | database | | flags | | | | DISABLE ORDERS FOR RECOVERY in | | the | | root | | file. | | | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :EOJ | | | _________________________________________________________________________ Figure G-1. Sample Job Stream for Starting Logging Cycle The job stream above builds a new log file. In this case, the log file resides on disk and sets the database flags. Note that because no logid password was specified in the GETLOG command, a blank line is left as a response to the password prompt. A backup copy of the database is made (this sets the date and time the copy was made in the root file), logging is initiated with START, the database is enabled for access, and recovery is disabled. At the end of the logging cycle, stop logging, store the current log file on tape for back-up, purge the current log file, build a new log file, and store a database backup copy.[REV BEG] To start a logging cycle, the steps (except GETLOG command) shown in the previous job stream in Figure G-1 are completed after you do the following:[REV END] :LOG ORDERLOG,STOP Stop logging. Use STORE command to store the log file to tape. :PURGE ORDER001 Purge the current log file. [REV BEG] The next example in Figure G-2 uses roll-forward recovery and DBSTORE/DBRESTORE. If all recommended procedures have been followed, the database backup copy will have flags set for enabling recovery and disabling access, so the step to set these flags would be unnecessary.[REV END] If this process is being done interactively, the following command in DBUTIL will show if the flags for recovery and access are correctly set: >>SHOW database name FLAGS ________________________________________________________________________ |[REV BEG] | | | | :JOB MGR.DATAMGT | | :RUN DBUTIL.PUB.SYS If | | the | | database | | is | | to | | be | | stored | | prior | | | | DISABLE ORDERS FOR ACCESS to | | recovery, | | set | | flags | | in | | the | | database | | | | ENABLE ORDERS FOR RECOVERY and | | run | | DBSTORE. | | | | EXIT | | :RUN DBSTORE.PUB.SYS Current | | database | | on | | the | | system. | | | | ORDERS Optional | | step. | | | | | | :RUN DBUTIL.PUB.SYS | | PURGE ORDERS Purge | | the | | current | | database. | | | | EXIT | | :RUN DBRESTOR.PUB.SYS Restore | | backup | | copy | | of | | the | | database | | for | | recovery. | | | | ORDERS | | | | :RUN DBUTIL.PUB.SYS | | DISABLE ORDERS FOR ACCESS Set | | the | | flags | | in | | the | | database. | | | | ENABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :RUN DBRECOV.PUB.SYS Use | | roll-forward | | recovery | | on | | | | | | RECOVER ORDERS database | | ORDERS. | | | | FILE PART1,SYS/P1D1.MKTG,0,3 The | | FILE | | command | | is | | used | | to | | | | FILE PART2,SYS/P1D1.MKTG,0,3 route | | log | | records | | to | | individual | | | | FILE PART3,SYS/P1D1.MKTG,0,3 user | | log | | files. | | | | RUN | | EXIT | | :LOG ORDERLOG,RESTART Restart | | current | | log | | file | | and | | set | | the | | | | :RUN DBUTIL.PUB.SYS database | | flags. | | | | ENABLE ORDERS FOR ACCESS | | DISABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :EOJ | | | ________________________________________________________________________ Figure G-2. Sample Job Stream for Roll-Forward Recovery Storing and purging the damaged database prior to restoring it is optional.[REV END] After recovery has completed, logging can either be restarted (from the current log file) or the log file can be purged and a new log file built. The next example in Figure G-3 uses roll-back recovery. If all recommended procedures have been followed, the database will have flags set for enabling recovery and disabling access, so the step to set these flags would be unnecessary.[REV BEG] A backup of the database using DBSTORE or TurboSTORE/iX 7x24 True-Online Backup (with ONLINE=START or ONLINE=END option) can be done at this time; however, this is optional.[REV END] If this process is being done interactively, the following command in DBUTIL will show if the flags for recovery and access are correctly set: >>SHOW database name FLAGS ________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :RUN DBUTIL.PUB.SYS | | DISABLE ORDERS FOR ACCESS Set | | the | | flags | | in | | the | | database | | | | ENABLE ORDERS FOR RECOVERY root | | file. | | | | EXIT | | | | A DBSTORE of the database at this time is recommended. | | | | :RUN DBRECOV.PUB.SYS | | CONTROL NOSTORE Allows | | recovery | | to | | proceed | | whether | | or | | not | | the | | DBSTORE | | flag | | is | | set. | | | | ROLLBACK ORDERS Use | | roll-back | | recovery | | on | | database | | ORDERS. | | | | FILE PART1,SYS/P1D1.MKTG,0,3 The | | FILE | | command | | is | | used | | to | | route | | log | | | | FILE PART2,SYS/P1D1.MKTG,0,3 records | | to | | individual | | user | | files. | | | | FILE PART3,SYS/P1D1.MKTG,0,3 | | RUN | | EXIT | | :LOG ORDERLOG,RESTART Restart | | the | | current | | log | | file | | and | | set | | | | :RUN DBUTIL.PUB.SYS the | | database | | flags. | | | | ENABLE ORDERS FOR ACCESS | | DISABLE ORDERS FOR RECOVERY | | EXIT | | :EOJ | | | ________________________________________________________________________ Figure G-3. Sample Job Stream for Roll-Back Recovery After recovery has completed, logging can either be restarted (from the current log file) or the log file can be purged and a new log file built. [REV BEG] The following job stream shows how you can start a new log cycle for roll-forward recovery using TurboSTORE/iX 7x24 True-Online Backup (with ONLINE=START or ONLINE=END option) to backup the database. If using roll-back recovery, replace the line >>ENABLE ORDERS FOR LOGGING with >>ENABLE ORDERS FOR ROLLBACK. This enables the database for logging and for roll-back recovery. _________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :GETLOG ORDERLOG;LOG=ORDER001,DISC;AUTO Acquire | | log | | identifier. | | AUTO | | is | | optional. | | | | | | :BUILD ORDER001;DISC=200000,20,7;CODE=LOG Build | | new | | log | | file. | | | | | | :RUN DBUTIL.PUB.SYS | | SET ORDERS LOGID=ORDERLOG Response | | to | | logid | | password | | prompt. | | | | | | ENABLE ORDERS FOR LOGGING Set | | the | | database | | flags | | in | | the | | root | | file | | | | DISABLE ORDERS FOR ACCESS | | ENABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :FILE ORDERBK1;DEV=TAPE Mount | | the | | tape. | | | | :STORE ORDERS;*ORDERBK1;ONLINE=START Store | | the | | database. | | | | :LOG ORDERLOG,START Start | | the | | logging | | process; | | logid | | is | | ORDERLOG. | | | | :RUN DBUTIL.PUB.SYS | | ENABLE ORDERS FOR ACCESS Set | | the | | database | | flags | | | | DISABLE ORDERS FOR RECOVERY in | | the | | root | | file. | | | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :EOJ | _________________________________________________________________________ Figure G-4. Sample Job Stream for Starting Logging Cycle The job stream above builds a new log file. In this case, the log file resides on disk and sets the database flags. Note that because no logid password was specified in the GETLOG command, a blank line is left as a response to the password prompt. A backup copy of the database is made (this sets the date and time the copy was made in the root file), logging is initiated with START, the database is enabled for access, and recovery is disabled. The database is ready for access. If you want to make another backup to keep recovery time short, you do not need to stop logging. Also the database could be open for access. You can backup the database using TurboSTORE/iX 7x24 True-Online Backup (with ONLINE=START or ONLINE=END option) and optionally store and purge the log files (if AUTO option was used with GETLOG) preceding the log file which was in use at the time of the backup. If you do not purge the preceding log files, you can continue until log file ORDER999. After that you will get an error when attempting to write to LOG0001. ________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :FILE ORDERBK2;DEV=TAPE Mount | | tape. | | | | :STORE ORDERS;*ORDERBK2;ONLINE=START Store | | database | | while | | it | | is | | open | | for | | access. | | | | :EOJ Assume | | that | | you | | will | | start | | a | | new | | log | | cycle | | after | | ORDER999. | | | ________________________________________________________________________ Figure G-5. Sample Job Stream for Backup with Database Open for Access The next example in Figure G-6 uses roll-forward recovery and TurboSTORE/iX 7x24 True-Online Backup (with ONLINE=START or ONLINE=END option). If all recommended procedures have been followed, the database backup copy will have flags set for enabling recovery and disabling access, so the step to set these flags would be unnecessary. If this process is being done interactively, the following command in DBUTIL will show if the flags for recovery and access are correctly set: >>SHOW database name FLAGS ________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :FILE ORDERBAD;DEV=TAPE Current | | damaged | | database | | on | | the | | system | | needing | | recovery. | | | | :STORE ORDERS;*ORDERBAD;ONLINE=START Store | | damaged | | database; | | optional | | step. | | | | | | :RUN DBUTIL.PUB.SYS | | PURGE ORDERS Purge | | the | | current | | database. | | | | EXIT | | :FILE ORDERBK2;DEV=TAPE Mount | | the | | backup | | tape. | | | | :RESTORE *ORDERBK2;ORDERS Restore | | the | | backup | | copy | | of | | the | | database | | for | | recovery. | | | | | | :RUN DBUTIL.PUB.SYS | | DISABLE ORDERS FOR ACCESS Set | | the | | flags | | in | | the | | database. | | | | ENABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :RUN DBRECOV.PUB.SYS Use | | roll-forward | | recovery | | on | | | | RECOVER ORDERS database | | ORDERS. | | | | FILE PART1,SYS/P1D1.MKTG,0,3 Use | | the | | FILE | | command | | to | | route | | log | | records | | | | FILE PART2,SYS/P1D1.MKTG,0,3 to | | individual | | user | | log | | files. | | | | FILE PART3,SYS/P1D1.MKTG,0,3 | | RUN | | EXIT | | :LOG ORDERLOG,RESTART Restart | | current | | log | | file | | and | | set | | the | | | | :RUN DBUTIL.PUB.SYS database | | flags. | | | | ENABLE ORDERS FOR ACCESS | | DISABLE ORDERS FOR RECOVERY | | ENABLE ORDERS FOR MUSTRECOVER | | EXIT | | :EOJ | | | ________________________________________________________________________ Figure G-6. Sample Job Stream for Roll-Forward Recovery Storing and purging the damaged database prior to restoring it is optional. After recovery has completed, logging can either be restarted (with the current log file) or the log file can be purged and a new log file built. The next example in Figure G-7 uses roll-back recovery. A backup of the database using DBSTORE or TurboSTORE/iX 7x24 True-Online Backup (with ONLINE=START or ONLINE=END option) can be done at this time; however, this is optional. The following command in DBUTIL will show if the flags for recovery and access are correctly set: >>SHOW database name FLAGS ________________________________________________________________________ | | | :JOB MGR.DATAMGT | | :RUN DBUTIL.PUB.SYS | | DISABLE ORDERS FOR ACCESS Set | | the | | flags | | in | | the | | database | | | | ENABLE ORDERS FOR RECOVERY root | | file. | | | | EXIT | | | | A backup of the database at this time is recommended. | | | | :RUN DBRECOV.PUB.SYS | | CONTROL NOSTORE Allows | | recovery | | to | | proceed | | whether | | or | | not | | the | | DBSTORE | | flag | | is | | set. | | | | ROLLBACK ORDERS Use | | roll-back | | recovery | | on | | database | | ORDERS. | | | | RUN | | EXIT | | :LOG ORDERLOG,RESTART Restart | | the | | current | | log | | file | | and | | set | | | | :RUN DBUTIL.PUB.SYS the | | database | | flags. | | | | ENABLE ORDERS FOR ACCESS | | DISABLE ORDERS FOR RECOVERY | | EXIT | | :EOJ | | | ________________________________________________________________________ Figure G-7. Sample Job Stream for Roll-Back Recovery After recovery has completed, logging can either be restarted (from the current log file) or the log file can be purged and a new log file built.[REV END]


MPE/iX 5.5 Documentation