Oracle database Backup and Restore command--exp/imp

Source: Internet
Author: User

Data export:

1 full export of database test, user Name System Password Manager exported to D:\daochu.dmp

  file=d:\daochu.dmp full=y

2 Exporting the system user in the database to the SYS user's table

file=d:\daochu.dmp owner= (System,sys)

3 Exporting Tables Table1, table2 in the database

  file=d:\daochu.dmp tables= (table1,table2)

4 Export the field filed1 in table table1 in the database with data beginning with "00"

  file=d:\daochu.dmp tables= (table1) query=\"  where filed1 like ' 00% ' \"

The 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.

  file=d:\daochu.dmp

There may be a problem, because some tables already exist, and then it is an error, and the table is not imported.

Add Ignore=y to the back.

2 Import the table table1 in D:\daochu.dmp

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.

Attention:

You need to have enough permissions, not 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

Appendix I:

Adding permissions to the import data to the user

First, start sql*puls

Second, landing with System/manager

Third, create user username identified by password (this step can be omitted if the user has already been created)

IV, GRANT create User,drop user,alter USER, create any VIEW,

DROP any view,exp_full_database,imp_full_database,

Dba,connect,resource,create SESSION to User name

V, run-cmd-into the directory where the DMP file is located,

Imp Userid=system/manager full=y file=*.dmp

or imp Userid=system/manager full=y file=filename.dmp

Oracle database Backup and Restore command--exp/imp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.