oracle 19c awr_pdb_autoflush_enabled值的修改
发布时间:2022-03-11
修改初始化参数awr_pdb_autoflush_enabled
数据库版本:19C
AWR_PDB_AUTOFLUSH_ENABLED:指定是否为CDB中的所有PDB或CDB中的单个PDB启用或禁用自动工作负载存储库(AWR)快照
以下为将参数由false修改为true的实际操作过程:
问题:在pdb级别与cdb级别修改此参数有什么不同?
验证:pdb级别修改awr_pdb_autoflush_enabled参数
SQL> alter session set container=mypdb2;
Session altered.
SQL> alter system set awr_pdb_autoflush_enabled=true;
System altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean FALSE
SQL> alter session set container=mypdb2;
Session altered.
SQL> alter system set awr_pdb_autoflush_enabled=false;
System altered.
结论:pdb级别修改awr_pdb_autoflush_enabled参数,只会影响该pdb.
验证:cdb级别修改awr_pdb_autoflush_enabled参数
SQL> conn / as sysdba
Connected.
SQL> alter pluggable database all open;
Pluggable database altered.
SQL> alter system set awr_pdb_autoflush_enabled=true;
System altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB2 READ WRITE NO
4 ORCLPDB3 READ WRITE NO
5 PDBC READ WRITE NO
SQL> alter session set container=ORCLPDB3;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> alter session set container=pdbc;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> alter session set container=mypdb2;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean FALSE
结论:cdb级别修改awr_pdb_autoflush_enabled,会影响所有pdb.
前提是不要单独进入某个pdb修改该参数,否则不受cdb级别管控.
如上所示pdb mypdb2该参数的值依然是FALSE
数据库版本:19C
AWR_PDB_AUTOFLUSH_ENABLED:指定是否为CDB中的所有PDB或CDB中的单个PDB启用或禁用自动工作负载存储库(AWR)快照
以下为将参数由false修改为true的实际操作过程:
问题:在pdb级别与cdb级别修改此参数有什么不同?
验证:pdb级别修改awr_pdb_autoflush_enabled参数
SQL> alter session set container=mypdb2;
Session altered.
SQL> alter system set awr_pdb_autoflush_enabled=true;
System altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean FALSE
SQL> alter session set container=mypdb2;
Session altered.
SQL> alter system set awr_pdb_autoflush_enabled=false;
System altered.
结论:pdb级别修改awr_pdb_autoflush_enabled参数,只会影响该pdb.
验证:cdb级别修改awr_pdb_autoflush_enabled参数
SQL> conn / as sysdba
Connected.
SQL> alter pluggable database all open;
Pluggable database altered.
SQL> alter system set awr_pdb_autoflush_enabled=true;
System altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB2 READ WRITE NO
4 ORCLPDB3 READ WRITE NO
5 PDBC READ WRITE NO
SQL> alter session set container=ORCLPDB3;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> alter session set container=pdbc;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean TRUE
SQL> conn / as sysdba
Connected.
SQL> alter session set container=mypdb2;
Session altered.
SQL> show parameter awr_pdb_autoflush_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
awr_pdb_autoflush_enabled boolean FALSE
结论:cdb级别修改awr_pdb_autoflush_enabled,会影响所有pdb.
前提是不要单独进入某个pdb修改该参数,否则不受cdb级别管控.
如上所示pdb mypdb2该参数的值依然是FALSE