Search This Blog

Thursday, January 4, 2007

Transport Tablespace


SQL>alter tablespace TEST read only;

SQL> conn sys@catdb as sysdba
Enter password:
Connected.
SQL> create directory DATA as 'e:\DATA';
Directory created.
SQL> grant EXP_FULL_DATABASE, IMP_FULL_DATABASE to scott;
Grant succeeded.
SQL> grant READ, WRITE on directory DATA to scott;
Grant succeeded.
SQL> conn scott/tiger@catdb
Connected.
SQL> host EXPDP scott/tiger@catdb TRANSPORT_TABLESPACES=test DIRECTORY=data -> DUMPFILE=test1 LOGFILE=test1
Export: Release 10.1.0.2.0 - Production on Thursday, 04 January, 2007 17:17
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
ProductionWith the Partitioning, OLAP and Data Mining options
Starting "SCOTT"."SYS_EXPORT_TRANSPORTABLE_01": scott/********@catdb TRANSPORT_TABLESPACES=test DIRECTORY=data DUMPFILE=test1 LOGFILE=test1
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLKP
rocessing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK
Master table "SCOTT"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TRANSPORTABLE_01 is: E:\DATA\TEST1.DMP
Job "SCOTT"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 17:18

----------------------------------------------------
SQL> conn sys@sh as sysdba
Enter password:
Connected.
SQL> create directory DATA as 'e:\DATA';
Directory created.
SQL> grant EXP_FULL_DATABASE, IMP_FULL_DATABASE to scott;
Grant succeeded.
SQL> grant READ, WRITE on directory DATA to scott;
Grant succeeded.
SQL> conn scott/tiger@sh
Connected.
SQL> host impdp scott/tiger@sh DIRECTORY=data DUMPFILE=test1 -
> TRANSPORT_DATAFILES='c:\oracle\product\10.1.0\oradata\SH\users01.dbf' -
> LOGFILE=test2
Import: Release 10.1.0.2.0 - Production on Thursday, 04 January, 2007 17:42
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
ProductionWith the Partitioning, OLAP and Data Mining options
Master table "SCOTT"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SCOTT"."SYS_IMPORT_TRANSPORTABLE_01": scott/********@sh DIRECTORY=data DUMPFILE=test1 TRANSPORT_DATAFILES='c:\oracle\product\10.1.0\oradata\SH\users01.dbf' LOGFILE=test2
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK
Job "SCOTT"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 17:42

SQL> alter tablespace TEST read write;
Tablespace altered.

No comments: