2.2.3 Configuring True Cache Database Application Services with DBCA
To use True Cache with the JDBC Thin driver, for each primary database application service that you want to cache, create a corresponding True Cache database application service.
This makes it easy for applications to switch an
existing JDBC connection from a primary database to True Cache without having to
change the JDBC connection URL. This is possible with the 23ai JDBC Thin driver by
setting the ReadOnly
parameter of the connection to
TRUE
or FALSE
.
On the primary database, complete the following steps:
-
Configure the remote listener.
Note:
Check to see if Valid Node Checking for Registration (VNCR) is configured for the listener. If so, add True Cache to theREGISTRATION_INVITED_NODES_LISTENER
parameter in thelistener.ora
file of the remote listener.Note:
For Oracle RAC primary databases, add the True Cache node to the invited node list for the SCAN listener by using the
srvctl
command line utility. (Don't manually edit thelistener.ora
file as the grid owner user.)For example:
srvctl modify scan_listener -invitednodes true_cache_host -endpoints TCP:port
-
Create and start a primary database application service to use with the True Cache service, and then verify that the service is running.
Choose one of the following options based on the primary database configuration:
-
For single instance primary databases, use the
DBMS_SERVICE
PL/SQL package. For services that are specific to a pluggable database (PDB), connect to the specific PDB, or set the correct PDB container in your session before starting the service usingDBMS_SERVICE
.Here's an example using the
DBMS_SERVICE
package for a single instance primary database:BEGIN DBMS_SERVICE.CREATE_SERVICE('SALES', 'SALES'); DBMS_SERVICE.START_SERVICE('SALES'); END; / PL/SQL procedure successfully completed.
SELECT service_id, name, true_cache_service FROM v$active_services WHERE name='SALES'; SERVICE_ID NAME TRUE_CACHE_SERVICE ---------- ------------------ ------------------ 6 SALES // TRUE_CACHE_SERVICE will be filled in by this (dbca -configureTrueCacheInstanceService) command
-
For Oracle RAC primary databases, use the
srvctl
command line utility with the-true_cache_service
option. Start the service on the primary instance. Usesrvctl
only for clusterware-managed instances.srvctl add service -db primary_db_unique_name -service primary_db_service_name -preferred primary_db_instance_list -pdb primary_pdb_name -true_cache_service true_cache_service_name
For example:
srvctl add service -db primdb1i -service sales -preferred primdb1i1,primdb1i2 -pdb sales_pdb -true_cache_service sales_tc
-
-
Run the
dbca -configureDatabase
command with the-configureTrueCacheInstanceService
parameter to configure True Cache.This configures the True Cache database application service on the primary database and then starts the True Cache service on True Cache. Run this command for each True Cache database application services.
Note:
The primary database application service must already exist before you run this command.Note:
For a uniform True Cache configuration with multiple True Caches serving the same service, DBCA starts the service on the first True Cache and then you manually start the service on the other True Caches.ORACLE_HOME/bin/dbca -configureDatabase -configureTrueCacheInstanceService -sourceDB primary_db_sid_or_db_unique_name -trueCacheConnectString true_cache_easy_connect_string -trueCacheServiceName true_cache_service_name -serviceName primary_db_service_name -pdbName primary_pdb_name -silent
Example:
$ORACLE_HOME/bin/dbca -configureDatabase -configureTrueCacheInstanceService -sourceDB primdb1i -trueCacheConnectString tc.example.com:1522/tcdb1.example.com -trueCacheServiceName sales_tc -serviceName sales -pdbName sales_pdb -silent
For descriptions of the parameters, see configureDatabase.
-
After the database application service starts on True Cache, use the
lsnrctl
command to validate the remote listener services for the True Cache service registration. -
For a uniform True Cache configuration with multiple True Caches serving the same service, start the service on all additional True Caches. For example:
EXEC DBMS_SERVICE.START_SERVICE('SALES_TC');