Set pdb to start with cdb

Source: Internet
Author: User
In Oracle12.1.0.1, the Business pdb cannot be automatically opened when the cdb database is started. To implement this function, you need to manually write a trigger to implement the cdbopen, and then the pdb can be opened. in versions 12.1.0.2 and later, you can set ALTERPLUGGABLEDATABASEPDBSAVESTATE to implement business pdb after cdbopen

In Oracle version 12.1.0.1, the pdb cannot be automatically opened during the startup of the cdb database. To enable this function, you need to manually write a trigger to implement the cdb open, and then the pdb can be opened. in versions 12.1.0.2 and later, you can set the alter pluggable database pdb save state to implement business pdb after cdb is open

In Oracle version 12.1.0.1, the pdb cannot be automatically opened during the startup of the cdb database. To enable this function, you need to manually write a trigger to implement the cdb open, and then the pdb can be opened. in versions 12.1.0.2 and later, you can set the alter pluggable database pdb save state to enable business pdb to automatically open after cdb is open.
After the database is started, pdb does not automatically open

The XFF_CDB $ ROOT @ SYS> startupORACLE routine has been started. Total System Global Area 805306368 bytesFixed Size 3050800 bytesVariable Size 394265296 bytesDatabase Buffers 297795584 bytesRedo Buffers 5337088 bytesIn-Memory Area 104857600 bytes database loaded. The database has been opened. XFF_CDB $ ROOT @ SYS> select * from v $ version; BANNER CON_ID detail ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production 0PL/SQL Release 12.1.0.2.0-Production 0 CORE 12.1.0.2.0 Production 0TNS for 64-bit Windows: version 12.1.0.2.0-Production 0 NLSRTL Version 12.1.0.2.0-Production 0XFF_CDB $ ROOT @ SYS> show pdbs; CON_ID CON_NAME open mode restricted -------- tables ---------- 2 PDB $ seed read only no 3 PDB MOUNTED

No record is found for query dba_pdb_saved_states

XFF_CDB $ ROOT @ SYS> select con_name, state from dba_pdb_saved_states; row not selected

Save state in database mount state

XFF_CDB $ ROOT @ SYS> alter pluggable database pdb save state; the plug-in DATABASE has changed. XFF_CDB $ ROOT @ SYS> select con_name, state from dba_pdb_saved_states; row not selected

If pdb is in the mount state, no save state record is executed, proving that the save state is not successful.

Save state in database open state -- set pdb to start with cdb

XFF_CDB $ ROOT @ SYS> alter pluggable database pdb open; the plug-in DATABASE has changed. XFF_CDB $ ROOT @ SYS> alter pluggable database pdb save state; the plug-in DATABASE has changed. XFF_CDB $ ROOT @ SYS> col con_name for a20XFF_CDB $ ROOT @ SYS> select con_name, state from dba_pdb_saved_states; CON_NAME STATE -------------------- -------------- PDB OPEN

If pdb is open, save state is executed successfully.
Note that the save state takes effect only when pdb is open.

Restart the database and test that pdb starts with cdb.

XFF_CDB $ ROOT @ SYS> shutdown the immediate database. The database has been detached. The ORACLE routine has been disabled. The XFF_CDB $ ROOT @ SYS> startupORACLE routine has been started. Total System Global Area 805306368 bytesFixed Size 3050800 bytesVariable Size 364905168 bytesDatabase Buffers 327155712 bytesRedo Buffers 5337088 bytesIn-Memory Area 104857600 bytes database loaded. The database has been opened. XFF_CDB $ ROOT @ SYS> show pdbs; CON_ID CON_NAME open mode restricted ---------- -------------------------------- ---------- 2 PDB $ seed read only no 3 PDB READ WRITE NO

Disable pdb to start with cdb-DISCARD STATE

XFF_CDB $ ROOT @ SYS> alter pluggable database pdb discard state; the plug-in DATABASE has changed. XFF_CDB $ ROOT @ SYS> select con_name, state from dba_pdb_saved_states; the row XFF_CDB $ ROOT @ SYS> shutdown immediate is not selected; the database is closed. The database has been detached. The ORACLE routine has been disabled. The XFF_CDB $ ROOT @ SYS> startupORACLE routine has been started. Total System Global Area 805306368 bytesFixed Size 3050800 bytesVariable Size 364905168 bytesDatabase Buffers 327155712 bytesRedo Buffers 5337088 bytesIn-Memory Area 104857600 bytes database loaded. The database has been opened. XFF_CDB $ ROOT @ SYS> show pdbs; CON_ID CON_NAME open mode restricted ---------- -------------------------------- ---------- 2 PDB $ seed read only no 3 PDB MOUNTEDXFF_CDB $ ROOT @ SYS>

Set pdb to start with cdb in 12.1.0.1

CREATE TRIGGER open_all_pdbs   AFTER STARTUP   ON DATABASEBEGIN   EXECUTE IMMEDIATE 'alter pluggable database all open';END open_all_pdbs;/

  • ORACLE 12C redo exception recovery test-some pdb are not open
  • ORACLE 12C redo exception recovery test-patch-based recovery complete
  • ORACLE 12C control file exception recovery
  • PDB parameter management mechanism in ORACLE 12C CDB
  • Basic Introduction to ORACLE 12C PDB Maintenance
  • Recovery of data files lost during normal operation of pdb
  • ORA-38760: this database instance cannot enable flashback Database
  • Upgrade 11GR2 to 12CR1 and insert CDB

Original article address: Set pdb to start with cdb. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.