Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 
 

Using v$sys_optimizer_env and v$sess_optimizer_env 

Oracle Database Tips by Donald BurlesonJune 1,  2015

Oracle has several views v$sys_optimizer_env and v$sess_optimizer_env that allow you to see how a specific session has changed from the optimizer default values. 

Querying v$sys_optimizer_env will show you the default SQL cost based optimizer parameter values for your instance:

SQL> select

  2     name,

  3     value,

  4     isdefault

  5  from

  6  v$sys_optimizer_env

  7  order by 3,1;

 

NAME                                     VALUE                     ISD

---------------------------------------- ------------------------- ---

_pga_max_size                            419420 KB                 NO

active_instance_count                    1                         YES

bitmap_merge_area_size                   1048576                   YES

cpu_count                                8                         YES

cursor_sharing                           exact                     YES

hash_area_size                           131072                    YES

is_recur_flags                           0                         YES

optimizer_capture_sql_plan_baselines     false                     YES

optimizer_dynamic_sampling               2                         YES

optimizer_features_enable                11.1.0.6                  YES

optimizer_index_caching                  0                         YES 

optimizer_index_cost_adj                 100                       YES

optimizer_mode                           all_rows                  YES

optimizer_secure_view_merging            true                      YES

optimizer_use_invisible_indexes          false                     YES

optimizer_use_pending_statistics         false                     YES

optimizer_use_sql_plan_baselines         true                      YES

parallel_ddl_mode                        enabled                   YES

parallel_degree                          0                         YES

parallel_dml_mode                        disabled                  YES

parallel_execution_enabled               false                     YES

parallel_query_default_dop               0                         YES 

parallel_query_mode                      enabled                   YES

parallel_threads_per_cpu                 2                         YES

pga_aggregate_target                     2097152 KB                YES

query_rewrite_enabled                    true                      YES

query_rewrite_integrity                  enforced                  YES

result_cache_mode                        MANUAL                    YES

skip_unusable_indexes                    true                      YES

sort_area_retained_size                  0                         YES

sort_area_size                           65536                     YES

star_transformation_enabled              false                     YES

statistics_level                         typical                   YES

transaction_isolation_level              read_commited             YES

workarea_size_policy                     auto                      YES


 

Remember, these are silver bullet parameters, in the sense that a system-wide change to an optimizer parameter will change the entire landscape of SQL performance (and not always in a good way!)

However, there are cases where a change to a specific session can change the default values for a session:

     - The alter session command - alter session set optimizer_mode=first_rows;

     - An optimizer SQL hint - select /*+ first_rows */

     - Using pga_aggregate_target - You will have varying values for hash_area_size and sort_area_size

We can select a specific SID value from v$session and drop it into this query to see specifically what has changed (in this example the SID = 141;

SQL> select name, isdefault from v$ses_optimizer_env

  2  where sid = 141

  3  order by isdefault, name;

 

NAME                                     ISD

---------------------------------------- ---

_pga_max_size                            NO

active_instance_count                    YES

bitmap_merge_area_size                   YES

cpu_count                                YES

cursor_sharing                           YES

hash_area_size                           YES

is_recur_flags                           YES

optimizer_capture_sql_plan_baselines     YES

optimizer_dynamic_sampling               YES

optimizer_features_enable                YES

optimizer_index_caching                  YES

 

NAME                                     ISD

---------------------------------------- ---

optimizer_index_cost_adj                 YES

optimizer_mode                           YES

optimizer_secure_view_merging            YES

optimizer_use_invisible_indexes          YES

optimizer_use_pending_statistics         YES

optimizer_use_sql_plan_baselines         YES

parallel_ddl_mode                        YES

parallel_degree                          YES

parallel_dml_mode                        YES

parallel_execution_enabled               YES

parallel_query_default_dop               YES

 

NAME                                     ISD

---------------------------------------- ---

parallel_query_mode                      YES

parallel_threads_per_cpu                 YES

pga_aggregate_target                     YES

query_rewrite_enabled                    YES

query_rewrite_integrity                  YES

result_cache_mode                        YES

skip_unusable_indexes                    YES

sort_area_retained_size                  YES

sort_area_size                           YES

star_transformation_enabled              YES

statistics_level                         YES

 

NAME                                     ISD

---------------------------------------- ---

transaction_isolation_level              YES

workarea_size_policy                     YES

 

35 rows selected.

 

SQL> spool off



 

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.