The simplest way to manage instance memory is to allow the Oracle Database instance to automatically manage and tune it for you. To do so (on most platforms), you set only a target memory size initialization parameter (MEMORY_TARGET) and optionally a maximum memory size initialization parameter (MEMORY_MAX_TARGET). The total memory that the instance uses remains relatively constant, based on the value of MEMORY_TARGET, and the instance automatically distributes memory between the system global area (SGA) and the instance program global area (instance PGA). As memory requirements change, the instance dynamically redistributes memory between the SGA and instance PGA.
管理实例内存最简单的方式是允许oracle数据库自动管理。为了实现这样,你只需要设置目标内存大小参数(MEMORY_TARGET),和有选择性的最大内存初始参数(MEMORY_MAX_TARGET)。实例总的内存会相对的一致,基于MEMORY_TARGET的值,接着实例在PGA和SGA自动分配内存。当内存需要改变时,实例动态重新分配内存。
Because the MEMORY_TARGET initialization parameter is dynamic, you can change MEMORY_TARGET at any time without restarting the database
MEMORY_TARGET可以在更改,不需要重启数据库
sys@ORCL> alter system set memory_max_target=500M scope=spfile; 更改最大内存
System altered.
sys@ORCL> alter system set memory_target=500M scope=both; 更改目标内存
System altered.
sys@ORCL> ALTER SYSTEM SET SGA_TARGET = 0;
System altered.
sys@ORCL> ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0;
System altered.
sys@ORCL> show parameter target
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 500M
memory_target big integer 500M
parallel_servers_target integer 64
pga_aggregate_target big integer 0
sga_target big integer 0
In a text initialization parameter file, if you omit the line for MEMORY_MAX_TARGET and include a value for MEMORY_TARGET, 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.
在pfile启动中,如果你省略MEMORY_MAX_TARGET这个参数,但是有MEMORY_TARGET这个参数,数据库会自动设置MEMORY_MAX_TARGET在MEMORY_TARGET这个值。如果你忽略MEMORY_TARGET,但是有MEMORY_MAX_TARGET这个值,那么MEMORY_TARGET 默认为零。在重启之后,你可以动态更改MEMORY_TARGET为非零值,前提是不超过最大内存。
The preceding steps instruct you to set SGA_TARGET and PGA_AGGREGATE_TARGET to zero so that the sizes of the SGA and instance PGA are tuned up and down as required, without restrictions. You can omit the statements that set these parameter values to zero and leave either or both of the values as positive numbers. In this case, the values act as minimum values for the sizes of the SGA or instance PGA.
在设置SGA_TARGET和PGA_AGGREGATE_TARGET为零只是为了无限制的调整,你可以忽略这一步,而设置参数。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27137878/viewspace-734901/ ,如需转载,请注明出处,否则将追究法律责任。