Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Changing service auto to manual via batch
Of course the simpler way would be
oradim -edit -sid orcl9 -startmode M
for manual
or
oradim -edit -sid orcl9 -startmode A
automatic.....change the sid to your sid of course
Just checked on my machine and that works too....without the need for WSH
Cheers
Quoting jherrick_at_igs.net:
>
>
> The following VBScript will do it
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")
> Set colServiceList = objWMIService.ExecQuery _
> ("Select * from Win32_Service where displayname = 'OracleServiceORCL9'")
> For Each objService in ColServiceList
> errCode = objService.Change(, , , , "Manual")
> Next
>
> put this into a file called 'manual.vbs' and call it using 'cscript' in
> your batch file (i.e. cscript manual.vbs). Change the service name to
> the proper service name....this code worked fine on my XP Pro install BTW....
>
> You could also paramaterize this one script so that it does manual and auto.
> I leave that for you to do.
>
> HTH
>
> Jeff Herrick
>
> Quoting "J. Dex" <cemail_219_at_hotmail.com>:
>
>> 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-lReceived on Wed Jul 18 2007 - 16:50:21 CDT
![]() |
![]() |