Download presentation
Presentation is loading. Please wait.
Published bySalvatore McDonald Modified over 10 years ago
1
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance
2
13-2 Copyright © 2005, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Troubleshoot invalid and unusable objects Gather optimizer statistics View performance metrics Deal with performance issues
3
13-3 Copyright © 2005, Oracle. All rights reserved. Performance Monitoring Memory allocation issues Memory allocation issues Input/outpu t device contention Input/outpu t device contention Application code problems Application code problems Resource contention Resource contention Network bottlenecks Network bottlenecks ? DBA
4
13-4 Copyright © 2005, Oracle. All rights reserved. Monitoring Methodologies Reactive Proactive: –Server-generated alerts –Automatic Database Diagnostic Monitor (ADDM)
5
13-5 Copyright © 2005, Oracle. All rights reserved. Database and Instance Metrics Several performance statistics are available through: Data dictionary Dynamic performance views Optimizer statistics DBA
6
13-6 Copyright © 2005, Oracle. All rights reserved. Database and Instance Metrics Full Notes Page
7
13-7 Copyright © 2005, Oracle. All rights reserved. Data Dictionary Metrics You can view the status of: PL/SQL code objects Indexes
8
13-8 Copyright © 2005, Oracle. All rights reserved. Invalid and Unusable Objects PL/SQL code objects are recompiled. Indexes are rebuilt.
9
13-9 Copyright © 2005, Oracle. All rights reserved. Invalid and Unusable Objects Full Notes Page
10
13-10 Copyright © 2005, Oracle. All rights reserved. Optimizer Statistics Optimizer statistics are: Not real time Persistent across instance restarts Collected automatically SQL> SELECT COUNT(*) FROM hr.employees; COUNT(*) ---------- 214 SQL> SELECT num_rows FROM dba_tables 2 WHERE owner='HR' AND table_name = 'EMPLOYEES'; NUM_ROWS ---------- 107
11
13-11 Copyright © 2005, Oracle. All rights reserved. Optimizer Statistics Full Notes Page
12
13-12 Copyright © 2005, Oracle. All rights reserved. Using the Manage Optimizer Statistics Page
13
13-13 Copyright © 2005, Oracle. All rights reserved. Manage Optimizer Statistics Page Full Notes Page
14
13-14 Copyright © 2005, Oracle. All rights reserved. Manually Gathering Optimizer Statistics
15
13-15 Copyright © 2005, Oracle. All rights reserved. Dynamic Performance Views Dynamic Performance views are: Real time Nonpersistent across instance restarts SQL> SELECT name, value FROM v$sysstat 2 WHERE name='sorts (memory)' ORDER BY name; NAME VALUE --------------- ---------- sorts (memory) 1979183 SQL> / NAME VALUE --------------- ---------- sorts (memory) 1979184
16
13-16 Copyright © 2005, Oracle. All rights reserved. Viewing Metric Information 1.Use the All Metrics link in the Related Links region. 2.Drill down for in-depth analysis.
17
13-17 Copyright © 2005, Oracle. All rights reserved. Reacting to Performance Issues Use Enterprise Manager to: Find key performance issues Drill down to the root cause
18
13-18 Copyright © 2005, Oracle. All rights reserved. Reacting to Performance Issues Drill down to performance measurements to identify bottlenecks. CPU user: A specific update statement
19
13-19 Copyright © 2005, Oracle. All rights reserved. Tuning Tips Considerations: There are some general guidelines that serve as a starting point in performance tuning. Your situation may not fit the guideline. Test any changes under a representative production environment to see the effects. There are written volumes and multiday classes dedicated to tuning an Oracle database.
20
13-20 Copyright © 2005, Oracle. All rights reserved. Tuning Activities The three activities in performance management are: Performance planning Instance tuning SQL tuning
21
13-21 Copyright © 2005, Oracle. All rights reserved. Performance Planning Investment options System architecture Scalability Application design principles Workload testing, modeling, and implementation Deploying new applications
22
13-22 Copyright © 2005, Oracle. All rights reserved. Performance Planning Full Notes Page
23
13-23 Copyright © 2005, Oracle. All rights reserved. Instance Tuning Have well-defined goals. Allocate memory to database structures. Consider I/O requirements in each part of the database. Tune the operating system for optimal performance of the database.
24
13-24 Copyright © 2005, Oracle. All rights reserved. Tuning Memory Allocation Java pool Database buffer cache Redo log buffer Shared pool Large pool SGA Fixed SGA Streams pool What is the optimal allocation? SGA_TARGET = 8G STATISTICS_LEVEL = TYPICAL
25
13-25 Copyright © 2005, Oracle. All rights reserved. Tuning Memory Allocation Full Notes Page
26
13-26 Copyright © 2005, Oracle. All rights reserved. Memory Tuning: Guidelines Try to fit the SGA into physical memory. Tune for a high buffer cache hit ratio, with the following caveats: –Even valid and necessary full table scans lower it. –It is possible that unnecessary repeated reads of the same blocks are artificially raising it. Use the Memory Advisor.
27
13-27 Copyright © 2005, Oracle. All rights reserved. Memory Tuning Guidelines Full Notes Page
28
13-28 Copyright © 2005, Oracle. All rights reserved. Memory Tuning Guidelines for the Library Cache Establish formatting conventions for developers so that SQL statements match in the cache. Use bind variables. Eliminate unnecessary duplicate SQL. Consider using CURSOR_SHARING. Use PL/SQL when possible. Cache sequence numbers. Pin objects in the library cache.
29
13-29 Copyright © 2005, Oracle. All rights reserved. Memory Tuning Guidelines for the Library Cache Full Notes Page
30
13-30 Copyright © 2005, Oracle. All rights reserved. Tuning I/O Look for hot spots on the disk. Ensure that you have right-sized redo log files. Consider moving redo logs to separate disks. Consider moving archive logs to separate disks. Look for a high I/O rate on the TEMP tablespace. Reduce contention for high I/O data files by segregating them. Consider striping all data across all disks. Consider using Automatic Storage Management.
31
13-31 Copyright © 2005, Oracle. All rights reserved. Tuning I/O Full Notes Page
32
13-32 Copyright © 2005, Oracle. All rights reserved. Tuning SQL Using the SQL Tuning Advisor Using indexes and clusters Using optimizer hints Using V$SQL_PLAN and EXPLAIN PLAN
33
13-33 Copyright © 2005, Oracle. All rights reserved. Tuning SQL Full Notes Page
34
13-34 Copyright © 2005, Oracle. All rights reserved. Tuning Recommendations
35
13-35 Copyright © 2005, Oracle. All rights reserved. Recommendation Plan
36
13-36 Copyright © 2005, Oracle. All rights reserved. SQL Statistics select count(*) from x where object_id < 340 select count(*) from x where object_id < 220 Each statement causes a hard parse.
37
13-37 Copyright © 2005, Oracle. All rights reserved. Identifying Duplicate SQL Bind variable candidates
38
13-38 Copyright © 2005, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Troubleshoot invalid and unusable objects Gather optimizer statistics View performance metrics Deal with performance issues Describe some basic tuning steps
39
13-39 Copyright © 2005, Oracle. All rights reserved. Practice Overview: Monitoring and Improving Performance This practice covers the following topics: Detecting and repairing unusable indexes Using EXPLAIN PLAN Gathering statistics Using the Performance page in Enterprise Manager
40
13-40 Copyright © 2005, Oracle. All rights reserved. Full Notes Page
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.