0

I am trying to connect to pluggable databases previously created and could not do it.

Option 1

SQL> conn /as sysdba;
    Connected.
    SQL> conn system/system
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    Process ID: 0
    Session ID: 0 Serial number: 0
    
    
    Warning: You are no longer connected to ORACLE.
    SQL>

Warning: You are no longer connected to ORACLE.

/

Option 2

SQL> show pdbs;
SQL> conn / as sysdba;
Connected.
SQL> show pdbs;
SQL> alter pluggable database orclpdb open;
alter pluggable database open
*
ERROR at line 1:
ORA-01109: database not open

Previously I had connected using sql developer and worked.

Updated

My database is not mounted and I tried to mount it and shows the below error details.

   SQL> conn / as sysdba;
    Connected.
    SQL> show con_name;
    
    CON_NAME
    ------------------------------
    CDB$ROOT
    SQL> select open_mode from v$database;
    select open_mode from v$database
                          *
    ERROR at line 1:
    ORA-01507: database not mounted
    
    
    SQL> alter database mount;
    alter database mount
    *
    ERROR at line 1:
    ORA-00214: control file
    'E:\APP\ORACLE\FAST_RECOVERY_AREA\PROD\CONTROLFILE\O1_MF_JCWYX5LY_.CTL' version
    102600 inconsistent with file
    'E:\APP\ORACLE\ORADATA\PROD\CONTROLFILE\O1_MF_JCWYX5BQ_.CTL' version 102597
    
    
    SQL> show parameter control
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    control_file_record_keep_time        integer     7
    control_files                        string      E:\APP\ORACLE\ORADATA\PROD\CON
                                                     TROLFILE\O1_MF_JCWYX5BQ_.CTL,
                                                     E:\APP\ORACLE\FAST_RECOVERY_AR
                                                     EA\PROD\CONTROLFILE\O1_MF_JCWY
                                                     X5LY_.CTL
    control_management_pack_access       string      DIAGNOSTIC+TUNING

1 Answer 1

0

This is because the CDB is at MOUNT, not OPEN, you should open the root container before using PDB.

SQL> conn / as sysdba
Connected.
SQL> show con_name

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

OPEN_MODE
--------------------
MOUNTED

To open the CDB, you may issue the following SQL command or bounce it.

SQL> alter database open;

Database altered.

Then show pdbs again.

SQL> show pdbs;

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

If the PDB is still MOUNTED, then you should open it.

SQL> alter pluggable database orclpdb open;

Pluggable database altered.
Sign up to request clarification or add additional context in comments.

2 Comments

Shows the following error after i tried your answer ORA-00214: control file 'E:\APP\ORACLE\FAST_RECOVERY_AREA\PROD\CONTROLFILE\O1_MF_JCWYX5LY_.CTL' version 102600 inconsistent with file 'E:\APP\ORACLE\ORADATA\PROD\CONTROLFILE\O1_MF_JCWYX5BQ_.CTL' version 102597
ORA-00214 is another issue, your database is unable to open normally at this moment. You should try to make your controlfiles consistent first.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.