oracle12c_pdb_SAVE STATE
程序员文章站
2022-05-29 17:33:25
...
在12.1.0.1的时候pdb不能跟随cdb自动open,如果实现自动打开基本靠触发器,在12.1.0.2的时候可以使用参数SAVE STATE来保存pdb在关闭前的状态 SQL SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- -----
在12.1.0.1的时候pdb不能跟随cdb自动open,如果实现自动打开基本靠触发器,在12.1.0.2的时候可以使用参数SAVE STATE来保存pdb在关闭前的状态
SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB MOUNTED 4 PDB2 MOUNTED 5 PDB3 MOUNTED 6 PDB4 MOUNTED 7 PDB5 MOUNTED SQL> shutdown immediate; DATABASE closed. DATABASE dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 838860800 bytes Fixed SIZE 2921400 bytes Variable SIZE 608177224 bytes DATABASE Buffers 222298112 bytes Redo Buffers 5464064 bytes DATABASE mounted. DATABASE opened. SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB MOUNTED 4 PDB2 MOUNTED 5 PDB3 MOUNTED 6 PDB4 MOUNTED 7 PDB5 MOUNTED SQL> ALTER pluggable DATABASE ALL save state 2 ; Pluggable DATABASE altered. SQL> shutdown immediate; DATABASE closed. DATABASE dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 838860800 bytes Fixed SIZE 2921400 bytes Variable SIZE 608177224 bytes DATABASE Buffers 222298112 bytes Redo Buffers 5464064 bytes DATABASE mounted. DATABASE opened. SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB MOUNTED 4 PDB2 MOUNTED 5 PDB3 MOUNTED 6 PDB4 MOUNTED 7 PDB5 MOUNTED
可以看出如果pdb是mount状态的时候来设置SAVE STATE,在数据库restart的时候也是mount
SQL> ALTER pluggable DATABASE ALL DISCARD STATE; Pluggable DATABASE altered. SQL> ALTER pluggable DATABASE ALL OPEN; Pluggable DATABASE altered. SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB READ WRITE NO 4 PDB2 READ WRITE NO 5 PDB3 READ WRITE NO 6 PDB4 READ WRITE NO 7 PDB5 READ WRITE NO SQL> ALTER pluggable DATABASE ALL save state; Pluggable DATABASE altered. SQL> shutdown immediate; DATABASE closed. DATABASE dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 838860800 bytes Fixed SIZE 2921400 bytes Variable SIZE 608177224 bytes DATABASE Buffers 222298112 bytes Redo Buffers 5464064 bytes DATABASE mounted. DATABASE opened. SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB READ WRITE NO 4 PDB2 READ WRITE NO 5 PDB3 READ WRITE NO 6 PDB4 READ WRITE NO 7 PDB5 READ WRITE NO
SQL> ALTER pluggable DATABASE ALL DISCARD STATE; Pluggable DATABASE altered. SQL> ALTER pluggable DATABASE ALL close; Pluggable DATABASE altered. SQL> ALTER pluggable DATABASE ALL save state; Pluggable DATABASE altered. SQL> shutdown immediate; DATABASE closed. DATABASE dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 838860800 bytes Fixed SIZE 2921400 bytes Variable SIZE 608177224 bytes DATABASE Buffers 222298112 bytes Redo Buffers 5464064 bytes DATABASE mounted. DATABASE opened. SQL> SHOW pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB MOUNTED 4 PDB2 MOUNTED 5 PDB3 MOUNTED 6 PDB4 MOUNTED 7 PDB5 MOUNTED
原文地址:oracle12c_pdb_SAVE STATE, 感谢原作者分享。
上一篇: 如何设置apache的最大空闲进程数
下一篇: MYSQL explain 执行计划
推荐阅读
-
英语单词state与status的区别
-
mysql show processlist中state含义
-
Vuex之理解state的用法实例
-
spark利用yarn提交任务报:YARN application has exited unexpectedly with state UNDEFINED
-
Win10蓝屏错误代码device power state failure怎么修复
-
使用vuex解决刷新页面state数据消失的问题记录
-
iOS App的设计模式开发中对State状态模式的运用
-
使用vuex解决刷新页面state数据消失的问题记录
-
Vuex中的State使用介绍
-
pytorch 状态字典:state_dict使用详解