Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction of Week 10 Assignment Discussion

Similar presentations


Presentation on theme: "Introduction of Week 10 Assignment Discussion"— Presentation transcript:

1 Introduction of Week 10 Assignment Discussion
2011 Fall Assignment Discussion Graded: Midterm Turned in: 8-1 (Homework on Database Security) Due this week: Lab3 (Backup and Recovery) Review of previous week and module Backup choices Recovery strategies Disaster Planning Overview of this week Database Tuning and Monitoring Managing and Monitoring Oracle Database ITEC 450

2 Module 4 Database Tuning
2011 Fall Module 4 Database Tuning ITEC 450 Section 1 Database Tuning and Monitoring

3 Examples of Performance Issues
2011 Fall A query has a response-time problem A query used to run for 5 minutes, now for an hour and still running A tablespace runs out of disk storage space The batch window extends into day Someone submitted a “query from hell” that just won’t stop running, and take away CPU and I/O resources ITEC 450

4 Performance Influential Factors
2011 Fall Workload – a combination of online transactions, batch jobs, ad hoc queries, and other system activities outside of database Throughput – the overall capability of the computer to process data, such as I/O speed Resources – hardware and software tools, such as chips, memory, and database kernel Optimization – query tuning, configuration change Contention – two or more components of the workload are competing a single resource ITEC 450

5 Database Performance Tuning
2011 Fall Database performance tuning can be defined as the optimization of resource use to increase throughput and minimize contention, enabling the largest possible workload to be processed. Identify the most troublesome areas Application tuning – 80% of database performance problems are from poorly coded SQL or application logic Database system tuning areas: Memory allocation (buffer/cache for data) Logging option (log cache, log size, log switch) I/O efficiency (data contention, fragmentation) Enabled features (parallelism, query rewrite) ITEC 450

6 Performance Management Components
2011 Fall Monitoring – scanning the environment to collect performance information Analysis – analyzing collected information to identify problem Correction - modifying problematic behaviors ITEC 450

7 Service-Level Management
2011 Fall SLM is the disciplined methodology and procedures used to ensure adequate levels of services are delivered A service level is a measure of operational behavior. SLM focus on mainly availability, sometimes performance. 99.9% uptime from 8:00 AM to 6:00 PM weekdays Average response time for the transaction will be two seconds or less for workloads of 500 or fewer users All involved parties, DBA and users, have to agree the service levels on stated objectives for availability and performance. ITEC 450

8 DBMS Performance Basics
2011 Fall Do not over-tune – stop tuning when performance reaches a pre-defined service level Remain focused – don’t tune multiple things at once Do not panic – “I don’t know, but I’ll find out.” Communicate clearly – keep users informed with progress, and coordinate discussions among all involved parties Accept reality – Proactive is the goal, but reality is often that dealing with problems as they occur. ITEC 450

9 Module 4 Database Tuning
2011 Fall Module 4 Database Tuning ITEC 450 Section 2 Managing and Monitoring Oracle Database

10 Proactive Database Monitoring
2011 Fall Alerts are used to monitor the database when particular metric thresholds are crossed, or can issue simply because an event has occurred. For each alert, you can set critical and warning threshold Default server-generated alerts: CPU Time Per Call (warning at 8000 ms, critical at 10,000 ms) Table space usage (warning at 85% full, critical at 97% full) SQL Service Response Time Recovery Area Space Usage ITEC 450

11 Oracle Enterprise Manager
2011 Fall ITEC 450

12 Managing Alerts Using Oracle Enterprise Manager
2011 Fall Using Oracle Enterprise Manager Warning and critical thresholds Response action, setting notification rules Read Chapter 10 in Oracle 2 Day DBA; and Chapter 5 in Oracle 2 Day DBA Tuning Guide Using DBMS_SERVER_ALERT Package Use DBMS_SERVER_ALERT.GET_THRESHOLD, SET_THRESHOLD SQL> connect sys/password as sysdba; SQL> desc dbms_server_alert SQL> select reason from dba_outstanding_alerts; SQL> select reason, resolution from dba_alert_history; Metrics and alerts information – v$sysmetric, v$servicemetric, v$sysmetric_history Information about alert types – v$alert_types SQL> select distinct object_type from v$alert_types ITEC 450

