I have added the HR data base to oracle 19c, but the thing is, every time I execute the sqldeveloper, it says the database is not open, so then I go to cmd and execute the following scripts, but is there any way to keep it always open? I don't want to go to cmd all the time.
sqlplus / as sysdba
show con_name;
ALTER SESSION SET CONTAINER = orclpdb;
COLUMN name FORMAT a20;
SELECT name, open_mode from v$pdbs;
ALTER PLUGGABLE DATABASE open;
ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;
conn hr/hr@orclpdb;
SHOW USER;'
Since 12.1.0.2 the new clause
SAVE STATE
was added to the statementALTER PLUGGABLE DATABASE
.After restart all PDB's remain closed:
Preserve thе last state of PDB (all PDB's with
ALL
instead of PDB name):Now, after restart the desired PDB will be opened automatically: