Professional Documents
Culture Documents
If log file was truncated, then we can use fn_dump_dblog to retrieve LSN informa
tion from Log Backup.
SELECT Operation,[Current LSN],[Transaction Name]
FROM fn_dump_dblog
(
DEFAULT, DEFAULT, DEFAULT, DEFAULT,
'C:\Media\KDSSGDB_Tlog3.trn',
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT
)
where OPERATION='LOP_BEGIN_XACT'
GO
RESTORE LOG AdventureWorks FROM DISK = 'C:\OurBackups\adventureworks_log.bak'
WITH STOPATMARK = 'lsn:15000000040000037'
GO
Prefix 0x in the LSN number which is identified and prefix it with 'lsn:0x' for
hexadecimal format.
RESTORE LOG [PITDB_Temp] FROM DISK = N'C:\OurBackups\PIT_Tlog3.trn' WITH
STOPBEFOREMARK = N'lsn:0x00000025:000000d7:0001', NORECOVERY