In this article we will learn how to start and stop 12c database having multitenant databases.
For shutting down and starting container database, method is same as standalone database like 11g. Connect to container database(cdb$root) with sysdba and check the status of PDB's
SQL> show pdbs
We are in root container. Now will shutdown one of the pluggable database PDB_TECHON
Below is command we use to stop and start pluggable database
Whenever we start container database, container database(CDB$ROOT) will be opened in read write mode and all PDB's will be in MOUNTED state and default SEED database will always be in READ only mode.
Now will be start our PDB from container database
For shutting down and starting container database, method is same as standalone database like 11g. Connect to container database(cdb$root) with sysdba and check the status of PDB's
SQL> show pdbs
CON_ID CON_NAME
OPEN MODE
RESTRICTED
---------- --------------------------
---------- ----------
2
PDB$SEED
READ ONLY NO
3
PDB_1
READ WRITE NO
4
PDB_TECHON
READ WRITE NO
Here we can see pdbs are in read only and read write mode. first check where we are, whether in PDB or CDB
SQL>
show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL>
We are in root container. Now will shutdown one of the pluggable database PDB_TECHON
Below is command we use to stop and start pluggable database
SQL>
show pdbs
CON_ID CON_NAME
OPEN MODE RESTRICTED
----------
------------------------------ ---------- ----------
2
PDB$SEED
READ ONLY NO
3
PDB_1
READ WRITE NO
4
PDB_TECHON
READ WRITE NO
SQL> alter pluggable database
PDB_TECHON close;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME
OPEN MODE RESTRICTED
----------
------------------------------ ---------- ----------
2
PDB$SEED
READ ONLY NO
3
PDB_1
READ WRITE NO
4
PDB_TECHON
MOUNTED
SQL>
Whenever we start container database, container database(CDB$ROOT) will be opened in read write mode and all PDB's will be in MOUNTED state and default SEED database will always be in READ only mode.
Now will be start our PDB from container database
SQL>
show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL>
SQL> alter pluggable database
PDB_TECHON open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME
OPEN
MODE RESTRICTED
----------
------------------------------ ---------- ----------
2
PDB$SEED
READ ONLY NO
3
PDB_1
READ WRITE NO
4
PDB_TECHON
READ WRITE NO
SQL>
Now perform the same operations from particular PDB (PDB_TECHON). first we need switch to pluggable database using alter session command. We do not need to mentioned pluggable database name while start and stop
Now switch back to container database and check the status of all PDB's
SQL> alter session set container=CDB$ROOT;
Session altered.
SQL>
SQL> show pdbs
CON_ID CON_NAME
OPEN
MODE RESTRICTED
---------- ------------------------------ ----------
----------
2
PDB$SEED
READ ONLY NO
3 PDBGD
READ WRITE NO
4
PDB_TECHON
READ WRITE NO
SQL>
0 comments:
Post a Comment