Oracle Data Import Export IMP/EXP Function: Oracle data import and export imp/exp is comparable with Oracle data restore and backup. In most cases, the data can be backed up and restored with Oracle data import and export (no loss of data). Oracle has a benefit, although your computer is not a server, but you installed the Oracle client, and established a connection (through the Net Configuration Assistant add the correct service naming, in fact, you can think of the client and the server side to fix the road, Then the data can be pulled over) so you can export the data locally, although the server may be far away from you. You can also import DMP files from a local to a remote 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 executed because in Oracle 8i installation directory \ $ora 10g\bin is set to the global path, This directory has EXP.EXE and IMP.EXE files that are used to perform import and export. Oracle is written in Java, I want to SQLPLUS.EXE, EXP. EXE, IMP. EXE these two files are packaged after the class file. SQLPLUS. EXE calls EXP.EXE, IMP. EXE They wrap the class, complete the import and export function. The following is an example of importing and exporting, and seeing an instance of import and export is basically done, because importing and exporting is simple. Data export: 1 full export of database test, user Name System Password Manager exported to D:\DAOCHU.DMP exp system/[email protected] File=d:\ DAOCHU.DMP full=y 2 Exports the table of system user and SYS user in the database exp system/[email protected] File=d:\daochu.dmp owner= ( System,sys) 3 Add the tables in the database table1, table2 export exp system/[email protected] file=d:\daochu.dmp tables= (table1 , table2) 4 exports the fields from table table1 in the database filed1 data that begins with "00" Exp System/[email&nbsP;protected] file=d:\daochu.dmp tables= (table1) query=\ "where filed1 like ' 00% ' \" Above is a common export, for compression I do not care, with WinZip to the DMP file can be very good compression. but add compress=y to the upper order.
Import of data 1 import the data from the D:\DAOCHU.DMP into the test database. Imp System/[email protected] file=d:\daochu.dmp above may be a problem, because some tables already exist, and then it is an error, the table will not be imported. Add Ignore=y to the back. 2 Import the table table1 in d:\daochu.dmp imp system/[email protected] file=d:\daochu.dmp tables= (table1) basically the above import and export is enough. In many cases I have completely removed the table and then imported it. Note: You need to have sufficient permissions to have enough permissions and it will prompt you. Database, you can connect to the. You can use tnsping test to get the database test to connect.
Data export: Exp hkb/[email protected]_14 full=y file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbfull.log;
Export considerations: Export the current user's data, if the current user has DBA authority, then export all the data!
Data import between users with the same name: Imp hkb/[email protected] file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbimp.log full=y
Data import between different names: Imp system/[email protected] FROMUSER=HKB touser=hkb_new file=c:\orabackup\hkbfull.dmp
Log=c:\orabackup\hkbimp.log;
Oracle database Import and Export command!