modius modius - 1 year ago 89
SQL Question

How can I confirm a database is Oracle & what version it is using SQL?

I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Oracle, and if possible, what version of Oracle they are running by sending a SQL statement to the datasource.

Answer Source

Run this SQL:

select * from v$version;

And you'll get a result like:

Oracle Database 10g Release - 64bit Production
PL/SQL Release - Production
CORE      Production
TNS for Solaris: Version - Production
NLSRTL Version - Production
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download