Decrypt T-SQL Log Backup Header and Read LSN

backuprecoverysql servertransaction-log

For some reason I need to read the LSN from the T-SQL logs backups without restoring them or even their headers (I assume even restoring only their headers will change the LSN on the database side too, but I'm not sure).

So is the T-SQL log backup files encrypted or does they have special structure? Any information as to where should I start?

Could anyone confirm or denies that restoring the header only wouldn't affect the sys.fn_dblog or anything else?

Best Answer

Could anyone confirm or denies that restoring the header only wouldn't affect the sys.fn_dblog or anything else?

RESTORE HEADERONLY doesn't target any database in its syntax:

RESTORE HEADERONLY FROM <backup_device>   

It reads the backup device and returns data to the client about what's in the backup. It won't affect your databases in any way.