Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle-l »

Re: Changing service auto to manual via batch

Jeff Herrick

2007-07-18

Replies:

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@(protected):

>
>
> 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@(protected)>:
>
>> 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


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.