Oracle data import and export impl/exp
A, exp export
To use the export tool, just enter the exp in the system prompt, all parameters can be input to the exp help=y to view the exp command.
1, Export the specified table (table mode)
exp hr/hr@orcl file=d:\data.dmp tables=(user,role) log=d:\emp.log
2, All objects of derived user (user mode)
exp hr/hr@orcl file=d:\data.dmp owner=hr log=d:\emp.log
3, To export the entire database
Before deriving the entire database, system power cable connected user must have exp_full_database.
The first implementation of grant exp_full_database to HR authorization
exp hr/hr@orcl file=d:\db.dmp full=y log=d:\emp.log
4, Part of the data in the table are specified
exp hr/hr@orcl file=d:\db.dmp tables=(user,role) query=”‘where rownum<=10’” log=d:\emp.log
In the export, can enter the parameters in a parameter file, then execute the exp command, specifying the parameter name can be executed.
Create the parameter file emp.par, file contents are as follows:
userid=hr/hr
file=d:\emp.dmp
tables=user
log=d:\emp.log
Then execute the export command:
exp parfile=d:\emp.par
Two, imp import
Using the import tool, just enter the IMP in the system prompt, all parameters can be input to the imp help=y to view the imp command.
1, Import the specified table (table mode)
imp hr/hr@orcl file=d:\data.dmp tables=(user,role) log=d:\emp.log
2, All objects into user environment (user mode)
imp cs/cs@orcl file=d:\data.dmp fromuser=hr touser=cs log=d:\emp.log
Represented by the CS database, and then all data contained in the export file users under the HR into CS.
You can also use the parameter file, with export.
Import data, if the table already exists, it will be in error, you can use the ignore parameter to solve this problem.
imp hr/hr@orcl file=d:\data.dmp tables=(user,role) ignore=y log=d:\emp.log
Add ignore=y said if creating the table the table already exists, you ignore this error, continue with the following steps.
article from http://www.programering.com/a/MDN1UjMwATM.html
还没有评论,来说两句吧...