Articles from Database administrator
workshop
Pluggable database: limitations of the open mode of
the CDB imposed on the o...
2.
3. NAME CON_ID OPEN_MODE
4. ------------------------------ ---------- ----------
5. PDB$SEED 2 READ ONLY
6. PDB001 3 MO...
7. PDB002 4 MOUNTED
You cannot open a pluggable database if the container is not open.
view plainprint?
1. SQL> alter plug...
7. Pluggable database altered.
8.
9. SQL> select name, con_id, open_mode from v$pdbs;
10.
11. NAME CON_ID OPEN_MODE
12. --...
Upcoming SlideShare
Loading in …5
×

Oracle Database 12c and pluggable databases: limitations of the open mode of the CDB imposed on the open mode of PDBs

2,118 views

Published on

Oracle Database 12c and pluggable databases: limitations of the open mode of the CDB imposed on the open mode of PDBs

http://dbaworkshop.blogspot.it/2013/07/Pluggable-database-limitations-of-the-open-mode-of-the-CDB-imposed-on-the-open-mode-of-PDBs.html

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,118
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
49
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Oracle Database 12c and pluggable databases: limitations of the open mode of the CDB imposed on the open mode of PDBs

  1. 1. Articles from Database administrator workshop Pluggable database: limitations of the open mode of the CDB imposed on the open mode of PDBs The open mode of the container database imposes limitations on the open mode of PDBs. For example, the root must be open before any PDBs can be open. Therefore, you might need to change the open mode of the root before changing the open mode of a PDB. Let's start. Verify you are connected to the root container. view plainprint? 1. SQL> SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL; 2. 3. SYS_CONTEXT('USERENV','CON_NAME') 4. -------------------------------------------------------------------------------- 5. CDB$ROOT Verify the open mode from the V$DATABASE view. view plainprint? 1. SQL> select name, con_id, open_mode from v$database; 2. 3. NAME CON_ID OPEN_MODE 4. --------- ---------- -------------------- 5. CDB001 0 READ WRITE I've two pluggable databases in the current container: I want to close the pluggable database called PDB001. view plainprint? 1. SQL> alter pluggable database PDB001 close immediate; 2. 3. Pluggable database altered. Verify the open mode from the V$PDBS view. One of my pluggable databases (PDB002) is available in READ WRITE mode, the second (PDB001) is in MOUNTED mode. The seed (PDB$SEED) is a template that you can use to create new PDBs and is always in READ ONLY mode. view plainprint? 1. SQL> select name, con_id, open_mode from v$pdbs;
  2. 2. 2. 3. NAME CON_ID OPEN_MODE 4. ------------------------------ ---------- ---------- 5. PDB$SEED 2 READ ONLY 6. PDB001 3 MOUNTED 7. PDB002 4 READ WRITE What does it happen to pluggable databases when you shutdown the root container and open it again in MOUNT mode ? view plainprint? 1. SQL> shutdown immediate; 2. Database closed. 3. Database dismounted. 4. ORACLE instance shut down. 5. SQL> startup mount; 6. ORACLE instance started. 7. 8. Total System Global Area 626327552 bytes 9. Fixed Size 2291472 bytes 10. Variable Size 473958640 bytes 11. Database Buffers 146800640 bytes 12. Redo Buffers 3276800 bytes 13. Database mounted. The root container is in MOUNTED mode as expected. view plainprint? 1. SQL> select name, con_id, open_mode from v$database; 2. 3. NAME CON_ID OPEN_MODE 4. --------- ---------- -------------------- 5. CDB001 0 MOUNTED 6. 7. SQL> SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL; 8. 9. SYS_CONTEXT('USERENV','CON_NAME') 10. -------------------------------------------------------------------------------- 11. CDB$ROOT The three pluggable databases are all in MOUNTED mode too. view plainprint? 1. SQL> select name, con_id, open_mode from v$pdbs; 2. 3. NAME CON_ID OPEN_MODE 4. ------------------------------ ---------- ---------- 5. PDB$SEED 2 MOUNTED 6. PDB001 3 MOUNTED
  3. 3. 7. PDB002 4 MOUNTED You cannot open a pluggable database if the container is not open. view plainprint? 1. SQL> alter pluggable database PDB001 open read write; 2. alter pluggable database PDB001 open read write 3. * 4. ERROR at line 1: 5. ORA-01109: database not open Open first the CDB instance containing the root, the seed and its pluggable databases. view plainprint? 1. SQL> alter database open; 2. 3. Database altered. 4. 5. SQL> select name, con_id, open_mode from v$database; 6. 7. NAME CON_ID OPEN_MODE 8. --------- ---------- -------------------- 9. CDB001 0 READ WRITE The seed database is now put in READ ONLY mode; the other two pluggable databases are still in MOUNTED mode. So they don't start automatically and you have to take care of this. view plainprint? 1. SQL> select name, con_id, open_mode from v$pdbs; 2. 3. NAME CON_ID OPEN_MODE 4. ------------------------------ ---------- ---------- 5. PDB$SEED 2 READ ONLY 6. PDB001 3 MOUNTED 7. PDB002 4 MOUNTED You can now open pluggable databases as you want. I'm going to open a pluggable database, PDB001, in READ ONLY mode and then PDB002 in READ WRITE mode. view plainprint? 1. SQL> alter pluggable database pdb001 open read only; 2. 3. Pluggable database altered. 4. 5. SQL> alter pluggable database pdb002 open; 6.
  4. 4. 7. Pluggable database altered. 8. 9. SQL> select name, con_id, open_mode from v$pdbs; 10. 11. NAME CON_ID OPEN_MODE 12. ------------------------------ ---------- ---------- 13. PDB$SEED 2 READ ONLY 14. PDB001 3 READ ONLY 15. PDB002 4 READ WRITE As you can see I didn't specify to open the pluggable database PDB002 in READ WRITE mode: as usual when you don't specify a valid option the READ WRITE is the default mode. To open also the PDB001 pluggable database in READ WRITE mode you can use the following command and the FORCE option. view plainprint? 1. SQL> alter pluggable database PDB001 open read write force; 2. 3. Pluggable database altered. 4. 5. SQL> select name, con_id, open_mode from v$pdbs; 6. 7. NAME CON_ID OPEN_MODE 8. ------------------------------ ---------- ---------- 9. PDB$SEED 2 READ ONLY 10. PDB001 3 READ WRITE 11. PDB002 4 READ WRITE That's all.

×