In Data Guard, for some reason, standby database rule are incorrectly shown as primary database, while primary database shows as standby rule.
DGMGRL> show configuration;
Configuration - TESTDB
Protection Mode: MaxPerformance
Databases:
TESTDBSTY - Primary database
Error: ORA-16810: multiple errors or warnings detected
for the database
TESTDB - Physical standby database
Error: ORA-16810: multiple errors or warnings detected
for the database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
DGMGRL> show database "TESTDBSTY";
Database - TESTDBSTY
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s): TESTDBSTY
Error: ORA-16782: instance not open for read and write access
Database Error(s):
ORA-16816: incorrect database role
Database Status:
ERROR
How to fix it ?
DGMGRL> remove configuration;
Removed configuration
DGMGRL> show configuration;
ORA-16596: database not part of the Data Guard broker configuration
Configuration details cannot be determined by DGMGRL
DGMGRL> create configuration 'TESTDB' as primary database
is 'TESTDB' connect identifier is 'TESTDB';
Configuration "TESTDB" created with primary database "TESTDB"
DGMGRL>ADD DATABASE 'TESTDBSTY' AS CONNECT IDENTIFIER IS 'TESTDBSTY'
MAINTAINED AS PHYSICAL;
Database "TESTDBSTY" added
DGMGRL>
DGMGRL> enable configuration;
Enabled.
DGMGRL>