Ask this server who the Primary is
Posted in 2011
Topics: High Availability & Replication
Hello, This is a peculiar one. We have a backup script that runs on every database host (Linux). We have an HDR Primary, an HDR Secondary and an RSS Secondary. The script needs to connect to sysmaster on the local-host and find out who the Primary database is? How can I do this? Once it then has the name of the Primary IDS engine, the script connects to the Primary database instead to update data etc. We just don't know how to find the name of the primary database engine from within sysmaster when we can't predict what mode the local-host IDS engine is going to be in? Thanks in advance.
Configure the three servers in a group as in... my_cluster group - - serv1 onsoctcp machine1 port1 g=my_cluster serv2 oncoctcp machine2 port2 g=my_cluster serv3 onsoctcp machine3 port3 g=my_cluster Then simply connect to the group name "my_cluster". The connection will resolve to the primary node. Alternatively, use the connection manager. From: "ANDREW LEMIN" <a_lemin@hotmail.com> To: ids@iiug.org Date: 03/23/2011 10:37 AM Subject: Ask this server who the Primary is [23181] Sent by: ids-bounces@iiug.org Hello, This is a peculiar one. We have a backup script that runs on every database host (Linux). We have an HDR Primary, an HDR Secondary and an RSS Secondary. The script needs to connect to sysmaster on the local-host and find out who the Primary database is? How can I do this? Once it then has the name of the Primary IDS engine, the script connects to the Primary database instead to update data etc. We just don't know how to find the name of the primary database engine from within sysmaster when we can't predict what mode the local-host IDS engine is going to be in? Thanks in advance. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Hello, I was aware you could do this by connecting to a cluster defintion, however I need to know explicitly who the primary database is as there are other functions in the script that need this information. Thank you very much for the suggestion though :) Cheers, Andy.
You can get the site by quizing sysmaster syscfg. From: "ANDREW LEMIN" <a_lemin@hotmail.com> To: ids@iiug.org Date: 03/23/2011 11:05 AM Subject: Re: Ask this server who the Primary is [23183] Sent by: ids-bounces@iiug.org Hello, I was aware you could do this by connecting to a cluster defintion, however I need to know explicitly who the primary database is as there are other functions in the script that need this information. Thank you very much for the suggestion though :) Cheers, Andy. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.