Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 High Availability (2005)
 How to find out the server is a primary/secondary

Author  Topic 

Sasikala
Starting Member

8 Posts

Posted - 2010-05-06 : 09:01:21
Hi,

I would want to check whether server is acting as a primary or secondary server? i.e any table or stored procedure has this detail.

How to do this? (not manually like, from the jobs we can identify).
From any table, can we identify this?

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-05-06 : 09:49:00
Any server you can query is acting as the primary.

Do you mean you want the name of the currently active node?



CODO ERGO SUM
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-05-06 : 09:56:35
Clustering, database mirroring or log shipping?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Sasikala
Starting Member

8 Posts

Posted - 2010-05-07 : 00:39:09
@GilaMonster

For Logshipping.

@Michel,

I want to know whether its a primary or secondary server in logshipping.

( How to check whether the current machine is acting as a primary or secondary server in logshipping ).
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-05-07 : 03:41:49
If the database is online, it's the primary. If it's restoring or standby, it's the secondary. That's a per-database thing, not server-wide. It's possible for a server to have a primary database for one log shipping setup and a standby database for another.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Sasikala
Starting Member

8 Posts

Posted - 2010-05-07 : 08:33:56
@GilaMonster,
Thanks for your clarification.

Additional questions:
Is there a way to check, for a database logshipping is enabled or not? ( any system table entries for this? )
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2010-06-08 : 15:44:03
On primary database, right click, properties, log shipping, check enable log shipping
Go to Top of Page

venkath
Posting Yak Master

202 Posts

Posted - 2010-06-10 : 07:58:38
The below queries will help us.

select * from msdb..log_shipping_primary_databases
select * from msdb..log_shipping_secondary_databases
Go to Top of Page
   

- Advertisement -