在 Oracle 12.1 中,在一个实例中的所有 PDB 只能共享同一个 UNDO 表空间 , 称之为 Global Shared Undo 模式 , 即共享 Undo 模式 。目前保留 共享 Undo 模式 只是为了升级过渡 。 在 Oracle 12.2 中 , 引入了 PDB Local UNDO 模式 , 每个 PDB 都有各自的 undo 表空间。对于 RAC 是每个实例每个 container 都有自己的 UNDO 表空间 , 这也正是推荐的 。 这种新的管理机制就叫做本地 undo 模式。本地 undo 模式为新建数据库的默认模式。在 DBCA 时会有 local undo 选项,且默认勾选。
SQL> col PROPERTY_NAME for a25;
SQL>
SQL> col PROPERTY_VALUE for a25;
SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name='LOCAL_UNDO_ENABLED';
PROPERTY_NAME PROPERTY_VALUE
------------------------- -------------------------
LOCAL_UNDO_ENABLED TRUE
1.local undo转化为shared undo步骤
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 2516581456 bytes
Fixed Size 9141328 bytes
Variable Size 721420288 bytes
Database Buffers 1778384896 bytes
Redo Buffers 7634944 bytes
Database mounted.
Database opened.
SQL> alter database local undo off;
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2516581456 bytes
Fixed Size 9141328 bytes
Variable Size 721420288 bytes
Database Buffers 1778384896 bytes
Redo Buffers 7634944 bytes
Database mounted.
Database opened.
SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name='LOCAL_UNDO_ENABLED';
PROPERTY_NAME PROPERTY_VALUE
------------------------- -------------------------
LOCAL_UNDO_ENABLED FALSE
操作完成后,之前存在的undo表空间不会自动删除。
2.shared undo转化为local undo步骤
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 2516581456 bytes
Fixed Size 9141328 bytes
Variable Size 721420288 bytes
Database Buffers 1778384896 bytes
Redo Buffers 7634944 bytes
Database mounted.
Database opened.
SQL> alter database local undo on;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2516581456 bytes
Fixed Size 9141328 bytes
Variable Size 721420288 bytes
Database Buffers 1778384896 bytes
Redo Buffers 7634944 bytes
Database mounted.
Database opened.
SQL> alter pluggable database PDB02 open;
Pluggable database altered.
SQL> col PROPERTY_NAME for a25;
SQL> col PROPERTY_VALUE for a25;
SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name='LOCAL_UNDO_ENABLED';
PROPERTY_NAME PROPERTY_VALUE
------------------------- -------------------------
LOCAL_UNDO_ENABLED TRUE
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 PDB02 READ WRITE NO
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle