您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

设置pdb随cdb一起启动

2024/3/25 20:46:52发布15次查看
在oracle 12.1.0.1版本中,在cdb数据库启动过程中,业务pdb无法自动open,如果要实现该功能,需要人工写触发器来实现cdb open后,pdb 给open起来.在12.1.0.2及其以后版本,可以通过设置alter pluggable database pdb save state来实现在cdb open之后业务pdb能够自
在oracle 12.1.0.1版本中,在cdb数据库启动过程中,业务pdb无法自动open,如果要实现该功能,需要人工写触发器来实现cdb open后,pdb 给open起来.在12.1.0.2及其以后版本,可以通过设置alter pluggable database pdb save state来实现在cdb open之后业务pdb能够自动open.
数据库启动后pdb未自动open
xff_cdb$root@sys> startuporacle 例程已经启动。total system global area 805306368 bytesfixed size 3050800 bytesvariable size 394265296 bytesdatabase buffers 297795584 bytesredo buffers 5337088 bytesin-memory area 104857600 bytes数据库装载完毕。数据库已经打开。xff_cdb$root@sys> select * from v$version;banner con_id-------------------------------------------------------------------------------- ----------oracle database 12c enterprise edition release 12.1.0.2.0 - 64bit production 0pl/sql release 12.1.0.2.0 - production 0core 12.1.0.2.0 production 0tns for 64-bit windows: version 12.1.0.2.0 - production 0nlsrtl version 12.1.0.2.0 - production 0xff_cdb$root@sys> show pdbs; con_id con_name open mode restricted---------- ------------------------------ ---------- ---------- 2 pdb$seed read only no 3 pdb mounted
查询dba_pdb_saved_states无记录
xff_cdb$root@sys> select con_name, state from dba_pdb_saved_states;未选定行
在数据库mount状态下save state
xff_cdb$root@sys> alter pluggable database pdb save state;插接式数据库已变更。xff_cdb$root@sys> select con_name, state from dba_pdb_saved_states;未选定行
pdb为mount状态下,执行save state无记录,证明save state不成功
在数据库open状态下save state—-设置pdb随cdb启动
xff_cdb$root@sys> alter pluggable database pdb open;插接式数据库已变更。xff_cdb$root@sys> alter pluggable database pdb save state;插接式数据库已变更。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
pdb为open状态下,执save state成功.
需要注意save state需要在pdb open情况下执行才能够生效.
重启数据库测试pdb随cdb启动
xff_cdb$root@sys> shutdown immediate数据库已经关闭。已经卸载数据库。oracle 例程已经关闭。xff_cdb$root@sys> startuporacle 例程已经启动。total system global area 805306368 bytesfixed size 3050800 bytesvariable size 364905168 bytesdatabase buffers 327155712 bytesredo buffers 5337088 bytesin-memory area 104857600 bytes数据库装载完毕。数据库已经打开。xff_cdb$root@sys> show pdbs; con_id con_name open mode restricted---------- ------------------------------ ---------- ---------- 2 pdb$seed read only no 3 pdb read write no
禁用pdb随cdb启动—discard state
xff_cdb$root@sys> alter pluggable database pdb discard state;插接式数据库已变更。xff_cdb$root@sys> select con_name, state from dba_pdb_saved_states;未选定行xff_cdb$root@sys> shutdown immediate;数据库已经关闭。已经卸载数据库。oracle 例程已经关闭。xff_cdb$root@sys> startuporacle 例程已经启动。total system global area 805306368 bytesfixed size 3050800 bytesvariable size 364905168 bytesdatabase buffers 327155712 bytesredo buffers 5337088 bytesin-memory area 104857600 bytes数据库装载完毕。数据库已经打开。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>
12.1.0.1中设置pdb随cdb启动
create trigger open_all_pdbs after startup on databasebegin execute immediate 'alter pluggable database all open';end open_all_pdbs;/
oracle 12c redo异常恢复测试—部分pdb未正常openoracle 12c redo异常恢复测试—打上patch恢复完全oracle 12c 控制文件异常恢复oracle 12c cdb中pdb参数管理机制oracle 12c pdb 维护基础介绍pdb正常运行丢失数据文件相关恢复ora-38760: 此数据库实例无法启用闪回数据库11gr2升级到12cr1并插入cdb 原文地址:设置pdb随cdb一起启动, 感谢原作者分享。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product