March 26, 2012 at 3:04 pm
A few years ago we had a student doing our system maintenance. When it came to setting up SQL Server and it's backups, he did it. He left and it fell upon me to do this. I know I've asked on these forums before for guidance on how to simplify things, and how to make it more frequent. (The former DBA has just 1 full backup a week, and 1 daily incremental backup. I don't think that's enough.) However, I'm not entirely sure why he's done what he's done. I think some of it might be good to retain, and others removed. Before I begin, I'd like to clear up something for myself. If a SQL Job starts at some step within a subplan, it doesn't automatically proceed to the next subplan, correct?
OK, here's what the student DBA has. He's got 6 subplans, some with multiple steps/tasks. Here they are:
Rebuilds index on all databases
[/li]
Full backup of all user databases
[/li]
Differential of all user databases
[/li]
Incremental of all user databases
[/li]
Full backup of master, model and msdb
[/li]
(Well, I guess the IFCode doesn't allow for lists within lists. I'm sorry about that.)
Anyway, I'm a sort of junior DBA, but this seems overly complex to me. Are there elements of what he's got here that I should duplicate when I redo it, or not?
Kindest Regards, Rod Connect with me on LinkedIn.
March 26, 2012 at 3:14 pm
March 26, 2012 at 3:37 pm
- Third subplan weekly_full_backup has 2 tasks/steps
Full backup of all user databases
- Backup of transactlon logs for all user databases
[/li]
I really don't like having log backups in the same maintenance plan as full backups. Adds complexity. Will break things if you decide to implement log shipping and forget to remove the log backup setp
- Fourth subplan daily_incremental_backup has 2 steps/tasks
Differential of all user databases
- Backup of all user databases trasnaction logs
[/li]
Same comment as above.`
- Fifth subplan weekly_incremental_backup has 2 steps/tasks
Incremental of all user databases
- Transaction log backup of all user databases
[/li]
No such thing as incremental backups for SQL Server.
Anyway, I'm a sort of junior DBA, but this seems overly complex to me. Are there elements of what he's got here that I should duplicate when I redo it, or not?
My backup maintenance plans (each is a separate plan, no subplans)
1) Full backup of user databases - has a checkDB, backup and backup cleanup tasks
2) Log backup of user databases - has backup and backup cleanup tasks
3) Full backup of system databases - has a checkDB, backup and backup cleanup tasks
If I need differential, that will be another plan
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 27, 2012 at 11:40 am
Gail, what you said makes sense. When I was setting up a backup scheme on our test database server, I asked on these forums about how to do it. I came up with my own scheme, based upon the feedback I got back then. I think I'd like to just duplicate on our production server what I did on our test server. Here's what I did:
1 maintenance plan for all system databases that runs once a day with the follow steps/tasks:
1 maintenance plan for all user databases, with 2 subplans. Here's how they break down:
The first subplan, runs once daily, with the following steps/tasks
The second subplan runs hourly during business hours, with the following steps/tasks
Due to the volume of business we do, I don't believe performing hourly backups throughout the whole day is warrented.
From you (and everyone else's) point of view, is this a good backup scheme for our production databases?
Kindest Regards, Rod Connect with me on LinkedIn.
March 27, 2012 at 11:48 am
Rod at work (3/27/2012)
Gail, what you said makes sense. When I was setting up a backup scheme on our test database server, I asked on these forums about how to do it. I came up with my own scheme, based upon the feedback I got back then. I think I'd like to just duplicate on our production server what I did on our test server. Here's what I did:1 maintenance plan for all system databases that runs once a day with the follow steps/tasks:
- Does a database integrity
- Does a full backup
- Does a transaction log backup
I don't recommend mixing full and log backups in a maintenance plan. Besides, which of the system databases needs log backups? master is in simple recovery, tempDB can't be backed up, msdb defaults to simple recovery and model shouldn't change.
Do you need to back up the system databases daily? Do you add/change logins, linked server, jobs, etc that often?
1 maintenance plan for all user databases, with 2 subplans. Here's how they break down:
The first subplan, runs once daily, with the following steps/tasks
- Does a database integrity check
- Does a full backup
That looks fine.
The second subplan runs hourly during business hours, with the following steps/tasks
- Does a database integrity check
- Does a backup of transaction logs
A full database consistency check every hour? Good luck with that.... What's going to happen when the checkDB takes 6 or more hours and hammers the database for the entire 6 hours and you have it scheduled hourly?
Due to the volume of business we do, I don't believe performing hourly backups throughout the whole day is warrented.
How much data can you lose in the case of a disaster? Say the drive with the DB files on implodes in the middle of the business day. How much data can the business tolerate losing?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 27, 2012 at 11:49 am
Rod at work (3/27/2012)
Gail, what you said makes sense. When I was setting up a backup scheme on our test database server, I asked on these forums about how to do it. I came up with my own scheme, based upon the feedback I got back then. I think I'd like to just duplicate on our production server what I did on our test server. Here's what I did:1 maintenance plan for all system databases that runs once a day with the follow steps/tasks:
- Does a database integrity
- Does a full backup
- Does a transaction log backup
1 maintenance plan for all user databases, with 2 subplans. Here's how they break down:
The first subplan, runs once daily, with the following steps/tasks
- Does a database integrity check
- Does a full backup
The second subplan runs hourly during business hours, with the following steps/tasks
- Does a database integrity check
- Does a backup of transaction logs
Due to the volume of business we do, I don't believe performing hourly backups throughout the whole day is warrented.
From you (and everyone else's) point of view, is this a good backup scheme for our production databases?
First, what recovery models are the databases using? You will find that the master database is using the simple recovery model (and that can't be changed), so transaction log backups on master will fail.
Second, I'm not sure about the hourly database integrity check. Nightly, I am okay with depending on the size of the database.
Third, and this is just my opinion, if I were to use maintenance plans, I would have separate plans for each user database. This would give me more flexibility over scheduling the backups.
Fourth, it may be over kill but I would run the t-log backups hourly and make sure that it didn;t overlap with the nightly full backup. You may have processes running at night that you want to continue with t-log backups.
Fifth, I would not shrink the databases or transaction logs.
March 27, 2012 at 12:56 pm
Good question, Lynn. I was't sure how the previous student DBA had set the recovery model for the system databases, so I just checked. He set it up so that master, model and msdb are all full recovery model, and tempdb is simple. And as you predicted the SQL jobs are failing on those, so no matter what I'd better change how he has things set up for my new backup scheme, re: system databases.
OK, I'll remove the database integrity check on hourly jobs.
Right now our databases are small enough that there's really no overlap. Although I will watch that to see how it goes.
I've eliminated all database shrinking in my scheme.
Kindest Regards, Rod Connect with me on LinkedIn.
March 27, 2012 at 1:09 pm
Gail, I didn't realize that it may not be necessary to backup the transaction logs of system databases. WOW, interesting. OK, I'll remove that.
As you suggest, our database schema doesn't change that frequent, so I could turn back the system database backup files to once or twice a week.
You got me again with the full database consistency check on an hourly basis. I'll remove that as well.
Now, as to how frequently we perform the intermediate backups (I have an hour at the moment) I'm kind of concerned with how much space we'll have on our backup media. I've estimately what 2 weeks of backups would take by seeing how has changed on the test database server. One of our major applications caches data locally for up to an hour and a half before commiting it to SQL Server, but other applications run more frequently and commit data to SQL immediately. I could try shorting it to every 30 minutes. This really is a "it depends" type of scenario. I'll have to play with it to see what works best in our environment.
Kindest Regards, Rod Connect with me on LinkedIn.
March 27, 2012 at 1:34 pm
Rod at work (3/27/2012)
As you suggest, our database schema doesn't change that frequent, so I could turn back the system database backup files to once or twice a week.
Nothing to do with database schema, that's in the user databases. master stored logins, server-level permissions, linked servers and things like that. MSDB stores jobs, job history, backup history, SSIS packages.
Now, as to how frequently we perform the intermediate backups (I have an hour at the moment) I'm kind of concerned with how much space we'll have on our backup media.
Do not design your backup strategy based on how much space you have available. Design your backup strategy based on how long you will have to restore the database in the case of a disaster and how much data the business can accept losing in the case of a disaster.
If you design your backup strategy based on space usage you may well end up with a backup strategy that does not support your business' requirements. If the business requires no more than 30 minutes data loss and you have a backup strategy that can result in up to 2 hours data lost, when a disaster happens and those 2 hours of data are lost, the next thing lost might well be your job. It has happened.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 27, 2012 at 2:23 pm
Gail,
For me, this has been a great day of learning. I didn't know that MSDB stored jobs, job history, etc. Cool, thank you!
Concerning what our business needs are, concerning data recovery, well right now it's 24 hours. For the last 16 years the best our users have ever had is the ability to only be able to recover whatever they did yesterday. Everything done today is lost, if there's a server hickup, etc. I'm trying to give them what they've never had before, and that's at least the ability loose at most 1 hour. I've beeen here a long time, and I've seen users sometimes (honestly, not often) loose a whole days worth of work, and its because someone else, way back in the day, set up backups this way. Then the student DBA who came in a few years ago, just copied that same pattern when he set things up the way they are now. I'm just trying to make it possible for us to never again loose a whole day's worth of data. I've not had the opportunity before, and have only gained enough knowledge to make the attempt more recently. Also, with other responsibilities I can only work on this when I have time (DBA activities isn't my primarily job responsibilities, but it is one of them since we don't have anyone else here to do DBA stuff).
I've got a follow-up question to ask. Lynn said that the master db can't have a recovery model other than simple. In our case, somebody in the past set the recovery model to full, but it is failing backing up the transaction logs. Should I just do a backup of the system dbs (except for tempdb) and leave the transaction logs out of it?
Kindest Regards, Rod Connect with me on LinkedIn.
March 27, 2012 at 2:31 pm
Here is a link that covers what I was talking about regarding the master database: http://msdn.microsoft.com/en-us/library/ms191488.aspx.
March 27, 2012 at 2:31 pm
master's recovery model is always simple, regardless of what the actual database setting value is set to. It cannot ever have log backups taken or restored
Re log backups for the system databases, which of the system databases do you need point-in-time restore for and why? Only if you have a sensible answer to that should you do log backups for any of them.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 27, 2012 at 2:57 pm
Lynn Pettis (3/27/2012)
Here is a link that covers what I was talking about regarding the master database: http://msdn.microsoft.com/en-us/library/ms191488.aspx.
Thank you, Lynn, I'm reading it now.
Kindest Regards, Rod Connect with me on LinkedIn.
March 27, 2012 at 2:59 pm
GilaMonster (3/27/2012)
master's recovery model is always simple, regardless of what the actual database setting value is set to. It cannot ever have log backups taken or restoredRe log backups for the system databases, which of the system databases do you need point-in-time restore for and why? Only if you have a sensible answer to that should you do log backups for any of them.
Thank you, Gail.
Kindest Regards, Rod Connect with me on LinkedIn.
March 28, 2012 at 9:58 am
Gail and Lynn, thank you both very much for your help. Using your advise I've come up with a couple of simpler maintenance plans (no shrinking of any databases), and have put them into place. I'll be watching them to see how them do, making sure they do what they should be doing. At least as well as I know how.
Kindest Regards, Rod Connect with me on LinkedIn.
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply