Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Full, diff and tlog backups based on recovery mode

By Patty Dunbar,

    This a script which creates stored procedures that can be executed adhoc or set as sql agent jobs to check the recovery status and generate full, differential or transaction log backupf for each database if the database recovery status is set to full.  We have terabytes of data and set all production databases to full and all test and demo databases to simple. This helps to ensure all our production databases are backed up while avoiding unnecessary backups.
    The full and transaction log backup call the sqlmaint utility which simplifies deleting old backups by setting the -delbkup parameter. The differential backup includes an extra vbscript component to delete old backups as you cannot use the sqlmaint utility.
    Complete instructions are in the script so please read and follow carefully. Feel free to email me with any questions. When you get to the visual basic script portion, check the format as unlike SQL, all code must be on the same line or use the ampersand, followed by a space and then the underscore keystroke & _ after each line to continue to the next. My thanks to Mr. Knight as I used his book "SQL Server 2000 for Experienced DBAs" for reference when building components of this script.

Total article views: 897 | Views in the last 30 days: 1
 
Related Articles
ARTICLE

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.

FORUM

xmla script for automate ssas database backup

xmla script for automate ssas database backup

SCRIPT

Script to Check the Database Backup duration

Script to Check the Database Backup duration of entire instances

SCRIPT

Backup & Restoration Script

This script provides very useful information about database backup and restoration.

SCRIPT

Database Backup Information Scripts

Scripts used to validate the backups information as below 1) Database Backups for all databases F...

 
Contribute