Oracle Database Cache Concepts and Administration Guide Release 1.0.2.1 Part Number A88706-01 |
|
Oracle Database Cache improves the scalability and performance of applications that access Oracle databases by caching frequently used data on a middle-tier system. With Oracle Database Cache, your applications can process several times as many requests as their original capacity. In addition, you do not need to modify your existing applications to use Oracle Database Cache. Oracle Database Cache is transparent to your end users.
If your applications meet the following criteria, you can use Oracle Database Cache to boost the scalability of your Web sites and the performance of your applications:
Many applications meet these characteristics, including e-business and content publishing applications.
Oracle Database Cache maintains a cache of frequently requested data on the middle tier (the Web server or application server tier), and it processes read-only requests using this dynamic cache.
Oracle Database Cache provides performance and scalability benefits by:
There is no need to modify your existing applications or your existing databases to achieve these benefits.
In a traditional multiple-tier environment running Web applications, the client (typically a Web browser) displays HTML or XML sent by an application running on the middle tier (usually a Web or application server). The middle tier gathers the information from the database server and translates the information into an HTML or XML page that can be displayed by the client. The database server tier stores, searches for, and retrieves data. The following figure shows an example of this Web-based, traditional, multiple-tier environment:
In this environment, each user executes a database request using a distinct path from the Web browser through the Web server to the database, even if more than one user is requesting the same information. For example, assume that your database contains information about books, such as the book title, author, description, and ranking in a best-seller list. If User A and User B both request the list of the top 10 mystery books, each user's request is routed through the application or Web server to the database on the database server. For each user, the database server returns the data through the application or Web server, which sends it to the Web browser for display. Each user receives a separate copy of the data. Later, if User A makes the same request, it is routed once again through the application or Web server to the database on the database server.
Other types of applications, such as content publishing, running in a multiple-tier environment, function in a similar way.
Using Oracle Database Cache, you can store frequently requested data on the Web or application server tier. The requests of User A and User B from the client tier are routed to the cache on the middle tier, which returns the data. The following figure shows the multiple-tier environment using Oracle Database Cache:
In this environment, Oracle Database Cache software, consisting of a middle-tier cache for storing data and intelligent software to route queries, resides on each Web or application server on the middle tier. Frequently accessed data is stored in the middle-tier cache. The origin database (on the database tier) is the original and primary storage for the data. For this release, a middle-tier cache can cache data from only one origin database.
When users request the frequently accessed data, the requests pass from the client, such as a Web browser, to the Web or application server, which returns the data. For example, assume you cache information about books, such as the book title, author, description, and ranking in a best-seller list, in the middle-tier cache. If User A and User B both request the list of the top 10 mystery books, each user's request is routed to the middle-tier cache. Because the data is stored on the same tier, the application returns the data quickly and does not need to pass the request to the origin database server for retrieval of the data. Furthermore, each user can click on one of the titles to get more detailed information about the book. The query is routed to the middle-tier cache, which returns the data quickly.
Oracle Database Cache provides a middle-tier cache for storing data and an easy-to-use management interface for managing the Oracle Database Cache environment. Oracle Database Cache caches and manages data in entities called data sets. A data set is any collection of data items that can be expressed using a SQL SELECT statement. A data set can be a table or any subset of a table, or data from more than one table.
Oracle Database Cache also provides components that transparently route queries to the middle-tier cache, enforce data caching policies, and store statistics about cache hits and misses. A hit is a query that was satisfied in the middle-tier cache. A miss is a query that could not be satisfied in the cache and that was routed to the origin database. Oracle Database Cache provides transparent connectivity to the origin database.
You use a Java-based interface, Cache Manager (a component of DBA Studio), to set up and manage your Oracle Database Cache environment. When you set up a middle-tier cache, you specify the origin database, the data sets (or tables) to be cached, and cache properties, such as memory allocation, disk space, and the synchronization policy. The synchronization policy establishes how and how often the data in the cache is refreshed from the origin database.
The following figure illustrates the Oracle Database Cache environment in more detail:
Oracle Database Cache maintains a history of queries and, based on that history, intelligently routes queries either to the middle-tier cache or to the origin database. It also maintains statistics about the queries. These statistics are accessed by all clients attached to a particular middle-tier cache.
When a user requests data, Oracle Database Cache checks to see if the query has been executed previously. If it has and if the history indicates that the data is not found in the middle-tier cache, Oracle Database Cache immediately routes the request to the origin database, which returns the data, through the Web or application server, to the user.
If the query has not been executed previously, Oracle Database Cache attempts to execute the query using the middle-tier cache. If the query can be satisfied on the middle-tier cache, Oracle Database Cache returns the data from the middle-tier cache to the user. (Note that a query may return no data, as when a user requests books by an author whose information is not stored in the database. In this case, the query is regarded as being satisfied by the cache.) If the query cannot be satisfied by the cache, Oracle Database Cache routes the request to the origin database, which returns the data, through the Web or application server, to the user. In either case, Oracle Database Cache records information about the query.
If the request is an insert, update, or delete, rather than a query, Oracle Database Cache immediately routes the request to the origin database.
If the request is a PL/SQL subprogram (procedure or function) or anonymous block or a call to a PL/SQL stored package, function, or procedure and if routing of PL/SQL is enabled, Oracle Database Cache attempts to execute the request. If Oracle Database Cache encounters an insert, update, or delete request, the request fails and Oracle Database Cache routes the request to the origin database.
Cache Manager helps you monitor the ratio of hits to misses. You can use this information to assess whether you are caching the appropriate data sets, you need to cache additional data sets, or you need to drop the currently cached data sets and cache different data sets.
You do not need to modify your applications to take advantage of the benefits of Oracle Database Cache. You only need to configure the environment of your applications, as described in "Configuring Your Application Environment". Applications that use SQL statements to access the database are routed to the middle-tier cache automatically. Similarly, applications that are linked with OCI using dynamic libraries and layered directly on OCI are routed to the middle-tier cache automatically. (Applications layered directly on OCI are those applications that call OCI directly or use ODBC, JDBC, or other interfaces that call OCI directly.)
Note that applications must use OCI in threaded mode. If they do not, refer to "Applications Must Be Linked in Multithreaded Mode" for information about linking in multithreaded mode.
Applications that are linked with OCI using static libraries and layered directly on OCI require that you relink those applications with the OCI library that ships with Oracle Database Cache. See "Linking Applications That Use Static OCI Libraries" for more information.
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|