注意:Oracle的隐含参数只应该在测试环境或者在Oracle Support的支持下使用。
从Oracle的系统表中,我们知道Oracle存在一个隐含参数_disable_logging可以用于禁用日志生成,这个参数显然只能用于测试目的(可以极大提高Benchmark测试的性能),禁止日志生成必然导致事务的不可恢复性,而且会导致日志文件损坏。
SQL> select ksppinm,ksppdesc from x$ksppi where ksppinm like '%logging';KSPPINM KSPPDESC-------------------- ------------------------------_disable_logging Disable logging
因为特殊的需要,对这个参数进行了一点简单测试:
1.设置参数
[oracle@jumper bdump]$ sqlplus "/ as sysdba"SQL*Plus: Release 9.2.0.4.0 - Production on Wed Oct 19 11:01:19 2005Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Connected to:Oracle9i Enterprise Edition Release 9.2.0.4.0 - ProductionWith the Partitioning optionJServer Release 9.2.0.4.0 - ProductionSQL> alter system set "_disable_logging"=true scope=both;System altered.
2.事务测试
SQL> create table t as select * from dba_users;Table created.SQL> select count(*) from t; COUNT(*)---------- 12SQL> shutdown abort;ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 97588504 bytesFixed Size 451864 bytesVariable Size 33554432 bytesDatabase Buffers 62914560 bytesRedo Buffers 667648 bytesDatabase mounted.Database opened.SQL> select count(*) from t;select count(*) from t *ERROR at line 1:ORA-00942: table or view does not exist
由于未产生相应日志,数据库crash或shutdown abort之后,上一次成功完成的检查点之后变化的数据将无法恢复。
3.观察alert文件
从日志中我们可以看到在instance recovery中,没有数据被恢复,只有成功完成的上次检查点之前数据可以被获取,之后数据都将丢失。
Wed Oct 19 20:38:38 2005Beginning crash recovery of 1 threadsWed Oct 19 20:38:38 2005Started first pass scanWed Oct 19 20:38:39 2005Completed first pass scan 0 redo blocks read, 0 data blocks need recoveryWed Oct 19 20:38:39 2005Started recovery at Thread 1: logseq 2, block 201, scn 0.897632464Recovery of Online Redo Log: Thread 1 Group 1 Seq 2 Reading mem 0 Mem# 0 errs 0: /opt/oracle/oradata/conner/redo01.logWed Oct 19 20:38:39 2005Completed redo applicationWed Oct 19 20:38:39 2005Ended recovery at Thread 1: logseq 2, block 201, scn 0.897652465 0 data blocks read, 0 data blocks written, 0 redo blocks readCrash recovery completed successfully
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。
新闻热点
疑难解答