Trouble Shooting and Maintenance Pertemuan 13 Matakuliah: T0413 Tahun: 2009.

Slides:



Advertisements
Similar presentations
DIGIDOC A web based tool to Manage Documents. System Overview DigiDoc is a web-based customizable, integrated solution for Business Process Management.
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Little Used, but Powerful Features with GP Cathy Fregelette, CPA, PMP Practice Manager BroadPoint Technologies September 20, 2012.
Security Pertemuan 7 Matakuliah: T0413 Tahun: 2009.
Client Connectivity Pertemuan 5 Matakuliah: T0413 Tahun: 2009.
DB2 Tools Pertemuan 3 Matakuliah: T0413 Tahun: 2009.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 COS 346 Day 20.
Optimizing Windows Vista Performance Lesson 10. Skills Matrix Technology SkillObjective DomainObjective # Introducing ReadyBoostTroubleshoot performance.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 10: Collect and Analyze Performance Data.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
A Guide to SQL, Seventh Edition. Objectives Embed SQL commands in PL/SQL programs Retrieve single rows using embedded SQL Update a table using embedded.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Passage Three Introduction to Microsoft SQL Server 2000.
1 Chapter Overview Transferring and Transforming Data Introducing Microsoft Data Transformation Services (DTS) Transferring and Transforming Data with.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
1 Working with MS SQL Server II. 2 The sqlcmd Utility Command line utility for MS SQL Server databases. Previous version called osql Available on classroom.
Overview What is SQL Server? Creating databases Administration Security Backup.
Backup & Recovery 1.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
Classroom User Training June 29, 2005 Presented by:
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
IBM Software Group ® DB2 Performance Expert for Multiplatforms Version 2.1 Step-by-step tutorial.
Scripting Pertemuan 4 Matakuliah: T0413 Tahun: 2009.
Working with Data Objects Pertemuan 6 Matakuliah: T0413 Tahun: 2009.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Module 16: Performing Ongoing Database Maintenance
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan Introduction to Concurrency Control Different types.
DB2 Configuration Pertemuan 2 Matakuliah: T0413 Tahun: 2009.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Transactions and Locks A Quick Reference and Summary BIT 275.
Troubleshooting Security Issues Lesson 6. Skills Matrix Technology SkillObjective Domain SkillDomain # Monitoring and Troubleshooting with Event Viewer.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Concurrency and locking Pertemuan 8 Matakuliah: T0413 Tahun: 2009.
Optimizing Windows Vista Performance Lesson 10. Skills Matrix Technology SkillObjective DomainObjective # Introducing ReadyBoostTroubleshoot performance.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Session 1 Module 1: Introduction to Data Integrity
Development Overview Pertemuan 11 Matakuliah: T0413 Tahun: 2009.
20 Copyright © 2008, Oracle. All rights reserved. Cache Management.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
SQL Triggers, Functions & Stored Procedures Programming Operations.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
A Guide to SQL, Seventh Edition
Chapter 6 - Database Implementation and Use
TOPSpro Special Topics
Chapter Ten Managing a Database.
Database Performance Tuning and Query Optimization
Introduction of Week 3 Assignment Discussion
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Chapter 7 Using SQL in Applications
Chapter 11 Database Performance Tuning and Query Optimization
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Trouble Shooting and Maintenance Pertemuan 13 Matakuliah: T0413 Tahun: 2009

Bina Nusantara University 3 Problem Diagnosis Review the DB2 online manuals (Information Center) Problem! db2 ? Check the DB2 Express-C forum Review Admin notification log or the db2diag.log Search for APARs, or known problems Review system with Operating System commands

Bina Nusantara University 4 db2 help: ? db2 ? SQL0104N db2 ? SQL104N db2 ? SQL-0104 db2 ? SQL-104 db2 ? SQL-104N

Bina Nusantara University 5 Finding More Information About Error Codes To find out more information about an error code received, in the Command Editor input area, enter the code prefixed by a question mark and click the Execute button Prefix error code by a question mark in the Input area More information about the error code appears in the Output area

Bina Nusantara University 6 The DB2 Information Center The DB2 Information Center contains the DB2 online manuals. It also includes the manuals of products related to DB2. It has a search field It can be installed locally, or accessed through the internet The internet version is the most up-to-date one. The URLs are: –V9: –V9.5: Most of the answers to your questions can be found from the DB2 Information Center!

Bina Nusantara University 7  Log with diagnosis information at the point failure  On Linux/UNIX platforms, the administration notification log is a text file called instance.nfy  On Windows, all administration notification messages are written to the Event Log, or you can see in in the DB2 Journal  The DBM configuration parameter notifylevel specifies the level of information to be recorded: ƒ0 -- No administration notification messages captured (not recommended) ƒ1 -- Fatal or unrecoverable errors ƒ2 -- Immediate action required ƒ3 -- Important information, no immediate action required (default) ƒ4 -- Informational messages DB2 Administration Notification Log

Bina Nusantara University 8  Information included in the db2diag.log  The timestamp when the error occurred. Use it to find the error quickly  The application name and DB2 function involved in the problem.  A diagnostic message explaining the reason for the error.  Any available supporting data, such as SQLCA data structures and pointers to the location of any extra dump or trap files.  If you can recreate the problem:  Remove/rename the db2diag.log  Recreate the problem. A new db2diag.log file will be generated db2diag.log

