Posted in 2016

Dataguard Broker is not working correctly?

First configuration looked like this:

create configuration 'DGConfig' as primary database is orcl_site1 connect identifier is orcl_site1 ;
add database orcl_site2 as connect identifier is orcl_site2 ;
enable configuration ;

Everything finished successfully, show configuration showed nice output. BUT after a while it stopped to work, I got an error on the standby database. Nothing worked, I could not switchover to orcl_site2, but show database verbose orcl_site[1,2] gave good information, real time apply worked (tablespace created/dropped).

So I removed the configuration and added all 4 orcl_site[1,2] from the configuration between single quotes and now everything works.
Hm, interresting.

Advertisements
Posted in 2016

RAC to RAC standby

I want to pay tribute to this page: RAC to Standby RAC
very good example, all examples should look like this one, but some remarks (for me):
– you don’t need to create the directory structure, it’s ASM
– when you copy the parameter file, check diagnostic_dest when you change the directory structure 😉

For 12c: only 1 thing is problematic:

RMAN> connect target sys/oracle@orcl1

connected to target database: ORCL (DBID=1438646520)

RMAN> connect auxiliary /

connected to auxiliary database: ORCL (not mounted)

RMAN> duplicate target database for standby ;

Starting Duplicate Db at 03-MAY-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=36 instance=orcl1 device type=DISK

contents of Memory Script:
{
   restore clone standby controlfile;
}
executing Memory Script

Starting restore at 03-MAY-16
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /tmp/orcl_03r4livv_1_1.bck
channel ORA_AUX_DISK_1: ORA-19870: error while restoring backup piece /tmp/orcl_03r4livv_1_1.bck
ORA-19504: failed to create file "+DATA1/ORCL_SITE2/CONTROLFILE/control01.ctl"
ORA-17502: ksfdcre:3 Failed to create file +DATA1/ORCL_SITE2/CONTROLFILE/control01.ctl
ORA-15001: diskgroup "DATA1" does not exist or is not mounted
ORA-15040: diskgroup is incomplete

Do not forget to have correct permissions on oracle binary

[root@standby1 dbs]# /products/grid/12.1.0.2/bin/setasmgid -o=/products/oracle/12.1.0.2/bin/oracle
[root@standby1 dbs]# ls -l /products/oracle/12.1.0.2/bin/oracle
-rwsr-s--x. 1 oracle asmadmin 323791685 May  3 11:08 /products/oracle/12.1.0.2/bin/oracle

And finally it starts to work:

[oracle@standby1 ~]$ rman

Recovery Manager: Release 12.1.0.2.0 - Production on Tue May 3 12:18:04 2016

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

RMAN> connect target sys/oracle@orcl1

connected to target database: ORCL (DBID=1438646520)

RMAN> connect auxiliary /

connected to auxiliary database (not started)

RMAN> startup clone force nomount pfile='?/dbs/pfile'; 

Oracle instance started

Total System Global Area     838860800 bytes

Fixed Size                     2929936 bytes
Variable Size                683674352 bytes
Database Buffers             146800640 bytes
Redo Buffers                   5455872 bytes

RMAN> 

RMAN> duplicate target database for standby ;

Starting Duplicate Db at 03-MAY-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=41 instance=orcl1 device type=DISK

contents of Memory Script:
{
   restore clone standby controlfile;
}
executing Memory Script

Starting restore at 03-MAY-16
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /tmp/orcl_03r4livv_1_1.bck
channel ORA_AUX_DISK_1: piece handle=/tmp/orcl_03r4livv_1_1.bck tag=TAG20160503T115143
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=+DATA1/ORCL_SITE2/CONTROLFILE/control01.ctl
Finished restore at 03-MAY-16

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

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   set newname for clone datafile  1 to new;
...
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=910873400 file name=+DATA1/ORCL_SITE2/DATAFILE/users.265.910873271
Finished Duplicate Db at 03-MAY-16