Thursday, December 5, 2019

CDB and PDB Startup and Shutdown

Click on the link below for a tutorial on Oracle Multitenant Architecture - Startup, Shutdown, and Availability of CDBs and PDBs. This link points to  a YouTube video.



Oracle Multitenant Architecture - Startup, Shutdown, and Availability of CDBs and PDBs



Demo - Startup and Shutdown Using SQL*Plus


Demo - Startup and Shutdown Using RMAN





Examples


SQL*Plus


SYS@XE>
SYS@XE>shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SYS@XE>startup nomount
ORACLE instance started.

Total System Global Area,1073738624,bytes
Fixed Size              ,   9036672,bytes
Variable Size           , 536870912,bytes
Database Buffers        , 524288000,bytes
Redo Buffers            ,   3543040,bytes
SYS@XE>show con_name

CON_NAME
------------------------------
CDB$ROOT
SYS@XE>show pdbs
SYS@XE>startup mount
ORA-01081: cannot start already-running ORACLE - shut it down first
SYS@XE>startup force
ORACLE instance started.

Total System Global Area,1073738624,bytes
Fixed Size              ,   9036672,bytes
Variable Size           , 536870912,bytes
Database Buffers        , 524288000,bytes
Redo Buffers            ,   3543040,bytes
Database mounted.
Database opened.
SYS@XE>
SYS@XE>
SYS@XE>show con_name

CON_NAME
------------------------------
CDB$ROOT
SYS@XE>
SYS@XE>
SYS@XE>show pdbs

    CON_ID,CON_NAME                      ,OPEN MODE ,RESTRICTED
----------,------------------------------,----------,----------
         2,PDB$SEED                      ,READ ONLY ,NO
         3,PDB1                          ,MOUNTED   ,
SYS@XE>startup pluggable database pdb1 open
Pluggable Database opened.
SYS@XE>
SYS@XE>show pdbs

    CON_ID,CON_NAME                      ,OPEN MODE ,RESTRICTED
----------,------------------------------,----------,----------
         2,PDB$SEED                      ,READ ONLY ,NO
         3,PDB1                          ,READ WRITE,NO
SYS@XE>



RMAN



RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down

RMAN> startup nomount

connected to target database (not started)
Oracle instance started

Total System Global Area    1073738624 bytes

Fixed Size                     9036672 bytes
Variable Size                536870912 bytes
Database Buffers             524288000 bytes
Redo Buffers                   3543040 bytes

RMAN> show con_name

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "all, archivelog, auxiliary, auxname, backup, channel, compression, controlfile, datafile, db_unique_name, default, device, encryption, exclude, incremental, maxsetsize, retention, snapshot, "
RMAN-01008: the bad identifier was: con_name
RMAN-01007: at line 1 column 6 file: standard input

RMAN> startup mount

database is already started
database mounted

RMAN> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
xe               MOUNTED

RMAN> select substr(name, 1,10) name, open_mode from v$pdbs;

NAME                                     OPEN_MODE
---------------------------------------- ----------
PDB$SEED                                 MOUNTED
PDB1                                     MOUNTED

RMAN> startup open

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "open": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01007: at line 1 column 9 file: standard input

RMAN> startup

database is already started
database opened

RMAN> select substr(name,1,10) name, open_mode from v$pdbs;

NAME                                     OPEN_MODE
---------------------------------------- ----------
PDB$SEED                                 READ ONLY
PDB1                                     MOUNTED

RMAN> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
xe               OPEN

RMAN> startup pluggable database pdb1 open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "pluggable": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01007: at line 1 column 9 file: standard input

RMAN> alter pluggable database pdb1 open;

Statement processed

RMAN>


No comments:

Post a Comment