Results 1 to 11 of 11
  1. #1
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS SQL server

    Hi all,

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

    Many thanks,

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    One way would be to set up a scheduled task on the SQL Server server which runs a BATch file to:<UL><LI>gracefully shut down the SQL Server program and anything else running<LI>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!
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  3. #3
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS SQL server

    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

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    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?
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    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
    Jerry

  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    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...
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #7
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> 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.
    Jerry

  8. #8
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS SQL server

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

    Thanks,

  9. #9
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS SQL server

    Hi there

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

  10. #10
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS SQL server

    My manager wants to restart it every sunday at 11m.

  11. #11
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS SQL server

    I have done it,

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •