Detecting if an Oracle Database is Installed

Christopher McAtackney picture Christopher McAtackney · Nov 20, 2008 · Viewed 27.4k times · Source

I was wondering if there was a way to tell if an instance of Oracle on a system has a database installed or not?

This is for an installation script, and I need to verify that there is an actual database in place before proceeding with the loading of my own tablespace onto that database. Has anyone tackled this problem before?

Cheers

Answer

ConcernedOfTunbridgeWells picture ConcernedOfTunbridgeWells · Nov 20, 2008

Check for the existence of an ORACLE_HOME. It's also reasonable to expect that this environment should be configured for the installation, so testing the environment variables and exiting with a sensible diagnostic (possibly suggesting they run oraenv) is a good first start. If you have an ORACLE_HOME, ORACLE_SID or other appropriate environment variable set up, you can then check for the existence of an oracle home and test for database connectivity and permissions.