Use of Oracle exp/imp Export Import tool-1, expimp
The exp export tool compresses data backup in the database into a binary system file, which can be migrated between different operating systems.
The imp import tool imports binary system files generated by EXP into the database.
1. Export tool exp
It has three modes:
A. User Mode: export data of all user objects and objects;
B. Table mode: export all or specified tables of the user;
C. entire database: export all objects in the database.
$ Exp oa1/123 @ oracle file = D:/all. dmp grants = y
Description: exports all oa1 tables to the file D:/all. dmp.
$ Exp oa1/123 @ oracle tables = (pfdept, pfuser) file = D:/all. dmp grants = y
Note: The oa1 user's two tables, emp and dept, are exported to the file D:/all. dmp.
$ Exp oa1/123 @ oracle tables = pfdept query = "where predeptid = 0745" file = D:/all. dmp
Note: add the query condition predeptid = 0745 for exporting pfdept to exp.
$ Exp parfile = username. par file =/directory1/username_1.dmp,/directory1/username_2.dmp filesize = 2000 M log =/directory2/username_exp.log
Ii. Import tool imp
There are three modes:
A. User Mode: export data of all user objects and objects;
B. Table mode: export all or specified tables of the user;
C. entire database: export all objects in the database.
$ Imp system/oracle fromuser = oa1 tables = (pfdept)
$ Imp system/oracle fromuser = oa1 tables = (pfdept, pfuser)
$ Imp system/oracle fromuser = oa1 touser = system
$ Imp oa1/123 file = all. dmp full = y
$ Imp oa1/123 file = all. dmp show = n buffer = 2048000 ignore = n commit = y grants = y full = y log = D:/. log