Subscribe to Posts by Email

Subscriber Count

    701

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

12c Database : Managing PDB’s

Starting/Stopping CDB and PDBs

The traditional approach of starting and stopping databases is now only valid for CDB. So in order to start and stop CDB you will use the familiar startup and shutdown commands.

PDBs don’t get automatically started with CDB. Even if your CDB is up and running it is possible that PDBs are still inaccessable. To view the current status of PDBs run the following command.

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

	SQL> alter pluggable database pdbtest open; 

	Pluggable database altered. 

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

Closing the PDB database

SQL> alter pluggable database pdbtest close;
Pluggable database altered.

Closing/open all PDB's at once

	SQL> alter pluggable database all open; 
	Pluggable database altered. 

	SQL> alter pluggable database all close; 
	Pluggable database altered. 

To know about which container you are

	SQL> show con_name 
	CON_NAME 
	------------------------------ 
	PDB12C 

When you connect in PDB and issue shutdown are startup that will be applicable to that PDB ONLY

	SQL> show con_name 
	CON_NAME 
	----------------------------- 
	PDB12C 
	SQL> shutdown immediate; 
	Pluggable Database closed. 
	SQL> startup 
	Pluggable Database opened. 

Renaming the PDB database


	SQL> alter pluggable database pdb_test close; 
	Pluggable database altered. 

	SQL> alter pluggable database pdb_test open restricted; 
	Pluggable database altered. 

	Connect to the PDB Database using ezconnect model

	$ sqlplus sys/oracle@localhost:1521/pdb_test as sysdba 
	SQL*Plus: Release 12.1.0.1.0 Production on Sat Jun 29 01:39:34 2013 
	Copyright (c) 1982, 2013, Oracle. All rights reserved. 
	Connected to: 
	Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 
	With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 

	SQL> show con_name 

	CON_NAME 
	------------------------------ 
	PDB_TEST 

	SQL> alter pluggable database pdb_test rename global_name to pdb3; 
	Pluggable database altered. 

	SQL> alter pluggable database pdb_test rename global_name to pdb3; 
	Pluggable database altered. 

	SQL> alter pluggable database close immediate; 
	Pluggable database altered. 


	SQL> alter pluggable database open; 
	Pluggable database altered. 

	SQL> select name,open_mode from v$pdbs; 

	NAME 				OPEN_MODE 
	------------------------------ ---------- 
	PDB3 				READ WRITE

Comments are closed.