|
ORADIM
On Windows,
Oracle provides a simple utility like .exe for
easily starting and stopping database services
and/or instances via command line –
oradim. Unlike UNIX,
where the dbstart and dbshut scripts simply launch
Oracle processes, oradim must work in the Windows
paradigm of launching the Oracle processes as
services. Below is a screen snapshot showing a
Windows machine running two database instances and a
listener. Also note that unlike UNIX, on Windows the
Oracle background processes are all executed within
threads of just the one Oracle process. See the
section later this chapter on ORAKILL for more
detailed information.
Figure 4.3:
Running Multiple Database Instances
The
oradim utility can be
launched several different ways to accomplish
differing tasks. Also, the parameters passed vary
depending upon the purpose being invoked. It creates
a log file in the directory $ORACLE_HOME\database.
To create a new instance, the
syntax is as follows:
-NEW -SID sid | -SRVC service
| -ASMSID sid | -ASMSRVC service
[-SYSPWD password]
[-STARTMODE auto | manual] [-SRVCSTART system |
demand]
[-PFILE file | -SPFILE]
[-SHUTMODE normal | immediate | abort]
[-TIMEOUT seconds] [-RUNAS
os_user/os_password]
To modify an existing instance,
the syntax is as follows:
-EDIT -SID sid | -ASMSID sid
[-SYSPWD password]
[-STARTMODE auto | manual] [-SRVCSTART system |
demand]
[-PFILE file | -SPFILE]
[-SHUTMODE normal | immediate | abort]
[-SHUTTYPE service |
instance] [-RUNAS os_user/os_password]
To delete an existing instance,
the syntax is as follows:
-DELETE -SID sid | -ASMSID
sid | -SRVC service | -ASMSRVC service
To start up an existing instance,
the syntax is as follows:
-STARTUP -SID sid | -ASMSID
sid
[-SYSPWD password]
[-STARTTYPE service | instance |
service,instance]
[-PFILE filename | -SPFILE]
To shut down an existing
instance, the syntax is as follows:
-SHUTDOWN -SID sid | -ASMSID
sid
[-SYSPWD password] [-SHUTTYPE
service | instance | service,instance]
[-SHUTMODE normal | immediate
| abort]
Here is a simple example of
trying to stop an instance:
C:\Temp>oradim -shutdown -sid
ORDB2
ORA-01031: insufficient
privileges
Although no
password is needed to perform this task, the Windows
user must have sufficient privileges to execute this
command successfully. Looking back up at the
services screen snapshot, see that the database is
running under the local system account, i.e.
administrator. Since, in this example, the user is
logged onto the machine using the domain/bscalzo
Windows User ID, there are not the privileges to run
oradim
on that database instance, or any database instance
for that matter.
lsnrctl
The
listener command line utility (lsnrctl)
provides the DBA a method for starting, stopping and
checking the status of the database listener as well
as several other listener management tasks. The
lsnrctl utility can either be run as a command line
invocation or as a command line interpreter, as
shown in these two examples:
$ lsnrctl command [listener_name]
$ lsnrctl
LSNRCTL> command [listener_name]
The lsnrctl command offers the
following commands:
|
change_password
|
To create or change an
encrypted password
|
|
exit
|
Exit the program
|
|
quit
|
Exit the program
|
|
reload
|
Re-read the listener.ora
file without a restart
|
|
services
|
Lists information about
services, instances, & service handlers
|
|
set
|
Alters parameter values
for the listener until shutdown
|
|
show
|
Displays current
parameter values for the listener
|
|
spawn
|
Start a program on the
server where listener is running
|
|
start
|
Start the named listener
|
|
status
|
Display status of the
named listener
|
|
stop
|
Stop the named listener
|
|
race
|
Start tracing for the
named listener
|
|
version
|
Shows current version of
lsnrctl utility
|
|