In our actual work, in non-archive mode (Note: The Archive mode will cause log corruption), use _ disable_logging to disable log generation, under this condition, the performance of some special operations (such as batch loading or Benchmark Testing) can be greatly improved.
Example of completion prohibition:
First, we need to start two sessions, one for management and the other for testing.
1. Session 1: Use the Sys user to connect to the database. Currently, _ disable_logging is not set and the database is in normal state.
$ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.4.0 - Production on Fri Apr 14 09:30:42 2006 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning option JServer Release 9.2.0.4.0 - Production SQL> col member for a40 SQL> select * from v$logfile; GROUP# STATUS TYPE MEMBER ---------- ------- ------- 1 ONLINE /opt/oracle9/oradata/testora9/redo01.log 2 ONLINE /opt/oracle9/oradata/testora9/redo02.log 3 ONLINE /opt/oracle9/oradata/testora9/redo03.log SQL> alter system switch logfile; System altered. SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM ---------- ---------- ---------- ---------- 1 1 148 104857600 1 NO CURRENT 262708457 14-APR-06 2 1 146 104857600 1 NO INACTIVE 262662667 14-APR-06 3 1 147 104857600 1 NO ACTIVE 262675537 14-APR-06
|
2. Session 2 is connected through the Scott user and the following update is executed:
SQL> connect scott/tiger Connected. SQL> update emp set sal=3000 where empno=7788; 1 row updated. SQL> commit; Commit complete.
|
3. Dump redo logs in the session
SQL> ALTER SYSTEM DUMP LOGFILE ' /opt/oracle9/oradata/testora9/redo01.log'; System altered.
|
4. Observe the trace file and record the redo information in normal state.
The TRC file is too large to be pasted.
5. Disable log generation and switch logs
SQL> alter system set "_disable_logging"=true; System altered. SQL> alter system switch logfile; System altered. SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM ---------- ---------- ---------- --------- 1 1 148 104857600 1 NO ACTIVE 262708457 14-APR-06 2 1 149 104857600 1 NO CURRENT 262708606 14-APR-06 3 1 147 104857600 1 NO INACTIVE 262675537 14-APR-06
|
6. Update Scott again.
SQL> show parameter disable NAME TYPE VALUE ------------------------------------ _disable_logging boolean TRUE SQL> update emp set sal=4000 where empno=7788; 1 row updated. SQL> commit; Commit complete.
|
7. Dump logs
SQL> ALTER SYSTEM DUMP LOGFILE ' /opt/oracle9/oradata/testora9/redo02.log'; System altered.
|
8. Record the redo information at this time
DUMP OF REDO FROM FILE '/opt/oracle9/oradata/testora9/redo02.log' Opcodes *.* DBA's: (file # 0, block # 0) thru (file # 65534, block # 4194303) RBA's: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff SCN's scn: 0x0000.00000000 thru scn: 0xffff.ffffffff Times: creation thru eternity FILE HEADER: Software vsn=153092096=0x9200000, Compatibility Vsn=153092096=0x9200000 Db ID=1628068176=0x610a5950, Db Name='TESTORA9' Activation ID=1628067152=0x610a5550 Control Seq=1163=0x48b, File size=204800=0x32000 File Number=2, Blksiz=512, File Type=2 LOG descrip:"Thread 0001, Seq# 0000000149, SCN 0x00000fa89d7e-0xffffffffffff" thread: 1 nab: 0xffffffff seq: 0x00000095 hws: 0x1 eot: 1 dis: 0 reset logs count: 0x1f435110 scn: 0x0000.00000001 Low scn: 0x0000.0fa89d7e 04/14/2006 09:33:43 Next scn: 0xffff.ffffffff 01/01/1988 00:00:00 Enabled scn: 0x0000.00000001 04/26/2004 15:56:10 Thread closed scn: 0x0000.0fa89d7e 04/14/2006 09:33:43 Log format vsn: 0x8000000 Disk cksum: 0xcac7 Calc cksum: 0xcac7 Terminal Recovery Stamp scn: 0x0000.00000000 01/01/1988 00:00:00 Most recent redo scn: 0x0000.00000000 Largest LWN: 0 blocks End-of-redo stream : No Unprotected mode Miscellaneous flags: 0x0 END OF REDO DUMP
|
No redo is generated. Currently, the database only records a small amount of necessary information.