05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9 ■ REDO AND UNDO 309<br />

data dictionary operations will be logged regardless of the logging mode. The amount of redo<br />

generated can be significantly less. For this example of the NOLOGGING clause, I ran the following<br />

in a database running in ARCHIVELOG mode:<br />

ops$tkyte@ORA10G> select log_mode from v$database;<br />

LOG_MODE<br />

------------<br />

ARCHIVELOG<br />

ops$tkyte@ORA10G> @mystat "redo size"<br />

ops$tkyte@ORA10G> set echo off<br />

NAME<br />

VALUE<br />

---------- ----------<br />

redo size 5846068<br />

ops$tkyte@ORA10G> create table t<br />

2 as<br />

3 select * from all_objects;<br />

Table created.<br />

ops$tkyte@ORA10G> @mystat2<br />

ops$tkyte@ORA10G> set echo off<br />

NAME<br />

V DIFF<br />

---------- ---------- ----------------<br />

redo size 11454472 5,608,404<br />

That CREATE TABLE generated about 5.5MB of redo information. We’ll drop <strong>and</strong> re-create<br />

the table, in NOLOGGING mode this time:<br />

ops$tkyte@ORA10G> drop table t;<br />

Table dropped.<br />

ops$tkyte@ORA10G> @mystat "redo size"<br />

ops$tkyte@ORA10G> set echo off<br />

NAME<br />

VALUE<br />

---------- ----------<br />

redo size 11459508<br />

ops$tkyte@ORA10G> create table t<br />

2 NOLOGGING<br />

3 as<br />

4 select * from all_objects;<br />

Table created.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!