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 the local --> service name in net8 Assistant
In fact, you can think of a path between the client and the server, and then the data can be pulled.) in this way, you can export the 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: In sqlplus. execute in EXE or DoS (command line). When dos can be executed, the \ ora81 \ bin directory in Oracle 8i is set to a global path, and exp exists in this directory. EXE and imp. the EXE file is 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. The user name GDOA password 123 is exported to D: \ test_bk.dmp.
Exp GDOA/123 @ test file = D: \ test_bk.dmp full = y
Or exp GDOA/123 @ test file = D: \ test_bk.dmp
2. Export the tables of GDOA users and SYS users in the database
Exp GDOA/123 @ test file = D: \ test_bk.dmp owner = (GDOA, sys)
3. Export tables Table1 and Table2 in the database
Exp GDOA/123 @ test file = D: \ test_bk.dmp tables = (Table1, table2)
4. Export the data with the field filed1 in table 1 in the database starting with "00"
Exp GDOA/123 @ test file = D: \ test_bk.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.
Import data 1: import data from D: \ test_bk.dmp to the test database.
Imp gdoa/123 @ test file = D: \ test_bk.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: \ test_bk.dmp
Imp gdoa/123 @ test file = D: \ test_bk.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.
the database can be connected. You can use tnsping test to obtain whether the database test can be connected.