Oracle DUL初步使用

init.dul


osd_big_endian_flag=false                        ==》该参数用来指定 endian
osd_dba_file_bits=10
osd_c_struct_alignment=32
osd_file_leader_size=1
osd_word_size=32


dc_columns=200000
dc_tables=10000
dc_objects=10000000

DC_USERS=40000
dc_segments=100000



control_file=control.dul



db_block_size=8192


compatible=10

LDR_ENCLOSE_CHAR = |                      ==>指定了 后面导出表的ENCLOSE 的符号
LDR_PHYS_REC_SIZE = 81
~                            


control.dul 通过下面的脚本获得


    sqlplus /nolog
    connect / as sysdba
    startup mount
    set trimspool on pagesize 0 linesize 256 feedback off
    column name format a200
    spool control.dul
    select ts#, rfile#, name from v$datafile;
    exit

例如

         0          1 /s01/oradata/G10R25/datafile/o1_mf_system_8nx5srds_.dbf
         1          2 /s01/oradata/G10R25/datafile/o1_mf_undotbs1_8nx5srg3_.dbf
         2          3 /s01/oradata/G10R25/datafile/o1_mf_sysaux_8nx5srdx_.dbf
         4          4 /s01/oradata/G10R25/datafile/o1_mf_users_8nx5srgb_.dbf
         6          5 /s01/oradata/G10R25/datafile/o1_mf_example_8nx5tqoy_.dbf
         7          6 /s01/oradata/G10R25/datafile/o1_mf_tbs5_8nx7pwqp_.dbf
         8          7 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5bdph_.dbf
         8          8 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5c081_.dbf
         8          9 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5cto7_.dbf
         8         10 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5ctpx_.dbf
         8         11 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5ctss_.dbf
         8         12 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5ctvl_.dbf
         8         13 /s01/oradata/G10R25/datafile/o1_mf_mac_tb1_8ot5ctwz_.dbf


[oracle@vrh8 dul_dir]$ ./dul 

Data UnLoader: 10.2.0.5.22 - Internal Only - on Sat Jul 20 07:54:48 2013
with 64-bit io functions

Copyright (c) 1994 2013 Bernard van Duijnen All rights reserved.

 Strictly Oracle Internal Use Only


DUL: Warning: Recreating file "dul.log"
Found db_id = 2696593743
Found db_name = G10R25


Found db_name = G10R25
DUL> bootstrap
  2  ;
Probing file = 1, block = 377
. unloading table                BOOTSTRAP$
DUL: Warning: block number is non zero but marked deferred trying to process it anyhow
      57 rows unloaded
DUL: Warning: Dictionary cache DC_BOOTSTRAP is empty
Reading BOOTSTRAP.dat 57 entries loaded
Parsing Bootstrap$ contents
Generating dict.ddl for version 10
 OBJ$: segobjno 18, file 1 block 121
 TAB$: segobjno 2, tabno 1, file 1  block 25
 COL$: segobjno 2, tabno 5, file 1  block 25
 USER$: segobjno 10, tabno 1, file 1  block 89
Running generated file "@dict.ddl" to unload the dictionary tables
. unloading table                      OBJ$   78608 rows unloaded
. unloading table                      TAB$    1672 rows unloaded
. unloading table                      COL$   57314 rows unloaded
. unloading table                     USER$      67 rows unloaded
Reading USER.dat 67 entries loaded
Reading OBJ.dat 78608 entries loaded and sorted 78608 entries
Reading TAB.dat 1672 entries loaded
Reading COL.dat 57314 entries loaded and sorted 57314 entries
Reading BOOTSTRAP.dat 57 entries loaded

DUL: Warning: Recreating file "dict.ddl"
Generating dict.ddl for version 10
 OBJ$: segobjno 18, file 1 block 121
 TAB$: segobjno 2, tabno 1, file 1  block 25
 COL$: segobjno 2, tabno 5, file 1  block 25
 USER$: segobjno 10, tabno 1, file 1  block 89
 TABPART$: segobjno 266, file 1 block 2121
 INDPART$: segobjno 271, file 1 block 2161
 TABCOMPART$: segobjno 288, file 1 block 2297
 INDCOMPART$: segobjno 293, file 1 block 2345
 TABSUBPART$: segobjno 278, file 1 block 2217
 INDSUBPART$: segobjno 283, file 1 block 2257
 IND$: segobjno 2, tabno 3, file 1  block 25
 ICOL$: segobjno 2, tabno 4, file 1  block 25
 LOB$: segobjno 2, tabno 6, file 1  block 25
 COLTYPE$: segobjno 2, tabno 7, file 1  block 25
 TYPE$: segobjno 181, tabno 1, file 1  block 1297
 COLLECTION$: segobjno 181, tabno 2, file 1  block 1297
 ATTRIBUTE$: segobjno 181, tabno 3, file 1  block 1297
 LOBFRAG$: segobjno 299, file 1 block 2393
 LOBCOMPPART$: segobjno 302, file 1 block 2425
 UNDO$: segobjno 15, file 1 block 105
 TS$: segobjno 6, tabno 2, file 1  block 57
 PROPS$: segobjno 96, file 1 block 721
Running generated file "@dict.ddl" to unload the dictionary tables
. unloading table                      OBJ$
DUL: Warning: Recreating file "OBJ.ctl"
   78608 rows unloaded
. unloading table                      TAB$
DUL: Warning: Recreating file "TAB.ctl"
    1672 rows unloaded
. unloading table                      COL$
DUL: Warning: Recreating file "COL.ctl"
   57314 rows unloaded
. unloading table                     USER$
DUL: Warning: Recreating file "USER.ctl"
      67 rows unloaded
. unloading table                  TABPART$     291 rows unloaded
. unloading table                  INDPART$     413 rows unloaded
. unloading table               TABCOMPART$      12 rows unloaded
. unloading table               INDCOMPART$      60 rows unloaded
. unloading table               TABSUBPART$    4392 rows unloaded
. unloading table               INDSUBPART$   21960 rows unloaded
. unloading table                      IND$    2399 rows unloaded
. unloading table                     ICOL$    3847 rows unloaded
. unloading table                      LOB$     577 rows unloaded
. unloading table                  COLTYPE$    1795 rows unloaded
. unloading table                     TYPE$    1990 rows unloaded
. unloading table               COLLECTION$     568 rows unloaded
. unloading table                ATTRIBUTE$    7414 rows unloaded
. unloading table                  LOBFRAG$       1 row  unloaded
. unloading table              LOBCOMPPART$       0 rows unloaded
. unloading table                     UNDO$      21 rows unloaded
. unloading table                       TS$      13 rows unloaded
. unloading table                    PROPS$      29 rows unloaded
Reading USER.dat 67 entries loaded
Reading OBJ.dat 78608 entries loaded and sorted 78608 entries
Reading TAB.dat 1672 entries loaded
Reading COL.dat 57314 entries loaded and sorted 57314 entries
Reading TABPART.dat 291 entries loaded and sorted 291 entries
Reading TABCOMPART.dat 12 entries loaded and sorted 12 entries
Reading TABSUBPART.dat 4392 entries loaded and sorted 4392 entries
Reading INDPART.dat 413 entries loaded and sorted 413 entries
Reading INDCOMPART.dat 60 entries loaded and sorted 60 entries
Reading INDSUBPART.dat 21960 entries loaded and sorted 21960 entries
Reading IND.dat 2399 entries loaded
Reading LOB.dat 577 entries loaded
Reading ICOL.dat 3847 entries loaded
Reading COLTYPE.dat 1795 entries loaded
Reading TYPE.dat 1990 entries loaded
Reading ATTRIBUTE.dat 7414 entries loaded
Reading COLLECTION.dat 568 entries loaded
Reading BOOTSTRAP.dat 57 entries loaded
Reading LOBFRAG.dat 1 entries loaded and sorted 1 entries
Reading LOBCOMPPART.dat 0 entries loaded and sorted 0 entries
Reading UNDO.dat 21 entries loaded
Reading TS.dat 13 entries loaded
Reading PROPS.dat 29 entries loaded
Database character set is AL32UTF8
Database national character set is AL16UTF16


PROPS.dat==> props$里存放了字符集属性




  2  [oracle@vrh8 dul_dir]$ ls -ltr
