Tuesday, 23 July 2024

Oracle True Cache 23c

 What is Oracle True Cache


A feature introduced in Oracle Database 23c that aims to optimize the management of cache memory within the database system. It intelligently manages the database buffer cache, ensuring that critical data is readily available while less critical data is efficiently managed. This leads to improved performance, reduced latency, and better overall resource utilization.
    
    



  Assumption:- If we are reading this, then we know what is Physical Standby Database. 

            True cache has its on control file, spfile and Standby Redo logs 

E.g 

Primary control file size:

  -rw-r-----. 1 oracle dba    56344576 Jul 23 13:37 control01.ctl

 

True Cache control file size:

-rw-r-----. 1 oracle oinstall 10133504 Jul 23 13:34 o1_mf_m5z7jxv8_.ctl


Application Connection Modes:

Application can connect in two ways:

#1 Dedicated connection to True Cache and Primary
   - In this all the API, tools are supported to connect




2. One logical connection:  In this app uses one connection logically, but transactions are redirected to PRIMARY ( for read+write transactions) and True Cache ( for read transactions) 

In this mode, currently only JDBC driver 23.3+ is supported.



Application needs to use these two setting at JDBC level:

useTrueCacheDriverConnection=true
setReadOnly = true  <-  App team need to set this flag  just before the READ ONLY ( SELECT ) transaction 


How to Configure True Cache:

Create SPFILE having some parameters:

True_Cache=True  <-- mandatory and new parameter 
TRUE_CACHE_SIZE
fal_server
fal_client
local_listener
remote_listener
SGA_MAX_SIZE
SGA_TARGET

SQL> Startup nomount;
SQL> create true cache;