Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am new to Unix and trying to find out a command that checks if Oracle DB is installed in my Unix box. I came across commands ps -ef|grep smon and ps -ef|grep pmon in net. But which is the correct command that I can use.

Also how to find out the installation directory where the Oracle DB is installed if ORACLE_HOME variable is not set?

I am using bash shell.

share|improve this question

migrated from stackoverflow.com Apr 17 '13 at 5:33

This question came from our site for professional and enthusiast programmers.

1  
The ps commands would only tell you if a database was running, it wouldn't tell you if the software was installed if a DB wasn't up. You can investigate the locate or find commands to search for common files, e.g. sqlplus, but you're probably better off just asking the DBA for the settings to use. –  Alex Poole Apr 15 '13 at 18:51
1  
This is a duplicate of your other question stackoverflow.com/q/16030061/298282 You should not create duplicate posts on different stackexchange sites. –  Yasir Arsanukaev Apr 17 '13 at 5:36
    
@Yasir the OP created both on SO: this one was migreted from there too. –  Jack Douglas Apr 17 '13 at 8:57
add comment

2 Answers 2

This depends on the flavor of *nix where you run on and whether the installation was customized or not. If something of Oracle was installed on your system, the directory /etc/oracle or /var/opt/oracle normally would have to exist. Normally they contain a file /etc/oraInst.loc or /var/opt/oracle/oraInst.log that points to the inventory that contains the central registry of the installations done on the host, if it has been done in a standard way.

If you found the oraInstloc you know at least that some installation has been taken place. The inventory contains the details about what was installed and where. Normally this directory is protected.

If the /etc/oratab or /var/opt/oracle/oratab file has been maintained, it contains a list of all instances running on your system, including the software locations. This is the file that is used by the oraenv utility that sets the minimal environment variables you need to be able to use that software for the specified ORACLE_SID.

The oratab, if maintained shows all defined ORACLE_SID's, also when they are not running.

But again, asking your dba might save a lot of time.

share|improve this answer
add comment

Oracle installs some handy "$ORACLE_HOME setting scripts" in /usr/local/bin (or possibly in another location such as /opt/bin depending on your flavour of Unix/Linux). These are called oraenv and coraenv. They can be "sourced" (ie its commands executed) in your current shell and will then prompt for $ORACLE_SID and set $ORACLE_HOME based on this value. If there are any Oracle instances this script should default the values so you just need to press enter to each prompt.

If you're running bash on a Linux box you would use . oraenv to do this.

See http://www.orafaq.com/wiki/Oraenv

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.