注意:Oracle的隱含參數(shù)只應(yīng)該在測試環(huán)境或者在Oracle Support的支持下使用。
從Oracle的系統(tǒng)表中,我們知道Oracle存在一個(gè)隱含參數(shù)_disable_logging可以用于禁用日志生成,這個(gè)參數(shù)顯然只能用于測試目的(可以極大提高Benchmark測試的性能),禁止日志生成必然導(dǎo)致事務(wù)的不可恢復(fù)性,而且會導(dǎo)致日志文件損壞。
SQL> select ksppinm,ksppdesc from x$ksppi where ksppinm like '%logging';
KSPPINM KSPPDESC
-------------------- ------------------------------
_disable_logging Disable logging
因?yàn)樘厥獾男枰?,對這個(gè)參數(shù)進(jìn)行了一點(diǎn)簡單測試:
1.設(shè)置參數(shù)
[oracle@jumper bdump]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Oct 19 11:01:19 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> alter system set "_disable_logging"=true scope=both;
System altered.
2.事務(wù)測試
SQL> create table t as select * from dba_users;
Table created.
SQL> select count(*) from t;
COUNT(*)
----------
12
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 97588504 bytes
Fixed Size 451864 bytes
Variable Size 33554432 bytes
Database Buffers 62914560 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> select count(*) from t;
select count(*) from t
*
ERROR at line 1:
ORA-00942: table or view does not exist
由于未產(chǎn)生相應(yīng)日志,數(shù)據(jù)庫crash或shutdown abort之后,上一次成功完成的檢查點(diǎn)之后變化的數(shù)據(jù)將無法恢復(fù)。
3.觀察alert文件
從日志中我們可以看到在instance recovery中,沒有數(shù)據(jù)被恢復(fù),只有成功完成的上次檢查點(diǎn)之前數(shù)據(jù)可以被獲取,之后數(shù)據(jù)都將丟失。
Wed Oct 19 20:38:38 2005
Beginning crash recovery of 1 threads
Wed Oct 19 20:38:38 2005
Started first pass scan
Wed Oct 19 20:38:39 2005
Completed first pass scan
0 redo blocks read, 0 data blocks need recovery
Wed Oct 19 20:38:39 2005
Started recovery at
Thread 1: logseq 2, block 201, scn 0.897632464
Recovery of Online Redo Log: Thread 1 Group 1 Seq 2 Reading mem 0
Mem# 0 errs 0: /opt/oracle/oradata/conner/redo01.log
Wed Oct 19 20:38:39 2005
Completed redo application
Wed Oct 19 20:38:39 2005
Ended recovery at
Thread 1: logseq 2, block 201, scn 0.897652465
0 data blocks read, 0 data blocks written, 0 redo blocks read
Crash recovery completed successfully
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。
您可能感興趣的文章:- oracle初始化參數(shù)設(shè)置
- Oracle表的分類以及相關(guān)參數(shù)的詳解
- oracle初始化參數(shù)設(shè)置
- Oracle 多參數(shù)查詢語句