原文链接:https://oracle-base.com/articles/12c/multitenant-memory-resource-management-for-pdbs-12cr2
在12.2之前的版本,我们根本没有办法控制一个单独的PDB能使用的内存总量。导致的结果就是“一个糟糕的邻居”可能占用大量内存从而导致同一个实例下其他PDB的性能下降。在Oracle 12.2中,你可以控制某单个PDB能使用的内存总量。
PDB内存参数
下列参数都可以在PDB级别进行设置:
* DB_CACHE_SIZE : The minimum buffer cache size for the PDB.
* SHARED_POOL_SIZE : The minimum shared pool size for the PDB.
* PGA_AGGREGATE_LIMIT : The maximum PGA size for the PDB.
* PGA_AGGREGATE_TARGET : The target PGA size for the PDB.
* SGA_MIN_SIZE : The minimum SGA size for the PDB.
设置PDB内存参数
Example Setting the Maximum Aggregate PGA Memory Available for a PDB
With the PDB as the current container, run the following SQL statement to set he PGA_AGGREGATE_LIMIT
initialization parameter both in memory and in the spfile to 90 megabytes:
ALTER SYSTEM SET PGA_AGGREGATE_LIMIT = 90M SCOPE = BOTH;
Example Setting the Minimum SGA Size for a PDB
With the PDB as the current container, run the following SQL statement to set the SGA_MIN_SIZE
initialization parameter both in memory and in the spfile to 500 megabytes:
ALTER SYSTEM SET SGA_MIN_SIZE = 500M SCOPE = BOTH;
监控PDB的内存使用
官方文档给出解释:(https://docs.oracle.com/en/database/oracle/oracle-database/12.2/admin/using-oracle-resource-manager-for-pdbs-with-sql-plus.html#GUID-BFBB962E-D5CF-4CD7-B5A5-D6CA74DAA88B)
COLUMN PDB_NAME FORMAT A10 SELECT r.CON_ID, p.PDB_NAME, r.SGA_BYTES, r.PGA_BYTES, r.BUFFER_CACHE_BYTES, r.SHARED_POOL_BYTES FROM V$RSRCPDBMETRIC r, CDB_PDBS p WHERE r.CON_ID = p.CON_ID;