eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 隐含参数_disable_logging的几点说明 | Blog首页 | _disable_logging如何禁用日志 »

_disable_logging对于性能的影响

设置了_disable_logging参数,可以禁用日志的生成,从而提高某些测试的性能.

以下测试,纯属测试目的,其他内容请参考本站其他文章:

http://www.eygle.com/archives/2006/04/more_about_disable_logging.html

禁用日志情况下:

SQL> connect / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  286755168 bytes
Fixed Size                   731488 bytes
Variable Size             167772160 bytes
Database Buffers          117440512 bytes
Redo Buffers                 811008 bytes
Database mounted.
Database opened.
SQL> connect eygle/eygle
Connected.
SQL> show parameter disable

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_disable_logging                     boolean     TRUE

测试创建100万数据表:

SQL> create table test as select * from dba_objects where 1=0;

Table created.

SQL> set timing on
SQL> begin    
  2  for i in 1 .. 10000 loop
  3  insert into test select * from dba_objects where rownum < 101;
  4  commit;
  5  end loop;
  6  end;
  7  /

PL/SQL procedure successfully completed.

Elapsed: 00:00:40.46
SQL> truncate table test;

Table truncated.

Elapsed: 00:00:52.72

大约时间用了40秒.

再看正常日志生成下:

 

SQL> connect / as sysdba
Connected.
SQL> alter system set "_disable_logging"=false;

System altered.

Elapsed: 00:00:00.05
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  286755168 bytes
Fixed Size                   731488 bytes
Variable Size             167772160 bytes
Database Buffers          117440512 bytes
Redo Buffers                 811008 bytes
Database mounted.
Database opened.
SQL> show parameter disable

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_disable_logging                     boolean     FALSE

SQL> connect eygle/eygle
Connected.
SQL> set timing on
SQL>
SQL> begin    
  2    for i in 1 .. 10000 loop
  3   insert into test select * from dba_objects where rownum < 101;
  4  commit;
  5    end loop;
  6  end;
  7 /  

PL/SQL procedure successfully completed.

Elapsed: 00:01:54.04
SQL>
SQL> truncate table test;

Table truncated.

Elapsed: 00:01:01.56

此时大约用时1分54秒.

两者差距为: 114 / 40 = 2.85 倍.

我们可以看出两者的差距是显著的.不作过多测试了,就此打住.大家有兴趣的可以自己测试一下.

 以上测试的环境为:

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE    9.2.0.3.0       Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production

 


历史上的今天...
    >> 2008-04-14文章:
    >> 2007-04-14文章:
    >> 2005-04-14文章:

无觅

By eygle on 2006-04-14 16:57 | Comments (2) | Internal | 743 |

2 Comments

请教大师,隐藏参数_disable_logging通过show parameter 也能显示出来,我的咋不行呢?

环境:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

因为你没有设置这个参数,设置之后在参数文件中存在才能show出来。

建议你不要乱试,看过了就算了吧:)


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com