How to start PDB service at startup in Active Dataguard
Hi
I'm using Oracle 19.17.
I'm running Active Dataguard: 1 PRIMARY database with 1 service in 1 PDB , and 1 duplicated STANDBY database opened in read only mode (WITH APPLY).
I would like the STANDBY PDB automatically opened, and the service in this PDB automatically started at STANDBY normal read only startup (without switchover or failover).
As I can't save PDB state in read only STANDBY, I created this trigger to open PDB and start service:
CREATE TRIGGER register_open_GBPROD AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
--
EXECUTE IMMEDIATE 'alter session set container = "GBPROD"';
--DBMS_SERVICE.START_SERVICE(service_name => 'SVC_GBPROD_BO');
--EXECUTE IMMEDIATE 'ALTER SYSTEM REGISTER';
END