How to import and export dmp files under Linux

  • 2020-06-12 11:36:19
  • OfStack

preface

With the oracle client installed on this machine, the following commands can be executed on dos, although the dmp file is exported locally.

But in the actual development, no one wants to install the huge oracle software on their own, so you need to use Xshell/puTTY..

The remote tool connects to Linux to do the import and export of dmp files on Linux.

The body of the

a. Exports the User system user table to the D disk in the specified path


exp system/password@SID file=d:/daochu.dmp full=y 

b. Exports the tables for users system and sys to the D disk in the specified path


exp system/password@SID file=d:/daochu.dmp owner=(system,sys) 

c. Exports the tables table_A and table_B in user system to the D disk in the specified path


exp system/password@SID file= d:/daochu.dmp tables=(table_A,table_B) 

d. Export the data starting with "00" from the field filed1 in table table1 in user system


exp system/passwor@SID filed=d:/daochu.dmp tables=(table1) query=/" where filed1 like '00%'/" 

For compression, the dmp file can be compressed using winzip, or it can be added after the above command compress=y To implement.

The exported DMP file is suitable for full migration of large databases, requires 1 character set for both server databases before and after migration, and is not friendly to CLOB field support.

For the export of small data, PLSQL can actually do better, faster, the export of SQL is also intuitive.

e. Import the data from D:/ daochu.dmp into the TEST database.


imp system/password@SID file=d:/daochu.dmp 
imp system/password@HUST full=y file=d:/data/newsmgnt.dmp ignore=y 

If there is a problem with the above command, assuming that some tables already exist, you can not import the table and add it later ignore=y .

f. Import table table1 from d:/ daochu.dmp


imp system/passord@SID file=d:/daochu.dmp tables=(table1)

conclusion


Related articles: