oracle 实例崩溃时启动的验证(low cache rba->on disk rba)

检查点的作用就是为了减少实例恢复的时间,以下是验证过程

sql>alter system checkpoint;

此时记录日志中如下:

Beginning global checkpoint up to RBA [0x13.62.10], SCN: 0x0000.00073778
Completed checkpoint up to RBA [0x13.62.10], SCN: 0x0000.00073778

此时插入数据

SQL> insert into test select * from test where rownum<100;

99 rows created.

SQL> insert into test select * from test where rownum<100;

99 rows created.

SQL> insert into test select * from test where rownum<100;

99 rows created.

--此时模拟发生实例崩溃

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  101785252 bytes
Fixed Size                   454308 bytes
Variable Size              75497472 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.

转储控制文件

SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump controlf 4;
Statement processed.

***************************************************************************
CHECKPOINT PROGRESS RECORDS
***************************************************************************
 (blkno = 0x4, size = 104, max = 1, in-use = 1, last-recid= 0)
THREAD #1 - status:0x2 flags:0x0 dirty:11
low cache rba:(0x13.64.0) on disk rba:(0x13.a3.0)

rba的组成:

Recent entries in the redo thread of an Oracle instance are addressed using a 3-part redo byte address, or RBA. An RBA is comprised of
the log file sequence number (4 bytes)
the log file block number (4 bytes)
the byte offset into the block at which the redo record starts (2 bytes)


SQL> alter database open;

Database altered.

将16进制转换为10进制

SQL> select to_number('&A','XXXXXXXX') from dual;
Enter value for a: 64
old   1: select to_number('&A','XXXXXXXX') from dual
new   1: select to_number('64','XXXXXXXX') from dual

TO_NUMBER('64','XXXXXXXX')
--------------------------
                       100

SQL> select to_number('&A','XXXXXXXX') from dual;
Enter value for a: a3
old   1: select to_number('&A','XXXXXXXX') from dual
new   1: select to_number('a3','XXXXXXXX') from dual

TO_NUMBER('A3','XXXXXXXX')
--------------------------
                       163

 

SQL> select to_number('&A','XXXXXXXX') from dual;
Enter value for a: 13
old   1: select to_number('&A','XXXXXXXX') from dual
new   1: select to_number('13','XXXXXXXX') from dual

TO_NUMBER('13','XXXXXXXX')
--------------------------
                        19           代表sequence 号

在数据库启动日志中可以看到恢复时也是从这个范围开始的

 

Completed first pass scan
 63 redo blocks read, 11 data blocks need recovery
Fri Mar 21 14:09:25 2008
Started recovery at
 Thread 1: logseq 19, block 100, scn 0.0
Recovery of Online Redo Log: Thread 1 Group 3 Seq 19 Reading mem 0
  Mem# 0 errs 0: D:\ORACLE\ORADATA\PUBTEST\REDO03.LOG
Fri Mar 21 14:09:25 2008
Completed redo application
Fri Mar 21 14:09:25 2008
Ended recovery at
 Thread 1: logseq 19, block 163, scn 0.513205
 11 data blocks read, 11 data blocks written, 63 redo blocks read
Crash recovery completed successfully

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-214920/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7199859/viewspace-214920/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值