詳解Oracle中的隱含參數(shù)_disable_logging
注意:Oracle的隱含參數(shù)只應該在測試環(huán)境或者在Oracle Support的支持下使用。
從Oracle的系統(tǒng)表中,我們知道Oracle存在一個隱含參數(shù)_disable_logging可以用于禁用日志生成,這個參數(shù)顯然只能用于測試目的(可以極大提高Benchmark測試的性能),禁止日志生成必然導致事務的不可恢復性,而且會導致日志文件損壞。
SQL> select ksppinm,ksppdesc from x$ksppi where ksppinm like '%logging'; KSPPINM KSPPDESC -------------------- ------------------------------ _disable_logging Disable logging
因為特殊的需要,對這個參數(shù)進行了一點簡單測試:
1.設置參數(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.事務測試
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)生相應日志,數(shù)據(jù)庫crash或shutdown abort之后,上一次成功完成的檢查點之后變化的數(shù)據(jù)將無法恢復。
3.觀察alert文件
從日志中我們可以看到在instance recovery中,沒有數(shù)據(jù)被恢復,只有成功完成的上次檢查點之前數(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)容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。
相關文章
解決maven不能下載oracle jdbc驅(qū)動的問題
這篇文章主要介紹了解決maven不能下載oracle jdbc驅(qū)動的問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-04-04
Oracle In和exists not in和not exists的比較分析
一個是問in exist的區(qū)別,一個是not in和not exists的區(qū)別2009-08-08
Ubuntu?22.04或20.04安裝Oracle?SQL?Developer的圖文教程
Oracle?SQL?Developer?是一個免費平臺,為開發(fā)人員提供用于開發(fā)和管理?Oracle?數(shù)據(jù)庫的集成開發(fā)環(huán)境,這篇文章主要介紹了Ubuntu?22.04或20.04安裝Oracle?SQL?Developer圖文教程,需要的朋友可以參考下2024-08-08
Oracle查詢最近幾天每小時歸檔日志產(chǎn)生數(shù)量的腳本寫法
這篇文章主要介紹了Oracle查詢最近幾天每小時歸檔日志產(chǎn)生數(shù)量的腳本寫法,需要的朋友可以參考下2017-07-07
調(diào)整Oracle數(shù)據(jù)庫的UNDO_RETENTION參數(shù)的方法
本文介紹了如何調(diào)整Oracle數(shù)據(jù)庫的UNDO_RETENTION參數(shù),包括查看當前值、動態(tài)和靜態(tài)調(diào)整方法,以及注意事項,感興趣的朋友一起看看吧2025-03-03

