Blog Home  Home Feed your aggregator (RSS 2.0) or Subscribe by Email   
StupidProgrammer.com - Transaction Log Backups Failing
"Stupid Programmer You Are" --Master Programmer Yoda
 

 Tuesday, March 25, 2008

Today we noticed our transaction log backups had started failing for our user databases.

From previous experience, I had a hunch that someone had created a new database that was in SIMPLE recovery model. Just an FYI... That will cause the log backup to fail.

Hum... This server has hundreds of databases... Now which is the culprit.

Here is a query you can use to find the recovery model of all you databases.

SELECT 
    'DbName' = name
    , 'RecoveryModel' = DATABASEPROPERTYEX(name, 'Recovery')
FROM   master.dbo.sysdatabases
ORDER BY name

Now... To find which one is SIMPLE?

SELECT 
    'DbName' = name
    , 'RecoveryModel' = DATABASEPROPERTYEX(name, 'Recovery')
FROM   master.dbo.sysdatabases
WHERE DATABASEPROPERTYEX(name, 'Recovery') = 'SIMPLE'
ORDER BY name

Sure enough... There was a database in SIMPLE recovery model.

Hope that helps someone...



Tuesday, March 25, 2008 3:56:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Database  |  Trackback
Comments are closed.