程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> 關於Oracle數據庫 >> 詳解Oracle中的隱含參數_disable_logging

詳解Oracle中的隱含參數_disable_logging

編輯:關於Oracle數據庫

注意: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 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

由於未產生相應日志,數據庫crash或shutdown abort之後,上一次成功完成的檢查點之後變化的數據將無法恢復。

3.觀察alert文件

從日志中我們可以看到在instance recovery中,沒有數據被恢復,只有成功完成的上次檢查點之前數據可以被獲取,之後數據都將丟失。

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

總結

以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved