oracle datapump export import sql

4
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 7 23:08:59 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> select table_name from user_tables; TABLE_NAME ------------------------------ DEPT EMP BONUS SALGRADE SQL> DISC Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> HOST Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. Creating DIRECTORY before commencing EXPDP utility SQL> CONN /AS SYSDBA Connected. SQL> CREATE OR REPLACE DIRECTORY EXT_DIR AS 'F:/ORABB_DIR/DUMP'; Directory created. SQL> GRANT READ,WRITE ON DIRECTORY EXT_DIR TO SCOTT; Grant succeeded. Running command line utility EXPDP to export tables of scott schema F:\Documents and Settings\Biswabrata Banerjee>expdp scott/tiger dumpfile=test.dmp directory=ext_dir

Upload: biswabrata-banerjee

Post on 19-Apr-2015

118 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Oracle Datapump Export Import SQL

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 7 23:08:59 2012

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

Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options

SQL> select table_name from user_tables;

TABLE_NAME------------------------------DEPTEMPBONUSSALGRADE

SQL> DISCDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> HOSTMicrosoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.

Creating DIRECTORY before commencing EXPDP utilitySQL> CONN /AS SYSDBAConnected.SQL> CREATE OR REPLACE DIRECTORY EXT_DIR AS 'F:/ORABB_DIR/DUMP';

Directory created.

SQL> GRANT READ,WRITE ON DIRECTORY EXT_DIR TO SCOTT;Grant succeeded.

Running command line utility EXPDP to export tables of scott schema

F:\Documents and Settings\Biswabrata Banerjee>expdp scott/tiger dumpfile=test.dmp directory=ext_dir

Export: Release 10.2.0.1.0 - Production on Sunday, 07 October, 2012 23:30:23

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options

Page 2: Oracle Datapump Export Import SQL

Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** dumpfile=test.dmp directory=ext_dirEstimate in progress using BLOCKS method...Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATATotal estimation using BLOCKS method: 192 KBProcessing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMAProcessing object type SCHEMA_EXPORT/TABLE/TABLEProcessing object type SCHEMA_EXPORT/TABLE/INDEX/INDEXProcessing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINTProcessing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICSProcessing object type SCHEMA_EXPORT/TABLE/COMMENTProcessing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINTProcessing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS. . exported "SCOTT"."DEPT" 5.656 KB 4 rows. . exported "SCOTT"."EMP" 7.820 KB 14 rows. . exported "SCOTT"."SALGRADE" 5.585 KB 5 rows. . exported "SCOTT"."BONUS" 0 KB 0 rowsMaster table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded*****************************************************************************Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is: F:\ORABB_DIR\DUMP\TEST.DMPJob "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 23:30:37

F:\Documents and Settings\Biswabrata Banerjee>sqlplus biswa/biswa

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 7 23:31:34 2012

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

Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options

SQL> impdp biswa/biswa dumpfile=test.dmp directory=ext_dir remap_schema=scott:biswaSP2-0734: unknown command beginning "impdp bisw..." - rest of line ignored.SQL> hostMicrosoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.

Importing tables from scott F:\Documents and Settings\Biswabrata Banerjee>impdp biswa/biswa dumpfile=test.dmp directory=ext_dir remap_schema=scott:biswa

Import: Release 10.2.0.1.0 - Production on Sunday, 07 October, 2012 23:34:41

Page 3: Oracle Datapump Export Import SQL

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsMaster table "BISWA"."SYS_IMPORT_FULL_01" successfully loaded/unloadedStarting "BISWA"."SYS_IMPORT_FULL_01": biswa/******** dumpfile=test.dmp directory=ext_dir remap_schema=scott:biswaProcessing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMAProcessing object type SCHEMA_EXPORT/TABLE/TABLEProcessing object type SCHEMA_EXPORT/TABLE/TABLE_DATA. . imported "BISWA"."DEPT" 5.656 KB 4 rows. . imported "BISWA"."EMP" 7.820 KB 14 rows. . imported "BISWA"."SALGRADE" 5.585 KB 5 rows. . imported "BISWA"."BONUS" 0 KB 0 rowsProcessing object type SCHEMA_EXPORT/TABLE/INDEX/INDEXProcessing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINTProcessing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICSProcessing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINTProcessing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICSJob "BISWA"."SYS_IMPORT_FULL_01" successfully completed at 23:34:46

F:\Documents and Settings\Biswabrata Banerjee>exit

SQL> show userUSER is "BISWA"SQL> select table_name from user_tables;

TABLE_NAME------------------------------ANYDATA_TESTTBLCOURSESEMP_NESTEDDEPTEMPBONUSSALGRADE

8 rows selected.

SQL>

Go through http://www.oracle-dba-online.com/data_pump_utility.htm link for more understanding of oracle’s DATAPUMP utility.