| Incorrect database role [message #485924] |
Sat, 11 December 2010 15:18  |
mateenaslam
Messages: 21 Registered: November 2010 Location: Islamabad, Pakistan
|
Junior Member |
|
|
Hi,
I am getting error ORA-16816: incorrect database role. The reason is my switch over to standby become failed and now both primary and standby databases showing 'database_role' as 'Physical Standby'.
My question is how to manually set 'database_role' to 'PRIMARY' on primary database.
--------------------------------------------
DGMGRL> show configuration
Configuration - dgproj
Protection Mode: MaxPerformance
Databases:
repl - Primary database
Error: ORA-16816: incorrect database role
dgrepl - Physical standby database
--------------------------------------------
|
|
|
|
|
|
| Re: Incorrect database role [message #485971 is a reply to message #485924] |
Sun, 12 December 2010 05:59   |
John Watson
Messages: 3178 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I have seen the reverse situation, where Data Guard Broker thought that both databases were primary. I would suggest that the first thing to do is to disable and remove the configuration, and (very important) delete all the config files. Then check reality: connect to both databases with SQL*Plus, and see if they are, in fact, primary or standby.
If you do have a primary and a standby, create a new configuration. Easy.
If both database are in fact standby, you will have to activate one of them as a primary, create a new configuration, and then try to reinstate the other as a standby. That might be a bit harder.
|
|
|
|
| Re: Incorrect database role [message #486001 is a reply to message #485971] |
Sun, 12 December 2010 12:24   |
mateenaslam
Messages: 21 Registered: November 2010 Location: Islamabad, Pakistan
|
Junior Member |
|
|
Yes, i have connect to both database by SQL*Plus and got both database_role as 'PHYSICAL STANDBY'. Any guide line how to activate one as a primary ?
--------------------------------------------
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
--------------------------------------------
|
|
|
|
| Re: Incorrect database role [message #486011 is a reply to message #486001] |
Sun, 12 December 2010 14:07   |
John Watson
Messages: 3178 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote:Any guide line how to activate one as a primary ?
I can't add anything to the description of the command that you'll find in your Data Guard Concepts and Admin guide.
|
|
|
|
| Re: Incorrect database role [message #486067 is a reply to message #486011] |
Mon, 13 December 2010 07:12   |
mateenaslam
Messages: 21 Registered: November 2010 Location: Islamabad, Pakistan
|
Junior Member |
|
|
Thanks for Data Guard Concepts and admin guide reference. This is how i made my database back to Primary
-------------------------------------------------------------
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database recover managed standby database cancel;
SQL> alter database recover managed standby database finish;
SQL> ALTER database commit to switchover to primary with session shutdown;
SQL> alter database open;
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
-------------------------------------------------------------
|
|
|
|
|
|
| Re: Incorrect database role [message #486069 is a reply to message #486067] |
Mon, 13 December 2010 07:28   |
babuknb
Messages: 1702 Registered: December 2005 Location: NJ
|
Senior Member |
 
|
|
Yes, Your correct, Oracle also suggest manually need to fix this issue.
Quote:
ORA-16816: incorrect database role
Cause: The Data Guard broker detected that this database object had a database role that was different from the recorded database role in the Data Guard Configuration. This could be the result of a failed switchover or failover operation, or an out-of-band switchover or failover operation done to the database.
Action: Manually fix the database to convert it to the appropriate database role, then issue an ENABLE DATABASE command to reenable the database object.
[Updated on: Mon, 13 December 2010 10:43] by Moderator Report message to a moderator
|
|
|
|
| Re: Incorrect database role [message #574904 is a reply to message #486069] |
Wed, 16 January 2013 13:05  |
 |
bakuman
Messages: 1 Registered: January 2013
|
Junior Member |
|
|
My DG Broker giving wrong information when I do "show configuration". It appears that after previous switchover activity, in DG Broker, my primary db is being reported as standby. My standby is being reported as primary. It also reports ORA-16816: incorrect database role.
I double-check the actual database role using SQL Plus and all info were correct.
To correct this issue, I rebuilt the DG Broker configuration again as below:
-Disable configuration broker on primary and standby
DGMGRL> disable configuration;
Disabled.
DGMGRL> disable configuration;
Disabled.
SQL> alter system set dg_broker_start=FALSE;
-drop exisiting broker configuration files on primary and standby (from the +ASM folders or regular file system)
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +ASMDATA_DG/dbname/dgconfig/dr1xxxxx.dat
dg_broker_config_file2 string +ASMRECV_DG/dbname/dgconfig/dr2xxxxx.dat
dg_broker_start boolean TRUE
-ensure the value of DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2 correctly in primary and standby
-enable broker in primary and standby
alter system set dg_broker_start=TRUE;
-create broker configuration again (do it from primary)
DGMGRL> create configuration 'XXXXXX' as primary database is 'XXXXXX' connect identifier is 'XXXXXX';
Configuration "XXXXXX" created with primary database "XXXXXX"
-add standby in configuration (do it from primary)
DGMGRL> ADD DATABASE 'XXXXXX' AS CONNECT IDENTIFIER IS 'XXXXXX' MAINTAINED AS PHYSICAL;
Database "XXXXXX" added
-enable configuration
DGMGRL> enable configuration;
Enabled.
|
|
|
|