SQL> show parameter memory
MEMORY_TARGET :
this parameter sets the system-wide usable memory
that will be used by the instance for SGA and PGA.
MEMORY_MAX_TARGET:
This defines the maximum size the MEMORY_TARGET can
be increased to without an instance restart.
If the MEMORY_MAX_TARGET is not specified,
it defaults to MEMORY_TARGET setting.
-- Set the dynamic parameters. Assuming Oracle has full control.
ALTER SYSTEM SET MEMORY_TARGET=5G SCOPE=SPFILE;
ALTER SYSTEM SET PGA_AGGREGATE_TARGET=0 SCOPE=SPFILE;
ALTER SYSTEM SET SGA_TARGET=0 SCOPE=SPFILE;
SQL> show parameter sga;
Monitoring and Tuning automatic memory management:
Oracle 11g includes four new V$ views to support automatic memory management:
select * from V$MEMORY_CURRENT_RESIZE_OPS;
select * from V$MEMORY_DYNAMIC_COMPONENTS;
select * from V$MEMORY_RESIZE_OPS;
select * from V$MEMORY_TARGET_ADVICE;
######### To display current status of the memory components, use the following
query:
SQL> SELECT COMPONENT, ROUND(CURRENT_SIZE/1024/1024) CURRENT_SIZE
,ROUND(MIN_SIZE/1024/1024) MIN, ROUND(MAX_SIZE/1024/1024) MAX FROM
V$MEMORY_DYNAMIC_COMPONENTS;
SQL> SELECT * FROM v$memory_target_advice ORDER BY memory_size;
############# monitoring Oracle Automatic Shared Memory Management
select component, oper_type, oper_mode, initial_size/1024/1024 "Initial",
TARGET_SIZE/1024/1024 "Target", FINAL_SIZE/1024/1024 "Final", status from
v$sga_resize_ops;
########## scripts for monitoring the shared pool:
SQL > select sum(value) from v$sga;
SQL > select sum(bytes) from v$sgastat;
SQL > select sum(current_size) from v$sga_dynamic_components;
SQL > select * from v$sga_dynamic_free_memory;
############# The amount of memory allocated to each dynamic component is
displayed
using the V$MEMORY_DYNAMIC_COMPONENTS view.
COLUMN component FORMAT A30
SELECT component, current_size, min_size, max_size
FROM v$memory_dynamic_components
WHERE current_size != 0;
SELECT * FROM v$memory_target_advice ORDER BY memory_size;