Solved

Sybase disk mirror

Posted on 2009-07-04
4
1,121 Views
Last Modified: 2012-05-07
I have configure the disk mirror on my Sybase machine, How do I monitor the progress of mirror? how will I notice my mirror going down or issue occured ?
0
Comment
Question by:motioneye
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 24778557
Maybe you are coming from the MicroShaft world, and you need to check that things are working all the time.  In the Sybase world, things do not break, and if they do break (for reasons beyond ASE control, such as a disk going down) you will get error messages.  These are logged in the errorlog file, which is located in:
C:\sybase\ASE-12_5\install
with the RUN_SERVER files.  You should be inspecting the errorlog regularly.  On Windoze, you can set it up to log messages in the system event log as well.  Most of us have either the errorlog piped to a window on our DBA desktop, or a simple shell script running that scans the errorlog and sends us email if an error is logged.

The deterministic question is:
Do you monitor normal disks, ie. unmirrored disks, or all your disks before you initialised your mirror ?
You need to do the exact same monitoring for the mirrors.  Nothing less, nothing more.

If a disk device (a mirror is just another disk device) goes down, an error will be logged.  If the disk is mirrored, there is no effect on the users, the mirror will keep going, and you can re-create the new disk somewhere else.  If the disk is unmirrored, all writes to the failed disk will fail, and users will be affected.

I am not sure what you mean by "progress" of the mirror.  The mirror is active 100% of the time, all writes to the device will be duplicated to the mirror device.  It is only when you start a new mirror that there is an initial witing to it, to make it a mirror, a "catch-up" period.

For monitoring the activity on both the device and the mirror device, use sp_sysmon.  Or any one of the available good 3rd party monitoring tools.

I am not saying that you should not use Sybase mirroring, but you should evaluate doing the mirroring at the Disk Controller or Volume Manager level.  This is much faster, because it is middleware, and it releases ASE from the task, which allows those free cycles to be used for the other things ASE does.  Sybase mirroring was essential in the old days, before Volume Managers were available, but since their advent, it is the slower choice.  Additionally, with a VM, you can configure and re-configure the entire disk array for the server (or several servers), not just the Sybase devices.  Sybase mirrors remain essential and are excellent for other purposes (not relevant to this question).
0
 

Author Comment

