Basic commands for Oracle database backup and Recovery

Source: Internet
Author: User

Oracle database Backup and restore basic commands

1. Get Help

$ exp Help=y

$ imp help=y

2. Three ways of working

(1) Interactive mode

$ exp Then follow the prompts to enter the required parameters

(2) command line mode

$ exp User/[email protected] file=/oracle/test.dmp full=y

Enter the required parameters in the command line

(3) Oracle database Backup and recovery we're going to go. Related to parameter file mode

$ exp Parfile=username.par

Enter the required parameters in the parameter file

Parameter file Username.par content Userid=username/userpassword buffer=8192000

Compress=n grants=y

File=/oracle/test.dmp full=y

3, three modes

(1) Table mode, export/import the data of the specified table.

Export: Export one or several tables: $ exp user/pwd file=/dir/xxx.dmp Log=xxx.log tables=table1,table2

Export part of a table's data

$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=\ "where col1=\ ' ... \ ' and col2 \<...\"

Import: Import one or several tables

$ imp user/pwd file=/dir/xxx.dmp log=xxx.log Tables=table1,

Table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y

(2) User mode, all objects and data of the specified user are exported/imported.

Export: $ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner= (xx, yy)

Export Data Objects only, do not export data (rows=n)

$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=user rows=n

Import: $ imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2

Commit=y Ignore=y

(3) All objects in the database are exported/imported as a whole library:

$ exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y

Import: $ imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2

The above is an introduction to the basic commands related to Oracle database backup and recovery, and hope you will reap some of the benefits.

Shaanxi Heavy Steam Backup SQL statements are:

Exp Sxzq/[email protected] file=d:/sxzq20140720.dmp log=sxzq20140720.log full=y
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.