12cPDB自启动-创新互联
默认情况下,在CDB 启动的时候,all 的PDB 都是mount状态,也没有默认的机制,在CDB启动时自动启动PDB。
创新互联长期为千余家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为通州企业提供专业的网站设计制作、成都网站设计,通州网站改版等技术服务。拥有10多年丰富建站经验和众多成功案例,为您定制开发。这里我们通过触发器的方式实现。
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;
/
实验过程如下:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1560281088 bytes
Fixed Size 2924784 bytes
Variable Size 956305168 bytes
Database Buffers 587202560 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
SQL> CREATE OR REPLACE TRIGGER open_pdbs
2 AFTER STARTUP ON DATABASE
3 BEGIN
4 EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
5 END open_pdbs;
6 /
Trigger created.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1560281088 bytes
Fixed Size 2924784 bytes
Variable Size 956305168 bytes
Database Buffers 587202560 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
SQL>
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
本文名称:12cPDB自启动-创新互联
网站网址:http://hbruida.cn/article/cechpc.html