Oracle data import and export: imp / exp
Function: Oracle data import and export imp / exp is quite the oracle data restore and backup.
Most cases can be completed with the Oracle data import and export (does not cause the loss of data) to back up and restore data.
Oracle has the advantage, though your computer is not a server, but you installed the oracle client, and the connection is established
(Add the correct service name by Net Configuration Assistant, you can actually be thought of as a client and server-side repair of the road, then the data can be pulled over a)
This allows you to export data to a local, although it may be a server far away from you.
You can also import the dmp file from a local to a remote database server.
You can use this feature to build two identical databases, one for testing, one for official use.
Execution Environment: You can SQLPLUS.EXE or DOS (command line) execute, DOS can be executed due when the oracle 8i in the installation directory \ $ ora10g \ BIN is set to the global path, there EXP.EXE with IMP the directory. EXE file is used to perform import and export.
oracle using java prepared, I think SQLPLUS.EXE, EXP.EXE, IMP.EXE These three documents are the class files are packaged.
SQLPLUS.EXE call EXP.EXE, IMP.EXE they wrapped the class to complete import and export functions.
Here is an instance of import and export, import and export to basically see examples can be completed, because the import and export is very simple.
TEST 1 full export database, user name, password manager system to export to the D: \ daochu.dmp in
exp system / manager @ TEST file = d: \ daochu.dmp full = y
2 user Export system and sys user tables in the database
exp system / manager @ TEST file = d: \ daochu.dmp owner = (system, sys)
3 Export the database table table1, table2
exp system / manager @ TEST file = d: \ daochu.dmp tables = (table1, table2)
4 to "00" starts with the data export database table table1 fields in filed1
exp system / manager @ TEST file = d: \ daochu.dmp tables = (table1) query = \ "where filed1 like '00% '\"
The above is a common export, I do not care for the compression, the dmp file with winzip compression can be very good.
However, in the above command followed by compress = y on it
1 D: \ daochu.dmp the data into the TEST database.
imp system / manager @ TEST file = d: \ daochu.dmp
The above may be a problem, because some form already exists, then it will error, the table will not be imported.
Followed by the ignore = y on it.
2 d: \ daochu.dmp the import table table1
imp system / manager @ TEST file = d: \ daochu.dmp tables = (table1)
Export Import substantially above enough. I will watch many cases completely remove, and then import.
You have enough authority, enough authority it will prompt you.
The database can be connected on. You can tnsping TEST TEST able to get connected to the database.
exp hkb / hkb @ boss_14 full = y file = c: \ orabackup \ hkbfull.dmp log = c: \ orabackup \ hkbfull.log;
Export Note: Exporting the data of the current user, and if the current user has permission to DBA, then export all the data!
Import data between users of the same name:
imp hkb / hkb @ xe file = c: \ orabackup \ hkbfull.dmp log = c: \ orabackup \ hkbimp.log full = y
Import data between different name:
imp system / test @ xe fromuser = hkb touser = hkb_new file = c: \ orabackup \ hkbfull.dmp
log = c: \ orabackup \ hkbimp.log;