在Oracle 12.2中,你可以控制某单个PDB能使用的内存总量。
46.1.6 Initialization Parameters That Control Memory for PDBs
Table 46-5 Initialization Parameters That Control the Memory Usage of PDBs
Initialization Parameter
Description
DB_CACHE_SIZE
Sets the minimum, guaranteed buffer cache space for the PDB.
The following requirements must be met:
•It must be less than or equal to 50% of the setting for the DB_CACHE_SIZE in the CDB root.
•The sum of the DB_CACHE_SIZE settings for all PDBs must be less than or equal to 50% of the setting for the DB_CACHE_SIZE in the CDB root.
These requirements do not apply if the SGA_TARGET initialization parameter is set to a non-zero value in the CDB root.
When the SGA_TARGET initialization parameter is set to a non-zero, the following requirements must be met:
•The values of DB_CACHE_SIZE plus SHARED_POOL_SIZE in a PDB must be less than or equal to 50% of the PDB’s SGA_TARGET value.
•The values of DB_CACHE_SIZE plus SHARED_POOL_SIZE in a PDB must be less than or equal to 50% of the SGA_TARGET value at the CDB level.
•The sum of DB_CACHE_SIZE plus SHARED_POOL_SIZE across all the PDBs in a CDB must be less than or equal to 50% of the SGA_TARGET value at the CDB level.
SHARED_POOL_SIZE
Sets the minimum, guaranteed shared pool space for the PDB.
The following requirements must be met:
•It must be less than or equal to 50% of the setting for the SHARED_POOL_SIZE in the CDB root.
•The sum of the SHARED_POOL_SIZE settings for all PDBs must be less than or equal to 50% of the setting for the SHARED_POOL_SIZE in the CDB root.
These requirements do not apply if the SGA_TARGET initialization parameter is set to a non-zero value in the CDB root.
When the SGA_TARGET initialization parameter is set to a non-zero, the following requirements must be met:
•The values of DB_CACHE_SIZE plus SHARED_POOL_SIZE in a PDB must be less than or equal to 50% of the PDB’s SGA_TARGET value.
•The values of DB_CACHE_SIZE plus SHARED_POOL_SIZE in a PDB must be less than or equal to 50% of the SGA_TARGET value at the CDB level.
•The sum of DB_CACHE_SIZE plus SHARED_POOL_SIZE across all the PDBs in a CDB must be less than or equal to 50% of the SGA_TARGET value at the CDB level.
PGA_AGGREGATE_LIMIT
Sets the maximum PGA size for the PDB.
The following requirements must be met:
•It must be less than or equal to the setting for the PGA_AGGREGATE_LIMIT in the CDB root.
•It must be greater than or equal to two times the setting for the PGA_AGGREGATE_TARGET in the PDB.
PGA_AGGREGATE_TARGET
Sets the target aggregate PGA size for the PDB.
The following requirements must be met:
•It must be less than or equal to the PGA_AGGREGATE_TARGET value set at the CDB level.
•It must be less than or equal to 50% of the PGA_AGGREGATE_LIMIT initialization parameter value set at the CDB level.
•It must be less than or equal to 50% of the PGA_AGGREGATE_LIMIT value set in the PDB.
SGA_MIN_SIZE
Sets the minimum SGA size for the PDB.
The following requirements must be met:
•It must be less than or equal to 50% of the setting for the SGA_TARGET in the CDB root.
•It must be less than or equal to 50% of the setting for the SGA_TARGET in the PDB.
•The sum of the SGA_MIN_SIZE settings for all PDBs must be less than or equal to 50% of the setting for the SGA_TARGET in the CDB root.
These requirements do not apply if the SGA_TARGET initialization parameter is not set or is set to 0 (zero) in the CDB root.
The best practice is to limit the sum of the SGA_MIN_SIZE values for all PDBs to 50% or less of the SGA size of the CDB.
SGA_TARGET
Sets the maximum SGA size for the PDB.
The SGA_TARGET setting in the PDB is enforced only if the SGA_TARGET initialization parameter is set to a non-zero value in the CDB root. The SGA_TARGET setting in the PDB must be less than or equal to the SGA_TARGET setting in the CDB root.
These initialization parameters control the memory usage of PDBs only if the following conditions are met:
•The NONCDB_COMPATIBLE initialization parameter is set to false in the CDB root.
•The MEMORY_TARGET initialization parameter is not set or is set to 0 (zero) in the CDB root.
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/admin/using-oracle-resource-manager-for-pdbs-with-sql-plus.html#GUID-A3459A8B-A36A-44D4-9FCD-75CA0E3D3252
How to Control and Monitor the Memory Usage (Both SGA and PGA) Among the PDBs in Mutitenant Database- 12.2 New Feature (文档 ID 2170772.1)