Showing posts with label active database. Show all posts
Showing posts with label active database. Show all posts

Tuesday, May 26, 2020

Reread resulted in same corrupt block on file 'spfil.ora' blockno=1

Active database duplication for standby fails with an error specific to 4k sector size. The primary database is Oracle restart with ASM where disks are on 4k emulation mode (512 logical sector and 4k physical sector). The spfile of the primary reside in the ASM disk (19c DB). During the active database duplicate command the primary would copy the spfile (with relavent changes specified by the duplication command) to the standby instance. But this location is not the ASM but $ORACLE_HOME/dbs. However, when the 4k emulation mode is involved this copying spfile from ASM to file system location results in following error on the primary DB rman session.
RMAN> duplicate target database for standby from active database
2> spfile
3> parameter_value_convert 'masterdb','masterdr','MASTERDB','MASTERDR'
set db_name='masterdb'
4> 5> set db_unique_name='masterdr'
6> set fal_server='masterdbtns'
7> set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=masterdr NOREOPEN ALTERNATE=log_archive_dest_2'
8> set log_archive_dest_3='service=masterdbtns LGWR ASYNC NOAFFIRM max_failure=10 reopen=60 valid_for=(online_logfiles,primary_role) db_unique_name=masterdb'
9> set local_listener='LISTENER_MASTERDR';

Starting Duplicate Db at 28-JUN-19
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=268 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/orapwmasterdr'   targetfile
 '+DATA/masterdb/parameterfile/spfile.293.1012128045' auxiliary format
 '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora'   ;
   sql clone "alter system set spfile= ''/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora''";
}
executing Memory Script

Starting backup at 28-JUN-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=575 device type=DISK
Finished backup at 28-JUN-19

sql statement: alter system set spfile= ''/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora''


Reread resulted in same corrupt block on file '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora' blockno=1
Reread resulted in same corrupt block on file '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora' blockno=1
Reread resulted in same corrupt block on file '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora' blockno=1
Reread resulted in same corrupt block on file '/opt/app/oracle/product/19.x.0/dbhome_1/dbs/spfilemasterdr.ora' blockno=1

The error keeps repeating and no going forward from this point.

The solution was to move the DB spfile out of ASM into local disk ($ORACLE_HOME/dbs) and re-run the duplicate command. There were no issue in the subsequent execution.

Related Post
4K Sector, compatible.rdbms and Redo Log File Block Size

Friday, July 6, 2012

11gR2 Standalone Data Guard (with ASM and Role Separation)

Post list the steps to configure a data guard environment with 11gR2 (11.2.0.3) standalone server using ASM and role separation. Following table list the names and conventions used during the setup.

Item On Primary On Standby
Host namerac1rac2
Database Nameent11g2ent11g2s
Diskgroup NamesDATA
FLASH
APPS
DG_DATA
DG_FLASH
APPS


1. Create the relevant *dump directories in the standby server
cd $ORACLE_BASE/admin
mkdir ent11g2s
cd ent11g2s
mkdir adump  dpdump  hdump  pfile
2. It is assumed primary db is in archive log mode if not put the db in archive log mode. This is required since duplication is done using active database.

3. Enable force logging on the primary database
alter database force logging;
4. Create standby log files for each thread on primary db. These should be same size as the online redo log. There should be at least one more redo log group per thread than the online redo log groups.
SQL> alter database add standby logfile thread 1 size 52428800;
5. Add static listener entries on standby and primary $GI_HOME's listener.ora file. This must be done as grid user. On primary add the following static listener entry to listener.ora
SID_LIST_LISTENER =
(SID_LIST =
        (SID_DESC =
                (GLOBAL_DBNAME = ent11g2.domain.net)
                (SID_NAME = ent11g2)
                (ORACLE_HOME = /opt/app/oracle/product/11.2.0/dbhome_1)
        )
)
On standby
SID_LIST_LISTENER =
(SID_LIST =
        (SID_DESC =
                (GLOBAL_DBNAME = ent11g2s.domain.net)
                (SID_NAME = ent11g2s)
                (ORACLE_HOME = /opt/app/oracle/product/11.2.0/dbhome_1)
        )
)
Restart both primary and standby listeners for static listener entries to take effect. After the listener restart the listener status would show on primary
...
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "ent11g2.domain.net" has 2 instance(s).
  Instance "ent11g2", status UNKNOWN, has 1 handler(s) for this service...
  Instance "ent11g2", status READY, has 1 handler(s) for this service...
Service "ent11g2XDB.domain.net" has 1 instance(s).
  Instance "ent11g2", status READY, has 1 handler(s) for this service...
The command completed successfully
On standby
...
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "ent11g2s.domain.net" has 1 instance(s).
  Instance "ent11g2s", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
6. As oracle user in ORACLE_HOME'S create tns entries. On primary server's oracle home create a tns entry pointing to the standby instance
ENT11G2STNS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ent11g2s.domain.net)
    )
  )
On standby's tnsnames.ora file add an entry pointing to the primary instance
ENT11G2TNS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ent11g2.domain.net)
    )
  )
7. Create a backup pfile from the primary spfile
SQL> create pfile='/home/oracle/pfile.ora' from spfile;
8. Modify the initialization parameters on the primary db. Remote archive dest state is set to defer, enable it before running the standby duplication. LGWR with ASYNC and NOAFFIRM is used as the redo transport this could be changed to suite the protection mode.
alter system set log_archive_config='dg_config=(ent11g2,ent11g2s)' scope=both ;
alter system set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2' scope=both;
alter system set log_archive_dest_2='service=ENT11G2STNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=ent11g2s' scope=both;
alter system set log_archive_dest_state_2='defer' scope=both;
alter system set log_archive_dest_state_1='enable' scope=both;
alter system set fal_server='ENT11G2STNS' scope=both;
alter system set fal_client='ENT11G2TNS' scope=both ;
alter system set log_archive_max_processes=10 scope=both;
alter system set db_file_name_convert='+DG_DATA/ent11g2s','+DATA/ent11g2','+APPS/ent11g2s','+APPS/ent11g2' scope=spfile;
alter system set log_file_name_convert='+DG_FLASH/ent11g2s','+FLASH/ent11g2','+DG_DATA/ent11g2s','+DATA/ent11g2' scope=spfile;
alter system set standby_file_management='AUTO' scope=both;
Restart the database server for the changes to take effect
srvctl stop database -d ent11g2
srvctl start database -d ent11g2
9. Copy password to standby and rename with the instance name
scp orapwent11g2 rac2:/opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwent11g2s
10. Create pfile on standby with db_name parameter only
export ORACLE_SID=ent11g2s
cat initent11g2s.ora
db_name=ent11g2s
10. Start the standby instance in nomount mode
SQL> startup nomount
ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
11. Enable the remote log archive destination on primary
alter system set log_archive_dest_state_2='enable' SCOPE=both sid='*';
12. Run the duplicate from active database command from primary. Local listner is set automatically and will be reset during duplication process.
duplicate target database for standby from active database
spfile
parameter_value_convert 'ent11g2','ent11g2s','ENT11G2','ENT11G2S'
set db_unique_name='ent11g2s'
set db_file_name_convert='+DATA/ent11g2','+DG_DATA/ent11g2s','+APPS/ent11g2','+APPS/ent11g2s'
set log_file_name_convert='+FLASH/ent11g2','+DG_FLASH/ent11g2s','+DATA/ent11g2','+DG_DATA/ent11g2s'
set control_files='+DG_DATA','+DG_FLASH'
set db_create_file_dest='+DG_DATA'
set db_recovery_file_dest='+DG_FLASH'
set log_archive_max_processes='10'
set fal_client='ENT11G2STNS'
set fal_server='ENT11G2TNS'
reset local_listener
set log_archive_dest_2='service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=ent11g2'
set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s';
The complete output of the duplication process is given below
rman target / auxiliary sys/ent11g2db@ent11g2stns

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jul 4 16:56:36 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ENT11G2 (DBID=2557133120)
connected to auxiliary database: ENT11G2S (not mounted)

RMAN> duplicate target database for standby from active database
2> spfile
3> parameter_value_convert 'ent11g2','ent11g2s','ENT11G2','ENT11G2S'
4> set db_unique_name='ent11g2s'
5> set db_file_name_convert='+DATA/ent11g2','+DG_DATA/ent11g2s','+APPS/ent11g2','+APPS/ent11g2s'
6> set log_file_name_convert='+FLASH/ent11g2','+DG_FLASH/ent11g2s','+DATA/ent11g2','+DG_DATA/ent11g2s'
7> set control_files='+DG_DATA','+DG_FLASH'
8> set db_create_file_dest='+DG_DATA'
9> set db_recovery_file_dest='+DG_FLASH'
10> set log_archive_max_processes='10'
11> set fal_client='ENT11G2STNS'
12> set fal_server='ENT11G2TNS'
13> reset local_listener
14> set log_archive_dest_2='service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=ent11g2'
15> set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s';

Starting Duplicate Db at 04-JUL-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwent11g2' auxiliary format
 '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwent11g2s'   targetfile
 '+DATA/ent11g2/spfileent11g2.ora' auxiliary format
 '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/spfileent11g2s.ora'   ;
   sql clone "alter system set spfile= ''/opt/app/oracle/product/11.2.0/dbhome_1/dbs/spfileent11g2s.ora''";
}
executing Memory Script

Starting backup at 04-JUL-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Finished backup at 04-JUL-12

sql statement: alter system set spfile= ''/opt/app/oracle/product/11.2.0/dbhome_1/dbs/spfileent11g2s.ora''