total 12060
-rwxr-xr-x 1 oracle oinstall 1098504 Jul 20 07:53 dul
-rw-r--r-- 1 oracle oinstall     318 Jul 20 07:53 init.dul
-rw-r--r-- 1 oracle oinstall    1021 Jul 20 07:54 control.dul
-rw-r--r-- 1 oracle oinstall    1185 Jul 20 07:54 USER.dat
-rw-r--r-- 1 oracle oinstall     252 Jul 20 07:54 USER.ctl
-rw-r--r-- 1 oracle oinstall     717 Jul 20 07:54 UNDO.dat
-rw-r--r-- 1 oracle oinstall     532 Jul 20 07:54 UNDO.ctl
-rw-r--r-- 1 oracle oinstall  159360 Jul 20 07:54 TYPE.dat
-rw-r--r-- 1 oracle oinstall     392 Jul 20 07:54 TYPE.ctl
-rw-r--r-- 1 oracle oinstall     269 Jul 20 07:54 TS.dat
-rw-r--r-- 1 oracle oinstall     318 Jul 20 07:54 TS.ctl
-rw-r--r-- 1 oracle oinstall  226175 Jul 20 07:54 TABSUBPART.dat
-rw-r--r-- 1 oracle oinstall     684 Jul 20 07:54 TABSUBPART.ctl
-rw-r--r-- 1 oracle oinstall   14577 Jul 20 07:54 TABPART.dat
-rw-r--r-- 1 oracle oinstall     678 Jul 20 07:54 TABPART.ctl
-rw-r--r-- 1 oracle oinstall   97023 Jul 20 07:54 TAB.dat
-rw-r--r-- 1 oracle oinstall     880 Jul 20 07:54 TAB.ctl
-rw-r--r-- 1 oracle oinstall     255 Jul 20 07:54 TABCOMPART.dat
-rw-r--r-- 1 oracle oinstall     334 Jul 20 07:54 TABCOMPART.ctl
-rw-r--r-- 1 oracle oinstall     907 Jul 20 07:54 PROPS.dat
-rw-r--r-- 1 oracle oinstall     254 Jul 20 07:54 PROPS.ctl
-rw-r--r-- 1 oracle oinstall 4519576 Jul 20 07:54 OBJ.dat
-rw-r--r-- 1 oracle oinstall     600 Jul 20 07:54 OBJ.ctl
-rw-r--r-- 1 oracle oinstall      38 Jul 20 07:54 LOBFRAG.dat
-rw-r--r-- 1 oracle oinstall     608 Jul 20 07:54 LOBFRAG.ctl
-rw-r--r-- 1 oracle oinstall   32487 Jul 20 07:54 LOB.dat
-rw-r--r-- 1 oracle oinstall     810 Jul 20 07:54 LOB.ctl
-rw-r--r-- 1 oracle oinstall       0 Jul 20 07:54 LOBCOMPPART.dat
-rw-r--r-- 1 oracle oinstall     336 Jul 20 07:54 LOBCOMPPART.ctl
-rw-r--r-- 1 oracle oinstall 1149629 Jul 20 07:54 INDSUBPART.dat
-rw-r--r-- 1 oracle oinstall     684 Jul 20 07:54 INDSUBPART.ctl
-rw-r--r-- 1 oracle oinstall   20616 Jul 20 07:54 INDPART.dat
-rw-r--r-- 1 oracle oinstall     678 Jul 20 07:54 INDPART.ctl
-rw-r--r-- 1 oracle oinstall  135890 Jul 20 07:54 IND.dat
-rw-r--r-- 1 oracle oinstall     810 Jul 20 07:54 IND.ctl
-rw-r--r-- 1 oracle oinstall    1275 Jul 20 07:54 INDCOMPART.dat
-rw-r--r-- 1 oracle oinstall     334 Jul 20 07:54 INDCOMPART.ctl
-rw-r--r-- 1 oracle oinstall   86622 Jul 20 07:54 ICOL.dat
-rw-r--r-- 1 oracle oinstall     392 Jul 20 07:54 ICOL.ctl
-rw-r--r-- 1 oracle oinstall    6400 Jul 20 07:54 dict.ddl
-rw-r--r-- 1 oracle oinstall  114017 Jul 20 07:54 COLTYPE.dat
-rw-r--r-- 1 oracle oinstall     608 Jul 20 07:54 COLTYPE.ctl
-rw-r--r-- 1 oracle oinstall   72235 Jul 20 07:54 COLLECTION.dat
-rw-r--r-- 1 oracle oinstall     754 Jul 20 07:54 COLLECTION.ctl
-rw-r--r-- 1 oracle oinstall 3579150 Jul 20 07:54 COL.dat
-rw-r--r-- 1 oracle oinstall     950 Jul 20 07:54 COL.ctl
-rw-r--r-- 1 oracle oinstall   18145 Jul 20 07:54 BOOTSTRAP.dat
-rw-r--r-- 1 oracle oinstall     332 Jul 20 07:54 BOOTSTRAP.ctl
-rw-r--r-- 1 oracle oinstall  779009 Jul 20 07:54 ATTRIBUTE.dat
-rw-r--r-- 1 oracle oinstall     752 Jul 20 07:54 ATTRIBUTE.ctl
-rw-r--r-- 1 oracle oinstall   16018 Jul 20 07:56 dul.log



