Recently, data guard (Oracle version: 10.2.0.1.0) is configured and managed using a broker. Earlier databases basically do not have db_domain settings. When database link is used, global_names = true is enabled, db_domain is also set, so we can successfully use the broker to configure and manage data guard settings in the past. Now we can't do it. I can't do it, it's when using the broker for switchover, the instances of the master and slave databases are not automatically started and must be manually started.
When I use show configuration, the broker also prompts successs, as shown below:
Dgmgrl> show configuration;
Configuration
Name: dgmgrl_1
Enabled: Yes
Protection Mode: maxperformance
Fast-start failover: Disabled
Databases:
Prod-physical standby Database
Sbdb-primary database
Current status for "dgmgrl_1 ":
Success
However, when I use switchover, the failure to automatically start instances is as follows:
Dgmgrl> switchover to prod;
Ming switchover now, please wait...
Operation requires shutdown of instance "sbdb" on Database "sbdb"
Shutting down instance "sbdb "...
ORA-01109: Database not open
Database dismounted.
Oracle instance shut down.
Operation requires shutdown of instance "Prod" on Database "Prod"
Shutting down instance "Prod "...
ORA-01109: Database not open
Database dismounted.
Oracle instance shut down.
Operation requires startup of instance "sbdb" on Database "sbdb"
Starting instance "sbdb "...
Oracle instance started.
Database mounted.
Operation requires startup of instance "Prod" on Database "Prod"
Starting instance "Prod "...
Unable to connect to database
ORA-12514: TNS: Listener does not currently know of Service requested in connect Descriptor
Failed.
You are no longer connected to Oracle
Please connect again.
Unable to start instance "Prod"
You must start instance "Prod" manually
Switchover succeeded, new primary is "Prod"
From the error message above, we can see that there must be a problem with the Listener Configuration. below is the listener. ora
Listener. ora
Listener =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = vmoel5u4.oracle.com) (Port = 1521 ))
)
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = prod_dgmgrl)
(ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1)
(Sid_name = prod)
)
(Sid_desc =
(Global_dbname = prod)
(ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1)
(Sid_name = prod)
)
)
So I checked the db_domain of the database:
SQL> show parameter db_domain;
Name type value
--------------------------------------------------------------------------------------------------
Db_domain string oracle. com
It is found that db_domain refers to the following format.
Listener. ora
Listener =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = vmoel5u4.oracle.com) (Port = 1521 ))
)
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname =Prod_dgmgrl.oracle.com)
(ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1)
(Sid_name = prod)
)
(Sid_desc =
(Global_dbname = prod)
(ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1)
(Sid_name = prod)
)
)
Perform switchover again. The instances is automatically started this time:
Dgmgrl> switchover to prod;
Ming switchover now, please wait...
Operation requires shutdown of instance "sbdb" on Database "sbdb"
Shutting down instance "sbdb "...
ORA-01109: Database not open
Database dismounted.
Oracle instance shut down.
Operation requires shutdown of instance "Prod" on Database "Prod"
Shutting down instance "Prod "...
ORA-01109: Database not open
Database dismounted.
Oracle instance shut down.
Operation requires startup of instance "sbdb" on Database "sbdb"
Starting instance "sbdb "...
Oracle instance started.
Database mounted.
Operation requires startup of instance "Prod" on Database "Prod"
Starting instance "Prod "...
Oracle instance started.
Database mounted.
Switchover succeeded, new primary is "Prod"
Dgmgrl> show configuration;
Configuration
Name: dgmgrl_1
Enabled: Yes
Protection Mode: maxperformance
Fast-start failover: Disabled
Databases:
Prod-primary database
Sbdb-physical standby Database
Current status for "dgmgrl_1 ":
Success
In the oralce tutorial, this is the case:
To enable the data guard broker CLI to restart instances during the course of broker operations, a service with a specific name must be statically registered with the local listener of each instance. The value of
Global_dbname attribute must be set to a concatenation
Db_unique_name_dgmgrl.db_domain.