Quantcast
Viewing all articles
Browse latest Browse all 668

12c Startup and Shutdown – Oracle Multitenant (PDB)

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


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 668

Trending Articles