SQL Query to detect Oracle version

Hello,
For our application, we need to programmatically detect the version of the Oracle instance. Can someone please tell me if there is any SQL query I can run to get the version information?
Thank you in advance for enlightening me.
Pradeep

hi,
SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
7.3.4.5.0
SQL> conn scott/tiger@lsc65
Connected.
SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
8.1.7.4.0
SQL> conn scott/tiger@lsc67
Connected.
SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
9.2.0.6.0
SQL> conn scott/tiger@lsc68
Connected.
SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
10.1.0.3.0
SQL> HTH
Laurent Schneider
OCM DBA

Similar Messages

  • SQL Query to find Discoverer version installed

    Hi ,
    As a developer, Is there a back-end DB sql query (or script) that can be run on DB to find the version of Oracle Discoverer installed?
    Will the query be different if Discoverer is used with Oracle Applications (R12.1.3) as compared to a Discoverer running on a plain stand alone Oracle Database (no Oracle apps)?
    thanks,
    gg.

    Hello gg
    The VER_NAME and VER_DESCRIPTION are typically never filled in and can be ignnored.
    The VER_RELEASE is the EUL version as you rightly summised. This version is 100% compatible with Discoverer 11g and if you already have it you can upgrade from 10g to 11g without changing anything in the EUL
    VER_MIN_CODE_VER is the minimum version of Oracle Discoverer that can be used with this EUL. In this case 10.1.2.45.20 is 10g Release 2
    VER_EUL_TIMESTAMP is the date and time this version of the EUL was released by Oracle - again you can ignore it
    The important fields therefore are the VER_RELEASE and VER_MIN_CODE_VER
    Hope this helps
    Best wishes
    Michael

  • SQL query (Windows) to Oracle (Linux)

    Hi,
    I have an Oracle on Linux, it is an Oracle XE. From Windows 7, I would like to access this Oracle Linux using any SQL query software. So, to do it, I would like to know:
    1) which components do I need to install ?
    2) how can I setup the components or the operating system or Oracle?
    4) where I can download the components? and what would be the name of the components?
    4) which SQL software I can run on Windows  to access Linux directly using the components or some settings on this software?
    5) are there any software that it is free to download?
    tks.

    ac01e371-bc09-4b23-81d2-b251ca9edd1e wrote:
    Hi,
    I have an Oracle on Linux, it is an Oracle XE. From Windows 7, I would like to access this Oracle Linux using any SQL query software. So, to do it, I would like to know:
    1) which components do I need to install ?
    2) how can I setup the components or the operating system or Oracle?
    4) where I can download the components? and what would be the name of the components?
    4) which SQL software I can run on Windows  to access Linux directly using the components or some settings on this software?
    5) are there any software that it is free to download?
    tks.
    Oracle SQL Developer Downloads</title><meta name="Title" content="Oracle SQL Developer Downloads…
    SQuirreL SQL Client Home Page</title></head><body><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 …

  • How to get this sql query value in oracle query?

    Hi all,
    i am using one query in sql that is
    select @EarlyLeaversMin = DATEDIFF(Minute,@OutTime,@nshiftmax)
    suppose first line query is getting 60 minutes.
    select @EarlyLeaversMin1=DATEDIFF(Minute,@temphrs,@ShiftTime)
    second line query is also getting 60 minutes
    set @EarlyLeaversMin=@EarlyLeaversMin+@EarlyLeaversMin1+1
    and now here it's calculating both variable minutes and storing in @earlyleaversmin that should store like 60+60+1=121 mintes
    select @EarlyLeaverstimeformat = CONVERT(char(8),Dateadd(n,@EarlyLeaversMin,0),108)
    so now it will store in this query that value in this format : 01:21:00
    can i use the same which it's happening here??
    thanks

    Oracle handles dates and time very differently from SQL Server (as I gather others on this forum have already tried to explain to you).
    Anyway, Oracle does not have a TIME datetype, but what it does have are INTERVALs. In this case you would use INTERVAL DAY TO SECOND. It's not completely clear what you mean by "store in this query that value" but we can use INTERVALS as both table columns and PL/SQL variables.
    So your first query would be something like this:
    declare
        interval_var  INTERVAL DAY TO SECOND;
    begin
         select (nshiftmax - outtime) day to second
         into interval_var
         from whatever;We can do arithmetic with interval variables.
         select (nshiftmax - outtime) day to second +  (shifttime - temphrs) day to second
         into interval_var
         from whatever;To add a hard-coded interval such as 1 minute you can use this functionality:
         interval_var := interval_var + to_dsinterval('0 0:1:0');There's loads of info in the Oracle documentation. [url http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm#sthref115]Find out more.
    Cheers, APC

  • How is sql query executed in oracle

    Hi,
    I want to know how is sql executed in oracle engine.
    Please provide me the link or the document.
    For eg: SQL>select * from emp;
    how the execution happens from beginning till end.

    >
    I want to know how is sql executed in oracle engine.
    Please provide me the link or the document.
    For eg: SQL>select * from emp;
    how the execution happens from beginning till end.If you are interested in databases in general (and for your
    edification) you might want to look at the books below.
    http://www.amazon.com/Fundamentals-Database-Systems-Ramez-Elmasri/dp/0321122267
    http://infolab.stanford.edu/~ullman/dscb.html
    Also, for Oracle, look at Tom Kyte (Expert Database Architecture) and to really
    get down and dirty look at Jonathan Lewis's book "Cost Based Oracle". Books
    on the Oracle Wait Interface (e.g. http://www.amazon.com/Oracle-Wait-Interface-Performance
    -Diagnostics/dp/007222729X/ref=sr_1_1?s=books&ie=UTF8&qid=1317990537&sr=1-1 (link wraps).
    It's a massive field. Good luck.
    Paul...

  • Explain SQL Query execution plan: Oracle

    Dear Masters,
    Kindly help me to understand execution plan for an SQL statement. I have following SQL execution plan for a query in system. How should I interpret it. I thank You in advace for your guidance.
    SELECT STATEMENT ( Estimated Costs = 1.372.413 , Estimated #Rows = 0 )
           5 NESTED LOOPS
             ( Estim. Costs = 1.372.413 , Estim. #Rows = 3.125 )
             Estim. CPU-Costs = 55.798.978.498 Estim. IO-Costs = 1.366.482
               2 TABLE ACCESS BY INDEX ROWID MSEG
                 ( Estim. Costs = 1.326.343 , Estim. #Rows = 76.717 )
                 Estim. CPU-Costs = 55.429.596.575 Estim. IO-Costs = 1.320.451
                 Filter Predicates
                   1 INDEX RANGE SCAN MSEG~R
                     ( Estim. Costs = 89.322 , Estim. #Rows = 60.069.500 )
                     Search Columns: 1
                     Estim. CPU-Costs = 2.946.739.229 Estim. IO-Costs = 89.009
                     Access Predicates
               4 TABLE ACCESS BY INDEX ROWID MKPF
                 ( Estim. Costs = 1 , Estim. #Rows = 1 )
                 Estim. CPU-Costs = 4.815 Estim. IO-Costs = 1
                 Filter Predicates
                   3 INDEX UNIQUE SCAN MKPF~0
                     Search Columns: 3
                     Estim. CPU-Costs = 3.229 Estim. IO-Costs = 0
                     Access Predicates

    Hi Panjak,
    Yeahh, there's a huge unperformatic SQL statment, what I can see from this acces plan is:
    1 DBO decided to start the query on index R on MSEG, using only part of the index (only one column) with no good uniqueness, accessing disk IO-Costs for this (60mi records), and expecting many interactions (loops) in memory to filter, see CPU-Costs.
    So with the parameters you gave to SQL, they start in a very bad way.
    2 After that program will access the MSEG commanded by what was found on First step, also with a huge loading from DB and filtering (another where criteria on MSEG fields, not found on index R), reducing the result set to 76.717 rows.
    3/4 With this, program goes direct to primary key index on MKPF with direct access (optimized access) and follow to access database table MKPF.
    5 At last will "loop" the result sets from MSEG and MKPF, mixing the tuplas generating the final result set.
    Do you want to share your SQL, the parameters you are sending and code which generate it with us?
    Regards, Fernando Da Ró

  • SQL query return wrong Windows version

    when excuting   'select @@VERSION' returns wrong Windows version. Why?

    when excuting   'select @@VERSION' returns wrong Windows version. Why?
    SELECT @@VERSION will return SQLServer version and not windows version
    Even in case of sql, if you're seeing a different version from what your management studio suggests, then it may be that you're SSMS (client tool) is of another later version whereas the server instance which you're actually connecting to may
    be of different (earlier) version.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Is there any restriction using pl/sql packages depending on Oracle Version?

    Hi everybody. Our company is using a mix of pl/sql packages to call web services and process xml inside stored procedures. We are using UTL_HTTP, UTL_DBWS and UTL_XML. Our client asks if there is any restriction using those packages on a Standard One licensed database? Does we need an upgrade p.e. enterprise edition to use those packages? I test all our development on a Express Edition, and there is no restriction. We run the same test on a Standard One and Enterprise Editions and the result was the same, no restrictions.
    To use those packages does we need an upgrade to enterprise edition?
    Xavier.

    the packages that you mention are not restricted to a particular version.

  • Java.lang.NoClassDefFoundError: oracle/xml/sql/query/OracleXMLQuery

    Hello, all.
    I get this error message:
    java.lang.NoClassDefFoundError: oracle/xml/sql/query/OracleXMLQuery
    at oracle.xml.xsql.actions.XSQLQueryHandler.handleAction(Compiled Code) ...
    when trying to view an xsql page with the jswdk 1.0.1 web server. (I have no problems when using Web-to-go)
    Classpath includes:
    C:\jdk1.1.8\lib\classes.zip;
    C:\xsql\lib\oraclexsql.jar;
    C:\xsql\lib\xmlparserv2.jar;
    C:\xsql\lib\xsu111.jar;
    C:\xsql\lib\classes111.zip;
    C:\xsql\lib;
    What could be the problem?
    Mateja
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Only thing I can think of is that maybe your server classpath is getting too long. I recall one of the Java Web Server releases having a classpath length limit that caused strange errors like this because that .jar files you thought were on your classpath were getting their path names truncated so the Java VM cannot find the JAR's.
    Try putting xsu111.jar earlier in the list of JAR's and/or try shortening the classpath (perhaps by using SUBST'd drive letters or softlinks on Unix to shorten the path names).<HR></BLOCKQUOTE>
    Putting the xsu11.jar file towards the start of the path did not help.
    I have rewriten the entire bat file that creates the CLASSPATH and starts the server and things now seem to work. There must have been some error in the original bat file, that I just couldn't see.
    Anyway - I thank you for your help.
    null

  • Error in oracle.xml.sql.query

    I am trying to write small piece of code as
    follows
    import java.sql.*;
    import java.math.*;
    import oracle.xml.sql.query.*;
    import oracle.jdbc.*;
    import oracle.jdbc.driver.*;
    Actual Code
    When i try to compile
    the java file it errors out on Package Oracle.xml.sql.query not found in import
    Pacakage oracle.jdbc.* not found
    Package oracle.jdbc.driver not found
    Is there any files to be installed.
    I installed default Enterprise edition of Oracle 8.1.7 on NT
    Please advise
    Thanks,
    Vidhya
    null

    Have you include classes12.jar/zip, xsu12.jar in your classpath?(assume using JDK 1.2.x)

  • PL/Sql concurent program in Oracle 10.7

    Hi
    I am creating a PL/SQL concurrent program in Oracle version 10.7. I need to write some messages to the log file. I know this can easily be done in 11i using FND_FILE.
    In 10.7, I am trying to use UTL_FILE. I get the logfile name from FND_CONCURRENT_REQUESTS using following cursor:
    SELECT logfile_name
    FROM fnd_concurrent_requests
    WHERE request_id = fnd_global.conc_request_id;
    This gives the correct name, when i try to open the file for writing after parsing, i get an error. The system is not able to open the file in Append mode, when i open the file in read mode, it does not give any errors.
    Same is the case for the outfile as well.
    Is it possible to write to the log file in 10.7. I used the append mode, since the concurrent manager also write to the same file.
    Any pointers ?
    thanks and regards

    utl_file_dir = * --> This is valid and can be used, but its not recommended to use it since it makes any directory accessible to the UTL_FILE function. Instead use utl_file_dir = path1, path2, .. etc (use an absolute directory path).
    I am not sure about 10.7, but for 11.0.x you have to verify that APPLPTMP is included in the setting of the utl_file_dir. Once you change this, restart the concurrent manager and make sure that the user who start the CM has read/write priviliges on APPLPTMP and utl_file_dir.
    You can verify that the PL/SQL runs properly for reading/writing from/to utl_file_dir from SQL*Plus

  • Sql query tuning

    How can i do SQl QUERY TUNING in Oracle 9i Database

    Hello,
    How can i do SQl QUERY TUNING in Oracle 9i Database You can start through reviewing the Performance Tuning Guide;
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm
    Good Luck!
    Adith

  • Oracle Sql Query issue Running on Different DB Version

    Hello All,
    I have come into situation where we are pruning sql queries on different DB version of Oracle and have performance issue. Let me tell you in brief and i really appreciate for your prompt response as its very imperative stuff.
    I have a query which is running on a DB of version 7.3.4 and it takes around 30 mins where as the same query when run on 8i it takes 15sec., its a huge difference. I have run the statistics to analyze on 7.3 and its comparatively very high. Question here is, the sql query trys to select data from same schema table and 2 tables from another DB using DB link and 2 other tables from another DB using DB link.So,how can we optimize this stuff and achieve this run as same time as 8i DB in 7.3. Hope i am clear about my question, Eagerly waiting for your replies.
    Thanks in Advance.
    Message was edited by:
    Ram8

    Difficult to be sure without any more detailed information, but I suspect that O7 is in effect copying the remote tables to local temp space, then joining; 8i is factoring out a better query to send to the remote DBs, which does as much work as possible on the remote DB before shipping remaining rows back to local.
    You should be able to use EXPLAIN PLAN to identify what SQL is being shipped to the remote DB, If you can't (and it's been quite a while since I tried DB links or O7) then get the remote DBs to yourself, and set SQL_TRACE on for the remote instances. Execute the query and then examine the remote trace files, And don't forget to turn off the tracing when you're done.
    Of course it could just be that the CBO got better,,,
    HTH - if not, post your query and plans for the local db, and the remote queries.
    Regards Nigel

  • How to Suppress The Output of a SQL Query In Oracle 11gR2

    Hi Friends,
    I am using oracle version 11.2.0.1, I have set a cronjob which will run on every 15 minutes and give us a log file mentioning the execution time taken for that SQL query:-
    For example:
    SQL> set timing on;
    SQL> SELECT objProp FROM aradmin.arschema WHERE (schemaId = 175);
    OBJPROP+
    --------------------------------------------------------------------------------+
    *6\60006\4\0\\60008\40\0\60009\4\0\\60010\4\0\\60018\4\0\\600*
    *22\4\68\1\63\AR:jRL#*
    Elapsed: 00:00:00.00
    The above query will return the output as well as the time taken for execution of the query. I want to suppress the output of the query and only want the time taken to be printed. Is it possible by set commands. I have marked the output as bold and made it Italic.
    Please help me at the earliest.
    Regards,
    Arijit

    >
    I am using oracle version 11.2.0.1, I have set a cronjob which will run on every 15 minutes and give us a log file mentioning the execution time taken for that SQL query:-
    The above query will return the output as well as the time taken for execution of the query. I want to suppress the output of the query and only want the time taken to be printed. Is it possible by set commands. I have marked the output as bold and made it Italic.
    >
    How would that even be useful?
    A query from a tool such as sql*plus is STILL going to send the output to the client and the client. You can keep sql*plus from actually displaying the data by setting autotrace to trace only.
    But that TIME TAKEN is still going to include the network time it takes to send ALL rows that the query returns across the network.
    That time is NOT the same as the actual execution time of the query. So unless you are trying to determine how long it takes to send the data over the network your 'timing' method is rather flawed.
    Why don't you tell us WHAT PROBLEM you are trying to solve so we can help you solve it?

  • Sub-Select SQL query in Oracle BI Answers

    Hi
    What's the proper usage of Sub-Select SQL query in Oracle BI Answers Version Oracle Business Intelligence 10.1.3.2.1?
    I get [SQL_STATE: HY000] [nQSError: 10058] A general error has occured when trying to Sub Select query like:
    itemno = (SELECT MIN(orders.itemno) FROM mydatabase where rownum < 2 order by orders.itemno)

    Maybe the best is to create a new physical and logical object for your sub-select and join this with your current objects.

Maybe you are looking for

  • WU_TEST_106 , client_text_io not working

    I tried the demo webutil software, all the components are working except the client_text_io , which is on the second tab, writing to a text file from the screen. Reference data from Java Console Loading http://hostmachine:8889/forms90/java/f90all_jin

  • Text Determination - Mandatory at Delivery Header

    Hi All, I would like to know how to keep TEXT as a mandatory option at Delivery Header. This TEXT has to be copied from Sales Document Header. My question is how to keep TEXT as mandatory option for doing PGI? I tried even by keeping "Text is obligat

  • HP 6110xi All-In-One Deskjet Printer

    I am unable to locate a new "latch cover door" that covers and holds the printer cartridge in place. The small 'tab' has broken off of the front of this "latch cover door" and am unable to close the door such that it stays closed. Can anyone help wit

  • Can the requiqitioner see his shopping carts in check status

    Situation : I (X) want to make a shopping cart for (Y). I do this by using the shop on behalf transaction and putting (Y) as requisitioner for my user in PPOMA_BBP. When I shopped for Y, Y needs to check, change or display the shopping cart in his ch

  • Samsung DVD Player "No Signal" Message

    Since we first bought our Samsung Blue-Ray Disc Player (BD-P-1400) it will play a disc for less than five minutes, and then the TV (Samsung Series 550) displays a "No Signal" message. The DVD player is still advancing the disc, but only the error mes