Controlling the Logging Process [ User Logging Programmer's Guide ] MPE/iX 5.0 Documentation
User Logging Programmer's Guide
Controlling the Logging Process
When logid has been created and the logfile built, the Operator will
control the logging process using the :LOG command. The :LOG command
allows the operator to start a logging process to a new logfile, stop a
logging process (for example, to change attributes using :ALTLOG, or to
shut the system down), or restart a logging process to a logfile which
has already been accessed. Problems which may occur when using the :LOG
command include:
* The user of the :LOG command does not have OP capabilities or the
operator has not done an :ALLOW of the :LOG command for the user.
* START was specified instead of RESTART for a file which already has
records in it.
* STOP was requested while user processes are accessing the logfile.
Logging to DISC
When logging to DISC, for User Logging to continue when a full logfile is
encountered, the :CHANGELOG command may be used. The :CHANGELOG command
will open a new User Logging file with the same attributes as the
previous file. To use the :CHANGELOG command, the User Logging filename
specified in the :GETLOG command must end with the three digits "001" .
Each time a new logfile is constructed, by the CHANGELOG command, the
value represented by the last three digits is incremented by 1 (for
example, filename001---> filename002). If the logfile name specified
with the :GETLOG command does not end with the three digits "001" , a
warning will be given (to the user issuing the command) that the
:CHANGELOG command will not be allowed for this file.
If the ;AUTO option is specified with the :GETLOG or :ALTLOG command for
a disc file, where :CHANGELOG is allowed, the User Logging process will
automatically perform a :CHANGELOG whenever the disc file becomes full.
If the ;AUTO option is not specified, when the disc logfile becomes full
the User Logging process will close the logfile and terminate, preventing
any applications which are linked to it from writing any additional log
records.
Logging to TAPE
When logging to tape, if an end-of-tape is encountered, the Operator will
be requested to mount the next tape in the volume set and the logging
will continue. The user may issue a :CHANGELOG command for logging to be
switched to a new logfile (DISC or TAPE) before end-of-tape is reached.
NOTE The ;AUTO option is ignored if the logfile media is TAPE.
Linking Logfiles
When a :CHANGELOG command is issued, information about the new logfile
and is written to the old logfile, and information about the old logfile
is written as the first record in the new logfile. This allows the
recovery programs to find the next logfile in the set.
NOTE Using :CHANGELOG is recommended over stopping the process,
switching logfiles (by renaming files or using :ALTLOG to point to
a new logfile), and starting the process. Using :CHANGELOG is
easier and it creates these links for use in recovery.
It is not required that all logfiles in a set be on the same media. The
first file could be on disc, the second on tape, the third on disc, etc.
This can be controlled with the ;DEV= option of the :CHANGELOG command.
After a System Backup
Usually, when it is time to backup a database, the operator will stop the
logging processes; the database and all associated logfiles will be
stored off, and the old logfile(s) will be purged from disc and rebuilt.
If :CHANGELOG was allowed, it is important to use the :ALTLOG command to
reset the last three digits of the logfile name back to "001" . Failure
to do this will cause problems when recovering data.
Obtaining Status of Open User Logging Files
To display the status information of currently open User Logging files,
use the :SHOWLOGSTATUS command:
:SHOWLOGSTATUS KATHY
LOGID CHANGE AUTO USERS STATE CUR REC MAX REC % USED
KATHY YES YES 1 INACTIVE 65 1023 6 %
NOTE INACTIVE is displayed when a process is waiting for information
from the user processes.
If there are processes with the logfile open, and a :LOG command with the
STOP option is issued, the operator will receive a warning at the System
Console, and the logging process will continue.
MPE/iX 5.0 Documentation