[oracle@vrh8 dul_dir]$ vi dict.ddl

REM DDL Script to unload the dictionary cache for DUL

REM force the settings to get the expected DUL self readable format
alter session set profile DUL_READABLE_FORMAT;

unload table OBJ$( OBJ# number, DATAOBJ# number, OWNER# number,
    NAME clean varchar2(30), NAMESPACE ignore, SUBNAME varchar2(30),
    TYPE# number, CTIME ignore, MTIME ignore, STIME ignore,
    STATUS ignore, REMOTEOWNER ignore, LINKNAME ignore,
    FLAGS ignore, OID$ hexraw)
    storage ( tablespace 0 segobjno 18 file 1 block 121);

unload table TAB$( OBJ# number, DATAOBJ# number,
    TS# number, FILE# number, BLOCK# number,
    BOBJ# number, TAB# number, COLS number, CLUCOLS number,
    PCTFREE$ ignore, PCTUSED$ ignore, INITRANS ignore, MAXTRANS ignore,
    FLAGS ignore, AUDIT$ ignore, ROWCNT ignore, BLKCNT ignore,
    EMPCNT ignore, AVGSPC ignore, CHNCNT ignore, AVGRLN ignore,
    AVGSPC_FLB ignore, FLBCNT ignore,
    ANALYZETIME ignore, SAMPLESIZE ignore,
    DEGREE ignore, INSTANCES ignore,
    INTCOLS ignore, KERNELCOLS number, PROPERTY number)
    cluster  C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 1 file 1 block 25);

unload table COL$ ( OBJ# number, COL# number , SEGCOL# number,
    SEGCOLLENGTH ignore, OFFSET ignore, NAME char(30),
    TYPE# number, LENGTH number, FIXEDSTORAGE ignore,
    PRECISION# number, SCALE number, NULL$ ignore, DEFLENGTH ignore,
    DEFAULT$ ignore, INTCOL# number, PROPERTY number,
    CHARSETID number, CHARSETFORM number)
    cluster C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 5 file 1 block 25);

[oracle@vrh8 dul_dir]$ 
[oracle@vrh8 dul_dir]$ cat dict.ddl
REM DDL Script to unload the dictionary cache for DUL

REM force the settings to get the expected DUL self readable format
alter session set profile DUL_READABLE_FORMAT;

unload table OBJ$( OBJ# number, DATAOBJ# number, OWNER# number,
    NAME clean varchar2(30), NAMESPACE ignore, SUBNAME varchar2(30),
    TYPE# number, CTIME ignore, MTIME ignore, STIME ignore,
    STATUS ignore, REMOTEOWNER ignore, LINKNAME ignore,
    FLAGS ignore, OID$ hexraw)
    storage ( tablespace 0 segobjno 18 file 1 block 121);

unload table TAB$( OBJ# number, DATAOBJ# number,
    TS# number, FILE# number, BLOCK# number,
    BOBJ# number, TAB# number, COLS number, CLUCOLS number,
    PCTFREE$ ignore, PCTUSED$ ignore, INITRANS ignore, MAXTRANS ignore,
    FLAGS ignore, AUDIT$ ignore, ROWCNT ignore, BLKCNT ignore,
    EMPCNT ignore, AVGSPC ignore, CHNCNT ignore, AVGRLN ignore,
    AVGSPC_FLB ignore, FLBCNT ignore,
    ANALYZETIME ignore, SAMPLESIZE ignore,
    DEGREE ignore, INSTANCES ignore,
    INTCOLS ignore, KERNELCOLS number, PROPERTY number)
    cluster  C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 1 file 1 block 25);

unload table COL$ ( OBJ# number, COL# number , SEGCOL# number,
    SEGCOLLENGTH ignore, OFFSET ignore, NAME char(30),
    TYPE# number, LENGTH number, FIXEDSTORAGE ignore,
    PRECISION# number, SCALE number, NULL$ ignore, DEFLENGTH ignore,
    DEFAULT$ ignore, INTCOL# number, PROPERTY number,
    CHARSETID number, CHARSETFORM number)
    cluster C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 5 file 1 block 25);

