Wednesday, February 10, 2016

12c: Trigger to open all pdbs after cdb reboot

when ever container is bounced, it will close all the pluggable databases
When ever it is up, we have to manually open all pluggable databases 
we can make it automatic by deploying following trigger on container database 

create or replace trigger sys.after_startuppdbs after startup on database 
begin 
execute immediate 'alter pluggable database all open';
end after_startuppdbs;
/

In order to validate bounce the database and check the status of pluggable database before and after server reboot

status of pluggable databases before server reboot

SQL> select name, open_mode from v$pdbs;
NAME          OPEN_MODE
--------------- ----------
PDB$SEED     READ ONLY
RED              MOUNTED

Bouncing container database and checking the status of pluggable databases in following steps 

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area  730714112 bytes
Fixed Size     2292672 bytes
Variable Size   549454912 bytes
Database Buffers   176160768 bytes
Redo Buffers     2805760 bytes
Database mounted.
Database opened.

SQL> select name, open_mode from v$pdbs;
NAME OPEN_MODE
--------------- ----------
PDB$SEED   READ ONLY
RED            READ WRITE

from above, we can confirm that trigger that we deployed on container is successfully bringing all pluggable databases after CDB reboot 

---Nikhil Tatineni--
---12c: Pluggable databases -- 


Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...