SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Not all Databases getting backed up


Not all Databases getting backed up

Author
Message
lmacdonald
lmacdonald
SSC Eights!
SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)

Group: General Forum Members
Points: 962 Visits: 564
I have a maintenance plan that makes a full backup of 45 databases every night, at least it supposed to. The job runs without error, but when it's done and I look at the backup destination they are not always there. I ran it manually just now for example, only 30 databases got backed up, the other 15 databases have yesterday's date or farther back.

Another portion worth mentioning is the fact that these databases are backed up to a Linux system and does not recognize Windows domain credentials. Simply putting in the path will not work in the Back Up Database Task because it will fail authentication. To resolve this, I put in an Execute SQL Statement task before the backup starts. Here is the task.

xp_cmdshell 'net use z: /delete'
GO
xp_cmdshell 'net use z: \\winvtblacka02\dbateam /USER:dbateam dbateam'
GO

This allows me to pick drive z:\ for the location as seen in the picture. I have looked through Windows and SQL logs and for the databases that did not get backed up and they are not even mentioned so I have no errors to look up. Sometimes the job completes in 15 minutes when it should take several hours.

I am wondering is there a maximum amount of database that can be backed up per maintenance plan?
Is there a hidden setting that tells a job to stop running once it's ran for a certain amount of time?
Does the logon to the mapped Z:\ drive go stale after? (I would think only idle connections would time out)

I have it set to "All Databases" and ignore databases where the state is not online check as well. Many of these databases are mirrored and I have the identical setup on the mirror, so if there is a fail over the new principal will begin backing them up.
lmacdonald
lmacdonald
SSC Eights!
SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)

Group: General Forum Members
Points: 962 Visits: 564
Sorry could not attach a picture.
jay81
jay81
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 252
I don't know how the SQL Agent job is set-up. If it is using a Stored Procedure to backup all databases, you should look at the logic of that SP. You should also check if the SQL Sql agent job fails if it fails to backup a DB.

On side-note, I have created one stored proc each for backing up each database in our environment. These SPs are run in subsequent steps in the SQL Server agent job. If any of the steps fails, the SQL Agent job fails and notifies the DBAs. This was needed as we don't take differential backup of small DBs.
Calibear
Calibear
SSC-Addicted
SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)SSC-Addicted (455 reputation)

Group: General Forum Members
Points: 455 Visits: 132
Having your code would be good here. If it isn't consistently backing up data (it sounds like it does back up the databases, but not on a regular basis), my inclination is first that something might be wrong in the code. Is it a stored procedure backing up the databases?

--------
For SQL Tips, check out my blog: http://lantztechknowledge.blogspot.com/
You can also follow my twitter account to get daily updates: @BLantz2455
lmacdonald
lmacdonald
SSC Eights!
SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)

Group: General Forum Members
Points: 962 Visits: 564
xp_cmdshell 'net use z: /delete'
GO
xp_cmdshell 'net use z: \\winvtblacka02\dbateam /USER:dbateam dbateam'
GO

Is the code before the backup begins, I don't use a SP. You are correct, it only backs up some of the databases. I looked this morning 41 databases backed up this morning as they where supposed to. 13 of them have yesterdays date or later and did not back up. However I have backup "all databases" selected. No errors in the logs.
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)

Group: General Forum Members
Points: 55148 Visits: 17708
Have you checked the maintenance plan history?

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
lmacdonald
lmacdonald
SSC Eights!
SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)

Group: General Forum Members
Points: 962 Visits: 564
Yep, just says it completed...
lmacdonald
lmacdonald
SSC Eights!
SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)SSC Eights! (962 reputation)

Group: General Forum Members
Points: 962 Visits: 564
Something I found to be interesting. The backup works if I uncheck ignore databases with the state is not online. However these are the principal db's at the moment so they should be online. I can dive in to them, and the resulting query says they are online.

select name, state_desc,user_access_desc from sys.databases
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search