Oracle 12.2 PDB的内存资源管理

原文链接:https://oracle-base.com/articles/12c/multitenant-memory-resource-management-for-pdbs-12cr2

12.2之前的版本,我们根本没有办法控制一个单独的PDB能使用的内存总量。导致的结果就是“一个糟糕的邻居”可能占用大量内存从而导致同一个实例下其他PDB的性能下降。在Oracle 12.2中,你可以控制某单个PDB能使用的内存总量。

如果你的CDB中只有一个PDB,那么你就不需要做这些限制,因为你本来就想让这个单独的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.

* SGA_TARGET : The maximum SGA size for the PDB.

关于哪些值可以设置也有一些限制,官方文档中给出了详细的解释(http://docs.oracle.com/database/122/ADMIN/using-oracle-resource-manager-for-pdbs-with-sql-plus.htm#ADMIN-GUID-A3459A8B-A36A-44D4-9FCD-75CA0E3D3252
 

设置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;

猜你喜欢

转载自blog.csdn.net/j_ychen/article/details/80497279