Sample Job Streams [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.0 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.
In the following example, roll-forward recovery is being used. 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 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. To end the logging cycle, the steps
shown in the previous job stream in Figure G-1 are completed after
you do the following:
:LOG ORDERLOG,STOP Stop logging.
Use STORE command to store the log file to tape.
:PURGE ORDER001 Purge the current log file.
The next example in Figure G-2 uses roll-forward recovery. Note that
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 |
| :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 |
| ORDERS |
| |
| :RUN DBUTIL.PUB.SYS |
| PURGE ORDERS Purge |
| the |
| current |
| database, |
| and |
| restore |
| |
| |
| EXIT the |
| backup |
| copy |
| of |
| the |
| database. |
| |
| :RUN DBRESTOR.PUB.SYS |
| 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 the database prior to purging it and restoring the backup
database copy is optional. 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. A DBSTORE of the database can be done at
this time; however, this is optional. 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.
MPE/iX 5.0 Documentation