Re: Restart Services

From: Narayana Vyas Kondreddi (answer_me_at_hotmail.com)
Date: 07/30/04


Date: Fri, 30 Jul 2004 16:28:23 +0100

How to restart SQL Server at regular intervals?
http://vyaskn.tripod.com/restart_sql_server_service.htm

-- 
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Noor" <noor@ngsol.com> wrote in message
news:OsvN9UfdEHA.3616@TK2MSFTNGP10.phx.gbl...
Thanks Hari and Keith...
Noor
"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:uIyaaVYdEHA.2352@TK2MSFTNGP09.phx.gbl...
> Hi Noor,
>
> I agree with Keith, Put the below contents in a batch file:-
>
> NET STOP SQLSERVERAGENT
> NET STOP MSSQLSERVER
> NET START MSSQLSERVER
> NET START SQLSERVERAGENT
>
> After that schedule this batch using the Windows scheduler or use the AT
> command.
>
> See the help of AT command by executing the below from command prompt:-
>
> AT/?
>
>
> Note: Ensure that Task schedular service is running all the time. AT
comand
> and Windows schedular user this service.
>
> Thanks
> Hari
> MCDBA
>
>
> "Keith Kratochvil" <sqlguy.back2u@comcast.net> wrote in message
> news:erWb75WdEHA.3528@TK2MSFTNGP12.phx.gbl...
> > Do you want to stop the services so that you can backup your databases?
> > Perhaps you could use the Transact-SQL BACKUP command to backup your
> > databases to disk that you could then backup using your backup software.
> >
> > If you don't have the available disk space to backup the databases and
you
> > can afford some downtime probably the better option is to issue
> > sp_detach_db, then have the backup software backup your databases, and
> then
> > issue sp_attach_db.
> >
> >
> > If you want to stop SQL Server from a job you could try creating a batch
> > file that issues the appropriate NET STOP and NET START commands.  You
can
> > then schedule a job to call the batch file.  I have not tried this, so I
> > don't know if it will work or not, but that is one way you could do it
> > within a [SQL] job.  If the SQL Server job does not work you could also
> > schedule a job within NT to call the batch file.
> >
> > --
> > Keith
> >
> >
> > "Noor" <noor@ngsol.com> wrote in message
> > news:O6M1c4TdEHA.1656@TK2MSFTNGP09.phx.gbl...
> > > Dear Professional
> > >
> > > I want to restart the msSqlServer and msSqlAgent Services once a day
> > through
> > > JOB, how can I perform this
> > >
> > > Thanks
> > > NOOR
> > >
> > >
> >
>
>


Relevant Pages

  • Re: Schtasks: Using quotes in arguments
    ... > I am trying to schedule a backup on Win XP Pro using the following ... > if this can be accomplished as above, in a single command. ...
    (microsoft.public.win2000.general)
  • Re: Scheduled Task problem...
    ... I'd save the command in a batch file and schedule that. ... If the job connects to another machine you may need to add the user/ group 'logon as batch job' rights. ... serverName (this is the server\instance name for SQL Server) ...
    (microsoft.public.windows.server.general)
  • Re: database backup schedule not working
    ... On the schedules tab hit "New Schedule" ... You will want to backup your user databases, master, and model. ... > I'm running SQL server 2000 on a Windows Server 2003. ... > Database, selected the local disk as a backup destination, clicked on ...
    (microsoft.public.sqlserver.tools)
  • Re: Need Recommendations for Back Up Program
    ... Subject: Schedule Batch file-How To? ... Maybe a little different because your wanting to backup to a 2nd PC on a network. ... I'm referring to how I use the Windows XP command to backup all files and folders ... I use the xcopy.exe command in a batch file. ...
    (microsoft.public.windowsxp.general)
  • Re: Scheduled backups fail to start
    ... When you scheduled your backup, ... command or did you schedule a batch file to run? ... - If it is the batch file, ...
    (microsoft.public.windows.server.general)