Bina Nusantara University 9 Example of a db2diag.log entry Timestamp when the problem occurred Level: Be concerned when you see “Severe” or “Error” here. Application name Error message information. Use any of these for searching in “Google”

Bina Nusantara University 10  WIN XP/2003 (default)  C:\Documents and Settings\All Users\Application Data\IBM\DB2\DB2COPY1\ ƒWIN VISTA ƒProgramData\IBM\DB2\  Linux/UNIX (default)  INSTHOME/sqllib/db2dump (INSTHOME is the home directory of the instance owner)  You can change the location of the db2diag.log using diagpath in the dbm cfg ƒdb2 update dbm cfg using diagpath  The verbosity of diagnostic text is determined by diaglevel in the dbm cfg ƒrange is 0 to 4 (default is 3) ƒmost verbose is 4 Locating the db2diag.log

Bina Nusantara University 11  Free community assistance  Mainly in English  The IBM DB2 Express-C team monitors the forum, though it is the community who assists the most  You can also access it from the DB2 Express-C web site: (and click the button to go to the forum) The DB2 Express-C Forum

Bina Nusantara University 12 REORG, RUNSTATS, REBIND RUNSTATS REBIND REORG Maintenance Utilities

Bina Nusantara University 13 Database Operational View in Control Center

Bina Nusantara University 14 Table Reorganization (REORG) Over time, tables and indexes get fragmented (much like a file system) A REORG reclaims wasted space and re-organizes data to make retrieval more efficient Tables that are modified the most will benefit the most from REORGs REORG has an Online and Offline option –Offline REORG is faster and more efficient, but does not permit access to the table –Online REORG allows access to the table, but can consume a lot of system resources; it works best for small tables REORG TABLE  Example: REORG TABLE employee

Bina Nusantara University 15 Statistics (RUNSTATS) Keeps database statistics up-to-date –e.g. number of rows in a table, index size, data value ranges, etc. Statistics are used by DB2 whenever queries are executed –DB2 Query Optimizer is a cost-based optimizer –Analyzes these statistics to produce data access plan The frequency of statistics gathering should be determined by how often the data in the table changes RUNSTATS ON TABLE  Example: RUNSTATS ON TABLE myschema.employee

Bina Nusantara University 16 RUNSTATS and REORG from the Control Center Control Center > (expand) All Databases folder > (expand) Database > (select) Tables Folder > (right-click) Table > Reorganize/Run Statistics

Bina Nusantara University 17 Bind/Rebind Packages  Applies to embedded SQL applications, SQL stored procedures  Static SQL application depicted C file (.c) bind file (.bnd) package library.exe embedded C program (.sqc) Access plans for static SQL are determined at BIND time

Bina Nusantara University 18 REBIND db2rbind database_alias -l  Example: db2rbind sample -l mylog.txt

Bina Nusantara University 19 Maintenance Choices Automated Maintenance –Have DB2 automatically look after maintenance for you (REORG, RUNSTATS, BACKUP) Manual Maintenance –You perform maintenance activities when the need arises Create Scripts to Perform Maintenance –Schedule regular execution of scripts

Bina Nusantara University 20 Automated Maintenance Based on a user-defined maintenance window –DB2 will perform maintenance on this window ONLY if needed. –Two maintenance windows: ONLINE: For online maintenance activities such as RUNSTATS and online BACKUP. These can be defined at any time because the database remains fully accessible OFFLINE: For offline maintenance activities such as offline BACKUP and REORG. Database may become inaccessible and any connected applications may be affected. –Database keeps track of operations performed and schedules any needed maintenance in the next appropriate maintenance window

Bina Nusantara University 21 Scheduled Maintenance Using Task Center More time-consuming than automatic maintenance, but more customization possibilities –E.g. different tables might have different backup needs Task Center is the central location for all scheduled activities for the DB2 administration tools –It is the main interface where all tasks can be created, edited, and scheduled

Bina Nusantara University 22 Performance Configure parameters –Use the Configuration Advisor –The bufferpool is the most important parameter to configure This is like cache for databases Do not over allocate physical memory to the bufferpool Design good indexes –Use the Design Advisor –Indexes can reduce sorts

Bina Nusantara University 23 Performance Choose the right locking strategy –Depending on your application logic choose the appropriate isolation level. UR provides the most concurrency. Reduce deadlocks by minimizing: –Repeatable Read isolation –Lock Escalation –Lock Conversion –Bad Access plans (table scans) –Catalog Modification –Referential Constraint Enforcement

Bina Nusantara University 24 Performance Minimize network traffic –Use stored procedures –Limit the fetch size using clauses like: Optimize for X rows: Use this clause to determine the best communications buffer size. fetch first x rows only: Limit on the number of rows retrieved Eg: SELECT EMPNAME, SALARY FROM EMPLOYEE ORDER BY SALARY DESC FETCH FIRST 100 ROWS ONLY OPTIMIZE FOR 20 ROWS

Bina Nusantara University 25 Performance Dynamic vs. Static SQL –Static SQL performs better than dynamic SQL –If must use dynamic SQL, ensure to use parameter markers Code your SQL appropriately –Don’t ask for more than you need For example, asking for all the columns is not good, like in: Select * from … –Analyze bad performing SQL with Visual Explain

Bina Nusantara University 26 Visual Explain Execute & Access Plan Statement to analyze Access Plan

Bina Nusantara University 27 Visual Explain