LianTong rman資料庫恢復

rainbowbridg發表於2007-08-07

ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.1.0
ORACLE_SID=imps
#NLS_LANG=AMERICAN_AMERICA.UTF8
NLS_LANG=.UTF8
PATH=$ORACLE_HOME/bin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/usr/local/lib:/usr/lib
NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
TMPDIR=/var/tmp
LANG=en_US.UTF-8
export ORALCE_BASE ORACLE_HOME ORACLE_SID NLS_LANG PATH
export LD_LIBRARY_PATH DISPLAY TMPDIR LANG NLS_DATE_FORMAT
umask 022

1、啟動rman

c:>rman target sys/oracle nocatalog;

2、進行不完全恢復

恢復archive log 檔案:
RMAN> run {
allocate channel test type disk;
SET ARCHIVELOG DESTINATION TO '/oraarchive';
RESTORE ARCHIVELOG ALL;
release channel test;
}

恢復controlfile檔案:
RMAN> run {
    allocate channel test type disk;
    restore controlfile to 'd:control.ctl';
release channel test;
   }

恢復資料檔案:
RMAN> run {
set until time='2005-02-17 15:01:20';
restore database;
recover database;
alter database open resetlogs;
}

3、資料庫恢復成功

SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
BONUS
DEPT
EMP
EMPCOPY
EMPCOPY1
EMPCOPY2
EMPCOPY3
EMPCOPY4
SALGRADE

注意:需要所有的archivelog 檔案及所有的備份檔案

4、重新註冊rman

RMAN> register database;
RMAN> list incarnation of database;
RMAN> reset database;
RMAN> list incarnation of database;

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7916042/viewspace-933264/,如需轉載,請註明出處,否則將追究法律責任。

相關文章