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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as off-topic by Max Vernon, Paul White, RolandoMySQLDBA, Mark Sinkinson, dezso Jun 2 '15 at 8:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Max Vernon, Paul White, RolandoMySQLDBA, Mark Sinkinson, dezso
If this question can be reworded to fit the rules in the help center, please edit the 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
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