Created
August 30, 2012 03:21
-
-
Save junlapong/3522000 to your computer and use it in GitHub Desktop.
Oracle Export/Import dump file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DBA define dump directory for remote and local db -- | |
C:\>sqlplus system/password@tns_name as sysdba | |
SQL> CREATE DIRECTORY data_dump_dir AS 'D:\oraclexe\dump'; | |
SQL> GRANT read,write ON DIRECTORY data_dump_dir TO username; | |
SQL> SELECT directory_name, directory_path FROM dba_directories; | |
--- EXPORT FROM REMOTE DB --- | |
C:\>expdp username/password@tns_name DIRECTORY=data_dump_dir DUMPFILE=database.dmp SCHEMAS=database LOGFILE=database.log | |
C:\>expdp username/password@tns_name DIRECTORY=data_dump_dir DUMPFILE=database.dmp TABLES=table_user,table_product LOGFILE=database.log | |
-- IMPORT TO LOCAL DB --- | |
C:\>sqlplus username/password@xe | |
SQL> DROP TABLE table_user CASCADE CONSTRAINTS; | |
SQL> DROP TABLE table_product CASCADE CONSTRAINTS; | |
SQL> PURGE recyclebin; | |
C:\>impdp username/password@xe DIRECTORY=data_dump_dir DUMPFILE=database.dmp SCHEMAS=database LOGFILE=database.log | |
C:\>impdp username/password@xe DIRECTORY=data_dump_dir DUMPFILE=database.dmp TABLES=table_user,table_product LOGFILE=database.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment