Tuesday, March 22, 2016

OPEN ALL PLUGGABLE DATABASES AT ONCE


[oracle@Linux03 Desktop]$ sqlplus /"As sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 22 14:47:02 2016

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  788529152 bytes
Fixed Size    2929352 bytes
Variable Size  541068600 bytes
Database Buffers  239075328 bytes
Redo Buffers    5455872 bytes
Database mounted.
Database opened.


SQL> select name,open_mode from v$pdbs;

NAME       OPEN_MODE
------------------------------ ----------
PDB$SEED       READ ONLY
PDBORCL       MOUNTED
PDBORCL2       MOUNTED
PDBORCL1       MOUNTED

SQL> alter pluggable database all open;

Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME       OPEN_MODE
------------------------------ ----------
PDB$SEED       READ ONLY
PDBORCL       READ WRITE
PDBORCL2       READ WRITE
PDBORCL1       READ WRITE

**************************************************************************************
The pluggable database <pdb> clause can be any of the following:
**************************************************************************************

One or more PDB names, specified as a comma-separated list.
The ALL keyword to indicate all PDBs.
The ALL EXCEPT keywords, followed by one or more PDB names in a comma-separate list, to indicate a subset of PDBs.
Some examples are shown below.

ALTER PLUGGABLE DATABASE pdborcl1, pdborcl2 OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE pdborcl1, pdborcl2 CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL EXCEPT pdborcl1 OPEN;
ALTER PLUGGABLE DATABASE ALL EXCEPT pdborcl1 CLOSE IMMEDIATE;



No comments:

Post a Comment