Link to home
Start Free TrialLog in
Avatar of Spikeuk30
Spikeuk30

asked on

SQL database backup success but - causing connection errors for scheduled tasks

Hi there,

I have an sql server which runs its database backups at 22:00.

At this time we have a number of scheduled tasks which connect to the database and extract some information.


The backups run perfectly but the scheduled tasks intermittently fail with sql connection errors.

If we change the scheduled tasks to run an hour before they work perfectly so its defintly the backups causing issues.


What can i check to resolve?
Avatar of dsacker
dsacker
Flag of United States of America image

Do these scheduled tasks run via the OS Task Scheduler? (From your statement that they "connect to the database", it sounds like they do.)

If so, you can actually trigger them off the completion of a SQL Maintenance Plan (if that's how you run your backups).

For instance, when a Maintenance Plan completes, it will log an event to the application event . If you look for source SQLISPackage100, Event ID 12289 (could differ a little bit, you'll have to play with this), your OS Task could fire from this trigger.

If these are all run within SQL Agent (as jobs), you may have to consider adding a sp_start_job 'Some Next Job' in your last step of the backup.

This is one of a number of articles on sp_start_job. I also wrote a blog sometime back on Scheduling OS Tasks to run after a maintenance plan finishes.
Avatar of Spikeuk30
Spikeuk30

ASKER

ok..

Yes OS Task Scheduler.

This runs an exe which is configured to connect to the db pull some information and email it.

Probably a silly question   -  Why will it not work during the maintenance plan?  

Is the db avalible to website users while the paln is running?
ASKER CERTIFIED SOLUTION
Avatar of dsacker
dsacker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial