RMAN异机复制数据库(相同路径)
有完整的備份,新的數據庫datafile、controfile、logfile所在目錄結構和原數據庫一樣。
創建好adump、bdump、cdump、udump等目錄。
?
?
1、恢復參數文件。
設置環境變量:
export ORACLE_SID=HNCDFHQ
?
登錄RMAN:
rman target /
?
在RMAN里把數據庫起到nomount狀態:
RMAN> ?startup nomount;
?
設置DBID:
RMAN> ?set dbid=3931082997
?
恢復spfile:
RMAN> ?restore spfile from '/backup/test/c-3931082997-20131204-02';
?
關閉數據庫:
RMAN> ?shutdown immediate;
?
把數據庫起到nomount狀態:
RMAN> ?startup nomount;
?
?
2、恢復控制文件。
RMAN> ?restore controlfile from '/backup/test/ctl_HNCDFHQ_20131204_21_1';
?
把數據庫啟動到mount狀態:
RMAN> ?alter database mount;
?
?
3、恢復數據文件:
如果備份不在備份時所在的目錄,在新的目錄。
可以用此命令注冊到控制文件。
?
?
RMAN> ?catalog start with '/oradata1/backup';
?
?
?
restore數據庫:
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?數據庫:
RMAN> ?recover database;
?
?
SQL> ?recover database until cancel using backup controlfile ;
--選擇redo的絕對路徑,一個一個試,有多少組redo,就試多少次
?
SQL> ?alter database open resetlogs;
?
?
?
轉載于:https://www.cnblogs.com/liang545621/p/9405901.html
總結
以上是生活随笔為你收集整理的RMAN异机复制数据库(相同路径)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SEO算法:如何通过PageRank算法
- 下一篇: 介绍一下opentcs