RMAN不停機搭建DG
前面pfile引數等配置 參考如下:
http://blog.itpub.net/29990276/viewspace-1683772/
點選( 此處 )摺疊或開啟
-
run{
-
allocate channel c1 type disk ;
-
allocate channel c2 type disk ;
-
sql 'alter system archive log current' ;
-
backup format '/backup/db_%U_%T' skip inaccessible filesperset 5 database ;
-
sql 'alter system archive log current' ;
-
backup format '/backuparch/arch_%U_%T' skip inaccessible filesperset 5 archivelog all delete input ;
-
backup current controlfile for standby format = '/backup/control_%U' ;
-
release channel c1 ;
-
release channel c2 ;
-
}
scp備份集到備庫相應的目錄
點選( 此處 )摺疊或開啟
-
[ oracle@primary backuparch ] $ scp * 192 . 168 . 6 . 31 : / backuparch/
-
oracle@192 . 168 . 6 . 31 's password:
-
arch_05q8hd9e_1_1_20150603 100% 61MB 15.2MB/s 00:04
-
arch_06q8hd9e_1_1_20150603 100% 9477KB 9.3MB/s 00:00
-
arch_07q8hd9f_1_1_20150603 100% 66MB 16.5MB/s 00:04
-
arch_08q8hd9g_1_1_20150603 100% 12MB 12.3MB/s 00:00
-
[oracle@primary backuparch]$ cd /backup
-
[ oracle@primary backup ] $ ll
-
total 1154188
-
- rw - r - - - - - 1 oracle oinstall 9797632 Jun 3 02 : 15 control_09q8hd9i_1_1
-
- rw - r - - - - - 1 oracle oinstall 711983104 Jun 3 02 : 15 db_01q8hd8h_1_1_20150603
-
- rw - r - - - - - 1 oracle oinstall 449028096 Jun 3 02 : 15 db_02q8hd8h_1_1_20150603
-
- rw - r - - - - - 1 oracle oinstall 9797632 Jun 3 02 : 15 db_03q8hd9a_1_1_20150603
-
- rw - r - - - - - 1 oracle oinstall 98304 Jun 3 02 : 15 db_04q8hd9a_1_1_20150603
-
[ oracle@primary backup ] $ scp * 192 . 168 . 6 . 31 : / backup
-
oracle@192 . 168 . 6 . 31's password:
-
...
-
...
備庫duplicate登陸
點選( 此處 )摺疊或開啟
-
[ oracle@standby ~ ] $ rman target sys/oracle@bj auxiliary sys/oracle@sh
-
-
Recovery Manager : Release 11 . 2 . . 3 . 0 - Production on Tue Jun 2 11 : 18 : 17 2015
-
-
Copyright ( c ) 1982 , 2011 , Oracle and / or its affiliates . All rights reserved .
-
-
connected to target database : BEIJING ( DBID = 845781194 )
-
connected to auxiliary database : BEIJING ( not mounted )
點選( 此處 )摺疊或開啟
-
RMAN > duplicate target database for standby nofilenamecheck dorecover ;
-
-
Starting Duplicate Db at 02 - JUN - 15
-
using target database control file instead of recovery catalog
-
allocated channel : ORA_AUX_DISK_1
-
channel ORA_AUX_DISK_1 : SID = 19 device type = DISK
-
-
contents of Memory Script :
-
{
-
set until scn 1134882 ;
-
restore clone standby controlfile ;
-
}
-
executing Memory Script
-
-
executing command : SET until clause
-
-
Starting restore at 02 - JUN - 15
-
using channel ORA_AUX_DISK_1
-
-
channel ORA_AUX_DISK_1 : starting datafile backup set restore
-
channel ORA_AUX_DISK_1 : restoring control file
-
channel ORA_AUX_DISK_1 : reading from backup piece /backup/db_03q8hd9a_1_1_20150603
-
channel ORA_AUX_DISK_1 : piece handle = / backup/db_03q8hd9a_1_1_20150603 tag = TAG20150603T021440
-
channel ORA_AUX_DISK_1 : restored backup piece 1
-
channel ORA_AUX_DISK_1 : restore complete , elapsed time : 00 : 00 : 02
-
output file name = / u01/app/oracle/oradata/shanghai/control01 . ctl
-
output file name = / u01/app/oracle/fast_recovery_area/shanghai/control02 . ctl
-
Finished restore at 02 - JUN - 15
-
-
contents of Memory Script :
-
{
-
sql clone 'alter database mount standby database' ;
-
}
-
executing Memory Script
-
-
sql statement : alter database mount standby database
-
-
contents of Memory Script :
-
{
-
set until scn 1134882 ;
-
set newname for tempfile 1 to
-
"/u01/app/oracle/oradata/shanghai/temp01.dbf" ;
-
switch clone tempfile all ;
-
set newname for datafile 1 to
-
"/u01/app/oracle/oradata/shanghai/system01.dbf" ;
-
set newname for datafile 2 to
-
"/u01/app/oracle/oradata/shanghai/sysaux01.dbf" ;
-
set newname for datafile 3 to
-
"/u01/app/oracle/oradata/shanghai/undotbs01.dbf" ;
-
set newname for datafile 4 to
-
"/u01/app/oracle/oradata/shanghai/users01.dbf" ;
-
set newname for datafile 5 to
-
"/u01/app/oracle/oradata/shanghai/example01.dbf" ;
-
restore
-
clone database
-
;
-
}
-
executing Memory Script
-
-
executing command : SET until clause
-
-
executing command : SET NEWNAME
-
-
renamed tempfile 1 to /u01/app/oracle/oradata/shanghai/temp01 . dbf in control file
-
-
executing command : SET NEWNAME
-
-
executing command : SET NEWNAME
-
-
executing command : SET NEWNAME
-
-
executing command : SET NEWNAME
-
-
executing command : SET NEWNAME
-
-
Starting restore at 02 - JUN - 15
-
using channel ORA_AUX_DISK_1
-
-
channel ORA_AUX_DISK_1 : starting datafile backup set restore
-
channel ORA_AUX_DISK_1 : specifying datafile ( s ) to restore from backup set
-
channel ORA_AUX_DISK_1 : restoring datafile 00001 to /u01/app/oracle/oradata/shanghai/system01 . dbf
-
channel ORA_AUX_DISK_1 : restoring datafile 00005 to /u01/app/oracle/oradata/shanghai/example01 . dbf
-
channel ORA_AUX_DISK_1 : reading from backup piece /backup/db_01q8hd8h_1_1_20150603
-
channel ORA_AUX_DISK_1 : piece handle = / backup/db_01q8hd8h_1_1_20150603 tag = TAG20150603T021440
-
channel ORA_AUX_DISK_1 : restored backup piece 1
-
channel ORA_AUX_DISK_1 : restore complete , elapsed time : 00 : 00 : 15
-
channel ORA_AUX_DISK_1 : starting datafile backup set restore
-
channel ORA_AUX_DISK_1 : specifying datafile ( s ) to restore from backup set
-
channel ORA_AUX_DISK_1 : restoring datafile 00002 to /u01/app/oracle/oradata/shanghai/sysaux01 . dbf
-
channel ORA_AUX_DISK_1 : restoring datafile 00003 to /u01/app/oracle/oradata/shanghai/undotbs01 . dbf
-
channel ORA_AUX_DISK_1 : restoring datafile 00004 to /u01/app/oracle/oradata/shanghai/users01 . dbf
-
channel ORA_AUX_DISK_1 : reading from backup piece /backup/db_02q8hd8h_1_1_20150603
-
channel ORA_AUX_DISK_1 : piece handle = / backup/db_02q8hd8h_1_1_20150603 tag = TAG20150603T021440
-
channel ORA_AUX_DISK_1 : restored backup piece 1
-
channel ORA_AUX_DISK_1 : restore complete , elapsed time : 00 : 00 : 15
-
Finished restore at 02 - JUN - 15
-
-
contents of Memory Script :
-
{
-
switch clone datafile all ;
-
}
-
executing Memory Script
-
-
datafile 1 switched to datafile copy
-
input datafile copy RECID = 4 STAMP = 881320957 file name = / u01/app/oracle/oradata/shanghai/system01 . dbf
-
datafile 2 switched to datafile copy
-
input datafile copy RECID = 5 STAMP = 881320957 file name = / u01/app/oracle/oradata/shanghai/sysaux01 . dbf
-
datafile 3 switched to datafile copy
-
input datafile copy RECID = 6 STAMP = 881320957 file name = / u01/app/oracle/oradata/shanghai/undotbs01 . dbf
-
datafile 4 switched to datafile copy
-
input datafile copy RECID = 7 STAMP = 881320957 file name = / u01/app/oracle/oradata/shanghai/users01 . dbf
-
datafile 5 switched to datafile copy
-
input datafile copy RECID = 8 STAMP = 881320957 file name = / u01/app/oracle/oradata/shanghai/example01 . dbf
-
-
contents of Memory Script :
-
{
-
set until scn 1134882 ;
-
recover
-
standby
-
clone database
-
delete archivelog
-
;
-
}
-
executing Memory Script
-
-
executing command : SET until clause
-
-
Starting recover at 02 - JUN - 15
-
using channel ORA_AUX_DISK_1
-
-
starting media recovery
-
-
channel ORA_AUX_DISK_1 : starting archived log restore to default destination
-
channel ORA_AUX_DISK_1 : restoring archived log
-
archived log thread = 1 sequence = 14
-
channel ORA_AUX_DISK_1 : restoring archived log
-
archived log thread = 1 sequence = 15
-
channel ORA_AUX_DISK_1 : reading from backup piece /backuparch/arch_08q8hd9g_1_1_20150603
-
channel ORA_AUX_DISK_1 : piece handle = / backuparch/arch_08q8hd9g_1_1_20150603 tag = TAG20150603T021509
-
channel ORA_AUX_DISK_1 : restored backup piece 1
-
channel ORA_AUX_DISK_1 : restore complete , elapsed time : 00 : 00 : 01
-
archived log file name = / arch/1_14_881314188 . dbf thread = 1 sequence = 14
-
channel clone_default : deleting archived log ( s )
-
archived log file name = / arch/1_14_881314188 . dbf RECID = 1 STAMP = 881320959
-
archived log file name = / arch/1_15_881314188 . dbf thread = 1 sequence = 15
-
channel clone_default : deleting archived log ( s )
-
archived log file name = / arch/1_15_881314188 . dbf RECID = 2 STAMP = 881320959
-
media recovery complete , elapsed time : 00 : 00 : 00
-
Finished recover at 02 - JUN - 15
-
Finished Duplicate Db at 02 - JUN - 15
中間有
alter database mount standby database;過程,一條命令搞定所有,但是不會做路徑的轉換,這時我們在pfile新增covert。
執行之後,資料庫是mount狀態,這時候我們就可以開啟備庫了。
點選( 此處 )摺疊或開啟
-
SQL > alter database open ;
-
-
Database altered .
-
-
SQL > select open_mode from v$database ;
-
-
OPEN_MODE
-
- - - - - - - - - - - - - - - - - - - -
-
READ ONLY
新增standby redo log和online redo log
應用
點選( 此處 )摺疊或開啟
-
SQL > alter database recover managed standby database disconnect from session ;
-
-
Database altered .
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-1684408/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman duplicate搭建第二個 dg
- 主庫不停做物理dg
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- 實戰不停機搭建ORACLE DataGuardOracle
- 10g+dg+rman+windows(借鑑rman方式做dg)Windows
- DG搭建
- RMAN遠端複製搭建物理DG過程小結
- 【DG】搭建(一)
- DG搭建配置方案
- Oracle RAC+DG搭建Oracle
- DG RAC - 單點搭建
- ora11_node_dg(1)DG搭建過程
- 物理DG、邏輯DG和快照DG的搭建(視訊講解)
- DG rman duplicate 複製庫錯誤
- 【DG】在Linux平臺上搭建單例項的dataguard--rman還原方式Linux單例
- 不停機 data guard 以及 switchover
- 【DG】Data Guard搭建(physical standby)
- dg搭建 單點-單點
- Oracle DG搭建1(duplicate方式)Oracle
- ORACLE DG 11G 搭建Oracle
- ORACLE DG從庫 Rman備份恢復Oracle
- ora11_node_dg(4)主庫當機後,從庫升為主庫,重新搭建DG
- 一步一步搭建11gR2 rac+dg之DG 機器配置(七)
- 【DG】Oracle 19c使用dbca來搭建物理DGOracle
- 搭建DG過程由於沒有口令檔案而導致rman連不上主庫
- 11G RAC+DG搭建
- 在dg庫上搭建ogg
- Oracle DG搭建2(冷備方式)Oracle
- 搭建RAC到單例項DG單例
- FAILOVER後DG的重新搭建AI
- RAC搭建DG-生產端控制檔案和聯機日誌檔案傳至DG端-實現DG端資料庫open資料庫
- Oracle DG從庫 Rman備份恢復測試Oracle
- 【DG】搭建(二)及相關測試
- oracle11g 搭建 rac+dgOracle
- oracle 11g dg搭建筆記Oracle筆記
- oracle DG支援搭建的平臺列表Oracle
- mysql之 mysql 5.6不停機主從搭建(一主一從基於GTID複製)MySql
- 利用rman快速搭建standby