oracle-true-cache-users-guide
oracle-true-cache-users-guide
23ai
F77385-07
October 2024
Oracle Database Oracle True Cache User's Guide, 23ai
F77385-07
This software and related documentation are provided under a license agreement containing restrictions on use and
disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or
allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit,
perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation
of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find
any errors, please report them to us in writing.
If this is software, software documentation, data (as defined in the Federal Acquisition Regulation), or related
documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then
the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any
programs embedded, installed, or activated on delivered hardware, and modifications of such programs) and Oracle
computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial
computer software," "commercial computer software documentation," or "limited rights data" pursuant to the applicable
Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction,
duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle
programs (including any operating system, integrated software, any programs embedded, installed, or activated on
delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle
data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms
governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services.
No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not
developed or intended for use in any inherently dangerous applications, including applications that may create a risk of
personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all
appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its
affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle®, Java, MySQL, and NetSuite are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used
under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo
are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open
Group.
This software or hardware and documentation may provide access to or information about content, products, and
services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all
warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an
applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss,
costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth
in an applicable agreement between you and Oracle.
Contents
Preface
Documentation Accessibility vii
Related Documents vii
Conventions vii
iii
2.3.2.2 Configure and Start the Local Listener on the True Cache Node 2-14
2.3.2.3 Copy the Password File or Wallet from the Primary Database to the True
Cache Node 2-14
2.3.2.4 Prepare a PFILE for True Cache 2-15
2.3.2.5 Create and Start True Cache 2-18
2.3.3 Configuring True Cache Database Application Services Manually 2-18
2.3.3.1 Create Database Application Services on the Primary Database 2-19
2.3.3.2 Verify That the Database Application Services Are Created 2-21
2.3.3.3 Start the Database Application Services 2-21
2.4 Deploying True Cache for an Oracle RAC Primary Database 2-22
2.5 Verifying the True Cache Configuration 2-24
2.5.1 Verifying That True Cache Is Working as Expected 2-24
2.5.2 Verifying the Remote Listener Configuration 2-25
2.5.3 Verifying the True Cache and Primary Database Application Services 2-26
2.6 Enabling DML Redirection 2-27
iv
7.2.2 Configuring DB_KEEP_CACHE_SIZE on True Cache 7-2
7.2.3 Assigning Objects to the KEEP Buffer Pool for True Cache 7-2
7.2.3.1 TRUE_CACHE_KEEP Procedure 7-3
7.2.4 Removing an Object's KEEP Buffer Pool Assignment for True Cache 7-3
7.2.4.1 TRUE_CACHE_UNKEEP Procedure 7-4
7.2.5 Viewing a List of KEEP Objects on True Cache 7-4
7.2.5.1 V$TRUE_CACHE_KEEP Columns 7-5
7.3 Database Smart Flash Cache 7-5
v
C True Cache Wait Events
vi
Preface
This guide provides a single location with everything you need to know about configuring and
using True Cache.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility
Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
Related Documents
The following documents contain information that may be of use when configuring and using
True Cache.
• Oracle True Cache Technical Architecture
• Oracle Data Guard Concepts and Administration
• Oracle Database Administrator’s Guide
• Oracle Database Container Images
• Oracle Database Error Messages
• Oracle Database Performance Tuning Guide
• Oracle Database PL/SQL Packages and Types Reference
• Oracle Database Reference
• Oracle Database JDBC Developer’s Guide
• Oracle Multitenant Administrator's Guide
• Oracle Real Application Clusters Administration and Deployment Guide
• Oracle Database SQL Language Reference
• Oracle Universal Connection Pool Developer’s Guide
• Java™ Platform, Standard Edition 7 API Specification
Conventions
The following text conventions are used in this document:
vii
Preface
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated with an
action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for which
you supply particular values.
monospace Monospace type indicates commands within a paragraph, URLs, code in
examples, text that appears on the screen, or text that you enter.
viii
1
Overview of Oracle True Cache
Oracle True Cache is an in-memory, consistent, and automatically managed SQL and key-
value (object or JSON) cache for Oracle Database.
For an interactive tour, see Oracle True Cache Technical Architecture.
1-1
Chapter 1
How True Cache Works
1-2
Chapter 1
Lock-Free Concurrency Control
23ai) maintains physical connections to the primary database and True Cache. This model
only works with Java applications.
The application switches between the primary database and True Cache without having to
specify an instance name. The application uses special calls to flag the logical connection
as read-only or read-write. If it's read-only, the query is sent to True Cache. Otherwise, it's
sent to the primary database.
Related Topics
• Using Oracle True Cache in Your Applications
When True Cache is configured, applications must decide whether to query data from True
Cache or the primary database.
1-3
2
Configuring True Cache
You can configure True Cache using the Oracle Database Configuration Assistant (Oracle
DBCA) or you can configure it manually.
Note:
True Cache for Oracle Database Free has a simplified configuration process. Get
started with the Oracle Database Free Installation Guide for your platform. See
Configuring True Cache on Oracle Database Free (Linux) or Configuring True Cache
on Oracle Database Free (Windows).
2-1
Chapter 2
Overview of the True Cache Configuration
1. Configure the network for True Cache and the primary database, and optionally create a
remote listener for high availability.
2. Create True Cache.
3. Create and start the True Cache database application services.
For example, if the primary service is SALES, the True Cache service would be SALES_TC.
Also, only start the True Cache services on True Caches, and make sure they're read-only.
2.1.5 Best Practices for Maximum Availability Architecture (MAA) with True
Cache
Follow these best practices for maximum availability with True Cache.
• Configure True Cache for high availability with two identical True Caches per dataset using
the uniform configuration architecture. To learn more, see Uniform Configuration.
• Use the JDBC 23ai UCP connection configuration for the application to ensure minimal
impact on the application if one True Cache becomes unavailable.
• Before enabling the database application service for True Cache, populate the cache by
running critical workload queries. To learn more about how data is cached, see How True
Cache Works.
• Before shutting down True Cache for planned maintenance, stop the database application
service on True Cache.
• Partition or design True Caches to minimize fetches from the primary database.
2.1.6 Pluggable Database (PDB) Behavior and Restrictions with True Cache
To achieve maximum availability, PDBs on True Cache and the primary database have the
following behavior and restrictions.
• Because non-CDB database are deprecated in Oracle 23ai, True Cache does not support
non-CDB primary databases.
• You can't perform administration tasks (for example, opening, closing, or shutting down) on
PDBs on True Cache. However, applications can connect to specific PDBs on True Cache
the same way they do for primary databases and Oracle Active Data Guard.
• True Cache's PDB availability depends on the PDB state on the primary database.
– When True Cache connects to the primary database, all open PDBs on the primary
database (in any Oracle RAC instances) are open on True Cache.
– If a PDB isn't open on the primary database on all Oracle RAC instances, then True
Cache effectively can't read anything from that PDB and sees the PDB in a mounted
state. When the primary database opens the PDB, then True Cache automatically
opens it as well.
2-2
Chapter 2
Configuring True Cache with Oracle DBCA
– When a PDB is closed on the primary database, it's marked as disconnected on True
Cache and never closes, unless some other action on the primary database requires
the PDB to close, like dropping it, renaming it, or using flashback. Otherwise, the PDB
remains open forever. Even if the primary CDB shuts down, when the primary CDB
restarts, True Cache checks whether each PDB can resume or has to be closed and
restarted.
– When the primary database shuts down, ROOT is marked as disconnected on True
Cache, and it may remain disconnected for a maximum of 24 hours (which is
configurable).
The following example illustrates how a PDB can be open on one True Cache and closed on
another True Cache that's connected to the same primary database.
1. PDB 1 is open on the primary database.
2. True Cache 1 connects to the primary database and sees that PDB 1 is open, so it opens
PDB 1.
3. The primary database closes PDB 1, but PDB 1 stays open on True Cache 1.
4. The primary database is bounced but doesn't reopen PDB 1.
5. True Cache 2 connects to the primary database and sees PDB 1 is in a mounted state, so
PDB 1 stays closed and mounted on True Cache 2.
Note:
True Cache for Oracle Database Free has a simplified configuration process. Get
started with the Oracle Database Free Installation Guide for your platform. See
Configuring True Cache on Oracle Database Free (Linux) or Configuring True Cache
on Oracle Database Free (Windows).
2.2.1 Prerequisites
Before configuring True Cache, complete the following prerequisites.
• Set up a network path to access the primary (source) database with an Easy Connect
(EZConnect) string from the True Cache node.
• Install the Oracle Database software on the True Cache nodes.
• Ensure that a primary database is running on the primary node in archive logging
(ARCHIVELOG) mode.
The primary database must be in ARCHIVELOG mode to ship redo log files to the True Cache
node. Oracle DBCA verifies that the primary database is in ARCHIVELOG mode.
If the primary database is not in ARCHIVELOG mode, restart it in mount mode, run the ALTER
DATABASE ARCHIVELOG command, and open the primary database again.
2-3
Chapter 2
Configuring True Cache with Oracle DBCA
Example:
2-4
Chapter 2
Configuring True Cache with Oracle DBCA
Note:
For Oracle RAC primary databases, set the -sourceDBConnectionString
parameter to SCAN:port/service_name.
Related Topics
• Rerunning Oracle DBCA After Creating True Cache
If you need to rerun Oracle DBCA after creating True Cache, clean up the True Cache
node first.
Note:
Check to see if Valid Node Checking for Registration (VNCR) is configured for
the listener. If so, add True Cache to the
REGISTRATION_INVITED_NODES_LISTENER parameter in the listener.ora file of
the remote listener.
2-5
Chapter 2
Configuring True Cache with Oracle DBCA
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 the listener.ora file as the grid owner user.)
For example:
2. 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 using
DBMS_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.
• For Oracle RAC primary databases, use the srvctl command line utility to add the
primary database service. Start the service on the primary instance. Use srvctl only
for Oracle Clusterware-managed instances.
2-6
Chapter 2
Configuring True Cache with Oracle DBCA
For example:
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.
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
EXEC DBMS_SERVICE.START_SERVICE('SALES_TC');
Related Topics
• CREATE_SERVICE Procedure
• MODIFY_SERVICE Procedure
2-7
Chapter 2
Configuring True Cache with Oracle DBCA
2.2.4.1 configureDatabase
The configureDatabase command configures the primary database for True Cache. Run this
command on the primary database.
Parameters
For True Cache, use the dbca -configureDatabase command with the following syntax.
Note:
This table lists the configureDatabase parameters that are specific to True Cache.
For the full syntax and parameters, see configureDatabase in the Oracle Multitenant
Administrator's Guide.
2-8
Chapter 2
Configuring True Cache with Oracle DBCA
2.2.4.2 createTrueCache
The createTrueCache command configures True Cache. Run this command on the True
Cache node.
dbca -createTrueCache
-dbUniqueName true_cache_unique_name | -gdbName true_cache_global_name
-sourceDBConnectionString primary_db_easy_connect_string
-trueCacheBlobFromSourceDB true_cache_config_blob_path | -
passwordFileFromSourceDB password_file_path
[-tdeWalletFromSourceDB tde_wallet_path]
[-createListener new_database_listener]
2-9
Chapter 2
Configuring True Cache with Oracle DBCA
[-datafileDestination true_cache_control_file_path
[-initParams initialization_parameters_list
[-initParamsEscapeChar initialization_parameters_escape_character]]
[-listeners listener_list]
[-pgaAggregateTargetInMB pga_memory_size]
[-sgaTargetInMB sga_memory_size]
[-sid true_cache_sid]
[-sourceTdeWalletPassword primary_db_wallet_password]
[-tdeWalletLoginType {PASSWORD | AUTO_LOGIN | LOCAL_AUTO_LOGIN}]
[-tdeWalletRoot tde_wallet_root_init_parameter]
[-useWalletForDBCredentials {true | false}
-dbCredentialsWalletLocation wallet_files_directory
[-dbCredentialsWalletPassword wallet_account_password]]
or
-gdbName
true_cache_global_name
-sourceDBConnectionString Required Enter the Easy Connect (EZConnect) string to connect to the
primary_db_easy_connect_string primary database.
Example: host:port/service_name
Note: For Oracle RAC primary databases, set the -
sourceDBConnectionString parameter to SCAN:port/
service_name.
-trueCacheBlobFromSourceDB Required Enter one of the following:
true_cache_config_blob_path • The full path and file name for the configuration BLOB file
that contains the primary database's password file or
or
wallet. This is the path where the file is located on the True
-passwordFileFromSourceDB Cache node.
password_file_path • The path to the primary database's password file that was
copied to the True Cache node.
If you use -passwordFileFromSourceDB, you can also enter
the following additional parameter:
-tdeWalletFromSourceDB: Enter the path to the primary
database's Transparent Data Encryption (TDE) wallet file that
was copied to the True Cache node. You can copy and use the
TDE wallet file only if the primary (source) database has TDE
enabled. Otherwise, the wallet file isn't required.
-createListener Optional Enter a new database listener to be created and to register the
new_database_listener database in the form LISTENER_NAME:PORT.
2-10
Chapter 2
Configuring True Cache with Oracle DBCA
-sid Optional Enter the system identifier (SID) for this True Cache.
true_cache_sid
-sourceTdeWalletPassword Optional If the primary database uses a TDE wallet, enter the password
primary_db_wallet_password for the wallet.
Related Topics
• createTrueCache
2-11
Chapter 2
Configuring True Cache Manually
2.3.1 Prerequisites
Before configuring True Cache, complete the following steps.
• Install the Oracle Database software on the True Cache nodes.
• Ensure that a primary database is running on the primary node in archive logging
(ARCHIVELOG) mode.
The primary database must be in ARCHIVELOG mode to ship redo log files to the True Cache
node. To see if the primary database is in ARCHIVELOG mode, enter the following SQL
query:
LOG_MODE
------------
ARCHIVELOG
If the primary database is not in ARCHIVELOG mode, restart it in mount mode, run the ALTER
DATABASE ARCHIVELOG command, and open the primary database again.
• Don't set LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_n on the primary database. True
Cache automatically configures these for the primary database.
2.3.2.1 Edit the tnsnames.ora File for True Cache and the Primary Database
Configure the database network connections by editing the tnsnames.ora file on both True
Cache and the primary database.
On most Linux platforms, you find the tnsnames.ora file in the $ORACLE_HOME/network/admin
directory.
You can create this file manually or by using Oracle Net Configuration Assistant (NETCA).
Add the following information to all primary database and True Cache tnsnames.ora files if the
information isn't already present:
• Network names for the primary database and all True Caches. These are needed to send
redo to True Cache, and they enable redo shipping to work even if the database
application services are not yet created.
• All primary database and True Cache database application service names. One True
Cache can support multiple database application services that are started simultaneously.
• All participating listener network aliases, if you're using a remote listener.
2-12
Chapter 2
Configuring True Cache Manually
Here are examples of the entries in the tnsnames.ora files for True Cache and the primary
database:
tcdb1i =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = true_cache_host)(PORT = 1521))
)
(CONNECT_DATA =
(SID = tcdb1i)
)
)
sales_tc =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = true_cache_host)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = sales_tc)
)
)
primdb1i =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_database_host)(PORT = 1521))
)
(CONNECT_DATA =
(SID = primdb1i)
)
)
sales =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_database_host)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = sales)
)
)
listener_primary =
2-13
Chapter 2
Configuring True Cache Manually
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_database_host)(PORT=1521))
)
listener_true_cache =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = true_cache_host)(PORT=1521))
)
2.3.2.2 Configure and Start the Local Listener on the True Cache Node
Configure and start the local listener to enable the True Cache node to receive redo from the
primary database.
1. Create the listener.ora file manually or by using NETCA.
Here's an example of listener.ora on a True Cache node:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = tcdb1i)
(ORACLE_HOME = local_oracle_home_on_true_cache)
(SID_NAME = tcdb1i)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = true_cache_host)(PORT = 1521))
)
lsnrctl start
lsnrctl status
2.3.2.3 Copy the Password File or Wallet from the Primary Database to the True
Cache Node
To provide authentication for redo transport sessions, copy the primary database's password
file or wallet to the True Cache node.
True Cache uses Oracle Net to transport redo data and control messages between the
members of a True Cache configuration. These redo transport sessions are authenticated
using a password file, so every True Cache in the configuration needs an up-to-date copy of
the password file from the primary database.
2-14
Chapter 2
Configuring True Cache Manually
Copy the primary database’s password file to the appropriate directory on the True Cache
node. You can find the password file in the V$PASSWORDFILE_INFO view, and on Linux the file is
usually in $ORACLE_HOME/dbs/orapwSID.
Note:
When using a TDE wallet, Oracle recommends configuring an auto-login or local
auto-login wallet for True Cache. For auto-login wallets, you an create the wallet
on the primary database and copy both the password wallet (ewallet.p12) and
auto-login wallet (cwallet.sso) to True Cache. Local auto-login wallets are host-
specific, so you can't copy them to another node. Instead, for local auto-login
wallets, copy the password wallet to True Cache, open it on True Cache, and
create the local auto-login wallet there with the wallet password. The local auto-
login wallet offers more security because it prevents someone from copying both
wallets and using them without knowing the wallet password. To learn more
about wallet types, see About Oracle Database Wallets. To learn more about
wallet types, see About Oracle Database Wallets
Parameter Description
TRUE_CACHE=TRUE This tells the server that this is a True Cache.
DB_NAME Enter the same value as the one for the primary
database.
DB_UNIQUE_NAME Specify a unique name for this True Cache.
DB_FILES Enter the same value as the one for the primary
database.
SGA_TARGET Enter the SGA memory size of this True Cache.
2-15
Chapter 2
Configuring True Cache Manually
Parameter Description
REMOTE_LISTENER Enter the primary database listener. This is not
needed for the CREATE TRUE CACHE command,
but it's needed to use JDBC.
Note: For Oracle RAC primary databases, set the
REMOTE_LISTENER parameter to SCAN:port.
Note: Check to see if Valid Node Checking for
Registration (VNCR) is configured for the listener. If
so, add True Cache to the
REGISTRATION_INVITED_NODES_LISTENER
parameter in the listener.ora file of the
remote listener. (In the example following this table,
this is the primary database's listener.ora file.)
Note: To simplify configuration and avoid
connection issues, you can use the
LISTENER_NETWORKS parameter instead of
specifying REMOTE_LISTENER and
LOCAL_LISTENER separately. All listeners within
the same network_name will cross-register. For
example:
LISTENER_NETWORKS='((NAME=network_nam
e)
(LOCAL_LISTENER=(DESCRIPTION=(ADDRESS
=(PROTOCOL=TCP)(HOST=true_cache_host)
(PORT=1521))))
(REMOTE_LISTENER=primary_database_hos
t:1521))'
2-16
Chapter 2
Configuring True Cache Manually
Parameter Description
FAL_CLIENT Enter the True Cache network name. When you
start True Cache, it automatically adds that network
name to the corresponding primary database
LOG_ARCHIVE_DEST_n initialization parameter so
that the primary database knows where to send
online redo log blocks.
DB_CREATE_FILE_DEST Enter a directory to store the internal True Cache
files (for example, control files and temp files).
DB_DOMAIN This might be necessary if the primary database
also sets DB_DOMAIN. Set this to the domain where
the True Cache node resides.
WALLET_ROOT and TDE_CONFIGURATION If the primary database configures TDE with the
recommended WALLET_ROOT and
TDE_CONFIGURATION parameters, configure them
accordingly on this True Cache.
true_cache=true
db_name=primaryd
db_unique_name=tcdb1
db_files=200
sga_target=20G
fal_server=primdb1i
fal_client=tcdb1i
instance_name=tcdb1i
db_create_file_dest=local_directory_on_true_cache_node
local_listener=listener
remote_listener=listener_primary
The preceding example assumes that the primary database's DB_UNIQUE_NAME initialization
parameter is set to primarydb and DB_FILES is set to 200.
Related Topics
• TRUE_CACHE
• Initialization Parameters
2-17
Chapter 2
Configuring True Cache Manually
export ORACLE_SID=tcdb1i
sqlplus / as SYSDBA
FILE_NAME
----------------------------------------------------
/u01/example/oracle/product/main/db_1/dbs/orapwtcdb1i
4. To verify that True Cache is working, see Verifying That True Cache Is Working as
Expected.
When you create True Cache, it automatically creates standby redo logs with the appropriate
size, control files, temp files (when needed), and an internal SPFILE based on the first PFILE
that you created. This SPFILE is used automatically on later STARTUP commands without the
need to specify any PFILE values.
At this point, your applications can use separate physical connections to the primary database
and True Cache and choose which connection to use based on whether it's reading or writing.
To use True Cache with the JDBC Thin driver, continue to the next topic to configure the
database application services for True Cache.
2-18
Chapter 2
Configuring True Cache Manually
Here's an example of creating these two services using the DBMS_SERVICE package for a single
instance primary database:
DECLARE
db_params dbms_service.svc_parameter_array;
BEGIN
-- create a database application service for True Cache called SALES_TC
using SALES_TC tnsname
DBMS_SERVICE.CREATE_SERVICE('SALES_TC', 'SALES_TC', db_params);
END;
2-19
Chapter 2
Configuring True Cache Manually
For example:
To create a True Cache service for an existing primary database service (db_service_name):
For example:
Note:
Also disable the True Cache service on the cluster where it was added to prevent
errors when stopping and restarting the primary database services. For example:
This doesn't affect standby databases or True Caches because they run outside the
cluster where the True Cache service is disabled. The disabled status is not stored in
the primary dictionary and DBA_SERVICES, but only in Cluster Ready Services (CRS),
and only in the cluster where the True Cache service was added. Other databases
outside the cluster can start the service with DBMS_SERVICE.START_SERVICE and aren't
affected by this setting.
Related Topics
• CREATE_SERVICE Procedure
• MODIFY_SERVICE Procedure
• Server Control Utility Reference
2-20
Chapter 2
Configuring True Cache Manually
connect / as SYSDBA
NAME TRUE_CACHE_SERVICE
-------- ------------------
SALES_TC
SALES SALES_TC
connect / as SYSDBA
DATABASE_ROLE
-------------
TRUE CACHE
EXEC DBMS_SERVICE.START_SERVICE('SALES_TC');
SERVICE_ID NAME
---------- ---------
28 SALES_TC
connect / as SYSDBA
DATABASE_ROLE
2-21
Chapter 2
Deploying True Cache for an Oracle RAC Primary Database
-------------
PRIMARY
EXEC DBMS_SERVICE.START_SERVICE('SALES');
Related Topics
• Verify That the Database Application Services Are Created
After you create services on the primary database, True Cache automatically inherits their
definitions. Using SQL*Plus, make sure that you can see the same results on both the
primary database and True Cache.
• START_SERVICE Procedure
• V$ACTIVE_SERVICES
• V$DATABASE
Note:
All of this information also appears in the context of the configuration steps for
Configuring True Cache with Oracle DBCA and Configuring True Cache Manually.
• True Cache needs to be able to access each instance in the Oracle RAC environment. To
do this, use the single client access name (SCAN) listener when configuring True Cache.
– If you're configuring True Cache with DBCA, set the -sourceDBConnectionString
parameter to SCAN:port/service_name.
– If you're manually configuring True Cache, use the following settings when preparing
the PFILE for True Cache:
* Set the REMOTE_LISTENER parameter to SCAN:port.
* Set the FAL_SERVER parameter to SCAN:port/service_name.
– 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 the listener.ora file as the grid
owner user.)
2-22
Chapter 2
Deploying True Cache for an Oracle RAC Primary Database
For example:
• When creating the database application services on the primary database, use the srvctl
command line utility to add the services. Start the service on the primary instance. Use
srvctl only for Oracle Clusterware-managed instances.
To create both a True Cache service and the primary database service:
For example:
For example:
2-23
Chapter 2
Verifying the True Cache Configuration
Note:
Also disable the True Cache service on the cluster where it was added to prevent
errors when stopping and restarting the primary database services. For example:
This doesn't affect standby databases or True Caches because they run outside
the cluster where the True Cache service is disabled. The disabled status is not
stored in the primary dictionary and DBA_SERVICES, but only in Cluster Ready
Services (CRS), and only in the cluster where the True Cache service was
added. Other databases outside the cluster can start the service with
DBMS_SERVICE.START_SERVICE and aren't affected by this setting.
Related Topics
• srvctl modify scan_listener
sqlplus / as SYSDBA
DATABASE_ROLE OPEN_MODE
---------------- --------------------
TRUE CACHE READ ONLY WITH APPLY
If OPEN_MODE is READ ONLY WITH APPLY, it means that the True Cache redo apply is actively
working.
2-24
Chapter 2
Verifying the True Cache Configuration
If CURRENT_SCN is advancing over time, it means that True Cache is moving forward as
expected.
4. To find the size of each log file, enter the following query:
Note:
For Oracle RAC primary databases, before using the lsnrctl command, set
your $ORACLE_HOME environment variable to the path for the Oracle Grid Infrastructure
home (Grid home).
The following example shows two True Caches registered with the SCAN listener for an Oracle
RAC primary database:
Note:
If the True Cache service is not registered with the remote listener, validate the
remote listener invited nodes and the True Cache initialization parameters for
REMOTE_LISTENER or LISTENER_NETWORKS.
2-25
Chapter 2
Verifying the True Cache Configuration
2.5.3 Verifying the True Cache and Primary Database Application Services
Verify that all database application services are active on both the primary database and True
Cache.
True Cache
1. Run SQL*Plus on True Cache.
sqlplus / as SYSDBA
For example:
SERVICE_ID NAME
---------- ---------
28 SALES_TC
Primary Database
1. Run SQL*Plus on the primary database.
sqlplus / as SYSDBA
For example:
Related Topics
• Configuring True Cache Database Application Services Manually
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.
• V$ACTIVE_SERVICES
2-26
Chapter 2
Enabling DML Redirection
Note:
If the user logs in to True Cache with OS authentication, the user can't enable
ADG_REDIRECT_DML. This is because the True Cache database administrator might not
actually have the SYSDBA password but is allowed to use OS authentication to
manage True Cache as SYSDBA. If the user can set ADG_REDIRECT_DML, then that user
can update primary data as SYSDBA without knowing the SYSDBA password.
For more on enabling DML redirection, see Managing Physical and Snapshot Standby
Databases.
2-27
3
Deploying True Cache in Containers
Containers can simplify the deployment of True Cache configurations.
You can use the scripts that are provided in the True Cache container image to automatically
create a True Cache configuration. The scripts complete the following configuration tasks:
• Create the primary database and True Cache containers.
• Create and start True Cache.
• Create and start the database application services for the primary database and True
Cache.
See the complete instructions for downloading the images and creating the containers in the
Oracle Database Container Images README.md.
Create a separate container for each True Cache. Assign different container names, Oracle
SIDs, and database application service names, as needed.
3-1
4
Shutting Down and Starting True Cache
You can shut down and start an existing True Cache.
Note:
Perform these tasks on the True Cache container database (CDB), not on the
pluggable database (PDB).
Note:
Before shutting down True Cache for planned maintenance, stop the database
application service on True Cache.
connect / as SYSDBA;
SHUTDOWN;
When you shut down True Cache, the cached content is lost. When you restart True Cache, it
fetches the content again from the primary database.
connect / as SYSDBA;
STARTUP;
Work is automatically routed to True Cache when it declares that it's ready to support the True
Cache service.
4-1
5
Monitoring True Cache
You can monitor True Cache with the V$TRUE_CACHE view, and you can use the Automatic
Workload Repository (AWR) to gather performance statistics for True Cache.
5-1
Chapter 5
Using the Automatic Workload Repository for True Cache
Column Description
MY_DG_ID The Data Guard ID (DGID) that uniquely identifies
the True Cache or primary database in the True
Cache configuration.
REMOTE_DG_ID On True Cache, this is the primary database’s
DGID. On the primary database, it's the True Cache
DGID.
DEST_ID On True Cache, this is always 0. On the primary
database, it's the corresponding destination ID (n)
of the LOG_ARCHIVE_DEST_n initialization
parameter. The LOG_ARCHIVE_DEST_n
initialization parameter specifies the network name
of the True Cache so that the primary database
knows where to send online redo log blocks.
TRUE_CACHE_NAME The unique name of the True Cache
(DB_UNIQUE_NAME in the PFILE).
PRIMARY_NAME The unique name of the primary database
(DB_UNIQUE_NAME in the PFILE).
STATUS Describes the current status of the True Cache. If
no issues are found, it displays HEALTHY.
Otherwise, it displays an error description. For
example: ORA-01034: The Oracle instance
is not available for use. Start the
instance.
REMOTE_VERSION On True Cache, this is the database version of the
primary database. On the primary database, this is
the database version of the True Cache.
CON_ID The root container ID.
Related Topics
• V$TRUE_CACHE
5-2
Chapter 5
Using the Automatic Workload Repository for True Cache
To generate an AWR snapshot report, complete the following steps on either the primary
database or the True Cache:
1. Go to the $ORACLE_HOME directory and run the following script:
• On True Cache:
@?/rdbms/admin/awrrpt.sql
@?/rdbms/admin/awrrpti.sql
The output displays a list of available database identifiers and instance numbers.
3. If you're generating the report on the primary database, enter the database identifier
(dbid) and instance number (inst_num) for True Cache. For example:
To get the dbid for True Cache, run the following query on the True Cache:
This step is not required if you're generating the report on True Cache because the
awrrpt.sql script automatically derives the dbid of the local node.
4. Specify the number of days for which you want to list snapshot IDs. For example:
The output displays a list of existing snapshots for the specified time range.
5. Specify beginning and ending snapshot IDs for the workload repository report. For
example:
6. Enter a report name or accept the default report name. For example:
Related Topics
• Automatic Workload Repository (AWR)
• Managing Snapshots
5-3
Chapter 5
Using the Automatic Workload Repository for True Cache
5-4
6
Using Oracle True Cache in Your Applications
When True Cache is configured, applications must decide whether to query data from True
Cache or the primary database.
6-1
Chapter 6
Sample Java Code Using the JDBC Thin Driver
WARNING:
Do not use this code in a production environment.
The core of this basic code is in the test1 function, which does the following:
1. Creates a connection to the primary database by using the JDBC Thin driver with either a
default user name and password or values that are specified on the command line when
invoking the program.
2. Prints some basic information about the primary database connection to verify that the
application is connected to the database.
3. Changes the isReadOnly connection parameter to TRUE to automatically switch the
connection to True Cache and verify that it's connected to it.
import java.sql.*;
import java.io.*;
import java.util.*;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.driver.OracleLog;
import oracle.jdbc.pool.OracleDataSource;
6-2
Chapter 6
Sample Java Code Using the JDBC Thin Driver
ods1.setPassword(password);
ods1.setConnectionProperty("oracle.jdbc.useTrueCacheDriverConnection",
"true");
conn1.setReadOnly(true);
show("isReadonly " + conn1.isReadOnly());
verifyConnection(conn1); // This is connected to True Cache
conn1.close();
} catch (SQLException sqex) {
show("test1 -- failed" + sqex.getMessage()+":"+sqex.getCause());
sqex.printStackTrace();
}
show("The end");
}
6-3
Chapter 6
Sample Java Code for Applications Using a Native Connection to the Database
WARNING:
Do not use this code in a production environment.
@Override
public void execute(Connection con) throws SQLException {
// if it is connected to primary, I want the connection to switch to
true_cache now
if(!con.isReadOnly()) {
// The below code demonstrates the connection is to primary
now
System.out.println("Query getting executed on:");
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery("SELECT database_role from
v$database");
rs.next();
System.out.println("Database role : " + rs.getString(1));
rs.close();
6-4
Chapter 6
Best Practices for Load Balancing in a Uniform Configuration
listener_networks='((NAME=net1)
(LOCAL_LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tc1.example.com)
(PORT=1521))))(REMOTE_LISTENER=scan_primary:1521))',
'((NAME=net2)(LOCAL_LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=tc1.example.com)(PORT=1521))))(REMOTE_LISTENER=scan_standby:1521))'
For more about configuring remote listeners and listener networks, see Prepare a PFILE for
True Cache.
Related Topics
• About Run-Time Connection Load Balancing
6-5
7
Complementary Caching Features
True Cache can be combined with other Oracle Database features to improve performance.
Support for server-side result set caching is available for both JDBC Thin and JDBC Oracle
Call Interface (JDBC OCI) drivers.
Related Topics
• Using the Result Cache on Physical Standby Databases
7.2.1 Overview of Using the KEEP Buffer Pool with True Cache
You can assign different objects to the KEEP buffer pool on different True Caches.
To propagate direct load data to True Cache, specify the LOGGING clause in the corresponding
DDL or DML, or alter the corresponding object property to LOGGING. The LOGGING clause lets
you specify whether certain operations will be logged in the redo log file (LOGGING) or not
(NOLOGGING).
7-1
Chapter 7
KEEP Buffer Pool
Related Topics
• Configuring the KEEP Pool
• logging_clause
7.2.1.1 How True Cache Works with the Primary Database Buffer Cache
By default, marking something KEEP on the primary database also marks it KEEP on True
Cache.
To prevent objects that are intended to be KEEP objects only on the primary database from
filling up the True Cache KEEP buffer pool, you can use the DBMS_CACHEUTIL.TRUE_CACHE_KEEP
procedure to mark objects as KEEP on True Cache. DBMS_CACHEUTIL.TRUE_CACHE_KEEP takes
precedence and overrides objects that are marked as KEEP on the primary database.
Related Topics
• DB_KEEP_CACHE_SIZE
• Setting or Changing Initialization Parameter Values
7.2.3 Assigning Objects to the KEEP Buffer Pool for True Cache
After configuring the KEEP buffer pool, assign the object to the KEEP buffer pool for True Cache.
7-2
Chapter 7
KEEP Buffer Pool
Syntax
DBMS_CACHEUTIL.TRUE_CACHE_KEEP(
schema IN VARCHAR2,
obj IN VARCHAR2,
partition IN VARCHAR2 := NULL);
Parameters
Parameter Description
schema The name of the schema for the object.
obj The name of the object.
partition • If the object is not partitioned, then this is NULL.
• If the object is partitioned, use the name of the partition segment.
• If it's a composited partitioned object, use the name of the
subpartition segment.
Related Topics
• TRUE_CACHE_KEEP Procedure
7.2.4 Removing an Object's KEEP Buffer Pool Assignment for True Cache
You can use DBMS_CACHEUTIL.TRUE_CACHE_UNKEEP() to remove objects from the KEEP buffer
pool.
Note that the block is not removed immediately. Instead, it will be naturally aged out as new
blocks for other objects are brought into the KEEP buffer pool. Also, the KEEP buffer pool
assignment on True Cache is only remembered while True Cache is up.
7-3
Chapter 7
KEEP Buffer Pool
Syntax
DBMS_CACHEUTIL.TRUE_CACHE_UNKEEP(
schema IN VARCHAR2,
obj IN VARCHAR2,
partition IN VARCHAR2 := NULL);
Parameters
Parameter Description
schema The name of the schema for the object.
obj The name of the object.
partition • If the object is not partitioned, then this is NULL.
• If the object is partitioned, use the name of the partition segment.
• If it's a composited partitioned object, use the name of the
subpartition segment.
Related Topics
• TRUE_CACHE_UNKEEP Procedure
Example 1
Example 2
7-4
Chapter 7
Database Smart Flash Cache
Column Description
TS_NUMBER The tablespace number.
DATA_OBJECT_ID The dictionary object number of the segment that
contains the object.
CON_ID The root container ID.
Note:
When configuring Database Smart Flash Cache on True Cache, spilling TDE
encrypted data to local flash devices is not supported. If a data block is TDE
encrypted on the primary database, it stays in the DRAM buffer cache on True
Cache.
7-5
8
Deleting True Cache
You can delete True Cache with Oracle DBCA or manually.
8.1.1 Cleaning Up the True Cache Services from the Primary Database
To delete True Cache, you need to clean up its corresponding services on the primary
database.
Run the following command on the primary database to delete all the services that correspond
to the True Cache that you're planning to delete.
Example:
Example:
8-1
Chapter 8
Deleting True Cache Manually
connect / as SYSDBA;
shutdown immediate;
Note:
This does not drop the primary database. It deletes the True Cache SPFILE; drops the
True Cache control, standby log, and temporary files; and removes
LOG_ARCHIVE_DEST entries from the primary database.
8-2
9
Deploying Oracle True Cache with Oracle
Global Data Services
You can deploy Oracle True Cache with Oracle Database Global Data Services (GDS) to
manage workload routing, dynamic load balancing, and service failover across multiple True
Caches and other database replicas.
9-1
Chapter 9
True Cache Integration with Global Data Services
balancing advisories and publish them to the client connection pool through the ONS
server network.
Related Topics
• Introduction to Global Data Services
Install at least one GSM in each region. For high availability, include two GSMs in each region.
To install GSMs, see the following topics in the Oracle Database Global Data Services
Concepts and Administration Guide:
9-2
Chapter 9
Configuring Global Data Services for True Cache
Note:
In addition to these steps, ensure that the GDS catalog is protected for high
availability and disaster recovery.
sqlplus / as SYSDBA
3. Start GDSCTL.
gdsctl
Related Topics
• What You Need to Know About Creating the Global Data Services Catalog
9-3
Chapter 9
Configuring Global Data Services for True Cache
For example:
If you don't specify a region when setting up the catalog, then a default region named
REGIONORA is created. You can optionally add more regions later.
For example:
add gsm -gsm gsm_dc_x1 -catalog primdb1i -pwd **** -region DC_X
Note:
You can run this command only on the system that hosts the GSM. Repeat the
command for each GSM on each system that runs the GSM.
For example:
status gsm
9-4
Chapter 9
Configuring Global Data Services for True Cache
Note:
At least one GSM must be added and running before you can add regions.
For example:
For example:
add database -connect primdb1i -pwd **** -gdspool sales –region DC_X //
primary
add database -connect tcdb1 -pwd **** -gdspool sales –region DC_X // True
Cache
9-5
Chapter 9
Configuring Global Data Services for True Cache
Note:
If the application uses the JDBC programming model, both the primary database
service and True Cache service names must be fully qualified with the domain name
(for example, sales.example.com and sales_tc.example.com). This is because GDS
has a default domain name and is different from the database's domain_name
parameter. This also limits the fully qualified service name to a maximum of 64
characters.
Note:
The PDB name is required to create a service for a PDB. If you don't specify the PDB
name, the service is created in CDB$ROOT.
For example:
For example:
Note:
The -failover_primary option requires the patch for bug 36740927.
3. Associate the True Cache service with the primary database service.
9-6
Chapter 9
Configuring Global Data Services for True Cache
• For True Cache and single instance primary databases, use the DBMS_SERVICE_PRVT
PL/SQL package.
On the primary database, connect to the PDB first. The following example uses the
sales.example.com and sales_tc.example.com services.
DECLARE
db_params sys.dbms_service_prvt.svc_parameter_array;
cl_params sys.dbms_service_prvt.svc_parameter_array;
BEGIN
-- modify an already existing primary service SALES to set the
TRUE_CACHE_SERVICE attribute and associate with SALES_TC
db_params('true_cache_service') :='sales_tc.example.com';
DBMS_SERVICE_PRVT.MODIFY_SERVICE('sales.example.com', cl_params,
db_params, FALSE, 1);
END;
• For Oracle RAC primary databases, use the srvctl command line utility with the -
global_override option to alter global services.
If you configure True Cache with Oracle DBCA, use the following command:
For example:
For manual configuration options, see Create Database Application Services on the
Primary Database.
9-7
Chapter 9
Configuring Global Data Services for True Cache
Note:
Also disable the True Cache service on the cluster where it was added to
prevent errors when stopping and restarting the primary database services.
For example:
This doesn't affect standby databases or True Caches because they run
outside the cluster where the True Cache service is disabled. The disabled
status is not stored in the primary dictionary and DBA_SERVICES, but only in
Cluster Ready Services (CRS), and only in the cluster where the True Cache
service was added. Other databases outside the cluster can start the service
with DBMS_SERVICE.START_SERVICE and aren't affected by this setting.
The following example starts the services on the primary database and on all True Caches:
Note:
If you receive the following warning when you add a service to a GDS pool with
existing True Caches and services running, you can ignore it: ORA-44311:
service service_name not running.
• Create the global services for the primary database and True Cache using fully qualified
names (for example, sales.example.com and sales_tc.example.com). This is because
GDS has a default domain name and is different from the database's domain_name
parameter. This also limits the fully qualified service name to a maximum of 64 characters.
• Use DBMS_SERVICE_PRVT instead of DBMS_SERVICE to associate the True Cache service with
the primary database service.
9-8
Chapter 9
Configuring Global Data Services for True Cache
Option Description
-available dbname_list Specify a comma-delimited list of available databases or True Caches
on which the service runs if the preferred ones are not available. You
can't specify a list of available instances, only databases and True
Caches. You can use the modify service command with the -
server_pool parameter to specify instance-level preferences.
The list of available databases or True Caches must be mutually
exclusive with the list of preferred ones.
You cannot use this option with the -preferred_all option.
-clbgoal {SHORT | LONG} For True Cache services, set the connection load balancing goal to
SHORT for runtime load balancing.
-failover_primary If the -role is TRUE_CACHE, you can use this option to enable the
service to failover to the primary database if no True Caches are
available. Also include the primary database in the -preferred or -
available list, or use the -preferred_all option.
Note:
The -failover_primary option
requires the patch for bug 36740927.
-gdspool gdspool_name Specify the name of the global data services pool to which you want
to add a service. If the pool name is not specified and there is only
one gdspool with access granted to the user, then the gdspool with
access granted is used as the default gdspool.
-lag {lag_value | ANY} Specify the maximum acceptable lag for the service in seconds.
Enter ANY if there is no upper threshold. If a True Cache falls behind
the primary database beyond the specified lag time, the service stop
forwarding requests to that True Cache until it catches up.
The default value for lag, if not specified, is ANY.
-locality {ANYWHERE | For True Cache services, set the locality to LOCAL_ONLY. This
LOCAL_ONLY} indicates that GDS only routes to True Caches in the same region,
regardless of load. Use this option together with -region_failover
so that client connections and requests are routed to another region if
all True Caches in a region have failed.
-pdbname primary_pdb_name Enter the primary pluggable database (PDB) name.
Note:
The PDB name is required to create a
service for a PDB. If you don't specify
the PDB name, the service is created in
CDB$ROOT.
9-9
Chapter 9
Configuring Global Data Services for True Cache
Option Description
-preferred dbname_list Specify a comma-delimited list of preferred databases or True
Caches on which the service runs. You can't specify preferred
instances, only databases and True Caches. You can use the modify
service command to specify instance-level preferences.
The list of preferred databases or True Caches must be mutually
exclusive with the list of available ones.
You cannot use this option with the -preferred_all option.
-preferred_all For True Cache services, indicates that this service will be started on
all existing and future True Caches and, if used with -
failover_primary, the primary database.
-region_failover Indicates that the service is enabled for region failover. You can only
use this option when you specify LOCAL_ONLY for the -locality
option.
-rlbgoal {SERVICE_TIME | For True Cache services, set the runtime load balancing goal to
THROUGHPUT} SERVICE_TIME to balance connections by response time instead of
by throughput.
-role {PRIMARY] | Specify the database role that the database must have for this
[PHYSICAL_STANDBY | service to start on that database.
TRUE_CACHE} For primary database services, use PRIMARY.
For True Cache services, use TRUE_CACHE. This ensure that the
service only runs on other True Caches, not on the primary database.
9-10
Chapter 9
Configuring Global Data Services for True Cache
Option Description
-service Specify the name of the global service.
service_name.domain_name
Note:
If the application uses the JDBC
programming model, both the primary
database service and True Cache
service names must be fully qualified
with the domain name (for example,
sales.example.com and
sales_tc.example.com). This is
because GDS has a default domain
name and is different from the
database's domain_name parameter.
This also limits the fully qualified
service name to a maximum of 64
characters.
A global service name must be unique within a GDS pool and when
qualified by domain, must also be unique within a GDS configuration.
A global service cannot be created at a database if a local or global
service with the same name already exists at that database.
A global service name can contain alphanumeric characters,
underscore (_), and period (.). The first character must be
alphanumeric. The maximum length of a global service name is 64
characters. The maximum length of a domain qualified global service
name is 250 characters.
An Oracle Net connect descriptor used to connect to a global service
must contain a domain qualified service name.
For True Cache service names, see Best Practices for Database
Application Services.
Note:
This table lists the add service options that are specific to True Cache. For the full
syntax and parameters, see add service in the Oracle Database Global Data
Services Concepts and Administration Guide.
sales =
(DESCRIPTION =(CONNECT_TIMEOUT=90)(RETRY_COUNT=30)(RETRY_DELAY=3)
(TRANSPORT_CONNECT_TIMEOUT=3)
9-11
Chapter 9
True Cache Restrictions with Oracle Global Data Services
(FAILOVER=ON)
(ADDRESS_LIST = //Lists DC_X's GSM listeners because primary is in DC_X
(LOAD_BALANCE=ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = gsm_dc_x1)(PORT = 1572)))
(CONNECT_DATA =
(SERVICE_NAME = sales.example.com)))
sales_tc =
(DESCRIPTION =(CONNECT_TIMEOUT=90)(RETRY_COUNT=30)(RETRY_DELAY=3)
(TRANSPORT_CONNECT_TIMEOUT=3)
(FAILOVER=ON)
(ADDRESS_LIST = //DC_X's GSM listeners
(LOAD_BALANCE=ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = gsm_dc_x1)(PORT = 1572)))
(ADDRESS_LIST = //buddy DC_Y's GSM listeners
(LOAD_BALANCE=ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = gsm_dc_y1)(PORT = 1572)))
(CONNECT_DATA =
(SERVICE_NAME = sales_tc.example.com) (REGION=DC_X))) // this client is
in DC_X
9-12
A
True Cache Error Messages
View error messages that you might encounter when using True Cache.
Select an error message to read the full description in the Error Help Portal.
• ORA-61850, Oracle version mismatch between primary database and True Cache.
• ORA-61851, True Cache instance does not allow string operation.
• ORA-61852, CREATE TRUE CACHE failed.
• ORA-61853 Cannot start True Cache.
• ORA-61854 Cannot start True Cache with non True Cache control file.
• ORA-61855 Invalid TRUE_CACHE_CONFIG attribute.
• ORA-61856 True Cache requires a valid parameter value for string.
• ORA-61857 Communication with the primary failed.
• ORA-61858 Unable to translate FAL_SERVER initialization parameter string.
• ORA-61859 There was an error when executing a remote procedure call (op: string-string-
string) at primary server string.
• ORA-61860 True Cache instance is being shutdown because it has been disconnected
from the primary for too long.
• ORA-61861 Unable to receive redo since standby redo log is not available.
• ORA-61862 String is not configured as a multitenant database.
• ORA-61863 True Cache could not be started because there was a configuration parameter
mismatch with the primary. Restart the database.
• ORA-61864 True Cache failed to read metadata from the primary.
• ORA-61865 The TNS alias string could not be translated.
• ORA-61866 Some static parameters (string) differed from the value in the primary
database. These parameters have been fixed and the database will be shut down.
• ORA-61867 Oracle True Cache failed to restart. Shutting down.
• ORA-61868 True Cache entry corresponding to the hash ID string not found in a
LOG_ARCHIVE_DEST_n parameter.
• ORA-61869 Unable to connect to True Cache.
• ORA-61870 True Cache requires ARCHIVELOG mode to be enabled at the primary
database.
• ORA-61871 Cannot fetch data block from the primary database (file # string, block #
string).
• ORA-61872 The string command in pluggable database string failed because some
process is keeping a lock on it for too long. True cache will be restarted.
• ORA-61873 True Cache could not be started because the system parameter 'string' is
different in the PRIMARY database. Remove the parameter from the True Cache
initialization file.
A-1
Appendix A
• ORA-61874 Cannot fetch data block from the primary database (file # string, block #
string).
• ORA-61875 There was a failure adding the system parameter LOG_ARCHIVE_DEST_n at
the primary database. True Cache database cannot be opened without it.
• ORA-61876 Failed to open True Cache because the primary database is configured for
shared server.
• ORA-61877 True Cache recovery lags too far behind, exceeding string seconds.
• ORA-61878 PDB (con_id:string) is not open on the primary database.
• ORA-61879 db_keep_cache_size is not configured on True Cache.
• ORA-61880 This operation (string) is only allowed on True Cache instance.
• ORA-61881 Failed to open True Cache because there has been an error reading metadata
(string) from the primary database string.
• ORA-61882 Cannot start Free Edition True Cache because the maximum number of
configured Free Edition True Caches (string) for the database has been reached already.
A-2
B
True Cache Database Statistics Descriptions
The following table describes the True Cache-related statistics stored in the V$SESSTAT and
V$SYSSTAT views.
B-1
C
True Cache Wait Events
The following True Cache-related wait events are used for block fetching.
Related Topics
• Oracle Wait Events
C-1
D
Licensing for True Cache
True Cache licensing is based on the edition of Oracle Database that you're using for both the
primary database and True Cache.
See Permitted Features, Options, and Management Packs by Oracle Database Offering in the
Oracle Database Licensing Information User Manual.
D-1
E
Troubleshooting True Cache
Follow these recommendations if you run into issues when configuring or using True Cache.
1. For services that are specific to a PDB, connect to the specific PDB, or set the correct PDB
container in your session.
2. Connect to True Cache and stop the True Cache service on True Cache if it's running.
EXEC DBMS_SERVICE.STOP_SERVICE('trueCacheServiceName');
3. Delete the service on the primary database using DBMS_SERVICE.DELETE_SERVICE.
EXEC DBMS_SERVICE.DELETE_SERVICE('trueCacheServiceName');
4. Configuration the True Cache application service again. See Configuring True Cache
Database Application Services with DBCA.
E-1
Appendix E
Preventing SRVCTL from Restarting True Cache Services for Oracle RAC Primary Databases
To prevent these errors, disable the True Cache service on the cluster where it was added. For
example:
srvctl disable service -d primdb1i -s sales_tc
This doesn't affect standby databases or True Caches because they run outside the cluster
where the True Cache service is disabled. The disabled status is not stored in DBMS_SERVICE/
service$, but only in Cluster Ready Services (CRS), and only in the cluster where the True
Cache service was added. Other databases outside the cluster can start the service with
DBMS_SERVICE.START_SERVICE and aren't affected by this setting.
Related Topics
• 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.
• Configuring True Cache Database Application Services Manually
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.
• Deploying True Cache for an Oracle RAC Primary Database
This section summarizes the configuration requirements for deploying True Cache for a
primary database in an Oracle Real Application Clusters (Oracle RAC) environment. These
requirements are also included in context within the detailed configuration steps.
E-2