database mirroring - How to find exact time of last received transaction on asynchronous mirror (SQL Server 2005)? -
database mirroring - How to find exact time of last received transaction on asynchronous mirror (SQL Server 2005)? -
i need provide users exact time of info integrity in case of forced service possible info loss.
i guess can find lastly lsn using:
select [mirroring_failover_lsn] [master].[sys].[database_mirroring] but won't give me exact time.
read how read , interpret sql server log. you'll see lop_begin_xact contains timestamp. given lsn, can analize log , find pending transactions (that xact_ids not have commit or rollback logged before given lsn). pending transations rolled in case of failover. info lost if forced failover occurs. there number of transactions pending undone, , these various transactions have started @ various times. if want attach 'exact time of info integrity' can no info loss occur before earliest pending lop_begin_xact. eg. given next log stream:
+-----+-----------+---------+------------+ | lsn | operation | xact_id | timestampt | +-----+-----------+---------+------------+ | 1 |insert | 1 | | | 2 |begin_xact | 2 | 12:00 | | 3 |insert | 1 | | | 4 |begin_xact | 3 | 12:02 | | 5 |commit_xact| 1 | | | 6 |insert | 2 | | | 7 |insert | 3 | | | 8 |commit_xact| 3 | | | 9 |commit_xact| 2 | | lets mirroring failover lsn 8. in case can not info loss occur before 12:00, because xact_id 2 not committed @ lsn 8 , hence rolled back. note xact_id 3 is commited lsn 8 won't lost, though has later time stamp. timestamp no t absolute, why 'no info loss occur before than...' rather 'data after ... lost'.
sql-server-2005 database-mirroring
Comments
Post a Comment