oracle redo日志文件的后缀,redo日志文件学习笔记(一)

关于redo日志文件,今天因为要做redo日志的在线迁移,所以特意做了个简单的总结。

1. 如果要把redo的切换信息显示到alert日志中,需要设置个参数。

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter check

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_block_checking                    string      FALSE

db_block_checksum                    string      TYPICAL

log_checkpoint_interval              integer     0

log_checkpoint_timeout               integer     1800

log_checkpoints_to_alert             boolean     FALSE

SQL> alter system set log_checkpoints_to_alert=true;

System altered.

2.查看redo的情况,current表示当前所属的redo日志组。

SQL> select group#,status from v$log;

GROUP# STATUS

---------- ----------------

1 INACTIVE

2 INACTIVE

3 INACTIVE

4 CURRENT

3.强制切换日志,使用switch logfile,切换后,current日志组切换到了第一组,刚刚的日志组4变成了active状态。表示dbwr还没有把脏数据写入数据文件。

需要出发dbwr来写入,或者等待一会儿。

alert日志内容如下;

--alter system switch logfile;

Mon Mar 24 18:16:46 2014

Beginning log switch checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156

Thread 1 advanced to log sequence 2845 (LGWR switch)

Current log# 1 seq# 2845 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A1/redo/redo01A.log

Current log# 1 seq# 2845 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B1/redo/redo01B.log

Mon Mar 24 18:16:46 2014

Archived Log entry 2844 added for thread 1 sequence 2844 ID 0x4a0d6000 dest 1:

SQL> select group#,status from v$log;

GROUP# STATUS

---------- ----------------

1 CURRENT

2 INACTIVE

3 INACTIVE

4 ACTIVE

4.再强制切换一次日志,日志组继续切换,可以看到有两个日志组成了active,

alert日志内容如下;

--alter system switch logfile;

Mon Mar 24 18:17:35 2014

Beginning log switch checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180

Thread 1 advanced to log sequence 2846 (LGWR switch)

Current log# 3 seq# 2846 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A3/redo/redo03A.log

Current log# 3 seq# 2846 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B3/redo/redo03B.log

Mon Mar 24 18:17:35 2014

Archived Log entry 2845 added for thread 1 sequence 2845 ID 0x4a0d6000 dest 1:

SQL> select group#,status from v$log;

GROUP# STATUS

---------- ----------------

1 ACTIVE

2 INACTIVE

3 CURRENT

4 ACTIVE

5.如果进行全量检查点,强制dbwr写入数据文件,可以出发全量检查点。

alert日志内容如下:

--alter system checkpoint;

Mon Mar 24 18:18:48 2014

Beginning global checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229

Completed checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229

Completed checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180

Completed checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156

SQL>  select group#,status from v$log;

GROUP# STATUS

---------- ----------------

1 INACTIVE

2 INACTIVE

3 CURRENT

4 INACTIVE

6.过了一会儿,可以看到日志中会出现增量检查点,增量检查点的优先级比全量的要低。

Mon Mar 24 18:19:22 2014

Incremental checkpoint up to RBA [0xb1e.4c.0], current log tail at RBA [0xb1e.5f.0]

7.触发日志归档

--alter system archive log current;

Mon Mar 24 18:20:51 2014

ALTER SYSTEM ARCHIVE LOG

Mon Mar 24 18:20:51 2014

Beginning log switch checkpoint up to RBA [0xb1f.2.10], SCN: 10583135604443

Thread 1 advanced to log sequence 2847 (LGWR switch)

Current log# 2 seq# 2847 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A2/redo/redo02A.log

Current log# 2 seq# 2847 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B2/redo/redo02B.log

Archived Log entry 2846 added for thread 1 sequence 2846 ID 0x4a0d6000 dest 1:

SQL> select group#,status from v$log;

GROUP# STATUS

---------- ----------------

1 INACTIVE

2 CURRENT

3 ACTIVE

4 INACTIVE

和alter system switch logfile的差别在于,对于日志组3,执行alter system archive log current和alter system switch logfile会有所不同

GROUP#    THREAD#  SEQUENCE#    MEMBERS    SIZE_MB ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

1          1        685          2           2048                 YES     ACTIVE

2          1        686          2           2048                 YES     ACTIVE

3          1        687          22048NOACTIVE

4          1        688          2           2048                 NO      CURRENT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值