Oracle 12c; cannot connect to HR without running ALTER PLUGGABLE DATABASE ALL OPEN 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.
Check out this from Oracle-Base about starting and stopping pluggable DBs.

First, they provide a trigger to auto-start your PDB:

CREATE OR REPLACE TRIGGER open_pdbs 
  AFTER STARTUP ON DATABASE 
BEGIN 
   EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN'; 
END open_pdbs;
/


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):

ALTER PLUGGABLE DATABASE pdb1 SAVE STATE;


But see the link for full details on both examples.