Korn Shell script to verify if oracle is installed
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Korn Shell script to verify if oracle is installed

  1. #1
    Join Date
    Aug 2001
    Location
    Brazil
    Posts
    22

    Korn Shell script to verify if oracle is installed

    Hi All,

    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?
    Example:
    if [ -r $ORACLE_HOME/bin/sqlplus ]
    then
    echo "Oracle software installed."
    exit 0
    else
    echo "Oracle software not installed."
    Exit 1
    fi

    How can I get the oracle software version without using the sqlplus and the V$VERSION view?

    Thanks and Regards
    Klaus Huewes

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    You could also check the following location:

    $ORACLE_HOME/oraInventory/Components/oracle.rdbms

    Each RDBMS version installed is listed in there.

    Regards
    Jim
    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!

  3. #3
    Join Date
    May 2002
    Posts
    2,645
    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.

  4. #4
    Join Date
    Aug 2001
    Location
    Brazil
    Posts
    22
    Thanks stecal…

    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
    Klaus Huewes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width