|
|
Re: problem with my batch file that run the oracle [message #309523 is a reply to message #309517] |
Thu, 27 March 2008 15:06 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
I just happen to know that there is a "sc.exe" in some Windows resource pack or another that is basically a "Service Control" program to start and stop windows services form the command line.
So this seems to belong into the Windows Platform Forum, and the problem is most likely that this sc.exe is either missing from the box in question, or the path variable got mangled up.
|
|
|
Re: problem with my batch file that run the oracle [message #309534 is a reply to message #309517] |
Thu, 27 March 2008 16:01 |
|
Barbara Boehmer
Messages: 9101 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Michel Cadot wrote on Thu, 27 March 2008 12:45 | What is SC?
|
C:\Windows\System32>sc
DESCRIPTION:
SC is a command line program used for communicating with the
Service Control Manager and services.
USAGE:
sc <server> [command] [service name] <option1> <option2>...
The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistent).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
failureflag-----Changes the failure actions flag of a service.
sidtype---------Changes the service SID type of a service.
privs-----------Changes the required privileges of a service.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
qfailureflag----Queries the failure actions flag of a service.
qsidtype--------Queries the service SID type of a service.
qprivs----------Queries the required privileges of a service.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
showsid---------Displays the service SID string corresponding to an arbitrary name.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService
Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]:
y
QUERY and QUERYEX OPTIONS:
If the query command is followed by a service name, the status
for that service is returned. Further options do not apply in
this case. If the query command is followed by nothing or one of
the options listed below, the services are enumerated.
type= Type of services to enumerate (driver, service, all)
(default = service)
state= State of services to enumerate (inactive, all)
(default = active)
bufsize= The size (in bytes) of the enumeration buffer
(default = 4096)
ri= The resume index number at which to begin the enumeration
(default = 0)
group= Service group to enumerate
(default = all groups)
SYNTAX EXAMPLES
sc query - Enumerates status for active services & drivers
sc query eventlog - Displays status for the eventlog service
sc queryex eventlog - Displays extended status for the eventlog service
sc query type= driver - Enumerates only active drivers
sc query type= service - Enumerates only Win32 services
sc query state= all - Enumerates all services & drivers
sc query bufsize= 50 - Enumerates with a 50 byte buffer
sc query ri= 14 - Enumerates with resume index = 14
sc queryex group= "" - Enumerates active services not in a group
sc query type= interact - Enumerates all interactive services
sc query type= driver group= NDIS - Enumerates all NDIS drivers
C:\Windows\System32>sc start
DESCRIPTION:
Starts a service running.
USAGE:
sc <server> start [service name] <arg1> <arg2> ...
C:\Windows\System32>
|
|
|
Re: problem with my batch file that run the oracle [message #309537 is a reply to message #309523] |
Thu, 27 March 2008 16:13 |
|
Barbara Boehmer
Messages: 9101 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
As ThomasG said, probably either sc.exe is missing or you are running it from a different directory than usual and/or the directory is not in your path.
First, confirm that it is on your system, by going to your command prompt and going to your root directory (if you have more than one drive, then do it on each one):
cd\
then search for it in all of the sub-directories:
dir sc.exe/s
If it is missing, then that is the problem. Otherwise, once you find the right directory:
C:\>dir sc.exe/s/p
Volume in drive C is OS
Volume Serial Number is B841-3E7B
Directory of C:\Windows\System32
11/02/2006 02:45 AM 31,744 sc.exe
1 File(s) 31,744 bytes
then try running the sc command from the command prompt in that directory. If it still does not run, then the file is corrupted. If it runs, then you either need to run it from that directory and modify your .bat file to do so or if the .bat file runs in the current directory, then run it from that directory, or add that directory to your path in your windows environment.
|
|
|
|
|
Re: problem with my batch file that run the oracle [message #309768 is a reply to message #309766] |
Fri, 28 March 2008 13:55 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Well, the problem is pretty clear.
"sc.exe" is not found by the batch script.
-> So the Oracle services are not started when you run the batch file.
-> So you get a TNS:protocol adapter error when you try to connect to oracle.
-> So you don't seem to understand the answer : "make sure sc.exe is there and can be found by the batch script"
Or forget the batch script, an start the services with Administrative Tools -> Services by hand, or set them to start automatic.
|
|
|
|
|
|
|
Re: GREAT [message #309911 is a reply to message #309854] |
Sat, 29 March 2008 14:28 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
You should ask yourself who/what removed c:\windows\system32 out of the path. Because, typically it IS part of the PATH environment variable by default.
|
|
|