今天闲来无事,看到一个隐含参数_disable_logging,号称能阻止Oracle写redo log,一时手痒,结果弄出问题了。在这里要说的是,严禁在生产库中使用该参数。
该参数在默认情况下为false。
_disable_logging FALSE Disable logging
现在将其置为true,然后重启一把,然后切换几个日志,事情就慢慢搞大了
[quote]SQL> alter system set "_disable_logging"=true scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
Database opened.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.[/quote]
当切换到第三个日志的时候,会话处于挂住状态
[quote]SQL> /
alter system switch logfile
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation[/quote]
查看alert日志,已经再报redo头损坏。。。
[quote]Fri Jan 7 15:01:42 2011
Errors in file /ora10/admin/ldbra/bdump/ldbra_arc1_21510.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 71038 change 10783758842576 time 01/07/2011 14:45:47
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'
ARC1: All Archive destinations made inactive due to error 354
Fri Jan 7 15:01:42 2011
ARC1: Closing local archive destination LOG_ARCHIVE_DEST_1: '/ora10/oracle/product/10.2.0/db_1/dbs/arch1_1836_715078399.dbf' (error 354)
(ldbra)
Committing creation of archivelog '/ora10/oracle/product/10.2.0/db_1/dbs/arch1_1836_715078399.dbf' (error 354)[/quote]
数据库重启也包redolog头损坏,悲剧开始
[quote]SQL> alter system set "_disable_logging"=false scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
ORA-16038: log 3 sequence# 1836 cannot be archived
ORA-00354: corrupt redo log block header
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'[/quote]
还好是测试库,再次用隐含参数_allow_resetlogs_corruption,成功将数据库打开。
[quote]SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
ORA-16038: log 3 sequence# 1836 cannot be archived
ORA-00354: corrupt redo log block header
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'
SQL> recover database until cancel;
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.[/quote]
该参数在默认情况下为false。
_disable_logging FALSE Disable logging
现在将其置为true,然后重启一把,然后切换几个日志,事情就慢慢搞大了
[quote]SQL> alter system set "_disable_logging"=true scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
Database opened.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.[/quote]
当切换到第三个日志的时候,会话处于挂住状态
[quote]SQL> /
alter system switch logfile
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation[/quote]
查看alert日志,已经再报redo头损坏。。。
[quote]Fri Jan 7 15:01:42 2011
Errors in file /ora10/admin/ldbra/bdump/ldbra_arc1_21510.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 71038 change 10783758842576 time 01/07/2011 14:45:47
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'
ARC1: All Archive destinations made inactive due to error 354
Fri Jan 7 15:01:42 2011
ARC1: Closing local archive destination LOG_ARCHIVE_DEST_1: '/ora10/oracle/product/10.2.0/db_1/dbs/arch1_1836_715078399.dbf' (error 354)
(ldbra)
Committing creation of archivelog '/ora10/oracle/product/10.2.0/db_1/dbs/arch1_1836_715078399.dbf' (error 354)[/quote]
数据库重启也包redolog头损坏,悲剧开始
[quote]SQL> alter system set "_disable_logging"=false scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
ORA-16038: log 3 sequence# 1836 cannot be archived
ORA-00354: corrupt redo log block header
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'[/quote]
还好是测试库,再次用隐含参数_allow_resetlogs_corruption,成功将数据库打开。
[quote]SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 327155712 bytes
Fixed Size 2083752 bytes
Variable Size 209716312 bytes
Database Buffers 109051904 bytes
Redo Buffers 6303744 bytes
Database mounted.
ORA-16038: log 3 sequence# 1836 cannot be archived
ORA-00354: corrupt redo log block header
ORA-00312: online log 3 thread 1: '/oradata/ldbra/redo03.log'
SQL> recover database until cancel;
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.[/quote]