How to set PDBs to open automatically when Oracle 12c starts
How to set PDBs to open automatically when Oracle 12c starts, I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Pluggable Database (PDB) is an important new feature in Oracle 12c, but the PDB database is not automatically opened when the 12c instance is started, so PDBs must be opened manually after starting the instance.
1. After the instance is started, open PDBs manually
[Oracle@12c ~] $sqlplus "/ as sysdba" SQL > select open_mode from vault database; SQL > alter pluggable database pdb1 open; SQL > alter pluggable database pdb2 open; SQL > select con_id,name,open_mode from vdatabases;-- or start all PDBs SQL > alter pluggable database all open; 2 with the all option. When the instance starts, all PDBs are automatically opened.
If you do not want to or it is not convenient to open PDBs manually, you can also customize Trigger to open PDBs automatically when you start the instance.
You can create the following triggers under the SYS user in CDB$ROOT:
CREATE TRIGGER open_all_pdbs
AFTER STARTUP
ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database all open'
END open_all_pdbs
/
In this way, when the oracle 12c instance starts, all of its PDBs is automatically opened and available to the user.
After reading the above, have you mastered how to set the PDBs to open automatically when Oracle 12c starts? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!