注意: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/197761.html">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
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。
新聞熱點
疑難解答