- Oracle Data Guard 11gR2 Administration Beginner's Guide
- Emre Baransel Nassyam Basha
- 470字
- 2021-08-13 17:12:26
Time for action – running an RMAN duplicate
Perform the following steps to create a standby database with the RMAN duplicate method:
- Check the primary database status; it must be either
open
ormount
.SQL> select db_unique_name,database_role,open_mode from v$database; DB_UNIQUE_ DATABASE_ROLE OPEN_MODE ---------- ---------------- -------------------- turkey_un PRIMARY READ WRITE
- Run the RMAN command from the standby system. Connect the primary and standby instances using Oracle Net Service names.
[oracle@oracle-stbydbs]$ rman target sys/free2go@turkey auxiliary sys/free2go@india Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 26 18:41:06 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1316772835) connected to auxiliary database: ORCL (not mounted)
RMAN will show the connected sessions as shown previously, which provided the primary status—either
open
ormounted
. Also, standby is in theNOMOUNT
status. - Now execute the
DUPLICATE
command.RMAN> duplicate target database for standby from active database;
The output will be similar to the one as shown in the following screenshot:
The tail of the output logfile will be as follows:
Starting Duplicate Db at 26-JUL-12 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: { backup as copy current controlfile for standby auxiliary format '/u02/app/oracle/oradata/orcl/control01.ctl'; restore clone controlfile to '/u02/app/oracle/flash_recovery_area/orcl/control02.ctl' from '/u02/app/oracle/oradata/orcl/control01.ctl'; } executing Memory Script .... sql statement: alter database mount standby database ... Starting backup at 26-JUL-12 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf output file name=/u02/app/oracle/oradata/orcl/system01.dbf tag=TAG20120726T160751 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:04 channel ORA_DISK_1: starting datafile copy ... sql statement: alter system archive log current contents of Memory Script: { switch clone datafile all; } executing Memory Script datafile 1 switched to datafile copy input datafile copy RECID=2 STAMP=789667774 file name=/u02/app/oracle/oradata/orcl/system01.dbf ... Finished Duplicate Db at 26-JUL-12
Tip
When a restore is in progress, you can monitor how much is complete and how much is still pending using the
v$session_longops
view from the primary database. - Configure the primary database initialization parameters required for Data Guard.
SQL> alter system set log_archive_dest_2='SERVICE=INDIA LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=INDIA_UN' scope=both sid='*'; SQL> alter system set log_archive_config= 'DG_CONFIG=(turkey_un,india_un)' scope=both sid='*'; SQL> alter system set log_archive_max_processes=8 scope=both sid='*';
Configure the following parameters in order to make the Data Guard configuration ready for a role-change operation:
SQL> alter system set fal_server='INDIA' scope=both sid='*'; SQL> alter system set standby_file_management='AUTO' scope=both sid='*'; SQL> alter system set db_file_name_convert= '/u02/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcl' scope=spfile sid='*'; SQL> alter system set log_file_name_convert= '/u02/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcl' scope=spfile sid='*';
Note that the last two settings are made on
SPFILE
; therefore, a database restart is required to make the changes valid.
What just happened?
We've successfully restored the standby database with the standby role using Oracle 11g RMAN duplicate of the active database method. We've also discussed different methods used to create a standby database from primary.
- C語言程序設計案例式教程
- Hands-On Swift 5 Microservices Development
- Java EE 7 Performance Tuning and Optimization
- Learning FuelPHP for Effective PHP Development
- Java高并發核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- Java Fundamentals
- Programming with CodeIgniterMVC
- Kubernetes進階實戰
- Python 快速入門(第3版)
- 軟件開發中的決策:權衡與取舍
- 零基礎C語言學習筆記
- 計算機視覺實戰:基于TensorFlow 2
- Java性能權威指南
- ACE技術內幕:深入解析ACE架構設計與實現原理
- ASP.NET MVC 4 Mobile App Development