Oracle Data Import/Export, oracle Data Import and Export
Import and Export Oracle Data imp/exp
Function: Oracle Data Import/Export imp/exp is equivalent to oracle data restoration and backup.
In most cases, you can use Oracle data import and export to back up and restore data (without causing data loss ).
Oracle has a benefit. Although your computer is not a server, you have installed an oracle client and established a connection.
(Add the correct service name through Net Configuration Assistant. In fact, you can think that the client and server have repaired the path, and then the data can be pulled)
In this way, you can export data locally, although the server may be far away from you.
You can also import the dmp file locally to a database server in a distance.
With this function, you can build two identical databases, one for testing and the other for formal use.
Execution environment: it can be executed in SQLPLUS. EXE or DOS (command line,
During DOS execution, the installation directory \ $ ora10g \ BIN in oracle 8i is set to a global path,
The EXP. EXE and IMP. EXE files in this directory are used for import and export.
Oracle is written in java. I think the SQLPLUS. EXE, EXP. EXE, and IMP. EXE files are packaged class files.
SQLPLUS. EXE calls EXP. EXE and IMP. EXE to complete the import and export functions.
The following describes the Import and Export instances. You can import and export instances to the Import and Export instances, because the import and export operations are very simple.
Data export:
1. Export the database TEST completely, and the username system Password manager is exported to D: \ daochu. dmp.
Exp system/manager @ TEST file = d: \ daochu. dmp full = y
2. Export the tables of system users and sys users in the database
Exp system/manager @ TEST file = d: \ daochu. dmp owner = (system, sys)
3. Export tables table1 and table2 in the database
Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1, table2)
4. Export the data with the field filed1 in table 1 in the database starting with "00"
Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1) query = \ "where filed1 like '201312 '\"
The above is a commonly used export. I am not very concerned about compression. I can use winzip to compress the dmp file.
However, add compress = y to the command above.
Data Import
1. import data from D: \ daochu. dmp to the TEST database.
Imp system/manager @ TEST file = d: \ daochu. dmp
The above may be a problem, because some tables already exist, and then it will report an error, the table will not be imported.
Add ignore = y to the end.
2. Import table 1 in d: \ daochu. dmp
Imp system/manager @ TEST file = d: \ daochu. dmp tables = (table1)
The preceding import and export operations are sufficient. In many cases, I completely delete the table and then import it.
Note:
If you have sufficient permissions, the system will prompt you.
Databases can be connected. You can use tnsping TEST to obtain whether the database TEST can be connected.
Data export:
Exp hkb/hkb @ boss_14 full = y file = c: \ orabackup \ hkbfull. dmp log = c: \ orabackup \ hkbfull. log;
Note: The data of the current user is exported. If the current user has DBA permissions, all data is exported!
Import data between users with the same name:
Imp hkb/hkb @ xe file = c: \ orabackup \ hkbfull. dmp log = c: \ orabackup \ hkbimp. log full = y
Data Import between different names:
Imp system/test @ xe fromuser = hkb touser = hkb_new file = c: \ orabackup \ hkbfull. dmp
Log = c: \ orabackup \ hkbimp. log;
This content is excerpted to: http://www.cnblogs.com/fjfzhkb/archive/2007/09/03/879807.html