ORADIM utility

Oradim is a oracle’s windows utility for easily starting and stopping database services and/or instances via command line. 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.

ORADIM can be used in creating a new instance or modifying an existing one or deleting. It can also be used to startup/shutdown the instances –

a.) CREATING AN INSTANCE using ORADIM –

Initially create a windows service for the instance using the 
ORADIM utility -

Here we are going to create an instance ORCL and the corresponding 
service OracleServiceORCL .....

C:\>oradim -new -sid ORCL -syspwd mgrorcl -startmode auto
 -pfile C:\app\mgrvinod\product\11.2.0\dbhome_1\dbs\init_orcl.ora;

Encountered with the following error - 

OPW-00001: Unable to open password-file
DIM-00014: Cannot open the Windows NT Service Control Manager.
O/S-Error: (OS 5) Access is denied.

If you encounter this kind of error - seems that your cmd is not 
running as 'Administrator' -- 
so, go to start->Accessories->cmd->run as administrator 

C:\>oradim -new -sid ORCL -syspwd mgrorcl -startmode auto
 -pfile C:\app\mgrvinod\product\11.2.0\dbhome_1\dbs\init_orcl.ora;

 Instance created.
C:\>
 
Now check whether the service created or not - 

C:\>net continue oracleserviceorcl 
The OracleServiceORCL service was continued successfully.
C:\>

OK.. Service created and running....

Now Let's start the instance ...

 C:\>set ORACLE_SID=ORCL

 C:\>sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed May 25 17:36:09 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

SQL> 
SQL> connect sys/mgrorcl as sysdba
Connected to an idle instance.
SQL> 

SQL> startup nomount
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file
'C:\APP\MGRVINOD\PRODUCT\11.2.0\DBHOME_1
\DATABASE\INITORCL.ORA'

At this point i dont understand why it is looking at this location 
for the pfile ... eventough i mentioned pfile location in 
oradim utility ...

 Anyways ....

SQL> startup nomount 
 pfile='c:\app\mgrvinod\product\11.2.0\dbhome_1\dbs\init_orcl.ora'

ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2182592 bytes
Variable Size             616563264 bytes
Database Buffers          444596224 bytes
Redo Buffers                5595136 bytes
SQL>

Now create the database - 

SQL> CREATE DATABASE ORCL
LOGFILE
  group 1 ('C:\app\mgrvinod\oradata\ORCL\redo1.log') size 10M,
  group 2 ('C:\app\mgrvinod\oradata\ORCL\redo2.log') size 10M,
  group 3 ('C:\app\mgrvinod\oradata\ORCL\redo3.log') size 10M
CHARECTER SET  WE8ISO8859P1
NATIONAL CHARACTER SET utf8
DATAFILE 'C:\app\mgrvinod\oradata\ORCL\system.dbf' size 50M 
  autoextend on next 10M maxsize unlimited 
  extent management local
SYSAUX datafile 'C:\app\mgrvinod\oradata\ORCL\sysaux.dbf'  
 size 10M autoextend on next 10M maxsize unlimited
UNDO TABLESPACE undotbs1
  datafile 'C:\app\mgrvinod\oradata\ORCL\undo.dbf'  size 10M
DEFAULT TEMPORARY TABLESPACE temp 
 tempfile 'C:\app\mgrvinod\oradata\ORCL\temp.dbf'   size 10M;

Database created.

SQL>

SQL>@C:\app\mgrvinod\product\11.2.0\dbhome_1\RDBMS\ADMIN\catalog.sql
SQL>@C:\app\mgrvinod\product\11.2.0\dbhome_1\RDBMS\ADMIN\catproc.sql
SQL>@C:\app\mgrvinod\product\11.2.0\dbhome_1\RDBMS\ADMIN\pupbld.sql

This is how we can utilize the ORADIM in creating a database –

b.) How ORADIM used to shutdown an instance –

C:\>oradim -shutdown -sid MGRORCL

C:\>

c.) How ORADIM used to startup an instance –

 C:\>oradim -STARTUP -SID MGRORCL -SYSPWD mgrorcl -STARTTYPE inst

 C:\>
Advertisements
This entry was posted in General, Oracle. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s