To recover a shell script for an Oracle database using the IMPDP method

Source: Internet
Author: User
Tags character set
Use Oracle users to execute the following script:
#!/bin/bash
source/etc/profile

export Nls_lang=american_america. ZHS16GBK
#Oracle的字符集, the Chinese character set for the Oracle database is American_america. ZHS16GBK

#Oracle数据库的根目录
export oracle_base=/u01/app/oracle
export oracle_home=/u01/app/oracle/ Product/12.1.0/db_1
export ORACLE_SID=ORCL

export path= $ORACLE _home/bin: $PATH

cd/u01/dpdata/


Sqlplus-silent/nolog <<eof
conn/as sysdba;
Shutdown immediate;
startup;
Drop User C # #FMMP Cascade;
@0_deleteolduserandtablespace. SQL
@1_createtablespace. SQL
@2_createuser. SQL
exit;
EOF

#impdp C # #FMMP/"*********" @orcl directory=dpdata schemas=c# #FMMP dumpfile=orcl_ ' Date +%y%m%d '. DMP logfile= Impdp_orcl_ ' Date +%y%m%d '. Log
#导出当日的数据库的数据并写日志. If for 2012-12-17, the data file is Orcl_20121217.dmp, the log is Orcl_20121217.log

IMPDP C # #FMMP/"*********" @orcl directory=dpdata schemas=c# #FMMP dumpfile=orcl_20170805.dmp Logfile=impdp_orcl_20170805.log

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.