Need information on Error ORA-30052:invalid lower limit snapshot expression

Hello all,
I have been running some flashback version queries on Oracle DB like:
SELECT versions_xid,VERSIONS_OPERATION, LABEL_NAME FROM <table_name> VERSIONS BETWEEN SCN <scn1> AND <scn2>;
It was working fine, but after some interval, I got the following error on executing the command:
ORA-30052: invalid lower limit snapshot expression
30052. 00000 - "invalid lower limit snapshot expression"
*Cause: The lower limit snapshot expression was below the UNDO_RETENTION
limit.
*Action: Specify a valid lower limit snapshot expression.
On Google, it could find this useful information only http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams251.htm but this didn't made me understand the problem i have been facing and the cause.
On running the command "show parameter retention", I got the following result:
NAME TYPE VALUE
db_flashback_retention_target integer 1440
undo_retention integer 900
Can anyone please help us out here what could be the issue here and what will be the solution?
Thanks
Ankush Gupta

Hi,
The flashback always works along with Undo segment....
Issue:
By default the undo retention is 900 seconds.One restriction with using specific timestamps or SCNs is that they must be within the boundaries of the undo_retention parameter.
The db_flashback_retention_target integer 1440 min (24 hrs) parameter is for flashback logs and it has nothing to do with table flashback.
The flashback only uses the data in undo and which is in turn handled by undo retention i.e, 900 sec or 15 min.
Solution:
Try increasing the undo retention value and run the same. Hope, it'll run without any error.
thanks,
-Seshi

