How to Import / Export Data in Oracle

There are different Ways to Import / Export Database, Tablespace, Table, Schema in Oracle Database:  

To Import Table from one Database to another follow the following steps: 

1. First check Data Pump directory: 

select Directory_Name, Directory_Path from dba_directories;

2. If directory is not created or you would like to change the location of directory run this: 

CREATE OR REPLACE DIRECTORY DUMP_DIR AS '/disk1/folder1';"

3. Additionally you can grant read/ write access to the user. 

GRANT READ,WRITE ON DIRECTORY DUMP_DIR TO User;"

4. Export Table command (Run this command on Shell not on SQL Console)

 
expdp SYSTEM TABLES=Schema.Table DIRECTORY=DUMP_DIR DUMPFILE=TableDumpfileName.dmp LOGFILE=Table_dumplog.log

5. To Import the dump command (Run this command on Shell not on SQL Console). This command will import the Data in same Table. Table definition on destination must be same as it is in source: 

 
impdp SYSTEM TABLES=Schema.Table CONTENT=DATA_ONLY DIRECTORY=DUMP_DIR DUMPFILE=TableDumpfileName.dmp

Comments

Popular posts from this blog

How to Enable / Disable a user in MS SQL Server

How to Create a Database in MS SQL Server