Skip to main content

Can we open a pluggable database if CDB is in mount state?

We cannot open a pluggable database if the CDB is in mount state.

Demo:

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL1210  MOUNTED

SQL> alter session set container=pdb1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB1
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-65054: Cannot open a pluggable database in the desired mode.


Now, I'm opening the container Database first and then running the same command

SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> sho con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> alter database open;

Database altered.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL1210  READ WRITE

SQL>  alter session set container=pdb1;

Session altered.

SQL> sho con_name

CON_NAME
------------------------------
PDB1
SQL> alter database open;

Database altered.
SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------

PDB1                           READ WRITE


Comments

Post a Comment

Popular posts from this blog

How to backup a container database using RMAN?

To backup the container database , connect RMAN to the root using sysdba or sysbackup. Note: sysdbackup is a new user introduced in 12c. After setting the environment variables for the CDB I'm connecting using OS level  authentication   (sysdba is already the part of OS group)  as below. -bash-4.1$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Sat Aug 4 16:50:18 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved. connected to target database: ORCL1210 (DBID=2368395079) Now you can take the backup in the same way you take it for non -CDB databases. RMAN> backup database; Starting backup at 04-AUG-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=21 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set *********************excerpts********************* Starting Control File and SPFILE Autobackup at...