I just installed Oracle 12c and I'm trying to connect to the default HR database.
When I open a command prompt and type connect hr/hr@pdborcl;
I get the following:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
To connect to HR, I have to do this first:
connect / as sysdba;
alter pluggable database all open;
Only then can I run hr/hr@pdborcl;
and connect successfully
This is a bit of a pain… having to connect as sysdba and alter the database just to connect. Is there a better way?
As a side note, all of this is on my development laptop. I don't keep Oracle running when it's not needed as that's a waste of CPU and RAM.
Best Answer
Check out this from Oracle-Base about starting and stopping pluggable DBs.
First, they provide a trigger to auto-start your PDB:
And from Oracle 12.1.0.2 onward, we have this command to have Oracle restart the pluggable DB in whatever state it was in at that time (so open the PDBs then run this for each):
But see the link for full details on both examples.