Oracle Data Import Export IMP/EXP is equivalent to Oracle data restore and backup. The EXP command can export data from a remote database server to a local DMP file, and IMP commands the DMP file to be imported locally into a distant database server. With this feature, you can build two identical databases, one for testing and one for formal use.
Execution environment: can be executed in SQLPLUS.EXE or DOS (command line),
DOS can be performed because the install directory \ora81\bin in Oracle 8i is set to the global path,
There are EXP.EXE and IMP.EXE files under this directory that are used to perform import export.
Oracle is written in Java, Sqlplus. EXE, EXP. EXE, IMP. EXE these two files may be packaged after the class file.
Sqlplus. EXE call EXP.EXE, IMP. EXE package, complete the import and export function.
The following is an example of an import export.
Data export:
1 completely export database test, user Name System Password Manager exported to D:\daochu.dmp
Exp System/manager@test FILE=D:\DAOCHU.DMP full=y 2 Exports the tables of the system user and the SYS user in the database
Exp system/manager@test file=d:\daochu.dmp owner= (System,sys)
3 Export the table inner_notify, Notify_staff_relat in the database
Exp AICHANNEL/AICHANNEL@TESTDB2 file= d:\data\newsmgnt.dmp tables= (Inner_notify,notify_staff_relat)
4 Export the fields in the table table1 in the database filed1 with the data beginning with "00"
Exp system/manager@test file=d:\daochu.dmp tables= (table1) query=\ "where filed1 like ' 0% '"
The above is commonly used for export, for compression, both with WinZip to DMP file can be very good compression.
You can also implement it by adding compress=y to the command below.
Import of data
1 Import the data from D:\DAOCHU.DMP into the test database.
Imp system/manager@test file=d:\daochu.dmp
Imp aichannel/aichannel@hust full=y file=file= d:\data\newsmgnt.dmp ignore=y
There may be something wrong with it, because some tables already exist, and then it complains, and the table is not imported.
Just add ignore=y to the back.
2 Import the table table1 in D:\daochu.dmp
Imp system/manager@test file=d:\daochu.dmp tables= (table1)
Basically, the import export above is sufficient. In many cases, you should first delete the table completely and then import it.