Sunday, December 28, 2008

Oracle ORADIM

ORADIM is a Windows only utility used for the creation, modification and deletion of the Windows Service

Definitions:-
ASMSID:- ASM instance name
ASMSRVC (service_name):- ASM service name
NEW:- Indicates that a new instance is being created
PFILE (file_name):- Parameter File Path and Name
RUNAS:- Options are OSUSR and OSPASS
SHUTMODE:- How the Windows Service should shutdown the database. Options are ABORT, NORMAL, and IMMEDIATE
SID:- Name of the Oracle instance
SPFILE:- Indicates that a server parameter file (SPFILE) be used during startup instead of a PFILE
SRVC (service_name):- Name of the Oracle service
SRVCSTART:- Options are SYSTEM and DEMAND
STARTMODE:- Should Windows start the instance when the Database service is started.Options are AUTO and MANUAL
SYSPWD (password):- System password
TIMEOUT (seconds):- Sets the maximum time to wait (in seconds) before the service for a particular SID stops

DROP:-
ORADIM -DELETE sid -ASMSID sid -SRVC srvc -ASMSRVC srvc
Example:-
$ORACLE_HOME\bin\oradim -DELETE -SID orabase

HELP:-
ORADIM -h $ORACLE_HOME\bin\oradim -?
Example:-
$ORACLE_HOME\bin\oradim -h
$ORACLE_HOME\bin\oradim -help

MODIFY Shutmode:-
ORADIM -EDIT -SID sid -ASMSID sid
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART systemdemand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-SHUTTYPE srvc inst]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SHUTMODE immediate

NEW:-
ORADIM -NEW -SID sid -SRVC srvc -ASMSID sid -ASMSRVC srvc
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART system demand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-TIMEOUT secs]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -NEW -SID orabase -SRVC orabase
-SYSPWD uwpwd -STARTMODE manual -SRVCSTART system
-PFILE c:\oracle\product\ora102\database\initorabase.ora
-SHUTMODE immediate

SPFILE Selection:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SPFILE

STARTUP:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME/bin/oradim -STARTUP -SID orabase
-STARTTYPE tstc -SPFILE

SHUTDOWN:-
ORADIM -SHUTDOWN sid -ASMSID sid [-SYSPWD pass]
[-SHUTTYPE srvc inst srvc,inst]
[-SHUTMODE normal immediate abort]
Example:-
$ORACLE_HOME\bin\oradim -SHUTDOWN -SID orabase -SHUTMODE abort

More Examples and General Information about ORADIM
oradim is a tool that can be used to create Oracle specific windows services and to start an instance.
oradim can be given the option -sid which identifies the system identifier.

Creating a service
c:\>oradim -new -sid SOME_SID -intpwd PASSWORD -startmode MODE -pfile PFILE
PASSWORD is the password that is used to connect / as sysdba.

MODE indicates how the service is started. It must either be auto or manual. auto tells Windows to automatically start the service when Windows is booted. manual, on the other hand, requires someone to manually start the service.

Starting things with oradim
Starting the service
c:\some\arbitrary\path> oradim -startup -sid -starttype srvc

Starting the instance
c:\some\arbitrary\path> oradim -startup -sid -starttype inst

Starting both the service and the instance
c:\some\arbitrary\path> oradim -startup -sid -starttype srvc,inst

Logging
ORADIM messages are not printed to the command prompt, instead, they're logged to %ORACLE_HOME%\database\oradim.log. It is possible to change the directory where the log file is stored by adding the ORA_CWD registry parameter.

No comments: