5.2.6 Managing XRMEM Cache Quotas for Databases and PDBs

I/O Resource Management (IORM) enables you to control how you want the Exadata RDMA Memory Cache (XRMEM cache) to be shared among different databases and pluggable databases (PDBs).

This can be done using just the CDB resource plan or in conjunction with the I/O Resource Management (IORM) interdatabase plan.

Consider an example intradatabase resource plan for the NEWCDB CDB. The plan specifies memory_min and memory_limit for the 3 PDBs mentioned in the plan.

Note the following:

  • The memory_min and memory_limit values are specified in percentages and range from 0 and 100. Because over-provisioning is supported, the sum of the percentages is not restricted to 100%. If the sum of these values is greater than 100%, then the values are normalized down to a percentage.
  • If memory_min is not specified, then it defaults to 0.
  • If memory_limit is not specified, then it defaults to 100.
  • For CDB$ROOT, there is a 5% memory_limit value.

The following code shows how to create the example intradatabase plan. The sum of the memory_min values is 40%, and the sum of the memory_limit values is 175%, which must be normalized. If an interdatabase plan is not specified, then these percentages apply to the entire size of the XRMEM cache. If an interdatabase plan is specified, then the quotas for the PDBs are computed as a percentage of the xrmemcachemin and xrmemcachesize values for the database as specified in the interdatabase plan directive.

BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
 
DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN(
    plan    => 'NEWCDB_PLAN',
    comment => 'CDB resource plan for newcdb');
 
  DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN_DIRECTIVE(
    plan                  => 'NEWCDB_PLAN', 
    pluggable_database    => 'SALESPDB', 
    memory_min            => 20);
  DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN_DIRECTIVE(
    plan                  => 'NEWCDB_PLAN', 
    pluggable_database    => 'SERVICESPDB', 
    memory_min            => 20,
    memory_limit          => 50);
  DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN_DIRECTIVE(
    plan                  => 'NEWCDB_PLAN', 
    pluggable_database    => 'HRPDB', 
    memory_limit          => 25);
 
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/

In the example above, if no interdatabase plan is specified and the size of the XRMEM cache is 1.25 TB, then the following table shows the breakdown of the quotas after normalization of the limit (because the sum of the memory_limit values is greater than 100%). After normalization, if a minimum value is greater than the corresponding limit, then the minimum value is reduced to make it equal to the limit.

Table 5-6 Case 1: PDB XRMEM Cache Limits with No Interdatabase Plan

PDB XRMEM Cache Min XRMEM Soft Limit Normalized Soft Limit XRMEM Hard Limit

SALESPDB

20% = 256 GB

100 (default)

100 / 175 * 1.25 TB = 731 GB

n/a

SERVICESPDB

20% = 256 GB

50

50 / 175 * 1.25 TB = 366 GB

n/a

HRPDB

0

25

25 / 175 * 1.25 TB = 183 GB

n/a

The next example shows an interdatabase plan with XRMEM cache quotas that includes the NEWCDB CDB.

ALTER IORMPLAN dbplan=                                                                                       -
      ((name=newcdb, share=8, xrmemCacheSize= 200G, flashCacheSize=10G),                                        -
       (name=finance, share=8, xrmemCacheMin= 100G, xrmemCacheLimit= 200G, flashCacheLimit=10G, flashCacheMin=2G), -
       (name=dev, share=2, xrmemCacheMin= 1G, xrmemCacheLimit= 10G, flashCacheLimit=4G, flashCacheMin=1G),    -
       (name=test, share=1))

In addition to the NEWCDB CDB, three other databases (finance, dev, and test) share the same storage servers. XRMEM cache quotas are only enforced if the directives specify the xrmemcachesize, xrmemcachelimit, or xrmemcachemin attributes. The database test does not specify any XRMEM cache directive; so that database and its PDBs (if any exist) are not managed for any XRMEM cache quotas.

Cache limits in an interdatabase IORM plan directive constrain the settings in any corresponding CDB plan. Consequently, if an interdatabase IORM plan directive specifies xrmemcachemin and xrmemcachesize settings for a database, then the PDB-specific memory_min quotas in the CDB plan represent fractions of the xrmemcachemin setting, and the PDB-specific memory_limit values represent fractions of the xrmemcachesize.

However, if the interdatabase IORM plan directive specifies xrmemcachesize without xrmemcachemin, then the PDB-specific memory_min settings are ignored while the memory_limit settings continue to represent fractions of the xrmemcachesize.

So, because the example interdatabase IORM plan directive for newcdb specifies xrmemcachesize without xrmemcachemin, the PDB-specific memory_min quotas in the CDB plan are ignored. The following table lists the effective XRMEM cache limits when applying the example CDB plan together with the example interdatabase IORM plan.

Table 5-7 Case 2: PDB XRMEM Cache Limits with an InterDatabase Plan

PDB XRMEM Cache Min XRMEM Hard Limit Normalized Hard Limit XRMEM Soft Limit

SALESPDB

0

100 (default)

100 / 175 * 200 GB = 114.29 GB

n/a

SERVICESPDB

0

50

50 / 175 * 200 GB = 57.14 GB

n/a

HRPDB

0

25

25 / 175 * 200 GB = 28.57 GB

n/a

For non-CDB databases, the xrmemcachesize, xrmemcachemin, and xrmemcachelimit values are specified in absolute terms and no additional normalization is required. Because xrmemcachemin is a guaranteed reservation, the sum of xrmemcachemin across all the directives should be less than the total size of the XRMEM cache.