• MS SQL server

    Author
    Topic
    #445530

    Hi all,

    Is there a way to schedule a restart on the MS SQL server 2005 every week?

    Many thanks,

    Viewing 0 reply threads
    Author
    Replies
    • #1080515

      One way would be to set up a scheduled task on the SQL Server server which runs a BATch file to:

      • gracefully shut down the SQL Server program and anything else running
      • run SHUTDOWN -R to shut down Windows Server 2003 and reboot (check the Help information to see if you want the -F option also)[/list]You’ll have to provide the first part of this!
      • #1081114

        What do i need to do to schedule a restart on windows 2003 server, does someone know how to do this?
        Any help much appriciated

        • #1081122

          Are you saying that you need an explanation of setting up a task in Task Scheduler to run the SHUTDOWN.EXE program?

          Have you already solved the problem of cleanly shutting down your SQL Server program from the command line?

        • #1081255

          Hi Skender

          When I first read this post, I had to re-read it!!!!

          Is there a reason why you should reboot the SQL server when you simply have to restart the SQL Services……

          Create a BATch file called SQLStart.bat with the following lines of code:

          @ECHO OFF
          NET STOP SQLSERVERAGENT
          NET STOP MSSQLSERVER
          NET START MSSQLSERVER
          NET START SQLSERVERAGENT

          You just need to put this in the Servers scheduled tasks. I would place it on the root drive in a folder called SQLJobs

          Now go to the Start | Run and type

          AT 23:59 /EVERY:Su C:SQLJobsSQLStart.BAT

          This will run the job every Sunday at 23:59 hrs

          • #1081261

            Jerry

            After doing what you suggest, he may have to go into Task Scheduler, select that task, then Properties, then insert an Administrator account and password under which to run the job. In my experience, Task Scheduler tends to be pretty touchy about running these system tasks…

            • #1081265

              yep Good call John.

              I would like to know a bit more why skender needs to do this as I/we may be able to help with scheduled maintenance in the SQL database i.e. log shrinking.

              Let’s see if he/she comes back on this.

            • #1081395

              I actually need to restart the computer and not just the MSSQL server.

              Thanks,

            • #1081396

              Hi there

              Just to give me more to assist you, why do you need to restart the server?

            • #1081398

              My manager wants to restart it every sunday at 11:pm.

            • #1081405

              I have done it,

              thanks

    Viewing 0 reply threads
    Reply To: MS SQL server

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: