RMAN异机复制数据库(相同路径)
有完整的備份,新的數(shù)據(jù)庫datafile、controfile、logfile所在目錄結(jié)構(gòu)和原數(shù)據(jù)庫一樣。
創(chuàng)建好adump、bdump、cdump、udump等目錄。
?
?
1、恢復(fù)參數(shù)文件。
設(shè)置環(huán)境變量:
export ORACLE_SID=HNCDFHQ
?
登錄RMAN:
rman target /
?
在RMAN里把數(shù)據(jù)庫起到nomount狀態(tài):
RMAN> ?startup nomount;
?
設(shè)置DBID:
RMAN> ?set dbid=3931082997
?
恢復(fù)spfile:
RMAN> ?restore spfile from '/backup/test/c-3931082997-20131204-02';
?
關(guān)閉數(shù)據(jù)庫:
RMAN> ?shutdown immediate;
?
把數(shù)據(jù)庫起到nomount狀態(tài):
RMAN> ?startup nomount;
?
?
2、恢復(fù)控制文件。
RMAN> ?restore controlfile from '/backup/test/ctl_HNCDFHQ_20131204_21_1';
?
把數(shù)據(jù)庫啟動(dòng)到mount狀態(tài):
RMAN> ?alter database mount;
?
?
3、恢復(fù)數(shù)據(jù)文件:
如果備份不在備份時(shí)所在的目錄,在新的目錄。
可以用此命令注冊(cè)到控制文件。
?
?
RMAN> ?catalog start with '/oradata1/backup';
?
?
?
restore數(shù)據(jù)庫:
RMAN> ?
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
restore database ;
}
?
recover?數(shù)據(jù)庫:
RMAN> ?recover database;
?
?
SQL> ?recover database until cancel using backup controlfile ;
--選擇redo的絕對(duì)路徑,一個(gè)一個(gè)試,有多少組redo,就試多少次
?
SQL> ?alter database open resetlogs;
?
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/liang545621/p/9405901.html
總結(jié)
以上是生活随笔為你收集整理的RMAN异机复制数据库(相同路径)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SEO算法:如何通过PageRank算法
- 下一篇: Redis相关链接