March 28, 2003 at 8:08 am
Does anyone know how to restart SQL Server unattended over a weekend. Something like a scheduled restart of the server.
Thanks.
March 28, 2003 at 8:31 am
You can use:
net stop mssqlserver
net start sqlserver
in a .bat file executed using the at command to execute at a specific time. You will need to handle any questions it asks such as stopping dependent processes or work out what they are and stop them with their own command.
One question - why do you want to stop and start the server?
Jeremy
March 28, 2003 at 8:42 am
You can also do the following:
@ECHO OFF
NET STOP SQLSERVERAGENT
NET STOP MSSQLSERVER
SLEEP <<TIME INTERVAL>>
NET START MSSQLSERVER
NET START SQLSERVERAGENT
For more info, you can check this page:
http://vyaskn.tripod.com/restart_sql_server_service.htm
.
March 28, 2003 at 9:03 am
You should be very carefull about this. I would also configure the mail to advice me when the SQL Serve Agent start so I can know everyhing went right. You could schedulle a job to execute xp_sendmail when the agent starts.
March 28, 2003 at 9:17 am
Infact, you can write a procedure to automate the SQL Server Agent to start as soon as you restart SQL Server. For further info you can check this page:
http://vyaskn.tripod.com/code/sql_server_agent_autostart.txt
NOTE: Please read the "Usage:" section of this page carefully, before applying.
.
March 28, 2003 at 10:00 am
All of these are great ideas, but why not just cycle the server? One the scariest things I know of is approaching a box that hasn't been cycled in 18 months.
We use the shutdown.exe on the NT resource Kit through NT scheduler for scheduled monthly reboots. Make sure you use the auto restart, and force shutdown features.
Cheers.
John Zacharkan
John Zacharkan
March 28, 2003 at 10:04 am
Yes. Thats true. Even for my servers I have Monthly reboots scheduled. But if the servers are being used for some other apps as well in the production segment, then we would need to see their business needs as well. In such cases, if we need to just restart the SQL Server, we can follow the above methods, which will become very handy that time.
Let me know your thoughts!!!
.
March 28, 2003 at 2:37 pm
Thanks for all your help. The reason why I am doing this is to recycle the server. I noticed that whenever we reboot the server for an application upgrade there is an improvement in performance for a couple of weeks.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply