tags:

views:

33

answers:

1

Hi All,

After how much time oracle itself closes an explicitly defined cursor?

+3  A: 

Hi Sachin,

Oracle won't close your cursor unless you explicitely ask for it. You can open a cursor on an inactive table, wait for 24 hours then fetch rows from the cursor.

On active tables (tables that may be updated/deleted/inserted), you may run into ORA-1555 after a while (the table has been modified and the information to reconstruct old versions of the blocks has been overwritten). If your UNDO tablespace is set as AUTOEXTEND, you can safely fetch from any cursor opened less than UNDO_RETENTION seconds ago:

SQL> show parameter undo_retention

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------
undo_retention                       integer     900

On my DB I can safely fetch from cursors for 900 seconds (15 mins). This is a low threshold (Oracle will keep sufficient data to reconstruct old versions of blocks for at least 15 minutes).

Vincent Malgrat
Thanks for thr information
Sachin Chourasiya