13 Alerts Section of OEM 2011 Fall ITEC 450

14 Automatic Workload Repository (AWR)
2011 Fall AWR automatically collects and stores database performance statistics relating to problem detection and tuning. A temporary in-memory collection of statistics in the SGA, accessible through dynamic views – v$sysstat, v$sessstat, v$session, v$session_wait, etc. A persistent type of performance data, access by data dictionary views – dba_users, dba_source, dba_errors, etc. By default, AWR generates snapshots once every hour, and retains the statistics for 8 days. Read Chapter 3 in Oracle 2 Day DBA Tuning Guide ITEC 450

15 Metrics Page from AWR 2011 Fall ITEC 450

16 AWR Reports Oracle provides a script generate summary reports:
2011 Fall Oracle provides a script generate summary reports: Top five timed events Wait events and latch activity Time-model statistics Buffer pool and PGA statistics and advisories dbhome_1\RDBMS\ADMIN\awrrpt.sql; Type Specified: html Enter value for num_days: 1 Enter value for begin_snap: 84 Enter value for end_snap: 89 A report is generated under: C:\app\Administrator\product\11.2.0\dbhome_1\BIN. The file name can be specified or default. ITEC 450

17 Active Session History (ASH)
2011 Fall Oracle also provides statistics for all active sessions every second, instead of AWR with 60 minutes by default. Current active session data – v$session, v$active_session_history SQL> select username, status, sid, serial#, program from v$session 2 where username is not null; SQL> select sample_time, session_id, event, module from v$active_session_history 2 where user_id = (select user_id from dba_users where username = 'SYSTEM'); Read Chapter 4 in Oracle 2 Day DBA Tuning Guide ITEC 450

18 Automatic Database Diagnostic Monitor
2011 Fall ADDM identifies performance problems, and recommends actions, after the AWR takes a new snapshot. ADDM diagnoses problems such as: Expensive SQL statements I/O performance issues Resource bottlenecks, including memory and CPU bottlenecks ADDM findings and recommendations Finding types – problem, symptom, and informational Recommendations – actions for each problem finding ITEC 450

19 Managing ADDM Using Oracle Enterprise Manager
2011 Fall Using Oracle Enterprise Manager Performance findings of the stored ADDM reports Using DBMS_ADVISOR Package CREATE_TASK – creates a new advisor task SET_DEFAULT_TASK – modifies default values of parameters within a task DELETE_TASK – deletes a specific task from the repository GET_TASK_REPORT – Displays the most recent ADDM report Using Oracle Provided Script C:\app\Administrator\product\11.2.0\dbhome_1\ RDBMS\ADMIN \addmrpt.sql; A report is generated under: C:\app\Administrator\product\11.2.0\dbhome_1\BIN by default. The file name should start with addmrpt. ITEC 450

20 Management Advisory Framework
2011 Fall The advisors help in the performance tuning, identifying bottlenecks and suggesting optimal sizes for key database resources. Memory advisor – recommendations regarding the optimal sizing of the SGA and PGA. Tuning-related advisors SQL tuning advisor – analyzing complex SQL statements and recommending way to improve performance SQL access advisor – advising on creating new indexes, materialized views, or materialized view logs. Space-Related advisors – segment advisor, undo advisor ITEC 450

21 Wrap Up Assignment 10-1: Database performance monitor
2011 Fall Assignment 10-1: Database performance monitor Hands-on practice to run Oracle built-in report You need to keep your database running for a few hours without a shutdown or reboot The window will be closed automatically, once the script is executed. If you couldn’t find the output report, it’s likely that your report didn’t run successfully. Next week FranklinLive session will be on Sunday (Nov. 13) evening 7:00 – 8:00 You can attend the live session or watch the recording next day. ITEC 450


Download ppt "Introduction of Week 10 Assignment Discussion"

Similar presentations


Ads by Google