Oracle RAC 12c Pluggable Database Error ORA-01033
Just recently my company decided to try out Oracle 12c for production. I have been "playing" around with it for few months so I thought it wouldn't be such a big deal to adapt from 11g. I installed the 12c, created the container database (
cdb), and then created some pluggable databases (
pdb). I opened all the
pdbs by executing command
ALTER PLUGGABLE DATABASE ALL OPEN; with no errors. However, when I tried to connect to one of the
pdbs, something happened:
SQL> conn user/password@pdb1 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>
My first thought was maybe the
pdb wasn't opened yet, so I queried the status of the
pdb from the container.
SQL> SELECT con_id,name,open_mode 2 FROM v$pdbs 3 ORDER BY con_id 4 / CON_ID NAME OPEN_MODE ---------- ------------------ ----------- 2 PDB$SEED READ ONLY 3 PDB1 READ WRITE 4 PDB2 READ WRITE 3 rows selected. SQL>
They're all opened, but why did it say
ORACLE initialization or shutdown in progress? A little duckduckgo-ing didn't help. It was frustrating because there weren't many articles around the web about 12c so far. So I turned to Crossy Road for awhile to refresh my brain.
It was a few minutes later I realised something.1 The
cdb I had been playing with was single instance
cdb, while this one was RAC. So instead of
v$pdbs, I thought I should've queried
SQL> SELECT inst_id,con_id,name,open_mode 2 FROM gv$pdbs 3 ORDER BY con_id,inst_id 4 / INST_ID CON_ID NAME OPEN_MODE ---------- ---------- ------------------ ----------- 1 2 PDB$SEED READ ONLY 2 2 PDB$SEED READ ONLY 1 3 PDB1 READ WRITE 2 3 PDB1 MOUNTED 1 4 PDB2 READ WRITE 2 4 PDB2 MOUNTED 6 rows selected. SQL>
Ahh, there's the culprit! I executed the command to open the pluggable database only on one node. It turns out when you open pluggable databases with command
ALTER PLUGGABLE DATABASE ALL OPEN;, it only opens all pluggable databases in
cdb’s instance at node where you execute the command, not all nodes of your
cdb cluster. If you want to open the pluggable databases of the other nodes, you should add
INSTANCES=ALL to your command, or
<cdb_inst> is the instance name(s)2 of container database node where the pluggable database isn't opened yet.
SQL> ALTER PLUGGABLE DATABASE pdb1 OPEN INSTANCES=('cdb2'); Pluggable database altered. SQL> conn user/password@pdb1 Connected. SQL>
Finally, it worked. Now, let's get back to Crossy Road.