Oracle 23ai DB new feature - True Cache
Oracle Database 23ai has come up with many new feature. One of the important feature is True cache. In general Database comes with many cache like DB Buffer cache, Library cache, Redo log Buffer cache, PL/SQL Function result cache, Smart Flash cache, SubQuery caching, In Memory option. All the said caches above are built within the cache. True cache is different from these cache. It is getting build outside of database.
True cache is a read only instance and its has its own
buffer. It will collect the data from the source database and keeps updating
the data to maintain sync with original data located in the source
database. The read only instance can be at source location or it can be at location closer to the customer region.
For example the database holds data of multiple region customers and database connection will be happening from different parts of the world. We need to provide same database performance to all customers. For application we have seen Redis cache which does this activity. But for database we need similar caching concept to aggregate database retrieval performance which is provided by True cache.
Consider the above scenario. Database is physically located in US and it is accessed by APAC customers. The data retrieval and performance should not be affected because of the distance between customer location and database. So we need to cache the data in APAC region. But we need only APAC region customer's data. So caching needs to be done for subset of data. Also the cached data should be read consistent and also updates happening in Main database should be reflected immediately in Cache.
True cache provides all the above features. It may look similar to Active Data Guard. But it is different.
True cache Installation
True cache can be installed either using DBCA or Manual method.
DBCA:
For configuring True cache first we need to collect details of Primary or Source database and configure True cache using the collected details. We call the Primary database details as Blob. Kindly note it is not related to Blob data type 😀
First step is generating BLOB from source database.
$ORACLE_HOME/bin/dbca -configureDatabase -prepareTrueCacheConfigFile -sourceDB <primary_db_sid_or_db_unique_name> -trueCacheBlobLocation <primary_db_config_blob_path> -silent
PrepareTrueCacheConfig parameter directs DBCA to create Blob at the location mentioned in trueCacheBlobLocation parameter. DBCA will package the password file (and optional TDE wallet) into a configuration BLOB file.
Once the blob got created, it can be copied to True cache instance creation location. It could be local or remote.
$ORACLE_HOME/bin/dbca -createTrueCache -gdbName true_cache_global_name -sid true_cache_sid -sourceDBConnectionString primary_db_easy_connect_string -trueCacheBlobFromSourceDB true_cache_config_blob_path -sgaTargetInMB sga_memory_size -pgaAggregateTargetInMB pga_memory_size -tdeWalletLoginType AUTO_LOGIN -listeners listener_name -silent
trueCacheBlobFromSourceDB parameter denotes the location of copied BLOB file.
sourceDBConnectionString parameter looks for Primary database connection string
True cache is an instance and requires SGA and PGA which can be specified through parameters.
sgaTargetInMB, pgaAggregateTargetInMB
Manual Method
The steps are similar to physical standby creation. Copy password file and init parameter file to True cache instance. At true cache instance, the init parameter file will have entries similar to physical standby database. db_name, db_unique_name, fal_server, fal_client, instance_name, local_listener, remote_listener, sga_target parameters to be specified.
true_cache=true ===> Additional parameter to enable True cache behavior.
Configure local listener at primary and true cache (static entry in listener.ora file) instance to establish the connectivity.
Connect to the True Cache instance using SQL*Plus:
sqlplus / as SYSDBA
Start the instance in NOMOUNT state using the PFILE:
STARTUP NOMOUNT PFILE=<path_to_init_parameter_file>;
Create the True cache. This step will create the control files, mount the instance, and start the database in read-only mode.
SQL> CREATE TRUE CACHE;
Additional Configuration:
Create standby redo logs to receive redo log entries from the primary database.
Update the LOG_ARCHIVE_DEST parameter in the primary database to configure the destination for redo log transmission.
No comments:
Post a Comment