SQL server maintenance when using active backup.



Similar documents
Backup and Restore Back to Basics with SQL LiteSpeed

Database Maintenance Guide

SQL Server 2005 Advanced settings

USING FILERELICATIONPRO TO REPLICATE SQL SERVER

Automated backup. of the LumaSoft Gas database

Keystone Enterprise Backup

How To Backup An Rssql Database With A Backup And Maintenance Wizard

1 of 10 1/31/2014 4:08 PM

Working with SQL Server Integration Services

Microsoft Outlook MAINTENANCE & USAGE GUIDE

QUANTIFY INSTALLATION GUIDE

DMS Performance Tuning Guide for SQL Server

Moving the Web Security Log Database

Table of Contents SQL Server Option

Enterprise Remote Control 5.6 Manual

Online Backup - Installation and Setup

How to Restore a Backup to Director V4.7x or greater

This article Includes:

Creating a Complete Backup of Shelby v5 Data

Working with SQL Server Agent Jobs

How to Copy A SQL Database SQL Server Express (Making a History Company)

GETTING STARTED WITH SQL SERVER

Wilkes University Mail Storage & Housekeeping for Students using Outlook 2003

DigiVault Online Backup Manager. Microsoft SQL Server Backup/Restore Guide

Note: Make sure the.pst file is stored in your U: drive, this drive is protected by backups.

Using SQL Server 2008 Automated Backup

How to schedule SQL Maintenance Plan

Installation / Backup \ Restore of a Coffalyser.Net server database using SQL management studio

SQL Server Maintenance Plans

1. Open the License Manager either via the Start Menu or from C:\Keri\DoorsNET directory.

Archiving Your Mail in Outlook 2010

sql server best practice

Monitoring SQL Server with Microsoft Operations Manager 2005

Installation Manual Version 8.5 (w/sql Server 2005)

Backup / migration of a Coffalyser.Net database

Moving the TRITON Reporting Databases

SalonTouch SQL and.net Database Backup Instructions Updated 10/16/2006

Using the Local Document Organizer in ProjectWise

PCSchool SQL Backup Tech Tip. SQL Backup Tech Tip. Created in version /9

Installing and Trouble-Shooting SmartSystems

NAStorage. Administrator Guide. How To Use Veritas Backup Exec With. NAStorage

Backup/Restore Microsoft SQL Server 7.0 / 2000 / 2005 / 2008

POLICY PATROL MFT. Manual

Operating Systems: Microsoft Windows XP, Windows Vista or Windows 7 RAM: 2GB

Online Backup Client User Manual Mac OS

Online Backup Client User Manual Mac OS

Backing Up and Restoring FrontDesk Data Files

SQL Server Replication Guide

Installing SQL Express. For CribMaster 9.2 and Later

Backups and Repository Maintenance

Quick Reference Guide Outlook 2010 for Windows: Outside the Mailbox Outlook Data Management

Module 07. Log Shipping

Archiving and Managing Your Mailbox

LOTUS NOTES 8.5. Making Lotus Notes Work For You. Microcomputer Training Centre

WhatsUpGold. v NetFlow Monitor User Guide

Archiving. Follow these steps to archive your

SQL Server 2008 R2 Express Edition Installation Guide

PLEASE NOTE: The client data used in these manuals is purely fictional.

Auto Archiving Folders in Outlook XP

BSDI Advanced Fitness & Wellness Software

Best Practices for Backup of Microsoft SQL 2000 Databases with Unitrends Backup Professional

Microsoft SQL Server 2005 How to Create and Restore Database (GRANTH3) Manually

Technical Bulletin. SQL Express Backup Utility

Restoring Microsoft SQL Server 7 Master Databases

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

Getting to Know the SQL Server Management Studio

Online Backup Client User Manual

OneDrive for Business User Guide

How to Backup Your Eclipse.Net Database Automatically. To clearly document a specific automatic SQL database backup method for Eclipse.net.

Retention Information Messages automatically age out of your mailbox

XenDesktop 5 Database Sizing and Mirroring Best Practices

Quick Reference Guide Outlook 2013 for Windows Outlook Data Management

System Administration Training Guide. S100 Installation and Site Management

Version 8. Backing Up and Restoring Progeny Databases

Installation, Setup, & Uninstall Guide Virtual TimeClock 15 Network Edition for Mac

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

Quick Guide on How to Clean up your Mailbox

Published. Technical Bulletin: Use and Configuration of Quanterix Database Backup Scripts 1. PURPOSE 2. REFERENCES 3.

How to schedule and automate backups of SQL Server databases in SQL Server Express Editions

Dell InTrust Preparing for Auditing Microsoft SQL Server

HP RDX Continuous Data Protection Software Quickstart Guide

Microsoft SQL Server Scheduling

Restoring your Computer from a Backup in Windows 8 (File History)

Division of Student Affairs Quota Practices / Guidelines

Event Record Monitoring and Analysis Software. Software Rev. 3.0 and Up. User s Guide

OneDrive for Business User Guide

BASIC PC MAINTENANCE AND BACKUP Lesson 1

Microsoft SQL Server 2005 How to Create and Restore Database (GRANTH3) Manually

Utilities ComCash

Enterprise Vault Users Guide

Maintenance Plans for MS SQL Database Servers in a ZENworks Environment

OneDrive for Business User Guide

