Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We have a number of stored procedures that run on startup via the sp_procoption startup:

exec sp_procoption 'ProcName', 'startup, 'true'

A customer's server started up with a very large database in recovery mode. This is a large database, so recovery will take a long while to complete.

According to the docs:

Execution of the stored procedures starts when all databases are recovered and the "Recovery is completed" message is logged at startup.

The startup procs were not run because the system is in recovery mode, and our software doesn't work if they aren't run. We can run these procs manually to get the system working.

However, after the recovery completes, will the startup procs be run again? That would be bad for us, because as written the procs drop some tables that may be in use by people since the server restarted.

share|improve this question
    
Is this not a scenario you tested when developing this methodology? In any case, I think you are in a better position to test this than any of us would necessarily be... –  Aaron Bertrand Mar 8 '13 at 16:35
    
The customer's database recovery actually jumped from LOW% to 100%, and then SQL Server ran the startup procs as expected. I expect the startup procs would have been run again, but I don't have proof. –  Paul Williams Mar 8 '13 at 16:48
2  
right but you could test your startup procs in a different environment (e.g. your test environment, hint hint). –  Aaron Bertrand Mar 8 '13 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.