The ctalog utility is a sample program that can read the SYSLOG files and display their contents. It can purge the contents of the SYSLOG files. A sample record output from ctalog is shown below.
The first record corresponds to a failed server startup because of a read error (36) with the temporary event file. (Such an error is very unlikely and was forced under a debugger for demonstration purposes.) The second record output shows the result of the subsequent successful startup with a rollback. Note that the second record output indicates a rollback is pending. The rollback is pending because the first attempt at recovery failed.
Class = 8 (Restore Point)
Event = 2 (Recovery results with Restore Points)
Date = 08/08/2014
Time = 11:57:19
Sequence number = 2
Error code = 36
User ID = ''
Node name = ''
Variable-length information:
---------------------------------------------------
Restore point specifications -
serial number: 1
log number: 1
log position: 23e58x
timestamp: 1407499816 Fri Aug 08 07:10:16 2014
type: Lightweight RP
name: 20140808_071016
Recovery/Restore Point status bits:
- Deferred LOG SYNC was enabled at the time of the crash
- RECOVER_TO_RESTORE_POINT is enabled
- rollback attempted
- rollback error
- error inserting skip forward info into log
Event originally added to temporary event file on
failed startup at 20140808 115705
System state:
All transactions committed before the system crash are recovered, but
rollback to a Restore Point failed (see error code) during the insertion of the
skip forward information into the Restore Point. It may be necessary to use the
log file copied before the insertion.
---------------------------------------------------
Class = 8 (Restore Point)
Event = 2 (Recovery results with Restore Points)
Date = 08/08/2014
Time = 11:57:19
Sequence number = 3
Error code = 0
User ID = ''
Node name = ''
Variable-length information:
---------------------------------------------------
Restore point specifications -
serial number: 1
log number: 1
log position: 23e58x
timestamp: 1407499816 Fri Aug 08 07:10:16 2014
type: Lightweight RP
name: 20140808_071016
Recovery/Restore Point status bits:
- Deferred LOG SYNC was enabled at the time of the crash
- pending rollback from previous recovery from Deferred LOG SYNC crash
- RECOVER_TO_RESTORE_POINT is enabled
- rollback attempted
- rollback to Restore Point completed
System state:
All transactions committed before the Restore Point are recovered, and
any transactions committed after the Restore Point are undone.
---------------------------------------------------
The system state output corresponds to the final system state bitmap entries shown above. The following routine is in ctalog.c:
VOID printRPsyslogrec (pSYSLOGrec psr,NINT print_header)
This routine could be used in other applications designed to read the SYSLOG files. Its only external requirements are the dateout() and timeout() routines included in ctalog.c.
The print_header parameter indicates whether or not to print the information from the common SYSLOG record header. ctalog sets this to NO since it already prints the information for each event. For a specialized SYSLOG reader, one might want to print the header information from the routine. ctalog calls this routine for each ctSYSLOGrstpnt event.