Oracle DB 10g+ Backup and Restore
2011年09月01日
Here's the steps for backup a db schema, which just applies to oracle database.
Suppose the osl schema is osl/welcome1, and the ORACLE_SID=orcl, then:
Export Schema (backup)
First, create directory expdir
SQL> CONNECT system/welcome1
SQL> CREATE OR REPLACE DIRECTORY expdir AS '/home/oracle/exp_data';
SQL> GRANT READ,WRITE ON DIRECTORY expdir TO PUBLIC;
Then use expdp
$ORACLE_HOME/bin/expdp osl/welcome1@orcl DUMPFILE=osl_bak.dmp DIRECTORY=expdir SCHEMAS=osl
Then you can copy the /home/oracle/exp_data/osl_bak.dmp to some other directory or some other machine to backup it.
Import Schema (restore)
First, create directoryexpdir (if you already created it, plz ignore this step)
Then delete the osl schema (beware of this step !!!)
SQL> CONNECT system/welcome1
SQL> DROP USER osl CASCADE;
Then use impdp
$ORACLE_HOME/bin/impdp osl/welcome1 DIRECTORY=expdir DUMPFILE=osl_bak.dmp
2011年09月01日
Here's the steps for backup a db schema, which just applies to oracle database.
Suppose the osl schema is osl/welcome1, and the ORACLE_SID=orcl, then:
Export Schema (backup)
First, create directory expdir
SQL> CONNECT system/welcome1
SQL> CREATE OR REPLACE DIRECTORY expdir AS '/home/oracle/exp_data';
SQL> GRANT READ,WRITE ON DIRECTORY expdir TO PUBLIC;
Then use expdp
$ORACLE_HOME/bin/expdp osl/welcome1@orcl DUMPFILE=osl_bak.dmp DIRECTORY=expdir SCHEMAS=osl
Then you can copy the /home/oracle/exp_data/osl_bak.dmp to some other directory or some other machine to backup it.
Import Schema (restore)
First, create directoryexpdir (if you already created it, plz ignore this step)
Then delete the osl schema (beware of this step !!!)
SQL> CONNECT system/welcome1
SQL> DROP USER osl CASCADE;
Then use impdp
$ORACLE_HOME/bin/impdp osl/welcome1 DIRECTORY=expdir DUMPFILE=osl_bak.dmp
本文详细介绍了如何使用OracleDB10g进行数据库的备份与恢复操作,包括创建目录、授权、导出、导入等关键步骤,确保数据库的安全性和可用性。
1005

被折叠的 条评论
为什么被折叠?



