Not all Databases getting backed up

  • 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.

  • Sorry could not attach a picture.

  • 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.

  • 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/[/url]
    You can also follow my twitter account to get daily updates: @BLantz2455

  • 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.

  • Have you checked the maintenance plan history?

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Yep, just says it completed...

  • 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

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply