鄭 鎮健 (Jingun Jung)

1


0.9 : 2014/1/16, 新規作成

2


Append Hint






Affect Performance
Affect the Table Size
Affect Redo Generation 1, 2, 3

Website

3






Data is appended to the end of the table, rather
attempting to use existing free space within the
table.
Data is written directly to the data files, by
passing the buffer cache.
Referential integrity constraints are ignored.

4
As direct-path inserts append data to the end of
the table, they constantly increase the table high
water mark, even if there is lots of free space
within the table.

5
Table Mode

Insert Mode

ArchiveLog
Mode

Result

LOGGING

APPEND

Archive Log

Redo Generated

NOLOGGING

APPEND

Archive Log

No Redo

LOGGING

NO APPEND

Archive Log

Redo Generated

NOLOGGING

NO APPEND

Archive Log

Redo Generated

LOGGING

APPEND

No Archive Log

No Redo

NOLOGGING

APPEND

No Archive Log

No Redo

LOGGING

NO APPEND

No Archive Log

Redo Generated

NOLOGGING

NO APPEND

No Archive Log

Redo Generated

6
SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
No Archive Mode
Automatic archival
Disabled
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
7
Current log sequence
9
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------3077 recursive calls
8127 db block gets
64112 consistent gets
6 physical reads
6608264 redo size
830 bytes sent via SQL*Net to client
796 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1529 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
No Archive Mode
Automatic archival
Disabled
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
7
Current log sequence
9
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------849 recursive calls
1418 db block gets
60376 consistent gets
2 physical reads
51360 redo size
820 bytes sent via SQL*Net to client
810 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1491 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

7
SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Enabled
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
8
Next log sequence to archive
10
Current log sequence
10
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------3378 recursive calls
7930 db block gets
62636 consistent gets
318 physical reads
6594052 redo size
832 bytes sent via SQL*Net to client
796 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1553 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Enable
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
8
Next log sequence to archive
10
Current log sequence
10
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------1146 recursive calls
1417 db block gets
60536 consistent gets
71 physical reads
6656776 redo size
823 bytes sent via SQL*Net to client
810 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1494 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

8
SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Enabled
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
8
Next log sequence to archive 10
Current log sequence
10
SQL> ALTER TABLE t1 NOLOGGING;
Table altered.
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------1097 recursive calls
7969 db block gets
61504 consistent gets
3 physical reads
6595468 redo size
839 bytes sent via SQL*Net to client
796 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1499 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2;
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Enable
Archive destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence
8
Next log sequence to archive
10
Current log sequence
10
SQL> ALTER TABLE t1 NOLOGGING;
Table altered.
SQL> SET AUTOTRACE ON STATISTICS
SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects;
55671 rows created.
Statistics
---------------------------------------------------------845 recursive calls
1418 db block gets
60397 consistent gets
2 physical reads
51292 redo size
825 bytes sent via SQL*Net to client
810 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1491 sorts (memory)
0 sorts (disk)
55671 rows processed
SQL> COMMIT;
Commit complete.
SQL> DROP TABLE t1 PURGE;

9
English




http://www.oracle-base.com/articles/misc/append-hint.php
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869
http://docs.oracle.com/cd/B28359_01/server.111/b28310/archredo002.htm#i1006201

Korean



http://www.oracleclub.com/lecture/1974
http://develop.sunshiny.co.kr/763

Japanese


http://www.shift-the-oracle.com/inside/direct-pass-insert.html

10

Data Migration in Database

  • 1.
  • 2.
     0.9 : 2014/1/16,新規作成 2
  • 3.
     Append Hint     Affect Performance Affectthe Table Size Affect Redo Generation 1, 2, 3 Website 3
  • 4.
       Data is appendedto the end of the table, rather attempting to use existing free space within the table. Data is written directly to the data files, by passing the buffer cache. Referential integrity constraints are ignored. 4
  • 5.
    As direct-path insertsappend data to the end of the table, they constantly increase the table high water mark, even if there is lots of free space within the table. 5
  • 6.
    Table Mode Insert Mode ArchiveLog Mode Result LOGGING APPEND ArchiveLog Redo Generated NOLOGGING APPEND Archive Log No Redo LOGGING NO APPEND Archive Log Redo Generated NOLOGGING NO APPEND Archive Log Redo Generated LOGGING APPEND No Archive Log No Redo NOLOGGING APPEND No Archive Log No Redo LOGGING NO APPEND No Archive Log Redo Generated NOLOGGING NO APPEND No Archive Log Redo Generated 6
  • 7.
    SQL> CREATE TABLEt1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 7 Current log sequence 9 SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------3077 recursive calls 8127 db block gets 64112 consistent gets 6 physical reads 6608264 redo size 830 bytes sent via SQL*Net to client 796 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1529 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 7 Current log sequence 9 SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------849 recursive calls 1418 db block gets 60376 consistent gets 2 physical reads 51360 redo size 820 bytes sent via SQL*Net to client 810 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1491 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; 7
  • 8.
    SQL> CREATE TABLEt1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 8 Next log sequence to archive 10 Current log sequence 10 SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------3378 recursive calls 7930 db block gets 62636 consistent gets 318 physical reads 6594052 redo size 832 bytes sent via SQL*Net to client 796 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1553 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode Archive Mode Automatic archival Enable Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 8 Next log sequence to archive 10 Current log sequence 10 SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------1146 recursive calls 1417 db block gets 60536 consistent gets 71 physical reads 6656776 redo size 823 bytes sent via SQL*Net to client 810 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1494 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; 8
  • 9.
    SQL> CREATE TABLEt1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 8 Next log sequence to archive 10 Current log sequence 10 SQL> ALTER TABLE t1 NOLOGGING; Table altered. SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------1097 recursive calls 7969 db block gets 61504 consistent gets 3 physical reads 6595468 redo size 839 bytes sent via SQL*Net to client 796 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1499 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; SQL> CREATE TABLE t1 AS SELECT * FROM all_objects WHERE 1=2; SQL> archive log list; Database log mode Archive Mode Automatic archival Enable Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 8 Next log sequence to archive 10 Current log sequence 10 SQL> ALTER TABLE t1 NOLOGGING; Table altered. SQL> SET AUTOTRACE ON STATISTICS SQL> INSERT /*+ APPEND */ INTO t1 SELECT * FROM all_objects; 55671 rows created. Statistics ---------------------------------------------------------845 recursive calls 1418 db block gets 60397 consistent gets 2 physical reads 51292 redo size 825 bytes sent via SQL*Net to client 810 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1491 sorts (memory) 0 sorts (disk) 55671 rows processed SQL> COMMIT; Commit complete. SQL> DROP TABLE t1 PURGE; 9
  • 10.