contents of Memory Script:
{
   sql clone "alter system set  audit_file_dest =
 ''/opt/app/oracle/admin/ent11g2s/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=ent11g2sXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ent11g2s'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''+DATA/ent11g2'', ''+DG_DATA/ent11g2s'', ''+APPS/ent11g2'', ''+APPS/ent11g2s'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''+FLASH/ent11g2'', ''+DG_FLASH/ent11g2s'', ''+DATA/ent11g2'', ''+DG_DATA/ent11g2s'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''+DG_DATA'', ''+DG_FLASH'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''+DG_DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''+DG_FLASH'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_max_processes =
 10 comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_client =
 ''ENT11G2STNS'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server =
 ''ENT11G2TNS'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 =
 ''service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=ent11g2'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_1 =
 ''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/opt/app/oracle/admin/ent11g2s/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=ent11g2sXDB)'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''ent11g2s'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''+DATA/ent11g2'', ''+DG_DATA/ent11g2s'', ''+APPS/ent11g2'', ''+APPS/ent11g2s'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''+FLASH/ent11g2'', ''+DG_FLASH/ent11g2s'', ''+DATA/ent11g2'', ''+DG_DATA/ent11g2s'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''+DG_DATA'', ''+DG_FLASH'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''+DG_DATA'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''+DG_FLASH'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_max_processes =  10 comment= '''' scope=spfile

sql statement: alter system set  fal_client =  ''ENT11G2STNS'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''ENT11G2TNS'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_2 =  ''service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=ent11g2'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                230690136 bytes
Database Buffers             599785472 bytes
Redo Buffers                   6574080 bytes

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''+DG_DATA/ent11g2s/controlfile/current.268.787763727'', ''+DG_FLASH/ent11g2s/controlfile/current.259.787763731'' comment=
 ''Set by RMAN'' scope=spfile";
   backup as copy current controlfile for standby auxiliary format  '+DG_DATA/ent11g2s/controlfile/current.267.787763731';
   restore clone controlfile to  '+DG_FLASH/ent11g2s/controlfile/current.258.787763731' from
 '+DG_DATA/ent11g2s/controlfile/current.267.787763731';
   sql clone "alter system set  control_files =
  ''+DG_DATA/ent11g2s/controlfile/current.267.787763731'', ''+DG_FLASH/ent11g2s/controlfile/current.258.787763731'' comment=
 ''Set by RMAN'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DG_DATA/ent11g2s/controlfile/current.268.787763727'', ''+DG_FLASH/ent11g2s/controlfile/current.259.787763731'' comment= ''Set by RMAN'' scope=spfile

Starting backup at 04-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/opt/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_ent11g2.f tag=TAG20120704T143626 RECID=5 STAMP=787761386
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 04-JUL-12

Starting restore at 04-JUL-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=138 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 04-JUL-12

sql statement: alter system set  control_files =   ''+DG_DATA/ent11g2s/controlfile/current.267.787763731'', ''+DG_FLASH/ent11g2s/controlfile/current.258.787763731'' comment= ''Set by RMAN'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                230690136 bytes
Database Buffers             599785472 bytes
Redo Buffers                   6574080 bytes

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set newname for tempfile  1 to
 "+dg_data";
   switch clone tempfile all;
   set newname for datafile  1 to
 "+dg_data";
   set newname for datafile  2 to
 "+dg_data";
   set newname for datafile  3 to
 "+dg_data";
   set newname for datafile  4 to
 "+dg_data";
   set newname for datafile  5 to
 "+apps";
   backup as copy reuse
   datafile  1 auxiliary format
 "+dg_data"   datafile
 2 auxiliary format
 "+dg_data"   datafile
 3 auxiliary format
 "+dg_data"   datafile
 4 auxiliary format
 "+dg_data"   datafile
 5 auxiliary format
 "+apps"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +dg_data in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 04-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/ent11g2/datafile/system.256.787750113
output file name=+DG_DATA/ent11g2s/datafile/system.260.787763751 tag=TAG20120704T143647
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/ent11g2/datafile/sysaux.257.787750113
output file name=+DG_DATA/ent11g2s/datafile/sysaux.261.787763827 tag=TAG20120704T143647
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/ent11g2/datafile/undotbs1.258.787750113
output file name=+DG_DATA/ent11g2s/datafile/undotbs1.262.787763883 tag=TAG20120704T143647
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+APPS/ent11g2/datafile/myapps.256.787760733
output file name=+APPS/ent11g2s/datafile/myapps.256.787763897 tag=TAG20120704T143647
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/ent11g2/datafile/users.259.787750113
output file name=+DG_DATA/ent11g2s/datafile/users.263.787763905 tag=TAG20120704T143647
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 04-JUL-12

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=5 STAMP=787763913 file name=+DG_DATA/ent11g2s/datafile/system.260.787763751
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=787763913 file name=+DG_DATA/ent11g2s/datafile/sysaux.261.787763827
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=787763913 file name=+DG_DATA/ent11g2s/datafile/undotbs1.262.787763883
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=787763913 file name=+DG_DATA/ent11g2s/datafile/users.263.787763905
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=787763913 file name=+APPS/ent11g2s/datafile/myapps.256.787763897
Finished Duplicate Db at 04-JUL-12
13. Once the duplication for standby is completed start the log apply process on standby
SQL> alter database recover managed standby database using current logfile disconnect;
and monitor the standby instance's alert log for recover process in action
alter database recover managed standby database using current logfile disconnect
Attempt to start background Managed Standby Recovery process (ent11g2s)
Wed Jul 04 17:07:05 2012
MRP0 started with pid=48, OS id=5459
MRP0: Background Managed Standby Recovery process started (ent11g2s)
 started logmerger process
Wed Jul 04 17:07:11 2012
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 2 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Log +DG_FLASH/ent11g2s/archivelog/2012_07_04/thread_1_seq_36.265.787770401
Media Recovery Log +DG_FLASH/ent11g2s/archivelog/2012_07_04/thread_1_seq_37.264.787770403
Media Recovery Log +DG_FLASH/ent11g2s/archivelog/2012_07_04/thread_1_seq_38.256.787770405
Media Recovery Waiting for thread 1 sequence 39 (in transit)
Recovery of Online Redo Log: Thread 1 Group 4 Seq 39 Reading mem 0
  Mem# 0: +DG_DATA/ent11g2s/onlinelog/group_4.258.787770345
  Mem# 1: +DG_FLASH/ent11g2s/onlinelog/group_4.278.787770345
Completed: alter database recover managed standby database using current logfile disconnect
Do a log switch on primary and see archive log application on standby
QL> select sequence#,thread#,applied from v$archived_log;

 SEQUENCE#    THREAD# APPLIED
---------- ---------- ---------
        36          1 YES
        37          1 YES
        38          1 IN-MEMORY
14. This conclude the data guard configuration. Next step is to bring the standby instance under oracle restart (high availability service) similar to primary db
srvctl config database -d ent11g2
Database unique name: ent11g2
Database name: ent11g2
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/ent11g2/spfileent11g2.ora
Domain: domain.net
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: ent11g2
Disk Groups: DATA,FLASH,APPS
Services:
Create a pfile from current spfile used by standby. At the end of the duplication standby's spfile is in the $ORACLE_HOME/dbs, this could be confirmed from the alert log which will have the following entry
Using parameter settings in server-side spfile /opt/app/oracle/product/11.2.0/dbhome_1/dbs/spfileent11g2s.ora
Create the pfile from spfile
SQL> create pfile='/home/oracle/pfileinitent11g2s.ora' from spfile;

File created.
Stop the log apply and shutdown the instance
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;
Edit the pfile and remove any references to primary instance. The final pfile would only have standby entries
ent11g2s.__db_cache_size=599785472
ent11g2s.__java_pool_size=4194304
ent11g2s.__large_pool_size=4194304
ent11g2s.__pga_aggregate_target=419430400
ent11g2s.__sga_target=843055104
ent11g2s.__shared_io_pool_size=0
ent11g2s.__shared_pool_size=222298112
ent11g2s.__streams_pool_size=0
*.audit_file_dest='/opt/app/oracle/admin/ent11g2s/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DG_DATA/ent11g2s/controlfile/current.274.787770165','+DG_FLASH/ent11g2s/controlfile/current.282.787770167'#Set by RMAN
*.db_block_size=8192
*.db_create_file_dest='+DG_DATA'
*.db_domain='domain.net'
*.db_file_name_convert='+DATA/ent11g2','+DG_DATA/ent11g2s','+APPS/ent11g2','+APPS/ent11g2s'
*.db_name='ent11g2'
*.db_recovery_file_dest_size=9437184000
*.db_recovery_file_dest='+DG_FLASH'
*.db_unique_name='ent11g2s'
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ent11g2sXDB)'
*.fal_client='ENT11G2STNS'
*.fal_server='ENT11G2TNS'
*.log_archive_config='dg_config=(ent11g2,ent11g2s)'
*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s'
*.log_archive_dest_2='service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_u
nique_name=ent11g2'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=10
*.log_file_name_convert='+FLASH/ent11g2','+DG_FLASH/ent11g2s','+DATA/ent11g2','+DG_DATA/ent11g2s'
*.open_cursors=300
*.pga_aggregate_target=419430400
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=840957952
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
Start the standby instance with the modified pfile
SQL> startup mount pfile='/home/oracle/pfileinitent11g2s.ora';
Create a spfile from the pfile give diskgroup as the spfile location
SQL> create spfile='+DG_DATA/ent11g2s/spfileent11g2s.ora' from pfile='/home/oracle/pfileinitent11g2s.ora';

SQL> shutdown immediate;
in $ORACLE_HOME/dbs create new pfile with following line
vi initent11g2s.ora
spfile='+DG_DATA/ent11g2s/spfileent11g2s.ora'
Remove the existing spfile created part of the duplication. Bring the standby instance under the control of oracle restart by running the following command as the oracle user. Startup mode is set to mount to prevent opening in read only mode which requires active data guard license.
$GI_HOME/bin/srvctl add database -d ent11g2s -o $ORACLE_HOME -m local -p "+DG_DATA/ent11g2s/spfileent11g2s.ora" -r physical_standby -s mount
If the database was running when the above command was executed then stop it using sqlplus and then start with
srvctl start database -d ent11g2s

srvctl config database -d ent11g2s
Database unique name: ent11g2s
Database name:
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DG_DATA/ent11g2s/spfileent11g2s.ora
Domain: domain.net
Start options: mount
Stop options: immediate
Database role: PHYSICAL_STANDBY
Management policy: AUTOMATIC
Database instance: ent11g2s
Disk Groups: DG_DATA,DG_FLASH,APPS
Services:
This will establish all the dependencies of the database and following lines will disappear from the alert log. Before instance is brought under the oracle restart
SUCCESS: diskgroup DG_FLASH was mounted
ERROR: failed to establish dependency between database ent11g2s and diskgroup resource ora.DG_DATA.dg
ERROR: failed to establish dependency between database ent11g2s and diskgroup resource ora.DG_FLASH.dg
ARCH: STARTING ARCH PROCESSES
After
ALTER DATABASE MOUNT /* db agent *//* {0:0:307} */
NOTE: Loaded library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so
NOTE: Loaded library: System
SUCCESS: diskgroup DG_DATA was mounted
SUCCESS: diskgroup DG_FLASH was mounted
ARCH: STARTING ARCH PROCESSES
Wed Jul 04 17:27:58 2012
ARC0 started with pid=26, OS id=6206
ARC0: Archival started
This conclude the configuration and setup of the standalone role separated ASM data guard configuration.



Alternately a pfile for the standby could be created with all the necessary parameter entries and use that to start the duplicate in nomount state. Then when running the duplicate command and omit the spfile clause. In this scenario pfile created on step 10 would have all the necessary parameters, this could be created by modifying a pfile created from the primary.
more initent11g2s.ora
*.audit_file_dest='/opt/app/oracle/admin/ent11g2s/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DG_DATA','+DG_FLASH'
*.db_block_size=8192
*.db_create_file_dest='+DG_DATA'
*.db_domain='domain.net'
*.db_file_name_convert='+DATA/ent11g2','+DG_DATA/ent11g2s','+APPS/ent11g2','+APPS/ent11g2s'
*.db_name='ent11g2'
*.db_unique_name='ent11g2s'
*.db_recovery_file_dest='+DG_FLASH'
*.db_recovery_file_dest_size=9437184000
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ent11g2sXDB)'
*.fal_client='ENT11G2STNS'
*.fal_server='ENT11G2TNS'
*.log_archive_config='dg_config=(ent11g2,ent11g2s)'
*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ent11g2s'
*.log_archive_dest_2='service=ENT11G2TNS LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_u
nique_name=ent11g2'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=10
*.log_file_name_convert='+FLASH/ent11g2','+DG_FLASH/ent11g2s','+DATA/ent11g2','+DG_DATA/ent11g2s'
*.open_cursors=300
*.pga_aggregate_target=419430400
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=840957952
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
Then execute the duplicate command as follows. In this case the auxiliary database name will be same as the primary name unlike in the method mentioned above (step 12)
rman target / auxiliary sys/ent11g2db@ent11g2stns

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jul 4 15:26:35 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ENT11G2 (DBID=2557133120)
connected to auxiliary database: ENT11G2 (not mounted)

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 04-JUL-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwent11g2' auxiliary format
 '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwent11g2s'   ;
}
executing Memory Script

Starting backup at 04-JUL-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=151 device type=DISK
Finished backup at 04-JUL-12

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '+DG_DATA/ent11g2s/controlfile/current.267.787766873';
   restore clone controlfile to  '+DG_FLASH/ent11g2s/controlfile/current.258.787766875' from
 '+DG_DATA/ent11g2s/controlfile/current.267.787766873';
   sql clone "create spfile from memory";
   shutdown clone immediate;
   startup clone nomount;
   sql clone "alter system set  control_files =
  ''+DG_DATA/ent11g2s/controlfile/current.267.787766873'', ''+DG_FLASH/ent11g2s/controlfile/current.258.787766875'' comment=
 ''Set by RMAN'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Starting backup at 04-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/opt/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_ent11g2.f tag=TAG20120704T152853 RECID=6 STAMP=787764533
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 04-JUL-12

Starting restore at 04-JUL-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 04-JUL-12

sql statement: create spfile from memory

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                234884440 bytes
Database Buffers             595591168 bytes
Redo Buffers                   6574080 bytes

sql statement: alter system set  control_files =   ''+DG_DATA/ent11g2s/controlfile/current.267.787766873'', ''+DG_FLASH/ent11g2s/controlfile/current.258.787766875'' comment= ''Set by RMAN'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                234884440 bytes
Database Buffers             595591168 bytes
Redo Buffers                   6574080 bytes

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set newname for tempfile  1 to
 "+dg_data";
   switch clone tempfile all;
   set newname for datafile  1 to
 "+dg_data";
   set newname for datafile  2 to
 "+dg_data";
   set newname for datafile  3 to
 "+dg_data";
   set newname for datafile  4 to
 "+dg_data";
   set newname for datafile  5 to
 "+apps";
   backup as copy reuse
   datafile  1 auxiliary format
 "+dg_data"   datafile
 2 auxiliary format
 "+dg_data"   datafile
 3 auxiliary format
 "+dg_data"   datafile
 4 auxiliary format
 "+dg_data"   datafile
 5 auxiliary format
 "+apps"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +dg_data in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 04-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/ent11g2/datafile/system.256.787750113
output file name=+DG_DATA/ent11g2s/datafile/system.263.787766913 tag=TAG20120704T152928
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/ent11g2/datafile/sysaux.257.787750113
output file name=+DG_DATA/ent11g2s/datafile/sysaux.262.787766989 tag=TAG20120704T152928
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/ent11g2/datafile/undotbs1.258.787750113
output file name=+DG_DATA/ent11g2s/datafile/undotbs1.261.787767045 tag=TAG20120704T152928
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+APPS/ent11g2/datafile/myapps.256.787760733
output file name=+APPS/ent11g2s/datafile/myapps.256.787767061 tag=TAG20120704T152928
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/ent11g2/datafile/users.259.787750113
output file name=+DG_DATA/ent11g2s/datafile/users.260.787767063 tag=TAG20120704T152928
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 04-JUL-12

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=6 STAMP=787767066 file name=+DG_DATA/ent11g2s/datafile/system.263.787766913
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=787767066 file name=+DG_DATA/ent11g2s/datafile/sysaux.262.787766989
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=787767066 file name=+DG_DATA/ent11g2s/datafile/undotbs1.261.787767045
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=787767066 file name=+DG_DATA/ent11g2s/datafile/users.260.787767063
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=787767066 file name=+APPS/ent11g2s/datafile/myapps.256.787767061
Finished Duplicate Db at 04-JUL-12
Reset of the steps are same as above to bring the standby under oracle restart's control.

Some other related notes
When the oracle software is installed on the standby node the permission of the Oracle binary is as follows.
ls -l /opt/app/oracle/product/11.2.0/grid/bin/oracle # GI HOME
-rwsr-s--x 1 grid oinstall 203972955 Jul  4 10:05 /opt/app/oracle/product/11.2.0/grid/bin/oracle
ls -l /opt/app/oracle/product/11.2.0/dbhome_1/bin/oracle # ORACLE HOME
-rwsr-s--x 1 oracle oinstall 232399473 Jul  4 12:29 /opt/app/oracle/product/11.2.0/dbhome_1/bin/oracle
See the post related to oracle binary permissions. On primary the permission of the oracle binary was "oracle:asmadmin". The permission was left as it is (oracle:oinstall) and this did not cause any problem during the standby creation and at the end of the duplication the oracle binary permission was changed to "oracle:asmadmin"
ls -l /opt/app/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle asmadmin 232399473 Jul  4 12:29 /opt/app/oracle/product/11.2.0/dbhome_1/bin/oracle
s -l /opt/app/oracle/product/11.2.0/grid/bin/oracle
-rwsr-s--x 1 grid oinstall 203972955 Jul  4 10:05 /opt/app/oracle/product/11.2.0/grid/bin/oracle
It was confirmed oracle binary permissions are in a smilar state after the installation and that when the database is created with dbca the permission gets changed to "oracle:asmadmin".

It is normal to see message similar to below in the standby alert log when the duplication process and this does not mean a problem
Errors in file /opt/app/oracle/diag/rdbms/ent11g2s/ent11g2s/trace/ent11g2s_lgwr_27303.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219'
ORA-17503: ksfdopn:2 Failed to open file +DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219
ORA-15012: ASM file '+DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219' does not exist
ORA-00312: online log 1 thread 1: '+DG_DATA/ent11g2s/onlinelog/group_1.261.787750215'
ORA-17503: ksfdopn:2 Failed to open file +DG_DATA/ent11g2s/onlinelog/group_1.261.787750215
ORA-15012: ASM file '+DG_DATA/ent11g2s/onlinelog/group_1.261.787750215' does not exist
Errors in file /opt/app/oracle/diag/rdbms/ent11g2s/ent11g2s/trace/ent11g2s_lgwr_27303.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219'
ORA-17503: ksfdopn:2 Failed to open file +DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219
ORA-15012: ASM file '+DG_FLASH/ent11g2s/onlinelog/group_1.257.787750219' does not exist
ORA-00312: online log 1 thread 1: '+DG_DATA/ent11g2s/onlinelog/group_1.261.787750215'
ORA-17503: ksfdopn:2 Failed to open file +DG_DATA/ent11g2s/onlinelog/group_1.261.787750215
ORA-15012: ASM file '+DG_DATA/ent11g2s/onlinelog/group_1.261.787750215' does not exist
The alert logs will be created without an issue.

Useful metalink notes
RMAN Duplicate Database From RAC ASM To RAC ASM [ID 461479.1]
Performing duplicate database with ASM/OMF/RMAN [ID 340848.1]
ORA-7445 [kcrf_val_log_bsz] Creating Physical Standby With Rman Duplicate From Active [ID 1320757.1]
Dataguard DB/LOG FILE NAME CONVERT has been set but files are created in a different directory [ID 1348512.1]
OERR:RMAN 5529 WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only [ID 1367794.1]

Related Posts
RAC to Single Instance Physical Standby
11gR2 RAC to RAC Data Guard

Saturday, June 2, 2012

Installing 11gR2 Standalone Server with ASM and Role Separation on RHEL 6

There's an earlier post with the steps specific to installing standalone 11gR2 with role separation and using ASM to data files. This post is to highlight any steps specific to installing 11gR2 (11.2.0.3) on RHEL 6. Instead of the vncserver RHEL 6 has a new remote desktop service. If vncserver is preferred use yum service to install tigervnc-server from the public yum.
The RHEL 6 kernel version is
uname -r
2.6.32-220.el6.x86_64
1. Create the users and groups for role seperate installation
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper

useradd -g oinstall -G dba,oper,asmdba oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba grid
grid user should be part of dba group as per metalink note 1084186.1 (see earlier post's step 15)

2. To get asmlib libraries with RHEL 6, it would require an unbreakable linux account (more on 1089399.1). In this installation block devices will be used for ASM. Use udev rules to add necessary permissions to the block devices.
# ASM DATA
KERNEL=="sde[1]", OWNER="grid", GROUP="asmadmin", MODE="660"

# ASM FLASH
KERNEL=="sdf[1]", OWNER="grid", GROUP="asmadmin", MODE="660"
Group has been set to asmadmin, setting it to asmdba (as in the case with earlier post using asmlib) could result in following warning (which was observed with cluster pre-req check not standalone pre-req check).

3. Set CV_ASSUME_DISTID=OEL6 in the cvu_config file as explained in installing 11gR2 on RHEL 6 Other pre-req steps are omitted here but it's expected these are carried out before continuing with rest of the steps.

4. Run cluster verify tool for high availability service option
./runcluvfy.sh  stage -pre hacfg

Performing pre-checks for Oracle Restart configuration
Total memory check passed
Available memory check passed
Swap space check passed
Free disk space check passed for "rhel6m2:/tmp"
Check for multiple users with UID value 502 passed
User existence check passed for "grid"
Group existence check passed for "oinstall"
Group existence check passed for "dba"
Membership check for user "grid" in group "oinstall" [as Primary] passed
Membership check for user "grid" in group "dba" passed
Run level check passed
Hard limits check passed for "maximum open file descriptors"
Soft limits check passed for "maximum open file descriptors"
Hard limits check passed for "maximum user processes"
Soft limits check passed for "maximum user processes"
System architecture check passed
Kernel version check passed
Kernel parameter check passed for "semmsl"
Kernel parameter check passed for "semmns"
Kernel parameter check passed for "semopm"
Kernel parameter check passed for "semmni"
Kernel parameter check passed for "shmmax"
Kernel parameter check passed for "shmmni"
Kernel parameter check passed for "shmall"
Kernel parameter check passed for "file-max"
Kernel parameter check passed for "ip_local_port_range"
Kernel parameter check passed for "rmem_default"
Kernel parameter check passed for "rmem_max"
Kernel parameter check passed for "wmem_default"
Kernel parameter check passed for "wmem_max"
Kernel parameter check passed for "aio-max-nr"
Package existence check passed for "make"
Package existence check passed for "binutils"
Package existence check passed for "gcc(x86_64)"
Package existence check passed for "libaio(x86_64)"
Package existence check passed for "glibc(x86_64)"
Package existence check passed for "compat-libstdc++-33(x86_64)"
Package existence check passed for "elfutils-libelf(x86_64)"
Package existence check passed for "elfutils-libelf-devel"
Package existence check passed for "glibc-common"
Package existence check passed for "glibc-devel(x86_64)"
Package existence check passed for "glibc-headers"
Package existence check passed for "gcc-c++(x86_64)"
Package existence check passed for "libaio-devel(x86_64)"
Package existence check passed for "libgcc(x86_64)"
Package existence check passed for "libstdc++(x86_64)"
Package existence check passed for "libstdc++-devel(x86_64)"
Package existence check passed for "sysstat"
Package existence check failed for "pdksh"
Check failed on nodes:
        rhel6m2
Package existence check passed for "expat(x86_64)"
Check for multiple users with UID value 0 passed
Current group ID check passed

Starting check for consistency of primary group of root user
Check for consistency of root user's primary group passed
Pre-check for Oracle Restart configuration was unsuccessful.
Even though CV_ASSUME_DISTID=OEL6 was set before running the above command the pdksh check fails (more on 1454982.1). But this happens only on cluvfy, the pre-req check done through OUI ignores this pdksh check and there won't be any failed pre-reqs.

5. Carry out the installation of GI for standalone server.

Using block devices for ASM

Separate OS groups for ASM administration

GI for standalone home is created under ORACLE_BASE (if not warning is given see step 7 on earlier post)

oraInventory directory must have oinstall as group.

Summary


Run root scripts when prompted
# /opt/app/oracle/product/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/app/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

   Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node rhel6m2 successfully pinned.
Adding Clusterware entries to upstart

rhel6m2     2012/05/30 12:24:37     /opt/app/oracle/product/11.2.0/grid/cdata/rhel6m2/backup_20120530_122437.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Once the root.sh script finishes the other configuration tools (netca,asmca) will run, and this will conclude the installation of GI for standalone.

6. Installation of database software and creation of database is no different to that of RHEL 5 installation with one notable difference is that prior to executing runInstaller set CV_ASSUME_DISTID=OEL6 in the database software's cvu_config file as well to ignore the pdksh check.

7. Follow MOS notes 372959.1, 1349844.1 and make changes to listener.ora to disable RAC related listener events not applicable for single instance deployments

Related Posts
Installing 11gR2 (11.2.0.3) GI with Role Separation on RHEL 6
Installing 11gR2 (11.2.0.3) GI with Role Separation on OEL 6
Installing 11.2.0.3 on RHEL 6
ASM for Standalone Server in 11gR2 with Role Separation (on RHEL 5)

Friday, November 11, 2011

ASM for Standalone Server in 11gR2 with Role Separation

One of the major differences in 11gR2 compared to previous version is the moving of ASM configuration to Grid Infrastructure. Therefore to setup a standalone database with ASM, grid infrastructure is needed.
In this blog the grid user will be used for installing and managing grid infrastructure and oracle user will be used for installing and managing the database software. This is not a comprehensive step by step guide, some general database installation steps are not shown here focusing mainly on the steps that are specific to the topic at hand. The software used here are 11gR2 (11.2.0.3)

1. Create the following groups in the OS
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper
and create the grid user and oracle user as follows
useradd -g oinstall -G asmadmin,asmdba,asmoper grid
useradd -g oinstall -G dba,oper,asmdba oracle
If Oralce user does not have the asmdba then ASM disk groups created by grid user won't be visible to Oracle user.

2. Create the grid infrastructure location and make the ownership as grid:oinstall
cd /opt/app/11.2.0/
ls -l
drwxr-xr-x 2 grid oinstall 4096 Nov  3 17:41 grid
3. Install and configure oracleasm libs. User grid user and asmdba as the oracleasm interface user and group
/etc/init.d/oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting  without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmdba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
/etc/init.d/oracleasm createdisk DATA /dev/sdb1
Marking disk "DATA" as an ASM disk:                        [  OK  ]
 /etc/init.d/oracleasm createdisk FLASH /dev/sdc1
Marking disk "FLASH" as an ASM disk:                       [  OK  ]
4. Login as grid user and start the grid infrastructure installation and select grid infrastrcuture for standalone server.

5. Create a ASM diskgroup to store data files. On this step only one diskgroup could be created. Once the grid infrastrcuture is installed use ASMCA to create any additional diskgroups needed.

6. Select the OS group related ASM activities. If the OS groups mentioned in step 1 are created this step would come pre-selected as shown below.





7. When grid infrastructure is installed for RAC it is advised not to install it as a sub directory of ORACLE BASE. But in this case trying to install out side oracle base would give a warning as shown below.



The grid infrastructure path is selected as below.


8. Installing summary


9. Execute the root scripts when prompted
/opt/app/oracle/product/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/app/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node rhel5 successfully pinned.
Adding Clusterware entries to inittab

rhel5     2011/11/03 18:15:01     /opt/app/oracle/product/11.2.0/grid/cdata/rhel5/backup_20111103_181501.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
10. Once the root scripts are finished listener and ASM instance will be created.


11. Following commands could be used to stop and start the grid infrastructure related services
crsctl stop has
crsctl start has
12. ASM's SPFile will be residing inside ASM itself. This could be found out in number of ways, looking at the alert log of ASM when ASM starts
Machine:        x86_64
Using parameter settings in server-side spfile +DATA/asm/asmparameterfile/registry.253.766260991
System parameters with non-default values:
  large_pool_size          = 12M
  instance_type            = "asm"
  remote_login_passwordfile= "EXCLUSIVE"
  asm_diskgroups           = "FLASH"
  asm_diskgroups           = "DATA"
  asm_power_limit          = 1
  diagnostic_dest          = "/opt/app/oracle"
Or using the asmcmd's spget command which shows the spfile location registered with GnP profile
ASMCMD> spget
+DATA/asm/asmparameterfile/registry.253.766260991
To copy the ASM spfile to a file systme location use spcopy (use spmove to move it). Before executing the spcopy stop the diskgroups
srvctl stop diskgroup -g data[flash] 
ASMCMD> spcopy +DATA/asm/asmparameterfile/registry.253.766260991 /opt/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora
and update the GnP profile with the new location using spset
ASMCMD> spset /opt/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora
ASMCMD> spget
/opt/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora
When ASM starts next the new location is listed as below
Machine:        x86_64
Using parameter settings in server-side spfile /opt/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora
System parameters with non-default values:
  large_pool_size          = 12M
  instance_type            = "asm"
  remote_login_passwordfile= "EXCLUSIVE"
  asm_diskgroups           = "FLASH"
  asm_diskgroups           = "DATA"
  asm_power_limit          = 1
  diagnostic_dest          = "/opt/app/oracle"
With this concludes the installation of grid infrastructure and creation of ASM.


13. Login as Oracle user and start the database software installation.


14. Some locations ($ORACLE_BASE/admin, $ORACLE_BASE/cfgtoollogs) may not have write permissions for Oracle user, permissions might be set as 755 grid : oinstall. Change permissions as 775 to allow oracle user the access to these location.



15. There is a pre-req check to see if grid user is also a member of the dba group. As per metalink note 1084186.1 "In case of stand alone set up, if the 11.2 Database be managed by Oracle Restart ( srvctl stop/start ), then 'grid' user should also be a part of 'dba' group."



16. Complete the installation.



17. Run dbca as Oracle user from the database software home. Creating database is straightforward. If anything can go wrong then it will be that ASM disk are not being shown when ASM is created for data file locations.


This will be because Oracle user is not in the asmdba group. Once added the disk will appear for selection. This concludes the creation of standalone database with ASM in 11gR2.

The database comes with Oracle restart configured as well as ASM as a target in the EM Console


Some useful metalink notes

DBCA Does Not Display ASM Disk Groups In 11.2 [ID 1177483.1] (issue seems to be fixed in 11.2.0.3)
Patch 11gR2 Grid Infrastructure Standalone (Oracle Restart) [ID 1089476.1]
11gR2 (11.2.0.1) Unable To Create ASM Spfile Standalone [ID 1082332.1]
Database Creation on 11.2 Grid Infracture with Role Separation ( ORA-15025, KFSG-00312, ORA-15081 ) [ID 1084186.1]
How to change ownership and group memberships of Grid home in 11.2 Standalone [ID 1171674.1]
Ora-01115, Ora-01110, Ora-15081 When Connecting DB with non-dba Group Users [ID 1372571.1]
ASM 11.2 Configuration KIT (ASM 11gR2 Installation & Configuration, Deinstallation, Upgrade, ASM Job Role Separation (Standalone Only). [ID 1092213.1]
How To Upgrade Oracle Restart i.e. Single Node Grid Infrastructure/ASM from 11.2.0.2 To 11.2.0.3. [ID 1400185.1]
Listener Log Showing * Service_died * Lsnragt * 12537 Died Message Every Minute. [ID 1349844.1]
WARNING: Subscription for node down event still pending' in Listener Log [ID 372959.1]

Related Post
Installing 11gR2 Standalone Server with ASM and Role Separation in RHEL 6

Saturday, February 19, 2011

11gR2 RAC to RAC Data Guard

The initial setup is not much different between RAC-RAC and RAC-Single instance data guard, in a way setting up the data guard is same with some additional setps at the end of setup in the way of bringing the standby database under the control of clusterware.

The primary RAC environment consists of two nodes, hostname rac4 and rac5. The primary database name is rac11g2 and two instances are rac11g21 (running on rac4 node) and rac11g22 (on rac5).

The standby RAC environment also consists of two nodes (symmetrical data guard) hostname rac4b and rac5b. The standby database will be named rac11g2s and the corresponding instances will be rac11g2s1 (on rac4b) and rac11g2s2 (on rac5b).

The software version is 11.2.0.2 on both primary and standby (both grid home and oracle home). Primary site has database created and standby site has grid infrastructure and oracle home software installed.

From Data Guard Concepts and Administration

New 11.2 Features Common to Redo Apply and SQL Apply
As of Oracle Database 11g Release 2 (11.2.0.2), Oracle Data Guard is fully integrated with Oracle Real Application Clusters One Node (Oracle RAC One Node).
A Data Guard configuration can now consist of a primary database and up to 30 standby databases.
The FAL_CLIENT database initialization parameter is no longer required.
The default archive destination used by the Oracle Automatic Storage Management (Oracle ASM) feature and the fast recovery area feature has changed from LOG_ARCHIVE_DEST_10 to LOG_ARCHIVE_DEST_1.
Redo transport compression is no longer limited to compressing redo data only when a redo gap is being resolved. When compression is enabled for a destination, all redo data sent to that destination is compressed.
The new ALTER SYSTEM FLUSH REDO SQL statement can be used at failover time to flush unsent redo from a mounted primary database to a standby database, thereby allowing a zero data loss failover to be performed even if the primary database is not running in a zero data loss data protection mode. See Section 8.2.2 for more information.


New 11.2 Features Specific to Redo Apply
You can configure apply lag tolerance in a real-time query environment by using the new STANDBY_MAX_DATA_DELAY parameter.
You can use the new ALTER SESSION SYNC WITH PRIMARY SQL statement to ensure that a suitably configured physical standby database is synchronized with the primary database as of the time the statement is issued.
The V$DATAGUARD_STATS view has been enhanced to a greater degree of accuracy in many of its columns, including apply lag and transport lag.
You can view a histogram of apply lag values on the physical standby. To do so, query the new V$STANDBY_EVENT_HISTOGRAM view.
A corrupted data block in a primary database can be automatically replaced with an uncorrupted copy of that block from a physical standby database that is operating in real-time query mode. A corrupted block in a physical standby database can also be automatically replaced with an uncorrupted copy of the block from the primary database.


1. On the standby ASM instances would have been created when grid infrastructure was installed but not the ASM diskgroups. Using asmca create diskgroup on the standby ASM instances. In this case both primary and standby ASM diskgroups are named +DATA and +FLASH

2. Create following directory structures in all standby nodes
cd $ORACLE_BASE
mkdir admin
cd admin/
mkdir rac11g2s
cd rac11g2s/
mkdir adump  dpdump  hdump  pfile
3. It is assumed primary db is in archivelog mode if not put the db in archive log mode. This is required since duplication is done using active database.

4. Enable force logging on the primary database
alter database force logging;
5.Create standby log files for each thread on primary db. These should be same size as the online redo log files
SQL> alter database add standby logfile thread 1 size 52428800;
or
SQL> alter database add standby logfile thread 1;
SQL> alter database add standby logfile thread 2;
There should be at least one more redo log group per thread than the online redo logs.

6. Both on primary and standby add static listener entries in $GRID_HOME($CRS_HOME)/network/admin/listener.ora. If scan listener is used for connections create static listener for those as well. One key difference is both in 10gR2 and 11gR1 the static listener and default listeners have hostname appended to the end but on 11gR2 this is not the case. Find out the available listeners with
srvctl config listener
Name: LISTENER
Network: 1, Owner: oracle
Home: 
End points: TCP:1521

srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
and create the static listeners for default listener as well as the scan listener. For standby on rac4b
more listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2s.domain.net)
(SID_NAME = rac11g2s1)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)


SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2s.domain.net)
(SID_NAME = rac11g2s1)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)
on rac5b
more listener.ora
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2s.domain.net)
(SID_NAME = rac11g2s2)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)

SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2s.domain.net)
(SID_NAME = rac11g2s2)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)
In 11gR2 there's another file in $ORACLE_HOME/network/admin folder called endpoints_listener.ora. This is there for backward compatibility with pre-11.2 databases. More on metalink note 11.2 Scan and Node TNS Listener Setup Examples [ID 1070607.1]
Stop and start the listeners on standby
srvctl stop listener -n `hostname -s`
srvctl start listener -n `hostname -s`

srvctl stop scan_listener
srvctl start scan_listener
After this stop and start of listeners doing a listener status listener would show the statically registered instance and service as below
Service "rac11g2s.domain.net" has 1 instance(s).
Instance "rac11g2s1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Do the same for primary environment on rac4
more listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2.domain.net)
(SID_NAME = rac11g21)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)


SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2.domain.net)
(SID_NAME = rac11g21)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)
on rac5
more listener.ora
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2.domain.net)
(SID_NAME = rac11g22)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)


SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = rac11g2.domain.net)
(SID_NAME = rac11g22)
(ORACLE_HOME = /opt/app/oracle/product/11.2.0/db_1)
)
)
7. Create TNS entries on both primary and standby. On all primary node's $ORACLE_HOME/network/admin
RAC11G2SCANB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = racb-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
)
)

RAC11G2S =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4b-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
)
)

RAC11G2S1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
(INSTANCE_NAME = rac11g2s1)
)
)


RAC11G2S2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
(INSTANCE_NAME = rac11g2s2)
)
)

RAC11G2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
)
)

RAC11G21 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
(INSTANCE_NAME = rac11g21)
)
)


RAC11G22 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
(INSTANCE_NAME = rac11g22)
)
)
On all standby node's $ORACLE_HOME/network/admin
RAC11G2SCAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
)
)

RAC11G2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
)
)

RAC11G21 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
(INSTANCE_NAME = rac11g21)
)
)


RAC11G22 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2.domain.net)
(INSTANCE_NAME = rac11g22)
)
)

RAC11G2S =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4b-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
)
)

RAC11G2S1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac4b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
(INSTANCE_NAME = rac11g2s1)
)
)


RAC11G2S2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac5b-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac11g2s.domain.net)
(INSTANCE_NAME = rac11g2s2)
)
)
8. Before modifying initialization parameters create a pfile from the spfile on the primary db
create pfile='/home/oracle/primaryinitpfile.ora' from spfile;
9. Modify the initialization parameters on the primary db. Remote archive dest state is set to defer, enable it before running the standby duplication. LGWR with ASYNC and NOAFFIRM is used as the redo transport this could be changed to suite the protection mode. Also FAL_CLIENT parameter has been set to each instance. This could be set to RAC11G2 TNS entry which has all entries.
alter system set log_archive_config='dg_config=(rac11g2,rac11g2s)' scope=both ;
alter system set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2' scope=both;
alter system set log_archive_dest_2='service=RAC11G2S LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2s' scope=both;
alter system set log_archive_dest_state_2='defer' scope=both;
alter system set log_archive_dest_state_1='enable' scope=both;
alter system set fal_server='RAC11G2S1','RAC11G2S2' scope=both;
alter system set fal_client='RAC11G21' scope=both sid='rac11g21'; --- since not using scan
alter system set fal_client='RAC11G22' scope=both sid='rac11g22'; --- sicne not using scan
alter system set log_archive_max_processes=10 scope=both;
alter system set db_file_name_convert='+DATA/rac11g2s','+DATA/rac11g2' scope=spfile;
alter system set log_file_name_convert='+FLASH/rac11g2s','+FLASH/rac11g2','+DATA/rac11g2s','+DATA/rac11g2' scope=spfile;
alter system set standby_file_management='AUTO' scope=both;
To make these changes take effect it requires a database restart not an instance restart this is due to the fact that filename convert parameter must be same on all nodes. If an instance restart is done it will fail with the following error
on alert log

NOTE: Loaded library: System
SUCCESS: diskgroup DATA was mounted
SUCCESS: diskgroup FLASH was mounted
NOTE: dependency between database rac11g2 and diskgroup resource ora.DATA.dg is established
NOTE: dependency between database rac11g2 and diskgroup resource ora.FLASH.dg is established
ORA-1105 signalled during: ALTER DATABASE MOUNT /* db agent *//* {1:7917:278} */...
Fri Feb 18 14:49:17 2011
Shutting down instance (abort)
License high water mark = 1
USER (ospid: 9322): terminating the instance
Instance terminated by USER, pid = 9322
Fri Feb 18 14:49:18 2011
Instance shutdown complete
on the command shell
$ srvctl stop instance -d rac11g2 -i rac11g21
$ srvctl start instance -d rac11g2 -i rac11g21
PRCR-1013 : Failed to start resource ora.rac11g2.db
PRCR-1064 : Failed to start resource ora.rac11g2.db on node rac4
CRS-5017: The resource action "ora.rac11g2.db start" encountered the following error:
ORA-01105: mount is incompatible with mounts by other instances
ORA-01677: standby file name convert parameters differ from other instance
CRS-2674: Start of 'ora.rac11g2.db' on 'rac4' failed
If the dataguard traffic is only one way (don't plan to use current primary as a standby in the future, then filename convert parameters could be ommited and a instnace restart could be carried out), otherwise do a database restart which means brining the system down.

10. Another difference between 10gR2/11gR1 and 11gR2 is the local_listener and remote_listener parameters. According to Real Application Clusters Installation Guide During Oracle Database creation, the LOCAL_LISTENER parameter is automatically configured to point to the local listener for the database. The Database Agent sets the LOCAL_LISTENER parameter to a connect descriptor that does not require a TNS alias.
You can set a value manually for LOCAL_LISTENER. However, Oracle recommends that you leave the parameter unset so that the Database Agent can maintain it automatically. If you set LOCAL_LISTENER, then the Agent does not automatically update this value. If you do not set LOCAL_LISTENER, then the Database Agent automatically keeps the database associated with the Grid home's node listener updated, even as the ports or IP of that listener are changed.

With Oracle Clusterware 11g release 2 and later, Database Configuration Agent (DBCA) no longer sets the LOCAL_LISTENER parameter. The Oracle Clusterware agent that starts the database sets the LOCAL_LISTENER parameter dynamically, and it sets it to the actual value, not an alias. So listener_alias entries are no longer needed in the tnsnames.ora file. For the REMOTE_LISTENER parameter, Oracle Clusterware uses the EZ connect syntax scanname:scanport, so no entries are needed for the REMOTE_LISTENER parameter in the tnsnames.ora file.
More on 11gR2 Grid Infrastructure Single Client Access Name (SCAN) Explained [ID 887522.1]

11. On 11gr2 remote listener is set to scan identify the standby scan name with
srvctl config scan
SCAN name: racb-scan, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /racb-scan/192.168.0.92
This will be used later on.

12. Copy the primary password file to standby nodes and rename accordingly. On rac4b where instance rac11g2s1 will be running password file will be named orapwrac11g2s1 and on rac5b orapwrac11g2s2.

13. Select one node (rac4b in this case) on the standby cluster and create a pfile with db_name entry which will have the standby database name (not the instance name). Rename the pfile with the instance name.
cat initrac11g2s1.ora
db_name=rac11g2s
14. Start the instance in nomount mode
export ORACLE_SID=rac11g2s1
SQL> startup nomount pfile='?/dbs/initrac11g2s1.ora';
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2225064 bytes
Variable Size             159386712 bytes
Database Buffers           50331648 bytes
Redo Buffers                5214208 bytes
15. On primary db enable the deferred log archive destination
SQL> alter system set log_archive_dest_state_2='enable' SCOPE=both sid='*';
16. On one node in the primary rac (rac4 in this case) connect to primary instance (target) as well standby instance (using rman auxiliary connection)
rman target / auxiliary sys/******@rac11g2s1

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Feb 18 15:12:39 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RAC11G2 (DBID=379668842)
connected to auxiliary database: RAC11G2S (not mounted)
17. Run the duplication command with
duplicate target database for standby from active database
spfile
parameter_value_convert 'rac11g2','rac11g2s','RAC11G2','RAC11G2S'
set db_unique_name='rac11g2s'
set db_file_name_convert='+DATA/rac11g2','+DATA/rac11g2s'
set log_file_name_convert='+FLASH/rac11g2','+FLASH/rac11g2s','+DATA/rac11g2','+DATA/rac11g2s'
set control_files='+DATA','+FLASH'
set instance_number='1'
set log_archive_max_processes='5'
set fal_client='RAC11G2S'
set fal_server='RAC11G21','RAC11G22'
set remote_listener='racb-scan:1521'
reset local_listener
set log_archive_dest_2='service=RAC11G2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2'
set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2s';
Key parameters are data file and log file name converters as well as the parameter value converter which maps primary environment values to appropriate standby environment values. local_listener is reset as it is auto set by grid infrastructure. remote_listener value is set the scan ip and port identified earlier.
rman target / auxiliary sys/******@rac11g2s1

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Feb 18 16:10:16 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RAC11G2 (DBID=379668842)
connected to auxiliary database: RAC11G2S (not mounted)

RMAN> duplicate target database for standby from active database
2> spfile
3> parameter_value_convert 'rac11g2','rac11g2s','RAC11G2','RAC11G2S'
4> set db_unique_name='rac11g2s'
5> set db_file_name_convert='+DATA/rac11g2','+DATA/rac11g2s'
6> set log_file_name_convert='+FLASH/rac11g2','+FLASH/rac11g2s','+DATA/rac11g2','+DATA/rac11g2s'
7> set control_files='+DATA','+FLASH'
8> set instance_number='1'
9> set log_archive_max_processes='5'
10> set fal_client='RAC11G2S'
11> set fal_server='RAC11G21','RAC11G22'
12> set remote_listener='racb-scan:1521'
13> reset local_listener
14> set log_archive_dest_2='service=RAC11G2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2'
15> set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2s';

Starting Duplicate Db at 18-FEB-11
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=13 device type=DISK

contents of Memory Script:
{
backup as copy reuse
targetfile  '/opt/app/oracle/product/11.2.0/db_1/dbs/orapwrac11g21' auxiliary format
'/opt/app/oracle/product/11.2.0/db_1/dbs/orapwrac11g2s1'   targetfile
'+DATA/rac11g2/spfilerac11g2.ora' auxiliary format
'/opt/app/oracle/product/11.2.0/db_1/dbs/spfilerac11g2s1.ora'   ;
sql clone "alter system set spfile= ''/opt/app/oracle/product/11.2.0/db_1/dbs/spfilerac11g2s1.ora''";
}
executing Memory Script

Starting backup at 18-FEB-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=155 instance=rac11g21 device type=DISK
Finished backup at 18-FEB-11

sql statement: alter system set spfile= ''/opt/app/oracle/product/11.2.0/db_1/dbs/spfilerac11g2s1.ora''

contents of Memory Script:
{
sql clone "alter system set  audit_file_dest =
''/opt/app/oracle/admin/rac11g2s/adump'' comment=
'''' scope=spfile";
sql clone "alter system set  dispatchers =
''(PROTOCOL=TCP) (SERVICE=rac11g2sXDB)'' comment=
'''' scope=spfile";
sql clone "alter system set  db_unique_name =
''rac11g2s'' comment=
'''' scope=spfile";
sql clone "alter system set  db_file_name_convert =
''+DATA/rac11g2'', ''+DATA/rac11g2s'' comment=
'''' scope=spfile";
sql clone "alter system set  log_file_name_convert =
''+FLASH/rac11g2'', ''+FLASH/rac11g2s'', ''+DATA/rac11g2'', ''+DATA/rac11g2s'' comment=
'''' scope=spfile";
sql clone "alter system set  control_files =
''+DATA'', ''+FLASH'' comment=
'''' scope=spfile";
sql clone "alter system set  instance_number =
1 comment=
'''' scope=spfile";
sql clone "alter system set  log_archive_max_processes =
5 comment=
'''' scope=spfile";
sql clone "alter system set  fal_client =
''RAC11G2S'' comment=
'''' scope=spfile";
sql clone "alter system set  fal_server =
''RAC11G21'', ''RAC11G22'' comment=
'''' scope=spfile";
sql clone "alter system set  remote_listener =
''racb-scan:1521'' comment=
'''' scope=spfile";
sql clone "alter system set  log_archive_dest_2 =
''service=RAC11G2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2'' comment=
'''' scope=spfile";
sql clone "alter system set  log_archive_dest_1 =
''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2s'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/opt/app/oracle/admin/rac11g2s/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=rac11g2sXDB)'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''rac11g2s'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''+DATA/rac11g2'', ''+DATA/rac11g2s'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''+FLASH/rac11g2'', ''+FLASH/rac11g2s'', ''+DATA/rac11g2'', ''+DATA/rac11g2s'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''+DATA'', ''+FLASH'' comment= '''' scope=spfile

sql statement: alter system set  instance_number =  1 comment= '''' scope=spfile

sql statement: alter system set  log_archive_max_processes =  5 comment= '''' scope=spfile

sql statement: alter system set  fal_client =  ''RAC11G2S'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''RAC11G21'', ''RAC11G22'' comment= '''' scope=spfile

sql statement: alter system set  remote_listener =  ''racb-scan:1521'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_2 =  ''service=RAC11G2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2s'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     630501376 bytes

Fixed Size                     2229120 bytes
Variable Size                247467136 bytes
Database Buffers             373293056 bytes
Redo Buffers                   7512064 bytes

contents of Memory Script:
{
sql clone "alter system set  control_files =
''+DATA/rac11g2s/controlfile/current.256.743447505'', ''+FLASH/rac11g2s/controlfile/current.256.743447507'' comment=
''Set by RMAN'' scope=spfile";
backup as copy current controlfile for standby auxiliary format  '+DATA/rac11g2s/controlfile/current.257.743447507';
restore clone controlfile to  '+FLASH/rac11g2s/controlfile/current.257.743447507' from
'+DATA/rac11g2s/controlfile/current.257.743447507';
sql clone "alter system set  control_files =
''+DATA/rac11g2s/controlfile/current.257.743447507'', ''+FLASH/rac11g2s/controlfile/current.257.743447507'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DATA/rac11g2s/controlfile/current.256.743447505'', ''+FLASH/rac11g2s/controlfile/current.256.743447507'' comment= ''Set by RMAN'' scope=spfile

Starting backup at 18-FEB-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/opt/app/oracle/product/11.2.0/db_1/dbs/snapcf_rac11g21.f tag=TAG20110218T161053 RECID=1 STAMP=743443854
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 18-FEB-11

Starting restore at 18-FEB-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 instance=rac11g2s1 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 18-FEB-11

sql statement: alter system set  control_files =   ''+DATA/rac11g2s/controlfile/current.257.743447507'', ''+FLASH/rac11g2s/controlfile/current.257.743447507'' comment= ''Set by RMAN'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     630501376 bytes

Fixed Size                     2229120 bytes
Variable Size                247467136 bytes
Database Buffers             373293056 bytes
Redo Buffers                   7512064 bytes

contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
set newname for tempfile  1 to
"+data";
switch clone tempfile all;
set newname for datafile  1 to
"+data";
set newname for datafile  2 to
"+data";
set newname for datafile  3 to
"+data";
set newname for datafile  4 to
"+data";
set newname for datafile  5 to
"+data";
set newname for datafile  6 to
"+data";
set newname for datafile  7 to
"+data";
backup as copy reuse
datafile  1 auxiliary format
"+data"   datafile
2 auxiliary format
"+data"   datafile
3 auxiliary format
"+data"   datafile
4 auxiliary format
"+data"   datafile
5 auxiliary format
"+data"   datafile
6 auxiliary format
"+data"   datafile
7 auxiliary format
"+data"   ;
sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +data in control file

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 backup at 18-FEB-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/rac11g2/datafile/sysaux.257.740770047
output file name=+DATA/rac11g2s/datafile/sysaux.258.743447539 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/rac11g2/datafile/system.256.740770045
output file name=+DATA/rac11g2s/datafile/system.259.743447625 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/rac11g2/datafile/undotbs1.258.740770049
output file name=+DATA/rac11g2s/datafile/undotbs1.260.743447699 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/rac11g2/datafile/undotbs2.264.740770355
output file name=+DATA/rac11g2s/datafile/undotbs2.261.743447725 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/rac11g2/datafile/users.259.740770049
output file name=+DATA/rac11g2s/datafile/users.262.743447733 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DATA/rac11g2/datafile/test.268.741633047
output file name=+DATA/rac11g2s/datafile/test.263.743447733 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=+DATA/rac11g2/datafile/test.269.741633183
output file name=+DATA/rac11g2s/datafile/test.264.743447735 tag=TAG20110218T161124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 18-FEB-11

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=1 STAMP=743447740 file name=+DATA/rac11g2s/datafile/system.259.743447625
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=743447740 file name=+DATA/rac11g2s/datafile/sysaux.258.743447539
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=743447740 file name=+DATA/rac11g2s/datafile/undotbs1.260.743447699
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=743447740 file name=+DATA/rac11g2s/datafile/users.262.743447733
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=743447740 file name=+DATA/rac11g2s/datafile/undotbs2.261.743447725
datafile 6 switched to datafile copy
input datafile copy RECID=6 STAMP=743447740 file name=+DATA/rac11g2s/datafile/test.263.743447733
datafile 7 switched to datafile copy
input datafile copy RECID=7 STAMP=743447740 file name=+DATA/rac11g2s/datafile/test.264.743447735
Finished Duplicate Db at 18-FEB-11
18. Once the above command suceeds on primary on the standby(rac4b node) run the log apply command
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
On the database alert log it could be observed archived logs being applied
Fri Feb 18 17:19:56 2011
alter database recover managed standby database using current logfile disconnect
Attempt to start background Managed Standby Recovery process (rac11g2s1)
Fri Feb 18 17:19:56 2011
MRP0 started with pid=60, OS id=8639
MRP0: Background Managed Standby Recovery process started (rac11g2s1)
started logmerger process
Fri Feb 18 17:20:01 2011
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 2 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Fri Feb 18 17:20:02 2011
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_1_seq_53.269.743447835
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_2_seq_43.268.743447835
Completed: alter database recover managed standby database using current logfile disconnect
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_1_seq_54.271.743447847
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_2_seq_44.270.743447847
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_2_seq_45.273.743447887
Media Recovery Log +FLASH/rac11g2s/archivelog/2011_02_18/thread_1_seq_55.272.743447883
Media Recovery Waiting for thread 1 sequence 56 (in transit)
Recovery of Online Redo Log: Thread 1 Group 6 Seq 56 Reading mem 0
Mem# 0: +DATA/rac11g2s/onlinelog/group_6.270.743447749
Mem# 1: +FLASH/rac11g2s/onlinelog/group_6.263.743447751
Media Recovery Waiting for thread 2 sequence 46 (in transit)
Recovery of Online Redo Log: Thread 2 Group 9 Seq 46 Reading mem 0
Mem# 0: +DATA/rac11g2s/onlinelog/group_9.273.743447755
Mem# 1: +FLASH/rac11g2s/onlinelog/group_9.266.743447755
Another way to find out is to connect into the standby instance (rac11g2s1 running on rac4b node) and issue
SQL> select sequence#,thread#,applied from v$archived_log;

SEQUENCE#    THREAD# APPLIED
---------- ---------- ---------
53          1 YES
43          2 YES
54          1 YES
44          2 YES
55          1 YES
45          2 IN-MEMORY
6 rows selected.
which shows YES on archive log applied column.



19. With above configuration inplace the data guard is setup and working. The next step is to bring the standby database under the control of the cluster. For this on the standby instance create a pfile from the spfile that was created during the duplication process.
SQL> create pfile='/home/oracle/stdbypfile.ora' from spfile;
20. Edit the pfile and remove any references to primary db (rac11g2) except db_name this must be same as primary db. Set instance specific instance_number, undo_tablespace, fal_client and thread. pfile content after the edit is given below
rac11g2s1.__db_cache_size=373293056
rac11g2s1.__java_pool_size=4194304
rac11g2s1.__large_pool_size=4194304
rac11g2s1.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
rac11g2s1.__pga_aggregate_target=209715200
rac11g2s1.__sga_target=633339904
rac11g2s1.__shared_io_pool_size=0
rac11g2s1.__shared_pool_size=239075328
rac11g2s1.__streams_pool_size=0
rac11g2s2.__db_cache_size=373293056
rac11g2s2.__java_pool_size=4194304
rac11g2s2.__large_pool_size=4194304
rac11g2s2.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
rac11g2s2.__pga_aggregate_target=209715200
rac11g2s2.__sga_target=633339904
rac11g2s2.__shared_io_pool_size=0
rac11g2s2.__shared_pool_size=239075328
rac11g2s2.__streams_pool_size=0
*.audit_file_dest='/opt/app/oracle/admin/rac11g2s/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA/rac11g2s/controlfile/current.257.743447507','+FLASH/rac11g2s/controlfile/current.257.743447507'#Set by RMAN
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain='domain.net'
*.db_file_name_convert='+DATA/rac11g2','+DATA/rac11g2s'
*.db_name='rac11g2'
*.db_recovery_file_dest='+FLASH'
*.db_recovery_file_dest_size=9470738432
*.db_unique_name='rac11g2s'
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=rac11g2sXDB)'
rac11g2s1.fal_client='RAC11G2S1'
rac1g2s22.fal_client='RAC11G2S2'
*.fal_server='RAC11G21','RAC11G22'
rac11g2s1.instance_number=1
rac11g2s2.instance_number=2
*.log_archive_config='dg_config=(rac11g2,rac11g2s)'
*.log_archive_dest_2='service=RAC11G2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_uniq
ue_name=rac11g2'
*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=rac11g2s'
*.log_archive_dest_state_2='enable'
*.log_archive_dest_state_1='enable'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=5
*.log_file_name_convert='+FLASH/rac11g2','+FLASH/rac11g2s','+DATA/rac11g2','+DATA/rac11g2s'
*.open_cursors=300
*.pga_aggregate_target=209715200
*.processes=150
*.remote_listener='racb-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sga_target=631242752
*.standby_file_management='AUTO'
rac11g2s1.undo_tablespace='UNDOTBS1'
rac11g2s2.undo_tablespace='UNDOTBS2'
rac11g2s1.thread=1
rac11g2s2.thread=2
21. Shutdown the database and startup mount and create a spfile with +ASM diskgroup as the locaiton
SQL>alter database recover managed standby database cancel;

SQL>startup mount pfile='/home/oracle/stdbypfile.ora';

ORACLE instance started.

Total System Global Area  630501376 bytes
Fixed Size                  2229120 bytes
Variable Size             247467136 bytes
Database Buffers          373293056 bytes
Redo Buffers                7512064 bytes
Database mounted.

SQL> create spfile='+DATA/rac11g2s/spfilerac11g2s.ora' from pfile='/home/oracle/stdbypfile.ora';

File created.

SQL> shutdown immediate;
22. Create pfile file on each node's oracle home (ORACLE_HOME/dbs) that points to the spfile by adding one line that referes to the spfile
vi initrac11g2s1.ora
spfile='+DATA/rac11g2s/spfilerac11g2s.ora'
Above is for rac4b, create initrac11g2s2.ora on rac5b.

23. Once above pfiles are created remove the spfile in $ORACLE_HOME/dbs that was created as part of the duplication.

24. Before bringing the standby instance under cluster control check it could be started on all other nodes with their respective instances. In this case rac5b since this is a two node rac, export ORACLE_SID to rac11g2s2 and start the instance in mount mode. Resolve any issues (init parameter related) before proceeding to the next step)

25. To add the database and instances to the cluster configuration run
$GRID_HOME/bin/srvctl add database -d rac11g2s -o $ORACLE_HOME -m local -p "+DATA/rac11g2s/spfilerac11g2s.ora" -n rac11g2 -r physical_standby -s mount
$GRID_HOME/bin/srvctl add instance -d rac11g2s -i rac11g2s1 -n rac4b
$GRID_HOME/bin/srvctl add instance -d rac11g2s -i rac11g2s2 -n rac5b
Without the "-s mount" the standby database would be started in open (read only) mode by default (both R1 and R2). With 11g (both R1 and R2) it is possible to apply redo while the database is open in read only mode. But this requires active dataguard license and setting the default startup mode to mount prevents such activity from happenning when active dataguard is not licensed. On 11gR1 db instances could be made dependent on that node's asm instance but this option is deprecated in 11gr2
$CRS_HOME/bin/srvctl modify instance -d rac11g2s -i rac11g2s1 -s +ASM1
-s option has been deprecated and will be ignored.

srvctl config database -d rac11g2s
Database unique name: rac11g2s
Database name: rac11g2
Oracle home: /opt/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/rac11g2s/spfilerac11g2s.ora
Domain: local
Start options: mount
Stop options: immediate
Database role: PHYSICAL_STANDBY
Management policy: AUTOMATIC
Server pools: rac11g2s
Database instances: rac11g2s1,rac11g2s2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
26. Test the configuration with starting the entire standby database
srvctl status database -d rac11g2s
Instance rac11g2s1 is not running on node rac4b
Instance rac11g2s2 is not running on node rac5b

srvctl start database -d rac11g2s

srvctl status database -d rac11g2s
Instance rac11g2s1 is running on node rac4b
Instance rac11g2s2 is running on node rac5b
Once the database is started as a cluster resource the asm dependencies are automatically added as well as the local_listener values which were reset during the duplication.
crsctl stat res ora.rac11g2s.db -p

NAME=ora.rac11g2s.db
TYPE=ora.database.type
..
SERVER_POOLS=ora.rac11g2s
SPFILE=+DATA/rac11g2s/spfilerac11g2s.ora
START_DEPENDENCIES=hard(ora.DATA.dg,ora.FLASH.dg)weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns)pullup(ora.DATA.dg,ora.FLASH.dg)
START_TIMEOUT=600
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=hard(intermediate:ora.asm,shutdown:ora.DATA.dg,shutdown:ora.FLASH.dg)
..

SQL> show parameter local

NAME            TYPE        VALUE
--------------- ---------- ------------------------------
local_listener  string      (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP(HOST=192.168.0.98)(PORT=1521))))
26. Start the recovery process on one of the standby instances.
SQL> alter database recover managed standby database using current logfile disconnect;
This concludes the setup of RAC-RAC data guard.

27. To make sure archive logs don't get deleted on primary without being applied on standby set the log deletion policy to applied on standby. For this at least one log archive locations must be mandatory.
SQL> alter system set log_archive_dest_2='service=RAC11G2S LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2s mandatory' scope=both sid='*';
Usign rman chagne the archive log deletion policy.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters are successfully stored
If it is configured APPLIED ON ALL STANDBY then archived redo log files are eligible for deletion after being applied or consumed on all remote destinations, whether mandatory or not.

With mandatory destination inplace if the standby is not up and accepting redo when the primary starts following error
PING[ARC1]: Heartbeat failed to connect to standby 'RAC11G2S'. Error is 12543.
Archived Log entry 202 added for thread 1 sequence 80 ID 0x16a13366 dest 10:
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance rac11g21 - Archival Error
ORA-16038: log 2 sequence# 80 cannot be archived
ORA-12543: TNS:destination host unreachable
ORA-00312: online log 2 thread 1: '+DATA/rac11g2/onlinelog/group_2.262.740770163'
ORA-00312: online log 2 thread 1: '+FLASH/rac11g2/onlinelog/group_2.258.740770163'
and any alter system switch logfile commands will hang.

Distributing redo load

It is possible to distribute the redo load among all standby instnaces. In this case instead of sending the redo from all primary instance to one standby instance each primary instance will send its redo to corresponding standby instance. This configuration is ideal in a symmetric data guard environment and one signle standby instnace cannot keep up with all the redo generated. To do this set primary instance specific log_archive_dest values
alter system set log_archive_dest_2='service=RAC11G2S1 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2s mandatory' scope=spfile sid='rac11g21';

alter system set log_archive_dest_2='service=RAC11G2S2 LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180 valid_for=(online_logfiles,primary_role) db_unique_name=rac11g2s mandatory' scope=spfile sid='rac11g22';
Here rac11g21 will send its redo to rac11g2s1 and rac11g22 will send to rac11g2s22.

But there can only be one apply instance.

Otherway around, sending all primary redo once standby instance gives more flexibility than above one-to-one redo transport configuration. In this case if the current standby apply instance need to be shutdown all that is required is stop the apply service on that instance and start in another instance. Since there's no instance specific redo transport configuration no additional steps are required. (provided the TNS entry has addressed for all standby instances similar to rac11g2s TNS entry above).

Related Post
11gR2 Standalone Data Guard (with ASM and Role Separation)
Data Guard Broker for 11gR2 RAC
Enable Active Dataguard on 11gR2 RAC Standby
Creating Data Guard Broker on 12c
Adding Far Sync Instances to Existing Data Guard Configuration
Setting Up Data Guard Broker for an Existing Data Guard Configuration with Far Sync