Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

having 2 machines, one being the principal and the second one as a mirror in case of failure of the 1st one. without witness but in High Safety mode

Is any way to check if the mirror DB was synchronised when the Principal has failed?

I need this because I'm concerned if:

1-the mirror goes down

2-the Principal does a lot of work (while mirror is down)

3-the mirror come up, and starts synchronising, while synchronizing the principal goes down

in this situation, can I detect the mirror is not up to date without a witness??

So...is there a way to check if the Mirror database is up to date while the Principal is down?

Edit: I tried to use a Event Notification, to keep track of mirroring changes, but theses notifications are asynchronous, so there is a gap I cant cover.

Is any other way?

share|improve this question

1 Answer 1

You can check the mirroring_state_desc in sys.database_mirroring. It will tell you if the databases are in sync, this does depend on if you're running in High Safety or High Performance mode. In High Performance mode as long as the mirroring process is running it will show state of SYNCHRONIZED while the actual state of the database can be behind as the log records are still being applied.

In this disaster type scenario, I believe the mirroring would be broken and it would be best to know the various ways to get a tail of the log backup combined with the normal course of database and transaction log backups to restore to the point of failure.

Tables 5-7 in this TechNet article cover the various scenarios against the statues reported.

share|improve this answer
    
in this case mirroring_state_desc will only say "Disconnected" it's not good enough...because it can be disconnected but up to date, or disconnected and not up to date –  RagnaRock Dec 19 '11 at 13:29
    
If you've forced the failover over using the FORCE_SERVICE_ALLOW_DATA_LOSS all transaction which weren't committed on the mirror will be rolled back which is why it would be better to recover from the failed principal’s tail log if possible. –  MartinC Dec 19 '11 at 13:43
    
so you are telling me that even in High Safety mode, there is no way to know for sure the data is up to date without a witness? –  RagnaRock Dec 19 '11 at 18:24
    
To know you need access to either both mirroring databases or the log chain+the tail of the log of the failed partner. The Log chain can be read using sys.fn_dump_dblog to see if it has newer LSN records than the value of mirroring_failover_lsn in sys.database_mirroring –  MartinC Dec 19 '11 at 21:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.