Wednesday, September 6, 2017

How to open and close a pluggable database in 12c multitenant database

Connect to the container database:

sqlplus sys@cdbveg as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 6 13:22:57 2017

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

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL>

Check status:
select con_id, dbid, name,open_mode from v$containers;


CON_ID DBID NAME OPEN_MODE
1 3465911448 CDB$ROOT READ WRITE
2 374976711 PDB$SEED READ ONLY
3 53565692 PDBVEG1 MOUNTED

Open the pluggable database;

alter pluggable database pdbveg1 open;

Check status again:

CON_ID DBID NAME OPEN_MODE
1 3465911448 CDB$ROOT READ WRITE
2 374976711 PDB$SEED READ ONLY
3 53565692 PDBVEG1 READ WRITE

To close the PDB and bring it back to a mounted state:

alter pluggable database pdbveg1 close;

No comments:

Post a Comment