| 導購 | 订阅 | 在线投稿
分享
 
 
 

_disable_logging對于非歸檔數據庫的影響

來源:互聯網網民  2006-04-20 05:58:30  評論

1. _disable_logging對于非歸檔數據庫的影響

首先確定數據庫當前是非歸檔模式:

lunar@TSMISC01> archive log list

Database log mode No Archive Mode

Automatic archival Enabled

Archive destination /oracle/oradata/TSMISC01/archive

Oldest online log sequence 0 之前被刪除或者被初始化過

Current log sequence 158

lunar@TSMISC01>

查看online redo log 的相關信息:

lunar@TSMISC01> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 0 2097152 2 YES UNUSED 0

2 1 158 104857600 2 NO CURRENT 49355946 12-APR-06

3 1 157 104857600 1 NO INACTIVE 49355943 12-APR-06

Elapsed: 00:00:00.00

lunar@TSMISC01> select * from v$logfile;

GROUP# STATUS TYPE MEMBER

---------- ------- ------- --------------------------------------------------

1 ONLINE /oracle/oradata/TSMISC01/redo11.log

2 ONLINE /oracle/oradata/TSMISC01/redo02.log

3 ONLINE /oracle/oradata/TSMISC01/redo03.log

2 ONLINE /oracle/oradata/TSMISC01/redo02_2.log

1 ONLINE /oracle/oradata/TSMISC01/redo12.log

Elapsed: 00:00:00.00

lunar@TSMISC01>

從這些信息我們看到,group 1 是新建的組,因此其sequence#是0,而status是 unused。還可以看到,group 2是當前數據庫正在使用的online redo logfile。

現在,檢查數據庫中_disable_logging參數的設置:

lunar@TSMISC01> @get_param

Enter value for par: disable_logging

old 14: x.ksppinm like '%_&par%'

new 14: x.ksppinm like '%_disable_logging%'

NAME VALUE ISDEFAULT ISMOD ISADJ

----------------------------------- ------------------------- --------- ---------- -----

_disable_logging FALSE FALSE FALSE FALSE

Elapsed: 00:00:00.00

lunar@TSMISC01>

可見,目前_disable_logging爲false。

我們可以使用alter system 命令修改這個參數,並且可以使用scope=memory(僅在當前的系統中生效)或者scope=both(在當前的系統和spfile中都做相應的設置)來指定,讓這個參數立刻生效:

lunar@TSMISC01> alter system set "_disable_logging"=true scope=memory;

System altered.

Elapsed: 00:00:00.02

lunar@TSMISC01> show parameter disable_logging

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

_disable_logging boolean TRUE

lunar@TSMISC01>

現在我們來作個測試表,創建一個大表,並向其中插入10000000 條記錄,然後看看系統是否發生了日志切換,還是會發生其他什麽異常情況:

lunar@TSMISC01> @big_table 10000000

Table dropped.

Elapsed: 00:00:01.33

Table created.

Elapsed: 00:00:00.13

Table altered.

Elapsed: 00:00:00.02

old 3: l_rows number := &1;

new 3: l_rows number := 10000000;

old 9: where rownum <= &1;

new 9: where rownum <= 10000000;

PL/SQL procedure successfully completed.

Elapsed: 00:01:29.89

Table altered.

Elapsed: 00:01:33.17

PL/SQL procedure successfully completed.

Elapsed: 00:03:12.77

COUNT(*)

----------

10000000

Elapsed: 00:00:02.05

lunar@TSMISC01>

現在看看日志文件的情況:

lunar@TSMISC01> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 162 2097152 2 NO INACTIVE 49413664 12-APR-06

2 1 161 104857600 2 NO INACTIVE 49374533 12-APR-06

3 1 163 104857600 1 NO CURRENT 49414128 12-APR-06

Elapsed: 00:00:00.19

lunar@TSMISC01> select * from v$logfile;

GROUP# STATUS TYPE MEMBER

---------- ------- ------- --------------------------------------------------

1 ONLINE /oracle/oradata/TSMISC01/redo11.log

2 ONLINE /oracle/oradata/TSMISC01/redo02.log

3 ONLINE /oracle/oradata/TSMISC01/redo03.log

2 ONLINE /oracle/oradata/TSMISC01/redo02_2.log

1 ONLINE /oracle/oradata/TSMISC01/redo12.log

Elapsed: 00:00:00.04

lunar@TSMISC01>

