Home arrow Oracle arrow Page 3 - Generic Architecture for Caching Table Data: Keeping It Real (and Small)

Showing the cache content - Oracle

In the third installment of this series we will add some more functionality to the cache that will alleviate some of the drawbacks that we discussed in earlier articles.

TABLE OF CONTENTS:
  1. Generic Architecture for Caching Table Data: Keeping It Real (and Small)
  2. Limit the size of the cache
  3. Showing the cache content
  4. Conclusion
By: Mark Vilrokx
Rating: starstarstarstarstar / 4
October 25, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Another useful ability is to be able to see what is actually stored in the cache, so we will create a log_cache procedure:

   PROCEDURE log_cache
   AS
      l_cache_idx   PLS_INTEGER;
   BEGIN
      l_cache_idx := g_dept_cache.FIRST;
      DBMS_OUTPUT.put_line ('Name           Location');
      DBMS_OUTPUT.put_line ('-------------- -------------');
      <<all_records_in_cache>>
      LOOP
         EXIT all_records_in_cache WHEN NOT g_dept_cache.EXISTS
(l_cache_idx);
         DBMS_OUTPUT.put_line (   LPAD (g_dept_cache
(l_cache_idx).NAME, 14)
                               || ' '
                               || LPAD (g_dept_cache
(l_cache_idx).LOCATION,
                                        13
                                       )
                              );
         l_cache_idx := g_dept_cache.NEXT (l_cache_idx);
      END LOOP all_records_in_cache;
   END log_cache;

I am sending the output of this procedure to the screen, but you might have another mechanism for this, e.g. maybe you log trace messages in a trace table.  You can modify the procedure to use your own logging mechanism.  It is always very handy to be able to peek into the cache, especially when you are debugging.



 
 
>>> More Oracle Articles          >>> More By Mark Vilrokx
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: