Operating System - HP-UX
1748213 Members
3173 Online
108759 Solutions
New Discussion юеВ

Re: Checking whether an oracle instance is configured or not

 
SOLVED
Go to solution
Vinu Neelakandhan
Occasional Contributor

Checking whether an oracle instance is configured or not

Hi,

I have a question on checking whether an oracle instance is configured or not. Given the instance name, I can check whether the instance is running or not using svrmgrl. If the given instance is not running, next thing I need to do is to check whether the instance is configured for oracle or not. For this I currently check whether the init$ORACLE_SID.ora file is present or not. But, I do not find this very efficient as presence of this file just does not mean that the oracle instance is configured completely. Is there any other way of checking this?

Regards,
Vinu
9 REPLIES 9
Printaporn_1
Esteemed Contributor

Re: Checking whether an oracle instance is configured or not

oracle instance mean SGA+processes
and it hard to say that it is proper configure or not !!

then you just check for all oracle process of that instance was all up is enough.
enjoy any little thing in my life
Andreas D. Skjervold
Honored Contributor

Re: Checking whether an oracle instance is configured or not

Hi
I just do a; ps -ef |grep pmon
(or smon)
as these processes get started as the database is opened.
Then you get a list of all your running databases on your machine.

I miss the svrmgrl message from Oracle7 that said; "Connected to an idle instance."

Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
Magdi KAMAL
Respected Contributor

Re: Checking whether an oracle instance is configured or not

Hi Venu,

To check if the instance is running :
#su - oracle
#svrmgrl
SVRMGR>connect internal
SVRMGR> select instance_name from v$instance;

Will reports the oracle active instance .

Magdi
Vinu Neelakandhan
Occasional Contributor

Re: Checking whether an oracle instance is configured or not

Yes, if the Oracle has been started up, we can find from the V$instance. But, if Oracle has not been started, how do we know whether an instance has been configured or not? Is there any system file or some place, we could check and find out whether it has been configured? (apart from init.ora file)
Thierry Poels_1
Honored Contributor

Re: Checking whether an oracle instance is configured or not

hi,

you can check if datafiles exists for this database.
If you know nothing at all about this database, you will have to check the init.ora file for references to control files and alert files (background_dump_dest directory).

regards,
Thierry
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Bill Thorsteinson
Honored Contributor
Solution

Re: Checking whether an oracle instance is configured or not

Check /etc/oratab (may be placed elsewhere during
installation) for an entry for the SID. If it is there and
the third field is Y then you may have problems starting
and stopping the system if the database isn't configured.

The init.ora will point you to the directories and
files used by the database. The init.ora in
$ORACLE_HOME/dbs is usually a soft link back to
a real file in $ORACLE_HOME/admin//pfile.

If the database has been configured then all the
files in the entry control_files will have been created.

The direcory $ORACLE_HOME/admin//create
should contain the database create scripts. One
script should have a create database entry listing
the database files. If these exist the database
has been configured.

If the create scripts aren't found look files
like system01.dbf, temp01.dbf, redo01.dbf, and redo02.dbf in the directories where the control files were created. If these are there then the database
has been configured.
Graham Cameron_1
Honored Contributor

Re: Checking whether an oracle instance is configured or not

Not really sure what you are trying to do or why.
One or more databases may in the past have been "configured" at some time in the past, but if all the required files are not still there then you cannot start up the instance fully.
You can search the system for the relevant files all you like, but the only sure-fire way is to try to start up the instance and see if it works.

export ORACLE_SID=
svrmgrl
connect internal
startup

Good luck
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
T G Manikandan
Honored Contributor

Re: Checking whether an oracle instance is configured or not

Hello,
export ORACLE_SID=instance_name
svrmgrl
connect internal
select * from v$instance;
select status,database_status from v$instance;

From OS you can use
#ps -ef|grep ora|grep .The five processes show that the instance is running.
Thanks
G Manikandan
Joseph C. Denman
Honored Contributor

Re: Checking whether an oracle instance is configured or not

The last thing you do when configuring a database is modify the oratab file for instance startup and shutdown at reboot. I would bet, if the instance is in the oratab file, it is configured.

Check your /etc/oratab file

...jcd...
If I had only read the instructions first??