Korn Shell script to verify if oracle is installed
How can I verify if oracle software is installed in a Solaris 8 machine using a Korn Shell script?
It is verifying if the sqlplus tool exists?
if [ -r $ORACLE_HOME/bin/sqlplus ]
echo "Oracle software installed."
echo "Oracle software not installed."
How can I get the oracle software version without using the sqlplus and the V$VERSION view?
Thanks and Regards
You could also check the following location:
Each RDBMS version installed is listed in there.
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
How do you know if the software was installed per OFA? The program files could be anywhere on the system. Maybe components were installed and then taken off. You don't know for sure by looking at directories such as /var/opt/oracle or the Oracle owner's home directory. Who is to say $ORACLE_HOME was ever set as an environment variable in .login or .cshrc or whatever?
You could view /etc/passwd and /etc/group to look for an Oracle owner and group. If an Oracle owner exists, "su - ownername" and you will be in the owner's home directory, assuming one was specified in the passwd file.
So, if you really don't know if Oracle was installed and you are not sure about user account resource files (i.e., the path statement does not include /some path for Oracle/bin), one recourse is to search the entire file system. That is the only way a script can verify if something exists.
Checking for existence of specific items (files, directories, and environment variables) is easy to do with a script, but to "verify if Oracle was installed" - you need to do more work than what was posted by jovery, or rephrase your question to ask for something more definite (e.g., "I know Oracle is installed. How can I see if I have $ORACLE_PATH set as an environment variable?").
Last edited by stecal; 11-04-2002 at 10:13 AM.
The scenario is that:
- I have a script that install Oracle software using OFA
- I know all environment values like, ORACLE_HOME, ORACLE_BASE, the oracle user, etc
- This script is called by a installer graphical tool to install oracle and another software that use the database
- When this another software is reinstalled, the user must to reinstall the oracle too
I want to put the intelligence of installing the oracle or not into the installer script because this way the graphical tool always call the installer script, but the script decides if the oracle needs to be install or not.
Note that is a controlled scenario, I don’t need to create a generic script.
Now it is more clearly?
Thanks and Regards
Click Here to Expand Forum to Full Width