basic handling of db2 issue with ibm support

23
© 2010 IBM Corporation Information Management Basic Handling of DB2 Issue with IBM Support Anthony Reina - Accelerated Value Specialist [email protected]

Upload: winda

Post on 01-Feb-2016

85 views

Category:

Documents


0 download

DESCRIPTION

Anthony Reina - Accelerated Value Specialist [email protected]. Basic Handling of DB2 Issue with IBM Support. IBM Software Accelerated Value Program. The IBM Software Accelerated Value Program delivers a proactive, cost-reducing, and productivity enhancing advisory service. The - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

Basic Handling of DB2 Issue with IBM Support

Anthony Reina - Accelerated Value Specialist

[email protected]

Page 2: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

2

•The IBM Software Accelerated Value Programdelivers a proactive, cost-reducing, andproductivity enhancing advisory service. Theprogram pairs you with an assigned team whobuild a foundational understanding of youroverall environment. Through that understanding,the trusted partner works to facilitate fasterdeployment, lifecycle leadership, riskmitigation, and more by identifying ways toimprove your environment, staff skill set, andprocesses.

http://www-01.ibm.com/software/support/acceleratedvalue/

IBM Software Accelerated Value Program

Page 3: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

3

Agenda :• Introduction – Why, What, and How?

• Using db2fodc for v9.7 for hang/performance issue

• Enabling and setting db2cos (DB2 call out script)

• The db2support

• Collecting db2support with OPT data

• The db2exfmt (access plan)

• Sending files to IBM.

• Related links and documents

• Gotchas

• Question/Answer

Page 4: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

4

Introduction Why there is a need for an action plan when issues occur?

Avoid confusion due to a standard response procedure.

Problem definition is immediately defined.

Correct diagnostic information is collected based on the issue reported.

Reduce overhead time, improve time to resolution.

Page 5: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

5

Introduction What information to collect?

Background Information :

- Time when the problem occurred. - Conditions that currently exist on the system. - Any recent changes to the system (ie. HW, SW, others) - Operation/steps leading to the issue. - Steps taken to recover from the issue. - Time when DB2 or system return to normal. - Diagnostic data

Diagnostic Data

Page 6: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

6

Introduction How to collect diagnostic data?

Type of Issue db2fodc (V9.7)

db2cos db2support OPTIMIZER db2exfmt

All type of issue

Query performance

Query non-performance

Performance

Hang

Timeout/Deadlock

Page 7: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

7

db2fodc for v9.7

• db2fodc o DB2 First Occurrence Data Capture process.

• Can be used to collect hang and performance issues.

• Diagnostic data collection usage : db2fodc –db <dbname> -<perf, basic> <full, basic>

• Output directory will be in the DIAGPATH directory.

• Can be customized as needed.

• Output directory will have a prefix of “FODC_Perf_<timestamp>_<nodeno>”

Page 8: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

8

db2fodc for v9.7 Data to be collected BASIC FULL

Snapshot 4 6

Stacktrace aka call stacks 3 5

vmstat 200 200

Iostat 200 200

db2perfcount 0 2

db2trc 0 1

latchtrace 0 0

Data to be collected Value

os_iterations 2

os_sleep 30

db2pdstack_iterations 2

db2pdstack_sleep 120

db2monitor_sleep 60

fullstack_sleep 300

db2trc_size 8mb

ostrc_size 8000000

ostrc_sleep 30

announce_sleep 15

no_wait OFF/ON (Default=OFF)

Data to be collected BASIC FULL

OS Iteration On

db2_config On

basic_db2_config On

more_db2_config On

os_monitor_info On

call_stacks On

db2pd_info On

db2pd_dump On

db2trc On

ostrc On

db2_monitoring On

extra_info On

• db2fodc -perf : refer to TOOLS OPTION of /bin/db2cos_perf

• db2fodc -hang : refer to TOOLS OPTION of /bin/db2cos_hang

Page 9: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

9

db2fodc for v9.7• Customize the db2fodc –perf full data collection

Before After

Actual Execution

Page 10: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

10

db2fodc for v9.7• Customize the db2fodc –hang basic to collect db2look.

Before

After

Page 11: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

11

db2fodc for v9.7• Execute the db2fodc –hang basic command.

db2fodc output

Additional db2look output.

Page 12: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

12

Enabling and setting db2cos • DB2 Callout Script invoked by default when DB2 cannot continue processing.

• Can be used when diagnostic data is hard to capture (ie. locktimeout, deadlock, sqlcode, or trap).

• The db2cos script can be modified as needed.

• By default it only collects only DB2PD Instance related info.

• The default db2cos scripts is under /bin directory.

• Place modified db2cos scripts under /adm directory. This will be executed first if exist.

Page 13: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

13

Enabling and setting db2cos

• db2cos example usage :

