Startup Single PDB

In Oracle 12c multitenant databases consist of a container database CDB which contain one or more pluggable databases PDB.   Startup of the PDB must be done after the CDB it is contained in has been started.   This procedures covers the startup of a single PDB.

 

  1. Logon to your server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon Jun 24 14:55:04 EDT 2016 on pts/1

[oracle@linux2 ~]$

 

  1. Logon to your CDB where the PDB you wish to start is stored.

 

[oracle@linux2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 25 09:41:06 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

 

SQL> startup open

ORACLE instance started.

 

Total System Global Area  734003200 bytes

Fixed Size                  2928728 bytes

Variable Size             524292008 bytes

Database Buffers          201326592 bytes

Redo Buffers                5455872 bytes

Database mounted.

Database opened.

SQL>

 

 

  1. View the available PDBs within the CDB with SQL statement: select name, open_mode from v$pdbs.

 

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           MOUNTED

 

SQL>

 

NOTE: MOUNTED is the closed state for a PDB while it CDB is open.

 

  1. You have four options for PDBs to choose from:
    1. MOUNTED – PDB closed but CDB open.
    2. OPEN MIGRATE – PDB is open for upgrade and patching.
    3. OPEN READ ONLY – PDB is open for reads but not writes.
    4. OPEN READ WRITE – PDB is open for all operations.

All of this modes can be moved to and from with the SQL statement:  ‘ALTER PLUGGABLE DATABASE <PDB_NAME> <OPTION>;    In this step we will move PDB1 from mounted to open read write.   NOTE: read write is optional.

 

SQL> alter pluggable database pdb1 open;

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           READ WRITE

 

SQL>

 

  1. You can close the PDB with close option.

 

SQL> alter pluggable database pdb1 close;

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           MOUNTED

 

SQL>

 

  1. You can actually specify the read write option and it will be accepted.

 

SQL> alter pluggable database pdb1 open read write;

Pluggable database altered.

 

SQL>  select name, open_mode from v$pdbs;

 

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           READ WRITE

 

SQL>

 

 

  1. You cannot move from read write to simply read option, you have to shut down the PDB first.

 

SQL> alter pluggable database pdb1 open read only;

alter pluggable database pdb1 open read only

*

ERROR at line 1:

ORA-65019: pluggable database PDB1 already open

 

 

SQL> alter pluggable database pdb1 close;

Pluggable database altered.

 

SQL> alter pluggable database pdb1 open read only;

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           READ ONLY

 

SQL>

 

  1. The other options are self-evident. This completes startup of single PDB within its CDB

Larry Catt

OCP

Leave a Reply