Oracle 12c中如何自動啟動PDB Pluggable Database

來源:互聯網
上載者:User

Oracle 12c中如何自動啟動PDB Pluggable Database

PDB Pluggable Database是12c的一個重要的新特性, 但是對於CDB中的PDB,預設啟動CDB時不會將所有的PDB帶起來,這樣我們就需要手動alter pluggable database ALL OPEN;

[Oracle@clouds ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on 星期四 3月 31 08:52:31 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

串連到:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> alter pluggable database bidb1 open;

插接式資料庫已變更。

SQL> alter pluggable database bidb2 open;   

插接式資料庫已變更。

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                          OPEN_MODE
---------- ------------------------------ ----------
        2 PDB$SEED                      READ ONLY
        3 BIDB1                          READ WRITE
        4 BIDB2                          READ WRITE

--或是直接啟動所有pluggable資料庫

SQL> alter pluggable database all open;

可以通過添加Trigger的形式來定製化startup時自動將PDB OPEN

使用SYS使用者建立如下觸發器即可:
CREATE TRIGGER open_all_pdbs
  AFTER STARTUP
  ON DATABASE
BEGIN
  EXECUTE IMMEDIATE 'alter pluggable database all open';
END open_all_pdbs;
/

這樣,在oracle 12c database 的cdb啟動後,pdb也會自動啟動了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.