Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Changing service auto to manual via batch

RE: Changing service auto to manual via batch

From: Ted Coyle <oracle-l_at_webthere.com>
Date: Thu, 19 Jul 2007 17:11:34 -0400
Message-ID: <000001c7ca49$636e8800$6401a8c0@medecision.com>


Here's a vbscript example:
Save this with .vbs extension.
Set ServiceName variable
Set script environment to cscript if echoing to screen Call "ScriptName.vbs a" for Auto or "m" for manual. This file can be called from .bat

'------Script Begin
Dim WshShell, oArgs, RegKey, ServiceName, StartMode Set WshShell=CreateObject("WScript.Shell") Set oArgs = WScript.Arguments
ServiceName = OracleService<YourService> RegKey="HKLM\SYSTEM\CurrentControlSet\Services\" & ServiceName & "\Start" Select Case UCase(oArgs.Item(0))
  Case "M"

     StartMode = "00000003"
  Case "A"

     StartMode = "00000002"
End Select
'Wscript.echo Startmode
WshShell.RegWrite regKey,StartMode,"REG_DWORD" '---------Script End

You could also use named arguments or add servicename as argument.

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Joel.Patterson_at_crowley.com
Sent: Thursday, July 19, 2007 9:32 AM
To: cemail_219_at_hotmail.com; oracle-l_at_freelists.org Subject: RE: Changing service auto to manual via batch

Type 'sc' at the DOS prompt and see if anything there will work for you. Certainly deleting the service works, as I use that for listener services etc.

Joel Patterson
Database Administrator
joel.patterson_at_crowley.com
x72546
904 727-2546

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of J. Dex Sent: Wednesday, July 18, 2007 4:04 PM
To: oracle-l_at_freelists.org
Subject: Changing service auto to manual via batch

Is there a way to change the "running services" status in the "Services"

window from Automatic to Manual via a batch script? I have a batch script
that uses oradim to shutdown/startup my 9207 databases on a WIN2003 server
but don't know how to change the status from automatic to manual in the event the server administrator wants to reboot the machine a couple of times
before I have the databases restart. My oradim command in the batch job
looks like this:

oradim -shutdown -sid dbsid -shutmode I -shuttype SRVC >> %BASELOGS%\oracle_shutdown.log



http://newlivehotmail.com

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Thu Jul 19 2007 - 16:11:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US