ITPub博客

首页 > Linux操作系统 > Linux操作系统 > _disable_logging调整

_disable_logging调整

原创 Linux操作系统 作者:wzc_19821215 时间:2012-06-27 20:10:49 0 删除 编辑
提示: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


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22521389/viewspace-733975/,如需转载,请注明出处,否则将追究法律责任。

上一篇: rman恢复
请登录后发表评论 登录
全部评论
Boundls怎么丢了

注册时间:2012-06-04

  • 博文量
    57
  • 访问量
    136398