Which three statements are true about the startup and shutdown of multitenant container
databases (CDBs) and pluggable databases (PDBs)?
A.
A PDB opened in restricted mode allows only local users to connect.
B.
When a CDB is open in restricted mode, PDBs must also be opened in restricted mode.
C.
When a CDB is in mount state, PDBs are automatically placed in mount state.
D.
All PDBs must be shut down before shutting down a CDB instance.
E.
When a CDB instance is started, PDBs can be placed in open state by using database
triggers or by executing the alter pluggable database command.
In this question, an answer is missing.
B,D,E
B,C,E is correct.
OPtion D is wrong. When CDB is shutdown, all the underlying PDB’s are automatically shutdown.
Why E Kiran?
Please advise.
Thanks!
B, C and E
BCE
B tested. How about the other two?
E. Prior to 12.1.0.2, when the CDB is started, all PDBs remain in mounted mode. There is no default mechanism to automatically start them when the CDB is started. The way to achieve this is to use a system trigger on the CDB to start some or all of the PDBs.
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE ‘ALTER PLUGGABLE DATABASE ALL OPEN’;
END open_pdbs;
/
Thanks Mohamed!
B,C
Which three statements are true about the startup and shutdown of multitenant container
databases (CDBs) and pluggable databases (PDBs)?
A PDB opened in restricted mode allows only local users to connect. (wrong tested)
B.
When a CDB is open in restricted mode, PDBs must also be opened in restricted mode. (right tested)
C.
When a CDB is in mount state, PDBs are automatically placed in mount state. (right tested)
D.
All PDBs must be shut down before shutting down a CDB instance. (wrong tested)
E.
When a CDB instance is started, PDBs can be placed in open state by using database
triggers or by executing the alter pluggable database command. (wrong. Because when CDB is started. PLUGABLE database is not visible)
E is correct. Is one of the things you learn in the course ‘Oracle Database 12c: Install and Upgrade’. And i tested it.
B,C,E A wrong => only common users (not local users) can connect
D wrong as Kiran already explaind.
I would Say B,C and E
The following is my reference for (E) :
URL: https://oracle-base.com/articles/12c/multitenant-startup-and-shutdown-cdb-and-pdb-12cr1
as mentioned in Section: “Pluggable Database (PDB) Automatic Startup”
The 12.1.0.2 patchset has introduced the ability to preserve the startup state of PDBs, so you probably shouldn’t be implementing a trigger in the manner discussed in this section.
Prior to 12.1.0.2, when the CDB is started, all PDBs remain in mounted mode. There is no default mechanism to automatically start them when the CDB is started. The way to achieve this is to use a system trigger on the CDB to start some or all of the PDBs.
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE ‘ALTER PLUGGABLE DATABASE ALL OPEN’;
END open_pdbs;
/
You can customise the trigger if you don’t want all of your PDBs to start.
Thanks,
Mohamed
BCE
B.
When a CDB is open in restricted mode, PDBs must also be opened in restricted mode.
C.
When a CDB is in mount state, PDBs are automatically placed in mount state.
In my lab:
SQL> startup open restrict;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2293880 bytes
Variable Size 322965384 bytes
Database Buffers 507510784 bytes
Redo Buffers 2334720 bytes
Database mounted.
Database opened.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
2 PDB$SEED READ ONLY YES
3 PDB01 MOUNTED
4 PDB02 MOUNTED
SQL> alter pluggable database pdb01 open;
alter pluggable database pdb01 open
*
ERROR at line 1:
ORA-65054: Cannot open a pluggable database in the desired mode.
SQL> alter pluggable database pdb02 open restricted;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
2 PDB$SEED READ ONLY YES
3 PDB01 MOUNTED
4 PDB02 READ WRITE YES
SQL>
E.
When a CDB instance is started, PDBs can be placed in open state by using database
triggers or by executing the alter pluggable database command.
This the alter instruction:
SQL> alter pluggable database pdb02 open;
Pluggable database altered.
And this is the trigger:
create or replace trigger open_pbs
after startup on database
begin
execute immediate ‘alter pluggable database all open’;
end open_pdbs;
/
So, correct answers: B, C, E.
BCE