Oracle Database 10Gr2: An Enlightened Revisit (Before We Give Up and Move To 11G!)
Oracle Database 10Gr2: An Enlightened Revisit (Before We Give Up and Move To 11G!)
AN ENLIGHTENED REVISIT
(BEFORE WE GIVE UP AND MOVE TO
11G!)
* Read the fine print : License required, even for SQL access!
AWR Baselining and comparison
• Enables performance “baselining”
• Collection of two or more snapshots
• Stored in “_BL” tables; data not purged
• View using WRM$_BASELINE/DBA_HIST_BASELINE
• Reports diff via AWRDDRPT.SQL
• Execution statistics for specific SQL statement using
AWRSQRPT.SQL
ASH – What’s up with sessions
• Historical view of active sessions
• Active sessions sampled every second
• Stored in circular memory buffer
• Every 10th sample persisted in AWR
• V$ACTIVE_SESSION_HISTORY : “In-memory”
• WRH$_ACTIVE_SESSION_HISTORY : “Persisted”
• Enables “after-the-fact” analysis!!!
• Reported via ASHRPT (Not available in 10gR1)
• “Slice-and-dice” analysis can reveal a lot of info
ASH – Session states exposed!
• “On-the-spot” analysis
• Retroactive analysis
– From memory buffer (V$ACTIVE_SESSION_HISTORY)
– From persisted AWR data
(WRH$_ACTIVE_SESSION_HISTORY connected via
SNAP_ID)
– Supports manual drill down from AWR/ADDM
• Tracks High load SQL execution behavior
• Determine Blocking sessions and “hot” segments
• SESSION_STATE : “ON CPU” or “WAITING”
ADDM – Your unpaid Tuning Expert!
• Starting point for most investigations
• Runs after every AWR snapshot
• Determines and records performance issue
• Recommends corrective action
• Generates probable benefit
• Suggest use of other advisors
• Common currency - “DB Time” (qualitative!)
• Oracle DB 11g – new “Instance ADDM”
ADDM – Partial check list
• CPU bottlenecks
• Excessive parsing
• Lock contention
• Concurrency
• I/O capacity
• Incorrect sizing of Oracle memory and file structures
• High-load SQL, Java and PL/SQL statements
• Poor connection management
• Hot objects
• RAC-specific issues
ADDM – Findings/Recommendations
• Qualitative rather than Quantitative analysis
• Hardware changes
• Database-configuration changes
• Schema-level changes
• Application changes
• Using other advisors (for example)
– SQL Tuning Advisor / SQL Access Advisor
– Segment Advisor
• Don’t stare at the screen – Use SQL to summarize
– Details in my 2007 paper
Advisors – A step beyond
• Builds on 9i advisors
– Buffer cache advisor
– Shared pool advisor
– MTTR (Mean Time To Recover) advisor
– Summary (MVIEW) advisor
– PGA Target Advisor
• New in 10g
– SQL Tuning Advisor
– SQL Access Advisor
– Segment Advisor
SQL Tuning Advisor
• Frontend to Automatic Tuning Optimizer
• Extension (reuse) of Optimizer (CBO)
• Performs “what-if” analysis
• Not restricted by “time to optimize”
(_optimizer_max_permutations = 2000)
• The following advice is provided
– Gather missing or stale statistics
– Create new indexes
– Restructure SQL statement
– SQL profiles
SQL Tuning Advisor
• SQL Profile
– Collects additional information via sampling/partial
execution techniques
– Verifies and adjusts CBO’s estimates at runtime
– Similar in function to Outlines
– Enabled by category : “test-and-set”
– Access/manipulate – DBMS_SQLTUNE
– Precedence given to Stored Outlines
– Runs against individual SQL or SQL Tuning Sets
(STS)
Other Advisors
• SQL Access Advisor
– Works alongside SQL Tuning Advisor
– Advice on MV, Indexes, MV logs
– Considers space usage vs performance
– Inputs: STS, User-defined, Hypothetical
– Advanced: Workload type (RO), Drop unused indexes,
Filters (Top N, Module)
• Segment Advisor
• Undo Advisor
• Memory Advisor
• Metrics and Server Generated Alerts
Avoiding Advisor Pitfalls
Instance CPU
~~~~~~~~~~~~
% of total CPU for Instance: 3.64
% of busy CPU for Instance: 81.90
%DB time waiting for CPU - Resource Mgr:
/*+
BEGIN_OUTLINE_DATA
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
OPT_PARAM('_b_tree_bitmap_plans' 'false')
OPT_PARAM('_fast_full_scan_enabled' 'false')
*/
New features in DBMS_XPLAN
Peeked Binds (identified by position):
--------------------------------------
1 - :1 (NUMBER): 50357
2 - :1 (NUMBER, Primary=1)
1 - "T"."RESPONSIBILITY_NAME"[VARCHAR2,100]
3 - "T"."RESPONSIBILITY_NAME"[VARCHAR2,100]
4 - "T".ROWID[ROWID,10]
Questions?
Contact information:
[email protected]
Please fill up your evaluation form!
Session # 319
Oracle DB 10g: An enlightened revisit
Thank you!