Oracle 参数 MEMORY_TARGET 官方解释,作用,如何配置最优化建议
本站中文解释
MEMORY_TARGET参数,可以控制Oracle数据库使用的内存大小,一般情况下,Oracle会根据系统的物理内存进行自动调节,但是如果要针对特定的进程进行特别的控制,则需要设置MEMORY_TARGET参数,这个参数控制着Oracle进程可以使用的最大内存大小。
正确设置MEMORY_TARGET参数的步骤如下:
1.确定Oracle进程需要使用多少内存,即需要设置多大的MEMORY_TARGET参数;
2.使用SQL *Plus连接数据库,以sys用户登录,并启用管理视图:
SQL> execute sys.DBMS_SYSCTL.SET_INT_PARAM_IN_MEMORY(‘MEMORY_TARGET’,要设的值);
3.执行”Alter system switch logfile;”命令以使内存参数立即生效。
4.重新连接数据库,查看内存分配情况,使用“show sga” 命令确定所设的MEMORY_TARGET值的正确性。
官方英文解释
MEMORY_TARGET specifies the Oracle systemwide usable memory. The database tunes memory to the MEMORY_TARGET value, reducing or enlarging the SGA and PGA as needed.
| Property | Description |
|---|---|
|
Parameter type |
Big integer |
|
Syntax |
|
|
Default value |
|
|
Modifiable |
|
|
Modifiable in a PDB |
No |
|
Range of values |
152 MB to |
|
Basic |
No |
MEMORY_TARGET should be set higher than or equal to the sum of the current sizes of the SGA and PGA.
In a text-based initialization parameter file, if you omit MEMORY_MAX_TARGET and include a value for MEMORY_TARGET, then the database automatically sets MEMORY_MAX_TARGET to the value of MEMORY_TARGET. If you omit the line for MEMORY_TARGET and include a value for MEMORY_MAX_TARGET, the MEMORY_TARGET parameter defaults to zero. After startup, you can then dynamically change MEMORY_TARGET to a nonzero value, provided that it does not exceed the value of MEMORY_MAX_TARGET.
Total memory usage can grow beyond the value of MEMORY_TARGET. For example, memory is allocated to PL/SQL tables and varrays regardless of the value of MEMORY_TARGET as long as memory is available at the operating system level.
In the Default value field, IMMEDIATE mode autotuning requests are necessary to avoid ORA-04031 errors. The DEFERRED and IMMEDIATE modes are reflected in the OPER_MODE column of the V$MEMORY_RESIZE_OPS view.
Note:
The default value of SGA_MAX_SIZE depends on the values of MEMORY_TARGET and MEMORY_MAX_TARGET.
See Also:
-
Oracle Database
Administrator’s Guide for more information about managing memory -
Oracle Multitenant
Administrator’s Guide for information about the initialization parameters that control the memory usage of PDBs