Kamal Suri · Nov 5, 2021

Identify a Mirror member status

I want to write some code differently to run on Primary, Backup and DR depending upon their status.

If its Primary then do something, if Backup then something else and if DR then do something different from both Primary and Backup.


This can identified whether a system is Primary or Not Primary by calling below method

w $SYSTEM.Mirror.IsPrimary()

1 means Primary and 0 means Not Primary. But a Not Primary member may be a backup or a Async DR or a Async Reporting.

How to identify if a system is a DR or Backup or Reporting?

Product version: HealthShare 2017.2
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2017.2.2 (Build 865_3_20144U) Mon Aug 17 2020 13:28:18 EDT
0 163
Discussion (4)1
Log in or sign up to continue

I think the function you might be looking for may be:

W $SYSTEM.Mirror.GetMemberType()

The return values are: Indeterminate, Not Member, Failover, Async, Disaster Recovery, Read-Only Reporting or Read-Write Reporting.

You can also get a lot more info than just if it's a primary or not from:

W $SYSTEM.Mirror.GetStatus()

Hope this helps!

Thanks Roger..  this is what I was looking for.