Methods for Oracle Backup (EXPDP, exp) and restore (imp, IMPDP)

Source: Internet
Author: User
Tags import database

Oracle Backup (exp, EXPDP)

--Export Tables by user
EXPDP Bdcdj/[email protected] SCHEMAS=BDCDJ directory=a dumpfile=bdcdj.dmp
--Export table by table name
EXPDP Scott/[email protected] tables=emp,dept dumpfile=expdp.dmp directory=dpdata1;
--Export Tables by query criteria
EXPDP Scott/[email protected] directory=dpdata1 dumpfile=expdp.dmp tables=emp query= ' WHERE deptno=20 ';
--Export tables by table space
EXPDP System/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=temp,example;
--Guide the entire database
EXPDP System/manager directory=dpdata1 dumpfile=full.dmp full=y;

--Normal backup
Exp Bdcdj/[email protected] file=e:\bdcdj.dmp OWNER=BDCDJ
--Normal backup single sheet
Exp System/[email protected] file=d:\daochu.dmp tables= (table1,table2)

--------------------------------------------------------------------------------------------------------------- -------

Oracle Restore (IMP, IMPDP)

--Import Table
IMPDP Sde/[email protected] SCHEMAS=BDCDJ directory=a dumpfile=bdcdj.dmp
--Import Table space
IMPDP System/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=example;
--Import Database
IMPDP System/manager directory=dump_dir dumpfile=full.dmp full=y;
--Append Data
IMPDP system/manager directory=dpdata1 dumpfile=expdp.dmp schemas=system table_exists_action
--Change the owner of the table
IMPDP system/manager directory=dpdata1 dumpfile=expdp.dmp tables=scott.dept remap_schema=scott:system;

--Restore a single table
Imp sde/[email protected] file=e:\xx.dmp tables= table name
Imp sde/[email protected] file=e:\sde_t_xtsz.dmp Tables=t_xtsz

--Normal restore
Imp sde/[email protected] file=e:\nb\sde.dmp fromuser=sde touser=sde buffer=99999999 log= ' E:\nb\sde.log '
--2 Import the table table1 in D:\daochu.dmp
Imp system/[email protected] file=d:\daochu.dmp tables= (table1)

Note: This is what I use at work. This is usually the usual backup restore. I hope we have a reference for you. Note The buffer=99999999 is due to the large case of the imported database file. To prevent the loss of data. If fewer tables are found at restore time. My suggestion is to restore the empty template library again. This will all be restored.

Methods for Oracle Backup (EXPDP, exp) and restore (imp, IMPDP)

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.