time to commit : dbms_utility « System Packages « Oracle PL / SQL

Home
Oracle PL / SQL
1.Aggregate Functions
2.Analytical Functions
3.Char Functions
4.Constraints
5.Conversion Functions
6.Cursor
7.Data Type
8.Date Timezone
9.Hierarchical Query
10.Index
11.Insert Delete Update
12.Large Objects
13.Numeric Math Functions
14.Object Oriented Database
15.PL SQL
16.Regular Expressions
17.Report Column Page
18.Result Set
19.Select Query
20.Sequence
21.SQL Plus
22.Stored Procedure Function
23.Subquery
24.System Packages
25.System Tables Views
26.Table
27.Table Joins
28.Trigger
29.User Previliege
30.View
31.XML
Oracle PL / SQL » System Packages » dbms_utility 




time to commit
   
SQL>
SQL> set echo on
SQL>
SQL> create table t
  2  as
  3  select from all_objects;

Table created.

SQL>
SQL> insert into t select from t;

12210 rows created.

SQL> insert into t select from t;

24420 rows created.

SQL> insert into t select from where rownum < 12000;

11999 rows created.

SQL> insert into t select from t;

60839 rows created.

SQL> insert into t select from t;

121678 rows created.

SQL> insert into t select from t;

243356 rows created.

SQL> insert into t select from t;

486712 rows created.

SQL> commit;

Commit complete.

SQL>
SQL> create or replace procedure do_commitp_rows in number )
  2  as
  3      l_start        number;
  4      l_after_redo   number;
  5      l_before_redo  number;
  6  begin
  7      l_start := dbms_utility.get_time;
  8      insert into t select from where rownum < p_rows;
  9      dbms_output.put_linesql%rowcount || ' rows created' );
 10      dbms_output.put_line 'Time to INSERT' ||to_charround( (dbms_utility.get_time-l_start)/100)'999.99') || ' seconds' );
 11
 12      l_start := dbms_utility.get_time;
 13      commit;
 14      dbms_output.put_line'Time to COMMIT: ' ||to_charround( (dbms_utility.get_time-l_start)/100)'999.99') || ' seconds' );
 15
 16      dbms_output.put_line'Generated ' ||  to_char(l_after_redo-l_before_redo,'999,999,999,999') || ' bytes of redo' );
 17      dbms_output.new_line;
 18  end;
 19  /

Procedure created.

SQL> show error
No errors.
SQL>
SQL> set serveroutput on format wrapped
SQL> begin
  2      for i in .. 5
  3      loop
  4          do_commitpower(10,i) );
  5      end loop;
  6  end;
  7  /
rows created
Time to INSERT:     .06 seconds
Time to COMMIT:     .00 seconds
Generated  bytes of redo

99 rows created
Time to INSERT:     .00 seconds
Time to COMMIT:     .00 seconds
Generated  bytes of redo

999 rows created
Time to INSERT:     .02 seconds
Time to COMMIT:     .00 seconds
Generated  bytes of redo

9999 rows created
Time to INSERT:     .31 seconds
Time to COMMIT:     .00 seconds
Generated  bytes of redo

99999 rows created
Time to INSERT:     .80 seconds
Time to COMMIT:     .00 seconds
Generated  bytes of redo


PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> drop table t;

Table dropped.

SQL>
SQL> --

   
    
  














Related examples in the same category
1.This script demonstrates DBMS_UTILITY.NAME_TOKENIZE.
2.Use dbms_utility to time
3.dbms_utility.get_parameter_value
4.Call dbms_utility.get_time twice to time a statement in PL SQL
5.round dbms_utility.get_time
6.Assign dbms_utility.get_time to integer variable
7.Use dbms_utility.get_time to do performace check
8.dbms_utility.format_error_stack
9.Timing Per Thousand Records Processed (in secs)
10.Timing Package function call
11.use DBMS_UTILITY.FORMAT_ERROR_STACK in a SERVERERROR trigger.
12.DBMS_UTILITY.analyze_schema
13.demonstrates the use of DBMS_UTILITY.TABLE_TO_COMMA and DBMS_UTILITY.COMMA_TO_TABLE.
14.Performace difference between simple parameter and collection parameter
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.