我們看到日志已經發生了切換,數據庫可以繼續操作,創建大表前數據庫的“當前日志是group 2”,在創建了一些大表後,當前日志已經是group 3了,且alert.log中沒有任何報錯信息,也沒有什麽異常的信息。因此,我們可以有下面的結論:在非歸檔模式的數據庫下,不論_disable_logging是false還是true,數據庫都可以繼續操作,而不受該參數的影響。

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
1. _disable_logging對于非歸檔數據庫的影響 首先確定數據庫當前是非歸檔模式: lunar@TSMISC01> archive log list Database log mode No Archive Mode Automatic archival Enabled Archive destination /oracle/oradata/TSMISC01/archive Oldest online log sequence 0 之前被刪除或者被初始化過 Current log sequence 158 lunar@TSMISC01> 查看online redo log 的相關信息: lunar@TSMISC01> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- 1 1 0 2097152 2 YES UNUSED 0 2 1 158 104857600 2 NO CURRENT 49355946 12-APR-06 3 1 157 104857600 1 NO INACTIVE 49355943 12-APR-06 Elapsed: 00:00:00.00 lunar@TSMISC01> select * from v$logfile; GROUP# STATUS TYPE MEMBER ---------- ------- ------- -------------------------------------------------- 1 ONLINE /oracle/oradata/TSMISC01/redo11.log 2 ONLINE /oracle/oradata/TSMISC01/redo02.log 3 ONLINE /oracle/oradata/TSMISC01/redo03.log 2 ONLINE /oracle/oradata/TSMISC01/redo02_2.log 1 ONLINE /oracle/oradata/TSMISC01/redo12.log Elapsed: 00:00:00.00 lunar@TSMISC01> 從這些信息我們看到,group 1 是新建的組,因此其sequence#是0,而status是 unused。還可以看到,group 2是當前數據庫正在使用的online redo logfile。 現在,檢查數據庫中_disable_logging參數的設置: lunar@TSMISC01> @get_param Enter value for par: disable_logging old 14: x.ksppinm like '%_&par%' new 14: x.ksppinm like '%_disable_logging%' NAME VALUE ISDEFAULT ISMOD ISADJ ----------------------------------- ------------------------- --------- ---------- ----- _disable_logging FALSE FALSE FALSE FALSE Elapsed: 00:00:00.00 lunar@TSMISC01> 可見,目前_disable_logging爲false。 我們可以使用alter system 命令修改這個參數,並且可以使用scope=memory(僅在當前的系統中生效)或者scope=both(在當前的系統和spfile中都做相應的設置)來指定,讓這個參數立刻生效: lunar@TSMISC01> alter system set "_disable_logging"=true scope=memory; System altered. Elapsed: 00:00:00.02 lunar@TSMISC01> show parameter disable_logging NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _disable_logging boolean TRUE lunar@TSMISC01> 現在我們來作個測試表,創建一個大表,並向其中插入10000000 條記錄,然後看看系統是否發生了日志切換,還是會發生其他什麽異常情況: lunar@TSMISC01> @big_table 10000000 Table dropped. Elapsed: 00:00:01.33 Table created. Elapsed: 00:00:00.13 Table altered. Elapsed: 00:00:00.02 old 3: l_rows number := &1; new 3: l_rows number := 10000000; old 9: where rownum <= &1; new 9: where rownum <= 10000000; PL/SQL procedure successfully completed. Elapsed: 00:01:29.89 Table altered. Elapsed: 00:01:33.17 PL/SQL procedure successfully completed. Elapsed: 00:03:12.77 COUNT(*) ---------- 10000000 Elapsed: 00:00:02.05 lunar@TSMISC01> 現在看看日志文件的情況: lunar@TSMISC01> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- 1 1 162 2097152 2 NO INACTIVE 49413664 12-APR-06 2 1 161 104857600 2 NO INACTIVE 49374533 12-APR-06 3 1 163 104857600 1 NO CURRENT 49414128 12-APR-06 Elapsed: 00:00:00.19 lunar@TSMISC01> select * from v$logfile; GROUP# STATUS TYPE MEMBER ---------- ------- ------- -------------------------------------------------- 1 ONLINE /oracle/oradata/TSMISC01/redo11.log 2 ONLINE /oracle/oradata/TSMISC01/redo02.log 3 ONLINE /oracle/oradata/TSMISC01/redo03.log 2 ONLINE /oracle/oradata/TSMISC01/redo02_2.log 1 ONLINE /oracle/oradata/TSMISC01/redo12.log Elapsed: 00:00:00.04 lunar@TSMISC01> 我們看到日志已經發生了切換,數據庫可以繼續操作,創建大表前數據庫的“當前日志是group 2”,在創建了一些大表後,當前日志已經是group 3了,且alert.log中沒有任何報錯信息,也沒有什麽異常的信息。因此,我們可以有下面的結論:在非歸檔模式的數據庫下,不論_disable_logging是false還是true,數據庫都可以繼續操作,而不受該參數的影響。
󰈣󰈤
王朝萬家燈火計劃
期待原創作者加盟
 
 
 
>>返回首頁<<
 
 
 
 
 
 熱帖排行
 
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有