To answer your question, I'm going to assume that you are asking about PL/SQL record variables...not records inserted into tables.
Here's the general rule of thumb regarding SGA (and PGA) memory usage.
- When a package is first instantiated, the package p-code is read from disk and put into the shared pool in the SGA. This can be "aged out" if space is needed in the SGA and thus may require reloading.
- Packaged variables (such as PL/SQL record variables) and cursors are kept in session memory in the PGA. These items will persist for the life of the session.
Packages marked with the PRAGMA SERIALLY_REUSABLE will be kept in the SGA rather than the PGA and will last only for each database call.
For More Information
- Dozens more answers to tough Oracle questions from Karen Morton are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
This was first published in July 2002