unload table USER$( USER# number, NAME varchar2(30))
    cluster C_USER#(USER#)
    storage ( tablespace 0 segobjno 10 tabno 1 file 1 block 89);

unload table TABPART$( OBJ# number, DATAOBJ# number, BO# number,
    PART# number, HIBOUNDLEN ignore, SPARE3 ignore,
    TS# number, FILE# number, BLOCK# number,
    PCTFREE$ ignore, PCTUSED$ ignore,
    INITRANS ignore, MAXTRANS ignore,
    FLAGS number)
    storage ( tablespace 0 segobjno 266 file 1 block 2121);

unload table INDPART$( OBJ# number, DATAOBJ# number, BO# number,
   PART# number, HIBOUNDLEN ignore, HIBOUNDVAL ignore, FLAGS number,
   TS# number, FILE# number, BLOCK# number)
    storage ( tablespace 0 segobjno 271 file 1 block 2161);

unload table TABCOMPART$( OBJ# number, DATAOBJ# ignore, BO# number,
    PART# number)
    storage ( tablespace 0 segobjno 288 file 1 block 2297);

unload table INDCOMPART$( OBJ# number, DATAOBJ# ignore, BO# number,
    PART# number)
    storage ( tablespace 0 segobjno 293 file 1 block 2345);

unload table TABSUBPART$( OBJ# number, DATAOBJ# number,
    POBJ# number, SUBPART# number, FLAGS number,
    TS# number, FILE# number, BLOCK# number)
    storage ( tablespace 0 segobjno 278 file 1 block 2217);

unload table INDSUBPART$( OBJ# number, DATAOBJ# number,
    POBJ# number, SUBPART# number, FLAGS number,
    TS# number, FILE# number, BLOCK# number)
    storage ( tablespace 0 segobjno 283 file 1 block 2257);

unload table IND$( BO# number, OBJ# number,
    DATAOBJ# number, TS# number, FILE# number, BLOCK# number,
    INDMETHOD# ignore, COLS number, PCTFREE$ ignore,
    INITRANS ignore, MAXTRANS ignore, PCTTHRESH$ ignore,
    TYPE# number, FLAGS number, PROPERTY number)
    cluster  C_OBJ#(BO#)
    storage ( tablespace 0 segobjno 2 tabno 3 file 1 block 25);

unload table ICOL$( BO# number, OBJ# number, COL# number, POS# number)
    cluster  C_OBJ#(BO#)
    storage ( tablespace 0 segobjno 2 tabno 4 file 1 block 25);

unload table LOB$( OBJ# number, COL# number, INTCOL# number,
    lobj# number, part# ignore, ind# number,
    ts# number, file# number, block# number, chunk number,
    pctversion$ ignore, flags ignore, property number)
    cluster  C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 6 file 1 block 25);

unload table COLTYPE$( OBJ# number, COL# number, INTCOL# number,
    toid hexraw, version# ignore, packed number, intcols number,
    intcols#s ignore, flags number)
    cluster  C_OBJ#(OBJ#)
    storage ( tablespace 0 segobjno 2 tabno 7 file 1 block 25);

unload table TYPE$( TOID hexraw, VERSION# ignore,
    VERSION ignore, TVOID hexraw,
    TYPECODE number, PROPERTIES ignore, ATTRIBUTES number)
    cluster  C_TOID_VERSION#( TOID, VERSION#)
    storage ( tablespace 0 segobjno 181 tabno 1 file 1 block 1297);

unload table COLLECTION$( TOID hexraw, VERSION# ignore,
    COLL_TOID hexraw, COLL_VERSION# ignore,
    ELEM_TOID hexraw, ELEM_VERSION# ignore,
    SYNOBJ# ignore, PROPERTIES number,
    CHARSETID number, CHARSETFORM ignore,
    LENGTH number, PRECISION# number, SCALE number,
    UPPER_BOUND number)
    cluster  C_TOID_VERSION#( TOID, VERSION#)
    storage ( tablespace 0 segobjno 181 tabno 2 file 1 block 1297);

unload table ATTRIBUTE$( TOID hexraw, VERSION# ignore,
    NAME clean varchar2(30), 
    ATTRIBUTE# number, ATTR_TOID hexraw, ATTR_VERSION# ignore,
    SYNOBJ# ignore, PROPERTIES number, 
    CHARSETID number, CHARSETFORM ignore,
    LENGTH number, PRECISION# number, SCALE number) 
    cluster  C_TOID_VERSION#( TOID, VERSION#)
    storage ( tablespace 0 segobjno 181 tabno 3 file 1 block 1297);

unload table LOBFRAG$( fragobj# number, parentobj# number,
    tabfragobj# ignore, indfragobj# ignore, frag# number,
    fragtype$ ignore, ts# number, file# number, block# number,
    chunk number)
    storage ( tablespace 0 segobjno 299 file 1 block 2393);

unload table LOBCOMPPART$( partobj# number not null,
    lobj# number not null,
    tabpartobj# ignore, indpartobj# ignore,
    part# number not null)
    storage ( tablespace 0 segobjno 302 file 1 block 2425);

unload table UNDO$( US# number, NAME clean varchar2(30),
    USER# ignore, FILE# number, BLOCK# number,
    SCNBAS ignore, SCNWRP ignore,
    XACTSQN ignore, UNDOSQN ignore, INST# ignore,
    STATUS$ number, TS# number)
    storage ( tablespace 0 segobjno 15 file 1 block 105);

unload table TS$( TS# number, NAME clean varchar2(30),
    OWNER# ignore, ONLINE$ ignore, CONTENTS$ ignore,
    UNDOFILE# ignore, UNDOBLOCK# ignore,
    BLOCKSIZE number)
    cluster  C_TS#( TS#)
    storage ( tablespace 0 segobjno 6 tabno 2 file 1 block 57);

unload table PROPS$( NAME clean varchar2(30),
    VALUE$ clean varchar2(4000), COMMENT$ ignore)
    storage ( tablespace 0 segobjno 96 file 1 block 721);


REM restore the user settings
alter session set profile USER;
REM load the files into the cache
reload;














[oracle@vrh8 dul_dir]$ cat COL.ctl 
load data
CHARACTERSET US7ASCII
infile 'COL.dat'
insert
into table "COL$"
fields terminated by whitespace
(
  "OBJ#"                             CHAR(5) enclosed by X'22'       
 ,"COL#"                             CHAR(3) enclosed by X'22'       
 ,"SEGCOL#"                          CHAR(3) enclosed by X'22'       
 ,"NAME"                             CHAR(30) enclosed by X'22'      
 ,"TYPE#"                            CHAR(3) enclosed by X'22'       
 ,"LENGTH"                           CHAR(5) enclosed by X'22'       
 ,"PRECISION#"                       CHAR(3) enclosed by X'22'       
 ,"SCALE"                            CHAR(2) enclosed by X'22'       
 ,"INTCOL#"                          CHAR(3) enclosed by X'22'       
 ,"PROPERTY"                         CHAR(8) enclosed by X'22'       
 ,"CHARSETID"                        CHAR(4) enclosed by X'22'       
 ,"CHARSETFORM"                      CHAR(1) enclosed by X'22'       
)









[oracle@vrh8 dul_dir]$ head -20 COL.dat
"20" "1" "2" "OBJ#" "2" "22" "" "" "1" "0" "0" "0"
"20" "2" "1" "BO#" "2" "22" "" "" "2" "0" "0" "0"
"20" "3" "3" "COL#" "2" "22" "" "" "3" "0" "0" "0"
"20" "4" "4" "POS#" "2" "22" "" "" "4" "0" "0" "0"
"20" "5" "5" "SEGCOL#" "2" "22" "" "" "5" "0" "0" "0"
"20" "6" "6" "SEGCOLLENGTH" "2" "22" "" "" "6" "0" "0" "0"
"20" "7" "7" "OFFSET" "2" "22" "" "" "7" "0" "0" "0"
"20" "8" "8" "INTCOL#" "2" "22" "" "" "8" "0" "0" "0"
"20" "9" "9" "SPARE1" "2" "22" "" "" "9" "0" "0" "0"
"20" "10" "10" "SPARE2" "2" "22" "" "" "10" "0" "0" "0"
"20" "11" "11" "SPARE3" "2" "22" "" "" "11" "0" "0" "0"
"20" "12" "12" "SPARE4" "1" "1000" "" "" "12" "0" "873" "1"
"20" "13" "13" "SPARE5" "1" "1000" "" "" "13" "0" "873" "1"
"20" "14" "14" "SPARE6" "12" "7" "" "" "14" "0" "0" "0"
"28" "1" "1" "OWNER#" "2" "22" "" "" "1" "0" "0" "0"
"28" "2" "2" "NAME" "1" "30" "" "" "2" "0" "873" "1"
"28" "3" "3" "CON#" "2" "22" "" "" "3" "0" "0" "0"
"28" "4" "4" "SPARE1" "2" "22" "" "" "4" "0" "0" "0"
"28" "5" "5" "SPARE2" "2" "22" "" "" "5" "0" "0" "0"
"28" "6" "6" "SPARE3" "2" "22" "" "" "6" "0" "0" "0"





TAB.CTL


load data
CHARACTERSET US7ASCII
infile 'TAB.dat'
insert
into table "TAB$"
fields terminated by whitespace
(
  "OBJ#"                             CHAR(5) enclosed by X'22'
 ,"DATAOBJ#"                         CHAR(5) enclosed by X'22'
 ,"TS#"                              CHAR(1) enclosed by X'22'
 ,"FILE#"                            CHAR(1) enclosed by X'22'
 ,"BLOCK#"                           CHAR(6) enclosed by X'22'
 ,"BOBJ#"                            CHAR(5) enclosed by X'22'
 ,"TAB#"                             CHAR(2) enclosed by X'22'
 ,"COLS"                             CHAR(3) enclosed by X'22'
 ,"CLUCOLS"                          CHAR(1) enclosed by X'22'
 ,"KERNELCOLS"                       CHAR(3) enclosed by X'22'
 ,"PROPERTY"                         CHAR(10) enclosed by X'22'
)		 
	
	
	
	TAB.dat
	
	"20" "2" "0" "1" "25" "2" "4" "14" "1" "14" "1024"
"28" "28" "0" "1" "169" "" "" "9" "" "9" "0"
"15" "15" "0" "1" "105" "" "" "22" "" "22" "0"
"25" "25" "0" "1" "145" "" "" "3" "" "3" "0"
"17" "17" "0" "1" "113" "" "" "14" "" "14" "0"
"13" "8" "0" "1" "73" "8" "1" "7" "3" "7" "1024"
"19" "2" "0" "1" "25" "2" "3" "34" "1" "34" "1024"
"14" "8" "0" "1" "73" "8" "2" "20" "3" "20" "1024"
"21" "2" "0" "1" "25" "2" "5" "24" "1" "24" "1024"
"5" "2" "0" "1" "25" "2" "2" "26" "1" "26" "1024"
"23" "23" "0" "1" "129" "" "" "6" "" "6" "0"
"16" "6" "0" "1" "57" "6" "2" "32" "1" "32" "1024"
"56" "56" "0" "1" "377" "" "" "3" "" "3" "0"
"12" "6" "0" "1" "57" "6" "1" "4" "1" "4" "1024"
"32" "29" "0" "1" "177" "29" "2" "11" "1" "11" "1024"
"22" "10" "0" "1" "89" "10" "1" "25" "1" "25" "1024"
"18" "18" "0" "1" "121" "" "" "21" "" "21" "0"
"4" "2" "0" "1" "25" "2" "1" "37" "1" "37" "1024"
"31" "29" "0" "1" "177" "29" "1" "21" "1" "21" "1024"
"57" "57" "0" "1" "417" "" "" "8" "" "8" "536870912"
"58" "58" "0" "1" "425" "" "" "6" "" "6" "536870912"
"61" "10" "0" "1" "89" "10" "2" "8" "1" "8" "1024"
"62" "62" "0" "1" "449" "" "" "4" "" "4" "536870912"
"63" "63" "0" "1" "457" "" "" "8" "" "8" "536870912"
	

	
	DUL> 
  2  unload maclean.maclog;
. unloading table                    MACLOG       2 rows unloaded


导出一张表

[oracle@vrh8 dul_dir]$ cat MACLEAN_MACLOG.ctl 
load data
CHARACTERSET AL32UTF8
infile 'MACLEAN_MACLOG.dat' "fix 81"
insert
continueif this (80) = X'2B0A'
into table "MACLEAN"."MACLOG"
fields terminated by whitespace
(
  "T1"                               CHAR(1) enclosed by X'7C'       
)


[oracle@vrh8 dul_dir]$ cat MACLEAN_MACLOG.dat 
|1|                                                                             
|1|      


insert into maclean.maclog(t2) values('刘相兵');

insert into maclean.maclog(t2) values('刘相兵');
insert into maclean.maclog(t2) values('刘相兵');

测试lob 

  1* select * from maclean.maclog
SQL> /

        T1 T2
---------- --------------------
           ���������շ�����ڿη��
           ��

           刘相兵
           刘相兵
           刘相兵
           刘相兵

		   
		   SQL> alter system checkpoint;

System altered.


  3  unload maclean.maclog;
. unloading (index organized) table     LOB010b882b       0 rows unloaded
Preparing lob metadata from lob index
Reading LOB010b882b.dat 0 entries loaded and sorted 0 entries
. unloading table                    MACLOG       5 rows unloaded
DUL> [oracle@vrh8 dul_dir]$ 







[oracle@vrh8 dul_dir]$ cat MACLEAN_MACLOG.ctl
load data
CHARACTERSET AL32UTF8
infile 'MACLEAN_MACLOG.dat' "fix 81"
insert
continueif this (80) = X'2B0A'
into table "MACLEAN"."MACLOG"
fields terminated by whitespace
(
  "T1"                               CHAR(1) enclosed by X'7C'       
 ,"T2"                               CHAR(60) enclosed by X'7C'      
)



[oracle@vrh8 dul_dir]$ cat MACLEAN_MACLOG.dat 
|| |���������շ�����ڿη����|               
|| |刘相兵|                                                                  
|| |刘相兵|                                                                  
|| |刘相兵|                                                                  
|| |刘相兵| 


有数据字典情况下 DUL 支持 CLOB多字符集









[oracle@vrh8 dul_dir]$ rm -rf *.ctl
[oracle@vrh8 dul_dir]$ rm -rf *.dat


==========================================================================================》


下面进入无system表空间 时的情况

DUL: Warning: Recreating file "dul.log"
Found db_id = 2696593743
Found db_name = G10R25
DUL> scan database;
Scanning tablespace 0, data file 1 ...
  1204 segment header and 84386 data blocks
  tablespace 0, data file 1: 97279 blocks scanned
Scanning tablespace 1, data file 2 ...

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 151009

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 199569

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 231593

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 259809

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 284097

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 330193

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 411913

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 419801

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 433857

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 447913

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 453097

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 455617

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 481225

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 527257

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 577033

DUL: Warning: Unsupported block type 37
DUL: Error: While processing ts# 1 file# 2 block# 624553
  0 segment header and 0 data blocks
  tablespace 1, data file 2: 673279 blocks scanned
Scanning tablespace 2, data file 3 ...
  3202 segment header and 42323 data blocks
  tablespace 2, data file 3: 65279 blocks scanned
Scanning tablespace 4, data file 4 ...

DUL: Error: Calculated block checksum, 0x0031,is non zero
DUL: Error: checksum value stored in block is 0x039c
DUL: Error: checksum value stored in block should be 0x03ad
DUL: Error: Ignoring block that has checksum mismatch
DUL: Error: While processing ts# 4 file# 4 block# 699

DUL: Error: Calculated block checksum, 0xdf8d,is non zero
DUL: Error: checksum value stored in block is 0xbc8b
DUL: Error: checksum value stored in block should be 0x6306
DUL: Error: Ignoring block that has checksum mismatch
DUL: Error: While processing ts# 4 file# 4 block# 742245
  26442 segment header and 570400 data blocks
  tablespace 4, data file 4: 766239 blocks scanned
Scanning tablespace 6, data file 5 ...
  425 segment header and 5710 data blocks
  tablespace 6, data file 5: 12799 blocks scanned
Scanning tablespace 7, data file 6 ...
  7 segment header and 6047 data blocks
  tablespace 7, data file 6: 6399 blocks scanned
Scanning tablespace 8, data file 7 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 7: 1279 blocks scanned
Scanning tablespace 8, data file 8 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 8: 639 blocks scanned
Scanning tablespace 8, data file 9 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 9: 639 blocks scanned
Scanning tablespace 8, data file 10 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 10: 639 blocks scanned
Scanning tablespace 8, data file 11 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 11: 639 blocks scanned
Scanning tablespace 8, data file 12 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 12: 639 blocks scanned
Scanning tablespace 8, data file 13 ...
  0 segment header and 0 data blocks
  tablespace 8, data file 13: 639 blocks scanned
Reading EXT.dat
DUL: Warning: Increased the size of DC_EXTENTS from 10000 to 32768 entries
 30442 entries loaded and sorted 30442 entries
Reading SEG.dat 31280 entries loaded
Reading COMPATSEG.dat 0 entries loaded
Reading SCANNEDLOBPAGE.dat 6890 entries loaded and sorted 6890 entries


scan extents;


暂时说到这里

关注dbDao.com的新浪微博

扫码关注dbDao.com 微信公众号:

Speak Your Mind

沪公网安备 31010802001379号

TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569