利用rman快速搭建standby
c:\rman target / catalog paultest/paultest@dev89
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PAUL (DBID=1605165889)
connected to recovery catalog database
RMAN> backup full database include current controlfile for standby;
Starting backup at 19-DEC-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including standby controlfile in backupset
input datafile fno=00001 name=D:\ORACLE\ORADATA\PAUL\SYSTEM01.DBF
input datafile fno=00002 name=D:\ORACLE\ORADATA\PAUL\UNDOTBS01.DBF
input datafile fno=00003 name=D:\ORACLE\ORADATA\PAUL\INDX01.DBF
input datafile fno=00005 name=D:\ORACLE\ORADATA\PAUL\USERS01.DBF
input datafile fno=00004 name=D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF
input datafile fno=00006 name=D:\TEST01_P.DBF
input datafile fno=00007 name=D:\TEST02_P.DBF
input datafile fno=00008 name=D:\TEST03_P.ORA
channel ORA_DISK_1: starting piece 1 at 19-DEC-07
channel ORA_DISK_1: finished piece 1 at 19-DEC-07
piece handle=D:\BACKUP\1QJ4078T_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 19-DEC-07
Starting Control File and SPFILE Autobackup at 19-DEC-07
piece handle=D:\BACKUP\C-1605165889-20071219-02 comment=NONE
Finished Control File and SPFILE Autobackup at 19-DEC-07
RMAN>
Recovery Manager complete.
注意要執行以下語句,要不在用dulicate target database for standby 命令時,會產生一下錯誤
sql statement: alter database mount standby database
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/19/2007 12:10:23
RMAN-05507: standby controlfile checkpoint (849056) is more recent than duplication point in time (848440)
SQL> alter system archive log current;
System altered.
將產生的備份檔案複製到備用庫相同 d:\backup目錄下
在主庫上執行
c:\rman target / auxiliary
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PAUL (DBID=1605165889)
connected to auxiliary database: paul (not mounted)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 19-DEC-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=11 devtype=DISK
printing stored script. Memory Script
{
restore clone standby controlfile to clone_cf;
replicate clone controlfile from clone_cf;
sql clone 'alter database mount standby database';
}
executing script. Memory Script
Starting restore at 19-DEC-07
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
output filename=D:\ORACLE\ORADATA\PAUL\CONTROL01.CTL
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\1QJ4078T_1_1 tag=TAG20071219T115925 params=NULL
channel ORA_AUX_DISK_1: restore complete
Finished restore at 19-DEC-07
replicating controlfile
input filename=D:\ORACLE\ORADATA\PAUL\CONTROL01.CTL
output filename=D:\ORACLE\ORADATA\PAUL\CONTROL02.CTL
output filename=D:\ORACLE\ORADATA\PAUL\CONTROL03.CTL
sql statement: alter database mount standby database
printing stored script. Memory Script
{
set until scn 849370;
set newname for datafile 1 to
"D:\ORACLE\ORADATA\PAUL\SYSTEM01.DBF";
set newname for datafile 2 to
"D:\ORACLE\ORADATA\PAUL\UNDOTBS01.DBF";
set newname for datafile 3 to
"D:\ORACLE\ORADATA\PAUL\INDX01.DBF";
set newname for datafile 4 to
"D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF";
set newname for datafile 5 to
"D:\ORACLE\ORADATA\PAUL\USERS01.DBF";
set newname for datafile 6 to
"D:\TEST01_P.DBF";
set newname for datafile 7 to
"D:\TEST02_P.DBF";
set newname for datafile 8 to
"D:\TEST03_P.ORA";
restore
check readonly
clone database
;
}
executing script. Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 19-DEC-07
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\PAUL\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\PAUL\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\PAUL\INDX01.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\PAUL\USERS01.DBF
restoring datafile 00006 to D:\TEST01_P.DBF
restoring datafile 00007 to D:\TEST02_P.DBF
restoring datafile 00008 to D:\TEST03_P.ORA
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\1QJ4078T_1_1 tag=TAG20071219T115925 params=NULL
channel ORA_AUX_DISK_1: restore complete
Finished restore at 19-DEC-07
printing stored script. Memory Script
{
switch clone datafile all;
}
executing script. Memory Script
datafile 2 switched to datafile copy
input datafilecopy recid=20 stamp=641736804 filename=D:\ORACLE\ORADATA\PAUL\UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafilecopy recid=21 stamp=641736804 filename=D:\ORACLE\ORADATA\PAUL\INDX01.DBF
datafile 4 switched to datafile copy
input datafilecopy recid=22 stamp=641736804 filename=D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF
datafile 5 switched to datafile copy
input datafilecopy recid=23 stamp=641736804 filename=D:\ORACLE\ORADATA\PAUL\USERS01.DBF
datafile 6 switched to datafile copy
input datafilecopy recid=24 stamp=641736804 filename=D:\TEST01_P.DBF
datafile 7 switched to datafile copy
input datafilecopy recid=25 stamp=641736804 filename=D:\TEST02_P.DBF
datafile 8 switched to datafile copy
input datafilecopy recid=26 stamp=641736804 filename=D:\TEST03_P.ORA
Finished Duplicate Db at 19-DEC-07
RMAN>
Recovery Manager complete.
然後在備庫啟用恢復管理模式:
sql>alter database recover managed standby database disconnect from session;
資料庫已更改;
注意地方:
1.首先需要在主庫進行一個RMAN備份,然後需要將備份傳送到備用資料庫和主庫相同的目錄下。
2.在備用主機建立監聽、必要的目錄結構、引數檔案,啟動例項到nomount狀態,然後就可以在主庫連線從庫進行恢復。
3.dulicate target database for standby 必須加上nofilenamecheck 引數,否則遇到相同檔名在做恢復時會報以下錯誤
sql statement: alter database mount standby database
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/19/2007 12:08:37
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary filename D:\TEST03_P.ORA conflicts with a file used by the target database
RMAN-05001: auxiliary filename D:\TEST02_P.DBF conflicts with a file used by the
RMAN>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-874/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 利用RMAN建立STANDBY資料庫資料庫
- 利用rman在同一臺機器上主庫online搭建standby
- Data Guard 之RMAN備份線上搭建物理standby
- ORACLE利用STANDBY端RMAN備份進行資料恢復Oracle資料恢復
- rman 建立ftp standbyFTP
- Rman backup standby databaseDatabase
- 利用docker快速搭建hexo部落格DockerHexo
- 利用RMAN搭建DATAGARD進行主備切換
- rman 建 Standby Database 筆記Database筆記
- 快速利用RecyclerView的LayoutManager搭建流式佈局View
- 通過rman在同一臺機器上搭建standby大致過程!
- 使用rman建立standby資料庫資料庫
- DataGuard搭建物理StandBy
- DataGuard搭建邏輯StandBy
- 使用RMAN建立物理Standby資料庫資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- 使用rman建立standby database的過程Database
- 使用RMAN建立STANDBY資料庫——RMAN使用者手冊資料庫
- 【DG】Data Guard搭建(physical standby)
- Using RMAN Incremental Backups to Refresh a Standby DatabaseREMDatabase
- 利用RMAN 建立 oracle dataguardOracle
- 利用RMAN做TSPITR
- 單例項Primary快速搭建Standby RAC參考手冊(19.16 ADG)單例
- 通過RMAN Duplicate建立Oracle物理standby備庫Oracle
- 同事總結的 : 用RMAN建立Physical Standby DatabaseDatabase
- 利用 FC + OSS 快速搭建 Serverless 實時按需影像處理服務Server
- RMAN不停機搭建DG
- ORA-17629:rman建立 standby資料庫時報錯資料庫
- 使用RMAN增量備份前滾STANDBY資料庫資料庫
- Using RMAN Incremental Backups to Roll Forward a Physical Standby DatabaseREMForwardDatabase
- Standby上執行RMAN報錯RMAN-10006錯誤處理
- Oracle RMAN快速入門指南Oracle
- 利用percona-xtrabackup快速搭建MySQL資料庫主從複製MySql資料庫
- vue 快速搭建Vue
- 快速搭建Fx
- 透過RMAN備份standby database成功恢復還原Database
- Creating a Physical Standby using RMAN DUPLICATE FROM ACTIVE DATABASEDatabase
- 11g RMAN新特性 active database duplication createing standbyDatabase