troubleshooting Question

Getting the Version of an Oracle Database via SQLPlus

Avatar of TexanLonghorn
TexanLonghornFlag for United States of America asked on
4 Comments3 Solutions4992 ViewsLast Modified:
Please let me know if there is a better way to query an Oracle database (8i or 10g) to know the version of the database software via SQLPlus session. The only way we know how to query an Oracle database is to submit a very complicated parsing query, like the following:

        myversion NUMBER;
        select to_number(substr(substr(banner,instr(banner,'Release')+8),1,instr(substr(banner,instr(banner,'Release')+8),'.')-1))
        into myVersion
        from v$version
        where banner like 'Oracle%' and rownum < 2;

        if myVersion >= 10 then
                Print " This is a 10g or later version of Oralce Database.";
        end if;

I'm thinking to myself that there must be a variable in a data dictionary table, an imbedded procedure or function to obtain the version of the Oracle database.
Ravindran Gopinathan

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros