First, the Environment configuration
1. Execution Environment:
Exp/imp can be executed either on the client or on the server side,
Clients that need to have Oracle installed on the client,
If it is a Linux system, it is logged in as an Oracle user and executed under the console.
It is recommended to perform exp on the server side, and the backup speed is fast.
2. If you do not configure an environment variable for Oracle's EXP/IMP command, go to the Bin directory of Oracle:
# Cd/opt/oracle_11/app/oracle/product/11.2.0/dbhome_1/bin
3. Configure temporary environment variables:
# Export oracle_home= "/opt/oracle_11/app/oracle/product/11.2.0/dbhome_1"
# Export Oracle_sid=glassfish
4. Switch to Oracle User
# su Oracle
Second, the Exp/imp way
1. Export All tables:
$./exp Userid=demo/[email Protected] File=./tb_test.dmp
2. Export some tables:
$./exp Userid=demo/[email protected] file=./tb_test.dmp Tables=tb_test,tb_user
3. Import all tables (you need to delete the existing table drop tables before importing):
$./imp Userid=demo/[email Protected] File=./tb_test.dmp
4. Import some tables:
$./imp Userid=demo/[email protected] file=./tb_test.dmp Tables=tb_test,tb_user
Three, EXPDP/IMPDP Way
1, first set up the directory :
Sql> Create directory directory name as ' a directory on the database server ', such as:
Sql> Create directory Dmpdir as '/home/dmpdir ';
Place the imported or exported files in this directory
2. Export and Import
To Sid=glassfish, to export the DMP account for demo, import DMP account for demo as an example.
To export data from SFZ:
$ EXPDP demo/[email protected] Directory=dmpdir dumpfile=tb_test.dmp
Import into Test :
$ IMPDP demo/[email protected] Directory=dmpdir dumpfile=tb_test.dmp
Use Exp/imp or EXPDP/IMPDP export to import Oracle data table data under Linux