Thursday, January 3, 2013

duration not active: A Tale of Two Articles

From time to time I snoop around our DB log files to see if anything is going on with the system, and the other day I found this:

Errors in file <filename>:
ORA-21779: duration not active

Now, I've never seen this before so I go to the Oracle authority MetaLink (or My Oracle Support as it's known now) to find two completely different articles which illustrate probably how many people they have working at Oracle more than anything else.

A helpful article:

What Does Error "ORA-21779 Duration Not Active" Mean? [ID 1084474.1]

Goal
What Does Error "ORA-21779 Duration Not Active" Mean?

Solution
The error "ORA-21779 Duration Not Active" is caused by some process trying to clean up an object from memory.

Duration is the amount of time a object is in memory.  If an object in memory is accessed and its duration is inactive state or not found then the ORA-21779 message is returned.

Each memory chunk is associated with a duration. This allows clients to automatically free all memory associated with a duration (at the end of the duration).  The duration determines the heap that is used to allocate the memory.

The allocation duration is set when an object is created with OCIObjectNew(), and the pin duration is set when an object is pinned with OCIObjectPin().  The datatype of the duration value is OCIDuration.

When an object reaches the end of its allocation duration, it is automatically deleted and its memory can be reused.  The pin duration indicates when an object's memory can be reused, and memory is reused when the cache is full.

There are various predefined types of durations supported on memory and context management calls.

OCI_DURATION_CALL. The duration of this operation is that of a callout.

OCI_DURATION_STATEMENT. The duration of this operation is the external row source.

OCI_DURATION_SESSION. The duration of this operation is the user session.

OCI_DURATION_PROCESS. The duration of this is agent process.

See following docs with regards to durations
Oracle Call Interface Programmer's Guide, 10g Release 2 (10.2), Part Number B14250-02
Oracle Database Data Cartridge Developer's Guide,10g Release 2 (10.2), Part Number B14289-02

A not so helpful article:

OERR: ORA-21779 duration not active [ID 49397.1]
Error: ORA-21779
Text: duration not active
---------------------------------------------------------------------------
Cause: User is trying to use a duration that has been terminated.
Action: User should avoid performing such operation.

Seriously, that's all the second article has for content!  And.......ANNNND.....it was last updated 6 months ago.  So it was.....added to?

Annnnyways, the first article does give me some idea of what was going on but not why or what was happening so I'll need to keep my eyes peeled to try and see this in action next time!

No comments:

Post a Comment