Help Selecting Oracle Version

I need to use SQL Plus Worksheet. Does oracle 9 include this? If not, what version includes it?
Any help appreciated, Thanks.

So which Oracle 9 one should i get, Personal, Lite, Database etc?
Any help appreciated.

Similar Messages

  • Not able to view Forms Server version in Help: About Oracle Applications after the forms upgrade 10.1.2.3.0

    Hi all,
    DB:11.2.0.3.0
    EBS:12.1.3
    O/S: Sun Solaris SPARC 64 bits
    I am not able to view Forms Server version in Help: About Oracle Applications after the forms upgrade 10.1.2.3.0 after the forms upgrade 10.1.2.3.0 as per note:Upgrading OracleAS 10g Forms and Reports to 10.1.2.3 (437878.1)
    Java/jre upgraded to 1.7.0.45 and JAR files regenerated(without force option). Able to opne forms without any issues.
    A)
    $ORACLE_HOME/bin/frmcmp help=y
    FRM-91500: Unable to start/complete the build.
    B)
    $ORACLE_HOME/bin/rwrun ?|grep Release
    Report Builder: Release 10.1.2.3.0 - Production on Thu Nov
    28 14:20:45 2013
    Is this an issue? Could anyone please share the fix if faced the similar issue earlier.
    Thank You for your time
    Regards,

    Hi Hussein,
    You mean reboot the solaris server and then start database and applications services. We have two databases running on this solaris server.
    DBWR Trace file shows:
    Read of datafile '+ASMDG002/test1/datafile/system.823.828585081' (fno 1) header failed with ORA-01206
    Rereading datafile 1 header failed with ORA-01206
    V10 STYLE FILE HEADER:
            Compatibility Vsn = 186646528=0xb200000
            Db ID=0=0x0, Db Name='TEST1'
            Activation ID=0=0x0
            Control Seq=31739=0x7bfb, File size=230400=0x38400
            File Number=1, Blksiz=8192, File Type=3 DATA
    Tablespace #0 - SYSTEM  rel_fn:1
    Creation   at   scn: 0x0000.00000004 04/27/2000 23:14:44
    Backup taken at scn: 0x0001.db8e5a1a 04/17/2010 04:16:14 thread:1
    reset logs count:0x316351ab scn: 0x0938.0b32c3b1
    prev reset logs count:0x31279a4c scn: 0x0938.08469022
    recovered at 11/28/2013 19:43:22
    status:0x2004 root dba:0x00c38235 chkpt cnt: 364108 ctl cnt:364107
    begin-hot-backup file size: 230400
    Checkpointed at scn:  0x0938.0cb9fe5a 11/28/2013 15:04:52
    thread:1 rba:(0x132.49a43.10)
    enabled  threads:  01000000 00000000 00000000 00000000 00000000 00000000
    Hot Backup end marker scn: 0x0000.00000000
    aux_file is NOT DEFINED
    Plugged readony: NO
    Plugin scnscn: 0x0000.00000000
    Plugin resetlogs scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Foreign creation scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Foreign checkpoint scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Online move state: 0
    DDE rules only execution for: ORA 1110
    ----- START Event Driven Actions Dump ----
    ---- END Event Driven Actions Dump ----
    ----- START DDE Actions Dump -----
    Executing SYNC actions
    ----- START DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK' (Async) -----
    Successfully dispatched
    ----- END DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK'
    (SUCCESS, 0 csec) -----
    Executing ASYNC actions
    ----- END DDE Actions Dump (total 0 csec) -----
    ORA-01186: file 1 failed verification tests
    ORA-01122: database file 1 failed verification check
    ORA-01110: data file 1:
    '+ASMDG002/test1/datafile/system.823.828585081'
    ORA-01206: file is not part of this database - wrong
    database id
    Thanks,

  • Help on Oracle streams 11g configuration

    Hi Streams experts
    Can you please validate the following creation process steps ?
    What is need to have streams doing is a one way replication of the AR
    schema from a database to another database. Both DML and DDL shall do
    the replication of the data.
    Help on Oracle streams 11g configuration. I would also need your help
    on the maintenance steps, controls and procedures
    2 databases
    1 src as source database
    1 dst as destination database
    replication type 1 way of the entire schema FaeterBR
    Step 1. Set all databases in archivelog mode.
    Step 2. Change initialization parameters for Streams. The Streams pool
    size and NLS_DATE_FORMAT require a restart of the instance.
    SQL> alter system set global_names=true scope=both;
    SQL> alter system set undo_retention=3600 scope=both;
    SQL> alter system set job_queue_processes=4 scope=both;
    SQL> alter system set streams_pool_size= 20m scope=spfile;
    SQL> alter system set NLS_DATE_FORMAT=
    'YYYY-MM-DD HH24:MI:SS' scope=spfile;
    SQL> shutdown immediate;
    SQL> startup
    Step 3. Create Streams administrators on the src and dst databases,
    and grant required roles and privileges. Create default tablespaces so
    that they are not using SYSTEM.
    ---at the src
    SQL> create tablespace streamsdm datafile
    '/u01/product/oracle/oradata/orcl/strepadm01.dbf' size 100m;
    ---at the replica:
    SQL> create tablespace streamsdm datafile
    ---at both sites:
    '/u02/oracle/oradata/str10/strepadm01.dbf' size 100m;
    SQL> create user streams_adm
    identified by streams_adm
    default tablespace strepadm01
    temporary tablespace temp;
    SQL> grant connect, resource, dba, aq_administrator_role to
    streams_adm;
    SQL> BEGIN
    DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE (
    grantee => 'streams_adm',
    grant_privileges => true);
    END;
    Step 4. Configure the tnsnames.ora at each site so that a connection
    can be made to the other database.
    Step 5. With the tnsnames.ora squared away, create a database link for
    the streams_adm user at both SRC and DST. With the init parameter
    global_name set to True, the db_link name must be the same as the
    global_name of the database you are connecting to. Use a SELECT from
    the table global_name at each site to determine the global name.
    SQL> select * from global_name;
    SQL> connect streams_adm/streams_adm@SRC
    SQL> create database link DST
    connect to streams_adm identified by streams_adm
    using 'DST';
    SQL> select sysdate from dual@DST;
    SLQ> connect streams_adm/streams_adm@DST
    SQL> create database link SRC
    connect to stream_admin identified by streams_adm
    using 'SRC';
    SQL> select sysdate from dual@SRC;
    Step 6. Control what schema shall be replicated
    FaeterBR is the schema to be replicated
    Step 7. Add supplemental logging to the FaeterBR schema on all the
    tables?
    SQL> Alter table FaeterBR.tb1 add supplemental log data
    (ALL) columns;
    SQL> alter table FaeterBR.tb2 add supplemental log data
    (ALL) columns;
    etc...
    Step 8. Create Streams queues at the primary and replica database.
    ---at SRC (primary):
    SQL> connect stream_admin/stream_admin@ORCL
    SQL> BEGIN
    DBMS_STREAMS_ADM.SET_UP_QUEUE(
    queue_table => 'streams_adm.FaeterBR_src_queue_table',
    queue_name => 'streams_adm.FaeterBR_src__queue');
    END;
    ---At DST (replica):
    SQL> connect stream_admin/stream_admin@STR10
    SQL> BEGIN
    DBMS_STREAMS_ADM.SET_UP_QUEUE(
    queue_table => 'stream_admin.FaeterBR_dst_queue_table',
    queue_name => 'stream_admin.FaeterBR_dst_queue');
    END;
    Step 9. Create the capture process on the source database (SRC).
    SQL> BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name =>'FaeterBR',
    streams_type =>'capture',
    streams_name =>'FaeterBR_src_capture',
    queue_name =>'FaeterBR_src_queue',
    include_dml =>true,
    include_ddl =>true,
    include_tagged_lcr =>false,
    source_database => NULL,
    inclusion_rule => true);
    END;
    Step 10. Instantiate the FaeterBR schema at DST. by doing export
    import : Can I use now datapump to do that ?
    ---AT SRC:
    exp system/superman file=FaeterBR.dmp log=FaeterBR.log
    object_consistent=y owner=FaeterBR
    ---AT DST:
    ---Create FaeterBR tablespaces and user:
    create tablespace FaeterBR_datafile
    '/u02/oracle/oradata/str10/FaeterBR_01.dbf' size 100G;
    create tablespace ws_app_idx datafile
    '/u02/oracle/oradata/str10/FaeterBR_01.dbf' size 100G;
    create user FaeterBR identified by FaeterBR_
    default tablespace FaeterBR_
    temporary tablespace temp;
    grant connect, resource to FaeterBR;
    imp system/123db file=FaeterBR_.dmp log=FaeterBR.log fromuser=FaeterBR
    touser=FaeterBR streams_instantiation=y
    Step 11. Create a propagation job at the source database (SRC).
    SQL> BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES(
    schema_name =>'FaeterBR',
    streams_name =>'FaeterBR_src_propagation',
    source_queue_name =>'stream_admin.FaeterBR_src_queue',
    destination_queue_name=>'stream_admin.FaeterBR_dst_queue@dst',
    include_dml =>true,
    include_ddl =>true,
    include_tagged_lcr =>false,
    source_database =>'SRC',
    inclusion_rule =>true);
    END;
    Step 12. Create an apply process at the destination database (DST).
    SQL> BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name =>'FaeterBR',
    streams_type =>'apply',
    streams_name =>'FaeterBR_Dst_apply',
    queue_name =>'FaeterBR_dst_queue',
    include_dml =>true,
    include_ddl =>true,
    include_tagged_lcr =>false,
    source_database =>'SRC',
    inclusion_rule =>true);
    END;
    Step 13. Create substitution key columns for äll the tables that
    haven't a primary key of the FaeterBR schema on DST
    The column combination must provide a unique value for Streams.
    SQL> BEGIN
    DBMS_APPLY_ADM.SET_KEY_COLUMNS(
    object_name =>'FaeterBR.tb2',
    column_list =>'id1,names,toys,vendor');
    END;
    Step 14. Configure conflict resolution at the replication db (DST).
    Any easier method applicable the schema?
    DECLARE
    cols DBMS_UTILITY.NAME_ARRAY;
    BEGIN
    cols(1) := 'id';
    cols(2) := 'names';
    cols(3) := 'toys';
    cols(4) := 'vendor';
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(
    object_name =>'FaeterBR.tb2',
    method_name =>'OVERWRITE',
    resolution_column=>'FaeterBR',
    column_list =>cols);
    END;
    Step 15. Enable the capture process on the source database (SRC).
    BEGIN
    DBMS_CAPTURE_ADM.START_CAPTURE(
    capture_name => 'FaeterBR_src_capture');
    END;
    Step 16. Enable the apply process on the replication database (DST).
    BEGIN
    DBMS_APPLY_ADM.START_APPLY(
    apply_name => 'FaeterBR_DST_apply');
    END;
    Step 17. Test streams propagation of rows from source (src) to
    replication (DST).
    AT ORCL:
    insert into FaeterBR.tb2 values (
    31000, 'BAMSE', 'DR', 'DR Lejetoej');
    AT STR10:
    connect FaeterBR/FaeterBR
    select * from FaeterBR.tb2 where vendor= 'DR Lejetoej';
    Any other test that can be made?

    Check the metalink doc 301431.1 and validate
    How To Setup One-Way SCHEMA Level Streams Replication [ID 301431.1]
    Oracle Server Enterprise Edition - Version: 10.1.0.2 to 11.1.0.6
    Cheers.

  • Incorrect version showing after Oracle version upgrade

    Dear All
    As we have upgraded our oracle version from 10.2.0.4.0 to 11.2.0.2.0. As we go in the sqlplus / as sysdba " . it is showing the
    correct version. ever after i checked through 'select version from
    V$instance' showing the correct result also. 11.2.0.2.0. When we go ourenterprise portal & check the oracle version in the system info of enterprise portal showing "Oracle Database 11g Release 11.1.0.0.0 -Production"
    we are not able to understand why it is showing the wrong version in the portal.
    Can anybody help to trace it out. 
    Thanks
    regards
    Ravi Kant Arya
    +91 9540990385

    Ravi Kant Arya wrote:
    Dear All
    >
    > As we have upgraded our oracle version from 10.2.0.4.0 to 11.2.0.2.0. As we go in the sqlplus / as sysdba " . it is showing the
    > correct version. ever after i checked through 'select version from
    > V$instance' showing the correct result also. 11.2.0.2.0. When we go ourenterprise portal & check the oracle version in the system info of enterprise portal showing "Oracle Database 11g Release 11.1.0.0.0 -Production"
    >
    > we are not able to understand why it is showing the wrong version in the portal.
    >
    > Can anybody help to trace it out. 
    >
    > Thanks
    > regards
    > Ravi Kant Arya
    > +91 9540990385
    Hi Ravi,
    Could it be belong to the Oracle client release?
    Best regards,
    Orkun Gedik

  • Oracle Versions Communication

    Hi Guys,
    this is my first post, so apologies in advance if I've selected the wrong part of the forum. . .
    We are currently undergoing a project to move the database for one of our systems from 8i on unix over to 10g on windows 2k3 (we no longer have any unix support since ms is the company standard - a decision far above our heads that we cannot question). We have had a few problems with past attempts, but these may be explainable by outside factors (i.e. we discovered that some ports were blocked around the same time we made one attempt, and there was a virus outbreak on another go - like I say, the company standard is ms), so people are questioning whether the 'new technology' is compatible, or if we should try using older versions of OSes & oracle.
    As I understand the theory, the operating system & oracle version should not cause any issues to our system if only the server side is changed, and the only change made to clients is to point them to the new server using their tns names file. Since all communication is via tcp/ip, and the database before and after is oracle, I would expect that if the same messages are being sent, the messages received should be the same, though the black-box server processing side of things may be different - i.e. aside from knowing about a change of server name and faster response, our clients should not be able to tell that there has been an upgrade, even when doing a binary level comparison of the responses. Does anyone know of any difference that could exist in the replies (i.e. would the later version of oracle maybe try to use a different data structure, or does the reply include some sort of tag to indicate what version of oracle was run on the server)?
    Hope that all makes sense. . .
    Many thanks in advance for your help,
    JB
    (Hope the bold helps to separate the question from the background padding ;) )

    Hi Arulselvaraj,
    That's kind of what I'm asking, but at a more technical level. I am not worried about the actual user's, but the client software (in this case a very old and heavily customised version of JDE OneWorld). I am wondering if the binary data returned to a client by a server running 8i on Unix would look exactly the same as the binary data returned by a server running 10g on windows 2k3 when both servers have the same data and are sent the same query by the same client? In other words, would a migration from one to the other be transparent to the client application?
    Hopefully that makes a bit more sense; not the easiest of issues to explain.
    Thanks again,
    JB

  • ORACLE VERSION 11g

    Hi All,
    when i am running SELECT * FROM TABLE1 that time its returns order by each records in oracle 9i oracle version.when i am trying in same query in oracle 11g its not comming in order all the the records.
    please help me any one.

    if you want the output of a connect by in a certain order, you better use ORDER siblings BY - the order by for a connect by
    otherwise, the rows come out in a hierarchy, but not necessarily in any sort order.
    You might get a plan against one set of data that uses an index to retrieve the data - and see it sorted, but as the result set grows - it might start scanning instead and all of a sudden - no more sort.
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2066102
    <quote>
    If you specify this clause, then do not specify either ORDER BY or GROUP BY, because they will destroy the hierarchical order of the CONNECT BY results. If you want to order rows of siblings of the same parent, then use the ORDER SIBLINGS BY clause.
    </quote>
    so, the hierarchy is assured, but the order of rows within - not at all - not without order siblings by

  • Finding Oracle Version

    Could anyone help me how to find the Oracle versions, that are installed on my NT System, from the registry.

    ye Darryl Hilarion Mendez is right. try this statement.
    =========================================
    SQL> r
    1* select * from v$version
    BANNER
    Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.1.0 - Production
    CORE Version 4.0.5.0.0 - Production
    TNS for 32-bit Windows: Version 8.0.5.0.0 - Production
    NLSRTL Version 3.3.2.0.0 - Production
    SQL>

  • How to supress the Oracle version in Reporting

    Hi All,
    I am trying to run an .sql file
    spool aPOORVA_TEST.log;
    SET ECHO Off;
    SET DEFINE OFF;
    set feedback off;
    set heading off;
    set line 5000;
    SELECT * FROM table WHERE ROWNUM<3;
    Spool Off;
    The output of this query is showing the Oracle Version along with the query result
    SQL*Plus: Release 9.2.0.6.0 - Production on Fri May 8 04:11:13 2009
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    How could i remove these which SET command is going wrong. Please advise.

    Do you have a
    sqlplus username/password@database command somewhere in the .sql file? How are you running the .sql file?
    After logging into the SQL*Plus console?
    If you are using sqlplus command in the sql file, then just suppress the ouput with -SILENT option or -s.
    Cheers
    Sarma.

  • How to find out the Oracle Version in Windows platform (OS level)

    Hi,
    I have installed Oracle 8.1.7, 9.2.0.1 and 10.2.0.1on my Windows machine for testing purpose.
    I want to list in my code as what are all the Oracle software version installed on my machine at OS level (before connecting into oracle).
    Is there any way to get this.
    Please help.
    Thanks,
    Riaz.

    Hi All,
    thanks for your inputs..
    In registry, where the oracle version info is getting stored... and if more than one Oracle is installed, then how did we get this info??
    thanks,
    riaz.

  • Steps to upgrade my Oracle version from 11.1.0.6 to 11.2.0.1 in windows.

    Can anyone help me with the steps to upgrade my Oracle version from 11.1.0.6 to 11.2.0.1 in windows.
    Thanks in advance.

    If you are going to upgrade, you should upgrade to the latest 11gR2 patchset (currently 11.2.0.4). At a high level -
    1. Install 11.2.0.4 into a new separate ORACLE_HOME - see MOS Doc 1562139.1 and Contents
    2. Apply the latest 11.2.0.4 PSU bundle available for Windows - see MOS Doc 1454618.1
    3. Use DBUA to perform the upgrade - MOS Doc 870814.1 and Contents
    Also see
    MOS Doc 1645862.1

  • Selection screen versions in LdB

    The following questions are related to SAP delivered LdBs that are not for HR.
    a) Do you know where the selection screen versions for a delivered LdB are stored?
    b) Can additional selection versions be created /delivered selection screen versions modified? Or the authorization for doing the changes is generally not provided.
    Thank you much,
    Fred.
    Edited by: Fred Myer on Jan 30, 2008 11:16 PM
    Guys, any help?

    Hi,
    Try declaring some global variable in the data delclaration event, and pass the values these variable at selection screen, and use them wherever required.
    Regards,
    Santhosh.

  • How to find out what Oracle version?

    Hi,
    Could anyone tell me how to find out what Oracle version is on your AIX/Unix machine? It looks like Oracle Installer doesn't use the native OS installation(installp,pkgadd) process, so I can't use lslpp/pkginfo to find out what filesets are installed.
    Thanks
    HQ.

    Hi!
    As far ar Oracle version is concerned, you can find it at the database level after connecting to the database
    select * from v$version;
    i am not sure if there is someway to find at the o/s level.
    Good luck
    null

  • Help with oracle 11g pivot operator

    i need some help with oracle 11g pivot operator. is it possible to use multiple columns in the FOR clause and then compare it against multiple set of values.
    here is the sql to create some sample data
    create table pivot_data ( country_code number , dept number, job varchar2(20), sal number );
    insert into pivot_data values (1,30 , 'SALESMAN', 5000);
    insert into pivot_data values (1,301, 'SALESMAN', 5500);
    insert into pivot_data values (1,30 , 'MANAGER', 10000);     
    insert into pivot_data values (1,301, 'MANAGER', 10500);
    insert into pivot_data values (1,30 , 'CLERK', 4000);
    insert into pivot_data values (1,302, 'CLERK',4500);
    insert into pivot_data values (2,30 , 'SALESMAN', 6000);
    insert into pivot_data values (2,301, 'SALESMAN', 6500);
    insert into pivot_data values (2,30 , 'MANAGER', 11000);     
    insert into pivot_data values (2,301, 'MANAGER', 11500);
    insert into pivot_data values (2,30 , 'CLERK', 3000);
    insert into pivot_data values (2,302, 'CLERK',3500);
    using case when I can write something like this and get the output i want
    select country_code
    ,avg(case when (( dept = 30 and job = 'SALESMAN' ) or ( dept = 301 and job = 'SALESMAN' ) ) then sal end ) as d30_sls
    ,avg(case when (( dept = 30 and job = 'MANAGER' ) or ( dept = 301 and job = 'MANAGER' ) ) then sal end ) as d30_mgr
    ,avg(case when (( dept = 30 and job = 'CLERK' ) or ( dept = 302 and job = 'CLERK' ) ) then sal end ) as d30_clrk
    from pivot_data group by country_code;
    output
    country_code          D30_SLS               D30_MGR               D30_CLRK
    1      5250      10250      4250
    2      6250      11250      3250
    what I tried with pivot is like this I get what I want if I have only one ( dept,job) for one alias name. I want to call (30 , 'SALESMAN') or (301 , 'SALESMAN') AS d30_sls. any help how can I do this
    SELECT *
    FROM pivot_data
    PIVOT (SUM(sal) AS sum
    FOR (dept,job) IN ( (30 , 'SALESMAN') AS d30_sls,
              (30 , 'MANAGER') AS d30_mgr,               
    (30 , 'CLERK') AS d30_clk
    this is a simple example .... my real life scenario is compliated with more fields and more combinations .... So something like using substr(dept,1,2) won't work in my real case .
    any suggestions get the result similar to what i get in the case when example is really appreciated.

    Hi,
    Sorry, I don't think there's any way to get exactly what you requested. The values you give in the PIVOT ... IN clause are exact values, not alternatives.
    You could do something like this to map all alternatives to a common value:
    WITH     got_dept_grp     AS
         SELECT     country_code, job, sal
         ,     CASE
                  WHEN  job IN ('SALESMAN', 'MANAGER') AND dept = 301 THEN 30
                  WHEN  job IN ('CLERK')               AND dept = 302 THEN 30
                                                                     ELSE dept
              END     AS dept_grp
         FROM     pivot_data
    SELECT     *
    FROM     got_dept_grp
    PIVOT     (     AVG (sal)
         FOR     (job, dept_grp)
         IN     ( ('SALESMAN', 30)
              , ('MANAGER' , 30)
              , ('CLERK'   , 30)
    ;In your sample data (and perhaps in your real data), it's about as easy to explicitly define the pivoted groups individually, like this:
    WITH     got_pivot_key     AS
         SELECT     country_code, sal
         ,     CASE
                  WHEN  job = 'SALESMAN' AND dept IN (30, 301) THEN 'd30_sls'
                  WHEN  job = 'MANAGER'  AND dept IN (30, 301) THEN 'd30_mgr'
                  WHEN  job = 'CLERK'    AND dept IN (30, 302) THEN 'd30_clrk'
              END     AS pivot_key
         FROM    pivot_data
    SELECT     *
    FROM     got_pivot_key
    PIVOT     (     AVG (sal)
         FOR     pivot_key
         IN     ( 'd30_sls'
              , 'd30_mgr'
              , 'd30_clrk'
    ;Thanks for posting the CREATE TABLE and INSERT statements; that really helps!

  • Different plsql for different Oracle versions

    Hi everyone,
    I am working on a plsql script which may be run on multiple databases. Unfortunately, I have a need to run one query type if the version is 10g, and another if it is 9i. The 10g query is preferable for the type & amount of information it returns, but 9i does not have the same level of support. I wrote the below (dumbed down for posting purposes) to do this:
    spool sqlLog.txt append
    set heading off;
    SET NEWPAGE 0;
    SET SPACE 0;
    SET LINESIZE 32767;
    SET PAGESIZE 0;
    --SET ECHO OFF;
    SET FEEDBACK OFF;
    SET VERIFY OFF;
    SET HEADING OFF;
    SET MARKUP HTML OFF;
    SET TERMOUT OFF;
    SET TRIMOUT ON;
    SET TRIMSPOOL ON;
    SET WRAP OFF ;
    SET LONG 4000;
    SET LONGCHUNKSIZE 500;
    set serverout on;
    set serveroutput on;
    declare     
    ver VARCHAR2(64);
    BEGIN
    select v.version into ver from product_component_version v where product like '%Oracle%';
    ver:=substr(ver,0,2); --remove anything but the highest version number, a.k.a. 9 or 10.
    dbms_output.put_line('ver: '||ver);
    --10g
    IF to_number(ver)>=10
    THEN
         for csr_10g in (SELECT sql_fulltext, a.parsing_schema_name, b.name, b.value_string
                             FROM V$SQL a left outer join v$sql_bind_capture b ON a.SQL_ID = b.SQL_ID)
              loop
                dbms_output.put_line(csr_10g.sql_fulltext||';'|| csr_10g.parsing_schema_name||';'|| csr_10g.name||';'|| csr_10g.value_string);
             end loop;
    ELSE
    --9i
         for csr_9i in (SELECT a.sql_Text, b.Schemaname
                             FROM v$sqlarea a left outer join v$session b ON a.parsing_schema_id=b.schema#
              loop
                dbms_output.put_line(csr_9i.sql_text||';'|| csr_9i.schemaname||';');
             end loop;
    END IF;
    END;
    --run;
    spool off;
    exit;If I run this on a 10g database, it works correctly, spooling the query return to a file.
    If I run this on a 9i database, it will not run, and i get these errors:
                             FROM V$SQL a left outer join v$sql_bind_capture b ON a.SQL_ID = b.SQL_ID --combine to also find the bound variables used
    ERROR at line 13:
    ORA-06550: line 13, column 35:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 12, column 17:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 27, column 30:
    PLS-00364: loop index variable 'CSR_10G' use is invalid
    ORA-06550: line 27, column 9:
    PL/SQL: Statement ignored
    Am I doing something wrong with my syntax, or is there another way to go about this?
    Thanks!

    Hi,
    Dynamic SQL, like John suggested, might be the most elegant solution, but here are some others to consider:
    (1) Create dummy objects. Your code guarantees that you'll never get a run-time error trying to query v$sql in Oracle 9, but the problem is that you're getting a compile-time error just by referencing it. So create a v$sql: a dummy table in your own schema, a synonym to the Oracle 10 data dictionary via a database link, anything just so it compiles.
    (2) Create real objects. For example, in your Oracle 9 database, create a view called v$sql, based on v$sqlarea and v$session, that has all the same columns you use in Oracle 10. If you can do this, you won't even need an IF statement in your PL/SQL; the same code that runs against the data dictionary v$sql in Oracle 10 will run against your own schema's v$sql in Oracle 9.
    (3) Isolate the problems. Write two different versions of a package, one for each version, and put all version-dependent code in the package. In most of your code, call the procedure to do the version-dependent stuff. For example, don't open a cursor in your program: instead, call the package to open a cursor.
    (4) Comment Out. Klugy but cute. Write your PL/SQL without IF statements, like this:
    BEGIN
    &v10     for csr_10g in (SELECT sql_fulltext, a.parsing_schema_name, b.name, b.value_string
    &v10                         FROM V$SQL a left outer
    &v9     for csr_9i in (SELECT a.sql_Text, b.Schemaname
    &v9                         FROM v$sqlarea a left outer join v$session b ON a.parsing_schema_id=b.schema#
    &v9                                                                                  join v$sql_bind_capture b ON a.SQL_ID = b.SQL_ID)
              loop
    &v10            dbms_output.put_line(csr_10g.sql_fulltext||';'|| csr_10g.parsing_schema_name||';'|| csr_10g.name||';'|| csr_10g.value_string);
    &v9            dbms_output.put_line(csr_9i.sql_text||';'|| csr_9i.schemaname||';');
             end loop;
    END;Compile your PL/SQL in SQL*Plus.
    Define two substitution variables: v10 and v9.
    In Oracle 10, v10 make " " and make v9 "--".
    In Oracle 9, v10 make "--" and make v9 " ".
    You can do the assignments on the fly with the SQL*Plus "COLUMN ... NEW_VALUE" command.
    In either database, code that only works in the other version will be commented out. Your code will look like hell (good spacing and comments will make it less hard to read), but it will compile and work.
    None of these ideas are mutually exclusive. You might want to do dynamic SQL in some places, and use on dummy objects in others, for example.

  • Control file version 10.2.0.1.0 incompatible with ORACLE version 10.2.0.0.

    hi;
    I'm totally new to the oracle databases field...am trying to startup the database using the parameter file init.ora by using the command
    startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init.ora'
    But its giving me the following error:
    ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version
    10.2.0.0.0
    ORA-00202: control file:
    '/u01/app/oracle/product/10.2.0/db_1/dbs/control01.ctl'
    Can anyone help me with this error?
    Thanks!

    startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init.ora'You are most likely using the wrong init.ora file. Get a list of files at /u01/app/oracle/product/10.2.0/db_1/dbs/
    For the database ORACLE_SID that you are attempting to startup, there would be an initSID.ora or spfileSID.ora
    e.g. if the ORACLE_SID is PROD, the file would be initPROD.ora or spfilePROD.ora
    The spfileSID.ora is a binary file and should not be accessed by a text-editor.
    Hemant K Chitale

Maybe you are looking for

  • Error while opening a function

    HI, 1. Create a query-only version of the System Profile Options function-- fun name is view system profile 2. and i assigned his to one of existing menu ABC Am able to see the this under the menu ABC.. but wen i click that it throws error The View S

  • Can you have 2 iTunes accounts, and use the same master card?

    I wonderd if I cold have 2 iTunes accounts, one for me, and one for my mom, and use the same master card on both? I dont want my mom to **** up my account if she gets an iPhone. Also she would be using my e-mail and my name.

  • Apple TV2 Dark movies

    I just buy and ATV2 and have and "old" plasma TV with no hdmi but connect trough VGA and it´s right i see 720i correct in my tv, colors too but in movies i see is soo dark, shadows go to black. I try rgb low, high, modes but in low is even worst. I r

  • Unsupported lib's and software

    Ok, made a specific topic for this as I feel it deserves more discussion (I hope this isn't too presumptuous.) The name may be a bit misleading as it isn't Gnome 1.4 specific which is what started this discussion. TOPIC=gnome1.4-libs and packages...

  • Quick Question about charging port

    ---I had the issue today of my phone randomly making the "charge initiation" noise well after I had plugged it in. Almost as if it had stopped charging for a split second and then reinitiated. Very curious if this would be related to the charging por