Your SlideShare is downloading. ×
Tuning SGA
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Tuning SGA

259

Published on

Published in: Technology, Health & Medicine
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
259
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Anar Godjaev http://anargodjaev.wordpress.com/ Tuning SGA -- monitoring SGA system parameters --- max size of the sga select name, value, description from v$parameterwhere name='sga_max_size'; -- sum of all values of the following query cannot exceed sga_max_size select sum(value) from ( select name, value, description from v$parameter where name in ('java_pool_size', 'shared_pool_size', 'large_pool_size') UNION select name, value, description from v$parameterwhere name like 'db_%cache_size' UNION select name, value, description from v$parameterwhere name='log_buffer' ); ------- lets have a look at something the value of sga_max_size may not be equal to the sum of its components the difference between these tow values will give you the approximate free space selecttrunc(((t2.sga_max_size - t1.total_sga_params)/1024/1024)) FREE_MB from ( select sum(value) total_sga_paramsfrom ( select name, value, description from v$parameter where name in ('java_pool_size', 'shared_pool_size', 'large_pool_size') UNION select name, value, description from v$parameterwhere name like 'db_%cache_size' UNION select name, value, description from v$parameterwhere name='log_buffer' ) ) t1 ,( select sum(value) sga_max_sizefrom v$parameterwhere name='sga_max_size' ) t2; --- other ways of obtaining free sga size -select* from v$sgastatwhere name='free memory'; selectcurrent_size/1024/1024 MB from v$sga_dynamic_free_memory; --- changing sga and sgacomponenets values
  • 2. Anar Godjaev http://anargodjaev.wordpress.com/ --- recommended: sga_max_size should be phsical_memory/2 alter system set sga_max_size=500M scope=spfile; -- changes of this parameter will take affect after instance restart alter system set java_pool_size=150M scope=spfile; -- changes of this parameter will take affect after instance restart alter system set shared_pool_size=150M; alter system set large_pool_size=50M; alter system set db_cache_size=150M; -- which system parameter can be changed without an instance restart -select* from v$parameterwhere issys_modifiable='IMMEDIATE' --- following parameter needs an instance restart -select* from v$parameterwhere issys_modifiable!='FALSE' -- to change these kind of system parameters following steps can be followed alter system set <name>=<value> scope=spfile; -- from now on you should login from sqlplus "/as sysdba" alter system checkpoint; shutdown immediate; startup; Advices for SGA --- advices for sga -select* from V$SHARED_POOL_ADVICE; select* from V$DB_CACHE_ADVICE; select* from V$PGA_TARGET_ADVICE; NOTES: 1- db_cache_advice system parameter should be ON for v$shared_pool_advice system view can be up-to-date. 2- for all advice views statistics_level system parameter should be at least in BASIC mode. -- setting db_cache_advice system parameter -select name, value, issys_modifiable, description from v$parameter where name='db_cache_advice'; alter system set db_cache_advice='ON';
  • 3. Anar Godjaev http://anargodjaev.wordpress.com/ select name, value, issys_modifiable, description from v$parameter where name='db_cache_advice'; --- modifying statistics_level -select value from v$parameterwhere name='statistics_level'; alter system set statistics_level='TYPICAL'; -- allowed values are [ALL|TYPICAL|BASIC]

×