Fix ORA-30052: invalid lower limit snapshot expression

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Error Description:
Oracle flashback transaction version query failing with following error message.
SQL> SELECT *
FROM dept
VERSIONS BETWEEN TIMESTAMP
      TO_TIMESTAMP('2014-07-14 14:12:00')
  AND TO_TIMESTAMP('2014-07-14 14:26:01')   ;
FROM dept
     *
ERROR at line 2:
ORA-30052: invalid lower limit snapshot expression
 
Solution Description:
Check your UNDO_RETENTION parameter value. In flashback version query you can query only during the transaction between the undo retention period. See an example below.

SQL>show parameter undo_retention
NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------------------
undo_retention                       integer     900
 
Undo retention is 15 minutes and the system time is 2:26PM. So the first query won’t work because the time period is more than undo retention. The second query will work as the time period is within the undo retention.

SQL> !date
Mon Jul 14 14:26:32 CEST 2014
 
SQL> SELECT *
FROM dept
VERSIONS BETWEEN TIMESTAMP
      TO_TIMESTAMP('2014-07-14 14:10:00')
  AND TO_TIMESTAMP('2014-07-14 14:26:01')   ;
FROM dept
     *
ERROR at line 2:
ORA-30052: invalid lower limit snapshot expression
 
SQL> SELECT *
FROM dept
VERSIONS BETWEEN TIMESTAMP
      TO_TIMESTAMP('2014-07-14 14:12:00')
  AND TO_TIMESTAMP('2014-07-14 14:26:01')   ;
    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
         40 OPERATIONS     BOSTON

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer