How to get the first SCN, next SCN, first time, next time of archived log? the first way should be check rows from V$LOG_HISTORY or V$ARCHIVED_LOG, but these view just keep information of few latest archived logs, it depend on the control file record keep time setting, in quite a few databases, it did not keep long time than one week. The another ways is to dump the log file header, the check the trace file, you may find the following lines:
FILE HEADER:
......
Low scn: 0x031f.05c00824 08/23/2006 19:08:21
Next scn: 0x031f.05c00990 08/23/2006 19:08:58
......
But dump log is quite complex, I have spent some time on log format, so just spent few minutes to write a new utility "lslog" to get these information, it's native C program, no Oracle environment is required:
$> lslog file=PROD_26375.arc
26375,3436537083312,2006-11-12 18:13:57,3436537256045,2006-11-12 21:09:24
It print out five fields split by "," as following:
1, Log Sequence
2, Start SCN
3, Start Time
4, Next Log Start SCN
5, Next Log Start Time
This feature is platform independent, and support 8i/9i/10g's archive log file. as following:
SQL> SELECT FIRST_CHANGE#,FIRST_TIME,NEXT_CHANGE#
2 FROM V$LOG_HISTORY WHERE SEQUENCE#=26375;
FIRST_CHANGE# FIRST_TIME NEXT_CHANGE#
---------------- ------------------- ----------------
3436537083312 2006-11-12 18:13:57 3436537256045
00:36:55 SQL> select FIRST_TIME from v$log_history where SEQUENCE#=26376;
FIRST_TIME
-------------------
2006-11-12 21:09:24
Not powerful utility, download it for fun.
