ITPub博客

首页 > Linux操作系统 > Linux操作系统 > DUL datafile (Non-tablespace)

DUL datafile (Non-tablespace)

原创 Linux操作系统 作者:boyall111 时间:2011-07-22 10:27:42 0 删除 编辑

===============================DUL  tablespace ( Non-system tablespace)


$cp -R dul dulbak
$ env | grep SID
ORACLE_SID=dul
SQL> host ps -ef  | grep dul
  ora10g 1142886 1323020   0 09:10:46  pts/1  0:00 grep dul
  ora10g 1257782 1323020   0 09:08:34      -  0:00 oracledul (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

SQL> startup
ORACLE instance started.

Total System Global Area  524288000 bytes
Fixed Size                  2085360 bytes
Variable Size             150998544 bytes
Database Buffers          360710144 bytes
Redo Buffers               10493952 bytes
Database mounted.
Database opened.
SQL> select name from v$tablespace;


NAME
------------------------------------------------------------
SYSTEM
UNDOTBS
SYSAUX
TEMPTS1
TBS_1
TBS_DUL

6 rows selected.


SQL> desc v$datafile;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 FILE#                                              NUMBER
 CREATION_CHANGE#                                   NUMBER
 CREATION_TIME                                      DATE
 TS#                                                NUMBER
 RFILE#                                             NUMBER
 STATUS                                             VARCHAR2(7)
 ENABLED                                            VARCHAR2(10)
 CHECKPOINT_CHANGE#                                 NUMBER
 CHECKPOINT_TIME                                    DATE
 UNRECOVERABLE_CHANGE#                              NUMBER
 UNRECOVERABLE_TIME                                 DATE
 LAST_CHANGE#                                       NUMBER
 LAST_TIME                                          DATE
 OFFLINE_CHANGE#                                    NUMBER
 ONLINE_CHANGE#                                     NUMBER
 ONLINE_TIME                                        DATE
 BYTES                                              NUMBER
 BLOCKS                                             NUMBER
 CREATE_BYTES                                       NUMBER
 BLOCK_SIZE                                         NUMBER
 NAME                                               VARCHAR2(257)
 PLUGGED_IN                                         NUMBER
 BLOCK1_OFFSET                                      NUMBER
 AUX_NAME                                           VARCHAR2(257)
 FIRST_NONLOGGED_SCN                                NUMBER
 FIRST_NONLOGGED_TIME                               DATE

SQL> select ts#,rfile#,file#,name from v$datafile;

       TS#     RFILE#      FILE#   NAME
--------------------------------------------------------------------------------
         0          1          1 /fs25/oradata/dul/system01.dbf
         1          2          2 /fs25/oradata/dul/undotbs01.dbf
         2          3          3 /fs25/oradata/dul/sysaux01.dbf
         4          4          4 /fs25/oradata/dul/tbs1.dbf
         5          5          5 /fs25/oradata/dul/dul01.dbf
         5          6          6 /fs25/oradata/dul/dul02.dbf


6 rows selected.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
$ pwd
/home/sunhy/dul
$ cd /fs25/oradata/dul/
$ ls -l
total 2459064
-rw-r-----    1 ora10g   dba        10493952 Jul 22 09:12 dul01.dbf
-rw-r-----    1 ora10g   dba        10493952 Jul 22 09:12 dul02.dbf
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control1
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control2
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo01.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:12 redo02.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo03.log
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 sysaux01.dbf
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 system01.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 09:12 tbs1.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 08:58 temp01.dbf
-rw-r-----    1 ora10g   dba       209723392 Jul 22 09:12 undotbs01.dbf
$ dd if=/dev/null f=dul02.dbf bs=4k count=1
wait: There are no child processes.
$ ls -l
total 2438568
-rw-r-----    1 ora10g   dba        10493952 Jul 22 09:12 dul01.dbf
-rw-r-----    1 ora10g   dba               0 Jul 22 09:12 dul02.dbf
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control1
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control2
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo01.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:12 redo02.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo03.log
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 sysaux01.dbf
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 system01.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 09:12 tbs1.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 08:58 temp01.dbf
-rw-r-----    1 ora10g   dba       209723392 Jul 22 09:12 undotbs01.dbf
$ pwd
/fs25/oradata/dul
$ cd ..
$ ls -l
total 16
drwxr-xr-x    2 ora10g   dba            4096 Jul 22 09:03 dul
drwxr-xr-x    2 ora10g   dba            4096 Jul 22 09:10 dulbak
$ cp dulbak/dul02.dbf dul/dul02.dbf
$ cd  dul
$ ls -l
total 2459064
-rw-r-----    1 ora10g   dba        10493952 Jul 22 09:12 dul01.dbf
-rw-r-----    1 ora10g   dba        10493952 Jul 22 09:13 dul02.dbf
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control1
-rw-r-----    1 ora10g   dba         5324800 Jul 22 09:12 ora_control2
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo01.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:12 redo02.log
-rw-r-----    1 ora10g   dba       104858112 Jul 22 09:10 redo03.log
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 sysaux01.dbf
-rw-r-----    1 ora10g   dba       340795392 Jul 22 09:12 system01.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 09:12 tbs1.dbf
-rw-r-----    1 ora10g   dba        20979712 Jul 22 08:58 temp01.dbf
-rw-r-----    1 ora10g   dba       209723392 Jul 22 09:12 undotbs01.dbf
$ exit

SQL> startup
ORACLE instance started.

Total System Global Area  524288000 bytes
Fixed Size                  2085360 bytes
Variable Size             150998544 bytes
Database Buffers          360710144 bytes
Redo Buffers               10493952 bytes
Database mounted.
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/fs25/oradata/dul/dul02.dbf'


SQL> shutdwon immeidiate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL>  exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ ls
1.sh                COMPATSEG.dat       SEG.dat             dmp                 init.dul
2.sh                EXT.dat             control.dul         dul
3.sql               SCANNEDLOBPAGE.dat  core                dul.log
$ pwd
/home/sunhy/dul
$ cd ..
$ su
root's Password:
# cp -R dul dulbak 
# exit
$ pwd
/home/sunhy
$ id
uid=202(ora10g) gid=203(dba) groups=1(staff)
$ cd dul
$ ls -l
total 1800
-rw-r--r--    1 ora10g   dba             905 Jul 22 08:45 1.sh
-rw-r--r--    1 ora10g   dba             156 Jul 22 08:41 2.sh
-rw-r--r--    1 ora10g   dba              55 Jul 22 08:51 3.sql
-rwxr-x--x    1 ora10g   dba             130 Jul 22 09:17 control.dul
-rwxr-x--x    1 ora10g   dba          899340 Jun 21 22:03 dul
-rwxr-x--x    1 ora10g   dba             584 Jun 27 11:22 init.dul

$ cat init.dul
osd_big_endian_flag=true                  
osd_c_struct_alignment=32                 
osd_file_leader_size=1                    
osd_dba_file_bits=10                      
dc_columns=200000                        
dc_tables=10000                           
dc_objects=1000000                        
dc_users=50                              
#dc_segments=100000                        
control_file=/home/sunhy/dul/control.dul
db_block_size=8192                        
export_mode=true                          
compatible=9  

$ vi init.dul
osd_big_endian_flag=true

osd_c_struct_alignment=32
osd_file_leader_size=1
#osd_word_size=32
osd_dba_file_bits=10
dc_columns=200000
dc_tables=10000
dc_objects=1000000
dc_users=50
#dc_segments=100000
control_file=/home/sunhy/dul/control.dul
db_block_size=8192
export_mode=true
compatible=10
~
$ cat control.dul
0        1   /fs25/oradata/dul/system01.dbf
5        5   /fs25/oradata/dul/dul01.dbf    
5        6   /fs25/oradata/dul/dul02.dbf  
$ dul

Data UnLoader: 10.2.0.5.2 - Internal Only - on Fri Jul 22 09:32:28 2011
with 64-bit io functions

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

 Strictly Oracle Internal Use Only


DUL: Warning: Recreating file "dul.log"
DUL: Warning: ulimit process stack size is only 2147483646
Reading SCANNEDLOBPAGE.dat 0 entries loaded and sorted 0 entries
Reading SEG.dat 0 entries loaded
Reading EXT.dat 0 entries loaded and sorted 0 entries
Reading COMPATSEG.dat 0 entries loaded
Found db_id = 194833648
Found db_name = DUL
DUL> bootstrap  ;
Probing file = 1, block = 377
. unloading table                BOOTSTRAP$      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$    9703 rows unloaded
. unloading table                      TAB$     845 rows unloaded
. unloading table                      COL$   42665 rows unloaded
. unloading table                     USER$      28 rows unloaded
Reading USER.dat 28 entries loaded
Reading OBJ.dat 9703 entries loaded and sorted 9703 entries
Reading SCANNEDLOBPAGE.dat 0 entries loaded and sorted 0 entries
Reading TAB.dat 845 entries loaded
Reading COL.dat 42665 entries loaded and sorted 42665 entries
Reading SEG.dat 0 entries loaded
Reading EXT.dat 0 entries loaded and sorted 0 entries
Reading COMPATSEG.dat 0 entries loaded
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"
    9703 rows unloaded
. unloading table                      TAB$
DUL: Warning: Recreating file "TAB.ctl"
     845 rows unloaded
. unloading table                      COL$
DUL: Warning: Recreating file "COL.ctl"
   42665 rows unloaded
. unloading table                     USER$
DUL: Warning: Recreating file "USER.ctl"
      28 rows unloaded
. unloading table                  TABPART$      72 rows unloaded
. unloading table                  INDPART$      80 rows unloaded
. unloading table               TABCOMPART$       0 rows unloaded
. unloading table               INDCOMPART$       0 rows unloaded
. unloading table               TABSUBPART$       0 rows unloaded
. unloading table               INDSUBPART$       0 rows unloaded
. unloading table                      IND$    1009 rows unloaded
. unloading table                     ICOL$    2057 rows unloaded
. unloading table                      LOB$     120 rows unloaded
. unloading table                  COLTYPE$    1143 rows unloaded
. unloading table                     TYPE$     940 rows unloaded
. unloading table               COLLECTION$     201 rows unloaded
. unloading table                ATTRIBUTE$    4231 rows unloaded
. unloading table                  LOBFRAG$       1 row  unloaded
. unloading table              LOBCOMPPART$       0 rows unloaded
. unloading table                     UNDO$      11 rows unloaded
. unloading table                       TS$       6 rows unloaded
. unloading table                    PROPS$      28 rows unloaded
Reading USER.dat 28 entries loaded
Reading OBJ.dat 9703 entries loaded and sorted 9703 entries
Reading SCANNEDLOBPAGE.dat 0 entries loaded and sorted 0 entries
Reading TAB.dat 845 entries loaded
Reading COL.dat 42665 entries loaded and sorted 42665 entries
Reading SEG.dat 0 entries loaded
Reading EXT.dat 0 entries loaded and sorted 0 entries
Reading TABPART.dat 72 entries loaded and sorted 72 entries
Reading TABCOMPART.dat 0 entries loaded and sorted 0 entries
Reading TABSUBPART.dat 0 entries loaded and sorted 0 entries
Reading INDPART.dat 80 entries loaded and sorted 80 entries
Reading INDCOMPART.dat 0 entries loaded and sorted 0 entries
Reading INDSUBPART.dat 0 entries loaded and sorted 0 entries
Reading IND.dat 1009 entries loaded
Reading LOB.dat 120 entries loaded
Reading ICOL.dat 2057 entries loaded
Reading COLTYPE.dat 1143 entries loaded
Reading TYPE.dat 940 entries loaded
Reading ATTRIBUTE.dat 4231 entries loaded
Reading COLLECTION.dat 201 entries loaded
Reading COMPATSEG.dat 0 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 11 entries loaded
Reading TS.dat 6 entries loaded
Reading PROPS.dat 28 entries loaded
Database character set is US7ASCII
Database national character set is AL16UTF16
DUL> dump tablespace dul;
Dul: parse error: Tablespace number expected, when parsing
File "standard input" line number 1 column 16
DUL> unload table big;
. unloading table                       BIG   31084 rows unloaded
DUL> exit

Life is DUL without it
$ ls
1.sh                COLLECTION.ctl      INDCOMPART.ctl      LOBFRAG.ctl         TABCOMPART.ctl      UNDO.ctl
2.sh                COLLECTION.dat      INDCOMPART.dat      LOBFRAG.dat         TABCOMPART.dat      UNDO.dat
3.sql               COLTYPE.ctl         INDPART.ctl         OBJ.ctl             TABPART.ctl         USER.ctl
ATTRIBUTE.ctl       COLTYPE.dat         INDPART.dat         OBJ.dat             TABPART.dat         USER.dat
ATTRIBUTE.dat       COMPATSEG.dat       INDSUBPART.ctl      PROPS.ctl           TABSUBPART.ctl      control.dul
BIG.dmp             EXT.dat             INDSUBPART.dat      PROPS.dat           TABSUBPART.dat      core
BOOTSTRAP.ctl       ICOL.ctl            LOB.ctl             SCANNEDLOBPAGE.dat  TS.ctl              dict.ddl
BOOTSTRAP.dat       ICOL.dat            LOB.dat             SEG.dat             TS.dat              dul
COL.ctl             IND.ctl             LOBCOMPPART.ctl     TAB.ctl             TYPE.ctl            dul.log
COL.dat             IND.dat             LOBCOMPPART.dat     TAB.dat             TYPE.dat            init.dul
$ ls -rntl
total 15720
-rwxr-x--x    1 202      203          899340 Jun 21 22:03 dul
-rw-r--r--    1 202      203             156 Jul 22 08:41 2.sh
-rw-r--r--    1 202      203             905 Jul 22 08:45 1.sh
-rw-r--r--    1 202      203              55 Jul 22 08:51 3.sql
-rw-r--r--    1 202      203               0 Jul 22 09:21 SEG.dat
-rw-r--r--    1 202      203               0 Jul 22 09:21 SCANNEDLOBPAGE.dat
-rw-r--r--    1 202      203               0 Jul 22 09:21 EXT.dat
-rw-r--r--    1 202      203               0 Jul 22 09:21 COMPATSEG.dat
-rw-r--r--    1 202      203           76596 Jul 22 09:24 core
-rwxr-x--x    1 202      203             583 Jul 22 09:30 init.dul
-rwxr-x--x    1 202      203             135 Jul 22 09:31 control.dul
-rw-r--r--    1 202      203           18153 Jul 22 09:32 BOOTSTRAP.dat
-rw-r--r--    1 202      203             332 Jul 22 09:32 BOOTSTRAP.ctl
-rw-r--r--    1 202      203            6400 Jul 22 09:32 dict.ddl
-rw-r--r--    1 202      203             552 Jul 22 09:32 USER.dat
-rw-r--r--    1 202      203             252 Jul 22 09:32 USER.ctl
-rw-r--r--    1 202      203             364 Jul 22 09:32 UNDO.dat
-rw-r--r--    1 202      203             532 Jul 22 09:32 UNDO.ctl
-rw-r--r--    1 202      203           75292 Jul 22 09:32 TYPE.dat
-rw-r--r--    1 202      203             392 Jul 22 09:32 TYPE.ctl
-rw-r--r--    1 202      203             122 Jul 22 09:32 TS.dat
-rw-r--r--    1 202      203             318 Jul 22 09:32 TS.ctl
-rw-r--r--    1 202      203               0 Jul 22 09:32 TABSUBPART.dat
-rw-r--r--    1 202      203             684 Jul 22 09:32 TABSUBPART.ctl
-rw-r--r--    1 202      203            3312 Jul 22 09:32 TABPART.dat
-rw-r--r--    1 202      203             678 Jul 22 09:32 TABPART.ctl
-rw-r--r--    1 202      203               0 Jul 22 09:32 TABCOMPART.dat
-rw-r--r--    1 202      203             334 Jul 22 09:32 TABCOMPART.ctl
-rw-r--r--    1 202      203           47787 Jul 22 09:32 TAB.dat
-rw-r--r--    1 202      203             880 Jul 22 09:32 TAB.ctl
-rw-r--r--    1 202      203             847 Jul 22 09:32 PROPS.dat
-rw-r--r--    1 202      203             254 Jul 22 09:32 PROPS.ctl
-rw-r--r--    1 202      203          476520 Jul 22 09:32 OBJ.dat
-rw-r--r--    1 202      203             600 Jul 22 09:32 OBJ.ctl
-rw-r--r--    1 202      203              38 Jul 22 09:32 LOBFRAG.dat
-rw-r--r--    1 202      203             608 Jul 22 09:32 LOBFRAG.ctl
-rw-r--r--    1 202      203               0 Jul 22 09:32 LOBCOMPPART.dat
-rw-r--r--    1 202      203             336 Jul 22 09:32 LOBCOMPPART.ctl
-rw-r--r--    1 202      203            6257 Jul 22 09:32 LOB.dat
-rw-r--r--    1 202      203             810 Jul 22 09:32 LOB.ctl
-rw-r--r--    1 202      203               0 Jul 22 09:32 INDSUBPART.dat
-rw-r--r--    1 202      203             684 Jul 22 09:32 INDSUBPART.ctl
-rw-r--r--    1 202      203            3679 Jul 22 09:32 INDPART.dat
-rw-r--r--    1 202      203             678 Jul 22 09:32 INDPART.ctl
-rw-r--r--    1 202      203               0 Jul 22 09:32 INDCOMPART.dat
-rw-r--r--    1 202      203             334 Jul 22 09:32 INDCOMPART.ctl
-rw-r--r--    1 202      203           54321 Jul 22 09:32 IND.dat
-rw-r--r--    1 202      203             810 Jul 22 09:32 IND.ctl
-rw-r--r--    1 202      203           43725 Jul 22 09:32 ICOL.dat
-rw-r--r--    1 202      203             392 Jul 22 09:32 ICOL.ctl
-rw-r--r--    1 202      203           71824 Jul 22 09:32 COLTYPE.dat
-rw-r--r--    1 202      203             608 Jul 22 09:32 COLTYPE.ctl
-rw-r--r--    1 202      203           25347 Jul 22 09:32 COLLECTION.dat
-rw-r--r--    1 202      203             754 Jul 22 09:32 COLLECTION.ctl
-rw-r--r--    1 202      203         2598320 Jul 22 09:32 COL.dat
-rw-r--r--    1 202      203             950 Jul 22 09:32 COL.ctl
-rw-r--r--    1 202      203          437192 Jul 22 09:32 ATTRIBUTE.dat
-rw-r--r--    1 202      203             752 Jul 22 09:32 ATTRIBUTE.ctl
-rw-r--r--    1 202      203         3021548 Jul 22 09:35 BIG.dmp
-rw-r--r--    1 202      203           15618 Jul 22 09:35 dul.log

$ ls
1.sh                COLLECTION.ctl      INDCOMPART.ctl      LOBFRAG.ctl         TABCOMPART.ctl      UNDO.ctl
2.sh                COLLECTION.dat      INDCOMPART.dat      LOBFRAG.dat         TABCOMPART.dat      UNDO.dat
3.sql               COLTYPE.ctl         INDPART.ctl         OBJ.ctl             TABPART.ctl         USER.ctl
ATTRIBUTE.ctl       COLTYPE.dat         INDPART.dat         OBJ.dat             TABPART.dat         USER.dat
ATTRIBUTE.dat       COMPATSEG.dat       INDSUBPART.ctl      PROPS.ctl           TABSUBPART.ctl      control.dul
BIG.dmp             EXT.dat             INDSUBPART.dat      PROPS.dat           TABSUBPART.dat      core
BOOTSTRAP.ctl       ICOL.ctl            LOB.ctl             SCANNEDLOBPAGE.dat  TS.ctl              dict.ddl
BOOTSTRAP.dat       ICOL.dat            LOB.dat             SEG.dat             TS.dat              dul
COL.ctl             IND.ctl             LOBCOMPPART.ctl     TAB.ctl             TYPE.ctl            dul.log
COL.dat             IND.dat             LOBCOMPPART.dat     TAB.dat             TYPE.dat            init.dul
$ cat TAB.ctl
load data
CHARACTERSET US7ASCII
infile 'TAB.dat'
insert
into table "TAB$"
fields terminated by whitespace
(
  "OBJ#"                             CHAR(4) enclosed by X'22'      
 ,"DATAOBJ#"                         CHAR(4) enclosed by X'22'      
 ,"TS#"                              CHAR(1) enclosed by X'22'      
 ,"FILE#"                            CHAR(1) enclosed by X'22'      
 ,"BLOCK#"                           CHAR(5) enclosed by X'22'      
 ,"BOBJ#"                            CHAR(4) enclosed by X'22'      
 ,"TAB#"                             CHAR(2) enclosed by X'22'      
 ,"COLS"                             CHAR(2) enclosed by X'22'      
 ,"CLUCOLS"                          CHAR(1) enclosed by X'22'      
 ,"KERNELCOLS"                       CHAR(3) enclosed by X'22'      
 ,"PROPERTY"                         CHAR(9) enclosed by X'22'      
)
$ ls
1.sh                COLLECTION.ctl      INDCOMPART.ctl      LOBFRAG.ctl         TABCOMPART.ctl      UNDO.ctl
2.sh                COLLECTION.dat      INDCOMPART.dat      LOBFRAG.dat         TABCOMPART.dat      UNDO.dat
3.sql               COLTYPE.ctl         INDPART.ctl         OBJ.ctl             TABPART.ctl         USER.ctl
ATTRIBUTE.ctl       COLTYPE.dat         INDPART.dat         OBJ.dat             TABPART.dat         USER.dat
ATTRIBUTE.dat       COMPATSEG.dat       INDSUBPART.ctl      PROPS.ctl           TABSUBPART.ctl      control.dul
BIG.dmp             EXT.dat             INDSUBPART.dat      PROPS.dat           TABSUBPART.dat      core
BOOTSTRAP.ctl       ICOL.ctl            LOB.ctl             SCANNEDLOBPAGE.dat  TS.ctl              dict.ddl
BOOTSTRAP.dat       ICOL.dat            LOB.dat             SEG.dat             TS.dat              dul
COL.ctl             IND.ctl             LOBCOMPPART.ctl     TAB.ctl             TYPE.ctl            dul.log
COL.dat             IND.dat             LOBCOMPPART.dat     TAB.dat             TYPE.dat            init.dul
$ mv BIG.dmp BIG2.dmp
$ dul

Data UnLoader: 10.2.0.5.2 - Internal Only - on Fri Jul 22 09:39:08 2011
with 64-bit io functions

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

 Strictly Oracle Internal Use Only


DUL: Warning: Recreating file "dul.log"
DUL: Warning: ulimit process stack size is only 2147483646
Reading USER.dat 28 entries loaded
Reading OBJ.dat 9703 entries loaded and sorted 9703 entries
Reading SCANNEDLOBPAGE.dat 0 entries loaded and sorted 0 entries
Reading TAB.dat 845 entries loaded
Reading COL.dat 42665 entries loaded and sorted 42665 entries
Reading SEG.dat 0 entries loaded
Reading EXT.dat 0 entries loaded and sorted 0 entries
Reading TABPART.dat 72 entries loaded and sorted 72 entries
Reading TABCOMPART.dat 0 entries loaded and sorted 0 entries
Reading TABSUBPART.dat 0 entries loaded and sorted 0 entries
Reading INDPART.dat 80 entries loaded and sorted 80 entries
Reading INDCOMPART.dat 0 entries loaded and sorted 0 entries
Reading INDSUBPART.dat 0 entries loaded and sorted 0 entries
Reading IND.dat 1009 entries loaded
Reading LOB.dat 120 entries loaded
Reading ICOL.dat 2057 entries loaded
Reading COLTYPE.dat 1143 entries loaded
Reading TYPE.dat 940 entries loaded
Reading ATTRIBUTE.dat 4231 entries loaded
Reading COLLECTION.dat 201 entries loaded
Reading COMPATSEG.dat 0 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 11 entries loaded
Reading TS.dat 6 entries loaded
Reading PROPS.dat 28 entries loaded
Database character set is US7ASCII
Database national character set is AL16UTF16
Found db_id = 194833648
Found db_name = DUL
DUL> bootstarp   rapt
Dul: parse error: Unexpected Command, when parsing
File "standard input" line number 1 column 0
DUL> bootstrap;

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"
    9703 rows unloaded
. unloading table                      TAB$
DUL: Warning: Recreating file "TAB.ctl"
     845 rows unloaded
. unloading table                      COL$
DUL: Warning: Recreating file "COL.ctl"
   42665 rows unloaded
. unloading table                     USER$
DUL: Warning: Recreating file "USER.ctl"
      28 rows unloaded
. unloading table                  TABPART$
DUL: Warning: Recreating file "TABPART.ctl"
      72 rows unloaded
. unloading table                  INDPART$
DUL: Warning: Recreating file "INDPART.ctl"
      80 rows unloaded
. unloading table               TABCOMPART$
DUL: Warning: Recreating file "TABCOMPART.ctl"
       0 rows unloaded
. unloading table               INDCOMPART$
DUL: Warning: Recreating file "INDCOMPART.ctl"
       0 rows unloaded
. unloading table               TABSUBPART$
DUL: Warning: Recreating file "TABSUBPART.ctl"
       0 rows unloaded
. unloading table               INDSUBPART$
DUL: Warning: Recreating file "INDSUBPART.ctl"
       0 rows unloaded
. unloading table                      IND$
DUL: Warning: Recreating file "IND.ctl"
    1009 rows unloaded
. unloading table                     ICOL$
DUL: Warning: Recreating file "ICOL.ctl"
    2057 rows unloaded
. unloading table                      LOB$
DUL: Warning: Recreating file "LOB.ctl"
     120 rows unloaded
. unloading table                  COLTYPE$
DUL: Warning: Recreating file "COLTYPE.ctl"
    1143 rows unloaded
. unloading table                     TYPE$
DUL: Warning: Recreating file "TYPE.ctl"
     940 rows unloaded
. unloading table               COLLECTION$
DUL: Warning: Recreating file "COLLECTION.ctl"
     201 rows unloaded
. unloading table                ATTRIBUTE$
DUL: Warning: Recreating file "ATTRIBUTE.ctl"
    4231 rows unloaded
. unloading table                  LOBFRAG$
DUL: Warning: Recreating file "LOBFRAG.ctl"
       1 row  unloaded
. unloading table              LOBCOMPPART$
DUL: Warning: Recreating file "LOBCOMPPART.ctl"
       0 rows unloaded
. unloading table                     UNDO$
DUL: Warning: Recreating file "UNDO.ctl"
      11 rows unloaded
. unloading table                       TS$
DUL: Warning: Recreating file "TS.ctl"
       6 rows unloaded
. unloading table                    PROPS$
DUL: Warning: Recreating file "PROPS.ctl"
      28 rows unloaded
Reading USER.dat 28 entries loaded
Reading OBJ.dat 9703 entries loaded and sorted 9703 entries
Reading SCANNEDLOBPAGE.dat 0 entries loaded and sorted 0 entries
Reading TAB.dat 845 entries loaded
Reading COL.dat 42665 entries loaded and sorted 42665 entries
Reading SEG.dat 0 entries loaded
Reading EXT.dat 0 entries loaded and sorted 0 entries
Reading TABPART.dat 72 entries loaded and sorted 72 entries
Reading TABCOMPART.dat 0 entries loaded and sorted 0 entries
Reading TABSUBPART.dat 0 entries loaded and sorted 0 entries
Reading INDPART.dat 80 entries loaded and sorted 80 entries
Reading INDCOMPART.dat 0 entries loaded and sorted 0 entries
Reading INDSUBPART.dat 0 entries loaded and sorted 0 entries
Reading IND.dat 1009 entries loaded
Reading LOB.dat 120 entries loaded
Reading ICOL.dat 2057 entries loaded
Reading COLTYPE.dat 1143 entries loaded
Reading TYPE.dat 940 entries loaded
Reading ATTRIBUTE.dat 4231 entries loaded
Reading COLLECTION.dat 201 entries loaded
Reading COMPATSEG.dat 0 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 11 entries loaded
Reading TS.dat 6 entries loaded
Reading PROPS.dat 28 entries loaded
DUL> unload user dul;
About to unload DUL's tables ...
. unloading table                       BIG   31084 rows unloaded
DUL> exit

Life is DUL without it
$ pwd
/home/sunhy/dul
$ env | grep SID
ORACLE_SID=dul
$ sqlplus  / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jul 22 09:42:04 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  524288000 bytes
Fixed Size                  2085360 bytes
Variable Size             150998544 bytes
Database Buffers          360710144 bytes
Redo Buffers               10493952 bytes
Database mounted.
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/fs25/oradata/dul/dul02.dbf'

SQL> alter database datafile 6 offline drop;

Database altered.

SQL> alter database open ;

Database altered.

SQL> connect dul/dul
Connected.
SQL> select count(*) from big;
select count(*) from big
                     *
ERROR at line 1:
ORA-00376: file 6 cannot be read at this time
ORA-01110: data file 6: '/fs25/oradata/dul/dul02.dbf'


SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/fs25/oradata/dul/system01.dbf
/fs25/oradata/dul/undotbs01.dbf
/fs25/oradata/dul/sysaux01.dbf
/fs25/oradata/dul/tbs1.dbf
/fs25/oradata/dul/dul01.dbf
/fs25/oradata/dul/dul02.dbf

6 rows selected.

SQL> drop tablespace tbs_dul including contents and datafiles;

Tablespace dropped.

SQL> create tablespace tbs_dul datafile '/fs25/oradata/dul/dul03.dbf' size 20M;

Tablespace created.


SQL> !
$ pwd
/ora10g
$ cd /home/sunhy

$ cd dul
$ ls
1.sh                COLLECTION.dat      INDCOMPART.dat      OBJ.ctl             TABPART.dat         control.dul
2.sh                COLTYPE.ctl         INDPART.ctl         OBJ.dat             TABSUBPART.ctl      core
3.sql               COLTYPE.dat         INDPART.dat         PROPS.ctl           TABSUBPART.dat      dict.ddl
ATTRIBUTE.ctl       COMPATSEG.dat       INDSUBPART.ctl      PROPS.dat           TS.ctl              dul
ATTRIBUTE.dat       DUL_BIG.dmp         INDSUBPART.dat      SCANNEDLOBPAGE.dat  TS.dat              dul.log
BIG2.dmp            EXT.dat             LOB.ctl             SEG.dat             TYPE.ctl            init.dul
BOOTSTRAP.ctl       ICOL.ctl            LOB.dat             TAB.ctl             TYPE.dat
BOOTSTRAP.dat       ICOL.dat            LOBCOMPPART.ctl     TAB.dat             UNDO.ctl
COL.ctl             IND.ctl             LOBCOMPPART.dat     TABCOMPART.ctl      UNDO.dat
COL.dat             IND.dat             LOBFRAG.ctl         TABCOMPART.dat      USER.ctl
COLLECTION.ctl      INDCOMPART.ctl      LOBFRAG.dat         TABPART.ctl         USER.dat
$ imp dul/dul fromuser=dul touser=dul file=DUL_BIG.dmp log=imp_dul_big.log

Import: Release 10.2.0.4.0 - Production on Fri Jul 22 09:45:24 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V07.00.07 via conventional path

Warning: the objects were exported by Bernard's DUL, not by you

IMP-00034: Warning: FromUser "DUL" not found in export file
Import terminated successfully with warnings.
$ imp dul/dul full=y file=DUL_BIG.dmp log=imp_dullog.log

Import: Release 10.2.0.4.0 - Production on Fri Jul 22 09:46:51 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V07.00.07 via conventional path

Warning: the objects were exported by Bernard's DUL, not by you

. importing Bernard's DUL's objects into DUL
. importing Bernard's DUL's objects into DUL
. . importing table                          "BIG"      31084 rows imported
Import terminated successfully without warnings.
$exit

SQL> select count(*) from big;

  COUNT(*)
----------
     31084

SQL> !
$ head -n 10 DUL_BIG.dmp
EXPORT:V07.00.07
UBernard's DUL
RTABLES
1024
                                                 Direct UnLoader(C) in EXPort mode
TABLE "BIG"
CREATE TABLE "BIG"("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(30),"SUBOBJECT_NAME" VARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT_TYPE" VARCHAR2(19),"CREATED" DATE,"LAST_DDL_TIME" DATE,"TIMESTAMP" VARCHAR2(19),"STATUS" VARCHAR2(7),"TEMPORARY" VARCHAR2(1),"GENERATED" VARCHAR2(1),"SECONDARY" VARCHAR2(1))
INSERT INTO "BIG" ("OWNER", "OBJECT_NAME", "SUBOBJECT_NAME", "OBJECT_ID", "DATA_OBJECT_ID", "OBJECT_TYPE", "CREATED", "LAST_DDL_TIME", "TIMESTAMP", "STATUS", "TEMPORARY", "GENERATED", "SECONDARY") VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13)

                          SYS CON$? ? ? TABLE xo      14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_COL2? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_USER#? ? ? INDEX xo      14 xo    14 2011-07-22:08:48:51 VALID N N N SYS C_TS#? ? ? CLUSTER xo      14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_OBJ#? ? ? INDEX xo       14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CON2? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS IND$? ? ? TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS
 BOOTSTRAP$? ? ? TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS UET$? ? ?        TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS COL$? ? ? TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_OBJ1? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_USER1? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CDEF4? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CDEF3? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CDEF2? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_IND1? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_PROXY_ROLE_DATA$_1? ? ? INDEX xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_TS#? ? ? INDEX xo  14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CDEF1? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_TS1? ? ? INDEX xo      14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_PROXY_ROLE_DATA$_2? ? ? INDEX xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS CLU$? ? ? TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_COL3? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CCOL1? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_CON1? ? ? INDEX xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS C_OBJ#? ? ? CLUSTER xo     14 xo    14 2011-07-22:08:48:51 VALID N N N SYS CCOL$? ? ? TABLE xo       14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_UNDO1? ? ? INDEX xo    14 xo    14 2011-07-22:08:48:51 VALID N N N SYS CDEF$? ? ? TABLE xo       14 xo    14 2011-07-22:08:48:51 VALID N N N SYS TAB$? ? ? TABLE xo 14 xo    14 2011-07-22:08:48:51 VALID N N N SYS I_FILE#_BLOCK#? ?
$
$ exit
SQL> drop table big;

Table dropped.

SQL> exit


========================================
SQL> connect / as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
$ pwd
/home/sunhy/dul
$ cd /fs25
$ ls
1               2.sh            ftp.log         imp200807.log   lost+found      sql             testtest1g.dbf
1.log           admin           ftp.sh          imp201007.log   nohup.out       test1g.dbf
2               com.sh          imp.sh          log.20110115    oradata         test1g.out
$ cd oradata
$ ls
dul     dulbak
$ mv dul dul_old
$ mv dulbak dul
$ exit

SQL> startup
ORACLE instance started.

Total System Global Area  524288000 bytes
Fixed Size                  2085360 bytes
Variable Size             150998544 bytes
Database Buffers          360710144 bytes
Redo Buffers               10493952 bytes
Database mounted.
sDatabase opened.
SQL> 
SQL> select count(*) b from dul.big;

  COUNT(*)
----------
     31084

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ exit
srdfdb:/ #

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/229689/viewspace-702802/,如需转载,请注明出处,否则将追究法律责任。

上一篇: v$lock
下一篇: RMAN 恢复笔记
请登录后发表评论 登录
全部评论

注册时间:2010-03-03

  • 博文量
    15
  • 访问量
    19945