Thinking Out Loud

August 1, 2013

12c Startup and Shutdown – Oracle Multitenant (PDB)

Filed under: 12c — mdinh @ 1:22 pm

Eventually, all databases will be container based. The first PDB in container is FREE, additional PDB is license option.

Startup / Shutdown Summary:

Starting CDB (container database) will NOT OPEN PDB (pluggable database)

Use SHOW CON_NAME to know where you are at, i.e. CDB or PDB

Use ALL to have OPEN/CLOSE all PDB, i.e. ALTER PLUGGABLE DATABASE ALL OPEN;

Use ALTER SESSION to switch to PDB, i.e. alter session set container=PDB01;

Demo:

> sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 1 05:41:27 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, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> SHOW CON_NAME

CON_NAME
------------------------------
CDB$ROOT

SQL> SHOW PDBS

CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          READ WRITE NO

SQL> shutdown immediate;

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> SHOW CON_NAME

ERROR:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SP2-1545: This feature requires Database availability.

SQL> startup;

ORACLE instance started.

Total System Global Area 3206836224 bytes
Fixed Size                  2293496 bytes
Variable Size             738197768 bytes
Database Buffers         2449473536 bytes
Redo Buffers               16871424 bytes
Database mounted.
Database opened.

SQL> SHOW CON_NAME

CON_NAME
------------------------------
CDB$ROOT

SQL> SHOW PDBS

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          MOUNTED

SQL> ALTER PLUGGABLE DATABASE PDB01 OPEN;

Pluggable database altered.
SQL> SHOW PDBS

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          READ WRITE NO

SQL> ALTER PLUGGABLE DATABASE ALL CLOSE;

		 
Pluggable database altered.

SQL> SHOW PDBS

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          MOUNTED
SQL>

SQL> ALTER PLUGGABLE DATABASE ALL OPEN;

Pluggable database altered.

SQL> alter session set container=PDB01;

Session altered.

SQL> SHOW CON_NAME

CON_NAME
------------------------------
PDB01
SQL>

References:

ALTER PLUGGABLE DATABASE

Oracle Multitenant Overview

Oracle Multitenant Learn More

About these ads

2 Comments »

  1. […] Startup and shutdown of PDBs […]

    Pingback by Oracle Database 12c (12.1) Installation and New Features | DBLinks Consulting Ltée — August 19, 2013 @ 7:00 pm | Reply

  2. Nice. Wondered how long it would be before Oracle adopted the SQL Server model.

    Comment by Ade R. — December 20, 2013 @ 11:48 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 294 other followers

%d bloggers like this: