Check the time for the last log backup - by Ola Hallengren

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


3
0
Sign in
to vote
ID 3117757 Comments
Status Resolved Workarounds
Type Suggestion Repros 0
Opened 1/1/2017 10:49:02 AM
Access Restriction Public

Description

I would like to ask for a way to check when the last log backup was performed.

This information is currently available in dbi_LastLogBackupTime in DBCC DBINFO (undocumented).

This would be useful together with log_space_in_bytes_since_last_backup in sys.dm_db_log_space_usage to implement transaction log backup strategies like "backup the log every 15 minutes or when the the size of the backup is 1 GB".
Sign in to post a comment.
Posted by Microsoft on 6/9/2017 at 11:55 AM
We have added a new DMF in SQL Server 2017 sys.dm_db_log_stats which has the field (log_backup_time) that provide last log backup time.

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-log-stats-transact-sql
Posted by Microsoft on 1/18/2017 at 7:36 AM
Hi Ola,

Thank you very much for your feedback. As Kevin mentioned, the last backup time is now available in msdb..backupset. We don't have plan to add it to sys.dm_db_log_space_usage. You can get the space usage and time information by joining these two table/DMVs, together with sys.sysdatabases.

Regards,
Xiaochen
Posted by KevinBHill on 1/9/2017 at 5:18 AM
Hi Ola...can't that information already be pulled from msdb..backupset? I love the idea you are going for here with the changing frequency based on activity!