Monday 25 November 2019

Export/Import in oracle database

Export (exp) and import (imp) utilities are used to perform logical database backup and recovery. When exporting, database objects are dumped to a binary file which can then be imported into another Oracle database or same database (if we need recovery).

 full data export/import
 Schema(User) Level export/import
 Table Level export/import
 Tablespace Level export/import (trasportable tablespace method)

Full database
=========

exp system/manager file='/backup/export.dmp' log='/backup/export1.log' full=y

imp system/manager file='/backup/export.dmp' log='/backup/export2.log' full=y


Schema Level
==========
exp system/manager file='/backup/scott.dmp' log='/backup/scott1.log' owner=scott

imp system/manager file='/backup/scott.dmp' log='/backup/scott2.log' fromuser=scott touser=scott


Table Level
========

exp system/manager file='/backup/table_name.dmp' log='/backup/table_name_1.log' tables=scott.table_name

imp system/manager file=/backup/table_name.dmp' log='/backup/table_name_2.log' fromuser=scott touser=scott tables=table_name

No comments:

Post a Comment