Oradim is an Oracle utility that is used to manage Oracle instance. It can be used to create, edit and delete an instance. Its typical use is when you had to manually create the instance for any reason. Among the reasons is when instance gets corrupted or when you are recovering your database after a media failure. For example if you want to create an instance then open the command prompt and issue the following command.
C:\oradim –new –sid crimson –syspwd oracle
The above command will create an instance named as crimson and the password for its sys account will be oracle. Now if you want to delete an instance then issue the following command.
C:\oradim –delete –sid crimson
This command will delete the instance. I was quite used to with these commands but here is something new that I discovered a few days earlier. Oradim can be used not only to start Oracle instance but also to start the database service at operating system well. The problem that I was facing was that I had Oracle 10g installed at home for playing. Normally I turned its services off and whenever required I turn them on. Every now and then I had to go to MMC and do the specific job. That is quite hectic, isn't it? So I searched and then devised a script that will do all the stuff for me with just a single click. It looks like this:
rem Start Listener
lsnrctl start
rem Start Oracle Database
oradim -startup -sid orcl -syspwd oracle -starttype srvc, inst
rem Start EM
set ORACLE_SID=ORCL
emctl start dbconsole
This script is for Windows. It first starts the Listener and then uses Oradim to start the database service and database itself. The parameter –starttype will define what to start. In this case both will get started. (srvc=service, inst=Instance)
Now if want to shutdown all these things then here it is:
rem Stop Oracle Database
oradim -shutdown -sid orcl -syspwd oracle -shuttype srvc, inst -shutmode i
rem Stop Listener
lsnrctl stop
rem Stop EM
set ORACLE_SID=ORCL
emctl stop dbconsole
For further options just type Oradim in command prompt provided that you have Oracle installed.
No comments:
Post a Comment