Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Not all Databases getting backed up Expand / Collapse
Author
Message
Posted Wednesday, April 17, 2013 1:03 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 72, Visits: 334
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.
Post #1443456
Posted Wednesday, April 17, 2013 1:06 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 72, Visits: 334
Sorry could not attach a picture.
Post #1443460
Posted Thursday, April 18, 2013 9:16 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 9:46 AM
Points: 12, Visits: 128
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.
Post #1443936
Posted Thursday, April 18, 2013 9:19 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 8, 2013 7:16 PM
Points: 221, 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
Post #1444216
Posted Friday, April 19, 2013 8:05 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 72, Visits: 334
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.
Post #1444423
Posted Friday, April 19, 2013 10:09 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:17 PM
Points: 6,490, Visits: 13,968
Have you checked the maintenance plan history?

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

"Ya can't make an omelette without breaking just a few eggs"
Post #1444503
Posted Friday, April 19, 2013 12:14 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 72, Visits: 334
Yep, just says it completed...
Post #1444555
Posted Wednesday, April 24, 2013 2:29 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 72, Visits: 334
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
Post #1446224
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse