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).
Shutting Down True Cache
To shut down True Cache, use the SHUTDOWN command.
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.
Starting True Cache
To start an existing True Cache, use the STARTUP command.
connect / as SYSDBA;
STARTUP;
Work is automatically routed to True Cache when it declares that it’s ready to support the True Cache service.
Restarting True Cache Application Services at Startup
To start the database application services when a primary database or True Cache starts, create an AFTER STARTUP trigger. The following example starts the SALES_TC service on one True Cache and the HR_TC service on another True Cache.
Update the True Cache database unique-name placeholders and service names for your configuration.
CREATE OR REPLACE TRIGGER tc_service_restart
AFTER STARTUP ON DATABASE
DECLARE
db_role VARCHAR2(32);
db_unique_name VARCHAR2(32);
BEGIN
SELECT database_role, db_unique_name
INTO db_role, db_unique_name
FROM v$database;
IF db_role = 'PRIMARY' THEN
DBMS_SERVICE.START_SERVICE('SALES');
DBMS_SERVICE.START_SERVICE('HR'); -- On an Oracle RAC primary, CRS can restart these services.
ELSIF db_role = 'TRUE CACHE' AND db_unique_name = 'tc1_database_unique_name' THEN
DBMS_SERVICE.START_SERVICE('SALES_TC');
ELSIF db_role = 'TRUE CACHE' AND db_unique_name = 'tc2_database_unique_name' THEN
DBMS_SERVICE.START_SERVICE('HR_TC');
ELSE
DBMS_SERVICE.STOP_SERVICE('SALES');
DBMS_SERVICE.STOP_SERVICE('SALES_TC');
DBMS_SERVICE.STOP_SERVICE('HR');
DBMS_SERVICE.STOP_SERVICE('HR_TC');
END IF;
END;
Note: Cluster Ready Services (CRS) and srvctl do not support starting or restarting a True Cache service on True Cache. Use DBMS_SERVICE for that operation.