使用 RMAN 將資料庫還原到其他主機
您可以使用 RMAN 將資料庫還原到其他主機。
使用 RMAN 將資料庫還原到其他主機
sqlplus <rman user>/<rman password>@<rman service> SQL> select db_key, db_id, bs_key, recid, stamp, backup_type, start_time, status from rc_backup_set;
SVRMGR> select file#, name from v$data file;
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=kernel。
SVRMGR> startup nomount pfile=$ORACLE_HOME/dbs/init<$ORACLE_SID>.ora
附註: 您會需要用到在步驟 2 中所取得的 db_id。
rman rcvcat <rman username>/<rman password>@<rman service>
RMAN> set dbid=<source database db_id value>
RMAN> connect target <username>/<password>;
RMAN> run {
RMAN> allocate channel dev1 type 'sbt_tape';
RMAN> restore controlfile;
RMAN> release channel dev1;
RMAN> }
SVRMGR> alter database mount;
rman target <username>/<password> rcvcat <rman username>/<rman password>@<rman service>
RMAN> run {
RMAN> allocate channel dev1 type 'sbt_tape';
RMAN> set newname for data file 1 to '<new path>'
RMAN> set newname for data file 2 to '<new path>'
...
RMAN> restore database;
RMAN> switch data file all;
RMAN> release channel dev1;
SVRMGR> recover database using backup controlfile until cancel;
SVRMGR> alter database open resetlogs;
SVRMGR> alter database rename file <online redo log #1 path> to <online redo log #1 new path>; ... SVRMGR> alter database rename file <online redo log #n path> to <onlne redo log #n new path>;
SVRMGR> alter database open resetlogs;
Copyright © 2013 CA.
All rights reserved.
|
|