Beginning log switch checkpoint up to RBA [0x4243f.2.10], SCN: 3916025539605
Sat May 1 00:54:52 2010
Thread 1 advanced to log sequence 271423 (LGWR switch)
Current log# 1 seq# 271423 mem# 0: /dw/stg_redo01/log_dwstg_g1_m1.log
Current log# 1 seq# 271423 mem# 1: /dw/stg_redo02/log_dwstg_g1_m2.log
Sat May 1 00:54:56 2010
Completed checkpoint up to RBA [0x4243f.2.10], SCN: 3916025539605
Sat May 1 00:57:40 2010
Beginning log switch checkpoint up to RBA [0x42440.2.10], SCN: 3916026109591
Sat May 1 00:57:40 2010
Thread 1 advanced to log sequence 271424 (LGWR switch)
Current log# 4 seq# 271424 mem# 0: /dw/stg_redo01/log_dwstg_g4_m1.log
Current log# 4 seq# 271424 mem# 1: /dw/stg_redo02/log_dwstg_g4_m2.log
Sat May 1 00:57:52 2010
Completed checkpoint up to RBA [0x42440.2.10], SCN: 3916026109591
From this file I need to cut the lines that beginning with "Beginning log switch checkpoint up to RBA" and every line under this line which reflect the time stamp.
The final file should be as the following:
Beginning log switch checkpoint up to RBA [0x42428.2.10], SCN: 3916022809348
Sat May 1 00:00:29 2010
Beginning log switch checkpoint up to RBA [0x42429.2.10], SCN: 3916022929579
Sat May 1 00:02:52 2010
Beginning log switch checkpoint up to RBA [0x4242a.2.10], SCN: 3916022993393
Sat May 1 00:04:12 2010
...
$> sed '/Beginning log switch checkpoint up to RBA/!d;n;!d' infile
Beginning log switch checkpoint up to RBA [0x4243f.2.10], SCN: 3916025539605
Sat May 1 00:54:52 2010
Beginning log switch checkpoint up to RBA [0x42440.2.10], SCN: 3916026109591
Sat May 1 00:57:40 2010
[ygemici\unix\is\not\linux~]\YG sed -n '/Beginning/ {N;p;}' file
Beginning log switch checkpoint up to RBA [0x4243f.2.10], SCN: 3916025539605
Sat May 1 00:54:52 2010
Beginning log switch checkpoint up to RBA [0x42440.2.10], SCN: 3916026109591
Sat May 1 00:57:40 2010
grep -n "Beginning log switch checkpoint up to RBA" -A1 t
1:Beginning log switch checkpoint up to RBA [0x4243f.2.10], SCN: 3916025539605
2-Sat May 1 00:54:52 2010
--
9:Beginning log switch checkpoint up to RBA [0x42440.2.10], SCN: 3916026109591
10-Sat May 1 00:57:40 2010