|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 8:12 AM
Points: 275,
Visits: 679
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
Nice one. Thanks for sharing
Thanks
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 12:41 PM
Points: 2,
Visits: 49
|
|
| Very nice "utility". Thanks!
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 9:16 AM
Points: 89,
Visits: 341
|
|
| We take image backups of the server partition for system restore purposes along with our SQL Server backups. Is there any way to have this script only consider SQL Server backups and not include the server Image backups?
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 9:16 AM
Points: 89,
Visits: 341
|
|
I found a way to do this by adding AND T2.NAME is not null to the where clause of the top select. Still not sure if this is the best way to do this but it seems to be working.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 24, 2012 9:58 AM
Points: 1,
Visits: 0
|
|
| Excellent Script, thanks for sharing.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 8:55 AM
Points: 475,
Visits: 1,677
|
|
Hi,
shortening it up a bit...
SELECT T1.Name AS DatabaseName, DATABASEPROPERTYEX(T1.Name, 'recovery') AS database_recovery_model, Isnull(Max(T2.recovery_model),'No Backup Taken') AS backup_recovery_model, CASE type WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Differential' WHEN 'L' THEN 'Log' ELSE COALESCE(type,'No Backup') END AS BackupType, Isnull(CONVERT(VARCHAR(17), CONVERT(DATETIME, Max(T2.backup_finish_date), 113)), 'Never') AS LastBackUpTaken FROM sys.sysdatabases T1 LEFT OUTER JOIN msdb.dbo.backupset T2 ON T2.database_name = T1.name GROUP BY T1.Name, type ORDER BY T1.Name, type
Best regards karl
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
@Karl Klingler - Nice. Thanks for sharing.
Thanks
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 10:56 PM
Points: 60,
Visits: 1,291
|
|
That is a great script Karl Klingler, very compact compared to the original script, but I notice both the original script and your script does not report on the important situation for a database in full recovery mode, where there is a last database backup but never a transaction log backup.
Can you see if you can get your script to report on this situation?
Also you can exclude the tempdb database.
Regards,
DBA Pete
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 8:12 AM
Points: 275,
Visits: 679
|
|
That was actually the intent of the original script. You should try that one again.
GL, Jon
|
|
|
|