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 321<br />

13 commit;<br />

14<br />

15 select v$mystat.value-l_start_redo<br />

16 into l_redo<br />

17 from v$mystat, v$statname<br />

18 where v$mystat.statistic# = v$statname.statistic#<br />

19 <strong>and</strong> v$statname.name = 'redo size';<br />

20<br />

21 dbms_output.put_line<br />

22 ( to_char(l_redo,'9,999,999') ||' bytes of redo generated for "' ||<br />

23 substr( replace( p_sql, chr(10), ' '), 1, 25 ) || '"...' );<br />

24 end;<br />

25 /<br />

Procedure created.<br />

Then, I ran equivalent INSERTs, UPDATEs, <strong>and</strong> DELETEs against the PERM <strong>and</strong> TEMP tables:<br />

ops$tkyte@ORA10G> set serveroutput on format wrapped<br />

ops$tkyte@ORA10G> begin<br />

2 do_sql( 'insert into perm<br />

3 select 1,1,1<br />

4 from all_objects<br />

5 where rownum

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

Saved successfully!

Ooh no, something went wrong!