by:motioneye
ID: 24780407
Hi,'
Thanks for this very long explicit explanation, Yes I'm 100% belongs to Mcsft, It was 10 years back my day with Oracle RDB running on VMS and since then I'm dedicated my self with Mssql + windows :(.
well what I'm trying to say with "progress" is just need to know if this sybase mirror provide us with any command or sp which we can monitor how mirror works at least we know on what command being mirrored to mirror device, if u said we can 100% trust on sybase mirror, then I have niothing much to say :)

< If the disk is unmirrored, all writes to the failed disk will fail, and users will be affected.> is this means we have to immediately to remirror to avoid from downtime ?
do you know when should I activate the mirror device? is that only upon primary device failed/corrupted  is that anyway which mirror will take over immediately upon primary crashed?
0
 
LVL 6

Accepted Solution

by:
IncisiveOne earned 500 total points
ID: 24787603
> need to know if this sybase mirror provide us with any command or sp which we can monitor how mirror works at least we know on what command being mirrored to mirror device
1  When you issue the disk mirror or disk remirror commands, it informs you re the progress of the mirror stating up, many lines, every 10mb IIRC.  That's is for the mirror getting up to speed.

2  sp_helpdevice (at any time) shows you the exact state of the primary device, including the mirror.  Unfortunately you cannot execute  sp_helpdevice on  the mirror directly.  But it does include mirror info, data_13 is the primary device; mirror_13 is the mirror:
'data_13','E:\\data\\data_13','file system device, special, MIRROR ENABLED, mirror = ''E:\\data\\mirror_13'', serial writes, dsync on, directio off, reads mirrored, physical disk, 100.00 MB, Free: 80.00 MB',' 17122','        0','    15','      0','   51199'
3  After disk unmirror, sp_helpdevice produces:
'data_13','E:\\data\\data_13','file system device, special, dsync on, directio off, physical disk, 100.00 MB, Free: 80.00 MB',' 16386','        0','    15','      0','   51199'
 
4  If either the primary device or the mirror device goes down, you will get nasty messages in the errorlog, which you need to monitor (as already described).  Here's an example where I have shutdown ASE; deleted the mirror; then rebooted:
00:00000:00001:2009/07/07 02:53:23.44 kernel  Initializing virtual device 14, 'E:\data\data_12' with dsync 'on'.
00:00000:00001:2009/07/07 02:53:23.44 kernel  Virtual device 14 started using asynchronous i/o.
00:00000:00001:2009/07/07 02:53:23.44 server  Activating disk 'data_13' of size 102400 KB.
00:00000:00001:2009/07/07 02:53:23.44 kernel  dopen: open 'E:\data\mirror_13', Windows NT system error 2: Not a valid filename.
00:00000:00001:2009/07/07 02:53:23.45 kernel  udunmirror: i/o error on secondary device 'E:\data\mirror_13'
00:00000:00001:2009/07/07 02:53:23.45 kernel  DataServer i/o to the device will be disabled
00:00000:00001:2009/07/07 02:53:23.45 kernel  Initializing virtual device 15, 'E:\data\data_13' with dsync 'on'.
00:00000:00001:2009/07/07 02:53:23.45 kernel  Virtual device 15 started using asynchronous i/o.
5  If you are writing scripts to monitor the devices (either primary or mirror), just interrogate master..sysdevices.status.  The Table Reference manual defines the bit values.  Notice the 17122 changed to 16386 after disk unmirror.

6  Do whatever monitoring you do on primary devices, on ASE in general, on the mirrors.

>> If the disk is unmirrored, [and the disk fails,] all writes to the failed disk will fail, and users will be affected.
 > is this means we have to immediately to remirror ] [ to avoid from downtime ?
 
There are two questions there.
7  (That was an unmirrored device we were discussing, not a mirrored device.)  It is too late to mirror or remirror the failed device.  Goodbye world, database (not server) down.
 
8  Downtime.  Yes, there will be downtime.  But not necessarily any lost data.  Sybase can recover from that kind of crash.  You will need to open a whole new question "How do I recover from a disk failure in Sybase".
 
 9  For mirrored devices, if either the primary device or the mirror goes down, there is no effect on the users.  No downtime.  You need to respond to the error messages; disk unmirror; replace the disk; then disk remirror.

> do you know when should I activate the mirror device?
 
 When you set the disks up, once.  Along with the primary.  Map out the disks; determine the devices; create the primary devices; create the mirrors.  Nothing to do after the set up (until something breaks).
 
 > is that only upon primary device failed/corrupted  is that anyway which mirror will take over immediately upon primary crashed?
 
 You may not be understanding mirrors.  Once the mirror is set up, it is always active, 100% of the time.  There is no "take over".  There is no waiting for the primary (or the mirror) to crash, then "taking over" or getting up to speed; at that point it is already too late and the [one side] device is lost ... you cannot read the damaged device to gear up the mirror or alternate device or whatever.

The way it works is, as soon as the disk mirror command completes, both device and the mirror are 100% active, all the time; all writes to the primary device are duplicated to the mirror.  Years later, when either the primary device or the mirror device crashes, the remaining device remains available (which is why all activity can continue without downtime).  At that point there is only one device, unmirrored.  Then repeat [9].  Which gets you back to a mirrored device (on a new disk unit).

Cheers

0
 

Author Closing Comment

by:motioneye
ID: 31599778
very gud explanation indeed
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
A procedure for exporting installed hotfix details of remote computers using powershell
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now