oracle12c/18c安装以后,默认在CDB下建立一个PDB,但是一般情况下,PDB的状态为mount。如何实现PDB启动后,状态变为打开(open)呢?有如下方法:
方法一:建立触发器,在启动数据库时自动启动(假设PDB名为pdbmine)
create trigger open_pdb as
after startup on database
begin
execute immediate ‘alter pluggable database pdbmine open’;
end open_pdb;
注:有多个PDB需要全部开启,则将pdb名称改为all:
create trigger open_pdb_all as
after startup on database
begin
execute immediate ‘alter pluggable database all open’;
end open_pdb_all;
方法二:打开PDB后,保存启动状态:
SQL>alter pluggable database pdbmine open;
SQL>alter pluggable database pdbmine save state;
「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」
(๑>ڡ<)☆谢谢老板~
使用微信扫描二维码完成支付