0% found this document useful (0 votes)
38 views2 pages

CH 14 SQL

This document discusses parameters and views for monitoring and tuning automatic memory management in Oracle. It provides the MEMORY_TARGET and MEMORY_MAX_TARGET parameters for setting system memory, shows commands for setting these parameters, and lists views like V$MEMORY_CURRENT_RESIZE_OPS, V$MEMORY_DYNAMIC_COMPONENTS, V$MEMORY_RESIZE_OPS, and V$MEMORY_TARGET_ADVICE that can be queried to monitor automatic memory management. It also provides examples of queries to view the current status and sizes of memory components.

Uploaded by

Khan Bahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

CH 14 SQL

This document discusses parameters and views for monitoring and tuning automatic memory management in Oracle. It provides the MEMORY_TARGET and MEMORY_MAX_TARGET parameters for setting system memory, shows commands for setting these parameters, and lists views like V$MEMORY_CURRENT_RESIZE_OPS, V$MEMORY_DYNAMIC_COMPONENTS, V$MEMORY_RESIZE_OPS, and V$MEMORY_TARGET_ADVICE that can be queried to monitor automatic memory management. It also provides examples of queries to view the current status and sizes of memory components.

Uploaded by

Khan Bahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

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;

You might also like