Similar Messages

  • ERROR: ORA-01017: invalid username/password; logon denied

    Hi all
    I need your kind help.
    I have installed Oracle Audit Vault Server  Release 10.2.3.2 in Linux system and collection agent in Windows system. Adding and starting DBAUD collector went fine however  adding REDO collector return back errors when executing avorcldb add_collector command as follow
    [oracle@avsrv ~]$
    [oracle@avsrv ~]$  avorcldb add_collector -srcname orcl -agentname avagent01 -colltype REDO -av Lugaopc:1521:orcl
    collector REDO_Collector for source orcl already exists
    initializing REDO Collector
    ERROR: could not get AV source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))
    ERROR: ORA-01017: invalid username/password; logon denied
    [oracle@avsrv ~]$
    Here is the contents of avorcldb.log file
    09-09-13 16:58:44 [INFO ] Processing command add_collector
    09-09-13 16:58:44 [INFO ] Processing arg -srcname = orcl
    09-09-13 16:58:44 [INFO ] Processing arg -agentname = avagent01
    09-09-13 16:58:44 [INFO ] Processing arg -colltype = REDO
    09-09-13 16:58:44 [INFO ] Processing arg -av = Lugaopc:1521:orcl
    09-09-13 16:58:44 [INFO ] Connect info : Lugaopc:1521:orcl
    09-09-13 16:58:45 [INFO ] Got AV admin connection using jdbc:oracle:oci:@AVDB
    09-09-13 16:58:45 [INFO ] Executing SQL as [ADM@AV] select s.host||':'||a1.num_value||':'||a2.char_value from avsys.av$attrvalue a1, avsys.av$attrvalue a2, avsys.av$source s, avsys.av$attrdef ad1, avsys.av$attrdef ad2 where source_name = :1 and a1.inst_id = s.source_id and a2.inst_id = s.source_id and a1.attr_id = ad1.attr_id and ad1.attr_name = 'PORT' and a2.attr_id = ad2.attr_id and ad2.attr_name = 'DB_SERVICE'
    09-09-13 16:58:45 [INFO ] Using bind value orcl
    09-09-13 16:58:45 [INFO ] Return value = Lugaopc:1521:orcl
    09-09-13 16:58:45 [INFO ] Connect info : Lugaopc:1521:orcl
    09-09-13 16:58:45 [INFO ] Executing SQL as [ADM@AV] select to_char(source_id) from avsys.av$source where source_name = :1
    09-09-13 16:58:45 [INFO ] Using bind value orcl
    09-09-13 16:58:45 [INFO ] Return value = 1
    09-09-13 16:58:46 [INFO ] Got source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))
    09-09-13 16:58:46 [INFO ] Executing SQL as [ADM@AV] select decode(c.status, 1, 'active', 0, 'dropped', null) from avsys.av$collector c, avsys.av$source s where source_name = :1 and collector_name = :2 and c.source_id = s.source_id
    09-09-13 16:58:46 [INFO ] Using bind value orcl
    09-09-13 16:58:46 [INFO ] Using bind value REDO_Collector
    09-09-13 16:58:46 [INFO ] Return value = active
    09-09-13 16:58:46 [MESG ] collector REDO_Collector for source orcl already exists
    09-09-13 16:58:46 [INFO ] Executing SQL as [ADM@AV] select decode(c.status, 1, 'active', 0, 'dropped', null) from avsys.av$collector c, avsys.av$source s where source_name = :1 and collector_name = :2 and c.source_id = s.source_id
    09-09-13 16:58:46 [INFO ] Using bind value orcl
    09-09-13 16:58:46 [INFO ] Using bind value REDO_Collector
    09-09-13 16:58:46 [INFO ] Return value = active
    09-09-13 16:58:46 [MESG ] initializing REDO Collector
    09-09-13 16:58:46 [INFO ] Executing SQL as [ADM@AV] select username from avsys.av$source where source_name = :1
    09-09-13 16:58:46 [INFO ] Using bind value orcl
    09-09-13 16:58:46 [INFO ] Return value = AVSRCUSR1
    09-09-13 16:58:46 [INFO ] Executing SQL as [ADM@AV] {? = call avsys.dbms_audit_vault.reset_source_user(?)}
    09-09-13 16:58:46 [INFO ] Adding mask for user password
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] select table_name from user_tables where upper(table_name) = upper(:1)
    09-09-13 16:58:46 [INFO ] Using bind value STREAMS_HEARTBEAT
    09-09-13 16:58:46 [INFO ] Return value = STREAMS_HEARTBEAT
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] drop table streams_heartbeat
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] create table streams_heartbeat( src_dbname varchar2(4000), job_number number, heartbeat_time timestamp)
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] declare dbs_name varchar2(4000); begin select global_name into dbs_name from global_name; insert into streams_heartbeat values (dbs_name, 0, SYSTIMESTAMP); end;
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] create or replace procedure update_heartbeat IS begin update streams_heartbeat set heartbeat_time=(select systimestamp from dual); commit; end;
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] select table_name from user_tables where upper(table_name) = upper(:1)
    09-09-13 16:58:46 [INFO ] Using bind value CAPTURE_RULES
    09-09-13 16:58:46 [INFO ] Return value = CAPTURE_RULES
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] drop table capture_rules
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] create table capture_rules( rule_name  varchar2(50), rule_scope varchar2(6),  rule_type  varchar2(3),  obj_name   varchar2(100))
    09-09-13 16:58:46 [INFO ] Executing SQL as [ADM@AV] select global_name from global_name
    09-09-13 16:58:46 [INFO ] Return value = AVDB.AVSRV
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] select db_link from user_db_links where db_link = :1
    09-09-13 16:58:46 [INFO ] Using bind value AVDB.AVSRV
    09-09-13 16:58:46 [INFO ] Return value = AVDB.AVSRV
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] drop database link "AVDB.AVSRV"
    09-09-13 16:58:46 [INFO ] Executing SQL as [USR@SRC] select version from v$instance
    09-09-13 16:58:46 [INFO ] Return value = 11.2.0.1.0
    09-09-13 16:58:46 [INFO ] Creating DB link using AVDB.AVSRV,AVSRCUSR1,{avsrcusr_pwd},Lugaopc,1521,orcl
    09-09-13 16:58:46 [INFO ] Connecting as srcuser_ora01 to @(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))
    09-09-13 16:58:46 [INFO ] Output from SQLPlus
    09-09-13 16:58:46 [INFO ]
    09-09-13 16:58:46 [INFO ] Package created.
    09-09-13 16:58:46 [INFO ]
    09-09-13 16:58:46 [INFO ] No errors.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] Package body created.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] No errors.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] Package created.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] No errors.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] Package body created.
    09-09-13 16:58:47 [INFO ]
    09-09-13 16:58:47 [INFO ] No errors.
    09-09-13 16:58:47 [INFO ] Executing SQL as [USR@SRC] select distinct name from user_errors where name = :1
    09-09-13 16:58:47 [INFO ] Using bind value DBMS_SRC_STREAMS_COLLECTOR
    09-09-13 16:58:47 [INFO ] Return value = null
    09-09-13 16:58:47 [ERROR] could not get AV source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))
    09-09-13 16:58:47 [ERROR] ORA-01017: invalid username/password; logon denied
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:765)
        at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:414)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
        at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:162)
        at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at oracle.av.avca.jdbc.JdbcConnection.<init>(JdbcConnection.java:87)
        at oracle.av.orcldb.DAO.initConnection(DAO.java:79)
        at oracle.av.orcldb.DAO.<init>(DAO.java:64)
        at oracle.av.orcldb.commands.AddCollector.setupCollector(AddCollector.java:746)
        at oracle.av.orcldb.commands.AddCollector.execute(AddCollector.java:230)
        at oracle.av.orcldb.Command.process(Command.java:89)
        at oracle.av.orcldb.Main.process(Main.java:118)
        at oracle.av.orcldb.Main.main(Main.java:132)
    I have searched the forum to my level best without clear solution
    Regards
    Sadock

    Hi gurus
    I don't believe if this is missing solution from oracle community. I have decided to installed the collction agent and source database in linux system, so now both auditt vault server and collction agent are running in Linux system (but separately)
    I am wondering, avorcldb add_collector -srcname ORCL -agentname avagent01 -colltype DBAUD and  avorcldb add_collector -srcname ORCL -agentname avagent01 -colltype OSAUD -orclhome /u01/app/oracle/product/11.2.0/dbhome_1 are working fine and  I am able to start these collectors
    The  avorcldb verify -src Lugaosrv:1521:ORCL.LUGAOSRV -colltype ALL command also return good results
    [oracle@avsrv ~]$ avorcldb verify -src Lugaosrv:1521:ORCL.LUGAOSRV -colltype ALL
    Enter Source user name: srcuser_ora01
    Enter Source password:          
    source ORCL.LUGAOSRV verified for OS File Audit Collector collector
    source ORCL.LUGAOSRV verified for Aud$/FGA_LOG$ Audit Collector collector
    source ORCL.LUGAOSRV verified for REDO Log Audit Collector collector
    [oracle@avsrv ~]$
    The problem still I am facing is when attempting to add REDO collector. In fact the collector is added successful and i can see it even on EM console.
    [oracle@avsrv ~]$ avorcldb add_collector -srcname ORCL -agentname avagent01 -colltype REDO -av Lugaosrv:1521:ORCL.LUGAOSRV
    source ORCL verified for REDO Log Audit Collector collector
    Adding collector...
    Collector added successfully.
    remember the following information for use in avctl
    Collector name (collname): REDO_Collector
    initializing REDO Collector
    ERROR: could not get AV source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaosrv)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL.LUGAOSRV)))
    ERROR: ORA-01017: invalid username/password; logon denied
    [oracle@avsrv ~]$
    Any help will be appreciated
    Sadock

  • Error: ORA-01722: invalid number performing List of Values query.

    when i created a cascading select list, For the first time it worked properly then little later
    it is giving this error.
    Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
    could any one please solve the problem?
    2. when i run the application. in all the items edit button is automatically seen
    including in the login screen.
    could any one identify what is the error and give me a solution.

    Is this better?
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER <> -1 order by 1or
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore)

  • IR: ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier

    Hi everyone,
    has anyone else had this error which has been driving me round the bend during the last three days?
    I have an interactive report which used to work fine.
    Now it happens (when the page loads/a filter is en- or disabled) that - from time to time, but unpredictable - I receive
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    The report is based on a table function.
    I will try to set up a testcase and post the link here, but so far I haven't managed to force the error to occur.
    But maybe someone else has already bumped into this kind of error? I would be grateful for any hints!
    Best regards,
    Sabine
    Application Express 4.1.0.00.32
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

    Hi Jari,
    I changed the type definition (the return type of the table function) and extended the select list in the source of the IR.
    I do not use 'select *' but reference every column explicitly. So APEX easked me whether to add the new column.
    I also tried deleting in recreating the region, but no luck.
    Any more ideas?
    Best regards,
    Sabine

  • DBMS_LOB.ISOPEN throws the error ora-22275 invalid lob locator

    DBMS_LOB.ISOPEN throws the error below error.
    ora-22275 invalid lob locator
    The below assume that i am getting the v_lob_length as empty. But i am getting error when it comes to DBMS_LOB.ISOPEN.
    Please correct me if i am wrong.
    here is my code:
    DBMS_LOB.createtemporary(v_xml_clob, TRUE);
    DBMS_LOB.open(v_xml_clob, DBMS_LOB.lob_readwrite);
    SELECT  DBMS_XMLGEN.getxml ('SELECT object_name, object_type from dba_objects where rownum <= 5')
    INTO    v_xml_clob
    FROM    DUAL;
    v_lob_length    := NVL(DBMS_LOB.getlength(v_xml_clob),0);
    v_index       := 1;
    fnd_file.put_line(fnd_file.log,'v_lob_length : '||v_lob_length);
    WHILE v_index <= v_lob_length
    LOOP
        v_read_cnt   := 32767;
        DBMS_LOB.read (
              v_xml_clob,
              v_read_cnt,
              v_index,
              v_chunk
        fnd_file.put(fnd_file.output,v_chunk);
        v_index := v_index + v_read_cnt;
    END LOOP;
    IF DBMS_LOB.ISOPEN(v_xml_clob) = 1
    THEN
        DBMS_LOB.close(v_xml_clob);
        DBMS_LOB.freetemporary(v_xml_clob);
    END IF;

    Most likely v_xml_clob is NULL so you'd rather check IF v_xml_clob IS NOT NULL AND DBMS_LOB.ISOPEN(v_xml_clob) = 1
    THENbye
    TPD

  • Error -ORA-01483: invalid length for DATE or NUMBER bind variable

    In discoverer plus, attempt to save a discoverer workbook into the database fails with the error:
    ORA-01483 invalid length for DATE or NUMBER bind variable
    The same workbook can be safely saved in "My Computer".
    Any idea why and what is the solution.

    Why: not quite sure, probably the code is validating the workbook when it saves it to the db and you've got an error in the sql. What happens when you run the workbook that you saved to the file system? Does it show the same error when run?
    Solution: Can you post the sql in the workbook? In the meantime try the following: Replace any to_char statements around dates with to_date statements instead. For example:
    Replace:
    where to_char(mydate, 'dd-mon-yyyy') = '05-apr-2009'
    With:
    where mydate = to_date('05-APR-2009','DD-MON-YYYY')

  • Sql error ORA-00900: invalid SQL statement

    Hi All
    I am new to sql and i try to solve this issue i have here.
    where i run this query (1) i get this message : ORA-00900: invalid SQL statement
    Query : 1
    WITH t1
    AS (SELECT CID ,
    TYPE,
    TO_CHAR (
    TO_DATE ('00:00:00', 'HH24:MI:SS')
    + (lg_end_time - lg_start_time),
    'HH24:MI:SS') call_time,
    ROW_NUMBER ()
    OVER (PARTITION BY CID ORDER BY CID NULLS FIRST)
    AS call_id1
    FROM test_1
    SELECT SUM (call_time)
    FROM t1;
    output:
    i get error: ORA-01722: invalid number
    table structure:
    select * form test_1;
    CID            TYPE                      LG_END_TIME               LG_START_TIME
    1508643     Dispatching     2012/12/03 14:05     2012/12/03 14:02
    1508643     Treatment     2012/12/03 14:00      2012/12/03 14:00
    1508643     Initiation     2012/12/03 14:00     2012/12/03 14:00
    1508662     Dispatching     2012/12/03 14:18     2012/12/03 14:16
    1508662     Initiation     2012/12/03 14:01     2012/12/03 14:01
    1508662     Treatment     2012/12/03 14:02      2012/12/03 14:01
    1508643     Dispatching     2012/12/03 14:02     2012/12/03 14:00
    1508662     Dispatching     2012/12/03 14:16     2012/12/03 14:02
    thanks for all your help

    Hi All
    thanks for helping and giving your support. but the at this time question remains unanswered.
    with t1
    as (
    SELECT CID ,
                    TYPE,
                    TO_CHAR (
                         TO_DATE ('00:00:00', 'HH24:MI:SS')
                       + (lg_end_time - lg_start_time),
                       'HH24:MI:SS') call_time,
                    ROW_NUMBER ()
                       OVER (PARTITION BY CID ORDER BY CID NULLS FIRST)
                       AS call_id1
               FROM test_1
               select * from t1Output:
    CID             TYPE           CALL_TIME     CALL_ID1
    1508643     Dispatching     0:02:06     1
    1508643     Initiation     0:00:00     2
    1508643     Treatment     0:00:39     3
    1508643     Dispatching     0:02:50     4
    1508662     Treatment     0:01:03     1
    1508662     Initiation     0:00:00     2
    1508662     Dispatching     0:13:17     3
    1508662     Dispatching     0:02:43     4Desired results would be :
    group by CID and total time (summed) by each CID
    and it will also look like:
    CID             TYPE        CALL_TIME     CALL_ID1   total_time
    1508643     Dispatching     0:02:06     1
    1508643     Initiation     0:00:00     2
    1508643     Treatment     0:00:39     3
    1508643     Dispatching     0:02:50     4            
                                                                    0:05:35 
    1508662     Treatment     0:01:03     1
    1508662     Initiation     0:00:00     2
    1508662     Dispatching     0:13:17     3
    1508662     Dispatching     0:02:43     4      
                                                                    0:17:03
    Create table :
    CREATE TABLE TEST_1
    ( CID            NUMBER                         NOT NULL,
      TYPE           VARCHAR2(20 BYTE)              NOT NULL,
      LG_END_TIME    DATE                           NOT NULL,
      LG_START_TIME  DATE                           NOT NULL
    Insert statement:
        insert  into   test_1 VALUES (1508643,Dispatching,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508643,Treatment,03-DEC-12,03-DEC-12);
        insert  into  test_1 VALUES (1508643,Initiation,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508662,Dispatching,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508662,Initiation,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508662,Treatment,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508643,Dispatching,03-DEC-12,03-DEC-12);
        insert  into   test_1 VALUES (1508662,Dispatching,03-DEC-12,03-DEC-12);Edited by: 855161 on Jan 7, 2013 8:37 AM
    Edited by: 855161 on Jan 7, 2013 9:15 AM
    Edited by: 855161 on Jan 7, 2013 1:00 PM

  • Trying to produce report but have ERROR ORA-00900: invalid SQL statement

    Hi,
    I am new to Oracle so have been experimenting with a few things to get the hang of it. I have been trying to produce a report, but keep getting the error: ORA-00900: invalid SQL statement.
    This happens at my first line of code where I have COLUMN <column_name> HEADING <Heading_name>
    So I am a bit confused - is there a command that I am supposed to issue that indicates to SQL*Plus that I am trying to create a report?
    Also, if I just delete the COLUMN <column_name> HEADING <Heading_name> rows and just start at BREAK ON <column_name> SKIP 1, it produces the same error.
    I am using Oracle 8.0.6 - does this make a difference?
    Here is my code:
    COLUMN a.p_ctryid HEADING 'Country'
    COLUMN s.p_animid HEADING 'Stallion ID'
    COLUMN s.p_uname HEADING 'Stallion Name'
    COLUMN a.p_animid HEADING 'Horse ID'
    COLUMN d.p_careertp HEADING 'Career'
    BREAK ON s.p_animid SKIP 1
    BREAK ON d.p_careertp SKIP 2
    COMPUTE SUM LABEL 'Total' OF d.p_careertp ON REPORT
    SELECT DISTINCT a.p_ctryid, s.p_animid, s.p_uname, a.p_animid, d.p_careertp
    FROM p_owby.p_animal a, p_owby.p_animal s, p_owby.p_mating m, p_owby.p_anim_dtl d
    WHERE m.p_mateyr = 2001
    AND a.p_animid = d.p_animid
    AND a.p_animid = m.p_animid
    AND a.p_animid > 0
    AND s.p_animid = a.p_sire
    AND a.p_ctryid IN('GB','IRE')
    GROUP BY a.p_ctryid, s.p_animid, s.p_uname, d.p_careertp, a.p_animid
    ORDER BY a.p_ctryid, s.p_animid, d.p_careertp
    Any help would be greatly appreciated!
    Thanks in advance!

    You are trying to do COMPUTE SUM ... ON REPORT but there is no BREAK ON REPORT specified. The computed sum will not be shown unless you also break on report. see below demonstration. first select has no sum even though we have specified COMPUTE. The second select shows the sum since now we have done break on report.
    SQL> compute sum of sal on report
    SQL> select * from scott.emp order by empno ;
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10
    14 rows selected.
    SQL> break on report
    SQL> select * from scott.emp order by empno ;
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10
    sum                                                         29025
    14 rows selected.
    SQL>

  • GROUP BY with parameter - cause error -ORA-00979: not a GROUP BY expression

    I generate a query via PreparedStatement. For example:
    SELECT when, value FROM test GROUP BY ?;
    PrepState.toString(1, "when");
    That causing error: ORA-00979: not a GROUP BY expression
    My application using query like:
    SELECT to_char(data,1), SUM(vlue) as sum FROM test GROUP BY to_char(data, 2);
    PrepState.toString(1, "YYYY-MM");
    PrepState.toString(2, "YYYY-MM");

    Ah. Reproduced in the first chunk of PL/SQL below.
    The second chunk is a workaround.
    Basically, SQL is parsed by the syntax engine and optimizer to get an execution plan. Then you can have a sequence of "bind, execute, fetch, fetch, fetch..., bind, execute..."
    Since you can have multiple binds for a single SQL parse, then the fact that the first set of binds all happen to have the same value doesn't mean the next set will.
    The optimizer needs to be 100% sure that the value in the select must always be the same as the value in the group by, so you can't have two separate (and therefore potentially different) bind variable mappings. [Given the right circumstances, the optimizer might do all sorts of tricks, such as using materialized views and function-based indexes.]
    Misleadingly, it actually fails on the 'EXECUTE' step of DBMS_SQL rather than the PARSE.
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,:b1), count(*) '||
        ' from user_objects u '||
        ' group by to_char(created,:b2) '||
        ' order by to_char(created,:b3)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b2', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b3', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,f.fmt), count(*) '||
        ' from user_objects u, (select :b1 fmt from dual) f '||
        ' group by to_char(created,f.fmt) '||
        ' order by to_char(created,f.fmt)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    /

  • Error ORA-01722: invalid number

    Hi,
    I am using Apex 3.2 on Oracle 11g (Enterprise Edition).
    I am new to Apex and I am using an imported application and editing its features to match my requirements.
    While uploading a CSV file, I am getting error as :ORA-01722: invalid number"
    Can someone help me where I am wrong or where I need to modify something?
    Thanks in advance.
    Regards
    Sharath

    Hi Littlefoot,
    Another set of information which I felt could be useful.
    In "Home>Application Builder>Application 1000>Page 71>Edit Page Process", under the tab 'Source', I could see the below code. I think I need to make changes here. Please correct me if I am wrong here.
    I need your help to modify this code (as this is an imported application, this code might be written keeping in mind the previous application).
    --PLSQL code for uploading server details
    DECLARE
    v_blob_data      BLOB;
    v_blob_len      NUMBER;
    v_position      NUMBER;
    v_raw_chunk      RAW(10000);
    v_char           CHAR(1);
    c_chunk_len           NUMBER:= 1;
    v_line           VARCHAR2 (32767):= NULL;
    v_data_array      wwv_flow_global.vc_arr2;
    v_rows           NUMBER;
    v_count           NUMBER;
    --for editing
    v_sr_no          NUMBER:=1;
    v_last_char          varchar2(2);
    BEGIN
    -- Read data from wwv_flow_files
    SELECT blob_content INTO v_blob_data FROM wwv_flow_files
    WHERE last_updated = (SELECT MAX(last_updated) FROM wwv_flow_files WHERE UPDATED_BY = :APP_USER)
    AND id = (SELECT MAX(id) FROM wwv_flow_files WHERE updated_by = :APP_USER);
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- For removing the first line
    WHILE ( v_position <= v_blob_len )
    LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    EXIT;
    END IF;
    END LOOP;
    -- Read and convert binary to char
    WHILE ( v_position <= v_blob_len )
    LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    --removing the new line character added in the end of each line
    v_line := substr(v_line, 1, length(v_line)-2);
    --removing the double quotes
    v_line := REPLACE (v_line, '"', '');
    --For checking the absense of data in the end of line
    v_last_char:= substr(v_line,length(v_line),1);
    IF v_last_char = CHR(44) THEN
         v_line :=v_line||'-';
    END IF;
    -- Convert each column separated by , into array of data
    v_data_array := wwv_flow_utilities.string_to_table (v_line, ',');
    -- Insert data into target tables
    --Checking whether the data already exist
    SELECT COUNT(SERVERID) INTO v_count FROM REPOS_SERVERS WHERE SERVERNAME=v_data_array(1);
    IF v_count = 0 THEN
    EXECUTE IMMEDIATE 'INSERT INTO
    REPOS_SERVERS (SERVERID,SERVERNAME,IPADDRESS,OS,SERVER_MODEL,CPU,MEMORY,PLATFORM_TYPE, MACHINE_TYPE,CLUSTERED,LAST_UPDATE_BY,LAST_UPDATE_DATE,REMARKS) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13)'
    USING
    SERVERS_SEQ.NEXTVAL,
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4),
    to_char(NVL(v_data_array(5),NULL)),
    v_data_array(6),
    v_data_array(7),
    v_data_array(8),
    v_data_array(9),
    v_data_array(10),
    v_data_array(11),
    v_data_array(12);
    END IF;
    -- Clearing out the previous line
    v_line := NULL;
    END IF;
    END LOOP;
    END;
    Regards
    Sharath

  • How to resolve error ORA-29491: invalid table for chunking?

    Hello,
    I'm trying to implement DBMS_PARALLEL_EXECUTE to speed up a huge update I need to do. I'm stuck on a problem with the table I'm using to test my procedure. Here's a simple test that produces the same error. As best I can tell, the table I'm declaring here is missing some kind of requirement that lets DBMS_PARALLEL_EXECUTE make use of it, but the docs and searching for the error code haven't turned up any useful discussions. Please help.
    drop table owner.why_cant_i_hold;
    create table owner.why_cant_i_hold (
    things VARCHAR2 (64),
    amount INT,
    CONSTRAINT why_cant_i_pk PRIMARY KEY (things)
    insert into why_cant_i_hold values ('limes', 8);
    insert into why_cant_i_hold values ('lemons', 8);
    insert into why_cant_i_hold values ('watermelons', 5);
    insert into why_cant_i_hold values ('cats', 4);
    insert into why_cant_i_hold values ('teacups',10);
    insert into why_cant_i_hold values ('mugs', 5);
    insert into why_cant_i_hold values ('eggs', 15);
    insert into why_cant_i_hold values ('jobs', 3);
    commit;
    -- got tasks?
    COLUMN task_name FORMAT A10
    SELECT task_name,
    status
    FROM user_parallel_execute_tasks;
    --exec DBMS_PARALLEL_EXECUTE.CREATE_TASK('holding');
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'why_cant_i_hold', true, 3);
    It seems like a really simple case here. The output is all successful until
    "Error starting at line 25 in command:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'owner', 'why_cant_i_hold', true, 3);
    Error report:
    ORA-29491: invalid table for chunking
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 27
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 121
    ORA-06512: at line 1"

    Oh. This was an easy one, table names are never really lower-case. Changing the value in my chunking call fixed the simple test:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'WHY_CANT_I_HOLD', true, 3);
    It doesn't help with why my more complicated test case isn't working, but I have details to check before I ask again.
    EDIT: lesson learned... 'invalid table' doesn't mean the database can find the table you are talking about at all. I hope that's a help.
    Edited by: user519442 on Nov 16, 2011 12:33 PM

  • Insert into table error - ora-01722 invalid number

    Need some assistance with inserting data into a table. The date column keeps on failing to insert.
    here is my insert statement
    insert into tab_mod_history (TABLE_OWNER, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, INSERTS, UPDATES, DELETES, TIMESTAMP, TRUNCATED)
    values ('$i_owner','$i_table','$i_part_name','$i_subpart_name','$i_ins','$i_upd','$i_del','$time','$trunc');Script loads data for partition tables, but not normal tables with the timestamp column
    I select the data using this select statement:
    select table_owner, table_name, partition_name, subpartition_name, inserts, updates, deletes, timestamp, truncated
    from dba_tab_modifications
    where table_owner in ('scott','MAC')
    order by table_name;

    ok here are the errors:
    values ('MAC','WC_MST','11','1','1','12/04/2011','NO','','')
    ERROR at line 2:
    ORA-01722: invalid number
    Session altered.
    values ('MAC','WF_05A','208','128','208','18/02/2011','NO','','')
    ERROR at line 2:
    ORA-01722: invalid numberHere is the table structure
    SQL> desc tab_mod_history
    Name                                      Null?    Type
    TABLE_OWNER                                        VARCHAR2(30)
    TABLE_NAME                                         VARCHAR2(30)
    PARTITION_NAME                                     VARCHAR2(30)
    SUBPARTITION_NAME                                  VARCHAR2(30)
    INSERTS                                            NUMBER
    UPDATES                                            NUMBER
    DELETES                                            NUMBER
    TIMESTAMP                                          DATE
    TRUNCATED                                          VARCHAR2(3)
    DROP_SEGMENTS                                      NUMBERI used the column names to create the variables..that is why $time was used.
    How else could I have done it????
    thought this was easy..but to my dismay...

  • Deployment error: ORA-01017: invalid username/password; logon denied

    Hi,
    I created a new target schema against an existing runtime owner user id and runtime access user id.
    But deploying the mapping now gives error as follows:
    <<ORA-01017: invalid username/password; logon denied>>
    Can you please guide where the problem is?
    Thanks & Regards,
    Lenin

    Hi,
    Just to add some more informations about this topic. I created one extra target schema for the same runtime user id/runtime access user. And then tried to deploy the mapping and got the above error. And again, I removed the older target schema by using "OWB Runtime Assistant". And then tried to deploy mapping again and got the same error again.
    Can you please help me out in this case?
    Thanks & Regards,
    Lenin

  • BC4J VSM on OC4J 10.1.2 - jdbc error ORA-00911: invalid character

    Hello,
    I have been trying to run the Virtual Shopping Mall application on OC4J Standalone 10.1.2. I have deployed the application from a JDeveloper 10.1.2 release. When i try to login the OC4J log presents the following information and login fails:
    C:\oracle\oc4j_1012\j2ee\home>java -jar oc4j.jar
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Statement: SELECT Users.USER_NAME, Users.FIRST_NAME, Users.LAST
    NAME,          Users.EMAIL, Users.ADDRESS, Users.CITY,
    Users.STATE, Users.COUNTRY, Users.ZIP, Users.PHONE,
    Users.ROLE, Users.PASSWORD, Users.CARD_PROVIDER,
    Users.CARD_NUMBER, Users.CARD_EXPIRY_DATE FROM USERS Users WHERE (USER
    _NAME=?)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java...
    which has a root cause of:
    ## Detail 0 ##
    java.sql.SQLException: ORA-00911: invalid character
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :137)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:625)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
    java:181)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPrepa
    redStatement.java:661)
    I've read some posts that suggest it could be the jdbc driver or the 'use ? style variables' option on the view definition. Your assistance is appreciated.
    Thanks
    David

    Thanks Luke,
    I changed
    vo.setWhereClause(" USER_NAME=?");
    to
    vo.setWhereClause(" USER_NAME=:0");
    And that particular segment worked as expected.
    Thanks
    David

  • Error: ORA-00920: invalid relational operator (WWV-16016)

    Hi,
    When I try to query in the form, I'm getting the following error
    An unexpected error occurred: ORA-00920: invalid relational operator (WWV-16016).
    The form has a field of type varchar2 with lov attached to it. This error is happening only if I enter characters more than 40 or select a value which has more than 40 characters from the lov.
    Anbody had this problem?..Is there a solution for this?..Help would be appreciated.
    Thanks
    PJ

    I figured out the problem and it seems like if the value has any 'IN' or 'BETWEEN' and try to query this error is happening and it's not because of character length. I think Portal assumes that relational operator is entered and tries to query based on those words. Is it a bug in the Portal?..
    Thanks
    PJ