How to start creating a VoIP solution with Ozeki VoIP SIP SDK

GO!NotifyLink. Database Maintenance. GO!NotifyLink Database Maintenance 1

Migrating helpdesk to a new server

Microsoft Office 365 online archive features and FAQs

Transcription:

SQL server maintenance when using active backup. SQL Server maintains a set of tables in the msdb database that stores details of all backups and restores that have been done over time. It generally remains small in size except when you are running :Arkitex Director in an active backup environment. In this case, the engine creates a backup of all of the Arkitex databases every x number of minutes (interval defined in system setup) and you can imagine that this creates a lot of entries in the msdb system database. The different tables that store these details are: Backupset Backupfile Backupfilegroup (SQL Server 2005 upwards) Backupmediaset Backupmediafamily Restorehistory Restorefile Restorefilegroup Logmarkhistory Suspect_pages (SQL Server 2005 upwards) Usefull SQL queries To get an idea about the kind of data saved by the SQL server: SELECT [backup_start_date],[backup_finish_date],[database_name],[server_name],[collation_name] FROM [msdb].[dbo].[backupset] ORDER BY [backup_start_date] Count the number of database backup or restores: SELECT FROM COUNT(*) AS Expr1 [msdb].[dbo].[backupset]

Setting up a new SQL server maintenance task SQL server 2005 Open the SQL server management studio and browse to Management\Maintenance Plan. Right click on Maintenance Plan and select to create a New Maintenance Plan. Fortunately, cleaning backup/restore history is already build-in into the SQL server. Select the task in the Toolbox at the left hand bottom corner and drag it onto the empty window at the right hand side. It might also be a good idea to shrink the database after it is cleaned. Drag a Shrink Database Task to the window on the right hand side. Connect both of the maintenance tasks: select the icon representing the history cleanup. You will now see a green arrow appearing. Select this green arrow and drag it onto the maintenance task that you want to de next (in this case the shrink database task).

Each of these tasks will have to be configured before it can be used (see the red icon inside the task). Right click on the History Cleanup Task and select Edit. In this example I decided to keep 2 weeks of backup/restore information in the msdb database.

Edit the Shrink database task. Here you can decide to shrink all of the databases or just a single one (msdb).

Setup the Job Schedule Properties. You should clean up this backup/restore history out of production hours! During this cleaning task, the sql server holds exclusive access to the msdb database and you might see sql errors in the Arkitex Client error list when the engine creates a new set of backupfiles. This error only indicates that SQL server was unable to add this new information inside the msdb database. There s no danger whatsoever that you are loosing data. The backup file set should normally be created without any problem. Right click on the tab and select to Save Selected Items in order to save this new scheduled maintenance task.

The new task will now show up in SQL Server Agent\Jobs. Needless to say that the SQL server agent service needs to be running when scheduling maintenance tasks. In SQL 2000 Note that the previous procedure is only valid when using SQL server 2005. It will not work on the old SQl server 2000 for the simple reason that there is no such thing as a history cleanup task. A possible solution would be to run the following SQL server commands. These commands will purge the history older then 120 days: use msdb go declare @OldestDate datetime set @OldestDate = getdate() -120 exec sp_delete_backuphistory @OldestDate Watch out!! I have tried this and during my tests I only purged out one (1) single day of backup/restore data and it took about 10 minutes!! Purging out months or years of backup/restore history would take an incredible amount of time (hours to days) and meanwhile it would block the usage of the msdb database. Best practice would first be to find out how long it takes to purge out a single day of backup/restore history. See the examples of SQl queries that I described earlier for finding out the oldest entry in the database. You can then use the following code for purging out a history older then a specific date. Purge history older then 20/8/2011 use msdb exec sp_delete_backuphistory '08/20/2011' The reason that is taking such a long time is that SQL 2000 is not having indexes on the tables in the msdb database. You could manually add indexes but I have never tried it. There s enough information on the internet that can give you some assistance in this matter. See also: http://weblogs.sqlteam.com/geoffh/archive/2008/01/21/msdb- Performance-Tuning.aspx

Initializing the Arkitex databases will NOT bring down the size of the msdb database. This msdb is a system database and not an Arkitex database. Initializing the Arkitex database is not going to wipe out the info out of the msdb database. Some facts before and after cleaning. Before cleaning After cleaning (kept 1 week) of history Number of lines in msdb 884666 5992 Msdb properties (db size) 1561,63 Mb 1569,56 Mb Msdb properties (db size free 135,78 Mb 626,79 Mb space) Manually shrinked msdb after 1561.63 Mb 167,50 Mb running the maintenance task (db size) Disk Free space (windows) 27,3 Gb 26,3 Gb In my case I had a SQL server that made 884666 database backups (used a SQL query to find out). Arkitex creates 6 backup files each time (one for each of the Arkitex databases). This means that the engine created about 147444 sets of database backup files and this happened every 10 minutes. This learned me that in total, this server did production for about 1023 days. These numbers will give you a pretty good idea of the amount of data that is kept during 2 or 3 years of production (rule of thumb might be a 500 Mb per year). The automatic shrink didn t quite work out as I expected it to be. In fact, it didn t shrink the database at all. No idea yet what was going on but I then decided to do a manual shrink. This brought the size of the database down from 1561,63 Mb to 167,5 Mb.