|
Posted by pk on 04/24/07 16:34
I have a problem that I would like to resolve through scripting, but
I'm not sure how to go about it (or if it's even possible.)
We're trying to work around a bug (
http://support.microsoft.com/default.aspx?scid=kb;en-us;303292&Product=sql2k
) that requires us to split up our maintenance plan into two parts.
In the first, we backup "All User Databases". This runs fine. The
second maintenance plan backs up the transaction logs and then is
SUPPOSED to delete the ones older than 4 days. If you read that
knowledge base article I referenced above, you'll see that this
doesn't happen. Our company creates a lot of databases every day and
it's not feasible for me to check every one by hand every night before
I head home to make sure that they get backed up correctly.
I would like to have a script that checks for all user databases that
are set to FULL Recovery Model
SELECT name, DATABASEPROPERTYEX(name, 'Recovery') as RecoveryModel
FROM master.dbo.sysdatabases
WHERE DATABASEPROPERTYEX(name, 'Recovery') = 'FULL'
ORDER BY 2
and re-enters them all into the second maintenance plan (obviously not
as duplicates) right before it runs. I don't think my scripting
knowledge is up to par, so I'm really looking for someone to help me
out. You can bet I'll study the solution after I get it though.
Thanks in advance.
-pk
Navigation:
[Reply to this message]
|