Maybe you are looking for

  • IPhoto Crashes all of the time. Attached Error Log. Please help?

    Attached is the error log. I've tried creating a new library and running disk utility. iPhoto crashes after a few minutes of use, especially when trying to edit photos. Any advice? The crashing is chronic and has occured for some time now (months). P

  • PSE9 Organizer crashes during playing of slide show

    I've upgraded from PSE6 to PSE9. PSE9 reported no failures when converting my PSE6 catalog. When I open the organizer, all looks fine. If I go to full screen on a photo, then click play to run a slide show, the organizer works fine for a while, then

  • Getting ORA-00600 when using table functions

    Hello, I am trying to use simple table function: create or replace type StatCall AS OBJECT ( dial_number varchar2(255), start_date date, duration number(20) create or replace type StatCallSet AS TABLE OF StatCall; create or replace package ref IS typ

  • Selecting physical channel from list with DAQmx

    I'm trying to write a simple VI for reading and writing digital data. However, when I have a DAQmx physical channel control, the only options it presents to me are the various analog inputs (and doesn't allow me to type in the port I actually want to

  • How to process such kind of XML data?

    Hi gurus, I need your help in processing this kind of XML data. Please note the ns# value can go up all the way to the 1000's. Thanks. <AllStatuteQueryResponse xmlns="http://crimnet.state.mn.us/mnjustice/statute/service/3.0"> <ns1:Statutes xmlns:ns1=