startup/shutdown CDB & PDB in oracle 12c
Startup and shutdown of the container database is the same as it has always been for regular instances. The SQL*Plus STARTUP and SHUTDOWN commands are available when connected to the CDB as a privileged user. Some typical values are shown below.
SQL> select name,open_mode ,cdb from v$database;
NAME OPEN_MODE CDB
--------- -------------------- ---
CDB1 READ WRITE YES
SQL> select pdb_name from dba_pdbs;
PDB_NAME
--------------------------------------------------------------------------------
PDB$SEED
PDB1
PDB4
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2290416 bytes
Variable Size 1711279376 bytes
Database Buffers 419430400 bytes
Redo Buffers 4886528 bytes
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.
SQL> select name,open_mode ,cdb from v$database;
NAME OPEN_MODE CDB
--------- -------------------- ---
CDB1 READ WRITE YES
SQL> select pdb_name,status from dba_pdbs;
PDB_NAME
--------------------------------------------------------------------------------
STATUS
-------------
PDB$SEED
NORMAL
PDB1
NORMAL
PDB4
NORMAL
PDB start/stop
ALTER PLUGGABLE DATABASE pdb1 OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE pdb1 CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE OPEN READ WRITE;
ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;
SQL>
ALTER PLUGGABLE DATABASE pdb1 OPEN READ ONLY FORCE;SQL>
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE pdb1 CLOSE IMMEDIATE;
Pluggable database altered.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 MOUNTED
PDB4 READ WRITE
SQL> ALTER PLUGGABLE DATABASE pdb1 OPEN READ ONLY FORCE;
Pluggable database altered.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ ONLY
PDB4 READ WRITE
SQL> ALTER PLUGGABLE DATABASE pdb1 CLOSE IMMEDIATE;
Pluggable database altered.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 MOUNTED
PDB4 READ WRITE
No comments:
Post a Comment