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
Follow Me!!!