Copy the /sqllib/bin/db2cos to /sqllib/adm/db2cos Modify db2cos to capture snapshot and db2pd info. Enable –catch flag to trigger db2cos script db2pdcfg –catch -911,2 locktype=V –alldbp db2pdcfg –catch -911,68 locktype=V –alldbp Wait for problem reoccurence To disable : db2pd –catch clear To verify state : db2pd –catch status

Page 14: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

14

The db2support• Collects environment data from client or server machine.

• Most important utility in collecting information for a DB2 issue.

• The following information is collected : db2diag.log All trap file Locklist files Dump files Buffer pool and table space Various system related files Output from various system commands db2cli.ini

• Command : “db2support . –d <dbname>”

• Output is created on the directory where command is run.

• Output filename is db2support.zip

• Db2support will collect all the files in the DIAGPATH incl. old db2diag.logs.

Page 15: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

15

Collecting db2support with OPT data and db2exfmt

• Collects additional optimizer (OPT) data.

• Used to investigate optimizer issues.

• Can be invoked via –sf and/or –cl option -sf <SQL file> : SQL filename -cl <0, 1, 2, 3> : Level of info to collect

• Level of information collected : 0 = collects only catalogs and db2look 1 = collect 0 plus db2exfmt 2 = collect 1 plus .db2service 3 = collect 2 plus db2batch

• Commands : db2support . –d <dbname> -sf <SQL file> -cl 1 db2support . –d <dbname> -cl 0

• Output will be part of the db2support.zip called db2supp_opt.zip

-/OPTIMIZER.

Page 16: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

16

db2support with OPT data enhancements1. Collect optimizer data for different OPTLEVEL including db2batch

information. db2support <output dir> -d <dbname> -c –cl 3 –sf <sql file>

-ol 0,1,2,3,5,7 –extenddb2batch

2. The –basic option collects only optimizer-related diagnostic information.

3. The –extenddb2batch collects db2batch information when –ol and –cl options are used.

4. No db2look and catalog information collected when “-nl | -nodb2look” and “-nc | -nocatalog” options are used.

Page 17: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

17

The DB2EXFMT (access plan)• Captures information about the access plan, optimizer

inputs, and environment of an SQL query.

• Helps to understand how the SQL query is compiled and executed.

• Shows how configuration parameter changes impact query performance.

• Indispensible tool for query problem determination.

• Explain information includesSequence of operations to process the queryCost informationPredicates and selectivity estimates for each predicateStatistics for all objects referenced in the SQL query at

the time the explain information is captured.

Page 18: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

18

The DB2EXFMT tool (access plan)• Explain tables must be created before the tool can be used.

SYSINSTALLOBJECTS() procedure – call sysproc.sysinstallobjects(‘EXPLAIN’,’C’,NULL,<schema name>) EXPLAIN.DDL – db2 –tvf …/sqllib/misc/EXPLAIN.DDL

• Using the db2exfmt tool :

db2 set current explain mode explain db2 –tvf <SQL filename> db2 set current explain mode no db2exfmt –d <dbname> -1 –o <output filename> or db2exfmt –d <dbname> -g TIC –w -1 –n –s % -# 0 –o <output

filename>

Page 19: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

19

Sending files to IBM• Submit files to IBM by using IBM Enhanced Customer Data

Repository (ECuRep) Service site.

• Provides secure and central repository of submitting files to IBM.

• Important Notes :Files must be in a compressed format.Submit files only if a problem record is already opened. IBM may provide information back via ECuRep as well.

Page 20: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

20

Sending files to IBM• Filename convention : xxxx.bbb.ccc.yyy.yyy

Where :xxxxx = PMR Number bbb = Branch ccc = Country Code

yyy.yyy = Description of the file type.

Example: 34143.055.724.zip

• How to submit files to the ftp server :1.Use a FTP client to connect to ftp.ecurep.ibm.com2.Login as anonymous and enter your email address as the

password.3.Change the directory to /toibm/im4.Change to binary transfer mode for example for a FTP

connection from a Windows command line, enter: bin.5.Upload your file.6.Close your FTP client.

Page 21: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

21

Important Links/Documents

• Submitting files to IBM via ECuRep

• Collecting Data for DB2 Compiler Issues

• IBM developerWorks

• IBM Support Portal

Page 22: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

22

Gotchas : Db2support will also collect db2fodc diagnostic data as well.

Collect db2cos data if stored outside the DIAGPATH directory.

Use “db2support…-sf <SQL file> -cl 1” for issues involving one query.

Use “db2support…-cl 0” for issues involviong more than one query.

Use db2exfmt tool to collect query access plan as needed or if more than one query is involved.

Advice support analyst via email once diagnostic files have been sent via ECuRep.

Page 23: Basic Handling of DB2 Issue with IBM Support

© 2010 IBM Corporation

Information Management

23

Questions?