DBARTISAN XE2 and 9.0 | Embarcadero® DBArtisan™ User Guide

Add to my manuals
1751 Pages

advertisement

DBARTISAN XE2 and 9.0 | Embarcadero® DBArtisan™ User Guide | Manualzz

Product Documentation

Embarcadero® DBArtisan™

User Guide

Version XE 2/9.0

1st Edition June, 2011

© 2011 Embarcadero Technologies, Inc. Embarcadero, the Embarcadero Technologies logos, and all other Embarcadero Technologies product or service names are trademarks or registered trademarks of Embarcadero Technologies, Inc. All other trademarks are property of their respective owners.

This software/documentation contains proprietary information of Embarcadero Technologies, Inc.; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited.

Embarcadero Technologies, Inc. is a leading provider of award-winning tools for application developers and database professionals so they can design systems right, build them faster and run them better, regardless of their platform or programming language. Ninety of the Fortune 100 and an active community of more than three million users worldwide rely on Embarcadero products to increase productivity, reduce costs, simplify change management and compliance and accelerate innovation. The company’s flagship tools include: Embarcadero® Change Manager™, CodeGear™ RAD Studio, DBArtisan®, Delphi®, ER/Studio®, JBuilder® and Rapid SQL®.

Founded in 1993, Embarcadero is headquartered in San Francisco, with offices located around the world. Embarcadero is online at www.embarcadero.com.

CORPOR ATE HEADQUARTE RS

1 0 0 C A L I F O R N I A S T REE T

1 2 TH FL O OR

S AN F RA N C I SC O, C A L I FO RN I A

9 4 11 1 U SA

EMEA HEA DQ UAR TER S

YO RK HO US E

18 YORK RO A D

M A I D E N H E A D , B E R K S H I RE

S L 6 1 S F, U N I T E D KI N G D O M

AS IA -P A CI FI C H E A DQ UA RT E RS

L 7. 3 13 L A TRO B E S TRE ET

ME LBOU RNE VIC 3 00 0

AU ST RA LIA

Contents

Welcome to DBArtisan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Additional Product Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

Prerequisites and Preliminary Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8

More Information on Using this Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16

Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21

Tutorial exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63

Specifying DBArtisan application and feature options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99

Datasource Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

Registering or Editing a Datasource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125

Datasources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131

Understanding the Datasource Catalog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132

Automatically Discovering Datasources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134

Changing Datasource Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134

Connecting to a Datasource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135

Disconnecting from a Datasource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136

Discover Datasources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136

Extracting Configuration Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137

Managing Datasources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138

Managing Datasource Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141

Selecting Datasources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141

Unregistering Datasource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142

Datasource Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142

Removing a Datasource Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143

Creating a New Datasource Group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143

Renaming a Datasource Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144

Categorizing Datasources using Color-coding and Labeling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144

Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146

Session Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148

Database Object Finder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150

Changing an ODBC Datasource to a Native Datasource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151

Database Object Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

Supported Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 3

C O N T E N TS >

Creating objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221

Modifying objects using editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .411

Object actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .543

SQL Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685

ISQL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .685

Results Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .736

Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749

Schema Extraction and Migration Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .750

Using the Schema Publication Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .762

Database Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .764

Instance configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .779

SQL Logfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .779

Data Export Wizard for IBM DB2 for Linux, Unix, and Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .780

Data Import Wizard for IBM DB2 for Linux, Unix, and Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .784

Load Data Utility Wizard for DB2 OS390 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .788

Data Unload Wizard for Microsoft SQL Server and Sybase ASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .796

Data Load Wizard for Microsoft SQL Server and Sybase ASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .799

Database Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .802

Database Backup Wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .803

Database Recovery Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .809

Data Export Wizard for Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .815

Data Import Wizard for Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .820

Archive activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .826

Backup Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .827

Chained Row Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .827

Free space Deficit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .828

Pinned Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .829

Maximum Extent Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .830

Instance Parameter Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .830

Configuring Resource Cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .832

Session Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .833

Resource Limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .833

Top Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .839

Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841

Find In Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .842

Database Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .842

Script Execution Facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .844

4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C O N T E N T S >

File Execution Facility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .844

Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .847

Visual Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .848

Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .852

Import Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .888

Data Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .890

Embarcadero Products. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .899

Code Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .900

Permissions Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .905

Add-on tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909

Embarcadero SQL Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .911

DBArtisan PL/SQL Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .953

Capacity Analyst. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967

Geting Started with the Capacity Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .967

Capacity Analyst Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .978

Using Capacity Analyst. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .990

Performance Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007

Welcome to Performance Analyst. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1009

Performance Analyst Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1017

Using Performance Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1021

Performance Analyst Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1021

Performance Analyst for Oracle Tutorial. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1037

Oracle Performance Analyst Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1049

Performance Analyst for Microsoft SQL Server Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1199

Microsoft SQL Server Performance Analyst Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1211

Performance Analyst for Sybase Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1315

Sybase ASE Performance Analyst Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1325

Performance Analyst for IBM DB2 for Linux, Unix and Windows Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1425

IBM DB2 (W/U/L) Performance Analyst statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1437

Space Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1563

Welcome to Space Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1565

Space Analyst Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1569

Using Space Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1573

Space Management Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1607

Space Analyst for Oracle tutorial. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1615

Space Analyst for Microsoft SQL Server Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1627

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 5

C O N T E N TS >

Space Analyst for Sybase ASE Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1637

Space Analyst for IBM DB2 for Linux, Unix, and Windows Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1645

Space Analyst Expert Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1653

Backup Analyst. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1657

Welcome to Backup Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1659

Backup Analyst Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1665

Using Backup Analyst for Microsoft SQL Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1671

Backup Analyst Command Line Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1683

6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

W

ELCOME TO

DBA

RTISAN

Welcome to DBArtisan, the database administration solution for managing IBM DB2 for Linux,

Unix, and Windows, IBM DB2 for z/OS and OS/390, Microsoft SQL Server, MySQL, Oracle, and

Sybase ASE databases.

The table below describes the major sections of Help.

Section

Getting Started

Datasource

Management

Database Object

Management

SQL Scripting

Utilities

Tools

Add-on tools

Description

Provides an introduction for new users and helps you set up DBArtisan. Included is an investigation of the major user interface elements, detailed tutorial exercises, and instructions on configuring DBArtisan features.

Shows you how to register the datasources that DBArtisan will work against.This chapter also describes the extensive datasource management facilities.

Describes how to create new database objects, edit existing objects, and provides details on the operations you can perform against database objects.

Describes the development/execution/testing environments offered.

Provides detailed information about the extraction, migration and publication of your schema, the loading and unloading of data, database searching, the use of the Script

Execution Facility and Query Builder, the scheduling of processes, the backing up and restoration of databases, the use of the Database Monitor, Database Manager, Resource

Limits, and Logfile.

Tools provide search, script and file execution, scheduling, visual difference, a visual query builder, data import, a data editor, and an auto-replace tool for the scripting environment.

License-dependent add-ons include:

Capacity Analyst - collects storage and performance metrics and provides visual analysis and reporting for historical trend analysis and forecasting.

Performance Analyst - presents a complete picture of a database's performance and lets you investigate performance bottlenecks.

Space Analyst - helps you effectively locate and troubleshoot bottlenecks and performance inefficiencies that result from space management issues.

Backup Analyst - increases the efficiency of database backups.

Debuggers - DBArtisan provides debugging environments for DB2 LUW, SQL Server,

Oracle, and Sybase.

Oracle PL/SQL Profiler - captures metrics of various PL/SQL programmable objects as they are executed

A

DDITIONAL

P

RODUCT

R

ESOURCES

The Embarcadero Web site is an excellent source for product information and access to additional resources:

• Release notes and product documentation

• Information on other Embarcadero application and database development tools

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 7

P RE RE Q UI S I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

• Embarcadero Development Network

• Product and technical support

• Educational and product expertise material in the form of online demos, white papers, and video presentations

• Access to sales staff and Embarcadero resellers

For access, direct your browser to www.embarcadero.com

.

P

REREQUISITES AND

P

RELIMINARY

T

ASKS

The following topics provide information on requirements that must be satisfied and initial setup tasks that must be performed before using DBArtisan:

Technical Requirements

Database Support

Licensing

T

ECHNICAL

R

EQUIREMENTS

DBArtisan is a 32-bit application that runs in a Microsoft Windows environment. Before using

DBArtisan, please verify that your environment meets the following requirements:

• Microsoft Internet Explorer 5.5 or later

Hardware requirements

Operating system requirements

NOTE:

Users need full registry privileges during the installation and access to the keys under

HKEY_CURRENT_USER in the registry after installation.

H

ARDWARE

R

EQUIREMENTS

Embarcadero Technologies recommends the following minimum hardware requirements:

• 1024 MB of memory

• 512 MB of disk space

8

O

PERATING

S

YSTEM

R

EQUIREMENTS

DBArtisan supports the following operating systems:

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P RE RE Q U IS I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

• Windows 7 (32-bit and 64-bit)

• Windows XP (32-bit and 64-bit)

• Windows Vista (32-bit and 64-bit)

For more detailed information, see the following topics:

• XP Support

• Vista and Windows 7 Support

• 32-bit Versus 64-bit Operating System Support and Restrictions

XP S

UPPORT

Windows XP has two user security groups:

• Users

• Power Users

Microsoft intentionally does not grant members of the Users Group the authority to install applications or make global changes to the system. Restricted Users are members of the Users

Group. Standard users belong to the Power Users Group. Microsoft grants members of the

Power Users Group the authority to install programs. You must be a member of the

Administrators Group in order to install and use Embarcadero Technologies applications.

Because Restricted Users are members of the Users Group, they cannot install and run

Embarcadero Technologies applications.

CAUTION:

You must be a member of the Administrators Group in order to install and use

Embarcadero Technologies applications.

To open the Group Membership tab where you can determine your group and review the

Microsoft security guidelines:

1 On the Control Panel, open User Accounts.

2 On the Users tab, select a user and then click the Properties button.

3 Click the Group Membership tab.

V

ISTA AND

W

INDOWS

7 S

UPPORT

Windows Vista UAC and Windows 7 provide two user types:

• Standard user

• Administrator

DBArtisan can be installed or uninstalled by an administrator or by a standard user using an administrator token. Standard users can run DBArtisan.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 9

P RE RE Q UI S I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

CAUTION:

For the purposes of running DBArtisan, default standard user token privileges should not be modified. Modifying standard user token privileges can result in licensing issues which will prevent DBArtisan from operating properly.

32-

BIT

V

ERSUS

64-

BIT

O

PERATING

S

YSTEM

S

UPPORT AND

R

ESTRICTIONS

DBArtisan is a 32-bit application that runs emulated on 64-bit versions of Windows. The only requirement is that DBArtisan supports only 32-bit versions of the client software that must be installed for connectivity to each DBMS that DBArtisan will work against.

D

ATABASE

S

UPPORT

The table below describes the database platforms DBArtisan supports and the server and client requirements:

Platform

IBM DB2 for z/OS

IBM DB2 for Linux, Unix, and Windows

Microsoft SQL Server

MySQL

Oracle

Sybase ASE

Server

IBM DB2 for z/OS 8 and 9.

Client

When going through a DB2 Connect gateway, DB2 Client for Windows 6.0 or later. When going directly to the mainframe from the client, DB2 Connect Personal

Edition v6 or higher on the client machine.

IBM DB2 Universal Database 8.0 - 9.7.

IBM DB2 Client for Windows 7.2 or later.

NOTE: When using a v8 client, DBArtisan only supports connecting to a v8 Database on Windows, Linux and Unix.

Microsoft SQL Server Client Library Microsoft SQL Server 2000, 2005, and 2008

NOTE: For SQL Server 2005 and 2008, only object types like users, logins, roles, config parameters, etc., are supported. We do

NOT support Microsoft .NET extensions at this time.

MySQL 4.x. (DBArtisan is tolerant of 5.x but does not support Stored Procedures,

Triggers, Views.)

Oracle 8i, 9i, 10g, and 11g

Sybase ASE 12.5 - 15.0.3

MySQL ODBC driver 3.5.1 and above

Oracle SQL*Net Client

Sybase Open Client

NOTE:

Since DBArtisan is a 32-bit application that runs emulated on 64-bit versions of

Windows, only 32-bit versions of the DBMS client software are supported.

IBM DB2

FOR

Z/OS S

TORED

P

ROCEDURE

R

EQUIREMENTS

When working against an IBM DB2 for z/OS data source, DBArtisan relies on the following stored procedures, provided as an optional installation step in setting up the DB2 subsystem:

• DSNWZP

10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P RE RE Q U IS I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

• DSNUTILS

• ADMIN_COMMAND_DSN

• ADMIN_COMMAND_DB2

Prior to using DBArtisan against an IBM DB2 for z/OS data source, ensure that these components are installed on the server. See http://publib.boulder.ibm.com/infocenter/dzichelp/ v2r2/topic/com.ibm.db2.doc.inst/stpadd.htm#stpadd for more information.

L

ICENSING

Each Embarcadero client application requires one or more licenses in order to run. An

Embarcadero product, such as DBArtisan or ER/Studio, has a baseline license which provides basic feature support for that product. In addition, incremental licenses may be required to support specific DBMS platforms, product add-ons, or other functions.

For more information, see the following topics:

Licensing Overview

Licensing your Application

Selecting a License Cateory During Startup

Online/Offline Mode and Concurrent License Checkout

L

ICENSING

O

VERVIEW

The following topics provide a high-level discussion of key licensing topics and directs you to sources of more detailed information.

• Viewing your License Type and Modules

• Understanding Trial, Workstation, and Networked Licenses

• DBArtisan License Modules, DBMS Support, and Feature Availability

• DBArtisan XE License Modules, DBMS Support, and Feature Availability

• Directing Queries Regarding Licenses

V

IEWING

Y

OUR

L

ICENSE

T

YPE AND

M

ODULES

The About... dialog, available from the Help menu, displays your license type and each individual license module currently registered.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 11

P RE RE Q UI S I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

U

NDERSTANDING

T

RIAL

, W

ORKSTATION

,

AND

N

ETWORKED

L

ICENSES

Three kinds of licenses are available: Trial, Workstation, and Networked.

Trial licenses

Workstation licensing

Networked licensing

A license for a 14-day, full-featured trial version of the product. The trial license must be registered before you can use the product.

A license or set of licenses is tied to a particular workstation. The product can only be used on that workstation.

Networked licenses are administered and distributed by a central License Server

(Embarcadero License Center or Acresso FLEXnet Publisher). There are two types of networked licenses: Concurrent and Networked Named User. With Concurrent licensing, users on different machines take turns using licenses from a shared pool. With

Networked Named User licensing, licenses are pre-assigned to specific users setup on the license server's user list. Those users are guaranteed to have licenses available any time.

NOTE: Concurrent licenses can be borrowed for use without a network connection. For details, see

Online/Offline Mode and Concurrent License Checkout

.

For a detailed description of licensing options, see http://www.embarcadero.com/softwarelicensing-solutions .

DBA

RTISAN

L

ICENSE

M

ODULES

, DBMS S

UPPORT

,

AND

F

EATURE

A

VAILABILITY

Individual license modules correspond to the DBMS platforms you are licensed to use. In addition, each DBMS license module corresponds to a product edition. Feature availability for each license module edition is as follows:

Standard - Provides baseline support including datasource management, object management, SQL editing and execution, and standard tools and utilities.

Professional - Standard edition features plus SQL Debugger and SQL Profiler.

Workbench - Professional edition features plus Performance Analyst, Space Analyst,

Capacity Analyst, and Backup Analyst.

DBA

RTISAN

XE L

ICENSE

M

ODULES

, DBMS S

UPPORT

,

AND

F

EATURE

A

VAILABILITY

An XE license provides access to all supported DBMS platforms. XE modules and feature availability are as follows:

XE Pro - Provides baseline support including datasource management, object management, SQL editing and execution, and standard tools and utilities, SQL Debugger and SQL Profiler.

Analyst Pack - Provides access to Performance Analyst, Space Analyst, Capacity Analyst, and Backup Analyst.

D

IRECTING

Q

UERIES

R

EGARDING

L

ICENSES

Questions regarding license availability, feature availability, and client or server licensing, should be directed as follows:

12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P RE RE Q U IS I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

• If you work in an organization that uses networked licensing, direct any questions to your site’s DBArtisan administrator

• If you are using workstation licensing, direct licensing questions to your Embarcadero

Technologies representative

L

ICENSING

Y

OUR

A

PPLICATION

See the following topics for details on registering your product:

• Registering a trial or workstation license during installation

• Registering a workstation license after application startup

• Registering by phone

• Registering a networked license

R

EGISTERING A

T

RIAL OR

W

ORKSTATION

L

ICENSE

D

URING

I

NSTALLATION

Shortly after initiating download of a trial version of an Embarcadero product, you should receive an email with a serial number you must register during installation. Similarly, if you purchase an

Embarcadero product while no trial version is active, you will receive a serial number that must be registered during installation.

1 Start the installation. An Embarcadero License Registration dialog appears.

2 Copy the serial number from the email and paste it in the Serial Number field.

3 Enter your Embarcadero Developer Network account credentials in the Login or Email and

Password fields. If you have not previously created an EDN account, or have forgotten your password, click I need to create ... or I’ve lost my password.

4 Click Register.

Your activation file should be downloaded and installed automatically. If this does not happen, click the Trouble Connecting? Try Web Registration link and follow the prompts. If you still have problems, see Registering by phone .

R

EGISTERING A

W

ORKSTATION

L

ICENSE

A

FTER

A

PPLICATION

S

TARTUP

The following instructions assume that you have received a workstation license by email and that you currently have a valid trial license. If you did not install a trial version or the trial period has expired, follow the instructions in Registering a Trial or Workstation License During Installation instead.

1 On the Help menu select About and then on the dialog that opens, click Manage to open a license manager dialog.

2 On the Serial menu, select Add.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 13

P RE RE Q UI S I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

3 Copy the serial number from the email and paste it in the Add Serial Number dialog, then click OK.

4 Right-click on the serial number you added, and then select Register from the context menu. A registration dialog opens.

NOTE:

The Registration Code box shows a machine-specific identifier required with other registration methods.

5 Ensure that the Register using Online Registration radio box is selected.

6 Provide Developer Network credentials in the DN Login name or Email and DN Password boxes. If you have not previously created an EDN account, or have forgotten your password, click I need to create ... or I’ve lost my password.

7 Click Register.

8 If prompted to restart the application, click Yes.

Your activation file should be downloaded and installed automatically. If this does not happen, click the Trouble Connecting? Try Web Registration link and follow the prompts. If you still have problems, see Registering by phone .

R

EGISTERING

B

Y

P

HONE

If you have problems with either of the above procedures, you can register licenses by phone.

You will have to provide Developer Network credentials; the registration code displayed in the

Embarcadero License Registration dialog that appears when you start an unlicensed application; the product base license serial number; and the license serial numbers for any additional features you have purchased.

For North America, Latin America and Asia Pacific, call (415) 834-3131 option 2 and then follow the prompts. The hours are Monday to Friday, 6:00 A.M. to 6:00 P.M. Pacific time.

For Europe, Africa and the Middle East, call +44 (0)1628-684 494. The hours are Monday to

Friday, 9 A.M. to 5:30 P.M. U.K. time.

Shortly after phoning in, you will receive an email containing an activation file. Then do the following:

1 Save the file to the desktop or a scratch directory such as c:\temp.

2 On the Help menu select About and then on the dialog that opens, click Register. A registration dialog opens.

3 Select the I have received an activation file (*.slip or reg*.txt) radio box.

4 Click the Browse button and use the Select License Activation File dialog to locate and select the activation file you installed.

5 Click the Import button to import the activation file and when complete, click the Finish button.

6 If prompted to restart the application, click Yes.

14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P RE RE Q U IS I T E S A N D P RE L I M IN A R Y TAS K S > P RE RE Q U I S I TE S AN D P RE L IM I N A R Y TA S K S

R

EGISTERING A

N

ETWORKED

L

ICENSE

If you work in an organization using Networked licensing, an administrator, department head, or someone providing a similar function will provide you with an activation file.

Once you receive the file, save it to the license subfolder of your product’s main installation folder (typically C:\Program Files\Embarcadero\<product><version>\license\), then restart the application.

No additional steps are necessary.

S

ELECTING A

L

ICENSE

C

ATEGORY

D

URING

S

TARTUP

During DBArtisan startup, if multiple concurrent license categories are available, you are prompted to select a category to use for this DBArtisan session. Multiple license categories can be set up to provide differing feature access or access to different DBMS versions. Feature and

DBMS version access are typically distributed across multiple license categories to optimize use of a site’s purchased licenses.

NOTE:

This dialog also includes the option to remember your selection on subsequent startups. If you select that option, you can subsequently use the Select Licenses button on the About... dialog (Help > About) to select a different license.

Contact your License Administrator for details on individual license categories or requests for additional feature or DBMS support.

O

NLINE

/O

FFLINE

M

ODE AND

C

ONCURRENT

L

ICENSE

C

HECKOUT

Concurrent licenses can be used in both online and offline modes. In online mode, you must have a continuous network connection to your License Center. Licenses are checked out when you start DBArtisan and checked back in when you shut DBArtisan down.

You can also use a license in offline mode. When you explicitly check out a license for offline use, you can use DBArtisan without a connection to your License Center for a specified duration. This lets you work while travelling or commuting, work away from your primary work area, or use

DBArtisan when a network connection is unavailable or not required.

NOTE:

Contact your site administrator for information on offline license availability, the maximum duration, offline license policy at your site, or any other issues arising from online license usage.

To check out a license for offline use:

1 On the Help menu, select Checkout License. The Check Out Licenses For Offline Use dialog opens.

2 Select the check box associated with each individual license you want to check out.

3 In the Checkout Duration box, type the number of hours that you can use the offline license without a network connection to the License Center.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 15

M O RE I N F O R M A T I O N O N U S I N G T HI S D O C U M E N T > M O RE I N F O R M A TI O N O N U S I N G T H IS D O C UM E N T

4 Click OK.

You can work offline for the specified duration. The duration period begins immediately.

If you subsequently establish a network connection to the License Center before the license duration expires, you can indicate to the License Center that the offline license is no longer required.

To indicate that an offline license is no longer required:

1 On the Help menu, select Checkin License.

There is no interruption in DBArtisan usage. The license is not actually checked in until you shut down DBArtisan.

M

ORE

I

NFORMATION ON

U

SING THIS

D

OCUMENT

The following topics provide additional information that is useful when working with product documentation:

• Accessing third party documentation

• Shorthand for third party product references

A

CCESSING

T

HIRD

P

ARTY

D

OCUMENTATION

Many DBArtisan features provide support for functionality available in the supported third party

DBMS platforms. In object management for example, properties available when creating or editing objects and actions available against object types, are direct equivalents of clauses, options, or keywords available for use with the third party equivalent.

In such cases, no attempt is made to duplicate detailed documentation by third parties. Casual descriptions are provided, noting the third party equivalent. You can consult the third party documentation for details or clarifications. The following links provide access to online documentation for DBMS platforms supported by DBArtisan:

• IBM DB2 for Linux, Unix, and Windows documentation

• IBM DB2 for z/OS documentation

• Microsoft SQL Server documentation

• MySQL documentation

• Oracle documentation

• Sybase documentation

16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O RE I N F O R M AT I O N O N U S I N G T H IS D O C U M E N T > M O RE IN F O R M A TI O N O N US I N G T H I S D O C U M E N T

S

HORTHAND FOR

T

HIRD

P

ARTY

P

RODUCT

R

EFERENCES

To save space in headings and table columns, the following shorthand is used to represent versions and variations of the DBMS platforms supported by DBArtisan.

• DB2 LUW - IBM DB2 for Linux, Unix, and Windows

• DB2 z/OS - IBM DB2 for z/OS

• SQL SVR - Microsoft SQL Server

• MySQL - MySQL

• Orcl - Oracle

• Syb - Sybase

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 17

M O RE I N F O R M A T I O N O N U S I N G T HI S D O C U M E N T > M O RE I N F O R M A TI O N O N U S I N G T H IS D O C UM E N T

18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G

ETTING

S

TARTED

The following sets of topics are intended for new users. They provide learning curve material and tell you how to configure DBArtisan:

Application Basics

DBArtisan Tutorial

Introduces the major user interface elements.

Provides detailed tutorial exercises that introduce the basic areas of DBArtisan functionality.

Specifying DBArtisan application and feature options

Tells you how to configure DBArtisan.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 19

G E T T I N G S T A R T E D

20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A

PPLICATION

B

ASICS

Application Basics is designed to situate you within the application and to provide information about what DBArtisan offers in the way of design, navigation, and application features. The information presented here is high-level and conceptual.

Application Basics is divided into two sections. The table below describes each section:

Section

DBArtisan Product

Design

Specifying DBArtisan application and feature options

Description

This section describes key interface elements and concepts, including how to use the

Datasource Explorer, parallel query execution, and how to navigate and make the most use of DBArtisan's Multiple Document Interface (MDI) environment.

This section describes how you can configure the application to meet your specific needs.

DBA

RTISAN

P

RODUCT

D

ESIGN

The Datasource Explorer has its own context-sensitive toolbar. As you switch object types in the

Datasource Explorer, this toolbar and shortcut menus adapt to expose functionality pertaining to the selected object type. This section describes key interface elements and concepts, such as how to use the Datasource Explorer, parallel query execution, and how to navigate and make the most use of DBArtisan's Multiple Document Interface (MDI) environment.

TIP:

DBArtisan lets you use a mouse with a wheel to navigate in active windows.

For more information, see:

Datasource Explorer

DBArtisan Toolbars and Menus

DBArtisan Dialog Boxes

Customizing the DBArtisan Display

D

ATASOURCE

E

XPLORER

The Datasource Explorer provides a visual method for browsing, accessing, and manipulating objects. The Explorer is designed to give you an overall picture of the contents and configuration of your datasources. From the Explorer you can connect, disconnect, filter, and browse the objects in all of the supported datasources on your network.

The Datasource Explorer is a separate tabular window, with a tree in the left pane. When you select an object on the Datasource Explorer, you can view corresponding data in the right pane.

TIP:

You can open any number of Explorer tabs so that you can administer and focus on a particular group of servers or objects in one window and accomplish separate tasks in another tab.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 21

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

The following topics provide basic information on understanding the Datasource Explorer:

Basic Viewing Options in the Datasource Explorer

Datasource Explorer Nodes by DBMS Platform

Filtering in the Datasource Explorer

Opening and Closing Explorer Tabs

NOTE:

You can assign datasources to defined categories such as production or development.

This lets you color-code and label Datasource Explorer user interface elements

associated with the datasource. For details, see Categorizing Datasources using Colorcoding and Labeling .

For detailed information on datasources, see Datasource Management .

B

ASIC

V

IEWING

O

PTIONS IN THE

D

ATASOURCE

E

XPLORER

The Datasource Explorer dropdown menu provides basic organization and display options.

22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

To change basic organization and viewing options

1 From the Datasource Explorer dropdown menu, select an option. Use the following table as a guide to your selection.

Option

Organize by Object Owner or

Organize by Object Type

Show System Objects

Full Refresh

Expand All Groups

Collapse All Groups

Collapse All Datasources

Retain View Settings

Description

Toggling these options has the following effect:

Owner - the Datasource Explorer displays objects for each user, categorized by object type. This display mode is most efficient if you are working with databases containing a high number of objects.

Type - the Datasource Explorer displays all objects, categorized by object type, for all users in the same list. This display mode speeds or slows performance in databases that contain many objects.

Lets you control display of system objects: NEVER, ALWAYS, or USE

DATASOURCE FILTER. For information on filter options, see Filtering in the

Datasource Explorer

.

Select to refresh.

Select to expand all groups.

Select to collapse all groups.

Select to collapse all datasources.

Select to retain the current state of the Datasource Explorer so that the it opens the same way the next time you start DBArtisan.

TIP:

You can also set these option on the Explorer Options

tab of the Options editor.

D

ATASOURCE

E

XPLORER

N

ODES BY

DBMS P

LATFORM

The Datasource Explorer tree organizes and nests subjects as branches, or nodes. By expanding or collapsing the tree, you can efficiently browse multiple servers and databases and penetrate to the appropriate level of detail.

The Datasource Explorer tree nodes give you quick access to instance and server configuration, as well as security and performance functionality. The node names depend on the platform. For example, the Instance node in IBM DB2 is very similar to the Server node in Sybase ASE.

When you click the Datasource node of the Explorer, DBArtisan lists all the databases available for that datasource. Similarly, by clicking the Databases Node you can view all the database object types available for that particular datasource. Finally, by drilling down to the object type,

DBArtisan displays available objects on in the right pane.

TIP:

For IBM DB2 for Linux, Unix, and Windows, DBArtisan offers enhanced navigation of the system, instance, and database nodes of the Datasource Explorer. DBArtisan lets you view, manage, and navigate DB2 for Windows/Unix datasources at the instance node level rather than at the database level.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 23

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

The Datasource Explorer displays the following nodes:

IBM DB2 for

Windows, Unix, and Linux

IBM DB2 for

OS390 and Z/OS

Microsoft SQL

Server

Filters Node

Instance Node

Performance

Node

Schema Node

Security Node

Storage Node

MySQL Oracle

Application

Processes

Databases Node Databases Node Databases Node

Filters Node Filters Node Filters Node

Performance

Node

Schema Node

Security Node

Storage Node

Subsystem

Performance

Node

Security Node

Server Node

Storage Node

Performance

Node

Security Node

Server Node

Filters Node

Instance Node

Performance

Node

Schema Node

Security Node

Storage Node

Sybase

Databases Node

Filters Node

Performance

Node

Security Node

Server Node

Storage Node

D

ATABASES

N

ODE

NOTE:

The Databases node is available for IBM DB2 for OS390, Microsoft SQL Server, MySQL, and Sybase ASE.

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery. Information management centers on the deployment and administration of databases and database applications.

The Datasource Explorer List

When you select the Databases node of the Datasource Explorer, DBArtisan lists the databases and displays pertinent information about each of them in the right pane. The tables below describes the information displayed for those DBMS that have a Databases node:

Sybase Node description IBM DB2 for

OS390 and Z/OS

AlterEdts

Microsoft SQL

Server

MySQL

Bufferpool

CreateEdts

Time when the most recent alter edit was applied

Name of default bufferpool for the database, blank if it is a system database

Time when the create statement was created for the database

24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

IBM DB2 for

OS390 and Z/OS

Microsoft SQL

Server

Create Date/

Time

MySQL

Creator

Database

Status

DB ID

Group Member

Index Bufferpool

MIXED_CCSID

Name

Stogroup

Timestamp

Type

Database

Name

Name

Sybase Node description

Create Date/

Time

When the database was created

Database

Status

Last Dump

Tran

Name of creator

Status of the database, such as online, offline, read-only or single-user

Internal identification number for database

The DB2 sharing member name

Indicates name of the default bufferpool for indexes

The last time that the transaction log for the database was dumped

Indicates graphic characters

Name of database

Database

Name

Online

Size

Suspended

Yes or no.

Size of the database in MB

Name of stogroup for the database, blank if it is a system database

Yes or no.

Indicates timestamp

Indicates type of database; W indicates a work file

For more information, see

Datasource Explorer Nodes by DBMS Platform .

NOTE:

MySQL does not support the concept of owner and databases for MySQL are registered manually. When you select the database node for MySQL, you see the name of the database.

F

ILTERS

N

ODE

The Filters node contains default Datasource Explorer tree filters and any custom filters you create for that datasource or create across that DBMS type. Controls let you enable or disable the default and custom filters. Options for creating and maintaining custom filters are provided.

For details, see Filtering in the Datasource Explorer .

I

NSTANCE

N

ODE

The following topics provide node descriptions for those DBMS for which DBArtisan supports an

Instance node:

• Instances (Oracle)

• Instances (DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 25

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

Instances (Oracle)

DBArtisan places Instance as the first level of information under the Datasource node in the

Datasource Explorer. The Instance node can be expanded to access the following:

ASM and ASM > Disk Groups nodes (only visible if the Datasource has an ASM instance) -

for details, see Disk Groups Support

.

Version node - provides specific version information for the datasource.

Configuration node - provides access to instance parameters for the datasource.

Oracle Job Queues node - for details, see

Job Queues .

Instances (DB2 LUW)

DBArtisan places Instance as the first level of information under the Datasource node in the

Datasource Explorer. Instance includes:

DB Manager Configuration node - provides access to instance parameters for the datasource.

Datasources node - lets you connect to specific datasources.

Right-clicking the Instance node also lets you take the following actions:

New UDB Database - see Database Wizard (IBM DB2 LUW)

Quiesce (Instance)

Unquiesce

D

ATABASE

C

ONFIGURATION

The Database Configuration node displays under the Instance node of the Datasource Explorer.

When you select the Configuration node, DBArtisan displays configuration information about your datasource in the right pane of the Explorer window. You can use the Datasource Explorer or shortcut menu to:

• Open the Instance Parameters dialog box.

• Open the Edit Configuration dialog box.

• Extract SQL.

• Execute an HTML report.

Opening the Instance Parameters dialog box

Connect to a datasource to access an instance.

1 On the Datasource Explorer, expand the target datasource node.

2 On the Datasource Explorer, expand the Instance node.

26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

3 Click Configuration.

DBArtisan displays the configuration information in the right pane of the Explorer window.

4 On the Datasource Explorer toolbar, click Open.

OR

In the right pane of the Explorer window, right-click the target configuration parameter, and then click Open.

OR

In the right pane of the Explorer window, double-click the target configuration parameter, and then click Open.

DBArtisan opens Instance Parameters dialog box.

V

ERSION

I

NFORMATION

NOTE:

Version is available for MySQL, Microsoft SQL Server and Oracle.

DBArtisan places Version under either the Server or Instance node of the Datasource Explorer.

When you select Version, DBArtisan shows version information about your datasource in the right pane of the Explorer window. Version information varies according to the database platform’s manufacturer.

Displaying Version Information

Connect to a datasource to access version information. After you have connected to a datasource, do the following:

1 On the Datasource Explorer, expand the Datasource node.

2 On the Datasource Explorer, expand the Server or Instance node.

3 Click Version.

DBArtisan displays version information in the right pane of the Explorer window.

P

ERFORMANCE

N

ODE

NOTE:

The Performance node is available for all DBMS.

The Performance node on the Datasource Explorer lets you quickly access to the following features of the Database Monitor:

MySQL Oracle Sybase IBM DB2 for

Windows, Unix, and Linux

Blocking Locks

IBM DB2 for

OS390 and Z/OS

Microsoft SQL

Server

Blocking Locks

Buffer Pools

Image Copies

Blocking Locks Blocking Locks

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 27

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

IBM DB2 for

Windows, Unix, and Linux

Locks

Processes

IBM DB2 for

OS390 and Z/OS

Microsoft SQL

Server

Locks

Databases.

Restricted

Tablespaces. and

Database Locks

Locks

Processes

Threads

Traces

Utilities Node

MySQL

Locks

Processes

Oracle

Locks

Processes

Sybase

Locks

Processes

You can select the Performance node and view the corresponding statistics in the right pane of the Explorer window. To utilize all Database Monitor functionality, on the Utilities menu, click

Database Monitor.

IBM DB2 for Linux, Unix, and Windows and IBM DB2 OS390

Performance is a result of the DB2 API calls. The DB2 API calls are subject to change depending on the version and DB2 SDK call interface of the DB2 server.

NOTE:

Performances do not appear in the system catalog tables.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

I

MAGE

C

OPIES

NOTE:

Image Copies are available for IBM DB2 for z/OS and OS/390 only.

The Image Copies node shows the image copies on the subsystem. Image Copies are a full image copy of all pages in a tablespace, partition, data set, or index space.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

P

ROCESSES

NOTE:

Processes is available for IBM DB2, Microsoft SQL Server, MySQL, Oracle, and Sybase

ASE.

The Processes node on the Datasource Explorer displays processes that are currently running on your DBMS.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

L

OCKS

NOTE:

Locks are available for all DBMS.

28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

The Locks node on the Datasource Explorer displays the lock objects held on the table and row

IDs for your database. Locks are a way of controlling concurrent events and access to data.

DBArtisan lets you view all locks associated with a database. To utilize all Database Monitor functionality, on the Utilities menu, click Database Monitor.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

Refreshing the Locks Tab

1 On the Datasource Explorer, select the Locks node.

DBArtisan displays the locked sessions in the right pane of the Explorer window.

2 On the Datasource Explorer toolbar, click Refresh.

B

LOCKING

L

OCKS

The Blocking Locks node on the Datasource Explorer displays only the locks that are blocked. To utilize all Database Monitor functionality, on the Utilities menu, click Database Monitor.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

D

ATABASES

. R

ESTRICTED

T

ABLESPACES

.

AND

D

ATABASE

L

OCKS

These nodes list

DISPLAY DATABASE

command status information for tablespaces, indexes, and locks:

The Databases node lists

-DISPLAY DATABASE(*) LIMIT(*)

output, showing status codes for all tablespaces and indexes on the datasource.

• The Restricted Tablespaces node lists

-DISPLAY DATABASE(*) SPACENAM(*) RESTRICT output, showing status codes for all tablespaces in an exception state

• The Database Locks node lists

-DISPLAY DATABASE(*) LIMIT(*) LOCKS output, showing status codes, connection ID, correlation ID, and lock information (LockInfo field) for all programs holding locks on databases or spaces.

NOTE:

LockInfo consists of lock status (H, W, or R), a lock state (IS, IX, S, U, SIX, X, or NSU), lock type (S, T, C, R, W, P, PP) and lock duration (A, C, H, M, P, or I). Similarly, status codes display standard -display command output (ARBDP, AREO*, ACHKP,

AREST, AUXW, CHKP, COPY, DBETE, GRECP, ICOPY, LPL, LSTOP, PSRBD, RBDP,

RBDP*, RECP, REFP, RELDP, REORP, RESTP, RO, RW, STOP, STOPE, STOPP, UT,

UTRO, UTRW, UTUT, and WEPR). For detailed descriptions of these items, connection

IDs and correlation IDs, consult DB2 for z/OS documentation. For more information,

see Accessing Third Party Documentation .

NOTE:

These nodes are available for DB2 z/OS V8 and above.

Refreshing the Blocking Locks Tab

1 On the Datasource Explorer select the Blocking Locks node.

DBArtisan displays the blocked sessions in the right pane of the Explorer window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 29

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

2 On Datasource Explorer toolbar, click Refresh.

T

HREADS

NOTE:

Threads are available for IBM DB2 for OS390.

Threads are control structures in IBM DB2 for z/OS and OS/390, which:

• Describe application connection.

• Trace application progress.

• Process resource functions.

• Communicate SQL statement status after SQL execution.

There are three types of threads:

1 Active Threads

2 Indoubt Threads

3 Inactive Threads

The table below describes the information DBArtisan displays in the right pane when you select the Active, Indoubt or Inactive Thread nodes on the Datasource Explorer:

Column Name

Token

Name

Status

A

Req

ID

Auth ID

Plan

ASID

Location

Session ID

Description

Token number designation

Location name of the system

Indicates status of the conversation or socket

Indicates event control

Indicates Req number value

Program currently running

User authorization ID

Bound application plan

Address space ID

IP address of client program

Session Instance Identifier

For more information, see

Datasource Explorer Nodes by DBMS Platform .

Active Threads: Active threads are the processes running on your database. When you select the Active Thread node on the Datasource Explorer, DBArtisan displays the active threads that are currently running on the IBM DB2 for z/OS and OS/390 database. To utilize all Database

Monitor functionality, on the Utilities menu, click Database Monitor.

30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

Refreshing Active Threads

1 On the Datasource Explorer, select the Active Threads node.

DBArtisan displays the active sessions in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target active thread(s).

3 On the Datasource Explorer toolbar, click the Refresh button.

OR

In the right pane of the Explorer window, right-click the active thread(s), and then click

Refresh.

DBArtisan refreshes the active thread.

Killing Active Threads

1 On the Datasource Explorer, select the Active Threads node.

DBArtisan displays the active sessions in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target active thread(s).

3 On the Datasource Explorer toolbar, click the Kill button.

OR

In the right pane of the Explorer window, right-click the active thread(s), and then click Kill.

DBArtisan refreshes the active thread(s).

For more information, see

Datasource Explorer Nodes by DBMS Platform.

Indoubt Threads: Indoubt threads are processes waiting for resources to become active.

When you select the Indoubt Thread node on the Datasource Explorer, DBArtisan displays the indoubt threads that are currently running on the IBM DB2 for z/OS and OS/390 database. To utilize all Database Monitor functionality, on the Utilities menu, click Database Monitor.

Refreshing Indoubt Threads

1 On the Datasource Explorer, select the Indoubt Threads node.

DBArtisan displays the indoubt sessions in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target indoubt thread(s).

3 On the Datasource Explorer toolbar, click the Refresh button.

OR

In the right pane of the Explorer window, right-click the indoubt thread, and then click

Refresh.

DBArtisan refreshes the indoubt thread.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 31

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

Killing Indoubt Threads

1 On the Datasource Explorer, select the Indoubt Threads node.

DBArtisan displays the indoubt sessions in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target indoubt thread(s).

3 On the Datasource Explorer toolbar, click the Kill button.

OR

In the right pane of the Explorer window, right-click the indoubt thread, and then click Kill.

DBArtisan kills the indoubt thread.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

Inactive Threads: Inactive threads are processes that are idle. When you select the Inactive

Thread node on the Datasource Explorer, DBArtisan displays the inactive threads that are currently running on the IBM DB2 for z/OS and OS/390 database. To utilize all Database Monitor functionality, on the Utilities menu, click Database Monitor.

Refreshing Inactive Threads

1 On the Datasource Explorer, select the Inactive Threads node.

DBArtisan displays the inactive threads in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target inactive thread(s).

3 On the Datasource Explorer toolbar, click the Refresh button.

OR

In the right pane of the Explorer window, right-click the inactive thread(s), and then click

Refresh.

DBArtisan refreshes the inactive thread.

Killing Inactive Threads

1 On the Datasource Explorer, select the Inactive Threads node.

DBArtisan displays the inactive threads in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the target inactive thread(s).

3 On the Datasource Explorer toolbar, click the Kill button.

OR

In the right pane of the Explorer window, right-click the inactive thread(s), and then click Kill.

DBArtisan kills the inactive thread.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

T

RACES

NOTE:

Traces are available for IBM DB2 for z/OS and OS/390 only.

The Traces node displays a list of active traces. Traces let you monitor and collect DB2 for OS/

390 monitoring, auditing, performance, accounting, statistics, and serviceability (global) data.

NOTE:

This information is read-only.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

B

UFFER

P

OOLS

The Buffer Pools node displays a list of buffer pools, the main storage that is reserved to satisfy the buffering requirements for one or more table spaces or indexes.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

U

TILITIES

N

ODE

NOTE:

The Utilities node is available for IBM DB2 for OS390 only.

The Utilities node displays wizards that are typically run from the command line and do not apply to a particular type of schema object. Some of these wizards are also available via the command menus for objects. The wizards include:

• Check Data

• Check Index

• Copy

• Copy to Copy

• Load

• Merge Copy

• Modify Recovery

• Modify Statistics

• Quiesce Tablespace

• Rebuild Index

• Recover

• Reorg Index

• Reorg Tablespace

• Runstats Index

• Runstats Tablespace

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 33

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

• Unload

• Maintain Template

TIP:

To run a wizard, select the command in the right pane of the application and click the

Execute button on the Datasource Explorer toolbar.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

S

CHEMA

N

ODE

NOTE:

Schema node is available for IBM DB2 for Linux, Unix, and Windows, IBM DB2 for

OS390, and Oracle.

DBArtisan offers an environment for managing database objects across different database platforms. DBArtisan stores information about server and object types in object editors. Each editor is a tabbed dialog box that groups related information together. Each editor includes a context-sensitive Commands menu with pertinent functionality for the desired object. Many of the object editors contain a DDL tab.

The Schema node displays the underlying target object's SQL. The object editor toolbar has a refresh button, which lets you refresh object editor contents, clear the object editors, and log

SQL if SQL Logging is turned on. This can be useful when you have completed an object and want to see the changes immediately. For objects that have dependent objects, such as tables, triggers, procedures, and views, you can view and access their dependent objects directly from the object tab, instead of having to go back to the correct node of the Datasource Explorer.

For more information, see

Datasource Explorer Nodes by DBMS Platform .

S

ECURITY

N

ODE

NOTE:

The Security node is available for all DBMS.

The Security node gives you quick access to related security functions and lets you administer and control security on your database from a single vantage point. Rather than having to sift through a large number of objects, you can simply create and alter security settings to be applied across the server from this top-level.

Each DBMS offers different security options:

MySQL Oracle Sybase IBM DB2 for

Windows, Unix, and Linux

Groups

IBM DB2 for

OS390 and Z/OS

Microsoft SQL

Server

Logins

Linked Servers

Logins

Users Users

Roles

Users

Profiles

Roles

Users

Roles

34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

A

PPLICATION

P

ROCESSES

NOTE:

The Application Processes node is available for IBM DB2 for z/OS and OS/390.

DBArtisan places Application Processes as the first level of information under the Datasources node in the Datasource Explorer. The Application Processes node of the Datasource Explorer includes portions of the mainframe DB2 subsystem that relate to application programming. The

Application Processes node also includes two components that are industry innovations: a search tool for statements, and a means to expose previously established access paths.

Application Processes includes:

• Plan

• Packages

• DBRM Node

• Procedures

• Triggers

P

LAN

A Plan is an executable application created in the bind process. It can include one or more packages or debris.

The Datasource Explorer List

You can select the Plan node in the Datasource Explorer and view the corresponding statistics.

The table below describes the information DBArtisan derives and displays about plans from the system catalog:

Column Name

Plan Name

Owner/Creator

Qualifier

Valid

Operative

Isolation

Reoptvar

Packlists

Environments

Bind Date/Timestamp

Description

Name of plan

User name of plan owner or creator

Name of qualifier

Indicates if plan is valid or invalid

Indicates if plan is operative

Level of isolation

Number of packlists

Number of environments

Time stamp of bind

TIP:

Double-click a specific plan open the Plan editor. For details, see

Plans Editor (IBM DB2

Z/OS) .

For more information, see

Application Processes

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 35

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

DBRM N

ODE

NOTE:

DBRM is for IBM DB2 for z/OS and OS/390 only.

A DBRM is an application containing information on SQL statements extracted from the DB2 precompiler. A DBRM refers to a specific database and is stored outside of the DB2 directory.

The Datasource Explorer List

When you select the DBRM node of the Datasource Explorer, DBArtisan lists pertinent information about each of them in the right pane. The table below describes the information

DBArtisan derives and displays DBRMs from the system catalog:

Column Name

DBRM Name

Version

Description

Displays the name of the DBRM.

Displays DBRM version.

Contoken

Language

The contoken (consistency token) in the object compares to the contoken in the plan/ package. If the contokens match, then the program will execute. If they do not match and autorebind = y, and the rebind is successful, then the program will execute. If they do not match and autorebind = n or fails, then an -818 is returned to the program - contoken mismatch, and the job ends. DB2 displays the mismatched contokens. The analysis associated with a -818 requires finding the DBRM or package contoken. This pane lets you easily expose the contokens and find the version mismatch.

Displays the Host language.

Precompile Timestamp Precompilation time of the DBRM.

For more information, see

Application Processes

.

S

ERVER

N

ODE

NOTE:

The Server node is available for MySQL, Microsoft SQL Server, and Sybase ASE.

DBArtisan places Server as the first level of information under the Datasource node in the

Datasource Explorer. Server includes:

MySQL

• Version Information

• Configuration

• Scheduling

Microsoft SQL Server

Version Information

Database Configuration

SQL Server Agent

36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

• Error Logs

Sybase ASE

• Version Information

Database Configuration

Accessing a Server

Connect to a datasource to access a server. After you have connected to your datasource, do the following:

1 On the Datasource Explorer, expand the datasource node.

2 On the Datasource Explorer, expand the Server node.

S

ERVER

V

ERSION

I

NFORMATION

DBArtisan places Version under the Server node of the Datasource Explorer. When you select

Version, DBArtisan shows version information about your datasource in the right pane of the

Explorer window.

Displaying Version Information

Connect to a datasource to view version information. After you have connected to a datasource, do the following:

1 On the Datasource Explorer, expand the Datasource node.

2 On the Datasource Explorer, expand the Server node.

3 Click Version.

DBArtisan displays version information in the right pane of the Explorer window.

For more information, see

Server Node .

C

ONFIGURATION

DBArtisan places Configuration under the Server node of the Datasource Explorer. When you select Configuration, DBArtisan shows configuration information about your datasource in the right pane of the Explorer window. You can use the Datasource Explorer or shortcut menu to:

• Open the Server Configuration dialog box.

• Open the Edit Configuration dialog box.

• Extract SQL.

• Execute an HTML report.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 37

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

Opening the Server Configuration Dialog Box

Connect to a datasource to access a server. After you have connected to your datasource, do the following:

1 On the Datasource Explorer, expand the datasource node.

2 On the Datasource Explorer, expand the Server node.

3 Click Configuration.

DBArtisan displays configuration information in the right pane of the Explorer window.

4 Select the target configuration parameter.

5 On the Datasource Explorer toolbar click Open.

OR

In the right pane of the Explorer window, right-click the configuration parameter, and then click Open.

DBArtisan opens the Server Configuration dialog box.

For more information, see

Server Node .

SQL S

ERVER

A

GENT

DBArtisan places SQL Server Agent under the Server node of the Datasource Explorer.

DBArtisan assists you in using the Microsoft SQL Server Agent service to automate administration of a Microsoft SQL server. Microsoft SQL Server Agent manages, and schedules, allowing programmed responses to server events or the execution of scheduled administrative tasks. Automating recurring administrative tasks and responses to server events can save considerable time for other administrative tasks.

For more information, see the object support topics for the following:

Alerts

Jobs

Operators

Before using SQL Agent elements from DBArtisan, consult the Microsoft SQL Server documentation for a detailed understanding of the prerequisites, operational requirements, and

functionality provided by that service. For more information, see Accessing Third Party

Documentation .

38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

E

RROR

L

OGS

DBArtisan places Error Logs under the Server node of the Datasource Explorer. Error logs are comprised of information recorded by Microsoft SQL Server. When you expand the Error Logs node, you can see the current and archived error logs. When you select the Error Logs node,

DBArtisan displays the current and archived error logs in the right pane of the Explorer window.

To note information, DBArtisan uses a blue information icon, and to note errors, DBArtisan uses a red error icon.

The column headings in the right pane of the Explorer window provide important information about error logs. These headings are:

• Name

• Source

• Message

You can use the Datasource Explorer toolbar or the shortcut menu to access functionality associated with error logs. The shortcut menu functionality lets you:

• Find

• Toggle All Messages

• Generate an HTML Report

• Refresh the Window

• Find Object

• Select All

• Unselect All

TIP:

Double-click any error log to display the message.

For more information, see

Server Node .

S

TORAGE

N

ODE

NOTE:

The Storage node is available for all DBMS.

DBArtisan places all storage mechanisms under the Storage node of the Datasource Explorer.

Storage objects include:

Oracle Sybase IBM DB2 for

Windows, Unix, and Linux

Bufferpools

IBM DB2 for

OS390 and Z/OS

Bufferpools

Microsoft SQL Server

Control Files

Directories

Data Caches

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 39

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

IBM DB2 for

Windows, Unix, and Linux

IBM DB2 for

OS390 and Z/OS

Microsoft SQL Server

Dump and Backup Devices

Nodegroups

Oracle

Tablespaces

Stogroups

Tablespaces

Redo Log

Groups

Rollback

Segments

Tablespaces

Sybase

Database Devices

Dump and Backup Devices

S

UBSYSTEM

NOTE:

The Subsystem node is available for IBM DB2 for z/OS and OS/390 only.

The Subsystem node displays detailed information about the DB2 subsystem. Subsystem objects include:

• Connections

• DDF

• Parameters

C

ONNECTIONS

Connections displays the current connections to the subsystem.

NOTE:

The information is read-only.

For more information, see

Subsystem

.

DDF

DDF (distributed data facility) displays the information regarding the status and configuration of the DDF, a set of DB2 for OS/390 components through which DB2 for OS/390 communicates with another RDBMS.

NOTE:

The information is read-only.

For more information, see

Subsystem

.

P

ARAMETERS

Parameters displays the DB2 subsystem parameters.

NOTE:

The information is read-only.

40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

For more information, see

Subsystem

.

F

ILTERING IN THE

D

ATASOURCE

E

XPLORER

For ease of navigation, DBArtisan lets you filter the Datasource Explorer tree to display only selected nodes and objects. DBArtisan offers the following filtering options:

• Real-time modification of the tree to show only nodes with names matching a typed character string. For details, see

Simple, on-the-fly, Character-based Tree Filtering .

• Permanent object filters, enabled and disabled for individual datasources, that restrict display based on object name and owning schema (and optionally, object type). For details, see

Object Name/schema Filtering .

• The ability to restrict object types displayed for each DBMS platform. For details, see

Node, or Object Type, Filtering .

Two default filters applying to owned and system objects are available. For details, see

Using the

Default Filters .

S

IMPLE

,

ON

-

THE

-

FLY

, C

HARACTER

-

BASED

T

REE

F

ILTERING

The Filter box at the top of the Datasource Explorer provides a quick, ad hoc way to restrict the nodes displayed.

To restrict the Datasource Explorer tree display to only user-defined nodes whose name contains a particular character string

• Type one or more characters in the Filter box.

The display is updated to show only nodes whose name contains the typed character string and their parent nodes.

NOTE:

The Clear button in the Filter box (X) deletes the contents of the Filter box and restores the unfiltered tree display.

O

BJECT

N

AME

/

SCHEMA

F

ILTERING

Object filters let you restrict Datasource Explorer tree display for a datasource by name, owning schema, or name/schema combinations. These filters are defined at the DBMS platform level and enabled or disabled on a datasource by datasource level. Multiple object filters can be created for a DBMS platform, letting you enable combinations of filters for a single datasource, ad hoc enabling and disabling of individual filters depending on your requirements, and so on.

Each filter consists of one or more ANDed conditions based on name or schema. For example you could create a two-condition filter that restricts the Datasource Explorer tree for a datasource to display only objects belonging to the Schema QA and whose name starts with the string Test.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 41

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

Each filter condition is a simple expression that tests object names for equality (Equals, Not

Equals), inclusion in a specified list (In, Not In), or using pattern matching (Like, Not Like).

Optionally, an object filter can also be used to restrict display of specified object types on a datasource.

To create an object filter that can be enabled for all datasources for a DBMS platform

1 Right-click in the left pane of the Datasource Explorer tree and select Filter from the context menu.

The Filters dialog opens. The Object Filters tab opens by default, letting you create an object filter definition. The Node Filters tab, on the other hand, lets you perform real-time filtering of object types for all datasources on a DBMS platform. For details, see

Node, or

Object Type, Filtering

.

2 In the View area, select By Filter.

NOTE:

The current instructions create a filter at the DBMS level. To create a filter for a single datasource, select the By Datasource view, select a specific datasource, and then proceed to step 4 .

3 Expand the icon corresponding to the DBMS for which you want to create a filter and ensure that the icon is selected.

4 Click New and type a name for the new filter.

42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

5 On the Predicates tab, create one or more name-based or schema-based conditions, all of which must be satisfied when this filter is enabled. Objects that do not satisfy the conditions will be filtered from view. Use the following guidelines in constructing conditions:

• The Like and Not Like operators take pattern-matching Values. DBArtisan supports the wildcard characters and conventions supported on the target DBMS.

• The In and Not In operators take a comma-delimited list such as CO,CA,CU, as a Value.

• Click the associated New button to add new predicates.

6 Optionally, on the Database Elements tab, select the check boxes for all object types to which this filter is to be applied. The filter does not affect the display of any deselected object types.

7 Click OK.

By default, when you create an object filter for a DBMS platform, it is enabled for each registered datasource of that DBMS type.

To disable or enable an object filter for a datasource

1 Right-click in the left pane of the Datasource Explorer tree and select Filter from the context menu. The Filters dialog opens.

2 In the View area, select By Datasource.

3 Expand the icon corresponding to the target DBMS and then expand the icon corresponding to the specific datasource for which you want to for enable or disable a filter.

4 Enable an object filter by selecting the associated check box or disable the object filter by deselecting the check box.

5 Click OK.

NOTE:

You can also enable and disable filters using controls found under the Filters node for each datasource in the Datasource Explorer tree.

You can also use the Filters dialog to select and edit an object filter, rename or create a clone of an existing object filter, and delete filters.

N

ODE

,

OR

O

BJECT

T

YPE

, F

ILTERING

Node filtering lets you hide specified Datasource Explorer tree nodes for a DBMS platform. For example, if you do not typically work with credential-related objects such as users, groups, profiles or logins, you may wish to filter those out of the Datasource explorer tree. You could either disable display of the individual object types or if practical, disable display of the Security node for the DBMS.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 43

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

To change the hidden/displayed status of object types for a DBMS platform

1 Right-click in empty space in the left pane of the Datasource Explorer tree and select Filter from the context menu. The Filters dialog opens.

The Filters dialog opens. The NodeFilters tab opens by default, letting perform real-time filtering of object types for all datasources on a DBMS platform. The Object Filters tab, on the other hand, lets you create permanent, name-based or schema-based filters. For details, see

Object Name/schema Filtering .

2 Click the Node Filters tab.

3 Expand the icon corresponding to the DBMS for which you want to create a node filter, and continue to expand nodes until all nodes for which you want to change the hidden/ displayed status, are visible.

4 Ensure that all nodes corresponding to objects types that are to be displayed, are selected.

Similarly, ensure that all nodes corresponding to objects types that are to be hidden, are deselected.

5 Click OK.

Hidden/displayed status is retained for the DBMS until you explicitly open the Filters dialog and change the current settings.

U

SING THE

D

EFAULT

F

ILTERS

The Datasource Explorer Filters node for each registered datasource includes two default

Datasource Explorer tree filters, Ignore System Objects and Show Only My Objects. These filters can be enabled and disabled for each datasource but cannot be edited or deleted.

O

PENING AND

C

LOSING

E

XPLORER

T

ABS

DBArtisan provides flexibility in the configuration of its display. DBArtisan lets you open or close multiple Explorer Tab windows. This feature lets you configure the DBArtisan desktop to suit the task at hand. The default setting for the Datasource Explorer is a single tab docked on the lefthand side of the application.

44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

To open a new Datasource Explorer tab

1 On the Datasource menu, click New Explorer.

To close a Datasource Explorer tab

1 Right-click the tab label at the bottom of the target Datasource Explorer tab and select

Close.

E

NTERPRISE

M

ANAGEMENT

C

ONSOLE

The Enterprise Management Console interface is an enterprise-wide view of managed databases. It is available when the application is focused on the top-level node of a datasource group. You can use this feature to do multiple administrative operations with one or two clicks.

The Enterprise Management Console gives you quick access to the following functionality:

• Connecting to your datasources

• Modifying datasource registration

• Database Monitor

• Data Load

• Data Unload

• Database Schema Extraction

• Database Schema Migration

P

ARALLEL

Q

UERY

E

XECUTION

/

MULTITHREADING

DBArtisan takes full advantage of 32-bit architecture by supporting parallel query execution or multithreading.

DBArtisan accelerates the development process by executing multiple queries simultaneously using separate operating system threads and improving response time because most operations can start immediately and return control to the primary application thread.

DBArtisan lets you run multiple, concurrent queries against the same datasource.

DBArtisan employs a database connection pooling technique that dynamically spawns connections as needed and disconnects them when the associated query has completed.

DBArtisan increases throughput by automatically assigns query threads to separate processors if your system has multiple CPUs. When you execute parallel queries against different database servers using a multi-processor computer, you experience near linear gains in throughput.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 45

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

D

ESCRIBE

W

INDOW

The Describe Window is a floating window that lets you view procedures, tables, views, and functions (Oracle and IBM DB2 for Linux, Unix, and Windows only). In the Describe Window you can view columnar information (for tables and views) or input parameter information (for procedures and functions).

Opening the Describe Window

DBArtisan offers three ways to open the Describe window:

1 In an editor, right-click an object and then click Describe.

2 On the View menu, select an object and then click Describe.

3 On the right pane of the Explorer or in an editor, select an object and then press CTRL+D.

Using the Describe Window

In the Describe window:

1 Click the Name list and then click a name to view a list of types of objects in the database.

2 Click the Owner list and then click an owner to view a list of all owners of objects in the database.

Click the Type list and then click a type to view columnar information (for tables and views) or input parameter information (for functions and procedures).

DBA

RTISAN

T

OOLBARS AND

M

ENUS

DBArtisan offers multiple ways to navigate through the application:

Main Menu

Toolbars

Shortcut Menus

For more information on customizing these items, see Customizing General User Interface

Appearance.

46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

M

AIN

M

ENU

You can access DBArtisan's features from the Main Menu by clicking the menu name, and then selecting the target command on the sub-menu. The menus are context-sensitive, changing as you perform tasks. DBArtisan menu items include:

Menu Item

File

Datasource

Utilities

Logfile

View

Tools

Analyst

Bookmarks

Window

Help

Edit

Query

Format

Description

Create, open, close, print and save script files and result sets. Set application options and defaults.

Note: When you open New, you have easy access to a new ISQL window, the DDL Editor, a Java file, or the Active Script.

Create, modify, select, manage, connect to, and disconnect from datasources. Access database object editors. Display or hide the Datasource Explorer. Access session recording for Tivoli integration.

Access utilities to extract schema, migrate schema, export and import data, execute scripts, search databases, monitor process activity and locks, schedule tasks, and restore, manage, and backup databases.

Activate/deactivate, open, flush, and annotate the DBArtisan application log.

Configure DBArtisan to hide or show toolbars, status bars, and windows. Access full screen mode.

Access customizable tools menu. Access installed DBMS connectivity utilities and server documentation.

Opens the Space Analyst, Capacity Analyst, Backup Analyst, and Performance Analyst.

Access and manage bookmarks.

Cascade and tile open windows. Arrange icons. Toggle between open windows.

Lets you access context-sensitive Help, link to Embarcadero on the Web, and see license information when you click About...

Edit and manipulate the text in your SQL scripts. Available only when an ISQL Window is selected.

Execute and set query options for a SQL script. Available only when an ISQL Window is selected.

Format the contents of result sets. Available only when a Result Window is selected.

For more information, see

DBArtisan Toolbars and Menus

.

E

XPLORER

B

OOKMARKS

DBArtisan supports easy datasource navigation with the Explorer bookmarks. You can right-click any node of the Explorer tree and add a bookmark. After a bookmark is created, you can simply select it from the Bookmark menu, and be instantly positioned and connected to the resource in the Datasource Explorer tree.

Creating Explorer Bookmarks

1 On the Datasource Explorer, right-click the target node, and then select Add Bookmark.

DBArtisan opens the Add Friendly Bookmark Name dialog box.

2 Type the Explorer bookmark name.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 47

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

3 Click OK.

DBArtisan displays the Explorer bookmark under the Bookmarks menu. Explorer bookmarks are organized by platform.

Editing Explorer Bookmarks

1 On the Main Menu, select Bookmarks.

2 Select Bookmark Manager.

DBArtisan opens Bookmark Manager.

3 To rename the Explorer bookmark, select the target explorer bookmark, and then click

Rename.

DBArtisan opens the Edit Bookmark Name dialog box.

4 Type the new explorer bookmark name.

5 Click OK.

6 To delete an Explorer bookmark, select the target bookmark, and then click Delete.

TIP:

To add explorer bookmarks without using the Add Friendly Bookmark Name dialog box, select Do not show ‘Add Friendly Bookmark Name’ dialog option.

T

OOLBARS

DBArtisan supports two classes of toolbars:

• Feature-specific toolbars appearing at the top of the window or panel of tools such as the

Datasource Explorer, Object editors, the ISQL editor, and the Analyst tools:

For information on the functions provided by feature-specific toolbars, see the documentation for the associated feature.

• Optional-display toolbars, appearing in one or more rows below the menu bar.

You can hide or display the individual optional-display toolbars and they change to reflect the element of the application you are using. These toolbars contain buttons that are the fastest way to access commonly used features of DBArtisan.

The following topics provide information you need to work with optional-display toolbars:

48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

Using Toolbar Viewing Options

Understanding the Shortcuts Available on Specific Toolbars

NOTE:

You can set preferences as to the default toolbars displayed and their appearance. For details, see

Customizing General User Interface Appearance

.

U

SING

T

OOLBAR

V

IEWING

O

PTIONS

DBArtisan offers standard Windows toolbar options such as docking, floating, and positioning toolbars.The only application-specific viewing option is the hiding or display of the individual toolbars.

To hide or display a toolbar

1 On the View menu, select Toolbars and then select the specific toolbar you want to display or hide.

For information on the toolbars available and the commands available on each, see

Understanding the Shortcuts Available on Specific Toolbars

.

U

NDERSTANDING THE

S

HORTCUTS

A

VAILABLE ON

S

PECIFIC

T

OOLBARS

The following optional-display toolbars are available using the Toolbars command on the View menu.

Analyst Series Toolbar

This toolbar offer shortcuts that open the Space Analyst, Capacity Analyst, Performance Analyst, and Backup Analyst tools.

Datasource Toolbar

This toolbar offers shortcuts that let you connect to or disconnect from a datasource, select a datasource and for Sybase and SQL Server, select a specific database.

Main Toolbar

This toolbar has common application functions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 49

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

It offers the following shortcuts:

New

Print

Output

Session Recording

Open

Send Mail

Describe Window

Find Object

Save

Options

Full Screen

Save All

New Datasource Explorer

Log SQL

Registration Toolbar

This toolbar offers shortcuts to registering a datasource, editing a datasource registration, and unregistering a datasource.

SQL Edit Toolbar

This toolbar offers functions used in editing SQL:

It offers the following shortcuts:

Undo

Paste

Comment

Match Token

Toggle Bookmark

Increase Indent

Redo

Insert File

Undo Comment

Find

Previous Bookmark

Decrease Indent

Cut

Paste SQL Syntax

Upper Case

Repeat

Next Bookmark

SQL Profiler Toolbar

This toolbar offer functions used when working with the Oracle Profiler.

Copy

Paste SQL Statement

Lower Case

Replace

Clear Bookmark

It offers the following shortcuts:

Start Profiler

Unit Summary

Flush Profile

Unit Detail

Run Summary

Clear Profile Tables

Tools Toolbar

This toolbar offers functions otherwise available on the Tools menu.

Run Detail

Stop Profiling

50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

It offers the following shortcuts:

Customize Tools Menu

File Execution Facility

Build Query

Code Workbench

Find in Files

Scheduler

Database Search

Visual Difference

Table/Index Size Estimator SQL* PLus

Import Data From File

Utilities Toolbar

This toolbar offers functions otherwise available on the Utilities menu.

Script Execution Facility

Edit Data

Performance Center

It offers the following shortcuts:

Schema Extraction

Data Load

Schema Migration

Database Monitor

Shema Publication

Server Configuration

Windows Toolbar

This toolbar offers functionality for working with windows.

Data Unload

It offers the following shortcuts:

Cascade

Previous

Tile Windows Horizontally Tile Windows Vertically

Windows

Next

C

USTOMIZING

G

ENERAL

U

SER

I

NTERFACE

A

PPEARANCE

DBArtisan lets you choose from a set of general visual application styles, dictate hiding or display of particular items, and select preferences for specific user interface elements.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 51

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

To customize the general look and feel of DBArtisan

1 On the View menu, select Toolbars and then select Customize. The Customize dialog opens.

2 Use the following table as a guide to understanding and setting options on tabs of the

Customize dialog:

Tab

Toolbars

Application Visual

Style

Tools

Keyboard

Options

Settings and tasks

Select the toolbars you want to display in the application. For information on the toolbars available, see

Understanding the Shortcuts Available on Specific Toolbars

.

Select a visual style such as Microsoft Windows XP or one of the .NET options from the dropdown. Depending on your selection, the following options may or may not be enabled:

Use default WIndows XP colors, OneNote style tabs, Docking Tab Colors, Allow MDI Tab

Swapping, Enable Smart Docking, Enable Tab Menu, and 3D Rounded Docking Tabs.

Menu animations

Menu Shadows

Lets you specify a menu animation style of UNFOLD, SLIDE, or

FADE.

Displays shadowed 3D effects.

Lets you define external applications to run from the Tools menu of DBArtisan: the text displayed on the Tools menu command (Menu contents), the path and file name of the executable (Command), optional Arguments, and an optional Initial DIrectory.

Category

Select a general category for a hot key for the command.

Commands

Description

Set Accelerator for

Current Keys

Press New Shortcut

Key

Show ScreenTips on toolbars

Select a hot key command, based on the general category.

Displays the command description.

Select application area where you want new hot key to be active.

Displays current hot key.

Press keyboard key or an unassigned F key.

Show shortcut keys in

ScreenTips

Select to display a ScreenTip when you hover your mouse over a button. For example, when you hover your mouse over the New button, DBArtisan displays the ScreenTip “New.”

Select to display a shortcut key in the ScreenTip when you hover your mouse over a button. For example, when you hover your mouse over the New button, DBArtisan displays the ScreenTip

“New (CTRL+N).”

3 Click Apply at any time to implement any changes you have made and when finished, click

Close.

S

HORTCUT

M

ENUS

DBArtisan incorporates shortcut menus to give you another way to access object functionality.

These menus mirror the functionality that you can access from application toolbars or the main menu.

52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

Accessing Shortcut Menus

1 On Desktop, right-click DBArtisan.

DBArtisan opens the shortcut menu.

2 Click the target shortcut menu command.

For more information, see

DBArtisan Toolbars and Menus.

K

EYBOARD

C

OMMANDS

DBArtisan provides a number of Keyboard commands that expedite IISQL Editor development.

The table below describes the available keyboard commands:

Category

General editing

Extending selections

Moving the insertion point

Action

Delete one character to the left

Delete one character to the right

Cut selected text to the Clipboard

Undo the last action

Redo the last undo operation

Copy text

Paste the Clipboard contents

One character to the right

One character to the left

To the end of a word

To the beginning of a word

To the end of a line

To the beginning of a line

One line down

One screen up

To the beginning of a document

To the end of a document

To include the entire document

One character to the left

One character to the right

One word to the left

One word to the right

Up one line

Down one line

To the end of a line

Keyboard shortcut

BACKSPACE

DELETE

CTRL+X

CTRL+Z

CTRL+Y

CTRL+C

CTRL+V

SHIFT+RIGHT ARROW

SHIFT+LEFT ARROW

CTRL+SHIFT+RIGHT

ARROW

CTRL+SHIFT+LEFT

ARROW

SHIFT+END

SHIFT+HOME

SHIFT+DOWN ARROW

SHIFT+PAGE UP

CTRL+SHIFT+HOME

CTRL+SHIFT+END

CTRL+A

LEFT ARROW

RIGHT ARROW

CTRL+LEFT ARROW

CTRL+RIGHT ARROW

UP ARROW

DOWN ARROW

END

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 53

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

Category

Bookmarks

Splitter windows

Debugger operations

Debugger windows

SQL Window

Action

To the beginning of a line

Up one screen (scrolling)

Down one screen (scrolling)

To the end of a document

To the beginning of a document

Toggle bookmark on/off

Go to next bookmark

Go to previous bookmark

Go to next pane

Go to previous pane

Start Debugging

Stop Debugging

Step Over

Step Into

Run to Cursor

Step Out

Describe from Cursor

Insert or Remove Breakpoint

Toggle (Enable or Disable) Breakpoint

Edit Breakpoint

Go

Restart

Open or Close Watch Window

Open or Close Variables Window

Open or Close Call Stack Window

Open or Close Dependency Tree Window

Go to the Result Tab

Go to the Query Tab

For more information, see

DBArtisan Toolbars and Menus

C

USTOMIZING THE

T

OOLS

M

ENU

The Customize Tools Menu dialog box lets you add up to sixteen commands to the Tools menu.

You can associate any program that running on your local machine. You can use this feature to associate frequently used programs and commands, thereby adding functionality directly to the

DBArtisan application. In addition, you can specify arguments for any command that you add to the Tools menu. You can use these arguments to decipher how you want to execute commands.

DBArtisan includes many pre-defined arguments that let you customize the application.

F11

CTRL+F10

SHIFT+F11

CTRL+D

F9

CTRL+F9

ALT+F9

F5

CTRL+SHIFT+F5

ALT+3

ALT+4

ALT+5

ALT+6

CTRL+ALT+R

CTRL+ALT+Q

Keyboard shortcut

HOME

PAGE UP

PAGE DOWN

CTRL+END

CTRL+HOME

CTRL+F2

F2

SHIFT+F2

F6

SHIFT+F6

CTRL+F5

SHIFT+F5

F10

54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

During the initial installation, DBArtisan automatically adds the following items (if installed locally) to the Tools menu.

• ODBC Administrator

• Oracle Service Name Manager

• Sybase Open Client/Server Config

• Sybase Directory Service Edit (DSEDIT)

• SQL Server Network Library Config

• SQL Server Books Online

• DB2 Client Configuration Assistant

For more information, see

DBArtisan Toolbars and Menus

.

Customize User Tools Menu Dialog Box: DBArtisan lets you customize the Tools menu.

The table below describes the options and functionality on the Customize User Tools Menu dialog box:

Option

Menu Contents

Menu Text

Command

Arguments

Initial Directory

Add Button

Remove Button

Move Up Button

Move Down Button

Description

In the box, click the target command.

In the box, type the name of the tool as you want to appear on the Tools menu.

In the box, type the path and name of the program for the new tool or click Browse to locate the program. For example, C:\WINDOWS\NOTEPAD.EXE

To pass an argument to the command, in the box, type any argument or click the Arrow, and then click the target argument.

NOTE: To display a menu of pre-defined arguments, click the drop-down arrow next to the Argument box, and then select an argument from the list to insert the syntax into the box.

To specify an initial directory, in the box, type the path and name of the file directory or click Browse to locate the file directory.

Click to add a new command to Tools menu.

In the Menu Contents box, click the command you want to remove, and then click the button.

Click to move the command up one position in the menu.

Click to move the command down one position in the menu.

Completing the Customize User Tools Menu Dialog Box

To complete the Customize User Tools Menu dialog box, do the following:

1 On the Tools Menu, select Customize.

DBArtisan opens the Customize User Tools dialog box.

2 Select options.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 55

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

3 Click OK.

For more information, see

DBArtisan Toolbars and Menus

.

S

PECIFYING

A

RGUMENTS

DBArtisan provides a number of pre-defined arguments that you can pass to programs that you have added to the Tools menu. You can specify an argument to be passed to a program for newly added commands by choosing one of DBArtisan's pre-defined arguments or typing in your own arguments. The table below describes the pre-defined arguments:

Argument

$$FilePath$$

$$FileDir$$

$$FileName$$

$$FileExt$$

$$CurLine$$

$$CurCol$$

$$CurText$$

Description

The complete filename of the current source (defined as drive+path+filename); blank if a nonsource window is active.

The directory of the current source (defined as drive+path); blank if a nonsource window is active.

The filename of the current source (defined as filename); blank if the non-source window is active.

The filename extension of the current source; blank if a nonsource window is active.

The current pointer line position within the active window.

The current pointer column position within the active window.

The current text (the word under the current pointer position, or the currently selected text, if there is one.)

$$CurDir$$ The current working directory (defined as drive+path.)

$$CurDatasource$$ The name of the current datasource as defined in DBArtisan.

$$CurUserID$$

$$CurPwd$$

$$CurConString$$

The name of the current datasource user.

The current datasource password.

The current connection string or server name.

NOTE:

Arguments are case-sensitive.

The table below describes examples for using the pre-defined arguments and command-line arguments:

Command

NOTEPAD.EXE

ISQL.EXE

SQLPLUS.EXE

Argument

$$FilePath$$

-U$$CurUserID$$ -P$$CurPwd$$ -

S$$CurConString$$ -i$$FilePath$$

$$CurUserID$$/

$$CurPwd$$@$$CurConString$$

@$$FilePath$$

Description

Launches Microsoft Notepad displaying the contents of the $$FilePath$$ argument.

Launches ISQL, automatically connects to the current datasource using the current user name and password, and executes the contents of $$FilePath$$.

Launches SQL*Plus, connects to the current datasource using the current user name and password, and executes the contents of $$FilePath$$.

TIP:

DBArtisan lets you specify an argument in the DBArtisan opens the Customizing

General User Interface Appearance

.

56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

For more information, see

DBArtisan Toolbars and Menus

.

DBA

RTISAN

D

IALOG

B

OXES

DBArtisan offers the following common dialog boxes.

DBA

RTISAN

W

IZARDS

DBArtisan offers several wizards that let you create objects without knowing the underlying SQL commands. DBArtisan also offers wizards to perform common tasks.

DBA

RTISAN

E

DITORS

DBArtisan stores information about server and object types in object editors. An editor is a tabbed dialog box that groups related information together. Each editor contains a contextsensitive Commands menu with pertinent functionality for the object. Many of the object editors contain a DDL Tab. This tab displays the underlying target object's SQL.

TIP:

The Object Editor tool bar has a refresh button, that lets you refresh Object Editor contents, clear the Object Editors, and log SQL if SQL Logging is turned on.

If an objects has dependent objects, such as tables, triggers, procedures and views, you can view and access their dependent objects in the editor.

For more information, see

Modifying objects using editors

.

C

USTOMIZING THE

DBA

RTISAN

D

ISPLAY

DBArtisan lets you customize your display to suit your work habits.

For more information, see:

Full Screen Mode

Active Windows Dialog Box

Navigating DBArtisan Windows

Output Window

Set Sort Columns Dialog Box

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 57

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

F

ULL

S

CREEN

M

ODE

DBArtisan is equipped with Full Screen mode capabilities that let you conceal the application framework and take advantage of the entire monitor area. Full screen mode hides any other applications running on the computer and uses every available pixel for DBArtisan. Main menu functionality is accessible through keyboard commands when you use Full Screen Mode.

Activating Full Screen Mode

1 On the View menu, click Full Screen.

DBArtisan expands the application to fit the entire monitor area, and displays the Full

Screen Mode icon as a stand-alone floating toolbar.

Dismissing Full Screen Mode

1 Click Full Screen.

DBArtisan reduces the size of the application.

TIP:

If you closed the Full Screen Mode toolbar, right-click the top of the DBArtisan desktop to display the full screen.

For more information, see

Customizing the DBArtisan Display .

A

CTIVE

W

INDOWS

D

IALOG

B

OX

DBArtisan’s multi-tasking environment lets you open multiple active windows. DBArtisan's Active

Windows dialog box lets you see all the open windows in the application workspace. DBArtisan displays active windows as tabs in the Datasource Explorer. Each tab represents a separate window that lets you execute, create or view the objects or schema in your database.

TIP:

DBArtisan lets you use a mouse with a wheel to navigate in active windows.

Opening the Active Windows Dialog Box

1 On the Window menu, click Windows.

DBArtisan opens the Active Windows dialog box and any open windows in the application workspace.

The table below describes the options and functionality on the Active Windows dialog box:

Option

Activate

OK

Save

Description

Sets the focus on the selected window and closes the Active Windows dialog box.

Closes the Active Windows dialog box and makes any changes you have made to the windows in the workspace.

Saves the contents of the selected window. If you are saving a file, DBArtisan prompts you to provide a name and location for the file.

58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

Option

Close Window

Description

Closes the selected window. If you have not saved the contents of the window,

DBArtisan prompts you to do so.

Initiates and displays this Help topic in the DBArtisan Help.

Help

For more information, see

Customizing the DBArtisan Display .

N

AVIGATING

DBA

RTISAN

W

INDOWS

DBArtisan offers functionality through the Windows toolbar that lets you:

• Tile windows vertically or horizontally.

• Cascade open windows.

• Minimize all windows and move to the next active window.

TIP:

DBArtisan lets you use a mouse with a wheel to navigate in active windows.

The table below describes the commands available on the Windows menu:

Command Description

Window

Cascade

Activates the Active Windows dialog box.

Layers all active windows on the desktop so that you can view all active windows simultaneously.

Tile Horizontal Tiles all active windows on the desktop horizontally.

Tile Vertical

Next

Previous

Tiles all active windows on the desktop vertically.

Moves the focus of the application to the next active window.

Moves the focus of the application to the previous active window.

For more information, see

Customizing the DBArtisan Display .

O

UTPUT

W

INDOW

DBArtisan has a separate window that captures all messages returned by the server and to log entries about the progress of operations started by the application.

The Output Window includes the following tabs:

• General

• Find In Files 1

• Find In Files 2

The Output Window lets you do the following to server messages:

• View

• Save

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 59

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

• Print

• Copy

• Flush

For more information, see

Customizing the DBArtisan Display .

CONFIGURING THE OUTPUT WINDOW

Basic Output window options you can configure include:

Floating the Output Window (with Smart Docking)

Docking the Output Window

Undocking the Output Window

Hiding the Output Window

Displaying the Output Window

Floating the Output Window (with Smart Docking)

This is the default view when you first open DBArtisan.

1 Place your pointer on the Output Window and drag it to another location.

Arrows appear and you can move the window to the top, bottom, or sides of the view within

DBArtisan or to another location on your desktop.

2 To change the location of the Output Window, repeat the first step.

3 To disable the feature, right-click and choose Docking or Hide.

Docking the Output Window

1 Place your pointer on the Output Window.

2 Right-click, and then click Docking View.

DBArtisan docks the Output Window to the bottom of the application frame.

Undocking the Output Window

1 Place your pointer on the Output Window.

2 Right-click, and then click Docking View.

DBArtisan floats the Output Window.

60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A P P L IC A T IO N B A S IC S > AP P L IC AT I O N B A S I C S

Hiding the Output Window

1 On the View menu, click Output.

DBArtisan hides the Output Window.

Displaying the Output Window

1 On the View menu, click Output.

DBArtisan displays the Output Window.

For more information, see

Customizing the DBArtisan Display .

SAVING OUTPUT WINDOW MESSAGES

DBArtisan lets you save messages in the Output window to a file.

1 Right-click a message in the Output Window, and then click Save.

DBArtisan opens the Save As dialog box.

2 In the File Name box, type the location and name of the file.

DBArtisan defaults the file extension to.msg.

3 Click Save.

DBArtisan saves the file.

For more information, see

Customizing the DBArtisan Display .

PRINTING OUTPUT WINDOW MESSAGES

DBArtisan lets you print the messages you see in the Output window.

1 Right-click a message in the Output Window, and then click Print.

DBArtisan opens the Print dialog box.

2 Configure your print job.

3 Click Print.

DBArtisan prints the file.

For more information, see Customizing the DBArtisan Display

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 61

A PP L I C A TI ON B A SI C S > A P P L IC A T IO N B AS IC S

COPYING OUTPUT WINDOW MESSAGES

DBArtisan lets you copy all or part of the contents of the Output window to the clipboard.

1 Select the target Server Messages.

2 Right-click, and then click Copy.

DBArtisan copies the selected messages to the Windows clipboard.

3 Paste the text into other Windows applications.

For more information, see Customizing the DBArtisan Display

.

CLEARING OUTPUT WINDOW MESSAGES

DBArtisan lets you clear server messages from the Output Window.

1 Right-click a message in the Output Window, and then click Clear.

DBArtisan clears the server messages.

For more information, see

Customizing the DBArtisan Display .

S

ET

S

ORT

C

OLUMNS

D

IALOG

B

OX

The Set Sort Columns dialog box lets you sort multiple columns, and sort column identification.

Completing the Set Columns Dialog Box

To complete the Set Columns dialog box, do the following:

1 In the right pane of the application, right-click a column heading and select Sort Multiple

Columns.

DBArtisan opens the Set Sort Columns dialog box.

2 In Column Name select the column(s) to use to sort the information in the right pane of the application.

3 Click the right arrow to move the column(s) to the Column Name box.

4 Click the up and down arrows to change the order of the sort columns.

62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

T

UTORIAL EXERCISES

The exercises that follow walk you through the DBArtisan’s major functional areas. After completing these exercises, you will have the foundation you need to explore the many features and benefits of DBArtisan. You’ll have learned how to competently manage the major database administration disciplines using DBArtisan’s standard cross-platform console. In addition, you will have a solid understanding of DBArtisan’s more advanced Space, Performance, and Capacity management capabilities.

This guide is divided into 10 sessions:

Session 1: Getting Started with DBArtisan

Session 2: Object and Schema Management

Session 3: Database Security Management

Session 4: Space Management

Session 5: SQL Management

Session 6: Job Management

Session 7: Data Management

Session 8: Performance Management

Session 9: Capacity Management

Session 10: General Utilities and Tools

You can use this basic tutorial as a roadmap of product highlights, but also to help you find your own path to explore DBArtisan.

Once you’ve started, you can select Help Topics from the Help menu to find many additional resources that complement and build on many of the activities shown in this tutorial.

S

ESSION

1: G

ETTING

S

TARTED WITH

DBA

RTISAN

How you start DBArtisan depends on the type of application you are evaluating:

• InstantOn version – start the application by double-clicking the file you downloaded.

• Fully-installed version - The Start menu sequence for DBArtisan is always in the form

Programs > Embarcadero DBArtisan version identifier > Embarcadero DBArtisan version

identifier, where version identifier reflects the version you are running.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 63

TU TORI AL EX ERCI SES

To get started

1 Run DBArtisan.

The first time DBArtisan starts, a dialog opens, prompting you to set up datasources. In addition to letting you manually set up individual datasources, a number of more automated methods are available. If you have installed and used other Embarcadero tools,

DBArtisan can find any active datasources being used by those tools. In addition, DBArtisan provides a Discover Datasources feature that automatically searches the DBMS configuration files on your system for datasources that are not currently registered. Since other Embarcadero tools let you export datasource definitions to file, you also have the option of importing these definitions.

2 For the purpose of this tutorial, click Cancel. You will be registering a datasource manually.

R

EGISTERING

C

ROSS

-P

LATFORM

D

ATASOURCES

The Datasource Registration Wizard walks you through the process of registering a datasource for use with DBArtisan.

1 On the Datasource menu, select Register Datasource. DBArtisan opens the wizard, initially prompting you for the DBMS type.

2 Select Oracle as the database type and then click Next. DBArtisan opens the next panel of the Datasource Registration Wizard.

64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

3 Ensure that Use TNS Names Alias is deselected and provide the Host machine name associated with an Oracle datasource.

4 Type a Port number. The default is 1521, but you can change it to wherever the Oracle listener is set up.

5 Specify a Type of SERVICE_NAME or SID and enter the corresponding value in the SID/

Service box.

6 In the Datasource Name text box, type SAMPLE_DATASOURCE for the purpose of this example.

7 Click Next. DBArtisan saves your selections and opens the next panel of the wizard. This is where you enter login credentials.

8 Provide a User ID and Password.

9 To save and encrypt your password so that you do not have to provide credentials each time you connect, select Auto-Connect?.

10 Click Next.

DBArtisan saves your selections and opens the next panel of the wizard. DBArtisan’s SQL

Editor supports directives similar to C compiler directives. This panel lets you specify directories that will be searched when a

#include

directive is encountered. You can leave the field blank for now.

11 Click Next. DBArtisan opens the final panel of the wizard.

12 In the Managed Datasources tree, select the folder corresponding to the type of DBMS you are registering.

13 Click Finish. DBArtisan prompts you as to whether you want to connect to the datasource.

14 Click Yes.

DBArtisan offers the same easy-to-use Datasource Registration Wizard for IBM DB2, Microsoft

SQL Server, Oracle, MySQL, and Sybase connections. The connection information only needs to be set up one time for each datasource and can be saved locally or in a common datasource catalog for use by other Embarcadero products.

You can configure Embarcadero database applications to use a datasource catalog stored in the system registry of your machine (local) or to use a datasource catalog located in the registry of another computer (remote). This capability makes it easy to share datasource catalogs among multiple users so that maintenance can be administered from one location.

All Embarcadero database administration products share the datasource catalog, which means that when you set up your datasource catalog using one product such as DBArtisan, the same list of datasources is available in other Embarcadero Technologies products. Any changes you make to the datasource catalog are reflected in all Embarcadero database management products.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 65

TU TORI AL EX ERCI SES

G

ENERAL

U

SABILITY

F

EATURES

DBArtisan provides many “user in mind” features that make the product configurable to meet individual needs and preferences. These features are designed to shave time off the tasks that you perform many times on any given working day.

Retaining Datasource Explorer View Settings

1 At the top of the Explorer tree, click to expand the drop-down menu.

2 Select Retain View Settings.

The next time you open DBArtisan, the Explorer appears just as you left it.

66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

Working with Datasource Explorer Bookmarks

1 In the Explorer tree, right-click the datasource you registered and select Add Bookmark from the context menu.

DBArtisan opens the Add Friendly Bookmark Name dialog box.

2 Click OK.

After Bookmarks are defined you can use them to easily navigate to commonly used datasource resources via the main menu Bookmarks item.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 67

TU TORI AL EX ERCI SES

Setting Keyboard Shortcuts and Hotkeys

1 From the Tools menu, select Customize. The Customize dialog box opens.

2 In the Customize dialog box, open the Keyboard tab.

The Keyboard tab can be used to set keyboard shortcut hot keys for all areas of DBArtisan functionality.

3 Click Close.

Datasource Explorer tree filtering

DBArtisan provides a number of ways to filter the Datasource Explorer tree, easing navigation.

During a DBArtisan session, you can use the Filter box at the top of the Datasource Explorer to display only those objects whose name contains characters typed in the Filter box.

68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

If you are interested in a more permanent filtering method, you can create filters at the DBMS or datasource level. Filters are available under the Filters node for each datasource.

Right-clicking in the tree and selecting Filter opens the Filters dialog. It lets you filter out object types at the DBMS platform level. It also lets you create object filters.

Object filters can be object name-based, schema-based, or some combination thereof. A name-based or schema-based filter consists of one or more ANDed conditions. You also specify the object types to which the filter is to apply.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 69

TU TORI AL EX ERCI SES

Object filters are created at the DBMS or datasource level and can be enabled and disabled for individual datasources.

The Filters dialog also lets you hide or display nodes based on object type. Node filtering lets you filter out object types for all datasources of the same DBMS type.

70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

In addition to any custom object filters you create, the Filters node also provides access to two default filters: Ignore System Objects and Show Only My Objects. They can be applied at the datasource level and cannot be deleted or modified.

S

ESSION

2: O

BJECT AND

S

CHEMA

M

ANAGEMENT

DBArtisan provides unparalleled database object management capabilities. Its database platform-specific and version-specific graphical object editors and wizards enable you to easily create, drop or alter any of your accessible database objects.

C

REATING A

T

ABLE

O

BJECT

The following example walks you through creating a standard Oracle table object. This concept carries across all of the supported object types, across all of the supported platforms.

1 On the Datasource Explorer, expand the Schema node of an Oracle datasource.

2 Right-click the Tables node, and then select Create.

3 DBArtisan opens the Table wizard and leads you through the process of creating a table object.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 71

TU TORI AL EX ERCI SES

4 Complete the wizard panels, and ensure that you create two or more columns in the table.

5 Click Finish.

DBArtisan lets you preview any and all generated scripts before you submit them to the database. This is standard for all object-related scripts.

M

AKING CHANGES TO AN EXISTING TABLE OBJECT

Changes to database tables, such as modifying column lengths, inserting new columns, or deleting unneeded ones, can require dropping of a table. This requires knowledge of the underlying object dependencies so that these dependent objects are rebuilt after the table has been recreated. DBArtisan provides the ability to perform “extended” table alterations by constructing a SQL script with the steps necessary to save off the original data, create the new table, and populate it with the original data. Once these steps are complete, all dependent objects are then rebuilt and permissions re-applied.

1 From the Explorer, Tables node, select the table you created in the previous example.

2 Double-click the table or from the Command menu, click Open.

DBArtisan opens the Table Editor. The Table Editor provides access to basic table properties, the list of table columns as well as any constraints, storage parameters, space allocation, partitioning, table dependencies, object privileges, table DDL and other attributes of the table.

72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

3 Ensure that the Columns tab is selected and select one of the columns you created in this table you want to modify.

Details for the column are shown in the Column Attributes area on the right side of the pane.

4 In the Width or Scale text box, type a new value.

5 On the Table Editor toolbar, select the Alter button.

DBArtisan lets you preview the SQL script before you submit it to the database.

6 Close the Table Editor pane.

W

ORKING WITH

O

BJECT

DDL

DBArtisan allows you to easily extract DDL for single or multiple objects using several methods.

The most straight-forward is described here:

1 On the Explorer, right-click the table you created earlier, and then select Extract.

The DDL for all highlighted objects is extracted directly in a DDL Editor where it can be altered, executed and saved to the database, with no intermediary steps required. For example:

2 Close the PL/SQL Editor pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 73

TU TORI AL EX ERCI SES

S

ESSION

3: D

ATABASE

S

ECURITY

M

ANAGEMENT

DBArtisan can help you efficiently establish and maintain database security. Whether you are managing an existing production database or setting up a new environment, you’ll find consistent support across all of the supported platforms.

A

DDING A NEW DATABASE USER

While this example focuses on creating a new Oracle user, the same wizard-driven principle applies to all security objects (groups, roles, etc).

1 On the Datasource Explorer, expand an Oracle datasource, and then the Security node.

2 On the Security node, right-click Users, and then click Create.

DBArtisan opens the User Wizard and leads you through the process of adding a user.

3 Provide the information on each panel of the User Wizard until you reach the DDL View panel.

DBArtisan allows you to preview any and all generated scripts before they are submitted to the database. This is standard for all object-related scripts.

4 Click Execute to create the new user.

DBArtisan automatically opens the User Editor for the new user. The standard User Editor can be used to manage existing database users as shown below.

74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

G

RANTING AND

E

DITING

U

SER

P

RIVILEGES

Privileges can be easily granted, revoked, or viewed from within either of two editors within

DBArtisan; the User Editor, or the individual object editor (Table, Procedure, etc.) The User

Editor provides a tabbed interface, which can be used to view and modify individual attributes of the user.

1 In the User Editor, open the Object Permissions tab.

2 Use the Object Type dropdown to select a set of objects such as tables or views.

3 Right-click a cell (corresponding to a specific object and a specific permission, such as

DELETE), and then click Grant.

A distinctive icon is shown in the cell, indicating that this permission is granted. You use a similar process to revoke privileges and perform other permission-based activities.

4 On the Object Editor toolbar, click Alter to implement the changes.

S

ESSION

4: S

PACE

M

ANAGEMENT

Managing space is vital to ensuring the availability and performance of your databases.

DBArtisan incorporates many built-in space features that let you smartly manage and exploit all aspects of your database’s storage. The following example walks you through a review of

DBArtisan’s built-in support for reporting Oracle tablespace storage and space data.

B

UILT

-

IN

S

PACE

M

ANAGEMENT

While this example is specific to Oracle tablespaces the same concept applies to all of the supported platforms.

1 On the Datasource Explorer, expand any Oracle datasource.

2 On the Oracle datasource, expand the Storage node, and then select Tablespaces.

3 Right-click any tablespace listed in the right pane of the Explorer window, and then click

Open.

Embarcadero DBArtisan opens the Tablespaces Editor.

4 Select the Properties tab. The Storage group on that tab provides a summary of the space settings for the tablespace.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 75

TU TORI AL EX ERCI SES

5 Select the Extent Details tab. It provides more detail on an extent-by-extent basis.

6 On the Tablespace Editor, click the Space tab.

The Space tab displays a graphical view of the free and used blocks for the target tablespace.

76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

7 Finally, on the Tablespace Editor, click the Map tab.

The Map tab displays a color-coded map of the objects contained on the tablespace. The map segments are proportional to the actual size of the objects on the tablespace.

Note the additional Reorganize and display options.

8 Close the Tablespaces Editor pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 77

TU TORI AL EX ERCI SES

A

DVANCED

S

PACE

M

ANAGEMENT

(O

RACLE AND

SQL S

ERVER ONLY

)

For advanced space analysis and management, DBArtisan’s optional Space Analyst component contains sophisticated diagnostics to help you pinpoint all space-related problems in your database, as well as an intelligent reorganization wizard that can reorganize all or selected parts of your database.

NOTE:

Space Analyst is a separately-licensed component. If you are not working with an

evaluation copy of DBArtisan or do not have a specific license, procced to Session 5:

SQL Management . Contact your license administrator or your Embarcadero

representative about obtaining a license.

To see the sort of information provide by the Space Analyst

1 On the Analyst menu, select Space Analyst.

NOTE:

If prompted to install components on the server, allow DBArtisan to install the components.

The Space Analyst launches in the DBArtisan workspace.

78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

Embarcadero’s Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance inefficiencies that result in poor space management. See the

DBArtisan online help for a detailed walkthrough of all available features and functionality.

2 Select the Data Files, Tablespace Map, Tables, and Indexes tabs available at the bottom of the Space Analyst pane.

3 Close the Space Analyst pane.

S

ESSION

5: SQL M

ANAGEMENT

DBArtisan provides powerful visual tools for creating and analyzing complex SQL statements and server-side code objects. The following examples walk you through DBArtisan’s Visual

Query Builder, feature-rich ISQL facility and some of the advanced analysis and debugging capabilities provided by the Embarcadero SQL Debugger and SQL Profiler.

V

ISUAL

Q

UERY

B

UILDER

1 From the Tools menu, select Query Builder.

DBArtisan opens the Query Builder.

2 In the Tables/Views tab, right-click a table or view and select Add.

3 In the window that opens, select the columns to return in the result. For example:

Query Builder generates the query text in the lower SQL window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 79

TU TORI AL EX ERCI SES

You can build advanced queries using the options supplied on the DML tab. You choose the type of query (SELECT, INSERT, and so on) using the dropdown on the Query Builder toolbar.

4 After the query is built, click the Execute button (green arrow) on the Query Builder toolbar.

Query Builder displays results in the lower SQL window.

5 Close the Query Builder pane.

ISQL W

INDOW

DBArtisan offers a fully-featured SQL editor. In addition to basic text processing features, the editor environment offers testing/debugging and execution facilities. In combination with supporting features, the ISQL editor eases and speeds up the process of developing working scripts.

A

UTOMATED ERROR DETECTION AND CODING ASSISTANCE

Rapid SQL provides a range of features that detect or help you avoid errors and save keystrokes in developing your scripts.

To enable these features:

1 On the File menu select Options. The Options dialog opens.

2 In the left-hand pane, expand the ISQL node and then select Code Assist.

80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

3 On the Code Assist panel:

• Ensure that Enable Code Complete is selected.

• Ensure that Enable Real-time syntax checking is selected.

• Ensure that Severity levels for semantic validation problems has Warning selected.

4 Click OK.

To see these features in action:

1 On the File menu, select New > ISQL.

DBArtisan opens the ISQL Editor window. You can add SQL code via your method of choice

(free-form typing, retrieve from a file, paste copied code, etc.).

2 Experiment with the automated error detection and coding assistance as follows:

• Type SELECT * FROM and stop typing. Note the error condition.

By default, DBArtisan runs a syntax check any time there is an interval of 1.5 seconds between keystrokes. You can also disable automatic syntax checking and only run a check when you manually initiate it. Syntax error annotation persists until you correct the problem.

• This time type a fragment that includes the name of a nonexistent object, SELECT *

FROM NON.OBJECT, for example. For now, ignore any popups. The warning condition is a result of on-the-fly semantic validation. DBArtisan notifies you when a script contains a reference to an object that DBArtisan cannot resolve.

• Type SELECT * FROM followed by a space and then stop typing. If no popup appears, press CTRL+SPACE. The Code Complete suggestion box lets you select from objects or object name components such as databases or schema. This feature saves keystrokes and minimizes typing errors. See the online Help for full descriptions of these features.

3 If you want to disable the automated errror detection and coding assistance features, select

File > Options and on the Code Assist page, click Restore defaults.

F

EATURE

S

UMMARY

The ISQL Editor window includes the following features and options:

• The ISQL window highlights all platform-specific and general keywords, and provides options for SQL code formatting and analysis.

• Once code is executed you have control over whether your transaction is committed or rolled back from the database.

• For all open ISQL windows, there are also options for connection locking, scheduling, executing your code across multiple datasources, explain plan generation, and SQL Tuning.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 81

TU TORI AL EX ERCI SES

S

ETTING ENVIRONMENT OPTIONS

DBArtisan lets you set platform-specific query options to immediately determine if your code is optimized.

1 Press F8.

DBArtisan opens the Query Option dialog box. For example, when connected to a SQL

Server datasource, the Query Options dialog offers the following options.

2 Either close the Query Options dialog and then the SQL Editor window or enter a valid query in the ISQL editor and then execute your query by clicking the Execute button.

3 When complete, ensure that only the Datasource Explorer window is open.

SQL D

EBUGGING

, A

NALYSIS AND

T

UNING

To analyze and debug your SQL code, DBArtisan provides cross-platform SQL code debuggers, and for your Oracle databases, a robust PL/SQL code profiler that helps you to pinpoint and eliminate “hot spots” within poorly running server-side code. To ensure code efficiency, the

ISQL window provides tight integration with Embarcadero’s SQL Tuner, so you can perform multiple “test then tune” iterations without having to leave an open ISQL window.

While this example is specific to Oracle PL/SQL Debugging, the same interface and functionality applies to all of the supported platforms.

To see debugging in action

1 On the Datasource Explorer, expand any Oracle datasource node.

2 On the Oracle datasource, expand the Procedures node.

82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

3 In the right pane of the Explorer, right-click any stored procedure, and then select Debug.

4 If prompted, enter any input parameters and then click Continue.

After the SQL Debugger interface is displayed you can step through code, step into dependencies, set and watch variables, and even perform basic code profiling for each line of executed code. See the DBArtisan online help for a detailed listing of all available SQL features.

5 Experiment with debugging features and then close the debugger window.

S

ESSION

6: J

OB

M

ANAGEMENT

DBArtisan freely integrates with the Microsoft Windows Task Scheduler, which allows you to virtually schedule any task to run on your own computer whenever and how often you’d like.

While this example is specific to an Oracle table redefinition, the same concept applies to any job or script that can be scheduled.

To schedule a job, do the following:

1 On the Explorer, expand any Oracle datasource.

2 On the Oracle datasource, expand the Tables node, right-click any table, and select Extract.

DBArtisan extracts the DDL that defines the selected table and opens an ISQL Editor window on the DDL.

3 From the ISQL window toolbar, click the Schedule button.

The Schedule Action dialog box opens. You can provide a name, set notifications, and specify an output directory for the new job.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 83

TU TORI AL EX ERCI SES

4 After you have completed the dialog box, click OK. The Job Scheduler dialog opens.

5 Proceed as prompted to schedule your job. When finished, close the ISQL window.

You can use the Oracle Job Queue explorer node to monitor your job..

S

ESSION

7: D

ATA

M

ANAGEMENT

DBArtisan provides comprehensive facilities to help you manage the data in all of your databases. A visual data editor helps you add, change, and delete data from your tables with all referential integrity enforced. You can create insert statements for tables using current data and also extract data as XML documents for certain databases. Rounding out its rich Schema

Management capabilities, DBArtisan also allows you to migrate schema objects and associated table data from one database server to another, across the same or different platforms.

V

ISUAL

D

ATA

E

DITING

To start the Visual Data Editor, do the following:

1 In the Datasource Explorer, right-click any table and select Edit Data. DBArtisan opens the

Data Editor Filter dialog.

2 In Columns, select the columns that are to be included in the editable data.

84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

You can also filter the editable rows by including your own SELECT statement.

3 Click OK.

In Live mode all changes are applied to the database when you move off of an updated or inserted row. Deleted rows are immediately removed from the database. Batch mode allows you to make changes and then save all when all are complete. Mode is controlled by a dropdown in the Data Editor toolbar.

4 Experiment with editing your data, and when complete, on the Data Editor toolbar, click the

Execute (blue arrow) button.

DBArtisan commits your changes. Regardless of mode, all of the generated DML statements are viewable in the lower SQL window.

5 Close the Data Editor pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 85

TU TORI AL EX ERCI SES

W

ORKING WITH

T

ABLE

D

ATA

– C

REATE

I

NSERT

S

TATEMENTS

DBArtisan lets you generate a set of INSERT statements based on rows of an existing table.

1 On the Datasource Explorer, select any Oracle datasource.

2 On the Oracle datasource, expand the Tables node.

3 In the right pane of the Explorer window, right-click any table, and then select Create Insert

Statements. DBArtisan opens the Create Insert Statements dialog box. For example:

4 In Columns, select the columns you want to include in the INSERT statement.

5 You can also filter what rows are included by adding your own WHERE clause.

6 Click OK.

The resulting INSERT statements are created and presented in an active ISQL window. At this point they can be executed immediately, scheduled to later or saved. Note that all extracted

INSERT statements can be run against the same or different databases containing a similar schema.

86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

7 Close the editor pane.

W

ORKING WITH

T

ABLE

D

ATA

– E

XTRACT

D

ATA AS

XML

DBArtisan lets you generate an XML representation of table data.

To extract data as XML

1 On the Datasource Explorer, expand any Oracle datasource.

2 On the Oracle datasource, expand the Tables node.

3 In the right pane of the Explorer window, right-click any table listed, and then select Extract

Data as XML.

4 Select the columns to include in the SELECT statement.

5 You can also filter what rows are included by adding your own SELECT statement.

6 Click OK.

The resulting XML document is created and presented in an active XML Editor. At this point the document can be saved in XML format.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 87

TU TORI AL EX ERCI SES

7 Close the editor pane.

A

DVANCED

D

ATA

M

ANAGEMENT

– S

CHEMA AND

D

ATA

M

IGRATION

DBArtisan provides advanced data management tools that help you to move schema and corresponding table data across the same or different platforms. You can copy a single database object, all objects owned by a specific user, or an entire database all guided by a wizard-driven process.

While this example is specific to an Oracle to SQL Server schema and data migration the same concept applies to any migration involving any combination of the supported platforms.

To open the Schema Migration Wizard:

1 On the Utilities menu, select Schema Migration. DBArtisan opens the Migration Wizard.

2 Select the Perform new migration option.

3 Click Next. DBArtisan opens the next panel of the Migration Wizard. For example:

88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

4 Select an Oracle datasource from the Source Datasource list and a Microsoft SQL Server datasource from the Target Datasource list.

5 Click Next and provide login credentials if prompted. DBArtisan opens the next panel of the

Migration Wizard.

Since Microsoft SQL Server supports multiple databases per datasource, you must choose a database.

6 Select an entry from the Target Database list and then click Next. DBArtisan opens the next panel of the Migration Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 89

TU TORI AL EX ERCI SES

7 In the Object Types list, select the object types to be migrated to the target datasource.

As you select object types, the Objects list is updated to let you select specific objects to migrate. The Expand/Collapse icons let you drill down through dependencies/ containment.

8 Use the Objects list to select the specific objects to migrate.

9 Click Next. DBArtisan opens the next panel of the Migration Wizard.

90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

10 Examine the migration options offered but leave the default settings for now.

11 Click Next. DBArtisan opens the next panel of the Migration Wizard.

Clicking Finish executes the migration and lets you view the progress of the job.

S

ESSION

8: P

ERFORMANCE

M

ANAGEMENT

DBArtisan offers a number of different options to help you manage the performance of your databases. First, DBArtisan ships with a built-in process monitor that helps you understand who is connected to your database along with each user’s current activity and session-related data.

For more robust performance details DBArtisan’s Performance Analyst add-on is a powerful client-side database monitor that runs fully contained in the DBArtisan console.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 91

TU TORI AL EX ERCI SES

M

ONITORING

S

ESSIONS

While this example is specific to Oracle the Process Monitor is available for all of the supported platforms.

To start the DBArtisan Process Monitor:

1 On the Datasource Explorer, select any Oracle datasource.

2 From the Utilities menu, select Database Monitor.

92

The Database Monitor includes the following options and features:

• Highlight any session and any currently running SQL is displayed in the lower pane.

• You can drill-down into a specific session to display session-level statistical details, historical and current wait events along with a working copy of the currently running SQL that can be copied to an ISQL for explain plan generation.

• By using the Monitor dropdown options you can display more advanced database-level monitoring data such as locks, blocking locks, hit ratio by user, Top 20 SQL etc.

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

3 Close the Database Monitor pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 93

TU TORI AL EX ERCI SES

A

DVANCED

C

LIENT

-S

IDE

P

ERFORMANCE

M

ONITORING

For advanced performance monitoring and management, DBArtisan’s optional Performance

Analyst provides intelligent diagnostic information and strong drilldown details to help you get to the heart of any episode of performance degradation. Performance Analyst integrates completely with DBArtisan so you can fix any performance problems with a few clicks of the mouse.

NOTE:

Performance Analyst is available for Oracle, SQL Server, Sybase and DB2 for Unix,

Windows, and Linux.

NOTE:

Performance Analyst is a separately-licensed component. If you are not working with

an evaluation copy of DBArtisan or do not have a specific license, procced to Session

10: General Utilities and Tools . Contact your license administrator or your

Embarcadero representative about obtaining a license.

1 On the Datasource Explorer, select any Oracle datasource.

2 On the Analyst menu, select Performance Analyst. The Performance Analyst opens in the

DBArtisan workspace for the target datasource.

In addition to the Home page displayed initially, Performance Analyst presents several pages of statistics. Page categories include Memory, I/O, Space, Objects, Users, and OS.

Each page contains several panes of related statistics, the Home page’s Key Ratio Analysis pane, for example:

Note the toolbar at the top of the Performance Analyst. It lets you navigate among the

Performance Analyst statistics pages.

3 Experiment with displaying the various pages available from the toolbar dropdowns.

See the DBArtisan online help Performance Analyst topics for a detailed walkthrough of all available features and functionality.

94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

For enterprise performance monitoring, DBArtisan integrates with the Embarcadero

Performance Center Web Client. While integration requires a licensed Performance Center server, there are no upgrade requirements for the DBArtisan console.

NOTE:

You should only work through the following exercise if you are a current Performance

Center user. If you are not a Performance Center customer, please read the following for information purposes only.

Use the following to establish a quick connection to your Performance Center server:

1 On the File menu select Options.

2 On the Options Editor, select the Perf Center tab.

3 Select the Web Client radio button and enter the Performance Center server info as indicated.

4 Perform a test to ensure the configuration is correct.

5 After a connection is established you can use the Tools > Performance Center option to launch the Web Client within the DBArtisan console. If you are using the full Performance

Center client you can use this same Options editor tab to switch back.

NOTE:

The Performance Center web client provides read-only access to the monitored datasources. To perform edits or maintenance you must switch to the full Performance

Center client.

Please see the relevant DBArtisan online help topics for a detailed walkthrough of all available features and functionality.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 95

TU TORI AL EX ERCI SES

S

ESSION

9: C

APACITY

M

ANAGEMENT

Planning for the future of your critical databases used to be a difficult task. However, DBArtisan’s optional Capacity Analyst tool makes it easy to understand where your databases are today and where they are headed in the future. Capacity Analyst lets you track key database metadata and performance metrics over time so you can perform trend analysis on key areas like growth, object fragmentation, I/O and session load. Like all of the Analyst Series products, Capacity

Analyst runs fully contained within DBArtisan so you have access to smart, built-in forecasting mechanisms that allow you to predict when your databases run out of space and the ability to proactively manage your storage assets, all from the same console.

Performance Analyst is available for DB2 for Unix, Windows, and Linux, Sybase, Oracle, and SQL

Server.

1 On the Datasource Explorer, select any Oracle datasource.

2 From the Analyst menu select Capacity Analyst.

NOTE:

Capacity Analyst is a separately-licensed component. If you are not working with an evaluation copy of DBArtisan or do not have a specific license, procced to

Session 10:

General Utilities and Tools . Contact your license administrator or your Embarcadero

representative about obtaining a license.

The Capacity Analyst opens in the DBArtisan workspace for the target Oracle datasource.

See the relevant DBArtisan online Help topics for a detailed walkthrough of all available features and functionality.

96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TU TORI AL EX ERCI SES

S

ESSION

10: G

ENERAL

U

TILITIES AND

T

OOLS

No evaluation of DBArtisan would be complete without a mention of the general utilities and tools that are available across all of the supported platforms. The Utilities menu offersprimarily

DBMS-specific operations while those offerd on the Tools menu are more generic.

The Utilities menu contains the more advanced DBArtisan features. The available menu items are context-sensitive and version-specific for the selected datasource DBMS platform. This example above shows the Utilities menu features that are available for Oracle.

The Tools menu contains those features that are common across all DBMS platforms. Te example above shows the Tools menu features that are available for all supported DBMS platforms. Note that if any other Embarcadero products are installed on your client they will be available on the Tools menu.

All DBArtisan utilities and tools provide a common interface that walks you through all input and execution requirements. All results are consistently presented so you can easily move between features without effort or confusion.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 97

TU TORI AL EX ERCI SES

98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S

PECIFYING

DBA

RTISAN APPLICATION AND FEATURE OPTIONS

DBArtisan lets you customize the application configuration for your specific needs. All DBArtisan application settings are available in the Options Editor, which is organized in a tabular format based on feature sets.

To specify options for the DBArtisan application or a particular feature

1 On the File menu, click Options.

DBArtisan opens the Options Editor.

2 Click the tab corresponding to the feature you want to customize:

Connection Options

Data Editor Options

Data Transfer Options

Explorer Options

Datasource Options

Specifies the timeout parameters, packet size for a connection, and ANSI to OEM settings.

Specifies settings for Data Editor.

Sets default directories when performing data unload and load and data export and import operations.

Sets defaults for the organization of objects in the Datasource Explorer.

Specifies general datasource management options and Datasource Explorer preferences.

DBMS_Java Options

DDL Extract Options

Debug Options

Directories Options

General Options

Specifies load Java files and drop Java files.

Specifies whether or not DBArtisan should include DROP statements when extracting the schema of different database object types.

Sets the duration of your debug initialization and debug session, enable or disable

DBMS_OUTPUT, and enable the refresh option.

Sets the default directories for placing the output of different operations such as HTML reports or schema extractions.

Sets defaults for automatic login, restoring the last session, and other general application options.

Dictates the physical appearance of the results window grid.

Grid Properties (Results window) Options

ISQL Options

Sets defaults for the maximum allowable errors before aborting the execution of a SQL script, executing selected text, and the position of Query and Results tabs.

Lets you specify Java Virtual Machine options.

Java Options

Logging Options

Migration Options

Sets defaults for SQL Logging.

Sets the default options for schema migration operations.

MySQL Utilities Options

Specifies paths to MySQL utilities.

Oracle Utilities Options

Specifies the location of the Oracle Utilities.

Perf Center Options

Query Builder Options

Results (ISQL) Options

SMTP Mail Options

Specifies Performance Center’s integration with DBArtisan.

Specifies global settings for Query Builder.

Specifies auto format result sets, sets the display and format of Result Windows, and the mail file type and default fonts.

Lets you specify defaults for your outgoing mail notifications.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 99

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Space Analyst Options

Warnings Options

Sets Space Analyst options.

Activates specific warnings when undesirable actions are attempted against a database.

3 Set feature options on the tab and then click OK.

NOTE:

If there is an open document, DBArtisan opens the Update Document Statement

Properties dialog box. The Update Document Statement Properties dialog box lets you override changes you made to a current document or documents with new setting you made in the Options Editor.

C

ONNECTION

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can configure a number of server parameters for interacting with your datasources on the

Connection tab.

NOTE:

Setting Connection Options are available for Microsoft SQL Server and Sybase ASE.

The table below describes the options and functionality on the Connection Tab:

Option Description

Login Timeout

Specifies the number of seconds that the application should wait for a response to a connection request from server. If server does not respond within the specified period, the application aborts the connection and returns an error message.

Default

30

0 Query Timeout Specifies the number of seconds that the application should wait for a response to a query from the server. If the server does not respond within the specified period, the application terminates its query process and returns an error.

Packet Size

Specifies the network packet size to be used when communicating with the server, in bytes.

The maximum number of connections allowed by the ctlib setting on the client.

Max

Connections

(ctlib)

Client

Character Set

Character set of client computer.

512

0

Host Name

Use Quoted

Identifiers

Name of the client computer.

If you plan to use delimited identifiers, select this option.

Local character set

Local name

Not selected

10 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

D

ATA

E

DITOR

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Data Editor tab.

NOTE:

Option parameters set in the Options Editor override options set within Query Builder and Data Editor.

The table below describes the options and functionality on the Data Editor Tab:

Interface Element Option

Default Execution

Mode

Description

Live Mode lets you execute changes one row at a time. Batch Mode lets you make unlimited changes prior to execution. Batch Mode offers three sub-options: Ignore errors-continue processing, Prompt on Error, and

Stop after error(s) (number of errors allowed before stopping execution)

Data Editor File

Grid Font

Printer Font

Auto Format

(Best Fit)

Mail File Type

Sets the default mail output style as Results, Tab

Delimited, Comma Separated, or HTML.

Includes column titles when saving.

Include column titles when saving

Customizes font style, and size for the Data Editor and the Results Grid.

Sets font style, and size for printing output.

Fits formatting to match your desktop.

Begin and End

Transaction

Statements

Default Date/

Time Format

Adds a beginning and ending transaction on each statement.

Confirmation

Dialog Options

Default

Live Mode

Results

Not selected

Available

Available

Selected

Selected

Displays the current date/time format and lets you customize the date/time display.

Use Calendar

Control as default

If selected, DBArtisan uses the Calendar Control window.

2 digit year system setting warning

If selected, DBArtisan sends a warning when you use a two digit year system setting.

Enabling Show Delete Confirmation Dialog, Show Update Confirmation

Dialog, or Show Update LOB Confirmation Dialog lets you display a confirmation dialog box when you use a delete command, update a row, or update a LOB, respectively.

Results

Not selected

Selected

Selected

D

ATA

T

RANSFER

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Data Transfer tab.

You can configure DBArtisan to use default directories when performing data unload and load and data export and import operations. Setting a default directory saves time because it describes a single reference point for loading or unloading, exporting and importing table or view data files.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 101

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

The table below describes the options and functionality on the Data Transfer Tab:

Option

Data Unload

Data Load

Oracle Export (for Oracle)

Oracle Import (for Oracle)

Description

Specifies the name and location of the default directory in the Data Unload box.

Specifies the name and location of the default directory in the Data Load box.

Specifies the name and location of the default directory in the Oracle Export box.

Specifies the name and location of the default directory in the Oracle Import box.

D

ATASOURCE

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Datasource tab. The table below describes the options and functionality on the Datasource Tab:

Option

Datasource Storage

Management

Recent Datasource List

Contains

Default to Alias Usage

When Defining New

Datasources

Description

DBArtisan offers both registry-based and file-based datasource catalog

management. Prior to changing methods, see Understanding the

Datasource Catalog

.

The following options are offered:

Windows Registry datasource catalog - The datasource catalog is stored and managed locally, in the Windows registry. This user can add and delete datasources and edit the registration details of existing resources. Any changes are retained across startups of DBArtisan.

File based datasource catalog - The datasource catalog is stored locally and is file-based (%APPDATA%\Embarcadero\Data Sources\ in a default installation). This user can add and delete datasources and edit the registration details of existing resources. Any changes are retained across startups of DBArtisan.

Network shared datasource catalog - The datasource catalog is filebased, and obtained from the location specified in the Location of shared

datasources file control. Changes such as new datasources, deleted datasources or edited datasource registrations are lost as soon as this user shuts down DBArtisan.

Changing methods does not delete datasource definitions stored using the current method. When you change methods, DBArtisan does not automatically convert existing catalog definitions to the new method

Default

Windows

Registry

Lets you specify number of datasources to display when you select Recent

Datasources from the File menu.

8

For DBMS that support alias usage, defaults the Connection Information tab to alias usage selection.

Unselected

10 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

Option

Datasource Category

Settings

Description

Lets you select the optional user interface elements that are to be colorcoded or labelled for datasources that have been assigned a category:

Color the status bar using the datasource’s category color

Color the tabs using the datasource’s category color

Include category short name in the datasource toolbar combo

For an introduction to datasource categorization and related tasks, see

Categorizing Datasources using Color-coding and Labeling .

Default

N/A

DBMS_J

AVA

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Java tab. The table below describes the options and functionality on the DBMS_Java tab:

NOTE:

Options differ by platform.

Interface

Element

Option

Load Java files Use the DBMS_JAVA package

Use batch file (oracle_home/bin/ loadJava.bat)

Default Encoding option

Drop Java files Use the DBMS_JAVA package

Use batch file (oracle_home/bin/ dropJava.bat)

Description

Lets you schedule your SQL.

Uses batch file (oracle_home/bin/ loadJava.bat)

Leave blank to use the default.

Lets you schedule your SQL.

Uses batch file (oracle_home/bin/ dropJava.bat)

Default

Selected

Not selected

Default

Selected

Not selected

DDL E

XTRACT

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the DDL Extract tab.The DDL Extraction Tab of the Options Editor lets you specify common and DBMS-specific DDL Extract options.

Common options

The table below describes the options and functionality on the DDL Extract Tab, main view, of the Options Editor:

Option

Extract to multiple windows

Description

Select to extract the schema for each object into separate DDL windows.

NOTE: This option only works when you extract DDL for multiple objects.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 103

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Option

Extract in dependency order

Script Use Statement

Grouping Extracted

DDL

Description

This is the default.

When you select a number of objects as part of an extraction job, this option ensures objects will be extracted in the proper dependency order.

If the option is not selected, errors may result when you execute the script.

It’s also true, however, that loading the dependencies can add significant overhead when you are extracting numerous objects.

This option is for Sybase. Optimizes extraction through generating Use statements in the generated script.

There are two option as to how the DDL is generated for an extract operation:

Group the Drop and Create DDL for each object together - Objects are extracted one at a time. In the DDL generated by the extract, the Drop statement for a selected or referenced object is followed by the Create statement for that object.

Group DDL statements by type - all Drop statements, then all Create statements - In the DDL generated by the extract, Drop statements for all selected or referenced objects are grouped to precede Create statements for those objects. This method ensures that all dependencies are respected.

For more information on DROP options and dependencies, see

DBMS-specific DDL

Extract Options

.

DBMS-specific DDL Extract Options

The DBMS-specific views of the DDL Extract tab let you specify:

• The object types to include DROP statements for

• The default dependent object types for each object type included in extraction/migration operations

You can choose to include DROP statements before you perform ad hoc DDL extractions. You can use this feature to modify and to re-compile database objects. To recompile a database object, drop it before recreating it. This option drops any existing objects of the same name before recreating the object. The data in the existing table is not saved when you specify a

DROP statement for extracted DDL.

CAUTION:

Because dropping an object is a destructive action, you should carefully consider including drop statements before activating this option.

You can also specify dependent object types included in extraction/migration operations. Each

DBMS-specific view of the DDL Extract tab lets you specify the object dependencies for each object type. Dependent object types selected on that view are by default selected when you run an extraction/migration operation and can be overridden using those wizards. For more

information see Extract .

10 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

D

EBUG

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Debug tab. The Debug Tab of the Options Editor lets you set the duration of your debug initialization and debug session, enable or disable DBMS_OUTPUT, and enable the refresh option.

The table below describes the options and functionality on the Debug Tab:

Tab

Profiler

Option

General Dependency Tree

Option

Profiler Time Unit

Save Profiler Reports

Description

Lets you specify pre-fetch levels.

Lets you select a unit of milliseconds, seconds or minutes.

Lets you save profiler reports and type or browse for the report path.

Default

Pre-Fetch All

Dependencie s

Milliseconds

Not Selected

Oracle

DB2

Initialization Timeout

(seconds)

Specifies the point at which the application stops trying to initialize the debugger. If it cannot initialize the debugger in the specified time, it displays message in the Debug Output window.

Specifies the point at which the application terminates your debug session due to idle time.

60

Debug Session Timeout

(seconds)

Enable DBMS Output

7200

Enables the Oracle built-in package, DBMS_OUTPUT, letting you send messages from stored procedures, packages, and triggers.

Selected

Refreshes the dependencies each time you run the debugger. Not selected

Refresh Dependencies for each run

Compile with Debug

Option

Debug Session Timeout

(seconds)

Compile with Debug

Option before Debug

Session

When debugging a procedure against an Oracle datasource,

DBArtisan performs a compilation before debugging. During a compilation, Oracle invalidates referencing objects. For example, if procedures A2 and A3 both reference procedure

A1, debugging procedure A1 in DBArtisan, will result in procedures A2 and A3 being marked as invalidated.

The Compile with Debug Options settings let you control compilation of dependent objects while debugging.

Specifies the point at which the application terminates your debug session due to idle time.

Lets you specify options.

Compile dependent options

300

Prompt

Always

D

IRECTORIES

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Directory tab. DBArtisan lets you configure Directory Options to use default directories when performing certain operations. You can set the default directories for:

• Wizard operations

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 105

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

• Report generation

• Schema extraction

• HTML templates for customizing reports

The table below describes the options and functionality on the Directories Tab:

Option

Wizard

Definitions

Description

Specifies the name and location of the default directory for saving wizard operations. This option applies to wizard operations in which you have the option to save the definition file, such as data unload/load or schema migration operations.

Specifies the name and location of the default directory for the output from generated HTML reports.

Default

C:\Documents and Settings\user

name\Application

Data\Embarcadero\DBArtisan\DefFi les

HTML

Reports

Schema

Extraction

Specifies the name and location of the default directory for placing the output from schema extraction operations.

C:\Documents and Settings\user

namer\Application

Data\Embarcadero\DBArtisan\Repo rt

C:\Documents and Settings\user

name\Application

Data\Embarcadero\DBArtisan\Extra ct

C:\Program

Files\Embarcadero\DBA<version

identifier>\HtmlTpl

HTML

Template

User SQL

Scripts

Job Config

Files

#include

Files

Specifies the name and location of the default directory where DBArtisan can find the HTML template on which to base HTML reports. This feature lets you customize your

HTML reports.

Specifies the name and location of the default directory for

SQL Scripts.

Specifies the location of any ETSQLX job configuration files you have set on your local machine.

Specifies the name and location of the directory searched for files specified by a #include directive in the ISQL editor,

Procedure Object Editor, or Package Body Object Editor if there are no paths specified on the Datasource Properties tab of the Datasource Registration Editor. For more information,

see Registering or Editing a Datasource

.

C:\Documents and Settings\user

name\Application

Data\Embarcadero\DBArtisan\UserS

QLScripts

C:\Documents and

Settings\davidt\My

Documents\Embarcadero\DBArtisan

\Directories\ETSQLXJobCfg

C:\Documents and

Settings\davidt\My

Documents\Embarcadero\DBArtisan

\Directories\IncludeFiles

E

XPLORER

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Explorer tab. The Explorer Tab of the Options Editor lets you configure how objects are organized in the Datasource Explorer.

10 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

The table below describes the options and functionality on the Explorer Tab:

Option

Explorer organization

Sort Type

Show System Objects

and Show Only My

Objects (available if you are organizing the

Datasource Explorer by object type)

Options

Landing Page View

Description

Lets you select a default grouping option of Organize by Object

Owner (groups objects, by object type, for each user) or Organize by

Object Type (groups objects by object type for all users in the same list). Grouping by object owner is most efficient if you are working with databases containing a high number of objects.

You can change the organization manually during a DBArtisan session.

For details, see Basic Viewing Options in the Datasource Explorer .

Lets you select object sorting: Alphanumeric or Lexicographic.

Default

Owner

Lets you select a default Datasource Explorer tree display options for system objects and objects that you own. Available options in the two groups are:

Never - the relevant objects are not displayed by default.

Always - the relevant objects are always displayed by default.

Use datasource filter - The relevant default datasource filter is enabled. For more information, see

Filters Node .

You can change the Show System Objects and Show Only My

Objects settings manually during a DBArtisan session. For details, see

Using the Default Filters .

Lets you enable or disable the following settings:

Refresh after Object Commands - Refreshes the Explorer automatically after an object has been modified or created.

Retain View Setting on Close - Select to retain the current state of the Datasource Explorer so that it opens the same way the next time you start DBArtisan.

Alphanumeric

N/A

N/A

Enables landing page views on a DBMS-by-DBMS basis. Landing pages display informative metadata that gives you a quick overview of your server/database.

Selected

G

ENERAL

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the General tab. The General tab of the Options Editor lets you specify general application options.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 107

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

The table below describes the options and functionality on the General Tab:

Tab

Main tab

Option

Confirm on Exit

Max Editors in a

Single Open

Operation

Max Entries in

Output Window

Description

Instructs DBArtisan to issue a message confirming the operation before exiting the application.

Specifies the maximum number of editors allowable from a single Open operation.

5

Default

Selected

Specifies the maximum number of messages that can appear in the Output Window before the contents are flushed. This option conserves memory resources. You can clear the Output window or raise the maximum number allowed at any time.

1500

The General tab also offers the following DBMS-specific aub-tabs:

Oracle sub-tab

Option

Data Dictionary View

Usage

Preserve Case in Object

Identifiers

Description Default

Lets you synchronize DBArtisan use of the Oracle Data Dictionary DBA and ALL/USER views with the privileges associated with the role used in creating and using the datasource.

Role-based Views - DBArtisan will use views based on the user’s role. That is, users with DBA privileges will use DBA views.

DBA Views - DBArtisan always uses DBA views.

All Views - DBArtisan always uses ALL views.

Use Datasource Configuration for Views - lets you set up Data Dictionary usage on a view-by-view basis when editing or registering a datasource. For more information,

see Datasource Registration .

Preserves case of the database object.

Not selected

Sybase and SQL Server sub-tabs

Option

Rename action

style

Description

Lets you specify whether user-defined objects or datatypes are renamed using an extended ALTER or using the sp_rename procedure.

Default extended alter

G

RID

P

ROPERTIES

(R

ESULTS WINDOW

) O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Grid Properties tab.

10 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

The Grid Properties tab of the Option editor lets you set preferences for the layout and appearance of the grid in an Results window. The table below describes the options and functionality on the Grid Properties tab:

Interface Element Options and descriptions

Titles and Gridlines 3D-Buttons

Enables or disables a 3-D appearance on row and column headings in the grid.

Preview

Default

Set

Horizontal

Gridlines

Vertical Gridlines

Mark Headings

Enables or disables ruling between rows of the grid.

Enables or disables ruling between columns of the grid.

Set

Set

Enables or disables highlighted row and column headings. Set

Displays a preview of the settings currently selected in the TItles and Gridlines group.

ISQL O

PTIONS

The ISQL options are available on the following tabs:

ISQL Options - Main Tab

ISQL Options - Oracle Tab

ISQL Options - DB2 Tab

ISQL Options - Sybase Tab

ISQL Options - SQL Server Tab

ISQL Options - MySQL Tab

ISQL Options - DB2 OS390 Tab

ISQL Options - Editor Tab

ISQL Options - Auto format Tab

ISQL Options - Code Assist Tab

ISQL O

PTIONS

- M

AIN

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the main tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Max Errors Before

Aborting Execution

Sets the maximum number of errors allowed before aborting the execution of a script. A zero indicates that the option is inactive and that you recognize no limit to the number of errors allowed. DBArtisan refers to this value when step executing SQL scripts.

Execute Selected Text

Executes a portion of a selected SQL script.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 109

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Check Syntax When

Executing

Automatically lock connection

Prompt to lock database connection

Tabs

File Association

Query Plan Layout

For DB2, required to execute DB2 call statements in the ISQL Window.

When disabled, a prompt to commit or rollback the transaction is displayed when you close the ISQL editor window. Enabling this options disables the prompts and locks the connection automatically.

Locks the database connection on execution.

Sets the appearance of the ISQL Window tabs to either the top or bottom of the ISQL

Window.

Specifies whether the application should open an unknown file type automatically into an

ISQL Window or prompt you with a message that DBArtisan does not recognize the file type.

Sets the default orientation of a graphical query plan. For more information, see

Query options

.

ISQL O

PTIONS

- O

RACLE

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Oracle tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option

Enable DBMS Output

Auto-Commit changes

Applies auto commit status changes to all open windows.

View xmltype as clob

When enabled, xmltype columns are displayed as CLOBs in the Results grid and the Data editor. Without this option selected, SELECT statements that qualify xmltype columns produce an OciTypeBinder conversion error. With the option selected, the SELECT submitted by DBArtisan is modified to include a getclobval() method call.

Retain connection in pool after use

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

Default Query Plan

Description

Lets you specify Buffer size. 0 is the default.

Load Query Options

Lets you select the default display, tree-based or graphical, when you generate a query

plan. For more information, see Viewing a Tree-based or Graphical Query Plan (Oracle)

.

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

11 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

ISQL O

PTIONS

- DB2 T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the DB2 tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option

Set Isolation Level

Description

Sets the default for the value of the Isolation Level option on the Query Options dialog.

For details, see Query options .

Auto-Commit changes

Applies auto commit status changes to all open windows.

Create Explain plan tables if required

If set to TRUE, Explain Plan tables are created, as necessary. If set to FALSE and you don’t manually create tables, Explain Plan operations will fail.

Create explain plan tables on the

SYSTOOLS schema

If set to TRUE, Explain Plan tables are created on the SYSTOOLS schema. If the tables already exist in the user’s default schema, DBArtisan continues to use those tables. Refer to DB2 documentation for a listing of Explain Plan tables that must be deleted in order to use the SYSTOOLS option. If set to FALSE, Explain Plan tables are created under the user’s default schema.

Retain connection in pool after use

Load Query Options

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

ISQL O

PTIONS

- S

YBASE

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Sybase tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option Description

Auto-Commit changes Applies auto commit status changes to all open windows.

Retain connection in pool after use

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 111

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Option

Load Query Options

Description

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

ISQL O

PTIONS

- SQL S

ERVER

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the SQL Server tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option

Enable Set Query

Options

Description

Sets the default value of the Send Set Options setting on the Query Options dialog. For details, see

Query options

. Changing this value does not affect ISQL sessions currently open.

Auto-Commit changes

Applies auto commit status changes to all open windows.

Retain connection in pool after use

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

Load Query Options

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

ISQL O

PTIONS

- M

Y

SQL T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the MySQL tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option

Retain connection in pool after use

Description

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

11 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

Option

Load Query Options

Description

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

ISQL O

PTIONS

- DB2 OS390 T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the DB2 OS390 tab of the ISQL pane. Use the following table as a guide to modifying settings on this tab:

Option

Retain connection in pool after use

Load Query Options

Description

This option determines what happens to a connection after it is unlocked by the ISQL window. If selected, the connection will be returned to the application connection pool. If unselected, the unlocked connection will be disconnected.

If this option is not enabled, DBArtisan loads a set of default query options that customize your execution environment, and periodically sends those settings to the server. Enabling this option and specifying an XML file, forces DBArtisan to load a previously saved query options file each time an ISQL windows opens against this DBMS platform. This lets you override DBArtisan’s default query options.

You can also enable this option when saving a query options file. For information on other load and save options, specific query options offered, manually updating query

options, and conditions for which query options are sent to the server, see Query options

.

ISQL O

PTIONS

- E

DITOR

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Editor tab of the ISQL pane. The table below describes the options and functionality on the Editor Tab:

Group

Window

Option

Show Toolbar and Show

Status Bar

Maximize on new or open

Description

Enables/disables these ISQL Window user interface elements.

Default

Selected

Indicates that DBArtisan should maximize the ISQL Editor. If you already have an active MDI Window that is maximized, the default behavior is to maximize a new child window. To deactivate this option, ensure you do not have any active MDI Windows, such as the

Explorer.

Selected

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 113

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Group

Command

History

Option

File Tracking

Auto-Reload

File

Description

Indicates that the ISQL Editor should use the File Tracking Facility to monitor the status of a file. If a file has been modified and saved outside the application, the application loads the most current version of the file into the IISQL Editor based on the options set for

Auto-Reload File (see above.)

If File Tracking is enabled, indicates that the application should automatically reload a file that has been externally modified without prompting you. If you turn this option off, DBArtisan prompts you before reloading your file if external changes have been saved.

Default

Selected

Not selected

Auto-Save File

Indicates that files in the ISQL Editor should automatically be saved at the indicated time interval. Backup files are saved to

C:\Documents and Settings\username\Application

Data\Embarcadero\DBArtisan\Backup\.

Backup files use a naming convention of the form ~ETxxxx.tmp., See the registry under

HKEY_CURRENT_USER\Software\Embarcadero\DBArtisan\versio

n\Backup for a listing of backup file names and the path of the file to which they correspond.

Save File

Before

Overwriting

Specifies the action you want the application to take when selecting a command from the Command History box. You have the option to be reminded to save a file before overwriting (Ask First), to automatically save a file before overwriting (Always), or to automatically overwrite the file with the command (Never).

Selected

(5 minutes)

Ask First

15

Save Most

Recent

Specifies the number of commands you want to save in the

Command History list in the top of the ISQL Window toolbar. The maximum value is 99.

Lets you select common printer options.

Printing

Appearance Enable Syntax

Highlighting

Sets syntax highlighting on so that all keywords and comments are colored for easier reading and debugging.

Places line numbers in the left column of an ISQL Window.

Show Line

Numbers

Enable

Outlining

Enables and disables outlining.

Selected

Selected

Selected

Formatting

Clipboard

Line Endings

Enable Text

Wrapping

Editor Font Sets the font face, style, and size displayed in the editor.

Syntax Colors

Sets syntax coloring for keywords, comments, quotes, and default text for various file types and scripts from the Syntax Coloring dialog box.

Auto Indent

Enables and disables a typical text wrap feature.

Selected

Available

Available

Selected Sets automatic indentation for each carriage return, new line in your

SQL script.

Sets tabs as the specified number of spaces in result sets. Expand Tabs and Tab Size

None

When copying text from the editor, no substitution is made for endof-line characters. This provides the fastest cut and paste operation.

Selected

(4)

Selected

11 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Group

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

Option

Line Endings

Description

When copying text from the editor, end-of-line characters are replaced with platform-specific equivalents (Windows - CR LF, UNIX -

LF, Macintosh - CR). This lets you copy text into environments such as

Notepad, that require platform-specific end-of-line characters.

This option avoids unnecessary characters and incorrect display, but cut-and-paste operations take more time to complete.

Default

ISQL O

PTIONS

- A

UTO FORMAT

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Auto Format tab. of the ISQL pane.

The Auto Format tab lets you specify the style and spacing of SQL statements in an ISQL window when you choose to auto format SQL in the ISQL editor.

On opening, the Preview area shows an SQL statement formatted according to the current Auto

Format settings. Click Edit to open the Auto Format Options dialog. Use the following table as a guide to understanding and modifying the settings in this dialog:

Setting

Keywords

Description

Lets you select a character case (UPPERCASE, LOWERCASE, INITIALCAPS, or NOCHANGE) formatting treatment for SQL keywords.

Right Margin

New line before keyword

Specifies the maximum number of characters per line.

If enabled, a new line is forced before every SQL keyword. If disabled, lines are only forced for statement type and clause type keywords.

BEGIN..END block

If enabled, empty BEGIN..END blocks occupy a single line.

Stack lists

List indent size

If enabled, a new line and indenting is forced for each item in comma-separated list such as argument lists.

If Stack lists is enabled, this control lets you specify the number of spaces each list item will be indented from the current offset.

Parenthesis indent size

Conditions format style

Lets you specify the number of indenting spaces for forced lines following an open parenthesis.

Specifies how conditions in clauses are formatted:

CONDITIONS_WRAPPED - lines are not forced before conditions.

CONDITIONS_STACKED_WITH_LEADING_OPERATORS - a new line is forced for each condition in a clause, with logical operators, if present for a line, displayed at the start of the line.

CONDITIONS_STACKED_WITH_TRAILING_OPERATORS - a new line is forced for each condition in a clause, with logical operators, if present for a line, displayed at the end of the line.

Conditions stack threshold

For Conditions format style selections that specify stacking, this value specifies the minimum number of conditions that must appear in a clause before conditions are stacked.

THEN statements

If enabled, simple THEN clauses are kept to a single line.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 115

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

ISQL O

PTIONS

- C

ODE

A

SSIST

T

AB

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the ISQL - Code Assist tab. This tab lets you activate and select options for three coding assistance and error-detection features available from the ISQL editor:

Code Complete - lets you insert or replace object names, selected from suggestion lists, as

you edit a script. For more information, see Code Complete

.

Semantic validation - detects object name references to objects not present in the datasource index. For more information, see

Semantic Validation

.

Real-time syntax checking - on-the-fly syntax checking is performed as you type. For more information, see

Syntax Checking

.

The ISQL - Code Assist tab has the following settings:

Group/Option

Code Complete

Code Validation

Enable Code Complete

Description

Lets you enable or disable the Code Complete feature.

When disabled, Code Complete cannot be invoked automatically or manually.

Because of the overhead in maintaining internal resources used in implementing this feature, a slight performance increase can result from disabling the feature.

Enable auto-activation and

Auto-activation delay

Insert single proposals automatically

Fully qualify completions automatically

Enable Real-time syntax checking

Severity levels for semantic validation problems

Perform syntax and semantic validation on files smaller than

When auto-activation is disabled, the Code Complete feature must be invoked manually. When auto-activation is enabled, the Code Complete feature is invoked automatically each time the interval between keystrokes exceeds the specified Auto-activation delay.

Specifies that if a Code Complete suggestion list would contain only a single suggestion, that suggestion is inserted automatically.

Specifies that Code Complete results are returned fully qualified, rather than the minimum required to identify the object.

If enabled, syntax-checking is performed as you type. If disabled, syntax checks must be initiated manually.

Lets you select the severity level (ERROR, WARNING, or

IGNORE) associated with detected semantic errors. The

WARNING option provides a contrast to syntax errors, which are always flagged with a severity level of ERROR.The

IGNORE setting disables the feature. For more information,

see Semantic Validation ..

Places an upper limit on the size of files for which automatic syntax checking and semantic validation are active.

11 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

Group/Option

Code Assist

Resources

Restore defaults

Refresh

Description

Each time you open an ISQL editor window, DBArtisan obtains schema information for the object types supported for the Code Complete and Semantic Validation features.

That information is updated with any modifications that you make and persists until the window is closed. The Refresh button ensures that the information is current in case other users or applications are modifying the schema while the current SQL editor session window is open.

Restores all settings on the tab to the original defaults.

J

AVA

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Java tab.

DBArtisan requires a JDBC connection. You have the ability, with this panel of the Options

Editor, to set or change options that apply to the Java virtual machine (JVM) that is running on the client. The table below describes the options and functionality of the Java tab:

Option

Initial Heap Size

JVM Options:

Set the size, in MB, for the repository where live and dead objects comingle with free memory. If memory runs out, JVM executions stop so the garbage can be collected and expunged. Each platform responds differently, so trial and error can help you maximize performance.

Maximum Heap Size

Set the upper limit for your heap size.

Maximum Perm Gen

Set the upper limit for the permanent generation size.

Additional Options

Description

Add options here ONLY in consultation with Embarcadero Technical Support.

Default

64 MB

64 MB

Versionspecific

N/A

L

OGGING

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Logging tab. The Logging tab lets you set defaults that specify the behavior and placement of SQL Logging and Output Logging.

The table below describes the options and functionality on the Logging Tab:

Option Description

Log all SQL

Statements to a File

Indicates that the application should log all of the SQL that it executes to a file. SQL logging provides an audit trail for DBArtisan. You can examine this log to determine the

SQL executed to complete a task.

Logfile Path

If you choose to log the SQL generated by the application, specify the drive, directory, and file name.

Default

Not selected

None

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 117

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Option Description

Max File Size

Specifies the maximum size for the logfile. When the logfile reaches this threshold, it automatically starts deleting lines in the logfile (starting with the oldest statements) to remain within the specified size limit.

Truncate

Empties the entire contents of the logfile.

Default

1024 KB

Log all

Output

Messages to a File

Indicates that the application should log all server messages sent to the Output window.

This type of logging lets you monitor only messages issued by the server versus all SQL logged by the application. You can examine this log to determine all messages the server issued.

Logfile Path

If you choose to log the server messages generated in the Output window, specify the drive, directory, and file name.

Max File Size

Specifies the maximum size for the output logfile. When the output logfile reaches this threshold, it automatically starts deleting lines in the file (starting with the oldest statements) to remain within the specified size limit.

Truncate

Empties the entire contents of the output logfile.

Not available

Not selected

None

1024 KB

Not available

M

IGRATION

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Migration tab. The Migration tab sets the default values effective when you open the Migration Wizard, a utility that lets you migrate schema and data. For

information on this utility, see Using the Schema Migration Wizard

.

M

Y

SQL U

TILITIES

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the MySQL Utilities tab. DBArtisan integrates with MySQL utilities.

For DBArtisan to access these utilities, you need to specify their location in the MySQL Utilities

Tab of the Options Editor. You can use the MySQL Dump and Import Utilities. The table below describes the options and functionality on the MySQL Utilities Tab

Option mysqldump mysqlimport

Description

Specifies a path for the MySQL dump utility, mysqldump.exe. By default, MySQL installs this utility in the C:\mysql\bin directory.

Specifies a path for the MySQL import utility, mysqlimport.exe. By default, MySQL installs this utility in the C:\mysql\bin directory.

O

RACLE

U

TILITIES

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Oracle Utilities tab.

11 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

DBArtisan integrates with multiple Oracle utilities. For DBArtisan to access these utilities, you need to specify their location in the Oracle Utilities Tab of the Options Editor. You can use the

Oracle Export, Import Utilities, and SQL * Loader. The table below describes the options and functionality on the Oracle Utilities Tab:

Option

Export

Import

SQL*Loader

Description

Specifies a path for the Oracle Export utility. By default, Oracle installs to C:\Orant\Bin directory.

Specifies a path for the Oracle Import utility. By default, Oracle installs to C:\Orant\Bin directory.

Specifies a path for the SQL * Loader utility. By default, Oracle installs to C:\Orant\Bin directory.

Default Bind Size Specifies the bind size. Default is set to 70KB.

P

ERF

C

ENTER

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Performance Center tab. DBArtisan lets you customize

Performance Center’s integration with DBArtisan. The table below describes the options and functionality on the Perf Center Tab:

Option

Computer Name or IP Address

Port Number

Test

Connect to the server using

Description Default

Specify where the Performance Center Server is installed. localhost

Specify the port for the Apache server or IIS web server.

80

Verifies the settings.

Specify if you want DBArtisan to open the Web Client or the Performance Center file (PerfCntr.exe) within

DBArtisan.

Web

Client

Q

UERY

B

UILDER

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Query Builder tab. Option parameters set on the Options Editor elicit a prompt if there are different options set on an open individual session. Global options override properties set within individual Query Builder sessions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 119

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

The table below describes the options and functionality on the Query Builder Tab:

Interface

Element

Code

Generation

Execution

General

Auto Join

Option Description Default

Generate Use Database statement

Adds a line of SQL code indicating which database or instance is used in the statement.

Generate owner names

Adds a line of SQL code showing the table owner name as part of the query.

Include Row Count limits

Generate SQL/92 if supported by DBMS

Includes the output row limit set in the Execution settings.

SQL/92 is a standard for relational database management systems.

To set the maximum number of rows in your result set, type the number in the dialog box. This lessens congestion of server processes when queries execute by setting row count limits.

Selected

Selected

Not selected

Not selected

1000 rows

Not selected

Selected

Show Column Data types in Query Diagram

Reveals the data type in each column for tables in the

SQL Diagram pane.

Confirm on Item delete

Opens a Confirm Delete dialog box when an item is deleted.

Auto Populate Views

Checks syntax every time an execute statement, refresh or copy statement begins.

Auto Format

Run Automatically

Automatically sets style and spacing of display.

Automatically detects names and data types, and create joins for multiple tables.

Require Indexes

Joins only indexed columns. Requires an indexed column for joins.

Require same data type Automatically joins columns with the same data type.

Not

Selected

Selected

Selected

Selected

Selected

Selected

Syntax Checker Automatic Syntax

Check

Display

Automatically checks SELECT and CREATE VIEW statements for errors.

Warn on non index join

Returns a warning when it detects a join against a nonindexed column, or a column not participating in a primary key

Lets you sets the style, size, and color of Column Font and Title Font. Also lets you set the background Table Color for the SQL Diagram Pane.

Not selected

Available

R

EPORTS

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Reports tab. The Reports tab lets you:

• Append a date and timestamp to report file names. This prevents existing reports from being overwritten.

• Save reports in date-specific folders.

• Save reports in PDF format as opposed to HTML.

12 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

• Let you include a provided image and title to reports.

R

ESULTS

(ISQL) O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Results tab. The table below describes the options and functionality on the Results Tab:

Interface Element

Results Option pane

Format pane

Options and descriptions

Result Window Single Window - Displays all results in one tabbed result window. Multiple result sets together in the window. Single Window and Multiple Windows options are mutually exclusive.

Multiple Windows - Displays multiple result sets one result set per window.

Attached to Editor - Sets results as tabbed windows attached to the ISQL window. Used in conjunction with Single Window option or Multiple

Window option. Attached and Unattached options are mutually exclusive.

Unattached - Sets results appear separate from the ISQL Window. Used in conjunction with Single Window option or Multiple Windows option.

Reuse Window - Sets new result sets to overwrite any current result sets in an open Result Window. Only valid for Single and Attached to Editor combination.

Results File

Result Set

Options

Mail File Type - Selects the file type to use when sending result sets via a

MAPI-compliant mail package. Valid formats include the proprietary Results type, Tab delimited, Comma separated, and HTML.

Schedule File Type - Selects the schedule file type. Valid formats include

Tab delimited, Comma separated, and HTML.

Include column titles when saving - Includes column titles when saving a result set. If this option is turned off, column titles DBArtisan does not save result sets.

Default Rowcount - Lets you limit the number of rows returned to the result window of the ISQL window (default 0).

Sybase and SQL Server: Text Size (bytes) - Lets you specify the text size

(default 8192).

Oracle:LONG Size (bytes) - Lets you specify the LONG size (default 8192).

LOB Preview: Text Size (bytes) - Specifies the length of the preview of

LOB column data (default 4096).

Sort Type

Column

Formatting

Lets you select a result sorting: Alphameric or Lexicographic.

Auto Format (Best Fit) - Sets column widths automatically to accommodate the longest piece of data in a column. Large queries depend on the longest row formatting, so activating this option can affect performance.

Use pre-defined column - Lets you select column type and character length

Enable Date/

Time Format

Lets you select the date/time format.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 121

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Interface Element Options and descriptions

Format

Standard Grid - Displays all result sets in a standard grid format. DBArtisan displays result sets in grid format in IISQL Editors that are opened after you have selected this option. DBArtisan does not display IISQL Editors that are already open.

HTML - Displays all result sets as HTML tables. DBArtisan displays result sets in HTML format in ISQL Editors that are opened after you have selected this option. DBArtisan does not display ISQL Editors that are already open.

ASCII Text - Displays all result sets as ASCII Text. DBArtisan displays result sets in ASCII Text format in ISQL Editors that are opened after you have selected this option. DBArtisan does not display ISQL Editors that are already open.

Grid Font and Printer Font buttons - Open a Font dialog box, letting you select the font, style, and size for the result sets grid or printed result sets.

Enable Locale - If selected, numbers are formatted (thousands separator, decimal separator) as locale-specific strings. If unselected, numbers are formatted according to the C locale.

SMTP M

AIL

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the SMTP Mail tab. The SMTP Mail Tab of the Options Editor lets you specify outgoing notification e-mail message options.

The table below describes the options and functionality on the SMTP Mail tab:

Option

Send messages through

SMTP

Name

E-mail Address

Authentication

User Name

Password

Host Name

Port Number

Test

Bind to

Description

Enables SMTP messaging and makes the other controls on this tab available.

Name that appear as the e-mail sender.

Default

Unselected

Address to send e-mails from DBArtisan.

Lets you specify authentication options.

User name for authentication.

Password for authentication.

SMTP server for outgoing messages. For Microsoft

Outlook, select Tools, and then Accounts. On the Mail

Tab, select target account, and then click Properties. On

Servers Tab, copy the Outgoing Mail(SMPT) and paste.

Port number you connect to on your outgoing SMTP server.

Opens an SMTP Configuration Test e-mail addressed to your e-mail address. Click Send Mail to send the e-mail.

Your IP address the message is bound to.

Name you specified during installation.

E-mail address you specified during installation.

None

Not available

Not available

Host Name you specified during installation.

25

Available

ANY_IP_ADDRESS

12 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P E C I F Y I N G D B A R TI S A N AP P L IC AT I O N AN D F E AT U RE O P T IO N S

Option

Encoding

Description

E-mail encoding.

Send messages Mime encoded

Messages encoded using Multipurpose Internet Mail

Extensions (MIME) support enriched content and attachments.

Send all messages as HTML

Messages include text formatting.

Auto Connect to the

Internet

DBArtisan connects to internet at launch.

Default

Western Europe (ISO)

Selected

Selected

Selected

S

PACE

A

NALYST

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Space Analyst tab. The table below describes the options and functionality on the Space Analyst Tab:

Tab

Oracle

Option

Exclude objects owned by SYS in

Reorganization Wizard.

Description

The Space Analyst Reorganization

Wizard excludes SYS objects.

Auto populate Table Reorganization

Details Grid

Space Analyst auto-populates table reorganization details.

Auto populate Index Reorganization

Details Grid

Space Analyst auto-populates index reorganization details.

SQL Server,

Sybase, and

IBM DB2 for

Windows, Unix, and Linux

Populate Index Reorganization

Details Grid with Deleted Leaf

Statistics

Space Analyst gathers deleted leaf row statistics for an index and displays details.

Offers the option to update the Table Details Grid and Index Details Grid.

Default

Selected

Not Selected

Not Selected

Not Selected

Not Selected

W

ARNINGS

O

PTIONS

After opening the Options editor (see

Specifying DBArtisan application and feature options

), you can make changes to the Warnings tab. DBArtisan lets you issue warning messages to users whenever improper operations are attempted in a database. Warning messages differ by platform.

The tables below describes the options of the Warnings Tab:

Option

Create an index on the same tablespace as the associated table

Description Platform

Issues a warning message whenever a user does not create an index on a different tablespace than the table. This makes it possible for the server to read the index and table data in parallel.

DB2

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 123

SP EC IF YI N G D B AR T IS AN AP P L I C AT I ON AN D FE AT U RE OP T IO N S

Option

Create an index on the same tablespace as the associated table

Create an object in the

SYSTEM tablespace

Create a user with default or temp tablespace as the

SYSTEM tablespace

Create an object in the master database

Description

Issues a warning message whenever a user does not create an index on a different tablespace than the table. This makes it possible for the server to read the index and table data in parallel.

Platform

Oracle

Issues a warning message whenever a user tries to create or place an object on the SYSTEM tablespace.

Issues a warning message when a user is created with a default or temp tablespace on the SYSTEM tablespace.

Oracle

Oracle

Create a table or index on the default segment

Create a non-clustered index on same segment as the associated table

Issues a warning message when an object is created in the master database.

Microsoft SQL

Server and

Sybase ASE

Issues a warning message when a table or index is created on the default segment.

Issues a warning message when a non-clustered index is created on the same segment as the associated table.

Microsoft SQL

Server and

Sybase ASE

Microsoft SQL

Server and

Sybase ASE

12 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A T AS O U RC E M A N AG E M E N T > R E G I S T E RIN G O R E D I T I N G A D AT A S O U RC E

D

ATASOURCE

M

ANAGEMENT

After installing DBArtisan, you must set up datasources to establish reusable connections to your database servers. A datasource is a database connection profile that is similar to the connection information that you have stored in your SQL.INI or WIN.INI files. DBArtisan stores information about the datasource specification in the system registry and provides a visual interface for maintaining it.

This section describes the function of datasources, the process of establishing datasource connections and managing your datasources and datasource groups.

R

EGISTERING OR

E

DITING A

D

ATASOURCE

A datasource is the connection profile that lets you have access to a database, and, therefore, to your data. So, when you register a datasource, you’re telling DBArtisan how to get at the database(s) you want to operate on. In fact, all database activities are performed through datasources, so you need a datasource profile for each database instance (or database server) in your enterprise. Each connection profile (i.e., datasource) includes a unique name, the connection string, the default user ID, and optionally, a password.

D

ATASOURCE

R

EGISTRATION

Each database instance must be registered. Whether you are registering a new datasource, registering a new datasource based on an existing datasource definition, or editing preexisting connection information, you use the Datasource Registration dialog box.

To register a new datasource

• From the Datasource menu, select Register Datasource.

To register a new datasource based on an existing definition

• In the left pane of the explorer, select the existing datasource and then from the Datasource menu, select Register Like.

To edit registration information

• On the Explorer, right-click a datasource, and select Edit from the context menu.

The table below describes the fields and controls you will encounter when creating or editing a datasource registration:

Panel/Tab Option Description

Database Type

Select the radio box corresponding to the DBMS type for the datasource. If there is currently a

DBMS node selected in the Explorer, that database type is automatically selected.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 125

R E G I S T E RI N G O R E D I T I N G A D AT A S O U RC E > R E G I S TE RI N G O R E D I T I N G A D A TA S O U RC E

Panel/Tab

Connection

Information

Security

Parameters

Datasource

Properties

Option Description

For detailed descriptions of the options on this tab, see Datasource Connection Information

.

User ID The User ID that DBArtisan will use to connect to the datasource.

Password

Connect As: (Oracle)

Domain: (SQL Server)

Auto connect?

The password associated with the User ID.

When relevant, choose the appropriate user/administrator level

(NORMAL, SYSASM, SYSDBA, or SYSOPER).

For MS SQL only. Identify the domain if the user has restricted access.

Spares the user from reentering the password every time you connect.

Login to the server is verified using Windows/OS authentication Connect using Windows

Authentication or Connect using OS Authentication (IBM

DB2 for Windows, Unix, and

Linux, MySQL, Oracle, SQL

Server)

Connect using Kerberos

Authentication (Sybase)

If this option is selected, login to the server is verified using

Kerberos authentication.

NOTE: This is only available of the Use alias information in the

SQL.INI file/Sybase Server option on the Connection Information tab is selected. For details, see

Datasource Connection

Information

.

Test Connection If the connection fails, read the error message and backtrack as necessary.

#Include Search Directories Enter one or more paths on this datasource, which will be searched for files in conjunction with use of the #include directive in the ISQL editor, Procedure Object Editor, or Package Body

Object Editor. Separate multiple paths using semicolons. For example: c:\myscripts;c:\Program Files\Scripts

For more information on use of the #include directive, see SQL

Preprocessing: #define and #include

.

Note that if there are no entries specified here, the directory specified on the Directories tab of the Options editor will be searched. For more information, see

Directories Options .

Database device default path

(Sybase)

The database device default path is used when creating a new database device.

12 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

R E G I S T E RI N G O R E D I TI N G A D A T A S O URC E > R E G I S T E RIN G O R E D I T I N G A D AT A S O U RC E

Panel/Tab

Oracle View

Config (Oracle only)

Datasource

Group

Option Description

Lets you manually configure DBArtisan access to Oracle Data Dictionary DBA or ALL/USER views to conform to the view privileges associated with a specific role.

NOTE: In order to enable manual configuration of Oracle Data Dictionary views for Oracle datasources and make this panel available, you must select Use Datasource Configuration for

Views in the Options Editor (File > Options > General > Oracle). For more information, see

General Options .

Only DBA views with an ALL/USER equivalent are offered on this panel. You can use the following methods to select DBA or ALL/USER type views on a view-by-view basis:

Manual selection using the

Use DBA View check boxes

Selecting the Use DBA View check box associated with an individual view makes the DBA group version of that view available to DBArtisan. Deselecting the Use DBA View check box associated with an individual view makes the ALL/USER group version of that view available to DBArtisan.

Reset to All

Reset to DBA

Deselects all Use DBA View check boxes, making only ALL views accessible to DBArtisan.

Selects all Use DBA View check boxes, making DBA views accessible to DBArtisan.

Resolve Automatically (only available when editing a connected datasource)

Queries the datasource and selects the Use DBA View check box for each DBA view to which the current user has access.

Changes take effect as soon as you click the Finish button.

Select the folder that is to contain this datasource.

Select the datasource group folder

Select a category If you want to use category-based user interface item color-coding and labeling for this datasource, this dropdown lets you select an existing category to assign this datasource to that category. You can also select Customize to manage your categories. For details,

see Customizing Datasource Categories .

For an introduction to datasource categorization and related tasks, see

Categorizing Datasources using Color-coding and

Labeling .

After clicking Finish, you are prompted to connect to the newly registered datasource.

NOTE:

On initial connection to a Sybase Cluster edition datasource, you are offered the choice to connect to the entire cluster. If you select NO, your connection scope is an instance.

This choice sets the default connection scope for this datasource. You can subsequently change the connection scope for the datasource by editing the datasource.

If you have completed the datasource registration and still encounter problems, please refer to

the Unable To Connect?

discussion.

NOTE:

After you successfully connect to a datasource, you can see the name of the host and the connection string information displayed at the bottom of the DBArtisan window.

For Oracle and Sybase ASE, should a question arise, you can see if perhaps you set up the datasource NOT to use the alias file. You can also use these cues to remind yourself that if you changed the alias file, that change will not be reflected here unless you very specifically made a change to the defaults in the Options Editor-Java tab.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 127

R E G I S T E RI N G O R E D I T I N G A D AT A S O U RC E > R E G I S TE RI N G O R E D I T I N G A D A TA S O U RC E

D

ATASOURCE

C

ONNECTION

I

NFORMATION

The following topics lists the Connection Information tab options, DBMS-by-DBMS, available when registering or editing a datasource.

IBM DB2 Connection Information

Option

Server

Schema ID

Function Path

Datasource Name

Description

The name of the server.

This is an optional field. If you want to include the current schema as part of the datasource connection properties, you can set the implicit schema for unqualified object references to a schema different from the user’s login id.

This is an optional field. If you choose, you can enter the appropriate function path name so the search scope of functions will not be limited to the IBM DB2 library.

This field is automatically populated with the server name, but you can rename it to whatever you want.

SQL Server Connection Information

Option

Use Network Library

Configuration

Alias

Protocol: TCP/IP or

Named Pipes

Host

Port (optional)/Pipe

Name

Default DB (optional)

Datasource Name

Description

When you select this, you can connect to a Net-Library that is listening on the server that is configured to either the Named Pipes or TCP/IP protocols.

This box is enabled only when you opt to use the Network Library Configuration

You need to select one or the other to register a SQL Server database.

Enabled only when you have not selected an Alias from the Network Library.

Depending on your section, you can optionally indicate the port for TCP/IP or the pipe name depending on your means of connection.

Optionally give the default name for the database.

The field is automatically populated with the host name, but you can rename to whatever you want.

MySQL Connection Information

Option

Server

Port (optional)

Default Database

Datasource Name

Description

Enter the name of the host, for example doctest01.

The default port is 3306. You do not need to enter this information.

You must enter the name of the default database.

This field is automatically populated with the server name, but you can rename it to whatever you want.

12 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

R E G I S T E RI N G O R E D I TI N G A D A T A S O URC E > R E G I S T E RIN G O R E D I T I N G A D AT A S O U RC E

Oracle Connection Information

Option

Use TNS Names Alias/

Oracle Alias

Host

Port

SID/Service Name /

Type: SERVICE_NAME or SID

Instance Name

Datasource Name

Description

If this option is checked, look for the Alias you want to register from the drop-down list.

The remaining fields will automatically populate. If it is unchecked, you must manually enter the requisite information.

Manually enter the name of the host machine.

The default is 1521, but you can change it to wherever the Oracle listener is set up.

Enter the SID or Service Name to correspond with the option you select.

The specific name used to identify the Oracle instance (the SGA and the Oracle processes).

The field is automatically populated with the host name, but you can change it.

NOTE:

Y ou can register an Oracle ASM instance directly using the Datasource Registration Wizard. No

Datasource Explorer tree is available when connecting to the ASM instance. The ISQL Editor is available with this type of connection.

Sybase Connection Information

Option

Use alias information in the SQL.INI file/Sybase

Server

Use SSL encryption

Host

Port

Default DB (optional)

Datasource

Description

If this option is selected, choose a name from the drop-down list in the Sybase Server field.

If this option is selected, the JDBC connection will be established using SSL encryption

If you selected the Alias option, this field automatically populates. Otherwise, you need to manually enter the name of the host.

There is no default for this optional field.

Optionally give the default name for the database.

Connection scope

(Cluster Edition only)

This field automatically populates with the server name. You can change it to whatever you want.

Lets you specify a connection to the entire cluster or to a single instance.

For context information, see Registering or Editing a Datasource .

C

USTOMIZING

D

ATASOURCE

C

ATEGORIES

DBArtisan lets you customize your datasource category scheme. A datasource category has the following configurable components:

• Category name - The name displayed as a selection in the Select a category dropdown

• Short Name - The abbreviation shown in the Datasource toolbar dropdown when a categorized datasource is selected.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 129

R E G I S T E RI N G O R E D I T I N G A D AT A S O U RC E > R E G I S TE RI N G O R E D I T I N G A D A TA S O U RC E

• Color - The color used to denote a categorized datasource in Datasource Explorer tree icons and window tabs.

NOTE:

Display of specific user items used to denote categories is configurable. For more

information, see Datasource Options

.

To customize your datasource categories

1 On the Datasource menu select Register Datasource and then select the Datasource Group panel.

2 From the Select a category dropdown select Customize. The Manage Datasource

Categories dialogs opens.

3 Take one of the following actions:

• Create a new category by clicking New and selecting or providing a name, short name and color combination.

• Edit an existing category by selecting the category, clicking Edit and modifying the name and color combination.

NOTE:

The short name for a category cannot be edited.

• Delete an existing category by selecting the category, clicking Delete and verifying the deletion at the prompt.

13 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DA TA SO URC ES > DA TA SOU RCE S

U

NABLE

T

O

C

ONNECT

?

If you are having trouble connecting to a datasource, as a first step please check the connection information to make sure it has been captured correctly.

1 Verify that the user/password combination is correct.

2 Check that the correct JDBC Driver is being called. You can see all platform-specific drivers when you browse from the Advanced Settings panel of the registration wizard. You can see

ALL drivers by going to the \Java\drivers\ subfolder of the main DBArtisan installation folder.

A list of supported drivers follows.

Drivers supported by DBArtisan:

Oracle:

JDBC OCI client-side driver--Type 2, Versions 8, 9, and 10. This is shipped by Oracle.

Oracle 9.0.2 Thin Driver--Type 4, shipped with DBArtisan.

Sybase: jConnect v5.5--Type 4, shipped with DBArtisan.

Microsoft SQL Server: jTDS Driver--Type 4, shipped with DBArtisan.

NOTE:

This is the only driver for MS SQL Server that we support.

IBM DB2--Type 2 driver comes from IBM.

MySQL:

MySQL driver--shipped with DBArtisan.

3 Verify that the connection URL is correct. The URL always begins with JDBC and includes a permutation of the driver.

D

ATASOURCES

A datasource is a database connection profile. A datasource includes:

• Name

• Connection String

• Default User ID

• Optional Password Specification

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 131

U N D E R S T AN D I N G T H E D AT A S O U RC E C AT A L O G > U N D E R S T A N D IN G T HE D A T AS O U RC E C A T AL O G

All database operations are performed through datasources. You can create a datasource profile for each database instance (or database server) in your enterprise, and you can create multiple datasource profiles with different logins for a single database. The table below describes the data items stored for each datasource:

Data Item

Name

Connection String

Default User

Default Password

Auto-Connect Flag

Default Database

Description

A unique, user-defined name for the datasource.

For Oracle: the SQL*Net connect string, for Sybase ASE: the database server name.

Default user ID to use when logging in to the datasource. Can be null.

Default password to use when logging in to the datasource. This is encrypted. Can be null.

If Yes, then automatically login using default user and password. If No, open Login dialog box.

SYBASE ASE ONLY: Database to automatically use after logging in.

U

NDERSTANDING THE

D

ATASOURCE

C

ATALOG

A Datasource Catalog is a collection of defined datasources. On startup, DBArtisan loads a

Datasource Catalog using one of three methods, specified using the Options editor:

• Windows Registry datasource catalog -

T he datasource catalog is stored and managed locally, in the Windows registry. This user can add and delete datasources and edit the registration details of existing resources. Any changes are retained across startups of

DBArtisan.

This method is compatible with other Embarcadero products using registry-based datasource definition storage. If more than one of those products is installed on the same machine, they can share the same Datasource Catalog.

• File based datasource catalog - The datasource catalog is stored locally and is file-based.

Each datasource definition included in the catalog is stored in a single file (

.dsd

file suffix) in the %APPDATA%\Embarcadero\Data Sources\ folder, in a default installation. This user can add and delete datasources and edit the registration details of existing resources. Any changes are retained across startups of DBArtisan.

This method is compatible with other Embarcadero products using file-based datasource definition storage. If more than one of those products is installed on the same machine with

DBArtisan, all can share the same Datasource Catalog.

13 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U N D E R S T A N D I N G T H E D A TA S O U RC E C A TA L O G > U N D E R S TA N D IN G T H E D A T A S O URC E C A T A L O G

• Network shared datasource catalog - The datasource catalog is file-based, and obtained from a user-specified location such as a network share. At each startup, DBArtisan imports definitions from the network shared file (.etsds file suffix).

Changes such as new datasources, deleted datasources or edited datasource registrations are lost as soon as this user shuts down DBArtisan. This method allows centralized maintenance of the Datasource Catalog and sharing of a single catalog among multiple users across a network.

NOTE:

The definition files used in both the File based datasource catalog and Network shared datasource catalog methods do not store user ID and password credentials.

Credentials, links to definition files in the current user’s catalog, and folder structure are stored in the %APPDATA%\Embarcadero\Data Sources\metadata\dsuri.xml file.

For information on choosing a method and specifying the network location of a Shared

Datasource Management definition file, see

Datasource Options .

Regardless of the catalog storage method, the Datasource Catalog can be built manually by explicitly registering datasources or using automated methods such as the Discover Datasources

feature. For details, see Automatically Discovering Datasources

and

Registering or Editing a

Datasource

. Keep in mind that changes made with Network shared datasource catalog in effect, are lost on shutdown of DBArtisan.

In order to set up a Network shared datasource catalog scheme, you can build a catalog first using the File based datasource catalog or Windows Registry datasource catalog method. You can subsequently use the Manage Datasources facility to export your Network shared datasource catalog file to the location that others will use to load the file. For details, see

Importing and Exporting Datasource Definitions

.

More generally, the Manage Datasources facility’s import/export functions can be used to exchange datasource definitions between users employing the different storage methods. Even more simply, these functions save time in allowing datasource definitions to be defined once and then shared with multiple users.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 133

A UT O M AT I C A L LY D IS C OV E RI N G D A T A SO URC E S > A U TO M A TI C A L L Y D I SC O VE RIN G D A TA S OU RC E S

A

UTOMATICALLY

D

ISCOVERING

D

ATASOURCES

The first time you run DBArtisan a dialog box displays, giving you the option to Auto-Discover all configured datasources. If you click Yes, the DBArtisan Auto-Discover feature searches the

DBMS configuration files on your computer and automatically discovers all the datasources that you are licensed for. For example, if you have a cross-platform license, Discover Datasources finds all unregistered datasources. If you have an Oracle only license, Discover Datasources finds all unregistered Oracle datasources.

NOTE:

Microsoft SQL Server datasources are registered through a Windows system call to your network. Provide login information (user name and password) the first time you connect to a datasource. For more information, see

Connecting to a Datasource

.

NOTE:

IBM DB2 for Linux, Unix, and Windows databases use ODBC/CLI or DB2 (attach) to connect. Therefore, you need the proper ODBC/CLI Connection established in order for the auto-discover feature to find your IBM DB2 for Linux, Unix, and Windows databases, including registering the DB2 datasource to ODBC as a system datasource.

Although your datasources are auto-discovered, provide login information (user name and password) the first time you connect to a datasource.

In addition to Auto-Discovering your database servers, the application creates Datasource

Groups based on RDBMS type. Each registered datasource is placed in its respective

Datasource Group. For example, all Microsoft SQL Server datasources are added to the

Microsoft SQL Server Group. Each registered datasource is placed in its respective Datasource

Group.

For more information on how to configure your datasources, see Datasource Management.

C

HANGING

D

ATASOURCE

G

ROUPS

DBArtisan lets you change datasource groups by:

• Dragging the datasource between groups.

• Invoking the Change Group dialog box.

Dragging and Dropping Between Groups

1 On the Datasource Explorer, left-click the datasource group you want to move, drag it over the folder for the new group, and release the pointer.

Using the Change Group Dialog Box

Disconnect your datasource before changing groups.

1 On the Datasource Explorer, right-click the datasource you want to move, and then click

Change Group.

DBArtisan opens the Change Datasource Group dialog box.

13 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C O N N E C T I N G TO A D AT A S O U RC E > C O N N E C T I N G T O A D AT A S O U RC E

2 In the Select... tree, click new group.

3 Click OK.

DBArtisan changes groups.

C

ONNECTING TO A

D

ATASOURCE

DBArtisan lets you set datasources to automatically connect each time you open the application.The first time you start the application, DBArtisan prompts you to register your datasources. During this process, you can select the Auto Connect check box, which automatically connects all registered datasource each subsequent time you open the

application. For details, see Automatically Discovering Datasources

.

If you did not check the Auto Connect box, or if you clicked No when prompted to connect to a database after registering, you must connect manually, each time you want to access that datasource.

If you later want to automatically connect your datasources, you can edit the datasource to make that change.

TIP:

To configure your datasource to login automatically, refer to

Registering or Editing a

Datasource .

To manually connect to a datasource

1 In the left pane of the Datasource Explorer, right-click a datasource and select Connect from the context menu.

DBArtisan opens a Login to... dialog box.

2 Type a Login ID and Password.

3 Optionally, and only if available, provide Login As, Default Schema ID, and Default

Function Path values.

4 Select Auto Connect to automatically connect to the datasource in the future.

5 Click OK.

DBArtisan connects to the datasource and expands the datasource display to show the top level

of nodes available on that datasource. For more information, see Datasource Explorer Nodes by

DBMS Platform

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 135

D I S C O N N E C T I N G F RO M A D A T AS O U RC E > D IS C O N N E C TI N G F RO M A D A TA S O U RC E

D

ISCONNECTING FROM A

D

ATASOURCE

When you disconnect from a server, the application immediately breaks the connection between any open ISQL Windows, the servers, and databases. Although your ISQL Windows are still visible, the connections are no longer valid. If you attempt to execute a script, DBArtisan attempts to reconnect to a registered datasource, if available.

Completing the Disconnect Dialog Box

To complete the Datasource Login dialog box, do the following:

1 On the left pane of the Datasource Explorer, right-click a datasource and select Disconnect from the context menu.

NOTE:

If necessary, DBArtisan opens a dialog box asking if you want to commit all pending transactions for that connection or to rollback all before disconnecting. You cannot disconnect if there is an uncommitted transaction.

D

ISCOVER

D

ATASOURCES

DBArtisan discovers datasources residing on your system that are not currently registered datasources through a Windows system call to your network. DBArtisan can retrieve a list of discovered datasources, which includes the name of the server or instance and the type of

DBMS of all unregistered datasources found on your network or local machine. Once discovered, you have the option to register datasources.

Completing the Discover Datasources Dialog Box

1 On the Datasource menu, click Discover Datasources.

DBArtisan opens the Discover Datasources dialog box and when the search is complete, displays all discovered datasources.

2 Select the check box next to any datasources you want to register.

3 Click Register.

DBArtisan registers the datasource or datasources selected.

13 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E X T R A C T I N G C O N F I G UR AT I O N S T A TE M E N T S > E X T R A C T I N G C O N F I G U R A T IO N S T AT E ME N T S

E

XTRACTING

C

ONFIGURATION

S

TATEMENTS

DBArtisan lets you extract the sp_configure statements for setting and displaying your server configuration parameters into an Interactive SQL window.

1 On the left pane of the Datasource Explorer, expand the Instance or Server node for a datasource and then select the Configuration node.

DBArtisan displays the server configuration parameters in the right pane of the Datasource

Explorer.

2 In the right pane of the Datasource Explorer, select one or more parameters, right-click and select Extract.

DBArtisan opens the DDL Editor. For more information, see ISQL Editor

.

For more information, see

Servers.

A

CTIVATING

/D

EACTIVATING

R

OLES IN THE

C

URRENT

S

ESSION

DBArtisan lets you activate or deactivate roles for the current session.

NOTE:

This functionality is available for Oracle and Sybase only.

The Role Activation action builds and submits one or more SET ROLE commands.

To enable or disable one or more roles in the current DBArtisan session

1 Right-click on a connected Sybase or Oracle datasource node and select Role Activation from the context menu. The Role Activation dialog opens.

2 Use the following table as a guide to understanding and modifying settings in the wizard:

Panel

Role Activation

Preview

Settings and tasks

The list contains entries for each role that has been granted to the current login. For information on granting/assigning roles to a login or user, see

Users Editor (Oracle) and

Logins Editor (Sybase)

.

To activate a role, select the Active check box associated with the role. If the role is configured to require a password, provide it in the Password box.

To deactivate a role, deselect the Active check box associated with the role.

Preview the DDL generated for the operation and when ready, click Execute.

For related information, see Role Wizard (Sybase)

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 137

M AN AG I N G D A T A S O URC E S > M A N AG I N G D A T A S O URC ES

M

ANAGING

D

ATASOURCES

The Manage Datasources dialog box lets you manage datasources throughout your enterprise from a single vantage point. It provides concise, relevant information on your datasources in a simple grid format. It provides centralized access to common datasource operations such as adding, modifying, deleting, discovering, importing, and exporting datasources.

To open the Manage Datasources dialog box:

1 On the Datasource menu, click Manage Datasources.

DBArtisan opens the Manage Datasources dialog box.

The grid format lets you access and view datasource specifications. datasources are grouped according to the default, DBMS-based folder structure and then within any custom datasource groups you have set up. The table below describes information available for each datasource entry:

Column Description

Datasource Name Uses an explorer-like interface to display all registered datasources and their groups. You can navigate this column in the same manner as the datasource explorer, by clicking on nodes to expand or collapse your view of the datasources.

Connect String Displays the full connection string for the datasource.

Default User Id

Auto-Connect?

Host Computer

Default Schema

Displays the Default User ID for the datasource.

Indicates whether the Auto Connect feature is turned on or off.

Displays the name of the Host Computer if one has been configured.

Displays view default schemas for your DB2 datasources.

13 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MA N A G I N G D A T AS O U RC E S > M AN A G I N G D A T A S O U RC E S

In addition, you can take the following actions:

• Click the New Datasource button to register a datasource. For more information, see

Registering or Editing a Datasource .

• Select a datasource and click the Edit Datasource button to edit that datasource definition.

For more information, see Registering or Editing a Datasource

.

• Select a datasource and click the Remove Datasource button to unregister that datasource

definition. For more information, see Unregistering Datasource

.

• Click the Discover button to locate all configured datasources on your network and

automate the process of registering them. For more information, see Automatically

Discovering Datasources

.

• Import or export datasource definitions. For details, see Importing and Exporting

Datasource Definitions .

I

MPORTING AND

E

XPORTING

D

ATASOURCE

D

EFINITIONS

On startup, DBArtisan loads a Datasource Catalog, a collection of datasource definitions that the user can work against. How the catalog is stored and whether changes to the catalog are temporary or permanent, depends on the datasource storage method used. For an introduction, see

Understanding the Datasource Catalog

.

Regardless of the storage method used, DBArtisan lets you add datasources to the currently loaded catalog by importing datasource definitions from the following sources:

• Windows Registry - if you previously used the Windows Registry datasource catalog storage method but are now using one of the file-based methods

• File based datasource catalog storage method files (

.dsd

file suffix)

• Network shared datasource catalog storage method files (

.etsds

file suffix)

Similarly, you can export the currently loaded Datasource Catalog definitions to File based datasource catalog or Network shared datasource catalog storage method files.

The ability to export and import datasource definitions provides a number of practical advantages. For example:

• Simple sharing among users - if you have a large number of datasources to register, you can have one user walk through the process of registering each datasource and then export those definitions. Other users can then import the resulting datasource definition files.

• Sharing definitions among users employing different datasource storage methods - datasource definitions or entire catalogs created using the Windows Registry datasource catalog or File based datasource catalog methods can be exported for use by users employing any of the three methods.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 139

M AN AG I N G D A T A S O URC E S > M A N AG I N G D A T A S O URC ES

To export one or more datasource definitions:

1 On the Datasource menu, click Manage Datasources.

DBArtisan opens the Manage Datasources dialog box.

2 Select a single datasource, multiple datasources, or a default or custom datasource group folder.

NOTE:

Datasource group folder information is not exported. Datasources are exported as individual files with no higher level grouping.

3 Click Export. An Export Data Sources Folder dialog opens.

4 Take one of the following actions:

• To export datasource definitions to individual files that can be imported on a datasourceby-datasource basis, select Export Data Sources to Individual Data Source Files and use the associated control to locate and select a target folder.

• To export datasource definitions to a single file for use by installations employing the

Shared Datasource Managed catalog storage method, select Export Data Sources To a

Shared Data Source Management File and use the associated control to locate and select a target folder and provide a file name. For information on how to designate a user as a

Shared Datasource Managed catalog storage method, see Datasource Options

.

5 Click OK.

NOTE:

User ID and password credentials are not exported to the datasource definition file.

After export, other users can then import the datasource definitions.

To add one or more datasource definitions to a catalog:

1 On the Datasource menu, click Manage Datasources.

DBArtisan opens the Manage Datasources dialog box.

2 Select the datasource group folder where the files or files are to be imported.

3 Click Import. An Import Data Sources dialog opens.

14 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M AN A G I N G D A T A S O U RC E P RO P E R T I E S > M A N AG I N G D A T A S O URC E P RO P E R T I E S

4 Take one of the following actions:

• If you previous used the Windows Registry catalog storage method but are currently using the Locally Managed or Shared Datasource Managed method, select Import Previously

Registered Embarcadero Data Sources From Registry to load any datasources registered when you were using the Windows Registry catalog method.

• To import datasource definitions from individual datasource definition files (

.dsd

file suffix), select Import Previously Registered Embarcadero Data Sources From File(s), click

Add, and use the Select datasource definitions to import dialog to locate and select the files to be added.

• To import datasource definitions from a single Shared Datasource Managed storage method file (

.etsds

file suffix) file, select Import Data Sources From a Shared Datasource

Management File and use the associated control to locate and select the target file.

5 Click OK.

After importing a datasource definition file, you can either edit the datasource registration to provide security parameters or provide credentials when connecting to the datasource.

M

ANAGING

D

ATASOURCE

P

ROPERTIES

The Datasource Properties dialog box displays the name, type, version, status and mode of the datasource. The Datasource Properties box also lets you view the middleware or connectivity software that is being used to establish a particular datasource connection. You can use this information to troubleshoot connectivity problems, determining vital information such as the server version, connectivity library used, and library version and date.

Completing the Datasource Properties Dialog Box

1 On the Datasource Explorer, click a datasource with an established connection.

2 On the Datasource menu, click Properties.

DBArtisan opens the Datasource Properties dialog box.

For more information, see

Datasource Management

:

S

ELECTING

D

ATASOURCES

The DBArtisan Select Datasource dialog box lets you select a datasource and connect to it.

Completing the Select Datasource Dialog Box

1 On the Datasource menu, click Select to open the Select Datasource dialog box.

2 Click the Datasource list box, and then click the target datasource.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 141

U N REG I S T E RI N G D A T AS O U RC E > U N REG I S T E RI N G D A T A S O URC E

3 Use Connect to connect to the datasource.

4 If available, click the Database list, and then click the target database.

5 Click OK to close the Select Datasource dialog box.

For more information, see

Datasource Management

.

U

NREGISTERING

D

ATASOURCE

DBArtisan lets you unregister datasources when you no longer need them.

TIP:

Removing a datasource from DBArtisan does not delete the physical database. It simply removes the datasource definition, and connection information, from the

DBArtisan catalog.

1 On the left pane of the Datasource Explorer menu, right-click the target datasource and select Unregister from the context menu.

2 When prompted to confirm, click Yes.

NOTE:

The datasource manager is shared across Embarcadero's database management products. When you remove a datasource in any of Embarcadero's database management tools the datasource is removed across all relevant products.

For more information, see

Datasource Management

.

D

ATASOURCE

G

ROUPS

DBArtisan lets you define datasource groups to organize the datasources in your enterprise. datasource Groups behave as folders in the Windows Explorer, allowing you to group related datasources together. If you manage or monitor many Microsoft SQL Servers, datasource groups are a great mechanism for alleviating desktop clutter.

Anywhere that datasources are presented in a hierarchical tree format, datasource group folders expand to display one or more contained datasources. Upon installation of the first

Embarcadero database management product, an initial datasource group is called Managed

Datasources. You can rename this group.

Available Functionality

DBArtisan offers the following functionality for Datasource Groups:

• Removing a Datasource Group

• Creating a New Datasource Group

• Renaming a Datasource Group

14 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

R E M O VI N G A D A T A S O URC E G RO U P > R E M O V I N G A D A T A S O U RC E G RO UP

R

EMOVING A

D

ATASOURCE

G

ROUP

DBArtisan lets you remove database groups that you no longer need to access, or that have become obsolete. Keep the following in mind when removing datasource groups:

• If a datasource group contains datasources or other datasource groups, those items are deleted when you delete the containing group.

• The default datasource groups correspond to the DBMS platforms supported by DBArtisan.

If you delete a default group, it will be recreated if you subsequently register a datasource for the associated platform.

To remove a datasource group

1 Right-click the datasource, and then click Remove. DBArtisan prompts you to verify.

2 Click Yes.

For more information, see

Datasource Groups

C

REATING A

N

EW

D

ATASOURCE

G

ROUP

DBArtisan lets you define datasource groups to organize the datasources in your enterprise.

Datasource Groups behave as folders in the Windows Explorer, allowing you to group related datasources together. If you manage or monitor many Microsoft SQL Servers, datasource groups are a great mechanism for alleviating desktop clutter.

Anywhere that datasources are presented in a hierarchical tree format, datasource group folders expand to display one or more contained datasources. Upon installation of the first

Embarcadero database management product, an initial datasource group is called Managed

Datasources. You can rename this group.

TIP:

SQL Server does not provide true clustering because separate instances of a database are actually running on each server in a cluster. To simulate a consolidated view, you can name and group clustered datasources within the Explorer by setting up a datasource group, named, for example, Cluster3. After you name the new group, simply drag-and-drop the datasources that make up the cluster into Cluster3.

Completing the New Datasource Group Dialog Box

1 In the Datasource Explorer tree take one of the following actions:

• To create a new folder at the top level, right-click in empty space and select New from the context menu.

• To create a folder within an existing folder, right-click the target folder and select New from the context menu.

DBArtisan opens the New Datasource Group dialog box.

2 In the Datasource Group Name box, type the new name of the datasource group.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 143

R E N AM I N G A D A T A S O URC E G RO UP > R E N A M I N G A D AT A S O U RC E G RO U P

3 Click OK.

R

ENAMING A

D

ATASOURCE

G

ROUP

DBArtisan lets you change the name of an existing datasource group.

To rename a datasource group

1 On the Datasource Explorer, right-click the datasource group folder, and then click Rename.

DBArtisan opens the Rename Datasource Group dialog.

2 In the Datasource Group Name box, type the new name of the datasource group.

3 Click OK.

C

ATEGORIZING

D

ATASOURCES USING

C

OLOR

-

CODING AND

L

ABELING

DBArtisan provides a means to visually distinguish between datasources used for different purposes in your organization. You can assign a category, such as development or production, when creating or editing a datasource. This color-codes or labels particular user interface elements associated with that datasource.

When you assign a category to a datasource, the Datasource Explorer icons for the datasource shows a distinctive color-coded category indicator. Optionally, you can customize your categorization scheme to include the following user interface elements:

• A short name label included in the Datasource toolbar combo/dropdown when a categorized datasource is selected

• Color-coded tabs on windows associated with actions against a categorized datasource, editor or ISQL windows for example

• Color-coding of the status bar at the bottom of the DBArtisan window

14 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AT E G O RI Z I N G D A T AS O U RC E S U SI N G C O L O R- C O D I N G A N D L A B E L I N G > C A TE G O RI Z I N G D A T A S O U RC E S

The default categories [and short name labels] and the associated colors are as follows:

Color Default Category

Production

Short Name Label

PROD

Development DEV

QA QA

Test TEST

In addition to the defaults, you can create custom category/color code/label category combinations.

To work with color-coded datasource resources, you must be familiar with the following tasks:

• Enabling the specific user interface items that can be color-coded or labelled. For details, see

Datasource Options .

• Customizing your category scheme. For details, see

Customizing Datasource Categories

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 145

SE RVERS > SER V ERS

• Assigning a category to a datasource when creating or editing it. For details, see

Datasource

Registration

.

S

ERVERS

DBArtisan lets you manage your servers from the Datasources menu. The Datasources menu provides the following options:

• Starting, pausing, and resuming a server (SQL Server)

• Shutting Down a Server (SQL Server, Sybase)

• Configuring the Server

• Extracting Configuration Statements

• Activating/Deactivating Roles in the Current Session

S

TARTING

,

PAUSING

,

AND RESUMING A SERVER

(SQL S

ERVER

)

DBArtisan lets you start a server that has been shut down. As well you can also pause and resume the SQL Server service.

NOTE:

For information how to shut down a server, see

Shutting Down a Server (SQL Server,

Sybase)

.

To start a server, pause a server or resume after pausing

• Use the Datasource menu’s Start Server, Pause Server, and Continue After Pause commands.

S

HUTTING

D

OWN A

S

ERVER

(SQL S

ERVER

, S

YBASE

)

DBArtisan lets you shutdown a server using the Shutdown Server dialog box.

Completing the Shutdown Server Dialog Box

1 In the Explorer, select the target datasource.

2 On the Datasource menu, click Shutdown.

DBArtisan opens the Shutdown Server dialog box.

The table below describes the options and functionality on the Shutdown Sever dialog box.

14 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S ERVER S > SE RVER S

Option

Normal

Immediate

Description

Shuts down the server in an orderly fashion. DBArtisan disables logins, and waits for currently executing Transact-SQL statements and stored procedures to finish.

Wait Time (Sybase ASE only) - Lets you enable a grace period, an upper limit on how long to wait for normal operations to complete before forcing a shutdown. Wait time is specified in hours, minutes, and seconds, and if this option is not enabled, the Sybase ASE server will wait indefinitely before shutting down.

Shuts down the server immediately. DBArtisan does not perform checkpoints in every database.

The server terminates all user processes and rolls back any active transactions.

For more information, see

Servers.

C

ONFIGURING THE

S

ERVER

To configure and tune your sever, DBArtisan offers the Server Configuration dialog box that lets you view and edit the configuration parameters for each server. These configuration parameters are stored in the system catalog and used by DBArtisan when restarting the server. For detailed information on the meaning and purpose of each server configuration parameter, see the

System Administration Guide and Performance and Tuning Guide.

NOTE:

Many changes to server configuration parameters require you to shutdown and to restart DBArtisan before the changes take effect.

Completing the Server Configuration Dialog Box

NOTE:

For Oracle the following dialog box is called Instance Parameters, and for SQL Server it is Server Configuration.

1 On the Datasource menu, click Configure.

The table below describes the options and functionality on the Server Configuration dialog box.

Option

Edit Button

New Value

Description

Click to modify the target parameter. For more information, see

Edit

Configuration Dialog Box

.

Lets you type the value for the parameter.

Oracle Managed Files (OMF)

For Oracle 91 only, DBArtisan supports Oracle Managed Files (OMF.) OMF automatically manages files for tablespace, redo logs, and control files. Oracle automatically creates and removes operating system files as you create and drop storage objects.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 147

SE SSI ON RE CORD I NG > SES SI ON REC ORDI NG

You can enter the following query to set the db_create_file_dest parameter at the system level.

You can set the parameter value for the session level by using Alter session clause:

ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/u01/oradata/sample2'

TIP:

You can also set the parameter at the system level in the Edit Configuration dialog box.

For more information, see

Servers.

E

DIT

C

ONFIGURATION

D

IALOG

B

OX

The table below describes the options and functionality on the Edit Configuration dialog box:

Option

New Value

Description

Lets you type the value for the parameter.

NOTE:

To modify a parameter, the parameter must have a Yes in the Session Modifiable or

System Modifiable column of the Instance Parameter grid.

For more information, see

Servers.

S

ESSION

R

ECORDING

DBArtisan includes a session recording feature that records changes to the server. The Session

Recording feature lets you create a script file that you can execute as a batch at another time.

The session recording feature automates repetitive tasks that you routinely perform by issuing the commands in the collected script with a single command. Session recording lets you:

• Streamline time consuming, repetitive tasks.

• Execute multiple actions with from a single file.

• Automate a complex series of tasks by creating a batch file.

• Distribute automated tasks to multiple users with the session recording file.

The Session Recording feature is not available for operations that are destructive to your server.

These operations include:

• Schema Migration

• Data Load

• ISQL and DDL Editors

When you activate session recording, these operations are grayed out and not available.

14 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S E S S I O N R E C O RD I N G > S ESS IO N R ECO RD ING

You can also use the session recording feature for Tivoli Integration. DBArtisan records schema change management sessions to instruction files, which are read by Tivoli Management Systems.

Tivoli subsequently transports these to multiple managed endpoints for local execution.

For more information, see

Recording a Session

and

Executing a Session File

.

R

ECORDING A

S

ESSION

You can create a session file that includes a series of commands or actions using DBArtisan

Session Recording Mode dialog box.

Completing the

Session Recording Mode

Dialog Box

1 On the Datasource menu, click Session Recording.

The table below describes the options and functionality on the Enter Session Recording Mode dialog box.

Option

Session Name

Session File

Description

Lets you type the name of the session.

Lets you type the location and session file name or click the browse button.

DBArtisan uses

*.ses file extension for session files.

NOTE:

DBArtisan appends each task that you record in the session file. In place of an Execute button, DBArtisan displays a Record button. To record a certain task, click the Record

Button to open the Task Recording dialog box.

2 When you want to exit session recording mode, open an ISQL Window that lets you review the session file.

3 On the Datasources menu, click Session Recording.

DBArtisan opens an SQL window.

For more information, see

Session Recording and

Executing a Session File.

E

XECUTING A

S

ESSION

F

ILE

You can execute a session file which includes a series of collected commands in a single batch from an ISQL Window.

1 On the File menu, click Open.

DBArtisan opens the Open Files dialog box.

2 Select the session file(s) (*.ses) from the file list, or in the File Name box, type a session file name.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 149

DATAB AS E O BJ ECT F IND ER > DATAB A SE OBJ EC T FI NDER

3 Click OK.

DBArtisan opens the session file into a SQL window.

4 On the SQL tool bar, click the Execute button.

5 On the SQL tool bar, click the Step-Execute button to see a graphical display to identify the execution path of the script, and then click the Execute button to execute the session file.

6 On the SQL tool bar, click the Query Plan button to see a graphical display to identify the execution path of the script.

7 Click the Execute button.

DBArtisan executes the script.

For more information, see

Session Recording .

D

ATABASE

O

BJECT

F

INDER

The Database Object Finder is a search utility that lets you search through all your database objects. You can narrow your search by type of object and object owner, and you can set the search direction. The Database Object Finder also includes many options that let you further focus your search. The Database Object Finder displays your search results in the Database

Object Found box at the bottom of the Database Object Finder dialog box. For successful searches, DBArtisan lets you open the appropriate object editor from the Database Object

Finder.

Completing the Database Object Finder

1 Connect to a datasource.

2 On the Datasource menu, click Find Object.

The table below describes the options and functionality on the Database Object Finder dialog box.

15 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C H AN G I N G A N O D B C D A T AS O U RC E T O A N AT I V E D A T A S O URC E > C H A N G I N G A N O D B C D AT A SO U RC E

Option

Object to Find

Description

Lets you type the target string of text. You can also click the list to choose from a list of up to ten previous search strings.

Type of Object

Object Owner

Search Direction

Case-Sensitive Search

Lets you select the target database object type.

Lets you select the target database object owner.

Lets you select a search direction: From Beginning, Down, or Up.

Select to perform the search with the same capitalization as the search string.

Find Entire String Only Select to perform the search using the entire search string, not partial strings.

Search My Objects Only Select to perform the search only on your database objects.

NOTE:

If the search is successful, DBArtisan displays the search string in the Database Object

Found box. Click the Open button and DBArtisan opens the object editor for the target object.

C

HANGING AN

ODBC D

ATASOURCE TO A

N

ATIVE

D

ATASOURCE

CAUTION:

The section below refers only to Microsoft SQL Server connectivity.

Microsoft SQL Server uses ODBC to connect to Microsoft SQL Servers. DBArtisan requires native connectivity. To connect through DBArtisan, register your Microsoft SQL Server(s) using native connectivity in the Microsoft SQL Server Client Utility.

To change your ODBC servers to native connectivity, do the following:

1 Open the Microsoft SQL Server Client Network Utility dialog box, CLICONFG.exe.

2 On the General Tab, click Add.

Microsoft SQL Server opens the Add Network Library Configuration dialog box.

The table below describes the options and functionality on the Add Network Library

Configuration dialog box:

Option

Server alias

Network libraries

Computer name

Port number

Description

In the box, type the unique name of the server.

In the box, click the appropriate option button to specify the network library that connects to the server.

In the box, type the name of the target computer.

In the box, type the port number of the target computer.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 151

C H AN G I N G A N O D B C D A TA S O U RC E TO A N A T I VE D A T AS O U RC E > C HA N G I N G A N O D B C D A T A S O URC E

3 Click OK.

DBArtisan returns to the Client Network Utility dialog box.

4 In the Client Network Utility dialog box, click Apply.

DBArtisan adds the server.

5 Open DBArtisan and the Datasource Registration wizard. For more information, see

Datasource Registration .

For more information, see

Datasource Management

.

15 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D

ATABASE

O

BJECT

M

ANAGEMENT

For each supported DBMS, DBArtisan provides extensive object management facilities. AImed at both Database Administrators and Developers, DBArtisan provides support for the most commonly used object types. The following sets of topics describe the major areas of support:

Supported Objects

Creating objects

Modifying objects using editors

Object actions

Describes the database objects and related elements supported by DBArtisan.

In addition to a listing of all supported objects by DBMS platform, a support summary is provided for each object type.

Tells you how to create new objects using graphical wizards.

Tells you how to edit existing objects.

Provides details on the actions and operations that DBArtisan lets you perform against database objects.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 153

D A TA B AS E O B J E C T M A N A G E M E N T

15 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

S

UPPORTED

O

BJECTS

DBArtisan lets you manage database objects across different database platforms. The table below indicates the objects that DBArtisan supports by platform:

Objects

Alerts

Aliases

Dump and Backup

Devices

Bufferpools

Check Constraints

Clusters

Control Files

Database Devices

Database Links

Database Triggers

Databases

Data Caches

DBRM

Defaults

Directories

Disk Groups

Support

Event Monitors

Extended

Procedures

Foreign Keys

Full-text Catalogs

Full-text Indexes

Functions

Groups

Image Copies

Indexes

Instance

Java Classes

Java Resources

Java Sources

Jobs

Job Queues

DB2 LUW DB2 z/OS MySQL

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

ORCL

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

SQL SVR

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

SYB

9

9

9

9

9

9

9

9

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 155

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Procedures

Profiles

Recycle Bin

Redo Log Groups

Remote Servers

Roles

Rollback Segments

Rules

Segments

Sequences

Server Roles

Server Triggers

Stogroups

Structured Types

Synonyms

Tables

Tablespaces

Triggers

Type Bodies

Types

Objects

Libraries

Linked Servers

Logins

Materialized Query

Tables

Materialized Views

Materialized View

Logs

Nodegroups

Operators

Outlines

Package Bodies

Packages

Partition Functions

Partition Schemes

Plans

Primary Keys

DB2 LUW DB2 z/OS MySQL

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

ORCL

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

X

9

9

9

SQL SVR SYB

9

9 9

9

9

9

9

9

9

9

9

9

9

15 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Objects

Unique Keys

User Datatypes

User Messages

Users

Views

9

9

9

9

DB2 LUW DB2 z/OS MySQL

9 9 9

9

9

9

9 9

9

ORCL

9

9

9

9

9

SQL SVR

9

9

9

9

9

SYB

9

A

LERTS

An alert is a definition that matches one or more Microsoft SQL Server events with a response.

Errors and messages, or events, are generated by Microsoft SQL Server and entered into the

Microsoft Windows application log. SQL Server Agent reads the application log and compares events to alerts that you defined. When SQL Server Agent finds a match, it fires an alert.

DBArtisan lets you define alerts to respond to SQL Server events by notifying operators, forwarding the event to another server, or executing a job. These administrative tasks runs automatically if the SQL Server Agent service has been started.

Platform availability and Explorer node location

SQL Server

Server > SQL Server Agent > Alerts

Creating and editing

Alerts Wizard (SQL Server)

and Alerts Editor (SQL Server)

Object actions/operations

Drop

Extract

Rename

A

LIASES

Aliases let you assume the permissions of another database user without creating a separate user identity. You can use an alias when a user requires only temporary access to a database. You can also use an alias to mask a user’s identity.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 157

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Sybase

Schema > Aliases

Schema > Aliases (and Databases > databasename > Aliases)

Databases > database name > Aliases

Creating and editing

Alias Wizard (DB2 LUW)

and

Aliases Editor (IBM DB2 LUW)

Alias Wizard (DB2 Z/OS) and

Aliases Editor (IBM DB2 Z/OS)

Alias Wizard (Sybase) and

Aliases Editor (Sybase)

Object actions/operations supported

Drop (DB2 LUW, DB2 z/OS, Sybase)

Extract (DB2 LUW, DB2 z/OS, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, Sybase)

Report (DB2 LUW, DB2 z/OS, Sybase)

Transfer Ownership (DB2 LUW)

B

UFFERPOOLS

NOTE:

This object is supported by IBM DB2 for OS/390 and z/OS and IBM DB2 for Linux, Unix, and Windows only.

Bufferpools are areas of system memory to cache table and index data pages. DBArtisan retrieves table and index data pages from their physical storage location and places them in the bufferpool so that when you modify or access data, you can retrieve the data from memory rather than a physical device or file. Bufferpools improve database system performance because

DBArtisan can retrieve the data quickly from memory.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Performance > Buffer Pools

Performance > Buffer Pools

Creating and editing

Bufferpool Wizard for IBM DB2 (IBM DB2 LUW)

and

Bufferpool Editor (IBM DB2 LUW)

Buffer Pools Editor (IBM DB2 Z/OS)

15 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Drop (DB2 LUW, DB2 z/OS)

Extract (DB2 LUW, DB2 z/OS)

Report (DB2 LUW, DB2 z/OS)

C

HECK

C

ONSTRAINTS

Check constraints are data values that are acceptable in a column. They are logical expressions that verify column values meet defined acceptance criteria.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

SQL Server

Sybase

Schema > Check Constraints

Schema > Check Constraints

Schema > Check Constraints

Databases > database name > Check Constraints

Databases > database name > Check Constraints

Creating and editing

See

Add or Modify Check Constraint

.

Object actions/operations supported

Change Status (check constraints)

(Oracle, SQL Server)

Drop (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Rename (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 159

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

C

LUSTERS

Clusters provide an optional method of storing table data. A cluster comprises of a group of tables that share the same data blocks, and which are grouped together because they share common columns and are often used together. The related columns of tables stored in a cluster are known as the cluster key.

There are two types of clusters:

• Index

• Hash

Index clusters store the cluster data together and index the cluster key, which should make them faster at retrieving a range of data rows.

Hash clusters apply hashing functions to the cluster key to determine the physical location of a data row, which should make them faster at retrieving specific data rows.

NOTE:

To place a table on a cluster, 6 include the ON CLUSTER syntax within the CREATE

TABLE statement. Placing a table on a cluster precludes you from placing it on a tablespace or defining the associated storage parameters.

Platform availability and Explorer node location

Oracle

Schema > Clusters

Creating and editing

Cluster Wizard (Oracle) and

Clusters Editor (Oracle) .

Object actions/operations supported

Allocate Extent

Analyze

Migrate

Report

Deallocate Unused

Space

Truncate

Drop

Extract

C

ONTROL

F

ILES

Control files map to the structures that make up the database including the location of datafiles.

Control files are read-only because they are only constructed during database creation.

16 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

Oracle

Storage > Control Files

Creating and editing

Control files cannot be created or edited using DBArtisan.

Object actions/operations supported

Backup Control Files

Open Control Files

Report

D

ATABASE

D

EVICES

A database device is a disk or a portion of a disk that stores databases and database objects.

Platform availability and Explorer node location

Sybase

Storage > Database Devices

Creating and editing

Database Device Wizard (Sybase) and

Database Devices Editor (Sybase)

Object actions/operations supported

Drop

Report

Extract

Resize

Mirror

Unmirror (Sybase)

Reinitialize

Refit

D

ATABASE

L

INKS

Database links are named schema objects that describe a path from one database to another.

Database links are implicitly used when a reference is made to a global object name in a distributed database. To use a database link, either it is public or you own it.

NOTE:

Oracle syntax does not let you alter an existing database link. To change its definition, drop and re-create it.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 161

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

Oracle

Schema > Database Links

Creating and editing

Database Link Wizard (Oracle)

and

Database Links Editor (Oracle)

Object actions/operations supported

Drop

Extract

Migrate

Rename

Report

D

ATABASE

T

RIGGERS

A database trigger implements a database-scope DDL trigger. These triggers fire in response to events associated with DDL statements.

NOTE:

Before working with database triggers, consult Microsoft SQL Server documentation

for a general understanding of DDL triggers. For more information, see Accessing Third

Party Documentation .

Platform availability and Explorer node location

SQL Server 2005 ^

Databases > database name > Database Triggers

Creating and editing

Database Triggers Wizard (SQL Server)

and

Database Triggers Editor (SQL Server)

Object actions/operations supported

Change Status

Drop

Extract

Migrate

Report

Related information

Server Triggers

16 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

D

ATABASES

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery.

Platform availability and Explorer node location

DB2 z/OS

MySQL

SQL Server

Sybase

Databases

Databases

Databases

Databases

Creating and editing

Database Wizard (IBM DB2 LUW) and

Databases Editor (IBM DB2 LUW)

Database Wizard (DB2 Z/OS)

and

Databases Editor (IBM DB2 Z/OS)

Database Wizard (SQL Server)

and

Databases Editor (SQL Server)

Database Wizard (Sybase)

and

Databases Editor (Sybase)

Object actions/operations supported

Attach Database (SQL Server)

Checkpoint

(SQL Server, Sybase)

Coalesce

(Oracle)

Copy Schema

(DB2 LUW)

DBCC (SQL Server, Sybase)

Detach Database

(SQL Server)

Drop (DB2 LUW, DB2 z/OS, MySQL, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, MySQL, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, SQL Server, Sybase)

Move Log (Sybase)

Quiesce (Database) DB2 LUW)

Rename (SQL Server, Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 163

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Report (DB2 z/OS, MySQL, SQL Server, Sybase)

Set Online/Offline

(SQL Server, Sybase)

Shrink (SQL Server)

Start Database

(DB2 z/OS)

Stop Database

(DB2 z/OS)

Unquiesce (DB2 LUW)

Update Statistics (SQL Server)

DBMS-specific information

IBM DB2 for Linux, Unix, and Windows Instances

Microsoft SQL Server Databases

IBM DB2 for OS/390 and z/OS Instances

Sybase ASE Databases

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

I

NSTANCES

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery.

M

ICROSOFT

SQL S

ERVER

D

ATABASES

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery.

NOTE:

Microsoft SQL Server recommends that you do not create any user objects, such as tables, views, stored procedures, or triggers, in the master database. The master database includes the system tables that store the system information used by SQL

Server, such as configuration option settings.

16 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

IBM DB2

FOR

OS/390

AND Z

/OS I

NSTANCES

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery.

S

YBASE

ASE D

ATABASES

Databases are a collection of tables, or a collection of index spaces and tablespaces. The goals of a database system are straightforward but challenging. In general, a database aims to manage large amounts of data in a multi-user environment. It should achieve high performance while letting many users access the same information concurrently without compromising data integrity. A database also must protect against unauthorized access and provide reliable solutions for failure recovery.

D

ATA

C

ACHES

Data Caches are devices stored in memory. If configured properly, they can substantially boost performance by allowing users to read or write data in memory instead of to or from physical disk. With System 11, you can now “borrow” memory from the default data cache and allocate it to customized data caches.

Named data caches let you achieve substantially greater concurrency. Data caches also increase the likelihood that Sybase ASE reads data from memory and not disk. DBArtisan lets you bind particularly active databases (for example, tempdb), tables (for example, syslogs and sysindexes) or indexes to dedicated data caches. In addition, you can boost performance by creating memory pools, each configured for different I/O throughput (2 K to 16 K), within every named data cache.

In spite of their potential, named data caches are not a panacea for performance problems. You should still carefully optimize your queries and indexing strategy. Poor configuration of named data caches can lead to worse performance because precious memory resources are misallocated. To determine data cache performance, you should examine the cache hit ratio.

Platform availability and Explorer node location

Sybase

Storage > Data Caches

Creating and editing

Data Cache Wizard (Sybase)

and

Data Cache Editor (Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 165

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Object actions/operations supported

Drop

Extract

Migrate

Report

DBRM

A Database Request Module (DBRM) is an application containing information on SQL statements extracted from the DB2 precompiler. A DBRM refers to a specific database and is stored outside of the DB2 directory.

Platform availability and Explorer node location

DB2 z/OS

Application processes > DBRM

Creating and editing

DBRMs Editor (IBM DB2 Z/OS)

Object actions/operations supported

Report

D

EFAULTS

Defaults promote data integrity by supplying a default value to a table column if the user does not explicitly provide one. They are reusable objects that you can bind to table columns or user datatypes.

Platform availability and Explorer node location

SQL Server

Sybase

Databases > database name > Defaults

Databases > database name > Defaults

Creating and editing

Default Wizard (SQL Server)

and Defaults Editor (SQL Server)

Default Wizard (Sybase)

and

Defaults Editor (Sybase)

Object actions/operations supported

Drop (SQL Server, Sybase)

Extract (SQL Server, Sybase)

16 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Hide Text

(Sybase)

Migrate

(SQL Server, Sybase)

Rename (SQL Server, Sybase)

Report (SQL Server, Sybase)

D

IRECTORIES

Directories create an alias to an external operating system directory to your database files, which can be used for storing large binary object files. When you create a directory, provide the full path name to the outside operating system where the BFILE's are stored. This object lets you store large files, such as video, outside of the database. The directory object lets you provide a simple alias to the full path name of an outside server's file system, which you can then use to point to the files when creating procedural logic objects. This saves the developer from having to type the full path name when coding.

To create a Directory object, you need CREATE ANY DIRECTORY system privileges. You also create or have in place a corresponding operating system directory to store the file. This directory must have the correct read permissions for Oracle processes.

Platform availability and Explorer node location

Oracle

Storage > Directories

Creating and editing

Directory Wizard (Oracle)

and

Directories Editor (Oracle)

Object actions/operations supported

Drop

Extract

Migrate

Report

D

ISK

G

ROUPS

S

UPPORT

When connected to an Oracle datasource with an ASM instance, the Explorer’s Instance node shows ASM and ASM > Disk Groups subnodes. DBArtisan lets you connect to the ASM instance and provides basic object management for disk groups.

DBArtisan lets you use the default datasource connection or a dedicated connection to the ASM instance. When using the default datasource connection, you can open a Disk Group Editor but you can only view limited properties of the disk group. With a dedicated connection to the ASM instance, you can create and edit disk groups and make use of the disk group-specific object actions: Check Disk Group, Mount Disk Group, Rebalance Disk Group, and Undrop Disk.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 167

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

After connecting to the datasource, you are prompted to choose between the default datasource connection and a dedicated ASM instance connection on the first object action against a disk group. The connection type persists and you can also explicitly change the connection type using the Manage ASM Connection and Disconnect ASM Connection actions.

Platform availability and Explorer node location

Oracle 10g ^

Instance > ASM > Disk Groups

NOTE:

The ASM and Disk Groups nodes are only visible if the datasource instance has an

ASM instance.

Creating and editing

Disk Groups Wizard (Oracle) and

Disk Groups Editor (Oracle)

Object actions/operations supported

Check Disk Group

Mount Disk Group

Disconnect ASM

Connection

Rebalance Disk

Group

Drop

Undrop Disk

Extract

Manage ASM

Connection

Connection details

When registering an Oracle datasource:

• As of Oracle 11gR1, you can specify the SYSASM privilege for the datasource connection.

This provides full ASM administrative privilege for this connection.

• Using the SYSDBA privilege, you can register the ASM instance directly using the

Datasource Registration Wizard.

For more information, see

Registering or Editing a Datasource .

D

UMP AND

B

ACKUP

D

EVICES

Dump devices store backups of databases and transaction logs. In Microsoft SQL Server, dump devices have been renamed to backup devices. Before you can dump a database or its transaction log, first create a dump device that stores the resulting backup file. Microsoft SQL

Server and Sybase ASE lets you create tape and disk dump devices. Disk dump devices are a fast and convenient mechanism for backups. Tape dump devices facilitate off site storage for enhanced disaster recovery.

16 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

SQL Server

Sybase

Storage > Backup Devices

Storage > Dump Devices

Creating and editing

Backup Device Wizard (SQL Server)

and Backup Devices Editor (SQL Server)

Dump Device Wizard (Sybase) and

Dump Devices Editor (Sybase)

Object actions/operations supported

Report (SQL Server, Sybase)

Extract (SQL Server, Sybase)

Migrate

(SQL Server, Sybase)

Report (SQL Server, Sybase)

View Contents (SQL Server)

E

VENT

M

ONITORS

Event Monitors lets you monitor specified events that occur on the database including deadlocks, connections, and statements. Because monitoring is configurable by type, you can record activity against all trackable objects or only those you consider most important.

NOTE:

Event Monitors cannot be altered using the ALTER command. An Event Monitor has to be dropped and re-created.

Platform availability and Explorer node location

DB2 LUW

Performance > Event Monitors

Creating and editing

Event Monitor Wizard (DB2 LUW) and

Event Monitor Editor (IBM DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 169

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Object actions/operations supported

Drop

Extract

Migrate

Report

Transfer Ownership

E

XTENDED

P

ROCEDURES

Extended Procedures are dynamic link libraries that can be used to load and execute application routines written in other programming languages, such as C or Visual Basic. Extended

Procedures function and appear in the same manner as normal stored procedures in that you can pass parameters to them and obtain results.

NOTE:

Extended Procedures can only be accessed on the Master database.

Platform availability and Explorer node location

Sybase

Databases > database name > Extended Procedures

Creating and editing

Extended Procedure Wizard (Sybase) and

Extended Procedures Editor (Sybase)

Object actions/operations supported

Drop

Migrate

Describe

Rename

Execute

Report

Extract

Hide Text

F

OREIGN

K

EYS

Foreign keys enforce referential integrity between tables by verifying the existence of foreign key values in the parent table before letting you insert or update foreign key values in the child table.

17 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Foreign Keys

Schema > Foreign Keys

Databases > database name > Foreign Keys

Schema > Foreign Keys

Databases > database name > Foreign Keys

Databases > database name > Foreign Keys

Creating and editing

Foreign Key Wizard (IBM DB2 LUW)

and

Foreign Keys Editor (IBM DB2 LUW)

Foreign Key Wizard (DB2 Z/OS))

and Foreign Keys Editor (IBM DB2 Z/OS)

Foreign Keys wizard (MySQL) and

Foreign Keys editor (MySQL)

Foreign Key Wizard (Oracle) and

Foreign Keys Editor (Oracle)

Foreign Key Wizard (SQL Server) and

Foreign Keys Editor (SQL Server)

Foreign Key Wizard (Sybase) and

Foreign Keys Editor (Sybase)

Object actions/operations supported

Change Status (check constraints)

(Oracle, SQL Server)

Drop (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Rename (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 171

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

DBMS platform-specific notes

MySQL MySQL recognizes two types of tables, MyISAM and InnoDB. MyISAM tables access data records using an index, where InnoDB tables allow transactions and foreign keys.

Therefore, the discussion of foreign keys is limited to your InnoDB tables.

F

ULL

-

TEXT

C

ATALOGS

A full-text catalog is a set of operating system files that store full-text indexes. Full-text catalogs, along with full-text indexes and the object actions supported for these object types, provide full text search support in DBArtisan.

NOTE:

Before working with full-text catalogs, consult Microsoft SQL Server documentation for

a general understanding of full-text searching. For more information, see Accessing

Third Party Documentation

.

Platform availability and Explorer node location

SQL Server 2005 ^

Databases > database name > Full-text Catalogs

Creating and editing

Full-text Catalogs Wizard (SQL Server) and

Full-text Catalogs Editor (SQL Server)

Object actions/operations supported

Drop

Extract

Migrate

Rebuild (Full-text Catalogs)

Report

Reorganize (SQL Server Full-text

Catalogs)

Related information

Full-text Indexes

F

ULL

-

TEXT

I

NDEXES

A full-text index stores information used by the Full-Text Engine to compile full-text queries that can quickly search a table for particular words or word combinations. A full-text index stores information about key words and their location within one or more columns of a table.

17 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Full-text indexes, along with full-text catalogs and the object actions supported for these object types, provide full text search support in DBArtisan.

NOTE:

Before working with full-text indexes, consult Microsoft SQL Server documentation for

a general understanding of full-text searching. For more information, see Accessing

Third Party Documentation

.

Platform availability and Explorer node location

SQL Server 2005 ^

Databases > database name > Full-text Indexes

Creating and editing

Full-text Indexes Wizard (SQL Server) and

Full-text Indexes Editor (SQL Server)

Object actions/operations supported

Change Status (Full-text Indexes)

Drop

Report

Extract

Migrate

Population status

Related information

Full-text Catalogs

F

UNCTIONS

Functions are subroutines that you define. Functions are useful for reusable application logic.

You can use functions to determine the best methods for controlling access and manipulation of the underlying data contained in an object.

The table below describes the types of user-defined functions that DBArtisan lets you create:

Function

Column or External

Table Function

External Scalar

Function

Description

You can write in a host programming language, such as C. This function can act on a table and returns a table value rather than a scalar value.

You can write in a language other than SQL, such as C++ or Java and returns a scalar value to the program. This type of function is referenced by the CREATE FUNCTION statement and can be used to perform computations on data contained in the database but cannot directly reference the data.

Accesses OLE DB data in user-defined OLE DB external tables.

OLEDB Function

Sourced Function Inherits the semantics of another function and can be an operator.

Template Function Partial functions that do not contain any executable code. Mainly used in a federated database to map the template function to a data source function -Oracle, SQL Server, Sybase, etc. A function mapping needs to be created in conjunction with the template function.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 173

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Functions

Schema > Functions

Databases > database name > Functions

Schema > Functions

Databases > database name > Functions

Databases > database name > Functions

Creating and editing

Function Wizard (IBM DB2 LUW)

and Functions Editor (IBM DB2 LUW)

Function Wizard (DB2 Z/OS) and

Functions Editor (IBM DB2 Z/OS)

Functions wizard (MySQL) and

Functions editor (MySQL)

Function Wizard (Oracle) and

Functions Editor (Oracle)

Function Wizard (SQL Server) and

Functions Editor (SQL Server)

Functions Wizard (Sybase) and

Functions Editor (Sybase)

Object actions/operations supported

Compile (Oracle)

Create Synonym

(Oracle)

Describe (DB2 LUW, DB2 z/OS, Oracle)

Drop (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Execute (Oracle)

Extract (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Rename (SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

17 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Important Notes

With respect to functions and stored procedures, it can be necessary to have statements executed before and after creation of the procedure or function. This can be useful for example, if you need to create or drop temporary tables used by the function or procedure. DBArtisan supports the use of two tag pairs, ETStart and ETEnd, that let you embed statements in the first comment block of a stored procedure or function. The following shows the expected syntax: create procedure dbo.procname(@a numeric) as

/*

<ETStart>SQL Statement</ETStart>

<ETEnd>SQL Statement</ETEnd>

*/ begin

...

G

ROUPS

Groups are a defined collection of database users. The primary use of groups is to consolidate the management of permissions. By matching together similar users into groups, you can greatly reduce the number of commands required to set permissions.

Every user automatically belongs to the public group. To assign a user to another group, add the user to that group. Then the user belongs to that group and public.

NOTE:

A user can only belong to one group at a time other than public.

Platform availability and Explorer node location

DB2 LUW

Oracle

Sybase

Security > Groups

Security > Groups

Databases > database name > Groups

Creating and editing

Group Wizard (DB2 LUW) and

Groups Editor (IBM DB2 LUW)

Groups Editor (Oracle)

Group Wizard (Sybase)

and Groups Editor (Sybase)

Object actions/operations supported

Drop (Sybase)

Extract (DB2 LUW, Oracle, Sybase)

Migrate

(DB2 LUW, Oracle, Sybase)

Report (DB2 LUW, Oracle, Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 175

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

I

MAGE

C

OPIES

Image Copies are a full image copy of all pages in a tablespace, partition, data set, or index space. Image Copies can also be an incremental image copy of only pages that have been modified since the last use of the Image Copy Wizard.

Platform availability and Explorer node location

DB2 z/OS

Performance > Image Copies

Creating and editing

Image Copies cannot be created or edited within DBArtisan.

Object actions/operations supported

Copy to Copy

Merge Copy

Modify Recovery

I

NDEXES

Indexes are optional structures associated with tables. You can create indexes specifically to speed SQL statement execution on a table. When properly used, Indexes are the primary means of reducing disk I/O. Indexes are logically and physically independent of the data in the associated table. Unique Indexes guarantee that no two rows of a table have duplicate values in the columns that define the index.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Indexes

Schema > Indexes (and Databases > databasename > Indexes)

Databases > database name > Indexes

Schema > Indexes

Databases > database name > Indexes

Databases > database name > Indexes

Creating and editing

Index Wizard (DB2 LUW)

and

Indexes Editor (IBM DB2 LUW)

Index Wizard (DB2 Z/OS)

and

Indexes Editor (IBM DB2 Z/OS)

Indexes, Primary Keys, or Unique Keys wizard (MySQL) and

Indexes, Primary Keys, and

Unique Keys editors (MySQL)

Index Wizard (Oracle) and

Indexes Editor (Oracle)

17 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Index Wizard (SQL Server)

and

Indexes Editor (SQL Server)

Index Wizard (Sybase)

and

Indexes Editor (Sybase)

Object actions/operations supported

Allocate Extent

(Oracle)

Analyze (Oracle)

Check Index (DB2 z/OS)

Copy to Copy (DB2 z/OS)

Deallocate Unused Space

(Oracle)

Disable Index (SQL Server)

Drop (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

DBCC (SQL Server, Sybase)

Estimate Size

(Oracle, Sybase)

Extract (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Modify Recovery (DB2 z/OS)

Modify Statistics

(DB2 z/OS)

Place

(Sybase)

Rebuild Index

(DB2 z/OS, Oracle, SQL Server)

Recover (DB2 z/OS)

Rename (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Reorganize /Reorg (DB2 LUW, DB2 z/OS, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Runstats Index (DB2 z/OS)

Shrink (Oracle)

Transfer Ownership (DB2 LUW)

Update Statistics (DB2 LUW, SQL Server, Sybase)

DBMS-specific information

• IBM DB2 for Linux, Unix, and Windows Indexes

• IBM DB2 for OS/390 and z/OS Indexes

• Microsoft SQL Server Indexes

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 177

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

• Oracle Indexes

• Sybase ASE Indexes

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

I

NDEXES

IBM DB2 for Linux, Unix, and Windows offers two types of indexes:

• Unique

• Non-Unique

Unique Indexes guarantee that no two rows of a table have duplicate values in the columns that define the index.

M

ICROSOFT

SQL S

ERVER

I

NDEXES

Microsoft SQL Server offers two types of indexes: clustered and non-clustered. Clustered indexes physically sort table data to match their logical order. Non-clustered indexes only order the table data logically. In a database, an index lets you speed queries by setting pointers that allow you to retrieve table data without scanning the entire table. An index can be unique or non-unique.

Microsoft SQL Server creates indexes as B-Trees, which are a series of pointers mapping index pages to their underlying data pages. As tables and, therefore, indexes grow, the number of levels in the B-Tree increases. The B-Tree of a clustered index is shorter than that of a nonclustered index because the leaf level of a clustered index is the data page.

A sound indexing strategy is critical to overall system performance. One pitfall to avoid is placing many indexes on a table without regard for their cumulative cost. Remember that indexes improve read but slow write performance because Microsoft SQL Server must update more information in the system catalog. Consequently, extra indexes can actually slow overall performance if data modification occurs frequently on the table. To determine the efficacy of indexes, you should tune your queries using SHOWPLAN and IO STATISTICS and analyze the selectivity of indexes using DBCC SHOW_STATISTICS.

DBArtisan separates system indexes from user-defined indexes in the Datasource Explorer to ensure that system indexes are not accidentally altered or dropped.

O

RACLE

I

NDEXES

Oracle offers two types of indexes. The table below describes these indexes:

Index

Table

Cluster

Description

A table index is defined on an individual table.

A cluster index is defined on a set of tables physically stored together in a cluster. In an Oracle database, both table and cluster indexes use a B-tree structure.

17 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

The indexing strategy, particularly with large, active tables, is critical to overall system performance. The optimal definition and number of indexes for a given table is determined by the mix of access paths to that table performing insert, update, delete and select operations.

For example, adding or changing an index can speed up your selects but slow your inserts, updates and deletes. Careful tuning and testing helps you achieve the best overall performance.

TIP:

Indexes generally improve read operations in a database, but you should not place too many indexes on some tables. Since Oracle must maintain each index along with its referenced table, placing too many indexes on a table that is the object of much insert, update, and delete activity, can actually degrade performance.

Even when an index exists on a table, the way a SQL statement is coded can actually disallow the use of the index. To prevent this from happening, follow these rules of thumb:

• Try not to use SQL statements that include the NOT IN, NOT LIKE, <>, IS NULL operators because they typically suppress the use of indexes.

• When referencing concatenated indexes with queries, be sure the leading column in the index is used. If it isn't, the index won't be used at all.

• Avoid using functions in WHERE predicates.

If you must use functions, and you are using Oracle8i, investigate the use of function-based indexes.

I

NDEX

P

ARTITIONS

Index partitions are similar to table partitions. There ar e three types of partitioned indexes that

Oracle supports:

1 Local prefixed

2 Local nonprefixed

3 Global prefixed

NOTE:

An index cannot be partitioned if it is a cluster index or if the index is defined on a clustered table.

Local prefixed and nonprefixed indexes

A local partitioned index has keys that refer to rows in a single table partition. A local partitioned index is automatically partitioned to mirror the underlying table. The number of partitions or subpartitions and the partition bounds for the partitioned index correspond with the partitions on the table. Oracle maintains this correspondence. If the table partitions are altered, the index partitions are altered accordingly.

A local partitioned index is prefixed if it is partitioned on the same column as the underlying table. The local partitioned index is nonprefixed if it is partitioned on a different column.

Global prefixed indexes

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 179

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

A global partitioned index can refer to rows in more than one table partition or subpartition.

Global partitioned indexes are more difficult to manage than local partitioned indexes because any change in the underlying table partition affects all partitions in a global index. As a result, there is increased partition maintenance.

NOTE:

A global index can only be range partitioned but it can be defined on any kind of partitioned table.

IBM DB2

FOR

OS/390

AND Z

/OS I

NDEXES

IBM DB2 for OS/390 and z/OS offers two types of indexes:

• Unique

• Non-Unique

Unique Indexes guarantee that no two rows of a table have duplicate values in the columns that define the index.

Non-Unique indexes let table rows have duplicate values in the columns that define the indexes.

S

YBASE

ASE I

NDEXES

Sybase ASE offers two types of indexes: clustered and non-clustered. Clustered indexes physically sort table data to match their logical order. Non-clustered indexes only order the table data logically. In a database, an index lets you speed queries by setting pointers that let you retrieve table data without scanning the entire table. An index can be unique or non-unique.

Sybase ASE creates indexes as B-Trees, which are a series of pointers mapping index pages to their underlying data pages. As tables and, therefore, indexes grow, the number of levels in the

B-Tree increases. The B-Tree of a clustered index is shorter than that of a non-clustered index because the leaf level of a clustered index is the data page.

A sound indexing strategy is critical to overall system performance. One pitfall to avoid is placing many indexes on a table without regard for their cumulative cost. Remember that indexes improve read but slow write performance because Sybase ASE must update more information in the system catalog. Consequently, extra indexes can actually slow overall performance if data modification occurs frequently on the table. To determine the efficacy of indexes, you should tune your queries using SHOWPLAN and IO STATISTICS and analyze the selectivity of indexes using DBCC SHOW_STATISTICS.

DBArtisan separates system indexes from user-defined indexes in the Datasource Explorer to ensure that system indexes are not accidentally altered or dropped.

I

NSTANCE

NOTE:

This object is support for IBM DB2 and Oracle.

18 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

DBArtisan places Instance as the first level of information under the Datasource node in the

Datasource Explorer. Instance includes:

• DB Manager Configuration

• Data sources

Available Functionality

DBArtisan offers the following functionality for this object:

Database Wizard

(IBM DB2 LUW)

Quiesce (Database)

Unquiesce

J

AVA

C

LASSES

The Java Classes contain compiled Java code. Java Classes are made up of a group of data items, with associated functions that perform operations. The data items are called fields or variables; the functions are referred to as methods.

TIP:

Oracle is shipped with a JVM (Java Virtual Machine). The JVM provided by Oracle sits atop the Oracle RDBMS and interacts directly with the RDBMS instead of the operating system.

Platform availability and Explorer node location

Oracle

Schema > Java Classes

Object actions/operations supported

Compile

Create Synonym

Drop

Load Java

Report

J

AVA

R

ESOURCES

NOTE:

This object is supported by Oracle only.

The Java Resources node of the Explorer tab offers support for browsing Java resources.

Platform availability and Explorer node location

Oracle

Schema > Resources

Available Functionality

• Drop

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 181

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

J

AVA

S

OURCES

Java Sources contain the uncompiled Java source code.

TIP:

Oracle is shipped with a JVM (Java Virtual Machine). The JVM provided by Oracle sits atop the Oracle RDBMS and interacts directly with the RDBMS instead of the operating system.

Platform availability and Explorer node location

Oracle

Schema > Java Sources

Object actions/operations supported

Compile

Rename

Drop

Report

Extract

Load Java

Migrate

J

OBS

Jobs define administrative tasks that can execute on a local server according to schedules or in response to alerts. A job is comprised of job steps that can be executable programs, Windows commands, Transact-SQL statements, Microsoft ActiveX script, or Replication Agents.

Platform availability and Explorer node location

SQL Server

Server > SQL Server Agent > Jobs

Creating and editing

Jobs Wizard (SQL Server) and

Jobs Editor (SQL Server)

Object actions/operations supported

Change Job’s Owner

Drop

Enable/Disable Job

(SQL Agent Job)

Extract

Start/Stop Job

View Job History

Rename

J

OB

Q

UEUES

Job Queues are built-in mechanisms that let you schedule a variety of SQL-based or commandline driven tasks.

18 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

Oracle

Instance > Oracle Job Queue

Creating and editing

Job Queue Wizard (Oracle)

and

Job Queue Editor (Oracle)

Object actions/operations supported

Disable Job

Drop

Enable Job (Job

Queue)

Report

Run Job

Extract

Migrate

L

IBRARIES

Libraries are an object type introduced in Oracle8 that represent a call to an operating system shared library. After the call is made, libraries can be used by SQL or PL/SQL to link to external procedures or functions. Libraries are only to be used on operating systems that support shared libraries and dynamic linking. Libraries serve as pointers or aliases to physical operating system shared library files and do not have existence as a physical object on their own, rather they rely on the physical existence of the files in the external operating system library to which they refer.

To access the function or procedures stored in the library, you need execute privileges at the operating system level where the shared library resides.

Platform availability and Explorer node location

Oracle

Schema > Libraries

Creating and editing

Library Wizard (Oracle)

and

Libraries Editor (Oracle)

Object actions/operations supported

Drop

Extract

Migrate

Rename

Report

L

INKED

S

ERVERS

Linked servers let you create links to OLE DB data sources. With a linked server you can execute commands against OLE DB data sources on different servers. Using linked servers you can:

• Access remote servers

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 183

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

• Issue enterprise-wide distributed queries, updates, commands, and transactions.

Distributed Queries

Before you run a distributed query, write the following as the first statement of your SQL script:

SET ANSI_NULLS ON

GO

SET ANSI_WARNINGS ON

GO

Platform availability and Explorer node location

SQL Server

Security > Linked Servers

Creating and editing

Linked Server Wizard (SQL Server) and

Linked Servers Editor (SQL Server)

Object actions/operations supported

Drop

Extract

Migrate

Report

L

OGINS

Logins let you access your account. Your login account controls access to the server and all of the databases within it. Only the System Administrator or System Security Officer can create logins. Once you can log into a server, you need additional privileges to access user databases.

Specifically, each database owner adds the login as a user or alias to the database.

Platform availability and Explorer node location

SQL Server

Sybase

Security > Logins

Security > Logins

Creating and editing

Login Wizard (SQL Server) and

Logins Editor (SQL Server)

Login Wizard (Sybase) and

Logins Editor (Sybase)

Object actions/operations supported

Add/Modify Login Trigger (Sybase)

18 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Bind To Temporary Database (Sybase)

Change Password (SQL Server)

Create Like (SQL Server)

Drop (SQL Server, Sybase)

Drop Login Trigger

(Sybase)

Extract (SQL Server, Sybase)

Migrate

(SQL Server, Sybase)

Report (SQL Server, Sybase)

Unbind From Temporary Database

(Sybase)

For more information, see the following topics:

Microsoft SQL Server Logins

Sybase ASE Logins

M

ICROSOFT

SQL S

ERVER

L

OGINS

Logins let you access your account. Your login account controls access to the server and all of the databases within it. Only the System Administrator or System Security Officer can create logins. Once you can log into a server, you need additional privileges to access user databases.

Specifically, each database owner adds the login as a user or alias to the database.

S

YBASE

ASE L

OGINS

Logins let you access your account. Your login account controls access to the server and all of the databases within it. Only the System Administrator or System Security Officer can create logins. Once you can log into a server, you need additional privileges to access user databases.

Specifically, each database owner adds the login as a user or alias to the database.

M

ATERIALIZED

Q

UERY

T

ABLES

NOTE:

This object is supported by IBM DB2 for Linux, Unix, and Windows version 8.

A materialized query table is a table whose definition is based on the result of a query. The materialized query table typically contains pre-computed results based on the data existing in the table or tables that its definition is based on. If the SQL compiler determines that a query will run more efficiently against a materialized query table than the base table or tables, the query quickly executes against the materialized query table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 185

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

DB2 LUW

Schema > Materialized Query Tables

Creating and editing

Materialized Query Table Wizard (DB2 LUW)

and Materialized Query Tables Editor (IBM DB2

LUW)

Object actions/operations supported

Build Query

Drop

Create Alias

Drop Materialized

Query Table

Quiesce Tablespaces Refresh Table

Select * From

Set Integrity

Create Like

Extract

Create View

Lock

Reorganize /Reorg

Report

Transfer Ownership

Update Statistics

Describe

Migrate

Schema

M

ATERIALIZED

V

IEWS

NOTE:

This object is supported by Oracle only.

Materialized views are used to dynamically copy data between distributed databases. There are two types of materialized views:

• Complex

• Simple

Complex materialized views copy part of a master table or data from more than one master table. Simple materialized views directly copy a single table. You cannot directly update the underlying data contained in materialized views.

Platform availability and Explorer node location

Oracle 8.1 ^

Schema > Materialized Views

Creating and editing

Materialized View Wizard (Oracle) and

Materialized Views Editor (Oracle)

18 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Compile

Rename

Create Synonym

Report

Drop

Shrink

Extract

Migrate

M

ATERIALIZED

V

IEW

L

OGS

Materialized View logs are tables that maintain a history of modifications to the master table, and they are used to refresh simple materialized views. When you create a materialized view log,

Oracle automatically creates a log table to track data changes in the master table and a log trigger to maintain the data in the log table.

Platform availability and Explorer node location

Oracle 8.1 ^

Schema > Materialized View Logs

Creating and editing

Materialized View Log Wizard (Oracle)

and

Materialized View Logs Editor (Oracle)

Object actions/operations supported

Drop

Extract

Migrate

Report

Shrink

N

ODEGROUPS

Nodegroups are a named subset of one or more partitions in a database. DBArtisan places

Nodegroup under the Storage node in the Datasource Explorer.

Platform availability and Explorer node location

DB2 LUW

Storage > Nodegroups

Creating and editing

Nodegroup Wizard (DB2 LUW)

and Nodegroups Editor (IBM DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 187

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Object actions/operations supported

Drop

Extract

Migrate

Redistribute

Report

O

PERATORS

Operators are individuals responsible for the maintenance of one or more computers running

Microsoft SQL Server. E-mail, pager, and Net Send can notify these operators.

Platform availability and Explorer node location

SQL Server

Server > SQL Server Agent > Operators

Creating and editing

Operators Wizard (SQL Server) and

Operators Editor (SQL Server)

Object actions/operations supported

Drop

Extract

Rename

O

UTLINES

Outlines are a set of results for the execution plan generation of a particular SQL statement.

When you create an outline, plan stability examines the optimization results using the same data used to generate the execution plan. That is, Oracle uses the input to the execution plan to generate an outline, and not the execution plan itself.

Platform availability and Explorer node location

Oracle

Schema > Stored Outlines

Creating and editing

Outline Wizard (Oracle) and

Outlines Editor (Oracle)

18 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Change Category

Extract

Drop

Migrate

Drop By Category

Reassign By

Category

Report

Drop Unused

Rebuild Outlines

Disable Keys

Rename

P

ACKAGES

NOTE:

This object is supported by IBM DB2 for Linux, Unix, and Windows, IBM DB2 for OS/

390 and z/OS, and Oracle only.

Packages contain all the information needed to process SQL statements from a single source file. You can use packages to process and call batches of SQL. Depending on the platform, packages can include:

• Procedures

• Functions

• Types

• Variables

• Constants

• Exceptions

• Cursors

• Subprograms

Packages offer a number of important advantages over using standalone procedures and functions, including the ability to:

• Modify package objects without recompiling dependent database objects.

• Declare global variables and cursors that can be shared within the package.

• Grant privileges more efficiently.

• Load multiple package objects into memory at once.

Packages usually have two parts: a header or specification and a body, although sometimes the body is unnecessary. The package header declares the members of the package while the body details the logic underlying each of the package components.

NOTE:

DBArtisan splits out package headers and package bodies in the Datasource Explorer; however, you create both a package header and body from the packages node.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 189

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

Schema > Packages

Schema > Packages

Schema > Packages

Creating and editing

Packages Editor (IBM DB2 LUW)

Packages Editor (IBM DB2 Z/OS)

Package Wizard (Oracle) and

Packages Editor (Oracle)

Object actions/operations supported

Bind Package

(DB2 z/OS)

Compile (Oracle)

Create Synonym

(Oracle)

Drop (DB2 LUW, Oracle)

Extract (Oracle)

Flush Cache

(DB2 LUW)

Free (Packages)

(DB2 z/OS)

Migrate

(Oracle)

Rebind Packages

(DB2 LUW, DB2 z/OS)

Report (DB2 LUW, DB2 z/OS, Oracle)

P

ACKAGE

B

ODIES

Package Bodies implement the package specification in that the package body includes the definition of every cursor and subprogram declared in the package specification.

Platform availability and Explorer node location

Oracle

Schema > Package Bodies

Creating and editing

While Package Bodies are listed as a separate object in the Datasource Explorer, they are created on the Packages Editor in conjunction with Packages. For more information, see

Package Bodies Editor (Oracle) .

19 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Compile

Report

Create Synonym

Drop

Extract

Migrate

P

ARTITION

F

UNCTIONS

Partition functions are functions that maps the rows of a table or index into partitions based on the values of a specified column. Partition functions are referenced in partition scheme definitions in partitioning indexes or tables.

Platform availability and Explorer node location

SQL Server

Databases > database name > Partition Functions

Creating and editing

See the following topics:

Partition Functions Wizard (SQL Server)

and

Partition Functions Editor (SQL Server)

Available Functionality

DBArtisan offers the following functionality for this object type:

Drop

Extract

Migrate

Report

For related information, see the following topics:

Partition Schemes and

Partition Scheme Wizard (SQL Server)

Index Wizard (SQL Server)

Table Wizard (SQL Server)

P

ARTITION

S

CHEMES

Partition schemes map the partitions of a partitioned table or index to filegroups. The number and domain of the partitions for a partitioned table or index are specified in a partition function definition. Partition scheme definitions are referenced when partitioning indexes or tables.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 191

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

SQL Server

Databases > database name > Partition Schemes

Creating and editing

See the following topics:

Partition Scheme Wizard (SQL Server) and

Partition Schemes Editor (SQL Server)

Available Functionality

DBArtisan offers the following functionality for this object type:

Drop

Extract

Migrate

Next Used Filegroup

Report

For related information, see the following topics:

Partition Functions and

Partition Functions (SQL Server) - Properties

Index Wizard (SQL Server)

Table Wizard (SQL Server)

P

LANS

A Plan is an executable application created in the bind process. It can include one or more packages or debris.

Platform availability and Explorer node location

DB2 z/OS

Schema >Plans

Creating and editing

Plan Wizard (DB2 Z/OS) and

Plans Editor (IBM DB2 Z/OS)

Object actions/operations supported

Drop

Free Plan

Rebind Plans

Report

P

RIMARY

K

EYS

NOTE:

This object is supported by all platforms.

Primary Keys are a set of table columns that can uniquely identify every row of a table.

19 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Primary Keys

Schema >Primary Keys

Databases > database name > Primary Keys

Schema > Primary Keys

Databases > database name > Primary Keys

Databases > database name > Primary Keys

Creating and editing

Primary Key Wizard (DB2 LUW)

and

Primary Keys Editor (IBM DB2 LUW)

Primary Key Wizard (DB2 Z/OS) and

Primary Keys Editor (IBM DB2 Z/OS)

Indexes, Primary Keys, or Unique Keys wizard (MySQL) and

Indexes, Primary Keys, and

Unique Keys editors (MySQL)

Primary Key Wizard (Oracle) and

Primary Keys Editor (Oracle)

Primary Key Wizard (SQL Server)

and

Primary Keys Editor (SQL Server)

Primary Key Wizard (Sybase) and

Primary Keys Editor (Sybase)

Object actions/operations supported

Allocate Extent

(Oracle)

Analyze (Oracle)

Change Status (check constraints)

(Oracle)

Deallocate Unused Space

(Oracle)

Disable Index (SQL Server)

Drop (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Rebuild Index

(Oracle, SQL Server)

Rename (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Reorganize /Reorg (SQL Server)

Report (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 193

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

P

ROCEDURES

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

SQL Server

Sybase

Schema > Procedures

Schema > Procedures

Schema > Procedures

Databases > database name > Procedures

Databases > database name > Procedures

Creating and editing

Procedure Wizard (DB2 LUW)

and

Procedures Editor (IBM DB2 LUW)

Procedure Wizard (DB2 Z/OS)

and

Procedures Editor (IBM DB2 Z/OS)

Procedure Wizard (Oracle) and

Procedures Editor (Oracle)

Procedure Wizard (SQL Server)

and

Procedures Editor (SQL Server)

Procedure Wizard (Sybase) and

Procedures Editor (Sybase)

Object actions/operations supported

Build (DB2 z/OS)

Compile (DB2 LUW, Oracle)

Create Synonym

(Oracle)

Describe (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Drop (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Execute (Oracle, Sybase)

Extract (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Rename (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

For more specific information, see the following topics:

19 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

DB2 z/OS Procedures

Sybase Procedures

Executing Statements Before and After Procedure or Function Creation

DB2

Z

/OS P

ROCEDURES

Only IBM DB2 for OS/390 and z/OS SQL stored procedures created by DBArtisan, or IBM's

Stored Procedure Builder can be retrieved by DBArtisan.

S

YBASE

P

ROCEDURES

Procedures perform procedural logic in your Sybase ASE applications. They are batches of SQL statements that are compiled and stored in the system catalog. Procedures execute faster than embedded SQL statements because they are pre-compiled and have execution plans for use by the optimizer. When you create a procedure, Sybase ASE builds a query tree, which it stores in a system table. When you execute a procedure for the first time, Sybase ASE loads it from the system table, compiles, and optimizes it. Sybase ASE places the resulting query plan in the procedure cache where it remains on a most recently used basis. In addition to better performance, procedures yield other benefits, including easier code maintenance, additional security and reduced network traffic.

NOTE:

DBArtisan also supports extended procedures. For details, see Extended Procedures

.

E

XECUTING

S

TATEMENTS

B

EFORE AND

A

FTER

P

ROCEDURE OR

F

UNCTION

C

REATION

With respect to functions and stored procedures, it can be necessary to have statements executed before and after creation of the procedure or function. This can be useful for example, if you need to create or drop temporary tables used by the function or procedure. DBArtisan supports the use of two tag pairs, ETStart and ETEnd, that let you embed statements in the first comment block of a stored procedure or function. The following shows the expected syntax: create procedure dbo.procname(@a numeric) as

/*

<ETStart>SQL Statement</ETStart>

<ETEnd>SQL Statement</ETEnd>

*/ begin

...

P

ROFILES

Profiles are a mechanism for allocating system and database resources to users. Profiles let you specify limits on:

• Number of sessions

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 195

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

• CPU time

• Connect time

• Idle time

• Logical reads and space in the SGA's shared pool

You can assign profiles to one or more users. The database's default profile and all of its resource limits are assigned to users without a specific profile assignment.

Platform availability and Explorer node location

Oracle

Security > Profiles

Creating and editing

Profile Wizard (Oracle) and

Profiles Editor (Oracle)

Object actions/operations supported

Drop

Extract

Migrate

Report

R

ECYCLE

B

IN

DBArtisan provides basic support for Oracle’s Recycle Bin feature. When enabled, dropped tables, indexes, and associated objects are stored in the Recycle Bin until explicitly purged.

Platform Availability and Explorer node location

Oracle

Schema > Recycle Bin

Creating and editing

The Recycle Bin cannot be created or edited.

Object actions/operations supported

On the Datasource Explorer, selecting the Recycle Bin node has the same effect as issuing a

SHOW RECYCLEBIN statement. The contents of the Recycle Bin are shown in the right pane of the Datasource Explorer.

19 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Related actions include:

Enable Recycle Bin

Flashback Recycle Bin Entry

Purge Recycle Bin

Purge Recycle Bin Entry

NOTE:

Select * From functionality is supported as a right-click option for individual tables in the Recycle Bin. For details on this feature, see

Select * From

.

R

EDO

L

OG

G

ROUPS

Redo Logs save information on the state of the database after an update. If the database fails before the update is written to the datafiles, the update can be re-done, bringing the changes back after a crash, so it appears the update did happen.

TIP:

Have sufficient redo logs available so that other Oracle threads do not have to wait until one is free before performing an update.

Redo logs are arranged in groups, and when a particular group is being written to, each member receives the same data.

TIP:

To avoid crashes, have two logfiles in a group, each one being on a different (physical) disk.

Platform availability and Explorer node location

Oracle

Storage > Redo Log Groups

Creating and editing

Redo Log Group Wizard (Oracle) and

Redo Log Groups Editor (Oracle)

Object actions/operations supported

Drop

Take Checkpoint

Extract

Migrate

Report

Switch Logfile

R

EMOTE

S

ERVERS

Remote Servers are servers on a network that you can access through your local server. Instead of logging directly into a remote server, you can log into your local server and execute a remote procedure call to it.

The local server routes all commands to the remote server. To communicate with a remote server, you log into a local server and submit your remote procedure calls for remote servers.

The remote server receives remote procedure calls from the local server and processes them accordingly.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 197

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

SQL Server

Sybase

Security > Remote Servers

Security > Remote Servers

Creating and editing

Remote Server Wizard (SQL Server) and

Remote Servers Editor (SQL Server)

Remote Server Wizard (Sybase) and

Remote Servers Editor (Sybase)

Object actions/operations supported

DB2 LUW DB2 z/OS Interbase

Firebird

Drop

Extract

Migrate

Report

MySQL Oracle SQL Server Sybase

9

9

9

9

9

9

9

9

R

OLES

Roles are sets of user privileges you associate with access to objects within a database. Roles streamline the process of granting permissions. You can use roles to grant sets of permissions and privileges to users and groups.

Platform availability and Explorer node location

Oracle

SQL Server

Sybase

Security > Roles

Databases > database name > Roles (and Security > Server Roles)

Security > Roles

Creating and editing

Role Wizard (SQL Server)

and

Roles Editor (SQL Server)

Role Wizard (Oracle) and

Roles Editor (Oracle)

Role Wizard (Sybase)

and

Roles Editor (Sybase)

Object actions/operations supported

Drop (Oracle, SQL Server, Sybase)

Extract (Oracle, SQL Server, Sybase)

19 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Migrate

(Oracle, SQL Server, Sybase)

Report (Oracle, SQL Server, Sybase)

For related information

Microsoft SQL Server Roles

Oracle Roles

Sybase ASE Roles

Server Roles

M

ICROSOFT

SQL S

ERVER

R

OLES

Roles let you manage permissions for users to perform a set of activities based on job functions.

Roles are a mechanism for streamlining the assignment of object and system privileges to multiple users. Instead of granting sets of privileges to individual users, you can create a role, grant system and object privileges to that role, and then grant that role to all the users who should share the same privileges. You can grant one or more roles to the same user. Therefore, if you need to change the permissions for a certain role you can do so, and not have to grant or revoke the permissions for each individual user.

For related information, see Server Roles

.

O

RACLE

R

OLES

Roles are a mechanism for streamlining the assignment of object and system privileges to multiple users. Instead of granting sets of privileges to individual users, you can create a role, grant system and object privileges to that role, then simply grant that role to all the users who should share the same privileges. You can grant one or more roles to the same user.

DBMS-specific functionality

• For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

S

YBASE

ASE R

OLES

Roles are a mechanism for streamlining the assignment of object and system privileges to multiple users. Instead of granting sets of privileges to individual users, you can create a role, grant system and object privileges to that role, then simply grant that role to all the users who should share the same privileges. You can grant one or more roles to the same user.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 199

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

DBMS-specific functionality

• For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

R

OLLBACK

S

EGMENTS

Rollback segments manage all transactions in your Oracle databases. They maintain read consistency among concurrent users in a database and can rollback transactions. They are transaction logs that maintain discrete records of changes to data. By maintaining a history of data changes, rollback segments can rollback uncommitted transactions so that data is rolled back to their prior state.

TIP:

Databases with large user bases and intensive data manipulation characteristics can benefit from having multiple rollback tablespaces that are placed on different server drives or file systems. This strategy aids in the reduction of I/O and rollback segment contention.

Because all changes are logged to a rollback segment, they can become a performance bottleneck as the number of concurrent users and transaction activity increases. You can tune rollback segment performance by creating additional ones to handle increased traffic. To determine whether rollback segment performance is satisfactory, you should monitor the ratio of gets to waits. If you see that the number of waits is climbing, create another rollback segment to further spread concurrency.

NOTE:

The analysis for determining when to add a rollback segment can be quite complicated. As a rule-of-thumb, however, many DBAs simply plan on allocating a rollback segment for every four concurrent users.

The proper sizing of rollback segments is critical to their overall performance. Performance degrades whenever a rollback segment must extend, wrap or shrink in response to transaction loads. Ideally, you want to make their extents as small as possible while ensuring that each transaction fits into a single extent, which in practice is very difficult to achieve.

NOTE:

You should carefully monitor each rollback segments for the occurrence of extends, wraps and shrinks. If you see a high level of extends and wraps, then the rollback segment is probably too small. If you see a high level of shrinks, then you should increase the rollback segment's optimal size.

Platform availability and Explorer node location

Oracle

Storage > Rollback Segments

Creating and editing

Rollback Segment Wizard (Oracle) and

Rollback Segments Editor (Oracle)

20 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Drop

Shrink

Extract

Migrate

Report

Set Online/Offline

R

ULES

Rules promote data integrity by allowing you to validate the values supplied to a table column.

They are reusable objects that you can bind to table columns or user datatypes. For example, you can create a rule, bind it to a column in a table and have it specify acceptable values that can be inserted into that column.

Platform availability and Explorer node location

SQL Server

Sybase

Databases > database name > Rules

Databases > database name > Rules

Creating and editing

Rule Wizard (SQL Server) and

Rules Editor (SQL Server)

Rule Wizard (Sybase) and

Rules Editor (Sybase)

Object actions/operations supported

Drop (SQL Server, Sybase)

Extract (SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(SQL Server, Sybase)

Rename (SQL Server, Sybase)

Report (SQL Server, Sybase)

S

CHEMA

A Schema is a container of objects that can be owned by any user.

NOTE:

The Schema nodes available under DB2 LUW, DB2 z/OS, and Oracle datasources do not own a specific set of objects. They are simply an organizational container for all database objects for a datasource or database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 201

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

SQL Server

Databases > Schema

Creating and editing

Schema Wizard (SQL Server) and

Schemas Editor (SQL Server)

Object actions/operations supported

Drop

Extract

Migrate

Report

S

EGMENTS

NOTE:

This object is supported by Sybase only.

Segments are a mechanism for placing tables and indexes on specific logical partitions. You create segments on one or more fragments of a database. You can map segments to specific database fragments, which in turn reside on specific hard disks; and, mapping segments lets you increase i/o throughput by placing intensively used tables and indexes on different physical devices. You can allocate tables and indexes to segments by including placement statements at the end of CREATE TABLE or CREATE INDEX statements.

Platform availability

Platform availability and Explorer node location

Sybase

Databases > database name > Segments

Creating and editing

Segment Wizard (Sybase) and

Segments Editor (Sybase)

20 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Drop

Extract

Migrate

Report

S

EQUENCES

Sequences are programmable database objects that generate a definable sequence of values.

Once defined, a sequence can be made available to many users. A sequence can be accessed and incremented by multiple users with no waiting. A sequence can be used to automatically generate primary key values for tables. When you create a sequence, you can define its initial value, increment interval and maximum value.

Platform availability and Explorer node location

DB2 LUW

Oracle

Schema > Sequences

Schema > Sequences

Creating and editing

Sequence Wizard (DB2 LUW) and

Sequences Editor (IBM DB2 LUW)

Sequence Wizard (Oracle) and

Sequences Editor (Oracle)

Object actions/operations supported

Create Alias

(DB2 LUW)

Create Synonym

(Oracle)

Drop (DB2 LUW, Oracle)

Extract (DB2 LUW, Oracle)

Migrate

(DB2 LUW, Oracle)

Rename (DB2 LUW, Oracle)

Report (DB2 LUW, Oracle)

Restart (DB2 LUW)

Transfer Ownership (DB2 LUW)

S

ERVER

R

OLES

DBArtisan lets you manage the login members for each of SQL Server’s fixed server roles: bulkadmin, dbcreator, diskadmin, processadmin, securityadmin, serveradmin, setupadmin, and sysadmin.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 203

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

SQL Server

Security > Server Roles

Creating and editing

Server Roles Editor (SQL Server)

NOTE:

Server roles are fixed and cannot be created.

S

ERVER

T

RIGGERS

A server trigger implements a server-scope DDL trigger. These triggers fire in response to events associated with DDL statements or specifically to logons.

NOTE:

This functionality is available for SQL Server 2005 and up.

NOTE:

Before working with server triggers, consult Microsoft SQL Server documentation for a general understanding of DDL triggers. For more information, see

Accessing Third

Party Documentation .

Platform availability and Explorer node location

SQL Server 2005 ^

Server > Server Triggers

Creating and editing

Server Triggers Wizard (SQL Server) and

Server Triggers Editor (SQL Server)

Object actions/operations supported

Change Status

Drop

Extract

Migrate

Report

Related information

Database Triggers

S

TOGROUPS

Stogroups are storage groups, named sets of volumes on which DB2 for OS/390 data is stored.

When you select the Stogroups node of the Datasource Explorer, DBArtisan lists pertinent information about each of them in the right pane.

20 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

DB2 z/OS

Storage > Stogroups

Creating and editing

See the following topics:

Stogroup Wizard (DB2 Z/OS) and

Stogroups Editor (IBM DB2 Z/OS)

Object actions/operations supported

Drop

Extract

Migrate

Report

S

TRUCTURED

T

YPES

Structured types define an abstract data type or object composed of a collection of similar types of data. For example, create an structured type that defines a full address rather than the pieces of an address, such as city, state and postal code. An structured type stores the pieces of an address in a single type, storing them in the same location and allowing the full address to be accessed and manipulated as single unit rather than multiple units.

Structured types are useful for ensuring uniformity and consistency as they are defined as single encapsulated entity that can be reused in other structured types and objects. They also offer flexibility by allowing for the creation of objects that represent real-world situations which is limited in relational objects.

Platform availability and Explorer node location

DB2 LUW

Schema > Structured Types

Creating and editing

Structured Type Wizard (DB2 LUW) and

Structured Types Editor (IBM DB2 LUW)

Object actions/operations supported

Drop

Extract

Migrate

Report

Transfer Ownership

S

YNONYMS

The function and usage of synonyms differs by DBMS platform

DB2 z/OS

An alternate name for an existing table, view, or alias.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 205

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Oracle

SQL Server

An alternative name for a table, view, sequence, procedure, function, package, materialized view, java class, type, or another synonym.

A single-part name used to reference multi-part names in SQL statements. While synonyms can be created for functions, procedures, tables, and views, consult Microsoft

SQL Server documentation for restrictions on function and procedure support. For more

information, see Accessing Third Party Documentation

.

Platform availability and Explorer node location

DB2 z/OS

Oracle

SQL Server

Schema > Synonyms

Schema > Synonyms

Databases > database name > Synonyms

Creating and editing

Synonym Wizard (DB2 Z/OS)

and

Synonyms Editor (IBM DB2 Z/OS)

Synonym Wizard (Oracle) and

Synonyms Editor (Oracle)

Synonym Wizard (SQL Server)

and

Synonyms Editor (SQL Server)

Object actions/operations supported

Create Synonym

(Oracle)

Describe (Oracle)

Drop (DB2 z/OS, Oracle, SQL Server)

Extract (DB2 z/OS, Oracle, SQL Server)

Migrate

(DB2 z/OS, Oracle, SQL Server)

Rename (Oracle, SQL Server)

Report (DB2 z/OS, Oracle, SQL Server)

T

ABLES

Tables are a the basic unit of data storage. Tables store all the data accessible to users in rows and columns. Each column has a name, datatype and other associated properties. After you define a table, users can insert valid data into the table, which you can later query, update and delete.

NOTE:

DBArtisan separates system tables from user-defined tables in the Datasource Explorer to ensure that system tables are not accidentally altered or dropped.

20 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Tables

Schema > Tables (and Databases > databasename > Tables)

Databases > database name > Tables

Schema > Tables

Databases > database name > Tables

Databases > database name > Tables

Creating and editing

Table Wizard (DB2 LUW) and

Tables Editor (IBM DB2 LUW)

Table Wizard (DB2 Z/OS)

and Tables Editor (IBM DB2 Z/OS)

Tables wizard (MySQL) and

Tables editor (MySQL)

Table Wizard (Oracle)

and

Tables Editor (Oracle)

Table Wizard (SQL Server) and

Tables Editor (SQL Server)

Table Wizard (Sybase) and

Tables Editor (Sybase)

Object actions/operations supported

Allocate Extent

(Oracle)

Analyze (Oracle)

Analyze Tables

(MySQL)

Build Query (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Change Access Status

(Oracle)

Check Tables

(MySQL)

Checksum Tables (MySQL)

Convert Tables (MySQL)

Create Alias

(DB2 LUW, DB2 z/OS)

Create Clone

(DB2 z/OS)

Create Insert Statements

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Create Like (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Create Synonym

(Oracle)

Create View

(DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

DBCC (SQL Server, Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 207

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Deallocate Unused Space

(Oracle)

Delete Statistics

(Sybase)

Describe (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Disable Keys

(MySQL)

Drop (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Drop Clone (DB2 z/OS)

Drop Unused Columns (Oracle)

Edit Data

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Enable Keys (MySQL)

Disable/Enable Triggers (SQL Server, Sybase)

Estimate Size

(Oracle, Sybase)

Exchange Data With Clone

(DB2 z/OS)

Extract (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Extract Data as XML (Oracle, SQL Server, Sybase)

Flashback Table (Oracle)

Flush Tables (MySQL)

Hide Text

(Sybase)

Import Data From File (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Lock (DB2 LUW, DB2 z/OS)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Optimize Tables (MySQL)

Place

(Sybase)

Quiesce Tablespaces

(DB2 LUW)

Rebuild Table (MySQL)

Recompile (SQL Server, Sybase)

Rename (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Reorganize /Reorg (DB2 LUW, Oracle, Sybase)

Repair Tables

(MySQL)

Report (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Runstats Tablespace (DB2 z/OS)

Schema (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

20 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Select * From

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Set Integrity (DB2 LUW)

Shrink (Oracle)

Transfer Ownership (DB2 LUW)

Truncate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Update Statistics (DB2 LUW, SQL Server, Sybase)

DBMS platform-specific notes

MySQL MySQL servers can store tables in multiple formats, including MyISAM and InnoDB.

MyISAM tables (ISAM is the acronym for indexed sequential access method) are used most often for read operations. The read operation is very fast, but you cannot include any referential integrity, such as a foreign key. Also, MyISAM tables only issue table-level locks. InnoDB tables, on the other hand, do permit transactions and foreign key constraints. InnoDB tables also lock data at the row level, which is appropriate for high transaction tables. Additional table types available are MERGE, MEMORY, FEDERATED, and ARCHIVE among others.

For a complete discussion of table types, go to the MySQL documentation of table and engine types. For more information, see

Accessing Third Party Documentation .

T

ABLESPACES

Tablespaces are storage structures that act as partitions for the database. You can create a tablespace to store table data and other objects related to table performance such as indexes or large object data. Tablespaces are used to manage large complex databases. Once you have created a tablespace, you can place objects on it.

TIP:

Create separate tablespaces for your tables and indexes and put each tablespace on a different drive or file system. Segmenting tables and their corresponding indexes in this manner helps eliminate I/O contention at the server level.

NOTE:

IBM DB2 for Linux, Unix, and Windows lets you assign a location for table or index data directly to physical storage devices. Each tablespace can also be broken down into a collection of containers which are the actual physical storage files or devices. You can then spread the data or database objects across multiple file systems, thereby giving you the necessary space for objects that require it.

Once you have created a tablespace, you can place individual tables and indexes on it. Because tablespaces map to physical drives, you can improve i/o performance by placing tables and their indexes on physically separated table spaces.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 209

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

Storage > Nodegroups

Storage > Tablespaces

Storage > Tablespaces

Creating and editing

Tablespace Wizard (DB2 LUW) and

Tablespaces Editor (IBM DB2 LUW)

Tablespace Wizard (DB2 Z/OS) and

Tablespaces Editor (IBM DB2 Z/OS)

Tablespace Wizard (Oracle) and

Tablespaces Editor (Oracle)

Object actions/operations supported

Change Status (Oracle)

Check Data (DB2 z/OS)

Check Index (DB2 z/OS)

Coalesce

(Oracle)

Copy to Copy (DB2 z/OS)

Drop (

DB2 LUW,

DB2 z/OS, Oracle)

Extract (

DB2 LUW,

DB2 z/OS, Oracle)

Merge Copy (DB2 z/OS)

Migrate

(

DB2 LUW,

DB2 z/OS, Oracle)

Modify Recovery (DB2 z/OS)

Modify Statistics

(DB2 z/OS)

Quiesce Tablespaces

(DB2 z/OS)

Rebuild Index

(DB2 z/OS)

Recover (DB2 z/OS)

Rename (

DB2 LUW,

Oracle)

Reorganize /Reorg (DB2 z/OS)

Report (

DB2 LUW,

DB2 z/OS, Oracle)

Runstats Index (DB2 z/OS)

Runstats Tablespace (DB2 z/OS)

Set Default (Oracle)

Set UNDO

(Oracle)

21 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Start Database

(DB2 z/OS)

Stop Database

(DB2 z/OS)

Switch Online (

DB2 LUW)

Transfer Ownership (

DB2 LUW)

T

RIGGERS

Triggers are a special type of procedure that automatically fire when defined data modification operations (insert, update, or delete) occur on a target table or view. Trigger support in

DBArtisan differs by DBMS type, but in general offers options such as:

• Standard INSERT/DELETE/UPDATE event support

• BEFORE/AFTER timing control

• Row/statement trigger type control

• INSTEAD OF triggers

• Enabled/disabled status options

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

SQL Server

Sybase

Schema > Triggers

Schema > Triggers (and Databases > databasename > Triggers)

Schema > Triggers

Databases > database name > Triggers

Databases > database name > Triggers

Creating and editing

Trigger Wizard (DB2 LUW)

and

Triggers Editor (IBM DB2 LUW)

Trigger Wizard (DB2 Z/OS) and

Triggers Editor (IBM DB2 Z/OS)

Trigger Wizard (Oracle) and

Triggers Editor (Oracle)

Trigger Wizard (SQL Server)

and

Triggers Editor (SQL Server)

Trigger Wizard (Sybase)

and

Triggers Editor (Sybase)

Object actions/operations supported

Change Status (SQL Server, Sybase)

Compile (Oracle)

Drop (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 211

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Extract (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

T

YPES

Types define an abstract data type or object composed of a collection of similar types of data.

For example, create an object type that defines a full address rather than the pieces of an address, such as city, state and postal code. An object type stores the pieces of an address in a single type, storing them in the same location and allowing the full address to be accessed and manipulated as single unit rather than multiple units.

Object types are useful for ensuring uniformity and consistency as they are defined as single encapsulated entity that can be reused in other object types and objects. They also offer flexibility by allowing for the creation of objects that represent real-world situations which is limited in relational objects.

You can choose to create a type that is incomplete, complete, a VARRAY, or a nested table or any combination of the above. An incomplete type specifies no attributes and can be used for circular references such as person - female. It lets the type be referenced before it is complete.

The VARRAY type can be used to store small sets of related data. For example, if you have ten offices (each one with a different description) at a particular division in your company, you could create a VARRAY of 10 to hold the details of these offices. The values for a VARRAY type must be fixed and known and small values as they are stored in RAW format. A nested table type can be used when data is repeated for the same entity an unknown number of times and storage is a concern.

Platform availability and Explorer node location

Oracle

Schema > Types

Creating and editing

Object Type Wizard (Oracle) and

Types Editor (Oracle)

21 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Object actions/operations supported

Compile

Drop

Extract

Migrate

Report

T

YPE

B

ODIES

Type Bodies implement object type specification by containing the definition of every cursor and subprogram declared in the object type specification. While Type Bodies are listed as a separate object in the Datasource Explorer, they are created on the Types editor in conjunction with Types.

Platform availability and Explorer node location

Oracle

Schema > Type Bodies

Creating and editing

While listed as separate objects in the Datasource Explorer, type bodies are created and edited

on the Body tab of the Types Editor. For details, see Types Editor (Oracle)

.

Object actions/operations supported

Compile

Drop

Extract

Migrate

Report

U

NIQUE

K

EYS

Unique keys can enforce logical keys that are not chosen as the primary key. They enforce uniqueness for specified columns in a table.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Schema > Unique Keys

Schema > Unique Keys (and Databases > databasename > Unique Keys)

Databases > database name > Unique Keys

Schema > Unique Keys

Databases > database name > Unique Keys

Databases > database name > Unique Keys

Creating and editing

Unique Key Wizard (DB2 LUW) and

Unique Keys Editor (IBM DB2 LUW)

Unique Key Wizard (DB2 Z/OS) and

Unique Keys Editor (IBM DB2 Z/OS)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 213

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

Indexes, Primary Keys, or Unique Keys wizard (MySQL) and

Indexes, Primary Keys, and

Unique Keys editors (MySQL)

Unique Key Wizard (Oracle) and

Unique Keys Editor (Oracle)

Unique Key Wizard (SQL Server) and

Unique Keys Editor (SQL Server)

Unique Key Wizard (Sybase) and

Unique Keys Editor (Sybase)

Object actions/operations supported

Allocate Extent

(Oracle)

Analyze (Oracle)

Change Status (Oracle)

Deallocate Unused Space

(Oracle)

Disable Index (SQL Server)

Drop (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Rebuild Index

(Oracle, SQL Server)

Rename (DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Reorganize /Reorg (SQL Server)

Report (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

U

SER

D

ATATYPES

User-defined datatypes promote domain consistency by streamlining the definition of commonly used table columns in a database. You can build a customized datatype from system datatypes and bind defaults and rules to it to enhance integrity. When you reference the user datatype in a column, the column assumes all of the properties of the user datatype.

21 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

SQL Server

Sybase

Schema > User Datatypes

Schema > User Datatypes

Databases > database name > User Datatypes

Databases > database name > User Datatypes

Creating and editing

User Datatype (DB2 LUW)

and

User Datatypes Editor (IBM DB2 LUW)

User Datatype Wizard (DB2 Z/OS)

and

User Datatypes Editor (IBM DB2 Z/OS)

User Datatype Wizard (SQL Server)

and User Datatypes Editor (SQL Server)

User Datatype Wizard (Sybase)

and

User Datatypes Editor (Sybase)

Object actions/operations supported

Drop (DB2 LUW, DB2 z/OS, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, SQL Server, Sybase)

Migrate

(DB2 LUW, DB2 z/OS, SQL Server, Sybase)

Rename (SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

U

SER

M

ESSAGES

User Messages lets you catalog error messages that your database applications can re-use.

Microsoft SQL Server stores your error messages in a system table, sysmessages. To return error messages from stored procedures and triggers, you need to call a system stored procedure and pass an error number as a parameter.

NOTE:

On SQL Server, User Messages can only be accessed from the master database for a specific server.

Platform availability and Explorer node location

SQL Server

Sybase

Databases > database name > User Messages

Databases > database name > User Messages

Creating and editing

User Message Wizard (SQL Server) and

User Messages Editor (SQL Server)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 215

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

User Message Wizard (Sybase) and

User Messages Editor (Sybase)

Object actions/operations supported

Drop (SQL Server, Sybase)

Extract (SQL Server, Sybase)

Migrate

(SQL Server, Sybase)

Report (SQL Server, Sybase)

U

SERS

A user is an individual with access to the DBMS.

Platform availability

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

MySQL

Oracle

SQL Server

Sybase

Security > Users

Security > Users

Security > Users (and Databases > database name > Users)

Security > Users

Databases > database name > Users

Databases > database name > Users

Creating and editing

User Wizard (DB2 LUW) and

Users Editor (IBM DB2 LUW)

User Wizard (DB2 Z/OS) and

Users Editor (IBM DB2 Z/OS)

Users wizard (MySQL) and

Users editor (MySQL)

User Wizard (Oracle) and

Users Editor (Oracle)

User Wizard (SQL Server) and

Users Editor (SQL Server)

User Wizard (Sybase) and

Users Editor (Sybase)

Object actions/operations supported

Analyze (Oracle)

Change Password (DB2 z/OS, MySQL, Oracle)

Compile (Oracle)

21 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

Create Like (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Drop (DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Extract (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Report (DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, Sybase)

Transfer Ownership (DB2 LUW)

Related information

• IBM DB2 for Linux, Unix, and Windows Users

• IBM DB2 for OS/390 and z/OS Users

• Microsoft SQL Server Users

• MySQL Users

• Oracle Users

• Sybase ASE Users

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

U

SERS

IBM DB2 for Linux, Unix, and Windows relies on your machine’s operating system to define users for the server. You create and maintain users through your operating system.

NOTE:

DBArtisan lets you set a default SQLID user for a DB2 data source. This lets the user set the implicit schema for the unqualified object references to a schema different from the user's login id.

IBM DB2

FOR

OS/390

AND Z

/OS U

SERS

IBM DB2 relies on the operating system you are running to define users for the server. This means that users are created and maintained through your operating system.

NOTE:

DBArtisan lets you set a default SCHEMA user for a DB2 data source. This lets the user set the implicit schema for the unqualified object references to a schema different from the user's login id.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 217

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

M

ICROSOFT

SQL S

ERVER

U

SERS

Microsoft SQL Server controls access at the database level by requiring the System

Administrator or Database Owner to add a login as a database user or alias. After you create a database user, you can implement further security by the granting or revoking the privileges for that user on specific database objects. To consolidate the process of granting or revoking permissions to many users, the database owner can assign users to groups.

M

Y

SQL U

SERS

Unlike adding new users to other platforms, MySQL doesn’t rely solely on a userid/password combination. The MySQL server must not only validate the user and password, but also the host from which the connection is being requested before the new user is admitted to the server’s inner sanctum. The DBArtisan User Wizard and User Editor enable these validations.

O

RACLE

U

SERS

To access an Oracle database, you need a user account authenticated with a password. A user account is what Oracle uses to permit access by the user. You can assign the following optional properties to the user:

• Default tablespace

• Temporary tablespace

• Quotas for allocating space in tablespaces

• Profile containing resource limits

S

YBASE

ASE U

SERS

Sybase ASE controls access at the database level by requiring the System Administrator or

Database Owner to add a login as a database user or alias. After you create a database user, you can implement further security by granting or revoking the privileges for that user on specific database objects. To consolidate the process of granting or revoking permissions to many users, the database owner can assign users to groups.

V

IEWS

Views are SQL queries stored in the system catalog that customize the display of data contained in one or more tables. Views behave like tables because you can query views and perform data manipulation operations on them. However, views do not actually store any data. Instead, they depend on data contained in their base tables. Views let you:

• View a customized selection of data from one or more tables. As a result, you can display data more cogently to different sets of users, even though the underlying data is the same.

21 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S U PP O R T E D O B JEC TS > S U P P O R T E D O B JE C T S

• Restricting access to a defined set of rows and columns.

Platform availability and Explorer node location

DB2 LUW

DB2 z/OS

Oracle

SQL Server

Sybase

Schema > Views

Schema > Views (and Databases > databasename > Views)

Schema > Views

Databases > database name > Views

Databases > database name > Views

Creating and editing

View Wizard (DB2 LUW)

and

Views Editor (IBM DB2 LUW)

View Wizard (DB2 Z/OS)

and

Views Editor (IBM DB2 Z/OS)

View Wizard (Oracle) and

Views Editor (Oracle)

View Wizard (SQL Server)

and

Views Editor (SQL Server)

View Wizard (Sybase)

and

Views Editor (Sybase)

Object actions/operations supported

Build Query (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Compile (

Oracle)

Create Alias

(

DB2 LUW, DB2 z/OS)

Create Synonym

(

DB2 z/OS, Oracle)

Describe (

DB2 LUW, Oracle, SQL Server, Sybase)

Drop (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Extract (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Generate Package/Procedure/Statement (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Hide Text

(Sybase)

Migrate

(

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Rename (

Oracle, SQL Server, Sybase)

Report (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Schema (

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Select * From

(

DB2 LUW, DB2 z/OS, Oracle, SQL Server, Sybase)

Transfer Ownership (

DB2 LUW)

Update Statistics (

DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 219

SU PPORTE D O BJE CTS > SU PPOR T ED O BJ ECTS

22 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

C

REATING OBJECTS

DBArtisan offers easy-to-use wizards and dialog boxes for creating objects. For an introduction

to object creation wizards, see Overview and Common Usage of Object Wizards

.

Platform-by-platform discussions of wizards are discussed as follows:

IBM DB2 for Linux, Unix, and Windows Object Wizards

IBM DB2 for z/OS Object Wizards

Microsoft SQL Server Object Wizards

MySQL object wizards

Oracle Object Wizards

Sybase ASE Object Wizards

O

VERVIEW AND

C

OMMON

U

SAGE OF

O

BJECT

W

IZARDS

An object wizard lets you create new database and server objects on a datasource. For example, a Tables wizard lets you create columns, set up permissions to work with that table, provide details on physical storage for the table, and so on. Each pane on an object wizard lets you perform a logical task or collection of logical tasks for that object type. For example:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 221

C RE A T I N G O B J E C TS

In order to work with object wizards, you must know how to:

Open an Object Wizard

for a server or database object.

Navigate and Set Properties in an Object Wizard

Create the New Object

.

O

PEN AN

O

BJECT

W

IZARD

Object wizards are accessed from the Datasource Explorer pane of the DBArtisan main window.

To open an Object wizard for a server or database object

1 Connect to the datasource where you want to create a new resource. For more information, see

Datasource Management .

2 On the Datasource Explorer, expand the target datasource.

3 Continue to expand folders under the datasource until the type of object you want to create is visible.

22 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

4 On the Datasource Explorer, right-click on the specific type of object that you want to create and select Create from the context menu.

DBArtisan opens the object wizard for that object type.

N

AVIGATE AND

S

ET

P

ROPERTIES IN AN

O

BJECT

W

IZARD

When you invoke an object wizard, it opens on the first pane of the wizard, typically a Properties pane. As you select options or provide details, you use the navigation buttons at the bottom of the window and the pane controls at the left of the window to navigate through the wizard.

• Use the Next button to move to the next pane of the wizard.

NOTE:

In some cases, the Next button is not activated until required information is provided.

Similarly, some panes of a wizard do not become accessible until activated by choice of an option or property on a previous pane. For example, a Partitions tab in a table wizard may only become available if the Clustered and Number of Partitions options on a prior tab are set accordingly.

• Use the Back button to move to the previous pane of the wizard.

• Use the pane controls at the left of the window to move to a specific pane of the wizard.

A

DD A

C

OMMENT TO AN

O

BJECT

The object wizards for certain object types feature a Comment tab that lets you add an explanatory note to specific object definitions. Comments are stored in the REMARKS column of the object’s system-catalog.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 223

C RE A T I N G O B J E C TS

To add a comment to an object:

1

Open an Object Wizard

on an object type that permits comments. See the topics for specific

Object editors later in this chapter for information on whether that object type supports comments.

2 Click the Comment panel when enabled.

3 In the Comment area, type an explanatory note of up to 254 characters long.

S

ET

P

ERMISSIONS FOR AN

O

BJECT

When you open an Object wizard to create an object with associated privileges, the Permissions

(or Privileges or Object Permissions or System Permissions) panel for that editor displays the relevant privileges and lets you make changes accordingly:

To set permissions for an object:

1

Open an Object Wizard on an object type with associated permissions or privileges. See the

topics for specific Object wizards later in this chapter for information on whether that object type supports permissions/privileges.

2 Click the Permissions (Privileges, Object Permissions or System Permissions) panel when enabled.

3 For each specific permission to be granted to an entity such as a user, login, or group, select the cell corresponding to the entity and specific permission, and click the Grant button. To revoke a privilege, select a cell showing a Granted permission and click Revoke.

C

REATE THE

N

EW

O

BJECT

The final pane or tab of a wizard or editor is most commonly designated DDL View or

Definition.

• A DDL View tab/panel lets you view the DDL generated by your selections on the other tabs/panels of the wizard or editor.

• A Definition tab/panel is only available for objects such as triggers and procedures, for which you must provide the additional SQL statements that provide the actions taken for that object.

22 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

In most cases you arrive at DDL View or Definition by navigating through panes or tabs, choosing options as you proceed. Alternatively, if you have provided all required information for that object type, you can click Finish or Execute to create the object.

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

O

BJECT

W

IZARDS

DBArtisan lets you create DB2 LUW objects using the following wizards:

• Alias Wizard (DB2 LUW)

• Bufferpool Wizard for IBM DB2 (IBM DB2 LUW)

• Database Wizard (IBM DB2 LUW)

• Event Monitor Wizard (DB2 LUW)

• Foreign Key Wizard (IBM DB2 LUW)

• Function Wizard (IBM DB2 LUW)

• Group Wizard (DB2 LUW)

• Index Wizard (DB2 LUW)

• Materialized Query Table Wizard (DB2 LUW)

• Nodegroup Wizard (DB2 LUW)

• Primary Key Wizard (DB2 LUW)

• Procedure Wizard (DB2 LUW)

• Schema Wizard (DB2 LUW)

• Sequence Wizard (DB2 LUW)

Structured Type Wizard (DB2 LUW)

• Table Wizard (DB2 LUW)

• Tablespace Wizard (DB2 LUW)

• Trigger Wizard (DB2 LUW)

• Unique Key Wizard (DB2 LUW)

• User Datatype (DB2 LUW)

• User Wizard (DB2 LUW)

• View Wizard (DB2 LUW)

In addition, see Create Synonym

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 225

C RE A T I N G O B J E C TS

A

LIAS

W

IZARD

(DB2 LUW)

An alias offers you security and convenience so that you can refer to an object without revealing who owns it or what database it belongs to. You can create aliases for tables, views, and even other aliases. The Alias Wizard lets you create an alias without knowing the underlying commands. As you complete the Alias Wizard process, DBArtisan constructs the necessary

CREATE ALIAS statement based on the information that you supply.

To create a new alias using a wizard:

1

Open an Object Wizard

for an alias.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details see

Aliases (DB2 LUW) - Properties .

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

Aliases (DB2 LUW) - Properties

When creating or editing an alias, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Target Owner

Target Type

Target Name

Description

Select the schema that is to own the alias.

Provide a name for the alias

Select the owner of the object to which you are creating an alias.

Select the type of object to which you want to create an alias.

Select the specific object to which you are creating an alias.

B

UFFERPOOL

W

IZARD FOR

IBM DB2 (IBM DB2 LUW)

The Bufferpool Wizard lets you create a bufferpool (an area of memory where data pages are read, altered, and held during an operation) without knowing the underlying commands. As you complete the Bufferpool Wizard, DBArtisan constructs the necessary CREATE BUFFERPOOL statement based on the information that you supply. Note that the bufferpool you’re creating to store the data from the tables in selected database won’t be active until you restart the database.

The Bufferpool Wizard lets you:

• Name the tablespace and specify the size of the bufferpool.

• Set storage options for UNIX systems.

22 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• Set Bufferpool disbursement parameters.

• Override the default bufferpool size for partitions (or nodes).

To Open the Bufferpool Wizard

1 On the Explorer, find the database where you want to add the new bufferpool.

2 On the Buffer Pools branch of the Performance node, right-click and select New.

3 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Buffer Pools (DB2 LUW) - Properties .

Nodegroups panel - for details, see Buffer Pools (DB2 LUW) - Nodegroups .

Partitions panel - for details, see Buffer Pools (DB2 LUW) - Partitions .

DDL View panel - for details, see

Create the New Object

.

4 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

B

UFFER

P

OOLS

(DB2 LUW) - P

ROPERTIES

When creating or editing a buffer pool, this tab/panel lets you work with the following settings:

Setting

Create deferred

Pagesize

Automatic Size

Number of Pages

No. of Block Pages and

Block Size

Description

Lets you defer changes until the next database activation.

The page size, in KB, is available in the increments 4, 8, 16, or 32.

Enables automatic size adjustment to account for workload.

Indicate the number of pages you want to include in the new bufferpool. If the database is partitioned database, the default size is of all the partitions (or nodes) where the bufferpool exists. A value of -1, the default, means the size will be taken from the database configuration parameter (BUFFPAGE).

Lets you specify NUMBLOCKPAGES and BLOCKSIZE values used when creating or modifying buffer pools.

Buffer Pools (DB2 LUW) - Nodegroups

Lets you select the Nodegroups on which to create the buffer pool. For more information, see

Nodegroup Wizard

(DB2 LUW) .

Buffer Pools (DB2 LUW) - Partitions

Lets you modify the default size of assocaited partitions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 227

C RE A T I N G O B J E C TS

D

ATABASE

W

IZARD

(IBM DB2 LUW)

The Database Wizard lets you create a database (a structured collection of data that can be updated or queried) without knowing the underlying commands. Databases can be simple, that is one file with many records and the same fields, or much more complicated with multiple files with different fields.

To open the IBM DB2 for Linux, Unix, and Windows Database Wizard

On the Registration tool bar, click New UDB Database.

OR

On the Datasource Explorer, right-click an instance node or the Datasources node, and then click New UDB Database.

The tables below describe the fields you may encounter as you complete the wizard.

Naming the New Database

Required Information

What is the name of the database?

What is the datasource name for the new database?

Each datasource should have a unique name. This is the name that will appear on the Explorer.

What is the alias name of the database.

Description

Each database requires a unique name. The database name should be between 1 - 8 characters and must begin with a letter A-Z. It’s wise to avoid the symbols @, #, and $ if the database will exist in a communications environment or be summoned from an area where those characters do not exist in the language (and hence, on a keyboard).

What is the comment used for the database?

OPTIONAL: A database alias is the local synonym given to the database you are creating, and must be unique. If you don’t assign an alias, the database name becomes the default alias.

Note that a DB2 client can have connections to two different databases with the same name if those databases live on different servers and each database has its own alias.

OPTIONAL: Lets you type a comment up to 30 characters. Any comment you enter can be changed later.

Drive Path and Parameters

Required Information

On what drive/path will the database reside?

Description

OPTIONAL: Leave blank if you want DBArtisan to create the database using the

DFTBPATH (default database path configuration) parameter.

22 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

What default tablespace parameters should be used?

What global default parameters should the database use?

Finish

Description

OPTIONAL

Extent size: This is the number of pages of table data that will be written before data is written to the next container.

Number of segments: The default is 0. The number you designate specifies the number of extended memory segments available for the database to use. You should only set this number if you have a large amount of real memory.

Territory: The territory where the database was created. This is purely informational, for example, en_US and is related to region-specific support.

Codeset: IBM-1252 or UTF-8 are the options for language support.

Collating Sequence: Compatibility, Identity, System are your choices for comparing character data. Note: The collation sequence can’t be changed after the database has been created.

Opens the Preview SQL dialog box.

Add Catalog/Temporary/User Containers

There are three distinct wizard panels, one for each container type, that enable you to customize your database. Click Next or Finish depending on how you want to proceed.

Required Information

What container(s) will be used to store the catalog/ temporary tables?

Description

Use System Managed Space: If you select this option, the operating system’s file system manager allocates and manages the space where the catalog tables are stored. This is the default.

Use Database Managed Space: If you select this option, the database manager controls the storage space for catalog tables.

Add or Edit - For details, see

Add/Edit Container for Tablespace

.

Optionally identify values for extent size, pre-fetch size, transfer rate, and overhead.

What optional default storage parameters should be used.

Finish Opens the Preview SQL dialog box.

A

DD

/E

DIT

C

ONTAINER FOR

T

ABLESPACE

The table below describes the options and functionality on this dialog box:

Required Information

Container Parameters

Directory

File Name

Device Information

Description

These parameters are enabled for modification only if you have opted to use database managed space. When enabled, you can either indicate file size parameters or specify device information.

Identify the directory where the catalog table container will be stored.

Identify a name for the file where the catalog table container will be stored.

Enable either raw partition and type a value, or raw drive, and select a value.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 229

C RE A T I N G O B J E C TS

E

VENT

M

ONITOR

W

IZARD

(DB2 LUW)

An event monitor is used to collect information about a particular database and connected appliances when one or more events you specify take(s) place. Where a snapshot monitor captures information for a given moment in time, the event monitor lets you trace the activity you specify.

The Event Monitor Wizard lets you provide basic properties, select event types, and specify conditions where appropriate, for an event monitor.

To create a new event monitor using a wizard:

1 Open a creation wizard for an event monitor. For details, see Open an Object Wizard .

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Event Monitors (DB2 LUW) - Properties .

Definition panel - for details, see Event Monitors (DB2 LUW) - Definition .

Conditions panel - for details, see Event Monitors (DB2 LUW) - Conditions .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

E

VENT

M

ONITORS

(DB2 LUW) - P

ROPERTIES

When creating or editing an event monitor, this tab/panel lets you work with the following settings:

Setting

Name

Auto Start

Target Type

Buffer Size

Blocked

Target

Write Mode

Max Files

Max FIle Size

Description

The name used to reference the object.

Indicates whether the event monitor is activated each time the database starts.

Indicates where the output is written: FILE, PIPE, or TABLE.

For a Target Type of TABLE or FILE, indicates the buffer size

For a Target Type of TABLE or FILE, indicate whether the event monitor is to be blocked.

For a Target Type of PIPE, a named pipe identifier.

For a Target Type of FILE, the value can be APPEND or REPLACE.

For a Target Type of FILE, indicate the maximum number of files.

For a Target Type of FILE, indicates the maximum file size.

E

VENT

M

ONITORS

(DB2 LUW) - D

EFINITION

This tab/panel lets you specify the Event Types used to construct the CREATE EVENT

MONITOR statement FOR clause.

23 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

The base set of event types is BUFFERPOOLS, CONNECTIONS, DATABASE, DEADLOCKS,

DEADLOCK WITH DETAILS, STATEMENTS, TABLES, TABLESPACES, and TRANSACTIONS.

For IBM DB2 for Linux, Unix, and Windows version 9.0, DEADLOCK WITH DETAILS HISTORY and DEADLOCKS WITH DETAILS HISTORY VALUES event types are available.

For IBM DB2 for Linux, Unix, and Windows version 9.5, ACTIVITIES, THRESHOLD VIOLATIONS, and STATISTICS event types are available.

NOTE: If your choices are all from the DEADLOCKS... types, you can also specify Deadlock

Monitoring of Global or Local. If you select Local, specify the Database Partitions the event monitor is to run against.

E

VENT

M

ONITORS

(DB2 LUW) - C

ONDITIONS

Available only for CONNECTION, STATEMENT, and TRANSACTION Event Types, this tab lets you identify a condition used to determine which CONNECTION, STATEMENT, or

TRANSACTION the event monitor will collect data for.

F

OREIGN

K

EY

W

IZARD

(IBM DB2 LUW)

Foreign keys are unique values that refer to specific columns of other tables. Thus, a foreign key links two tables together. Embarcadero DBArtisan’s Foreign Key Wizard makes it easy for you to create a relational link between two tables, thereby speeding queries and giving you faster access to data.The Foreign Key Wizard lets you create a foreign key without knowing the underlying commands.

To create a new foreign key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Foreign Keys (DB2 LUW) - Properties

Column Mapping panel - for details, see

Foreign Keys (DB2 LUW) - Column Mapping

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

Foreign Keys (DB2 LUW) - Properties

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Table Schema

Description

The schema owning the table where the foreign key is being created.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 231

C RE A T I N G O B J E C TS

Setting

Table Name

Name

Enabled

Delete Rule

Update Rule

Description

This is the table where the foreign key link originates--the child table.

Lets you select a constraint name.

System Generated Name - DB2 automatically generates a name.

User Specified Constraint Name - You type the name.

TRUE enables the Foreign Key while FALSE disables the Foreign Key.

Select an action:

NO ACTION - ensures that referenced values cannot be updated or deleted if to do so would violate referential integrity.

CASCADE permits a referenced row in a child table to be deleted/updated if it is deleted/updated in the parent table. A row in the child table is SET NULL when rows in the parent table are deleted/updated.

RESTRICT prevents a command from executing if changes to referential data prompts an error.

Select an action.

NO ACTION - ensures that referenced values cannot be updated or deleted if to do so would violate referential integrity.

RESTRICT - prevents a command from executing if changes to referential data prompts an error

Foreign Keys (DB2 LUW) - Column Mapping

1 Under Referenced Table, choose the Owner and then the Name of the referenced, or parent, table.

2 Under the Main Table, select check boxes corresponding to the columns that are to reference columns in the referenced table.

F

UNCTION

W

IZARD

(IBM DB2 LUW)

To create a relationship between one set of values and another, DBArtisan offers the Function

Wizard. You can develop reusable subroutines so you can control, access, and manipulate the data that underlies an object. As you complete the Function Wizard process, DBArtisan constructs the necessary CREATE FUNCTION statement based on the information that you supply. The Function Wizard lets you create a function without knowing the underlying commands.

NOTE:

To create a user-defined function, you need CREATE ANY privileges or

IMPLICIT_SCHEMA authority on the database if the schema does not already exist.

23 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Functions (DB2 LUW) - Properties .

Advanced panel - for details, see

Functions (DB2 LUW) - Advanced .

Source panel (only available for a Function Type of SOURCED) - for details, see

Functions

(DB2 LUW) - Source

.

Parameters panel ( only available for a Function Type of SQL, SOURCED, or TEMPLATE

) - for details, see

Functions (DB2 LUW) - Parameters .

Return Scalar panel - for details, see

Functions (DB2 LUW) - Return Scalar

.

Return Columns panel ( only available when you choose a Function Type of EXTERNAL TABLE

) - for

details, see Functions (DB2 LUW) - Return Columns

.

Body panel - for details, see Functions (DB2 LUW) - Body

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

UNCTIONS

(DB2 LUW) - P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Schema, Name, and

Specific Name

Function Type

Language

Return Type

External Name

Description

Let you select the owner of the function, provide a name for the function, and provide the Specific name to be used by some SQL statements and DB2 commands for this function.

Select the type of function:

External Scalar - written in a programming language and returns a scalar value.

External Table - written in a programming language and returns a complete table.

OLEDB - accesses OLE DB data in user-defined OLE DB external tables.

Sourced - another function is invoked to implement the function you are creating.

SQL Language - written in SQL and returns a table, scalar value, or single row.

Template: - this is a partial function and can only be invoked from a federated datasource.

For more information, see About function types .

If you chose a Function Type of EXTERNAL SCALAR or EXTERNAL TABLE, specify a language of C, JAVA, or OLE. For more information, see

About function types

.

For a Function Type of SQL, select ROW, TABLE, or SCALAR. For other Function Type choices, this indicates the default return type for that choice.

Provide the External Name of the function.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 233

C RE A T I N G O B J E C TS

Setting

SQL Access Level

Description

Indicates whether the function can execute SQL statements.

CONTAINS SQL: Statements that don’t read or modify SQL can be executed.

NO SQL: No SQL statements can be executed.

READS SQL: Statements that cannot modify SQL can be executed.

Functions (DB2 LUW) - Advanced

This tab is only available after clicking the Advanced button on the Function wizard’s Properties panel. It lets you work with the Threadsafe, Fenced, Scratchpad, Scratchpad Length, Allow

Parallel, Final Call, Parameter Style, Inherit Special Registers, DBINFO, Deterministic,

External Action, Called on Null Input, and Parameter CCSID properties.

Functions (DB2 LUW) - Source

NOTE:

This panel is only available for a Function Type of SOURCED.

Select the Schema, Name, and Specific Name of the source function. Function Parameters and

Return Type for the selected function are displayed. For more information, see About function types

.

Functions (DB2 LUW) - Parameters

NOTE:

This panel is only available for a Function Type of SQL, SOURCED, or TEMPLATE.

For each parameter for this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, and if appropriate, the

Precision, Scale, and Size options.

Functions (DB2 LUW) - Return Scalar

Under Return Datatype, select a Type and depending on your choice, provide or select

Precision, Scale, Size, and As Locator options.

To make use of a CAST FROM clause, under Cast Datatype set Enabled to True, select a Type, and if appropriate, the Scale, Size, and As Locator options

Functions (DB2 LUW) - Return Columns

NOTE:

This panel is only available when you choose a Function Type of EXTERNAL TABLE.

For each column returned by this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, and if appropriate, the

Precision, Scale, Size, and As Locator options.

23 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Functions (DB2 LUW) - Body

Enter the return statement for the function.

A

BOUT FUNCTION TYPES

External Scalar/Table/OLE DB Function

External scalar user-defined functions are implemented in an external programming language.

The functions are executed on the server and can read SQL data but cannot make changes to the data. These functions are often used to extend the set of built-in functions for DB2, perform logic inside a SQL query that SQL can’t perform on its own, and, encapsulate a scalar query that is often used as a subquery in SQL statements, for example, if given an ingredient, search a table for a recipe that uses that ingredient.

When specifying the Specific Name for one of these function types:

• If you are using C language, specify the full library path and the function name, otherwise

IBM DB2 Database Manager assumes the function is under the IBM DB2 library.

• If you are using Java script, specify the Class ID and the function name, otherwise IBM DB2

Database Manager assumes the function is under the IBM DB2 library.

• If you are using OLE language, specify the full library path and the function name, otherwise

IBM DB2 Database Manager assumes the function is under the IBM DB2 library.

Sourced Functions

When you create a sourced function, the new function you are creating will be implemented by a preexisting (source) function that’s known to the database manager. The source function can be a built-in function or a previously created user-defined scalar function.

When you select the appropriate schema, you are really specifying an implicit schema privilege.

In other words, you’re selecting a schema/function that belongs to a user with DBAdmin privileges. If you want to use a built-in function, you must specify the function’s specific name.

SQL Language Function

The function you are creating is written in SQL. A table, scalar value, or single row is returned.

Template Function

A template function is better thought of as a template for a function. It’s a partial function that has no executable code. You create a function template for mapping it to a datasource function.

When the mapping is created, you can specify the function template be used in queries submitted to the federated server. When the query is processed, the federated server invokes datasource function where the template is mapped and returns the appropriate values.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 235

C RE A T I N G O B J E C TS

G

ROUP

W

IZARD

(DB2 LUW)

The Group Wizard lets you define new groups and to assign the appropriate object and system level privileges. Any user who is a part of the group you create will inherit the authorities and privileges assigned to the group.

To Open the Group Wizard

1 On the Explorer, find the datasource where you want to add the new group.

2 Expand the Security branch, right-click Groups, and select New.

The table that follows describes the fields you may encounter as you complete the Group

Wizard:

Required Information

What is the name of the group?

Description

Lets you enter the name of the group.

What database authority(ies) do you want to give this group?

Select all or some of the authorities:

BINDADD: User can create new database packages

CONNECT: Gives users access to the database

CREATETAB: A user can create new tables in the database

CREATE_NOT_FENCED: Allows a user to create user-defined functions

IMPLICIT_SCHEMA: Enables any user to implicitly create a schema by creating an object with a CREATE statement using a schema name that doesn’t already exist.

DBADM: Gives users administrative privileges.

LOAD: Users can load data into a table.

NOTE: The authorities listed here are the system privileges.

I

NDEX

W

IZARD

(DB2 LUW)

Comparable to an index in a book, an index gives you speedy access to particular records in a table. The Index Wizard lets you create an index without knowing the underlying commands.

23 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new index using a wizard:

1

Open an Object Wizard

for an index.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Indexes (DB2 LUW) - Properties

.

Columns and Include Columns panels - for details, see Indexes (DB2 LUW) - Columns and

Include Columns

.

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

I

NDEXES

(DB2 LUW) - P

ROPERTIES

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Schema and Name

Index Type

Clustered

Percent Free

Description

Choose the owner and name of the table in which the index is being created.

Choose the owner and name of the index being created.

Index enforces uniqueness on the values of the table's index key.

Specifies that the index is the clustering index of the table. The cluster factor of a clustering index is maintained or improved dynamically as data is inserted into the associated table, by attempting to insert new rows physically close to the rows for which the key values of this index are in the same range.

Lets you type or select the percentage of each index page to leave as free space when building the index, from 0 to 99.

I

NDEXES

(DB2 LUW) - C

OLUMNS AND

I

NCLUDE

C

OLUMNS

Index columns can be segregated into unique key columns (Columns pane) and Include columns that are to be part of the index but do not form part of the unique key.

The steps in completing the panes for the two column types are identical.

• From the Column dropdown, select a column for the index and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction.

Use the Delete button to drop columns.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 237

C RE A T I N G O B J E C TS

M

ATERIALIZED

Q

UERY

T

ABLE

W

IZARD

(DB2 LUW)

A materialized query table (MQT) is a table based on the result of a query. An MQT contains information that is summarized from other tables and can save time when processing dynamic

SQL queries. The Materialized Query Table Wizard lets you create a table without knowing the underlying commands.

To Open the Materialized Query Wizard

1 On the Explorer, find the datasource where you want to add the new materialized query table.

2 Expand the Schema branch, right-click Materialized Query Tables, and select New.

The table that follows describes the fields you may encounter as you complete the Materialized

Query Table Wizard.

NOTE:

These options are only available if the tablespace you selected is a database managed tablespace.

Required Information

Who owns the table?

What is the name of the table?

Select a tablespace on which to place the table:

Specify separate tablespaces for index and long data

Specify the query on which this table is based

Description

Choose the owner of the table you’re creating from the drop-down list.

Type the name of the materialized query table you are creating.

OPTIONAL: No selection is the default. But you can select a tablespace that belongs to the new table’s owner if you want.

OPTIONAL: Lets you separate indexes or long data from the table.

Indexes

Long data

Write the query you want to use to create the table.

Note: Every select list element must have a name (use the AS clause for expressions)

Click Add, Insert or Edit to add or modify table columns. Click Drop to delete a selected column.

Add the columns belonging to this table

Add the columns belonging to the partition key

Do you want the table replicated across database partitions?

Definition Only

The default is no, but check the box if you do want to replicate the table.

Replicated materialized query tables can help you improve query performance by enabling collocation between tables. Replication is especially helpful when you have joins between large fact tables and small dimension tables. It’s best if tables that are to be replicated are infrequently updated.

Lets you select definition options, Include Column Defaults and Include Identity

Column Attributes.

When you select the Definition Only option, the new table is treated as if it was a base table rather than a MQT.

After you complete the wizard, DBArtisan opens the Tables Editor.

23 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

Refreshable

Would you like extra information regarding SQL changes to this table to be written to the log?

Description

Lets you select refresh options:

Immediate: The table you are creating will be refreshed automatically when changes are made to the base table(s).

Deferred: Static SQL will not be optimized. Changes to the base table(s) will not be reflected.

Query Optimization:

Enabled: Queries will be routed to the MQT.

Disabled: This is the default.

Maintained by:

System: This is the default

User

After you complete the wizard, DBArtisan opens the Material Query Tables Editor.

If you opted to replicate the table, you must make a selection here.

Yes means you want to receive error messages issued by the DB2 replication programs.

Include Longvar Columns means you want to receive error messages for these columns if long varchar data is a part of the table you’re replicating.

No

Initially Not Logged: This is an option that can reduce logging and increase performance, but also means that you cannot recover the table when rolling forward.

Logged Initially. This is the default.

Would you like to skip logging changes made to this table by Insert... and

Alter Table operations in the same unit of work in which this table is created?

What type of table lock would you like when it is being accessed?

What percent of free space to leave for load and reorganization?

Do you want data to append to the end of the table?

Do you want the access plan to this table to be based on existing statistics and optimization level?

Enter a comment

Row: This is the default. During a table or index scan, DB2 locks each row that is scanned before determining whether that row is relevant to the query.

Table: During a table scan, DB2 locks the table so no data can be added or altered while the query is executed.

-1 is the default.

Yes

No: This is the default

Volatile: A volatile table’s contents can vary from empty to huge at run time and can render collected statistics inaccurate.

Not Volatile: This is the default.

Optional

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 239

C RE A T I N G O B J E C TS

N

ODEGROUP

W

IZARD

(DB2 LUW)

A nodegroup is a named subset of one or more database partitions. The Node Group Wizard lets you create a node group without knowing the underlying commands. When you create a nodegroup, the wizard simply asks you to name the nodegroup and select the partitions to include in the nodegroup.

To Open the Nodegroup Wizard

1 On the Explorer, find the datasource where you want to add the new Nodegroup.

2 Expand the Storage branch, right-click Nodegroups, and select New.

P

RIMARY

K

EY

W

IZARD

(DB2 LUW)

A primary key is a column or group of columns that you can use to identify or access one or more specific rows in a table. A primary key is ‘constrained’ in that no values can be null and no two values are equal. You can only create one primary key for any table. The Create Primary Key

Constraint dialog box lets you create a primary key without knowing the underlying commands.

When you create a primary key, specify the table owner and the table on which you want to place the primary key constraint. You name the constraint and select the column(s) you want to include.

To create a new primary key using a wizard:

1

Open an Object Wizard

for a primary key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Primary Keys (DB2 LUW) - Properties .

Columns panel - for details, see Primary Keys (DB2 LUW) - Columns

.

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

P

RIMARY

K

EYS

(DB2 LUW) - P

ROPERTIES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Name

Description

Choose the owner and name of the table in which the primary key is being created.

Choose the owner and name of the primary key being created.

24 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

RIMARY

K

EYS

(DB2 LUW) - C

OLUMNS

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

P

ROCEDURE

W

IZARD

(DB2 LUW)

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly.

To create a new procedure using a wizard:

1

Open an Object Wizard

for a procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Procedures (DB2 LUW) - Properties .

Advanced panel - for details, see Procedures (DB2 LUW) - Advanced

.

Parameters panel - for details, see

Procedures (DB2 LUW) - Parameters

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

P

ROCEDURES

(DB2 LUW) - P

ROPERTIES

When creating or editing a procedure, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Specific Name

Language

External Name

SQL Access Level

Description

Select the owner for the procedure.

Provide the name of the function.

Optionally, provide the unique name of the procedure.

Select among C, JAVA, COBOL, OLE, or SQL. The database manager will call the procedure accordingly.

Provide the external name of the procedure.

Select an option:

MODIFIES SQL DATA - the procedure can support any SQL statement except those that cannot be supported in procedures.

CONTAINS SQL DATA - only SQL statements that neither modify nor read SQL data can be executed in the procedure.

READS SQL DATA - some SQL statements that don’t modify SQL data can be included in the procedure.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 241

C RE A T I N G O B J E C TS

P

ROCEDURES

(DB2 LUW) - A

DVANCED

When creating or editing a procedure, this tab/panel lets you work with the following settings:

Setting

Results Sets

External Action

New Save Point

Threadsafe

Fenced

Parameter Style

Program Type

Inherit Special

Registers

DBINFO

Deterministic

Parameter CCSID

Description

Indicate the estimated upper bound of returned result sets. 0 is the default.

Select the External Action option.

Lets you specify a NEW SAVEPOINT LEVEL clause for the procedure.

Specify whether the procedure is safe to run within the same process as other routines.

If you select yes, you are saying you do not want the procedure to run in the manager operating system environment. This means the database management system will protect its internal resources from the procedure. This option can affect the procedure’s operation.

To run a procedure as not fenced, or a No selection, you must have SYSADMIN or

DBADMIN privileges because of the potential to compromise data if the procedure has not been adequately tested.

Lets you select an option: DB2DARI, DB2GENERAL, DB2SQL, GENERAL, GENERAL

WITH NULLS, JAVA, and SQL.

DB2GENERAL is for Java Language only.

DB2SQL is for C, COBOL, or OLE Language only.

GENERAL is for C Language only.

GENERAL WITH NULLS is for C or COBOL Language only.

JAVA is for Java Language only.

SQL is for C, COBOL, or OLE Language only.

MAIN: valid for C or COBOL Language and Parameter Style GENERAL, GENERAL WITH

NULLS, SQL, or DB2SQL only. In this case, parameters will be passed as an argument counter or argument vector.

SUBROUTINE: the procedure expects the parameters to be passed as separate arguments.

Lets you specify this optional clause dictating that the procedure will inherit initial values from the environment of the invoking statement.

Specific information contains such information as the database name, application ID, database code page, and so on.

Enabling this feature specifies the procedure will always return the same result for given argument values. Disabling it means there are state values that affect the results and so the same result will not always be returned when you use identical inputs to invoke the procedure.

Select an encoding scheme of ASCII, UNICODE, or NONE for character or graphic string parameters.

P

ROCEDURES

(DB2 LUW) - P

ARAMETERS

For each parameter for this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, specify a Parameter Mode of

INPUT, OUTPUT, or INPUT_OUTPUT, and if appropriate, the Precision, Scale, and Size options.

24 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

S

EQUENCE

W

IZARD

(DB2 LUW)

A sequence allows the automatic generation of values, something well-suited to the generation of unique key values. Sequences are not tied to particular table columns. The Sequence Wizard lets you create a sequence without knowing the underlying commands. As you complete the

Sequence Wizard, DBArtisan constructs the necessary CREATE SEQUENCE statement from the information that you have supplied. When finished, you can instruct DBArtisan to compile the sequence on the target DBArtisan database or to write a script file containing the CREATE

SEQUENCE statement.

The Sequence Wizard lets you:

• Specify the name and owner of the sequence.

• Set both the value of the sequence, and an interval and ranges for incrementing it.

• Cache the sequence, cycle the sequence when it reaches its minimum or maximum values, and guarantee that DBArtisan generates sequence numbers in the order of request.

NOTE:

To create a sequence, it must belong to your schema or you need CREATE SEQUENCE privileges.

To Open the Sequence Wizard

1 On the Explorer, find the datasource where you want to add the new Sequence.

2 Expand the Schema branch, right-click Sequences, and select New.

The table that follows describes what you may encounter as you complete the Sequence Wizard:

Required Information

Who owns the sequence?

What is the sequence name?

What numeric datatype should the

Sequence use?

What is the first sequence number to be generated?

What is the interval between sequence numbers?

What is the sequence’s minimum value?

What is the sequence’s maximum value?

Should DB2 preallocate sequence numbers and cache them for faster access?

Description

You decide.

Your choice.

Choose among BIGINT (big integer), decimal (choose width as well), integer, small integer.

Starting with 1 is the default.

Increment by 1 is the default.

Choose none or set a value

Choose none or set a value

Preallocating and storing values in the cache reduces synchronous I/O to the log when values are generated for the sequence.

If Yes, give number of values

No

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 243

C RE A T I N G O B J E C TS

Required Information

Should the sequence continue to generate values after reaching either its maximum or minimum value?

Should the sequence numbers be generated in the order of request?

Description

Lets you make the sequence cycle and continue to generate numbers.

Yes or No

Select to generate sequence numbers in the order of request. The

ORDER option is useful when you are using the sequence number as a timestamp.

Yes or No

S

CHEMA

W

IZARD

(DB2 LUW)

The Schema Wizard lets you create the structure of a database system including database objects.

To Open the Schema Wizard

1 On the Explorer, find the datasource where you want to add the new Schema.

2 Right-click Schema and select New.

All you need to do when the single-panel wizard opens is to give a unique name to the schema you’re creating.

S

TRUCTURED

T

YPE

W

IZARD

(DB2 LUW)

The Structured Type wizard lets you create the object type specification and define attributes for a structured type. You then use the Structured Type editor to define the methods and body for the type.

To Open the Type Wizard

1 On the Explorer, find the datasource where you want to add the new Structured Type.

2 Expand the Schema branch, right-click Structured Type, and select Create.

3 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Structured Types (DB2 LUW) - Properties

.

Attributes panel - for details, see Structured Types (DB2 LUW) - Attributes .

DDL View panel - for details, see

Create the New Object

.

4 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

On completion, the Structured Type editor opens, letting you provide method and body

specifications for the structured type. For details, see Structured Types Editor (IBM DB2 LUW)

.

24 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

S

TRUCTURED

T

YPES

(DB2 LUW) - P

ROPERTIES

When creating or editing a structured type, this tab/panel lets you work with the following settings:

Setting

Attributes

Supertype

Reference

Description

Instantiable - if disabled, no constructor function can be generated, nor can a noninstantiable type be used as the type of a table or view.

Final Type - enabled, indicates that the structured type cannot be used as a supertype.

With Function Access - If enabled, all methods of the type you are creating, and those you will create, can be accessed using functional notation. Some applications prefer functional notation over method invocation.

Without Comparisons - If enabled, indicates that there are no comparison functions supported for instances of the structured type.

Inline Length - Specifies the maximum size of an instance of a structured type in a column. If the size of a structured type instance is less than the defined maximum, the data is stored inline with the other values in the row. If the size of the structured type is larger than the defined maximum, the structured type data is stored outside of the table

(like LOBs).

Supertype Schema and Supertype Name - let you designate this structured type as a subtype by providing details of the owning supertype.

Cast (Source as Ref) With and Cast (Ref as Source) With - Lets you name the cast function, although one will be created with the default name of the structured type you are creating. The cast function “casts” a value between the reference type and the representation type in both directions.

Reference Using, Size, Precision, and Scale - Define the built-in data type used as the underlying data type for the structured type you are creating and all its subtypes.

S

TRUCTURED

T

YPES

(DB2 LUW) - A

TTRIBUTES

For each attribute to be added to the structured type, click the New button, and provide a name for the attribute.

With an attribute selected, you can modify the Datatype. Depending on the datatype you choose you can provide the following datatype qualifiers:

Width (decimal only)

Scale (decimal only)

Size (blob, character, clob, dbclob, graphic, varchar, vargraphic only)

Allow log (blob, clob, dbclob only)

Allow compact (blob, clob, dbclob only)

For bit data (character, long varchar, varchar, only)

T

ABLE

W

IZARD

(DB2 LUW)

The Table Wizard lets you create a table without knowing the underlying commands.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 245

C RE A T I N G O B J E C TS

To create a new table using a wizard:

1

Open an Object Wizard

for an table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Tables (DB2 LUW) - Properties

.

Columns panel - for details, see Tables (DB2 LUW) - Columns

.

Partition panel - for details, see Tables (DB2 LUW) - Partition

.

Tablespaces panel - for details, see

Tables (DB2 LUW) - Tablespaces .

Dimension panel - for details, see Tables (DB2 LUW) - Dimensions .

Distribution Key Columns panel - for details, see

Tables (DB2 LUW) - Distribution Key

Columns

.

Indexes panel - for details, see

Tables (DB2 LUW) - Indexes

.

Constraints panel - for details, see

Tables (DB2 LUW) - Constraints .

Comment panel - for details, see

Add a Comment to an Object .

Permissions panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

ABLES

(DB2 LUW) - P

ROPERTIES

When creating or editing a table, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Percent Free

Lock Size

Description

Select the schema that is to own the table.

Provide a name for the table.

Append Data

Volatile

Compress

Row Compression

Security Policy

RestrictDrop

Log Index Build

The table-level lock prevents concurrently operating applications from using or changing a table. When scanning a table for a query, a row-level lock locks the row when it is being assessed.

Enable or Disable appending data to the end of the table.

Enable this feature if a table contents may fluctuate from empty to very large. The access plan will not depend on the existing statistics for that table.

Enable or disable value compression

Enable or disable row compression.

Lets you add a security policy to a table.

Corresponds to the DB2 Restrict on Drop attribute.

Enables this level of logging when creating, recreating, or reorganizing an index.

24 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

CCSID

Tablespace, Index

Tablespace, and Long

Data Tablespace

Do not initially log

Data Capture

Description

Specify ASCII or UNICODE or leave unspecified. If specified, this is the encoding scheme for string data. If unspecified, CCSID default encoding is used.

Select a tablespace, an index tablespace, and a tablespace for Long or LOB table columns.

If enabled, all changes to the table will be flushed out at commit time. This also means that if a statement fails, the unit of work will rollback. If you are concerned about recoverability, disable this feature.

Specify additional information logged by selecting DATACAPTURE NONE, DATA

CAPTURE CHANGES, or DATA CAPTURE CHANGES INCLUDE LONGVAR.

T

ABLES

(DB2 LUW) - C

OLUMNS

For each column in the table, click the New button to create a column and provide a name for the column. Then, in the Column Attributes area, provide details for the column.

Use the Delete button to drop a selected column.

T

ABLES

(DB2 LUW) - P

ARTITION

Under Partition Columns, for each partition column, click the New button and then choose a column name from the dropdown. To add a Data Partition, click the New button to open a dialog that lets you add a partition.

T

ABLES

(DB2 LUW) - T

ABLESPACES

For each Data Tablespace or Long Tablespace, click the New button and then choose a tablespace from the dropdown. To specify an Index Tablespace, select a tablespace from the dropdown.

T

ABLES

(DB2 LUW) - D

IMENSIONS

For each column that is to make up a dimension, click the New button to open a dialog that lets you add a column.

T

ABLES

(DB2 LUW) - D

ISTRIBUTION

K

EY

C

OLUMNS

For each column that is to make up the distribution key, click the New button and then select a column from the dropdown

T

ABLES

(DB2 LUW) - I

NDEXES

Click Add to open the Index wizard. For more information, see Index Wizard (DB2 LUW)

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 247

C RE A T I N G O B J E C TS

T

ABLES

(DB2 LUW) - C

ONSTRAINTS

Selecting a constraint type and clicking Add opens the object wizard for that object type. For details see:

Primary Key Wizard (DB2 LUW)

Unique Key Wizard (DB2 Z/OS)

Foreign Key Wizard (DB2 Z/OS))

T

ABLESPACE

W

IZARD

(DB2 LUW)

Tablespaces establish connections between the physical storage devices of your database system and the logical containers or tables being use to store data. In essence, a tablespace is a storage structure that can hold tables, indexes, large objects, and long data. The Tablespace

Wizard lets you create a tablespace without knowing the underlying commands.

To create a new tablespace using a wizard:

1

Open an Object Wizard

for a tablespace.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Tablespaces (DB2 LUW) - Properties

.

Container panel - for details, see Tablespaces (DB2 LUW) - Container

.

Comment panel - for details, see

Add a Comment to an Object .

Permissions panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

ABLESPACES

(DB2 LUW) - P

ROPERTIES

When creating or editing a tablespace, this tab/panel lets you work with the following settings:

Setting Description

Tablespace properties

Type - Select REGULAR, LARGE, TEMPORARY, or USER TEMPORARY.

Use Automatic Storage and Managed By let you specify whether storage is managed automatically, by the database, or by the system.

Database Partition Group - lets you select a database partition group.

Buffer Pool - lets you select a buffer pool.

Drop Recovery - For REGULAR type tablespaces, lets you enable/disable drop recovery.

Performance properties This group lets you specify or select the Page SIze, Extent Size, Prefetch Automatic,

Prefetch Size, Overhead, Transfer Rate, and File System Caching properties.

24 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Automatic Storage properties

Description

This group lets you specify or select the AutoResize, Initial Size, Increase Size, Max

Size Unlimited, and Max Size attributes.

T

ABLESPACES

(DB2 LUW) - C

ONTAINER

For each container in the tablespace, in the Container Properties area, provide the following container properties: Database Partitions, Type (FILE or DEVICE), Name, and Size, and then click the New button.

Use the Delete button to drop a selected container.

T

RIGGER

W

IZARD

(DB2 LUW)

A trigger defines a set of actions that take place in conjunction with, or are triggered, for a particular base table, with an insert, update, or delete statement. Triggers are dandy ways to validate input data, read from other tables for cross-referencing purposes, and other similar purposes. The Trigger Wizard lets you create a trigger without requiring you to know any of the underlying commands.

To create a new trigger using a wizard:

1

Open an Object Wizard

for a trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Triggers (DB2 LUW) - Properties

.

Column Selection panel - for details, see Triggers (DB2 LUW) - Column Selection

.

Definition panel - for details, see

Triggers (DB2 LUW) - Definition .

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

RIGGERS

(DB2 LUW) - P

ROPERTIES

When creating or editing a trigger, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Schema and Name

Description

Choose the owner and name of the table for which the trigger is being created.

Choose the owner and name of the trigger being created.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 249

C RE A T I N G O B J E C TS

Setting

Trigger Timing

Trigger Events

Trigger Type

Old Table Alias

New Table Alias

Old Row Alias

New Row Alias

Description

BEFORE: These triggers serve as extensions to the constraint subsystem and are most often used to validate input data, generate values for newly inserted rows, and read from other tables for cross-reference purposes. Note: Before triggers must be created as a For

Each Row.

AFTER: Such a trigger is run after the integrity constraint validations; they can be used to modify operations in the database or be used for activities beyond the database, like supporting an alert notification.

An INSERT trigger must be associated with an INSERT statement. For example, if a data load operation doesn’t include an INSERT statement, the trigger will not be invoked.

An UPDATE trigger can be associated with specific columns of the base table and will only be activated if those columns are updated.

STATEMENT: (only fires once).

ROW (fires for each affected row): The trigger runs as many times as there are rows in the affected section. If the set of affected rows is empty, the trigger doesn’t run.

Type the name of a temporary table of rows as they exist before they’re updated or deleted.

Type a name for a temporary table of rows as they exist after they’re inserted or updated.

Type a name for the rows as they are before they’ve been deleted or updated.

Type a name for the rows as they are after they’ve been inserted or updated.

T

RIGGERS

(DB2 LUW) - C

OLUMN

S

ELECTION

If you chose UPDATE as the Trigger Event, select the columns, select the check box beside each column that is to fire the trigger.

T

RIGGERS

(DB2 LUW) - D

EFINITION

Complete the CREATE TRIGGER outline provided by typing or pasting the body of the trigger.

Finally, use the Execute button to

Create the New Object .

U

NIQUE

K

EY

W

IZARD

(DB2 LUW)

A unique key constraint is a key for which no two of its values can be equal and no values can be null. A table can have a number of unique constraints, but it cannot have more than one unique constraint on the same set of columns. If you are creating a unique key constraint on a table that already exists (as opposed to creating a unique key at the time the table is first generated), a unique index must already exist on the columns of the unique key you want to constrain. If no unique index exists, the Index Wizard will open as you complete the Create Unique Key

Constraint dialog box.

25 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new unique key using a wizard:

1

Open an Object Wizard

for a unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Unique Keys (DB2 LUW) - Properties

.

Columns panel - for details, see Unique Keys (DB2 LUW) - Columns .

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

U

NIQUE

K

EYS

(DB2 LUW) - P

ROPERTIES

When creating or editing a unique key, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Name

Description

Choose the owner and name of the table in which the unique key is being created.

Provide a name for the unique key being created.

U

NIQUE

K

EYS

(DB2 LUW) - C

OLUMNS

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

U

SER

D

ATATYPE

(DB2 LUW)

User defined datatypes allow column definitions to be consistent across a database. They let you associate frequently used datatype information to be associated with a specified function and take advantage of performance features available to built-in datatypes including indexing and parallel database queries.

To create a new user datatype using a wizard:

1

Open an Object Wizard

for a user datatype.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

User Datatype (DB2 LUW) - Properties

.

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 251

C RE A T I N G O B J E C TS

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

U

SER

D

ATATYPE

(DB2 LUW) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you work with the following settings:

Setting

Owner

Datatype

Type

Size

Allow Bit Data

Description

Select the owner of the user datatype.

Provide a name for the datatype.

Select the base datatype.

Provide the size of the datatype.

The option is only available for certain datatypes. A check means you want to store the data in a bit format.

U

SER

W

IZARD

(DB2 LUW)

Users have authorization to use a database and its objects, and the User Wizard gives you an easy way to add new ones.

To create a new user using a wizard:

1

Open an Object Wizard

for a user

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Users (DB2 LUW) - Properties

.

Object Permissions and System Permissions panels - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

SERS

(DB2 LUW) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you provide the user Name.

V

IEW

W

IZARD

(DB2 LUW)

A view gives you an alternative way to look at data in one or more tables. You can customize how you see a table’s contents.

25 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new view using a wizard:

1

Open an Object Wizard

for a view.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Views (DB2 LUW) - Properties

.

Definition panel - for details, see

Views (DB2 LUW) - Definition

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

V

IEWS

(DB2 LUW) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Check Type

Description

Select the owner of the view. The owner of the view must have SELECT privileges for the tables in the CREATE view statement or DBADM authority on the database that contains the table.

Provide a name for the view.

CHECK_NONE - No search conditions must be satisfied for insert or update operations.

CHECK_LOCAL - Update and insert operations on view must satisfy the search conditions of the view and underlying views that are defined with a check option. Furthermore, every updatable view that is directly or indirectly defined on view inherits those search conditions

(the search conditions of view and all underlying views of that are defined with a check option) as a constraint on insert or update operations.

CHECK_CASCADED - Update and insert operations on the view must satisfy the search conditions of view and all underlying views, regardless of whether the underlying views were defined with a check option. Furthermore, every updatable view that is directly or indirectly defined on view inherits those search conditions (the search conditions of view and all underlying views) as a constraint on insert or update operations.

Views (DB2 LUW) - Definition

Complete the CREATE VIEW statement by typing or pasting in the relevant query. Finally, use the Execute button to

Create the New Object

.

IBM DB2

FOR Z

/OS O

BJECT

W

IZARDS

DBArtisan lets you create DB2 OS390 objects using the following wizards:

• Alias Wizard (DB2 Z/OS)

• Database Wizard (DB2 Z/OS)

• Foreign Key Wizard (DB2 Z/OS))

• Function Wizard (DB2 Z/OS)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 253

C RE A T I N G O B J E C TS

• Index Wizard (DB2 Z/OS)

• Plan Wizard (DB2 Z/OS)

Primary Key Wizard (DB2 Z/OS)

• Procedure Wizard (DB2 Z/OS)

• Stogroup Wizard (DB2 Z/OS)

• Synonym Wizard (DB2 Z/OS)

• Table Wizard (DB2 Z/OS)

• Tablespace Wizard (DB2 Z/OS)

• Trigger Wizard (DB2 Z/OS)

• Unique Key Wizard (DB2 Z/OS)

• User Datatype Wizard (DB2 Z/OS)

• User Wizard (DB2 Z/OS)

• View Wizard (DB2 Z/OS)

In addition, see Create Synonym

.

A

LIAS

W

IZARD

(DB2 Z/OS)

An alias offers you security and convenience so that you can refer to an object without revealing who owns it or what database it belongs to. You can create aliases for tables or views. The Alias

Wizard lets you create an alias without knowing the underlying commands. As you complete the

Alias Wizard process, DBArtisan constructs the necessary CREATE ALIAS statement based on the information that you supply. To create an alias, you must have CREATE ALIAS privileges or sysadmin or sysctrl authority.

To create a new alias using a wizard:

1

Open an Object Wizard

for an alias.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Aliases (DB2 z/OS) - Properties

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

25 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

A

LIA

SES

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Target Owner

Target Type

Target Name

Description

Select the schema that is to own the alias.

Provide a name for the alias.

Select the owner of the object to which you are creating an alias.

Select the type of object (TABLE, VIEW) to which you are creating an alias.

Select the specific object to which you are creating an alias.

D

ATABASE

W

IZARD

(DB2 Z/OS)

The Database Wizard lets you create a database (a structured collection of data that can be updated or queried) without knowing the underlying commands. Databases can be simple, that is one file with many records and the same fields, or much more complicated with multiple files with different fields.

To create a new database using a wizard:

1

Open an Object Wizard

for a database.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Databases (DB2 z/OS) - Properties

.

Permissions panel - for details, see Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D

ATABASES

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a database, this tab/panel lets you work with the following settings:

Setting

Name

Type

Group Member

Tablespace Buffer

Pool

Description

Provide a unique name for the database.

Workfile: This option in only available if the server is configured in IBM DB2 for OS/390 and z/

OS to allow sharing. For more information, contact your System administrator.

Temp: This option indicates the database is only for declared temporary tables. A temp database cannot be shared.

Specifies the member for which this database is being created. Use this only in a shared environment.

Select the default buffer pool to be used for tablespaces created within the database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 255

C RE A T I N G O B J E C TS

Setting

Index Buffer Pool

Description

Select the default buffer pool name to be used for indexes created within the database.

Storage Group

Select the default storage group to support the DASD space requirements for tablespaces and indexes within the database.

Encoding Scheme

Select an encoding schema of DEFAULT, ASCII, EBCDIC, or UNICODE.

NOTE: To change the encoding scheme for a database after it has been created to use a different coded character set identifier (CCSID) that supports the Euro symbol, all data must be unloaded and reloaded. For more information regarding the encoding scheme, contact your System administrator.

F

OREIGN

K

EY

W

IZARD

(DB2 Z/OS))

Foreign keys are unique values that refer to specific columns of other tables. Thus, a foreign key links two tables together. Embarcadero DBArtisan’s Foreign Key Wizard makes it easy for you to create a relational link between two tables, thereby speeding queries and giving you faster access to data.The Foreign Key Wizard lets you create a foreign key without knowing the underlying commands.

To create a new foreign key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Foreign Keys (DB2 z/OS) - Properties

.

Column Mapping panel - for details, see Foreign Keys (DB2 z/OS) - Column Mapping

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

OREIGN

K

EYS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Table Schema

Table Name

Name

Delete Rule

Description

Select the owner of the referencing, or child, table.

Select the name of the referencing, or child, table.

If you do not want to use the system-generated name, provide a new one.

Select the action to be taken (NO ACTION, RESTRICT, CASCADE, or SET NULL) when a row of the referenced, or parent, table is deleted.

25 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

F

OREIGN

K

EYS

(DB2

Z

/OS) - C

OLUMN

M

APPING

Under Referenced Table, choose the Owner and then the Name of the referenced, or parent, table.

Under the Main Table, select check boxes corresponding to the columns that are to reference columns in the referenced table. Then, under Referenced Table, select the corresponding column check boxes.

F

UNCTION

W

IZARD

(DB2 Z/OS)

To create a relationship between one set of values and another, DBArtisan offers the Function

Wizard. You can develop reusable subroutines so you can control, access, and manipulate the data that underlies an object. As you complete the Function Wizard process, DBArtisan constructs the necessary CREATE FUNCTION statement based on the information that you supply.

NOTE:

To create a user-defined function, you need CREATE ANY privileges or

IMPLICIT_SCHEMA authority on the database if the schema does not already exist.

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Functions (DB2 z/OS) - Properties .

Source panel - (Only available for a Function Type of SOURCED

.

) for details, see Functions

(DB2 z/OS) - Source

.

Parameters panel - for details, see Functions (DB2 z/OS) - Parameters .

Return Scalar panel - for details, see

Functions (DB2 z/OS) - Return Scalar

.

Return Columns panel - (Only available when you choose a Function Type of EXTERNAL

TABLE

.

) for details, see Functions (DB2 z/OS) - Return Columns .

Body panel - for details, see Functions (DB2 z/OS) - Body .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

UNCTIONS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a function, this tab/panel lets you work with the following settings:

Setting

Schema, Name, and

Specific Name

Description

Select the owner of the function, provide a name for the function, and provide the Specific name to be used by some SQL statements and DB2 commands for this function.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 257

C RE A T I N G O B J E C TS

Setting

Function Type

Language

Description

External Scalar: This allows you to extend the function by adding your own or another party’s definition for the function.

External Table: Use this to create a function that is written in ASSEMBLE, C, COBOL, or PLI to return a table after it is deployed.

Sourced: Here you are creating a function that is based on an existing scalar or table function with an application server.

SQL: This type of function returns a single value when the function is invoked if the SQL statement that defines it is valid.

If you chose a Function Type of EXTERNAL SCALAR or EXTERNAL TABLE, specify a language of ASSEMBLE, C, COBOL, or PLI.

Identifies the return type of the function.

Return Type

External Name

SQL Access Level

Provide the External Name of the function.

Indicates whether the function can execute SQL statements.

CONTAINS SQL: Statements that don’t read or modify SQL can be executed.

NO SQL: No SQL statements can be executed.

READS SQL: Statements that cannot modify SQL can be executed.

WLM Environment

Specify a Workload Management Environment (Required if Language is JAVA/COMPJAVA/

REXX, the Procedure contains a LOB parameter, Security is set to ‘USER’ or ‘DEFINER’, or program type is ‘SUB’).

WLM For Nested

Self-explanatory

F

UNCTIONS

(DB2

Z

/OS) - S

OURCE

NOTE:

Only available for a Function Type of SOURCED.

Select the Schema, Name, and Specific Name of the source function.

F

UNCTIONS

(DB2

Z

/OS) - P

ARAMETERS

For each parameter for this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, and if appropriate, the

Precision, Scale, Size, and As Locator options.

F

UNCTIONS

(DB2

Z

/OS) - R

ETURN

S

CALAR

Under Return Datatype, select a Type and depending on your choice, provide or select

Precision, Scale, Size, and As Locator options.

To make use of a CAST FROM clause, under Cast Datatype set Enabled to True, select a Type, and if appropriate, the Scale, Size, and As Locator options

F

UNCTIONS

(DB2

Z

/OS) - R

ETURN

C

OLUMNS

NOTE:

Only available when you choose a Function Type of EXTERNAL TABLE.

25 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

For each column returned by this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, and if appropriate, the Precision, Scale, Size, and As Locator options.

Functions (DB2 z/OS) - Body

Enter the return statement for the function.

I

NDEX

W

IZARD

(DB2 Z/OS)

Like the index in a book, a database index makes it easier for you to access information quickly.

An index lists the location of rows, sorted by the contents of one or more columns.

To create a new index using a wizard:

1

Open an Object Wizard

for an index.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Indexes (DB2 z/OS) - Properties

Columns panel - for details, see Indexes (DB2 z/OS) - Columns

Indexes panel - for details, see

Indexes (DB2 z/OS) - Storage

Partitions panel - for details, see

Indexes (DB2 z/OS) - Partitions

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

I

NDEXES

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Schema and Name

Index Type

Description

Choose the owner and name of the table in which the index is being created.

Choose the owner and name of the index being created.

Unique: Prevents the selected table from having two or more rows with the same value of the index key. The uniqueness is enforced at the end of the SQL statement update. Also, null values are treated like any other values, so a column cannot contain more than one null. If you later elect to partition the index, the columns specified for the unique key must include all columns for the partitioning key.

Non-Unique (default)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 259

C RE A T I N G O B J E C TS

Setting

Clustered

Description

Enable or disable clustering. Unless you specifically select the CLUSTER option when you create an index, the first index you create on a table will be bestowed with that distinction. Each table can only have one clustering index at a time.

The clustering index tells DB2 to insert rows in the table in the order of the clustering key values. Inserted rows will be stored contiguously in sequence when possible. Columns frequently searched with a range of values BETWEEN, less than, greater than, and LIKE, or GROUP BY, etc., are good candidates for a clustering index.

If you enabled Clustering, specify the number of partitions.

Provide the buffer pool in which this index should reside

Enable or disable these DB2 options as required.

Number of Partitions

Buffer Pool

Defer, Close, Copy, and

Define

Piece Size

Compress

Index on expression

Padded

The maximum addressability of the dataset for a non-partitioned index.

Enabling this setting specifies a COMPRESS=YES parameter when creating the table, resulting in a compressed index. This feature is available if the size of the specified

Buffer Pool is 8k, 16k, or 32k.

Setting the check box enables the Index on Expression feature. The key expression is

then provided on the Columns tab/panel. For details, see Indexes (DB2 z/OS) - Columns .

Setting this check box specifies that the table is to be created with the PADDED keyword.

This feature must be enabled if you are using index key randomization. The RANDOM setting is applied on a column by column basis on the Columns tab/panel.

I

NDEXES

(DB2

Z

/OS) - C

OLUMNS

The actions you take on this tab/panel depend on whether you set the Index on Expression check box on the Properties panel. For more information, see

Indexes (DB2 z/OS) - Properties

.

• If Index on Expression is disabled:

From the Column dropdown, select a column for the index and specify a Sort option.

NOTE:

If you want to use the RANDOM sort option, you must first set the Padded check box on the Properties tab/panel.

• If Index on Expression is enabled:

Enter a valid key-expression in the Expression field and choose a Sort order.

To add more columns/key-expressions, click the New button and then follow the steps in the last instruction. Use the Delete button to drop columns.

I

NDEXES

(DB2

Z

/OS) - S

TORAGE

This tab/panel lets you perform the following tasks:

• Select a dataset management scheme

• Provide associated attribute values

26 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To select a data set management scheme:

1 Click the Edit button. The Data Set Management dialog opens.

2 Set one of the following data set management options:

• DB2 will define and manage the data sets on a volume of the default storage group of the database

DB2 will define and manage the data sets on a volume of the specified storage

group - Select a storage group (a storage group is made up of disk device volumes): Each data set will be defined on a volume listed in the storage group you select.

Minimum primary space allocation: 12 kilobytes is the default.

Minimum secondary space allocation: 12 kilobytes is the default.

NOTE:

NOTE: If the primary and (118 x) secondary space allocations combine to be greater than 2 gigabytes, more than one data set may eventually be used.

Erase data sets when index dropped? If choose this option, DB2 will overwrite all data with zeros before they are deleted as a security measure.

User will manage the data sets on a specified VCAT catalog-name - Enter or select the

VCAT. Do not select this option for an index on a declared temporary table.

3 Click OK.

In addition to the attributes specific to your data set management choice, this tab/panel also offers the following settings:

Free Page

Percent Free

GBP Cache

One free page exists for every x pages. The x specifies how often to leave a page of free space when index entries are created from executing a DB2 utility or creating an index for a table with pre-existing rows. (0-255)

The percentage of free space you want to leave in every page when entries are added to an existing index. The default is 10%.

This option is available only in a data-sharing environment.

ALL: As pages are read, all of them will be cached in the group buffer pool.

CHANGED: Updated pages are cached to the group buffer pool.

NONE: No pages will be cached.

I

NDEXES

(DB2

Z

/OS) - P

ARTITIONS

Displays the default settings for the number of partitions you specified on the Properties pane.

Select a partition and click the Edit button to modify details for that partition.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 261

C RE A T I N G O B J E C TS

P

LAN

W

IZARD

(DB2 Z/OS)

A plan, also known as the application plan, is a control structure that is used to process the SQL statements DB2 encounters when it is executing those SQL statements. The Plan Wizard, really, the Bind Plan Wizard, creates the structure that is used in the bind process--the process by which the output from the SQL precompiler is converted into usable form. Some authorization checking is necessary.

To Open the Bind Plan Wizard

1 On the Explorer, find the database where you want to add the new bind plan.

2 On the Plan branch, right-click and select Create.

The Bind Plan Wizard lets you set plan parameters, add packages, and set bind properties. The table below describes the options and functionality on the Bind Plan wizard:

Panel Settings and tasks

1 Plan Name Lets you select the plan name.

Qualifier

Action

Sql Rules

OPTIONAL: Lets you select a qualifier, the plan creator.

OPTIONAL: Lets you select an action.

Cache Size

OPTIONAL: Determines whether you can execute a type 2 CONNECT statement to an existing SQL connection, according to DB2 rules. Lets you select DB2 or STD.

OPTIONAL: Lets you select or type the cachesize in bytes, the authorization cache acquired in the EDM pool for the plan. At run time, the authorization cache stores user IDs authorized to run. Consulting the cache can avoid a catalog lookup for checking authorization to run the plan.

2

3

Plan Owner

Current

Server

Resource

Acquire

Disconnect

OPTIONAL: Determines the authorization ID of the owner of the plan.

OPTIONAL: Determines the location to connect to before running the plan.

OPTIONAL:

Use - Acquires table space locks only when first used by a bound application program.

Allocate - Acquires all table space locks when the plan is allocated. The value has no effect on dynamic SQL statements, which always use ACQUIRE(USE).

OPTIONAL: Determines which remote connections to destroy during commit operations.

The option applies to any application process that uses the plan and has remote connections of any type. Regardless of the value of this option, a commit operation destroys all connections in the release pending state.

Explicit - Destroy only connections in the release pending state. This value allows you maximum flexibility for controlling remote connections.

Automatic - Destroy all remote connections.

Conditional - Destroy all remote connections unless an open cursor defined as WITH

HOLD is associated with the connection.

Lets you select the Member Name, PDS Name (partitioned data set) and click Add to enter each member and PDS name.

Lets you select the Location to connect to, the Collection (location of the DBMS where the plan binds and where the description of the plan resides.) and a Package.

26 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Panel Settings and tasks

4 Isolation Determines how far to isolate an application from the effects of other running applications.

Keep

Dynamic

Specifies that DB2 keeps dynamic SQL statements after commit points. The application does not need to prepare an SQL statement after every commit point. DB2 keeps the dynamic SQL statement until the application process ends, a rollback operation occurs or the application executes an explicit PREPARE statement with the same statement identifier.

If the prepared statement cache is active, DB2 keeps a copy of the prepared statement in the cache. If the prepared statement cache is not active, DB2 keeps only the SQL statement string past a commit point. DB2 then implicitly prepares the SQL statement if the application executes an OPEN, EXECUTE, or DESCRIBE operation for that statement.

Current Data Determines whether to require data currency for read-only and ambiguous cursors when the isolation level of cursor stability is in effect. It also determines whether block fetching can be used for distributed, ambiguous cursors.

Degree Determines whether to attempt to run a query using parallel processing to maximize performance. Lets you select an option.

5

Dynamic

Rules

Release

Validate

Determines what values apply at run time for the following dynamic SQL attributes:

The authorization ID that is used to check authorization

The qualifier that is used for unqualified objects

The source for application programming options that DB2 uses to parse and semantically verify dynamic SQL statements

Whether dynamic SQL statements can include GRANT, REVOKE, ALTER, CREATE, DROP, and RENAME statements

Determines when to release resources that a program uses. Options are at each Commit point or Deallocate when the program terminates.

Determines whether to recheck, at run time, errors found during bind. The option has no effect if all objects and needed privileges exist.

Bind - If not all objects or needed privileges exist at bind time, the wizard displays an error messages, and does not bind the package.

Run - If not all objects or privileges exist at bind time, the process issues warning messages, but the bind succeeds. DB2 checks existence and authorization again at run time for SQL statements that failed those checks during bind. The checks use the authorization ID of the plan owner.

Explain Obtains information about how SQL statements in the member list of the plan, are to execute, and then inserts that information into the table owner.PLAN_TABLE, where owner is the authorization ID of the owner of the plan or package. This option does not obtain information for statements that access remote objects.

Reopt(VARS) Re-determines the access path at run time.

Prepare Prepares dynamic SQL statements that refer to remote objects.

ImmedWrite Immediate writes will be done for updates made to group buffer pool dependent pagesets or partitions.

Opthint Query optimization hints are used for static SQL.

Encoding

Path

Flag

Lets you select type of language for the package.

Lets you select a path that DB2 uses to resolve unqualified user-defined distinct types, functions, and stored procedure names (in CALL statements).

Lets you select all message types or a specified subset to display: informational, warning, error, and completion messages.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 263

C RE A T I N G O B J E C TS

Panel Settings and tasks

6

Enable or Disable system connection types that can use the plan or package, select a System or Cname option.

P

RIMARY

K

EY

W

IZARD

(DB2 Z/OS)

A primary key is a unique key that is part of a table’s definition. There can be only one primary key for each table, and the columns contained in a primary key cannot have null values. A primary key constraint forbids duplicate values in one or more columns. A table with a primary key will be considered the parent table to a table with a foreign key, which becomes the dependent table.

NOTE:

A nullable column cannot be a part of a primary key.

To create a new primary key using a wizard:

1

Open an Object Wizard

for a primary key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Primary Keys (DB2 z/OS) - Properties .

Columns panel - for details, see Primary Keys (DB2 z/OS) - Columns

.

Storage panel - for details, see Primary Keys - Storage - Edit button (manage datasets)

and

Primary Keys (DB2 z/OS) - Storage - Attributes

.

Partitions panel - for details, see

Primary Keys (DB2 z/OS) - Partitions

.

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

P

RIMARY

K

EYS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Description

Choose the owner and name of the table in which the index is being created.

Schema and Name Choose the owner and name of the index being created.

Clustered

Enable or disable clustering.

If you enabled Clustering, specify the number of partitions.

Number of

Partitions

Buffer Pool

Provide the buffer pool in which this index should reside

26 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Defer, Close, Copy, and Define

Piece Size

Description

Enable or disable these DB2 options as required.

The maximum addressability of the dataset for a non-partitioned index.

P

RIMARY

K

EYS

(DB2

Z

/OS) - C

OLUMNS

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

P

RIMARY

K

EYS

- S

TORAGE

- E

DIT BUTTON

(

MANAGE DATASETS

)

NOTE:

Availability differs according to the dataset management options you chose

Choose a data set management option:

DB2 will define and manage the data sets on a volume of the default storage group of the database

DB2 will define and manage the data sets on a volume of the specified storage group

Select a storage group (a storage group is made up of disk device volumes): Each data set will be defined on a volume listed in the storage group you select.

Minimum primary space allocation: 12 kilobytes is the default.

Minimum secondary space allocation: 12 kilobytes is the default.

NOTE:

If the primary and (118 x) secondary space allocations combine to be greater than 2 gigabytes, more than one data set may eventually be used.

Erase data sets when index dropped? If you choose this option, DB2 will overwrite all data with zeros before they are deleted as a security measure.

User will manage the data sets on a specified VCAT catalog-name Enter or select the VCAT.

Do not select this option for an index on a declared temporary table.

P

RIMARY

K

EYS

(DB2

Z

/OS) - S

TORAGE

- A

TTRIBUTES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Storage Group,

Primary Space

Allocation,

Secondary Space

Allocation, Erase, and VCAT catalog

Description

The ability to set these options depends on the dataset management options you chose.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 265

C RE A T I N G O B J E C TS

Setting

Free Page

Percent Free

GBP Cache

Description

One free page exists for every x pages. The x specifies how often to leave a page of free space when index entries are created from executing a DB2 utility or creating an index for a table with pre-existing rows. (0-255)

The percentage of free space you want to leave in every page when entries are added to an existing index. The default is 10%.

This option is available only in a data-sharing environment.

ALL: As pages are read, all of them will be cached in the group buffer pool.

CHANGED: Updated pages are cached to the group buffer pool.

NONE: No pages will be cached.

P

RIMARY

K

EYS

(DB2

Z

/OS) - P

ARTITIONS

Displays the default settings for the number of partitions you specified on the Properties pane.

Select a partition and click the Edit button to modify details for that partition.

P

ROCEDURE

W

IZARD

(DB2 Z/OS)

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly.

To create a new procedure using a wizard:

1

Open an Object Wizard

for a procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Procedures (DB2 z/OS) - Properties

.

Parameters panel - for details, see Procedures (DB2 z/OS) - Parameters .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

Important Notes

• If you are creating a SQL routine procedure, you must have the latest DB2 fixpack installed on your OS/390 Client. If you do not have the latest fixpack installed, the SQL routine procedure creation will fail.

26 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

ROCEDURES

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a procedure, this tab/panel lets you work with the following settings:

Setting

Schema, Name, and

Specific Name

Language

SQL Access Level

Description

Select the schema that is to own the procedure, provide a name for the procedure, and provide the Specific Name for the procedure.

The database manager will call the procedure accordingly assuming the program is designed to run in the server’s environment.

Assemble: a stored procedure written in Assembler

C: a stored procedure written in C or C++

COBOL: a stored procedure written in COBOL

CompJAVA: CompJAVA is no longer supported. Stored procedures should alternatively be written in JAVA.

JAVA

PLI: A stored procedure written in PL/I.

REXX (Restructured Extended Executor Language) - Don’t use this language when SQL parameter style is in effect. To specify REXX, the general parameter style or general with nulls.

SQL

MODIFIES SQL DATA (Default): The procedure can support any SQL statement except those that cannot be supported in procedures.

CONTAINS SQL DATA: Only SQL statements that neither modify nor read SQL data can be executed in the procedure.

READS SQL DATA Some SQL statements that don’t modify SQL data can be included in the procedure

NO SQL: Only SQL statements with a data access classification of NO SQL can be executed.

Don’t select this option for a JAVA procedure that uses a .jar.

WLM Environment

Specify a Workload Management Environment (Required if Language is JAVA/COMPJAVA/

REXX, the Procedure contains a LOB parameter, or Security is set to ‘USER’ or ‘DEFINER’).

WLM For Nested

Self-explanatory

P

ROCEDURES

(DB2

Z

/OS) - P

ARAMETERS

For each parameter for this function, use the New button to add a new parameter, provide a name for the parameter, and in the Attributes area, select a Type, specify a Parameter Mode of

INPUT, OUTPUT, or INPUT_OUTPUT, and if appropriate, the Precision, Scale, and Size options.

S

TOGROUP

W

IZARD

(DB2 Z/OS)

Stogroups are storage groups. You create them on the current server. Storage from the named sets of volumes you create can be allocated at a later date for tablespaces or index spaces.

To Open the Stogroup Wizard

1 On the Explorer, find the datasource where you want to add the new Storage Group.

2 Expand the Storage branch, right-click Stogroup, and select New.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 267

C RE A T I N G O B J E C TS

The table below describes the fields you will encounter as you complete the Stogroup Wizard.

Required Information

What is the name of the

Stogroup?

VCAT

Description

Enter a name for the storage group.

Select the volumes in the

Stogroup

Select All

This is the integrated catalog facility catalog, or volume catalog. Name the catalog or choose one from the drop-down list if it is available.

Specify a set of volumes that may exist on the system but may not be in use by other storage groups.

Selects all listed volumes.

Unselect All

Add

Remove

Unselects all listed volumes.

Opens the

Add Volume Dialog Box

.

Deletes all selected volumes from the list.

A

DD

V

OLUME

D

IALOG

B

OX

The table below describes the options and functionality on the Add Volume dialog box:

Required Information

Enter one or more volumes to add to the stogroup

Check

Description

Type the names of the volumes (separated by spaces) to add to the stogroup.

Or select volumes for the list

Click to see if any additional information is available about the volumes you typed.

Opens the

Volumes Info Dialog Box

.

Lets you select volumes.

V

OLUMES

I

NFO

D

IALOG

B

OX

The table below describes the options and functionality on the Volume Info dialog box:

Required Information

Volumes

OK

Description

Lets you select volumes.

Click to add volumes to Stogroup Wizard.

26 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

S

YNONYM

W

IZARD

(DB2 Z/OS)

A synonym is an alternative name you can create for a table or view. Using a synonym can make it easier for you to remember that table or view instead of having to think about the possibly cumbersome formal name (for example, a show dog may have a formal name that incorporates all his ancestors, but will answer to the name Spot around the house).

To create a new synonym using a wizard:

1

Open an Object Wizard

for a synonym.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Synonyms (DB2 z/OS) - Properties

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

S

YNONYMS

(DB2 z/OS) - P

ROPERTIES

When creating or editing a synonym, this tab/panel lets you work with the following settings:

Setting

Schema

Name

Description

Select the schema that is to own the synonym.

Provide a name for the synonym.

Referenced Object

Owner

Select the owner of the object to which you are creating a synonym.

Referenced Object

Type

Select the type of object (TABLE, VIEW) to which you are creating a synonym.

Referenced Object

Name

Select the specific object to which you are creating a synonym.

T

ABLE

W

IZARD

(DB2 Z/OS)

All data in a database is stored in a tabular format, that is a collection of rows and columns.

Tables, therefore are fundamental to whatever database you are administering.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 269

C RE A T I N G O B J E C TS

To create a new table using a wizard:

1

Open an Object Wizard

for a table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Tables (DB2 z/OS) - Properties .

Columns panel - for details, see Tables (DB2 z/OS) - Columns

.

Indexes panel - for details, see Tables (DB2 z/OS) - Indexes .

Constraints panel - for details, see Tables (DB2 z/OS) - Constraints

.

Comment panel - for details, see

Add a Comment to an Object .

Permissions panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

The table that follows describes the fields you may encounter as you complete the Table Wizard.

T

ABLES

(DB2

Z

/OS) - P

ROPERTIES

Select the Schema, provide a Name, and provide or select other table properties.

T

ABLES

(DB2

Z

/OS) - C

OLUMN

s

For each column in the table, click the Add Column button to create a column, provide a Name for the column and provide or select the remaining column attributes.

Use the Delete button to drop a selected column.

Use the arrow buttons to reposition the columns.

Tables (DB2 z/OS) - Indexes

Click Add to open the

Index Wizard (DB2 Z/OS)

.

T

ABLES

(DB2

Z

/OS) - C

ONSTRAINTS

Selecting a constraint type and clicking Add opens the object wizard for that object type. For details see:

Foreign Key Wizard (DB2 Z/OS))

Primary Key Wizard (DB2 Z/OS)

Unique Key Wizard (DB2 Z/OS)

Create Synonym

27 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

T

ABLESPACE

W

IZARD

(DB2 Z/OS)

Tablespaces establish connections between the physical storage devices of your database system and the logical containers or tables being used to store data. In essence, a tablespace is a storage structure that can hold tables, indexes, large objects, and long data.

NOTE:

To change the encoding scheme for a database after it is created to utilize a different coded character set identifier (CCSID) that supports the Euro symbol, all data must be unloaded and reloaded. For more information regarding the encoding scheme, contact your System administrator.

To Open the Tablespace Wizard

1 On the Explorer, find the datasource where you want to add the new Tablespace.

2 Expand the Storage branch, right-click Tablespaces, and select New.

3 Use the following table as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Tablespaces (DB2 z/OS) - Properties

.

Permissions panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

4 Finally, use the Execute button to create the object.

T

ABLESPACES

(DB2 z/OS) - P

ROPERTIES

When creating or editing a tablespace, this tab/panel lets you work with the following settings:

Group

Creation

Tablespace management

Settings

Name and

Database

Description

Provide a name and select an assocaited database.

Database type

Creation type

Lets you select a REGULAR or WORKFILE database type.

Lets you select among PARTITIONED, SEGMENTED, RANGE-

PARTITIONED UNIVERSAL, PARTITION-BY-GROWTH UNIVERSAL, and LOB options.

For detailed information on these types and other required settings, see http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/ index.jsp

. Search on a term such as universal tablespaces.

Management type

Lets you select how you want the tablespace managed: DEFAULT

STORAGE GROUP, STORAGE GROUP, or VCAT CATALOG-NAME.

Storage group,

Minimum primary space allocation,

Minimum secondary space allocation, and Erase rule

If you selected a Management type of STORAGE GROUP, select a storage group, specify minimum space allocations, and specify whether data sets are to be erased when the tablespace is dropped.

VCatName If you selected a Management type of VCAT catalog-name, select a catalog name.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 271

C RE A T I N G O B J E C TS

Group

Bufferpool

Settings

Buffer Pool

Partitions and size Number of partitions

Partition size

(DSSIZE)

Space

Management

Description

Select the buffer pool where the tablespace is to reside.

If you selected a Creation Type of PARTITIONED or RANGE-

PARTITIONED UNIVERSAL, specify the number of partitions.

If you did not select a Creation Type of SEGMENTED, select a partition size.

Segment size If you selected a Creation Type of SEGMENTED, PARTITION-BY

GROWTH, or RANGE-PARTITIONED UNIVERSAL, select the number of pages that are to be assigned to each segment of the tablespace.

Max rows per page Specify the number of rows (1-255) that can be placed on each data page.

Free space portion of each page (%)

If you did not select a Creation Type of LOB, specify the percentage of each page to be left as free space when a tablespace is reloaded or reorganized.

Free page frequency

Other parameters GBPCACHE

Compress

Track modified pages

Encoding scheme

Log

If you did not select a Creation Type of LOB, specify how often to leave a free page when a tablespace is reloaded or reorganized.

Select a group buffer pool cache scheme of CHANGED, ALL, SYSTEM, or NONE.

Enable this setting to allow compression.

Enable this setting to track modified pages in the space map pages.

Define

Member Cluster

Close rule

Lock Size

Maximum locks

Select an encoding scheme of EBCDIC, UNICODE, ASCII, or NONE.

Enabling this check box specifies that changes to a LOB column are to be written to the log.

Enabling this check box specifies that tablespace data sets are defined when the tablespace is created. Otherwise, data sets are not created until data is inserted.

Enable this setting to manage space for inserts on a member-bymember basis.

Enable this setting to specify CLOSE YES, dictating the data set close priority.

Specify a lock size of ANY, TABLESPACE, PAGE, or ROW.

Specify the number of locks that are allowed before escalating.

T

RIGGER

W

IZARD

(DB2 Z/OS)

All data in a database is stored in a tabular format, that is a collection of rows and columns.

Tables, therefore are fundamental to whatever database you are administering.

27 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new trigger using a wizard:

1

Open an Object Wizard

for a trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Triggers (DB2 z/OS) - Properties

.

Column Selection panel - for details, see Triggers (DB2 z/OS) - Column Selection

.

Definition panel - for details, see

Triggers (DB2 z/OS) - Definition .

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

RIGGERS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a trigger, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Schema and Name

Trigger Timing

Description

Choose the owner and name of the table for which the trigger is being created.

Trigger Events

Trigger Type

Old Table Alias

New Table Alias

Old Row Alias

New Row Alias

Choose the owner and name of the trigger being created.

BEFORE: These triggers serve as extensions to the constraint subsystem and are most often used to validate input data, generate values for newly inserted rows, and read from other tables for cross-reference purposes. Note: Before triggers must be created as a For

Each Row.

AFTER: Such a trigger is run after the integrity constraint validations; they can be used to modify operations in the database or be used for activities beyond the database, like supporting an alert notification.

An INSERT trigger must be associated with an INSERT statement. For example, if a data load operation doesn’t include an INSERT statement, the trigger will not be invoked.

An UPDATE trigger can be associated with specific columns of the base table and will only be activated if those columns are updated.

STATEMENT: (only fires once).

ROW (fires for each affected row): The trigger runs as many times as there are rows in the affected section. If the set of affected rows is empty, the trigger doesn’t run.

Type the name of a temporary table of rows as they exist before they’re updated or deleted.

Type a name for a temporary table of rows as they exist after they’re inserted or updated.

Type a name for the rows as they are before they’ve been deleted or updated.

Type a name for the rows as they are after they’ve been inserted or updated.

T

RIGGERS

(DB2

Z

/OS) - C

OLUMN

S

ELECTION

If you chose UPDATE as the Trigger Event, select the columns, select the check box beside each column that is to fire the trigger.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 273

C RE A T I N G O B J E C TS

T

RIGGERS

(DB2

Z

/OS) - D

EFINITION

Complete the CREATE TRIGGER outline provided by typing or pasting the body of the trigger.

Finally, use the Execute button to

Create the New Object .

U

NIQUE

K

EY

W

IZARD

(DB2 Z/OS)

A unique key constraint is a key for which no two of its values can be equal and no values can be null. A table can have a number of unique constraints, but it cannot have more than one unique constraint on the same set of columns. If you are creating a unique key constraint on a table that already exists (as opposed to creating a unique key at the time the table is first generated), a unique index must already exist on the columns of the unique key you want to constrain. If no unique index exists, the Index Wizard will open as you complete the Create Unique Key

Constraint dialog box.

To create a new unique key using a wizard:

1

Open an Object Wizard

for a unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Unique Keys (DB2 z/OS) - Properties .

Columns panel - for details, see Unique Keys (DB2 z/OS) - Columns .

Storage panel - for details, see Unique Keys (DB2 z/OS) - Storage - Edit button (manage datasets)

and

Unique Keys (DB2 z/OS) - Storage - Attributes

.

Partitions panel - for details, see

Unique Keys (DB2 z/OS) - Partitions .

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

U

NIQUE

K

EYS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Table Schema and

Table Name

Description

Choose the owner and name of the table in which the unique key is being created.

Schema and Name Choose the owner and name of the index being created.

Clustered

Enable or disable clustering.

If you enabled Clustering, specify the number of partitions.

Number of

Partitions

Buffer Pool

Provide the buffer pool in which this unique key should reside

27 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Defer, Close, Copy, and Define

Piece Size

Description

Enable or disable these DB2 options as required.

The maximum addressability of the dataset for a non-partitioned index.

U

NIQUE

K

EYS

(DB2

Z

/OS) - C

OLUMNS

From the Column dropdown, select a column for the unique key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

U

NIQUE

K

EYS

(DB2

Z

/OS) - S

TORAGE

- Edit

BUTTON

(

MANAGE DATASETS

)

NOTE:

Availability differs according to the dataset management options you chose

Choose a data set management option:

DB2 will define and manage the data sets on a volume of the default storage group of the database

DB2 will define and manage the data sets on a volume of the specified storage group

Select a storage group (a storage group is made up of disk device volumes): Each data set will be defined on a volume listed in the storage group you select.

Minimum primary space allocation: 12 kilobytes is the default.

Minimum secondary space allocation: 12 kilobytes is the default.

NOTE:

If the primary and (118 x) secondary space allocations combine to be greater than 2 gigabytes, more than one data set may eventually be used.

Erase data sets when index dropped? If you choose this option, DB2 will overwrite all data with zeros before they are deleted as a security measure.

User will manage the data sets on a specified VCAT catalog-name Enter or select the VCAT.

Do not select this option for an index on a declared temporary table.

U

NIQUE

K

EYS

(DB2

Z

/OS) - S

TORAGE

- A

TTRIBUTES

NOTE:

Availability differs according to the dataset management options you chose

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 275

C RE A T I N G O B J E C TS

When creating or editing a unique key, this tab/panel lets you work with the following settings:

Setting

Storage Group,

Primary Space

Allocation,

Secondary Space

Allocation, Erase, and VCAT catalog

Free Page

Percent Free

GBP Cache

Description

The ability to set these options depends on the dataset management options you chose.

One free page exists for every x pages. The x specifies how often to leave a page of free space when index entries are created from executing a DB2 utility or creating an index for a table with pre-existing rows. (0-255)

The percentage of free space you want to leave in every page when entries are added to an existing index. The default is 10%.

This option is available only in a data-sharing environment.

ALL: As pages are read, all of them will be cached in the group buffer pool.

CHANGED: Updated pages are cached to the group buffer pool.

NONE: No pages will be cached.

U

NIQUE

K

EYS

(DB2

Z

/OS) - P

ARTITIONS

Displays the default settings for the number of partitions you specified on the Properties pane.

Select a partition and click the Edit button to modify details for that partition.

U

SER

D

ATATYPE

W

IZARD

(DB2 Z/OS)

A datatype is a named set of valid values that can be manipulated by a set of operations. There are intrinsic datatypes, which are predefined and always available, and derived datatypes. A derived datatype is a user-defined datatype, which can include both intrinsic and previously derived datatypes. The User Datatype Wizard lets you create a derived datatype without knowing the underlying commands.

To create a new user datatype using a wizard:

1

Open an Object Wizard

for a user datatype.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

User Datatypes (DB2 z/OS) - Properties

.

Comment panel - for details, see

Add a Comment to an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

27 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

U

SER

D

ATATYPES

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you work with the following settings:

Setting

Owner

Datatype

Type

Size

For Data

CCSID

Description

Select the owner of the user datatype.

Provide a name for the datatype.

Select the base datatype.

Provide the size of the datatype.

Select the MIXED, SBCS, or BIT option for the datatype.

Select the NONE, ASCII, EBCDIC, or UNICODE option for the datatype.

U

SER

W

I

ZARD

(DB2 Z/OS)

Users have authorization to use a database and its objects, and the User Wizard gives you an easy way to add new ones.

To create a new user using a wizard:

1

Open an Object Wizard

for a user

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Users (DB2 z/OS) - Properties

.

Object Permissions and System Permissions panels - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

SERS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you provide the user Name.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 277

C RE A T I N G O B J E C TS

V

IEW

W

IZARD

(DB2 Z/OS)

A view gives you a new way of looking at data in a results table. Views behave like tables because you can query views and perform data manipulation operations on them. However, views do not actually store any data. Instead, they depend on data contained in their base tables. Columns added to the base table(s) after the view is created are not included in the result set. Views are thus handy tools for controlling access to a table. You can allow someone to see portions of data without allowing that user to see the table in its entirety. For example, you can create a view that will permit a user to see employee names in a table without allowing access to the Social Security numbers of that same table.

The wizard itself is a single panel. After you complete the wizard, the View Editor opens so you can complete the definition of the view, choose the columns to show in the view, the dependencies, and access privileges to the view.

To create a new view using a wizard:

1

Open an Object Wizard

for a view.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Views (DB2 z/OS) - Properties .

Definition panel - for details, see Views (DB2 z/OS) - Definition

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

V

IEWS

(DB2

Z

/OS) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Check Type

Description

Select the owner of the view. The owner of the view must have SELECT privileges for the tables in the CREATE view statement or DBADM authority on the database that contains the table.

Provide a name for the view.

CHECK_NONE - No search conditions must be satisfied for insert or update operations.

CHECK_LOCAL - Update and insert operations on view must satisfy the search conditions of the view and underlying views that are defined with a check option. Furthermore, every updatable view that is directly or indirectly defined on view inherits those search conditions

(the search conditions of view and all underlying views of that are defined with a check option) as a constraint on insert or update operations.

CHECK CASCADED - Update and insert operations on the view must satisfy the search conditions of view and all underlying views, regardless of whether the underlying views were defined with a check option. Furthermore, every updatable view that is directly or indirectly defined on view inherits those search conditions (the search conditions of view and all underlying views) as a constraint on insert or update operations.

27 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Views (DB2 z/OS) - Definition

Complete the CREATE VIEW statement by typing or pasting in the relevant query. Finally, use

the Schedule or Execute buttons to Create the New Object

.

M

ICROSOFT

SQL S

ERVER

O

BJECT

W

IZARDS

DBArtisan lets you create SQL Server objects using the following wizards:

Alerts Wizard (SQL Server)

• Backup Device Wizard (SQL Server)

• Database Wizard (SQL Server)

Database Triggers Wizard (SQL Server)

• Default Wizard (SQL Server)

• Extended Procedure Wizard (SQL Server)

Foreign Key Wizard (SQL Server)

Full-text Catalogs Wizard (SQL Server)

Full-text Indexes Wizard (SQL Server)

• Function Wizard (SQL Server)

• Index Wizard (SQL Server)

Jobs Wizard (SQL Server)

• Linked Server Wizard (SQL Server)

• Login Wizard (SQL Server)

Operators Wizard (SQL Server)

Partition Functions Wizard (SQL Server)

Partition Scheme Wizard (SQL Server)

• Primary Key Wizard (SQL Server)

• Procedure Wizard (SQL Server)

• Remote Server Wizard (SQL Server)

• Role Wizard (SQL Server)

• Rule Wizard (SQL Server)

Schema Wizard (SQL Server)

Server Triggers Wizard (SQL Server)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 279

C RE A T I N G O B J E C TS

Synonym Wizard (SQL Server)

• Table Wizard (SQL Server)

• Trigger Wizard (SQL Server)

• Unique Key Wizard (SQL Server)

• User Message Wizard (SQL Server)

• User Wizard (SQL Server)

• User Datatype Wizard (SQL Server)

• View Wizard (SQL Server)

A

LERTS

W

IZARD

(SQL S

ERVER

)

The Alerts Wizard lets you build and submit an sp_add_alert call to create a SQL Agent Alert.

You can create event-based, performance-based, or WMI-based alerts. Job-based and operatorbased responses are available.

NOTE:

For an overview of SQL Agent service support provided by DBArtisan, see

SQL Server

Agent

.

To create a new alert using a wizard:

1

Open an Object Wizard

for an alert.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details see Alerts (SQL Server) - Properties .

Response panel - for details see Alerts (SQL Server) - Response .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

For information on related SQL Agent elements, see the following topics:

Jobs Wizard (SQL Server)

Operators Wizard (SQL Server)

28 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

A

LERTS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing an alert, this tab/panel lets you select an alert type and provide details on the type selected. It has the following settings:

Category

Creation

Property

Name

Enabled

Description

Provide a name for the alert.

Select this check box to enable the alert.

Type

Select an alert type of SQL SERVER EVENT ALERT, SQL SERVER

PERFORMANCE CONDITION ALERT, or WMI EVENT ALERT (Windows

Management Instrumentation, available with SQL Server 2005 and above).

Alert definition If you selected a Type of SQL SERVER EVENT ALERT, select or provide the following details

Error #

Error Description

Type a valid, native or user-defined error number.

Displays the textual description for the Error # you specified.

Severity

Database

Select a severity to be associated/displayed for this alert.

If you want to restrict this alert to be reported on a specific database, select a specific database.

Event Description

Provide a textual description to be displayed with the alert.

If you selected a Type of SQL SERVER PERFORMANCE CONDITION ALERT, select or provide the following details

Object

Counter

Instance

Select the performance object to be monitored. Available performance objects differ by the version of SQL Server you are using. They MAY include:

Access Methods, Backup Device, Broker Activation, Broker Statistics, Broker/

DBM Transport, Buffer Manager, Buffer Node, Buffer Partition, Cache

Manager, Catalog Metadata, CLR, Cursor Management by Type, Cursor

Management Total, Database Mirroring, Databases, Deprecated Features,

Exec Statistics, General Statistics, Latches, Locks, Memory Manager, Plan

Cache, Resource Pool Stats, SQL Errors, SQL Statistics, Transactions, User

Settable, Wait Statistics, and Workload Group Stats.

Select a counter specific to the performance Object you selected.

If a specific instance is available for the Object and Counter you selected, select an instance.

Alert if counter and

Value

Use these settings to select the relational operator (<, =,or >) and value that make up the condition for which the alert is generated.

If you selected a Type of WMI EVENT ALERT, select or provide the following details

Namespace

Type the WMI namespace for the WMI Query Language (WQL) statement that identifies which WMI event will trigger this alert.

Query

Type the WQL statement that identifies the event that this alert responds to.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 281

C RE A T I N G O B J E C TS

A

LERTS

(SQL S

ERVER

) - R

ESPONSE

When creating or editing an alert, this tab/panel lets you specify details of responses to the alert.

It lets you specify a job to be executed as well as details of email, pager or net send notifications. You work with the following settings:

Category

Job Properties

Include alert error text in

Additional Properties

Operators to notify

Property

Execute Job

Job Name

Description

Select this check box to have a job executed on this alert.

If you selected Execute Job, select the specific job to execute.

Use the Email, Pager, and Net send controls to specify whether a textual description of the SQL Server error is to be included as part of the notification message for the target media.

Notification message

Use this control to add an optional additional message that will be sent to the operator as part of the notification.

The wait period, in seconds, between responses to the alert.

Delay Between

Responses

The list displays all defined operators. Use the Email, Pager, and Netsend controls to select the operators and the media by which they will be contacted for this alert.

NOTE:

The New Job and New Operator buttons let you open the Jobs Wizard and Operators

Wizard, respectively. For details, see Jobs Wizard (SQL Server)

and Operators Wizard

(SQL Server) .

B

ACKUP

D

EVICE

W

IZARD

(SQL S

ERVER

)

The Backup Device Wizard lets you add a disk or tape backup device to a SQL Server instance.

Backup devices store backups of databases and transaction logs.

Before you can dump a database or its transaction log, first link to a backup device that stores the resulting backup file.

To create a new backup device using a wizard:

1 Open a creation wizard for a backup device. For details, see

Open an Object Wizard

.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Backup Devices (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object.

28 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

B

ACKUP

D

EVICES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a backup device, this tab/panel lets you work with the following settings:

Setting

Name

Device Type

Skip ANSI Labels

Physical Name

Description

Lets you provide a logical name for the backup device.

For Microsoft SQL Server 2005, DISK and TAPE are supported. For Microsoft SQL Server

2000, DISK, TAPE, and PIPE are supported.

Available only with a Device Type of TAPE, ANSI tape labels are ignored if this check box is enabled.

The physical name of the device. This value can be any simple file name (sqltable.dat for example) or full path (a:\sqltable.dat for example) that is recognized by the operating system.

D

ATABASE

W

IZARD

(SQL S

ERVER

)

The Database Wizard presents you with a different set of options based on your server version to create the database accurately on each platform.

TIP:

Microsoft SQL Server recommends that you do not create any user objects, such as tables, views, stored procedures, or triggers, in the master database. The master database includes the system tables that store the system information used by SQL

Server, such as configuration option settings.

To create a new database using a wizard:

1

Open an Object Wizard

for a database.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Options panel - for details, see Databases (SQL Server) - Options .

Placement panel - for details, see

Databases (SQL Server) - Placement .

Transaction Log panel - for details, see Databases (SQL Server) - Transaction Log

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D

ATABASES

(SQL S

ERVER

) - O

PTIONS

When creating or editing a database, this tab/panel lets you work with the following settings:

Setting

Name

Description

Provide a name for the database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 283

C RE A T I N G O B J E C TS

Setting

Attach existing OS files

Compatible Level

Properties group

Description

To create a database from an existing set of operating system files, there must be a

<filespec> entry for the first PRIMARY file. The PRIMARY filegroup contains all the database system tables. Primary files have a .mdf extension.

Select a version compatibility level.

Select the following settings: ANSI null default, ANSI nulls, ANSI padding, ANSI warnings,

auto create statistics, auto update statistics, autoclose, autoshrink, concat null yields

null, cursor close on commit, arithabort, db chaining, dbo use only, default to local

cursor, merge publish, numeric roundabout, offline, published, quoted identifier, read

only, recursive triggers, select into/bulkcopy/pllsort, single user, subscribed, torn page

detection, and trunc log on chkpt.

D

ATABASES

(SQL S

ERVER

) - P

LACEMENT

Indicate the file where you want the database to live. For example, a new Books database could include author and title filegroups.

By default, when you open the Wizard and click the Placement tab, a filegroup definition, using the name you provided for the database and default settings, is displayed. For each filegroup to be added, click the New button, provide a Device File Name for the filegroup, and use the File

Group Properties and Device File Properties groups to provide the attributes of the filegroup.

Use the Delete button to delete a selected filegroup.

D

ATABASES

(SQL S

ERVER

) - T

RANSACTION

L

OG

The transaction log file is a required file for each database. This file holds the log information to recover the database. There can be multiple log files for a database, but there has to be at least one. Traditionally the logfile extension has been .ldf.

By default, when you open the Wizard and click the Transaction Log tab, a transaction log file definition, using the name derived from the name you provided for the database and with default settings, is displayed. For each file to be added, click the New button, provide a Device

File Name, and use the Log Device Properties group to provide the attributes of the file.

Use the Delete button to delete a selected file.

NOTE:

As you complete the wizard, be aware that the Primary file contains startup information for the database and is also used to store data. The transaction log files hold the information used to recover the database.

28 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

D

ATABASE

T

RIGGERS

W

IZARD

(SQL S

ERVER

)

This wizard builds and submits a CREATE TRIGGER... ON DATABASE statement, letting you create a DDL trigger with database scope, that fires in response to selected DDL events. The wizard builds basic syntax only, letting you provide the actions and conditions SQL making up the main body of the trigger.

NOTE:

This functionality is available for SQL Server 2005 and up.

NOTE:

Before working with database triggers, consult Microsoft SQL Server documentation for general information on DDL triggers as well as specifics such as FOR/AFTER argument details, valid actions and conditions, and supported events. For more

information, see Accessing Third Party Documentation .

To create a new database trigger using a wizard:

1

Open an Object Wizard

for a database trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Database Triggers (SQL Server) - Properties .

Trigger Events panel - for details, see Database Triggers (SQL Server) - Trigger Events .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

NOTE:

In order to fire in response to specified events, a database trigger must be enabled.

For information on enabling and disabling a database trigger, see

Database Triggers

Editor (SQL Server)

and

Change Status (SQL Server DDL triggers) .

D

ATABASE

T

RIGGERS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a database trigger, this tab/panel lets you work with the following settings:

Setting

Name

Trigger Timing

Encrypted

Description

Provide a name for the DDL trigger.

Use this control to specify a FOR/AFTER argument option. The specific events for the argument are provided on the Trigger Events tab/panel.

Select this check box to add a WITH ENCRYPTION argument to the generated DDL. This prevents the trigger from being published as part of a SQL Server replication.

D

ATABASE

T

RIGGERS

(SQL S

ERVER

) - T

RIGGER

E

VENTS

When creating or editing a database trigger, this tab/panel lets you specify the FOR/AFTER argument appearing in the generated CREATE TRIGGER... ON DATABASE syntax. For each event that is to fire this trigger, select the associated check box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 285

C RE A T I N G O B J E C TS

D

EFAULT

W

IZARD

(SQL S

ERVER

)

When bound to a column or user-defined object, a default ensures that a specific value will be inserted into the column where the object will be bound if no explicit value is given.

The Default Wizard lets you name the default and specify its value.

To create a new default using a wizard:

1

Open an Object Wizard

for a default.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Defaults (SQL Server) - Properties

.

Dependencies panel - Defaults (SQL Server) - Dependencies

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D

EFAULTS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a default, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Value

Description

Select the schema that is to own the default.

Provide a name for the default.

Provide the value of the default.

D

EFAULTS

(SQL S

ERVER

) - D

EPENDENCIES

From the Type dropdown, choose Column or Datatype, and if you chose Column, choose a

Table from the Table dropdown. The list on the left is populated with candidate columns or datatypes. To move a candidate from the list on the left to the dependencies column on the right, select the candidate and click Add. Remove columns or datatypes from the dependencies list on the right by selecting the column or datatype and clicking Remove.

E

XTENDED

P

ROCEDURE

W

IZARD

(SQL S

ERVER

)

Extended Procedures are dynamic link libraries that can be used to load and execute application routines written in other programming languages, such as C or Visual Basic. Extended

Procedures function and appear in the same manner as SQL Server stored procedures in that you can pass parameters to them and obtain results.

28 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Extended stored procedures provide a method for calling procedural language functions from within the Adaptive Server.

NOTE:

Extended procedures can only be created in the Master database.

To create a new Extended procedure using a wizard:

1

Open an Object Wizard

for an extended procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Extended Procedures (SQL Server) - Properties

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

E

XTENDED

P

ROCEDURES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing an extended procedure, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Library

Description

Select the owner of the extended procedure.

Provide a name for the extended procedure.

Provide the name of the DLL containing the extended procedure.

F

OREIGN

K

EY

W

IZARD

(SQL S

ERVER

)

Foreign keys are unique values that refer to specific columns of other tables. Thus, a foreign key links two tables together. Embarcadero DBArtisan’s Foreign Key Wizard makes it easy for you to create a relational link between two tables, thereby speeding queries and giving you faster access to data. The column in the initial table, the parent table, is called the primary key. The corresponding column in the (child) table that references the primary key, is the foreign key.

Foreign keys can also refer to columns within the same table.

To create a new Foreign Key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Foreign Keys (SQL Server) - Properties .

Column Mapping panel -

Foreign Keys (SQL Server) - Column Mapping

.

DDL View panel - for details, see

Create the New Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 287

C RE A T I N G O B J E C TS

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

F

OREIGN

K

EYS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Name

Enabled

Description

Select the owner and name of the table for which the foreign key is being created.

Provide a name for the foreign key.

Enables or disables the foreign key.

Not For Replication Replication copies and distributes data and database objects from one database to another and then synchronizes information between databases for consistency.

Delete Rule

If you choose the CASCADE option, all rows containing data involved with the foreign key will be deleted after a delete operation.

Update Rule

If you choose the CASCADE option, all rows containing data involved with the foreign key will be deleted after an update operation.

F

OREIGN

K

EYS

(SQL S

ERVER

) - C

OLUMN

M

APPING

Under Referenced Table, choose the Owner and then the Name of the referenced, or parent, table.

Under the Main Table, select check boxes corresponding to the columns that are to reference columns in the referenced table. Then, under Referenced Table, select the corresponding column check boxes.

F

ULL

-

TEXT

C

ATALOGS

W

IZARD

(SQL S

ERVER

)

This wizard builds and submits a CREATE FULLTEXT CATALOG statement. This lets you add a full-text catalog to a database, specifying accent sensitivity and an owner, and letting you define the catalog as the default full-text catalog. Against SQL Server 2005 datasources, you can also provide filegroup and root directory details.

Along with full-text indexes, full-text catalogs facilitate full-text searching. For related

information, see Full-text Indexes Wizard (SQL Server) .

NOTE:

This functionality is available as of SQL Server 2005.

NOTE:

Full-text catalogs cannot be created in the master catalog.

NOTE:

Before working with full-text catalogs, consult Microsoft SQL Server documentation for general information on full-text searching and detailed information on topics such as restrictions on where these objects can be created, required permissions, virtual object and filegroup considerations, and the relationship with full-text indexes and the default

collation. For more information, see Accessing Third Party Documentation

.

28 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new full-text catalog using a wizard:

1

Open an Object Wizard

for a full-text catalog.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Full-text Catalogs (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

ULL

-

TEXT

C

ATALOGS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a full-text catalog, this tab/panel lets you work with the following settings:

Setting

Name

Filegroup (SQL Server

2005 only)

Path (SQL Server 2005 only)

Accent Sensitive

Default

Authorization Owner

Description

Provide a name for the catalog.

Selecting a filegroup adds an explicit ON FILEGROUP clause, specifying the selected filegroup to which the catalog will belong. If not specified, the new catalog will be part of the default filegroup used for all full-text catalogs.

Specifying a path adds an explicit IN PATH clause, specifying the root directory for the catalog. If no path is specified, the new catalog will be located in the default directory specified during setup.

Lets you specify a WITH ACCENT_SENSITIVITY = ON/OFF clause, reflecting the selected/deselected status of the check box.

Select this check box to add an AS DEFAULT argument, specifying that this catalog is the default full-text catalog. If an existing full-text catalog is currently specified as the default, this catalog becomes the new default.

Select a user or role to add an AUTHORIZATION argument that sets the owner of the full-text catalog.

F

ULL

-

TEXT

I

NDEXES

W

IZARD

(SQL S

ERVER

)

This wizard lets you build and submit a CREATE FULLTEXT INDEX statement, adding a full-text index for a table or indexed view. Along with full-text catalogs, full-text indexes facilitate full-text searching.

NOTE:

This functionality is available as of SQL Server 2005.

NOTE:

Full-text indexes cannot be created in the master catalog.

NOTE:

Before working with full-text indexes, consult Microsoft SQL Server documentation for general information on full-text searching and detailed information on topics such as required permissions, column specification details, recommended datatype, and XML

considerations. For more information, see Accessing Third Party Documentation

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 289

C RE A T I N G O B J E C TS

To create a new full-text index using a wizard:

1

Open an Object Wizard

for a full-text index.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Full-text Indexes (SQL Server) - Properties .

Columns panel - for details, see Full-text Indexes (SQL Server) - Columns .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

For related information, see Full-text Catalogs Wizard (SQL Server)

.

F

ULL

-

TEXT

I

NDEXES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a full-text index, this tab/panel lets you work with the following settings:

Setting

Parent Type

Parent Schema

Parent Name

Key Index

Description

Select table or indexed view.

The parent’s owning schema.

Select the name of the table or indexed view on which the index is to be created.

Select the unique key index on the table or view that will be used as the value for the KEY

INDEX argument.

Full-text Catalog Name

Select an existing full-text catalog. For information on creating full-text catalogs, see Fulltext Catalogs Wizard (SQL Server) . If you do not select a catalog, SQL Server will assign

the index to the default full-text catalog, generating an error if no default exists.

Filegroup Name (SQL

Server 2008 ^)

Select the filegroup that the index is to be created on. Specifying no filegroup results in

SQL Server default behavior, placing the index in the same filegroup as the base table or view for a non-partitioned table or in the PRIMARY filegroup for a partitioned table.

Change Tracking

Stoplist (SQL Server

2008 ^)

Select a CHANGE_TRACKING argument value of MANUAL, AUTO, OFF, or OFF, NO

POPULATION to specify whether changes to columns covered by the full-text index will be propagated to the full-text index.

Select a STOPLIST argument value of OFF to specify that no stoplist be associated with the index or SYSTEM to specify that the default full-text system STOPLIST be used for this index.

F

ULL

-

TEXT

I

NDEXES

(SQL S

ERVER

) - C

OLUMNS

When creating or editing a full-text index, this tab/panel lets you specify the columns that make up the index:

• For each column to include in the full-text index, select the associated Indexed check box.

• Optionally, select a language from the associated Language column.

29 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• For varbinary(max) and image columns, provide a TYPE COLUMN argument filename extension.

F

UNCTION

W

IZARD

(SQL S

ERVER

)

Functions are subroutines that you define so you can reuse code without having to reinvent the wheel each time. You can use functions to determine the best methods for controlling access and manipulation of the underlying data contained in an object. A function returns a value, unlike a stored procedure, which does not.

• To create a user-defined function, you need CREATE ANY privileges or IMPLICIT_SCHEMA authority on the database if the schema does not already exist.

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Functions (SQL Server) - Properties

.

Definition panel - for details, see

Functions (SQL Server) - Definition .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

F

UNCTIONS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a function, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Schema Binding

Encryption

Description

Select the owner of the function.

Provide a name for the function.

Choose whether the function is bound to database objects that it references.

Choose whether SQL Server encrypts table columns that contain the text of the CREATE

FUNCTION statement.

F

UNCTIONS

(SQL S

ERVER

) - D

EFINITION

Complete the CREATE FUNCTION outline provided by typing or pasting the body of the

function. Finally, use the Schedule or Execute buttons to Create the New Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 291

C RE A T I N G O B J E C TS

I

NDEX

W

IZARD

(SQL S

ERVER

)

Like an index in a book, a table index helps you get at the data you want without having to read through the whole table. Indexes can exist on single column or on multiple columns. Indexes appear in the form of B-trees. And, as for books, you can have multiple indexes for a single table. You can also create indexes for a view.

To create a new index using a wizard:

1

Open an Object Wizard

for an extended procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Indexes (SQL Server) - Properties

.

Columns panel -

Indexes (SQL Server) - Columns .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

I

NDEXES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Parent Type

Parent Owner

Parent Name

Name

Build Online

Max degree of parallelism

Index Type

Clustered

Description

Select TABLE or VIEW.

Select the owner of the table or view.

Select the specific table or view containing the columns you want to index.

Provide a name for the index.

Enabling this feature specifies that the ONLINE=ON clause is used when creating this object and can subsequently be used when rebuilding or dropping this object.

Lets you specify a MAXDOP index operation value, limiting the number of processors used in parallel plan execution.

Select UNIQUE or NONUNIQUE. An index is unique when no two rows are permitted to have the same index value. (Note: A clustered index on a view must be unique.) If an INSERT or

UPDATE statement creates a duplicate value, the operation may fail.

A clustered index is one in which the physical order of rows matches the order of indexed rows. A table or view can only have one clustered index at a time.

In a nonclustered index, the physical order of rows is independent of the indexed order of rows.

For an indexed view, you can only create a nonclustered index if there is already a clustered index extant.

With this check box enabled, subsequent rebuild and drop operations offer an online option.

29 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Ignore Duplicate

Key

Statistics

Recompute

Partitioned

Partition Scheme

Partition Column

Filegroup

Pad Index

Sort in TempDB

Allow Row Locks and Allow Page

Locks

Description

This option controls what happens when an attempt is made to insert a duplicate key value into a column that is part of a unique clustered index.

If the option is selected and an INSERT statement that creates a duplicate key is executed,

SQL Server issues a warning and ignores the duplicate row.

If not selected, SQL Server issues an error message and rolls back the entire INSERT statement.

Enabling this feature means queries involving the table run at the optimal level as distribution statistics are updated automatically when the index is created. If you disable this option, you can compromise query performance.

When selected, an ON clause is added to the CREATE TABLE statement, letting you specify a

Partition Scheme, partitioning this table.

This property is only available if the Partitioned check box is selected.

Select the partition scheme that specifies the filegroup mapping for this table. For information on creating partition schemes, see

Partition Scheme Wizard (SQL Server) .

This property is only available if the Partitioned check box is selected.

Select the column that the index will be partitioned against.

This property is only available if the Partitioned check box is not selected.

Select an existing, named filegroup to have the index stored on the specified filegroup.

Select PRIMARY to have the index stored on the default database filegroup.

Enable or disable padding of index pages.

Select to store the intermediate index sort results in tempdb. This option may reduce the time needed to create an index if tempdb is on a different set of disks than the user database, but it increases the amount of disk space used to create an index. In addition to the space required in the user database to create the index, tempdb must have about the same amount of additional space to hold the intermediate sort results.

Lets you enable locking granularity at the page and row level (Default=TRUE)

NOTE: You cannot reorganize an index (primary key, or unique key) that has an Allow Page

Locks property set to FALSE. For information on reorganizing indexes, see Reorganize (SQL

Server indexes, primary keys, and unique keys) .

I

NDEXES

(SQL S

ERVER

) - C

OLUMNS

From the Column dropdown, select a column for the index and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

J

OBS

W

IZARD

(SQL S

ERVER

)

This wizard lets you create SQL Agent jobs. It lets you specify a category, set up associated notifications, create a step structure, set up schedules, work with associated alerts, and define a single or multiple server targets for the job.

NOTE:

For an overview of SQL Agent service support provided by DBArtisan, see

SQL Server

Agent

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 293

C RE A T I N G O B J E C TS

To create a new job using a wizard:

1

Open an Object Wizard

for a job.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details see Jobs (SQL Server) - Properties .

Steps panel - for details see Jobs (SQL Server) - Steps .

Schedules panel - for details see Jobs (SQL Server) - Schedules .

Alerts panel - for details see Jobs (SQL Server) - Alerts .

Target panel - for details see Jobs (SQL Server) - Target .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

For information on related SQL Agent elements, see the following topics:

Alerts Wizard (SQL Server)

Operators Wizard (SQL Server)

J

OBS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a SQL Agent job, this tab panel provides most settings of an sp_add_job call, letting you specify an enabled/disabled status and select a category, as well as specify notify and delete levels for the job. This tab has the following settings:

Category

Creation

Notifications

Setting

Owner and Name

Category

Description

Let you provide basic identification details.

Lets you select the category to which the job belongs.

Lets you provide a textual description for the job.

Enabled

Lets you specify whether the job is enabled or disabled.

Each subcategory lets you specify when notifications should be sent or jobs deleted (NEVER,

WHEN JOB SUCCEEDS, WHEN JOB FAILS, or WHEN JOB COMPLETES).

The Email, Page, and Net send subcategories let you select the specific operator to which notifications are directed. For information on creating operators, see

Operators Wizard (SQL

Server)

.

The Windows application event log subcategory lets you select when an entry is placed in the

Microsoft Windows application log for this job.

The Job Deletion subcategory lets you select when a job is deleted.

29 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

J

OBS

(SQL S

ERVER

) - S

TEPS

When creating or editing a job, this tab/panel lets you work with the steps for the job. You can use it to create one or more sp_add_jobstep calls that will be included as part of the job definition DDL.

To add a step to the job

1 Click the Add Step button, provide a Name for the step and press TAB or ENTER.

DBArtisan adds the step to the step list with a set of default properties.

2 Modify the default properties using the table below as a guide.

NOTE:

Properties available differ by the subsystem Type you select.

Setting

Is start step

Type

Database

Database user name

Command

On success action

Retry attempts

Retry interval

On fail action

Output file

Append output to file,

Log to table

(overwrite), Log to

table (append), and

Output to history

Description

Lets you designate this step as the first step in the job.

Note that at least one step must have this check box selected. If you deselect this check box, the change does not actually take effect until you select the check box in another step.

Lets you select the subsystem used by the SQL Server Agent service to execute the step:

ACTIVESCRIPTING, CMDEXEC, DISTRIBUTION, SNAPSHOT, LOGREADER, MERGE,

QUEUEREADER, ANALYSISQUERY, 'ANALYSISCOMMAND, DTS, POWERSHELL (SQL

Server 2008 only), or TSQL.

The name of the database in which to execute the step.

The user account to use when executing the step.

The commands to be executed by the SQLServerAgent service through subsystem.

The job action to perform (QUIT WITH SUCCESS, QUIT WITH FAILURE, GO TO NEXT

STEP, GO TO STEP: [N] STEPNAME) if the step succeeds.

The number of retry attempts to use if the step fails.

The duration, in minutes, between retry attempts.

The job action to perform (QUIT WITH SUCCESS, QUIT WITH FAILURE, GO TO NEXT

STEP, GO TO STEP: [N] STEPNAME) if the step fails.

The name of the file in which the output of this step is saved

Lets you set the flags that control how the output file is written.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 295

C RE A T I N G O B J E C TS

To modify a job step

1 Select a step from the step list, and modify properties accordingly.

To delete a step from the job

1 Select a step from the step list and click Delete. If you delete the step that currently has the

Is start step check box selected, the next lower step in the list becomes the first step. If there was no step below the deleted step, the first step in the list has its Is start step check box selected.

To change the order for a step

1 Select a step from the step list, and use the arrow buttons to move the step up or down one position.

J

OBS

(SQL S

ERVER

) - S

CHEDULES

When creating or editing a job, this tab/panel lets you manage the schedules for a job.

Specifically, you can:

• Create new schedules for this job

• Add schedules that were defined in other job definitions

• Delete schedules currently associated wit the current job definition

• Display all jobs using a selected schedule

To add a schedule

1 Click New, provide a Name for the schedule and press TAB or ENTER. DBArtisan adds the schedule to the schedule list with a set of default properties.

2 Select a frequency Type: START AUTOMATICALLY WHEN SQL SERVER AGENT STARTS,

START WHENEVER THE CPUS BECOME IDLE (SQL Server 2005 and up), ONE TIME, DAILY,

WEEKLY, MONTHLY, or MONTHLY RELATIVE TO FREQUENCY INTERVAL.

3 Use the Enabled check box to enable or disable the schedule.

4 If you selected a Type of ONE TIME ONLY, use the One-time occurrence controls to provide the Date and Time of the one-tome occurrenc e.

29 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

5 If you selected a Type of DAILY, WEEKLY, MONTHLY, or MONTHLY RELATIVE TO

FREQUENCY INTERVAL, use the table below as a guide to providing details in the

Frequency, Daily Frequency, and Duration property groups.

Property group

Frequency

Daily Frequency

Duration

Type

Daily

Weekly

Monthly

Monthly relative to frequency interval

Daily

Description

Lets you specify the recurrence frequency, in days.

Lets you specify the recurrence frequency, in weeks., and the specific weekdays on which the job is to execute.

Lets you specify the recurrence frequency, in months, and the specific day of the month on which the job will execute.

Lets you specify the recurrence frequency, in months, and a relative weekday (such as the second Sunday) on which the job is to execute.

For the specific days on which the job is to execute, this group lets you specify whether the job is to execute once per day or several times per day.

If you select the Occurs once check box, use the at control to specify the schedule time.

If you deselect the Occurs once check box, use the remaining controls to specify an hourly recurrence frequency, and a start and end time within the day when the schedule is active.

Use these controls to specify the start and end dates for a fixed duration schedule. For an open-ended schedule, provide a start date and select the No end date check box.

To delete a schedule from the schedule list

1 Select a schedule from the schedule list and click Remove.

To copy an already existing schedule definition to the current job (SQL Server 2005 and up)

1 Click Pick. A Pick schedule for job dialog opens. The Available schedules list shows all schedules defined on this datasource.

2 Select the schedule that is to be added to the schedule list for this job definition and click

OK.

To display all jobs currently using a schedule in the schedule list

1 Select a schedule from the schedule list and click Jobs in schedule. A Jobs in schedule dialog opens, showing all jobs currently using the selected schedule.

J

OBS

(SQL S

ERVER

) - A

LERTS

When creating or editing a job, this tab/panel provides a convenient way to work with SQL

Agent alerts associated with this job. On opening, this tab provides a list of all alerts that specify this job as the target job to be executed in response to those alerts. When you execute the job that creates or edits this job, DDL to create all alerts on this tab is submitted.

NOTE:

Alerts cannot be created for multi-target jobs. They will be rejected by the server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 297

C RE A T I N G O B J E C TS

Manage the alerts list as follows:

• Click Add to create a new alert to be added to the list. This opens the Alert Wizard, with the

Execute Job check box selected and the Job Name box specifying the current job, both uneditable. For information on using the Alert Wizard, see

Alerts Wizard (SQL Server)

.

• Select an alert and click Edit to open an editor on the selected alert. The Execute Job check box and the Job Name box specifying the current job are both uneditable. For information

on using the Alert Wizard, see Alerts Editor (SQL Server) .

• Select an alert and click Remove to drop the selected alert from the alert list. DDL to create or alter the alert is not submitted when you execute the job that creates or edits this job. For existing alert definitions, this does not delete the definition nor does it modify the Execute

Job or Job Name controls.

J

OBS

(SQL S

ERVER

) - T

ARGET

When creating or editing a job, this tab/panel lets you specify a target server or servers for the job. The default setting, Target Local Server, specifies that the job will be executed on the local server. The Target Multiple Servers setting is only available in multiserver operation domains, with the selectable server names populated from the systargetservers table.

NOTE:

Alerts cannot be created for multi-target jobs. They will be rejected by the server.

To target a job at one or more servers in a multiple server environment

1 Select Target Multiple Servers.

2 Select the check box associated with each server on which the job will be executed.

L

INKED

S

ERVER

W

IZARD

(SQL S

ERVER

)

A linked server object represents a database system other than Microsoft SQL Server. The links are created through OLE DB datasources. OLE DB is a COM-based application programming interface (API) for accessing data. OLE DB supports accessing data stored in any format

(databases, spreadsheets, text files, and so on) for which an OLE DB provider is available. With a linked server you can execute commands against OLE DB datasources on different servers.

Linked servers let you issue distributed queries, commands, and so on.

The wizard prompts you to provide much of the same information you give when you initially register a server.

29 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new linked server using a wizard:

1 Open a creation wizard for a linked server. For details, see

Open an Object Wizard

.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Linked Servers (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object.

L

INKED

S

ERVERS

(SQL Server) - P

ROPERTIES

When creating or editing a linked server, this tab/panel lets you work with the following settings:

Group

General

Server Options

Settings and descriptions

If defining a linked server defined through Microsoft SQL Server, set the Is SQL Server check box. The name must be the server’s network name. Any tables retrieved from the server are from the default database defined for the login on the linked server.

If defining a linked server not defined through Microsoft SQL Server, clear the Is SQL Server check box and use the following options to provide OLE DB details:

Product Name - The product name of the OLE DB datasource to which you are linking.

Datasource - The name of the OLE DB provider managing access to the linked server.

OLE DB Provider Name - The name of the OLE DB provider managing access to the specified linked server.

Provider Location - The OLE DB location property corresponding to the linked server.

Provider Connection String - The OLD DB provider-specific connection string that identifies a unique datasource.

Catalog - The name of the catalog to be used when making a connection to the OLE DB provider.

RPC Out Server - Lets you select the server with RPC encryption.

RPC - Enables RPC encryption from the server.

Collation Compatible Server - Indicates Change DIstributed Query execution against linked servers. If you select this option, Microsoft SQL Server assumes that all characters in the linked server are compatible with the local server, with regard to character set and collation sequence (or sort order). This option is for Microsoft SQL Server 8.0 or later.

Lazy Schema Validation - This option lets you optimize performance by ensuring the query processor does not request metadata for any of the linked tables until data is actually needed from the remote member table. This option is for Microsoft SQL Server 8.0 or later.

Use Remote Collation and Collation Name - Let you indicate that the linked server should use remote collation and select the name of the collation. This option is for Microsoft SQL

Server 8.0 or later.

Query Timeout - Type the query timeout value. This option is for Microsoft SQL Server 8.0 or later.

Connection Timeout - Type the connection timeout value. This option is for Microsoft SQL

Server 8.0 or later.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 299

C RE A T I N G O B J E C TS

L

OGIN

W

IZARD

(SQL S

ERVER

)

The Login wizard lets you build and submit a CREATE LOGIN statement, adding a new SQL

Server, Windows, certificate-based, or asymmetric key-based login. The Login wizard also lets you:

• Add the login to fixed server roles

• Create user accounts for the login on selected databases

To create a new login using a wizard:

1

Open an Object Wizard

for a login.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Logins (SQL Server) - Properties .

Server Roles panel - for details, see Logins (SQL Server) - Server Roles .

Users panel - for details, see Logins (SQL Server) - Users .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

L

OGINS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a login, this tab/panel lets you work with the following properties:

Setting

Name

Default Database

Default Language

Account Type

Password

Check Policy

Description

Specifies a name for this login.

Lets you specify a DEFAULT_DATABASE argument, specifying a default database for this login.

Lets you specify a DEFAULT_LANGUAGE argument, specifying a default language for this login.

Lets you select one of the following login types:

STANDARD - (SQL Server logins) if you select this type, you must also provide Password and Check Policy values.

NTGROUP or NTUSER - (Windows logins) if you select one of these types, you must also provide a Domain value.

CERTIFICATE - (certificate-mapped logins) if you select this type, you must also provide a

Certificate value.

ASYMMETRIC KEY - (asymmetric key-mapped logins) if you select this type, you must also provide an Asymmetric Key value.

This is only available for an Account Type of STANDARD. It lets you provide a password for the login.

This is only available for an Account Type of STANDARD. If selected, login policies defined on the server apply to this login.

30 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Setting

Check Expiration

Must Change

Domain

Certificate

Asymmetric Key

C RE AT I N G O B J E C T S

Description

This is only available if Check Policy is selected. If selected, password expiration policies are applied to this login.

This is only available if Check Expiration is selected. If selected, the user will be prompted to change the password on the first login.

This is only available for an Account Type of NTUSER or NTGROUP. Lets you specify the domain name value that will be specified with the loginName argument

([<domainName>\<loginName>]).

This is only available for an Account Type of CERTIFICATE. It lets you specify the name of a certificate that is to be associated with this login. It lets you specify the name of a certificate that is to be associated with this login.

This is only available for an Account Type of ASYMMETRIC KEY. It lets you specify the name of an asymmetric key that is to be associated with this login.

L

OGINS

(SQL S

ERVER

) - S

ERVER

R

OLES

When creating or editing a login, this tab/panel builds sp_addsrvrolemember procedure calls that will be submitted along with the CREATE LOGIN statement issued by this wizard/editor.

This lets you add the login as a member of one or more fixed server roles by selecting the check boxes associated with those roles.

For information on editing fixed server roles, see Roles Editor (SQL Server)

.

L

OGINS

(SQL S

ERVER

) - U

SERS

When creating or editing a role, this tab/panel lets you build CREATE USER... FOR LOGIN statements that will be submitted with the CREATE LOGIN statement issued with this wizard/ editor. Maintain database user accounts for a login as follows:

• Add a user account for this login to a database by selecting a database from the Databases

where the Login does NOT have a User Account and clicking the Add button. This opens the SQL Server User wizard, letting you define a new user on that database. For more information, see

User Wizard (SQL Server)

.

• Remove a user account for this login from a database by selecting a database from the

Databases where the Login HAS a User Account and clicking the Remove button.

O

PERATORS

W

IZARD

(SQL S

ERVER

)

This wizard lets you create an SQL Agent operator. It also lets you assign a set of notifications sent to the operator for selected SQL Agent alerts.

NOTE:

For an overview of SQL Agent service support provided by DBArtisan, see

SQL Server

Agent

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 301

C RE A T I N G O B J E C TS

To create a new operator using a wizard:

1

Open an Object Wizard

for an operator.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details see Operators (SQL Server) - Properties .

Notifications panel - for details see Operators (SQL Server) - Notifications .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

For information on related SQL Agent elements, see the following topics:

Jobs Wizard (SQL Server)

Alerts Wizard (SQL Server)

O

PERATORS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a SQL Agent operator, this tab/panel lets you identify the operator, set an enabled/disabled status, specify the operators contact information, and set a pager duty schedule. Offering controls to build a basic sp_add_operator call, it has the following settings:

Property group

Creation

Pager on duty schedule

Setting

Name

Enabled

Email

Description

Provide a name for the operator.

Set the status of this operator to enabled or disabled.

Type the operator’s email address.

Pager Address

Net Send Address

Type the operator’s pager address.

Type the operator’s net send address.

Monday through Sunday Select the days that this operator is available for pages.

O

PERATORS

(SQL S

ERVER

) - N

OTIFICATIONS

When creating or editing an operator, this tab lets you select the SQL Agent alerts for which this operator will be notified. The selections are submitted as a set of sp_add_notification calls made after the sp_add_operator call used to create the operator or submit operator definition changes.

To assign one or more alerts to the operator currently being defined

1 Select one or more of the Email, Pager, or Net Send check boxes associated with an alert.

NOTE:

When editing an operator, this tab displays the status of the most recent attempts to notify this operator by email, pager and net send.

30 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

ARTITION

F

UNCTIONS

W

IZARD

(SQL S

ERVER

)

The Partition Functions Wizard lets you build and submit a CREATE PARTITION FUNCTION statement, specifying a range, input parameter type, and boundary values. Once created, the partition function can be referenced by the partition scheme used to create a partitioned table or index.

NOTE:

Before creating a partition function, consult Microsoft SQL Server documentation for detailed information on topics such as type restrictions and boundary value usage. For

more information, see Accessing Third Party Documentation .

To create a new partition function using a wizard:

1

Open an Object Wizard

for a partition function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Partition Functions (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

For related information, see the following topics:

Partition Scheme Wizard (SQL Server)

Index Wizard (SQL Server)

Table Wizard (SQL Server)

P

ARTITION

F

UNCTIONS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a partition function, this tab/panel lets you work with the following settings:

Setting Description

Name

Provide a name for the partition function.

Input Parameter Type

Select the data type of the column used for partitioning.

Range

Function Values

Select to which side of each functional value interval (LEFT, RIGHT) the functional value belongs, when interval values are sorted in ascending order from left to right.

Lets you specify the boundary values to include as FOR VALUES arguments to the

CREATE PARTITION FUNCTION statement. Each boundary value is a constant expression that can reference variables. The set of values provided define the partition points for an index or table partitioned using this function.

Use the New, Delete, Up, and Down buttons to create and maintain the value list.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 303

C RE A T I N G O B J E C TS

P

ARTITION

S

CHEME

W

IZARD

(SQL S

ERVER

)

The Partition Scheme Wizard builds and submits a CREATE PARTITION SCHEME statement, letting you specify a partition function and a file group mapping. Once created, the partition scheme can be referenced when creating a partitioned table or index.

NOTE:

Before creating a partition scheme, consult Microsoft SQL Server documentation for detailed information on topics such as the relationship between the partition function and filegroups specified. For more information, see

Accessing Third Party

Documentation .

To create a new partition wizard using a wizard:

1

Open an Object Wizard

for a partition scheme.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Partition Schemes (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

For related information, see the following topics:

Partition Functions Wizard (SQL Server)

Index Wizard (SQL Server)

Table Wizard (SQL Server)

P

ARTITION

S

CHEMES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a partition scheme, this tab/panel lets you work with the following settings:

Setting

Name

Partition Function

Filegroup Name

Description

Provide a name for the partition scheme.

Select the partition function that specifies the range, input parameter type, and boundary values for this partition scheme.

Lets you specify the names of the filegroups to store the partitions specified by the selected Partition Function.

Consult Microsoft SQL Server documentation for details on the relation ship between filegroups and partitions. For more information, see

Accessing Third Party

Documentation

.

Use the New, Delete, Up, and Down buttons to create and maintain the value list.

30 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

RIMARY

K

EY

W

IZARD

(SQL S

ERVER

)

Primary key constraints make sure that no duplicate values or NULLS are entered in the columns you specify. You can use primary key constraints to enforce uniqueness and referential integrity.

A table can only have a single primary key constraint.

The dialog box lets you specify the owner and table on which you want to place the primary key constraint.

To create a new primary key using a wizard:

1

Open an Object Wizard

for a primary key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Primary Keys (SQL Server) - Properties

.

Columns panel -

Primary Keys (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

P

RIMARY

K

EYS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Name

Build Online

Max degree of parallelism

Clustered

File Group

Fill Factor

Description

Choose the owner and name of the table in which the primary key is being created.

Provide a name of the primary key being created.

Enabling this feature specifies that the ONLINE=ON clause is used when creating this object and can subsequently be used when rebuilding or dropping this object.

Lets you specify a MAXDOP index operation value, limiting the number of processors used in parallel plan execution.

Enable or disable clustering.

With this check box enabled, subsequent rebuild and drop operations offer an online option.

If you do not specify a filegroup, Microsoft SQL Server creates the index in the default filegroup.

This specifies how full each index page that’s storing data should be. The fill factor is a percentage value between 0 and 100.

Primary Keys (SQL Server) - Columns

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 305

C RE A T I N G O B J E C TS

P

ROCEDURE

W

IZARD

(SQL S

ERVER

)

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly.

The Procedure Wizard lets you:

• Name the procedure and specify its body.

• Specify any execution options and you can encrypt the stored procedure text in syscomments.

To create a new procedure using a wizard:

1

Open an Object Wizard

for a procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Procedures (SQL Server) - Properties

.

Definition panel - for details, see

Procedures (SQL Server) - Definition .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

P

ROCEDURES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a procedures, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Procedure Number

Replication

Recompile

Encryption

Description

Select the owner of the procedure.

Provide a name for the procedure

Optionally, provide a procedure number. By using a number, you can group procedures of the same name together. This also enables you to drop them using only one DROP

PROCEDURE statement. So, the procedures bill;1, bill;2, bill;3, etc. will be dropped simultaneously when the time comes.

This option creates a procedure that is used as a stored procedure filter and is executed only during replication.

The plan for this procedure will not be cached and the procedure is recompiled when it is run. This option is appropriate when you’re using atypical or temporary values and you don’t want to override the execution plan cached in memory.

If you select this option, SQL Server will encrypt the syscomments table entry containing the text of the CREATE PROCEDURE statement. It keeps the procedure from being published as part of replication.

30 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

ROCEDURES

(SQL S

ERVER

) - D

EFINITION

Complete the CREATE PROCEDURE outline provided by typing or pasting the body of the

procedure. Finally, use the Execute button to Create the New Object

.

R

EMOTE

S

ERVER

W

IZARD

(SQL S

ERVER

)

Remote Servers are servers on a network that you can access through your local server. Instead of logging directly into a remote server, you can log into your local server and execute a remote procedure call to it.

NOTE:

Only stored procedures are allowed against remote servers. You can use a linked server to execute distributed queries and stored procedures.

Before beginning

Before you can set up a remote server, you first configure both the local and remote servers to accept remote access. To configure the Microsoft SQL Servers for remote access, you need to log into each server. The table below describes the parameters you need to configure on each server:

Parameter

Remote Access

Remote Connections

Remote Logins

Remote Sites

Description

1(enabled)

Number of remote connections required

Number of remote logins required

Number of remote sites required

After setting these server configuration parameters, shutdown and restart the server so the new values can take effect.

To create a new remote server using a wizard:

1 Open a creation wizard for a remote server. For details, see Open an Object Wizard

.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Remote Servers (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 307

C RE A T I N G O B J E C TS

R

EMOTE

S

ERVERS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a remote server, this tab/panel lets you work with the following settings:

Setting

Name

Server Type

Publication Server

Distribution Server

Subscription Server

Description

The name for the remote server.

Lets you specify a server type of LOCAL or REMOTE. The local server routes all commands to the remote server. To communicate with a remote server, you log into a local server and submit your remote procedure calls for remote servers. The remote server receives remote procedure calls from the local server and processes them accordingly.

Select if the server is to publish data for replication.

Select If the server is to manage the distribution database.

This option applies if you want to deploy a subscription management application from the remote server.

Select if the server is both a subscriber and publisher of replicated data.

Publisher/Subscriber

Server

Collation Compatible

Server

RPC Out Server

Select if the server is to be collation compatible.

Select if the server is to serve as a RPC Out server.

R

OLE

W

IZARD

(SQL S

ERVER

)

Roles are sets of user privileges you associate with access to objects within a database. Roles streamline the process of granting permissions. You can use roles to grant sets of permissions and privileges to users and groups. Roles can help you comply with Sarbanes Oxley regulations by limiting which users can have access to what privileges, for example a Human Resources Role versus an Accounting Role.

To create a new role using a wizard:

1 Open a creation wizard for a role. For details, see Open an Object Wizard .

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Roles (SQL Server) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object.

After you click Finish and the role has been created, the Roles Editor open. You can then assign object and system privileges to the role and determine which users can take part in the role. For more information, see

Roles Editor (SQL Server) .

30 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

R

OLES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a role, this tab/panel lets you work with the following settings:

Setting

Name

RoleType

Authorization Owner

Password

Description

The name used to reference the role.

The value can be NONE, APPLICATION, or STANDARD.

Only required with a Role Type of STANDARD.

Only required with a Role Type of APPLICATION.

R

ULE

W

IZARD

(SQL S

ERVER

)

Rules promote data integrity by allowing you to validate the values supplied to a table column.

They are reusable objects that you can bind to table columns or user datatypes. Check constraints are similar to rules, and are in fact the preferred way of restricting data. A column or user-defined data type can have only one rule bound to it, but a column can have both a rule and one or more check constraints associated with it. Not that a rule cannot apply to data already existing in the database at the time you’re creating the rule and can’t be bound to a system-created data type. If you create a new rule when one already exists, the new rule will override the previous one.

To create a new rule using a wizard:

1

Open an Object Wizard

for a rule.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Rules (SQL Server) - Properties .

Dependencies panel - Rules (SQL Server) - Dependencies .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

R

ULES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a rule, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Restriction

Description

Select the Owner of the rule.

Provide a name for the rule.

Type the condition. The rule restriction is the condition that defines the rule and can be any expression valid in a WHERE clause and can include such elements as arithmetic operators, relational operators, and predicates (for example, IN, LIKE, BETWEEN).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 309

C RE A T I N G O B J E C TS

R

ULES

(SQL S

ERVER

) - D

EPENDENCIES

From the Type dropdown, choose Column or Datatype, and if you chose Column, choose a

Table from the Table dropdown. The list on the left is populated with candidate columns or datatypes. To move a candidate from the list on the left to the dependencies column on the right, select the candidate and click Add. Remove columns or datatypes from the dependencies list on the right by selecting the column or datatype and clicking Remove.

S

CHEMA

W

IZARD

(SQL S

ERVER

)

DBArtisan lets you create a schema on Microsoft SQL Server.

To create a new schema using a wizard:

1

Open an Object Wizard

for a schema.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Schema (SQL Server) - Properties .

Permissions panel -

Schema (SQL Server) - Permissions

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

S

CHEMA

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a schema, this tab/panel lets you provide a Name and select the

Owner of the schema.

S

CHEMA

(SQL S

ERVER

) - P

ERMISSIONS

For each specific permission to be granted, select the cell corresponding to the name and specific permission, and click the Grant button. To revoke a privilege, select a cell showing a

Granted permission and click Revoke.

31 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

S

ERVER

T

RIGGERS

W

IZARD

(SQL S

ERVER

)

This wizard builds and submits a CREATE TRIGGER... ON ALL SERVER statement, letting you create a DDL trigger with server scope, that fires in response to either a logon or selected DDL events. The wizard builds basic syntax only, letting you provide the actions and conditions SQL making up the main body of the trigger.

NOTE:

This functionality is available for SQL Server 2005 and up.

NOTE:

Before working with server triggers, consult Microsoft SQL Server documentation for general information on DDL triggers as well as specifics such as FOR/AFTER argument details, valid actions and conditions, and supported events. For more information, see

Accessing Third Party Documentation

.

To create a new server trigger using a wizard:

1

Open an Object Wizard

for a server trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Server Triggers (SQL Server) - Properties .

Trigger Events panel - for details, see Server Triggers (SQL Server) - Properties .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

NOTE:

In order to fire in response to logons or specified events, a server trigger must be enabled. For information on enabling and disabling a server trigger, see

Server

Triggers Editor (SQL Server)

and Change Status (SQL Server DDL triggers)

.

S

ERVER

T

RIGGERS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a server trigger, this tab/panel lets you work with the following settings:

Setting

Name

Trigger Timing

Fire On Logon

Encrypted

Description

Provide a name for the DDL trigger.

Use this control to specify a FOR/AFTER argument option. If the Fire On Logon check box is not selected, the specific events for the argument are provided on the Trigger

Events tab/panel.

If selected, the CREATE TRIGGER statement is created with a FOR/AFTER LOGON argument, associating the DDL trigger with a user logon. If deselected, the trigger is associated with the event(s) selected on the Trigger Events tab/panel.

Select this check box to add a WITH ENCRYPTION argument to the generated DDL. This prevents the trigger from being published as part of a SQL Server replication.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 311

C RE A T I N G O B J E C TS

S

ERVER

T

RIGGERS

(SQL S

ERVER

) - T

RIGGER

E

VENTS

When creating or editing a database trigger, this tab/panel lets you select the FOR/AFTER argument DDL events that will fire this trigger.

NOTE:

This tab/panel is only available if the Fire On Logon check box is deselected. For more information, see Server Triggers (SQL Server) - Properties .

S

YNONYM

W

IZARD

(SQL S

ERVER

)

This wizard builds and submits a CREATE SYNONYM statement, letting you build a one-part name that can be used in SQL statements instead of a fully-qualified, multi-part name.

To create a new synonym using a wizard:

1

Open an Object Wizard

for a wizard.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Synonyms (SQL Server) - Properties .

Permissions panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

S

YNONYMS

(SQL S

ERVER

) - P

ROPERTIES

When creating a synonym, this tab/panel lets you provide a synonym name and fully qualify the object name that it references. When editing a synonym, this tab/panel lets you view the synonym definition.

NOTE:

Before creating or editing a synonym, consult Microsoft SQL Server documentation for information on topics such as support for specific function and procedure types, and three-part and four-part name restrictions.

For assistance, see

Accessing Third Party

Documentation

.

The following table describes the available settings:

Setting

Schema and Name

Description

Use these setting to select an owner and type the one-part name that will be used to reference

Server, Database, Referenced

Object Type, Referenced Object

Owner, and Referenced Object

Name

Use these setting to select the specific object to which the synonym is to refer.

Optionally, you can use the server, database, and owner settings to construct a partially-qualified to fully-qualified name for the object.

The user interface will allow you to construct all valid, multi-part name variations

(for example: server.database.owner.object, database.owner.object,

owner.object, server...object).

31 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

T

ABLE

W

IZARD

(SQL S

ERVER

)

A table is a column-based arrangement of data in which the content of one column has a bearing on the other column(s). So, for example, a table might have a column for authors, another column for the books each author has written, and a third for the number of copies each title by a given author has sold. The data moves across the columns in rows.

You must have CREATE TABLE permissions to generate a new table.

To create a new table using a wizard:

1

Open an Object Wizard

for a table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Dependencies panel - Tables (SQL Server) - Properties

.

Columns panel - Tables (SQL Server) - Columns

.

Indexes panel - Tables (SQL Server) - Indexes .

Constraints panel - Tables (SQL Server) - Constraints .

Permissions panel - Set Permissions for an Object

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

T

ABLES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a table, this tab/panel lets you work with the following settings:

Setting

Schema

Name

ANSI_NULLS option

Partitioned

Partition Scheme

Filegroup

Text Image

Filegroup

Description

Select the owner of the table.

Provide a name for the table

By setting this option, you are setting ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, and

QUOTED_IDENTIFIER to on so the table can be used in an Indexed View.

When selected, an ON clause is added to the CREATE TABLE statement, letting you specify a

Partition Scheme, partitioning this index.

This property is only available if the Partitioned check box is selected.

Select the partition scheme that specifies the filegroup mapping for this index. For information on creating partition schemes, see

Partition Scheme Wizard (SQL Server) .

This property is only available if the Partitioned check box is not selected.

Select an existing, named filegroup to have the table stored on the specified filegroup. Select

PRIMARY to have the table stored on the default database filegroup.

Select an existing, named filegroup to have text, ntext, image, xml, varchar(max), nvarchar(max), varbinary(max), and CLR user-defined type columns stored on the specified filegroup. Select PRIMARY to have columns of those types stored on the default database filegroup.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 313

C RE A T I N G O B J E C TS

T

ABLES

(SQL S

ERVER

) - C

OLUMNS

Use the Add Column button to add the columns for the table. After providing a Name for a new column, you can modify column properties in the Property/Value list. Available properties depend on the datatype you choose as well as on the property values you select:

Computed and Computed Expression - Let you define a column as a computed column and provide the computed column expression.

Type - Lets you select a datatype (depending on the type, additional properties such as Size,

Width, and Scale may be available).

Identity Column - Select this check box to define the column as an identity column.

Allow Nulls - Select this check box to allow nulls in this column.

Default Collation - available for text/character datatypes, lets you specify a default collation.

Default Value - Lets you type a constant value or select a function returning a constant value to serve as the default for the column

Default Binding and Rule Binding - Let you bind a rule or default to a column.

Is Sparse - Available to columns that allow NULL values, optimizes storage of the column for null values. This property does apply to the following data types: text, ntext, image, timestamp, userdefined data type, geometry, or geography. Columns with default values, default or rule bindings, cannot be defined as sparse. Computed columns cannot be defined as Sparse, but the columns in the computed expression can be Sparse columns.

Optionally, you can select a column and modify its values or select a column and Delete it.

NOTE:

For SQL Server 2000, if you create a table with a Column datatype = text., you can set the storage and image values on the Storage Tab of the Tables Editor Storage Tab.

When you have a text datatype, the Storage Tab displays a Text In Row box where you can specify the maximum size to be stored.

NOTE:

Because the smalldatetime datatype stores dates and time with less precision than the datetime datatype, before outputting you use the CAST or CONVERT functions to convert any boxes with the smalldatetime datatype to either VARCHAR or datetime datatypes. For more information, see SQL Server Books Online, Transact-SQL

Reference.

T

ABLES

(SQL S

ERVER

) - I

NDEXES

Click Add to open the

Index Wizard (SQL Server)

.

T

ABLES

(SQL S

ERVER

) - C

ONSTRAINTS

Selecting a constraint type and clicking Add opens the object wizard for that object type. For details see:

Primary Key Wizard (SQL Server)

Unique Key Wizard (SQL Server)

31 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Foreign Key Wizard (SQL Server)

Create Synonym

T

RIGGER

W

IZARD

(SQL S

ERVER

)

Triggers are a special type of procedure that automatically fire when defined data modification operations (insert, update, or delete) occur on a target table or view. Triggers fire after an insert, update or delete, but belong to the same transaction as the data modification operation.

Triggers can be implemented to enforce business rules or referential data integrity.

Important Notes

• For more information on the syntax for Trigger bodies, consult the Microsoft SQL Server

Transact-SQL Documentation.

To create a new trigger using a wizard:

1

Open an Object Wizard

for a trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Triggers (SQL Server) - Properties

.

Definition panel - for details, see

Triggers (SQL Server) - Definition .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

NOTE:

You can use the Trigger Editor opens to create dependencies or alter the trigger statement.

T

RIGGERS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a trigger, this tab/panel lets you work with the following settings:

Setting

Parent Type

Parent Schema

Parent Name

Name

Description

Select the TABLE or VIEW on which the trigger is to be created.

Select the owner of the table or view on which the trigger is to be created.

Select the specific table or view in which the trigger is to be created.

Provide a name for the trigger.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 315

C RE A T I N G O B J E C TS

Setting

Trigger Timing

Fire On Insert

Fire On Update

Fire On Delete

Encrypted

Description

INSTEAD OF: This is the only option for a View trigger. An INSTEAD OF trigger fires in place of the triggering statement and will not make changes to the data unless the conditions of the INSTEAD OF statement are met first. So, your UPDATE execution statement is replaced by an INSTEAD OF UPDATE statement as a way to enforce particular business rules you establish.

AFTER: An AFTER trigger fires following the successful completion of the triggering action. So, for example, the trigger would fire after an UPDATE statement has executed and after constraints have been checked and verified.

An INSERT trigger must be associated with an INSERT statement. For example, if a data load operation doesn’t include an INSERT statement, the trigger won’t be invoked.

An UPDATE trigger can be associated with specific columns of the base table and will only be activated if those columns are updated.

A DELETE trigger is associated with a DELETE operation.

If you choose to encrypt the trigger, the trigger can’t be published as part of SQL Server replication.

4 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

RIGGERS

(SQL S

ERVER

) - D

EFINITION

Complete the CREATE TRIGGER outline provided by typing or pasting the body of the trigger.

Finally, use the Schedule or Execute buttons to

Create the New Object

.

U

NIQUE

K

EY

W

IZARD

(SQL S

ERVER

)

Unique keys can enforce logical keys that are not chosen as the primary key. In other words, you can use a unique key to ensure no duplicate values are entered in specific columns that are not a part of the primary key. Although you can only attach one primary key to a table, you can attach multiple unique keys. Also, you can use unique keys on columns that allow null values.

To create a new unique key using a wizard:

1

Open an Object Wizard

for a unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Unique Keys (SQL Server) - Properties .

Columns panel -

Unique Keys (SQL Server) - Columns .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

31 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

U

NIQUE

K

EYS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a unique key, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Name

Build Online

Max degree of parallelism

Clustered

File Group

Fill Factor

Description

Choose the owner and name of the table in which the unique key is being created.

Provide a name of the unique key being created.

Enabling this feature specifies that the ONLINE=ON clause is used when creating this object and can subsequently be used when rebuilding or dropping this object.

Lets you specify a MAXDOP index operation value, limiting the number of processors used in parallel plan execution.

Enable or disable clustering.

With this check box enabled, subsequent rebuild and drop operations offer an online option.

If you do not specify a filegroup, Microsoft SQL Server creates the unique key in the default filegroup.

This specifies how full each index page that’s storing data should be. The fill factor is a percentage value between 0 and 100.

U

NIQUE

K

EYS

(SQL S

ERVER

) - C

OLUMNS

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

U

SER

M

ESSAGE

W

IZARD

(SQL S

ERVER

)

The User Message wizard lets you create multiple-language versions of user messages, such as errors and warnings, associated with a single message number. Key properties include the severity level and whether the message is automatically written to the NT Event Log.

NOTE:

The user messages node only displays under the master database.

To create a new user message using a wizard:

1 Open a creation wizard for a user message. For details, see

Open an Object Wizard .

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

User Messages (SQL Server) - Properties .

Information panel - for details, see

User Messages (SQL Server) - Information .

Object Permissions and System Permissions panels - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 317

C RE A T I N G O B J E C TS

U

SER

M

ESSAGES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a user message, this tab/panel lets you work with the following settings:

Setting Description

Message Number

Lets you specify a message number. The number must be greater than 50,000. The wizard automatically loads a value one higher than the currently highest used message number, but you can override the value.

Severity

Lets you select a predefined severity level between 001 and 025. The levels and their meanings are indicated in the User Message editor.

Write to NT Event Log

Lets you specify that the message is always written to the Windows NT Event Log.

U

SER

M

ESSAGES

(SQL S

ERVER

) - I

NFORMATION

Lets you create the different language versions of the text for the message. The first version must be created in us_english. Click the Add new text for the user message button, and in the dialog box that opens, select a Language of us_english and provide the Message Text.

You can subsequently use the same process to create each different language version of the us_english message.

NOTE:

You cannot create two versions of a message for the same language.

This tab/panel also lets you edit and delete messages.

U

SER

W

IZARD

(SQL S

ERVER

)

The User Wizard lets you create a user who will then have access to the database where you are registering him or her. You can also identify the appropriate user group and the system privileges you want to assign to the new user.

To create a new user using a wizard:

1

Open an Object Wizard

for a user

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Users (SQL Server) - Properties .

Roles panel - Users (SQL Server) - Roles

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

31 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U

SERS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a user, this tab/panel lets you work with the following settings:

Setting

Login Name

Name

Description

Select the server login associated with this user.

Provide the user name.

U

SERS

(SQL S

ERVER

) - R

OLES

For each role to be assigned to the user, select the check box beside that role.

C RE AT I N G O B J E C T S

U

SER

D

ATATYPE

W

IZARD

(SQL S

ERVER

)

User datatypes promote domain consistency by streamlining the definition of commonly used table columns in a database. You can build a customized datatype from system datatypes and bind defaults and rules to it to enhance integrity. When you reference the user datatype in a column, the column assumes all of the properties of the user datatype.

To create a new user datatype using a wizard:

1

Open an Object Wizard

for a user datatype.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

User Datatypes (SQL Server) - Properties

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

SER

D

ATATYPES

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you work with the following settings:

Setting

Owner

Datatype

Type

Size

Allow Nulls

Default Binding

Description

Select the owner of the user datatype.

Provide a name for the datatype.

Select the base datatype.

Provide the size of the datatype.

Null has no explicitly assigned value. Null is not equivalent to zero or blank. A value of null is not considered to be greater than, less than, or equivalent to any other value, including another value of null.

Defaults promote data integrity by supplying a default value to a column if the user does not explicitly provide one. They are reusable objects that you can bind to user datatypes.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 319

C RE A T I N G O B J E C TS

Setting

Rule Binding

Description

Rules promote data integrity by allowing you to validate the values supplied to a column.

They are reusable objects that you can bind to user datatypes.

V

IEW

W

IZARD

(SQL S

ERVER

)

Views are SQL queries stored in the system catalog that customize the display of data contained in one or more tables. Views behave like tables because you can query views and perform data manipulation operations on them. However, views do not actually store any data. Instead, they depend on data contained in their base tables.

To create a new view using a wizard:

1

Open an Object Wizard

for a view.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Views (SQL Server) - Properties .

Definition panel - for details, see

Views (SQL Server) - Definition

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

V

IEWS

(SQL S

ERVER

) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Encryption

Schema Binding

Check Condition

Owner

Description

Select the owner of the view. The owner of the view must have SELECT privileges for the tables in the CREATE view statement or DBADM authority on the database that contains the table.

Provide a name for the view.

If you select this option, the view will not be published with SQL Server replication.

When you specify this option, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified

When a row is modified through a view, this option makes sure the data remains visible through the view after the modification is committed.

Select the owner of the view. The owner of the view must have SELECT privileges for the tables in the CREATE view statement or DBADM authority on the database that contains the table.

V

IEWS

(SQL S

ERVER

) - D

EFINITION

Complete the CREATE VIEW statement by typing or pasting in the relevant query.

32 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

M

Y

SQL

OBJECT WIZARDS

DBArtisan lets you create MySQL objects using the following wizards:

Database wizard (MySQL)

Foreign Keys wizard (MySQL)

Functions wizard (MySQL)

Indexes, Primary Keys, or Unique Keys wizard (MySQL)

Tables wizard (MySQL)

Users wizard (MySQL)

D

ATABASE WIZARD

(M

Y

SQL)

The MySQL Database Wizard lets you build and execute a basic CREATE DATABASE statement and grant privileges on the database.

To create a new database using a wizard:

1

Open an Object Wizard

for a database.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Databases - Properties

Privileges panel - Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 321

C RE A T I N G O B J E C TS

D

ATABASES

- P

ROPERTIES

When creating or editing database, this tab/panel lets you work with the following settings:

Setting

Database Name

Default Character Set

Collation

Description

The database name you choose can be up to 64 characters long. Feel free to use all alphabetic characters or mix in some special or numeric characters. But a name cannot be exclusively special or numeric characters.

This is the character set for a language or alphabet. If you do not make a selection from the drop-down list (click the arrow to see the choices), the database will use the server’s default character set.

The collation encodes the rules governing character used for a language (like Greek) or an alphabet. The database will use the server’s default collation unless you specify otherwise.

NOTE:

It’s possible to create databases with different character sets and collations on the same MySQL server.

F

OREIGN

K

EYS WIZARD

(M

Y

SQL)

The MySQL Foreign Keys Wizard lets you build and execute an ALTER TABLE statement with an

ADD CONSTRAINT option implementing a foreign key.

The wizard makes it easy for you to create a relational link between two tables, thereby speeding queries and giving you faster access to data. By using the Create Foreign Key Wizard you obviate the need for remembering the code underlying the creation process.

To create a new foreign key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Foreign Keys - Properties

Column Mapping panel - for details, see Foreign Keys - Column Mapping

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

OREIGN

K

EYS

- P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Group

Constraint Name

Setting

System Generated and

User Specified

Description

The constraint name must be unique. You can either rely on

MySQL to assign a unique name or you can specify one.

32 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Group

Constraint State

Setting

On Update and On

Delete

Description

Lets you specify ON UPDATE and ON DELETE values of NO

ACTION, CASCADE, RESTRICT, or SET NULL.

F

OREIGN

K

EYS

- C

OLUMN

M

APPING

1 Under Referenced Table, choose the Database and then the referenced, or parent, Table.

2 Under the Main Table, select the referencing Table.

3 Under the Main Table, select the check box corresponding to the referring column and then under Referenced Table, select the check box corresponding to the referenced column.

F

UNCTIONS WIZARD

(M

Y

SQL)

The MySQL Functions Wizard lets you build and submit a CREATE FUNCTION declaration, specifying a return type and the owning library.

NOTE:

Functions must be written in C or C++, your operating system must support dynamic loading, and you must have compiled mysqld dynamically (not statically).

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Functions - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

F

UNCTIONS

- P

ROPERTIES

When creating or editing a function, this tab/panel lets you work with the following settings:

Required Information

Function Name

Description

In 64 characters or less, you can name your function.

Return Value

STRING, REAL (also known as Double), INTEGER

Shared Object Library

Identify the file that holds the library where your functions are stored.

Aggregate

Check the box if the function you are creating will collapse a large amount of data into a single output, or aggregate the data.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 323

C RE A T I N G O B J E C TS

I

NDEXES

, P

RIMARY

K

EYS

,

OR

U

NIQUE

K

EYS WIZARD

(M

Y

SQL)

The Indexes Wizard, Primary Keys Wizard, and Unique Keys wizard offer the same steps in creating these MySQL objects.

To create a new index, primary key, or unique key using a wizard:

1

Open an Object Wizard

for an index, primary key, or unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Indexes, Primary Keys, or Unique Keys - Properties

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

I

NDEXES

, P

RIMARY

K

EYS

,

OR

U

NIQUE

K

EYS

- P

ROPERTIES

When creating or editing an index, primary key, or unique key, this tab/panel lets you work with the following settings:

Setting

Table Name

Index Name

Constraint Type

Index Storage Type

Specify Columns in

Index

Description

Select the table on which you want to create the object.

Provide a name of up to 64 alphanumeric characters.

Primary: Each record of a table is identified as uniquely and relates to a foreign key in another table.

Unique: Ensures that there is no duplication between values in columns where you place this constraint.

Full Text: Enables the search for several words in arbitrary order in a table.

Spatial: Allows you to find records that are defined by location, or geometry types.

Hash: Used for equality comparisons. Only whole keys can be used to search for a row.

BTree: Tree data structure that keeps data sorted. BTrees grow from the bottom up as elements are inserted.

RTree: Tree data structure used for spatial indexes and access to multidimensional information.

Columns are listed by name and datatype and whether or not they are nullable. As you check selections, the sort order is identified.

T

ABLES WIZARD

(M

Y

SQL)

The MySQL Table Wizard lets you create a basic table definition.

32 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new table using a wizard:

1

Open an Object Wizard

for a table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Tables - Properties

Columns panel - for details, see Tables - Columns

Indexes panel - for details, see Tables - Indexes

Foreign Keys panel - for details, see Tables - Foreign Keys

MERGE tables panel - for details, see Tables - MERGE Tables

Privileges panel - for details, see Set Permissions for an Object

DDL View panel - for details, see

Create the New Object

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

T

ABLES

- P

ROPERTIES

When creating or editing a table, this tab/panel lets you work with the following properties:

NOTE:

Prior to working with MySQL table properties, you should have a detailed understanding of MySQL table creation options. For access to MySQL documentation,

see Accessing Third Party Documentation .

Setting

Table Name

Storage Type

Row Format

Description

Provide a unique name of up to 64 characters.

Lets you select a storage engine value of MyISAM, InnoDB, BerkeleyDB, ISAM,

MRG_MyISAM, HEAP, or MEMORY.

Lets you select a row format of DEFAULT (returns the default value if there is one), FIXED

(each row is stored with a fixed number of bytes), DYNAMIC (data records have variable length), or COMPRESSED (each record is compressed separately).

Create via SELECT

When you create a table using a SELECT command, the individual columns take their data types from the SELECT command, and don’t have to be declared explicitly.

Attributes, however, are not carried over.

Unique Key Violations

When you try to insert or update a row that causes a violation, you can choose to

IGNORE the violation and continue processing the next row.

Or, you can choose REPLACE, which is equivalent to an insert statement if a violation occurs. The row will be replaced with the new data.

Default Character Set

This is the character set for a language or alphabet.

Default Collation

The collation encodes the rules governing character used for a language (like Greek) or an alphabet.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 325

C RE A T I N G O B J E C TS

Setting

Auto-increment

Comment

Min Rows and Max

Rows

Average Row Length

Pack Keys

Check Sum

Delay Key Write

Description

You can specify the initial value used for the auto-increment sequence. This is possible only for MyISAM tables and for InnoDB tables built in MySQL versions 5.0.3 or greater.

For InnoDB tables built in versions prior to 5.0.3, you can manually insert a dummy row with a value one less than the desired value after creating the dummy table; you then delete the dummy row.

Enter a descriptive comment.

Note that if you set the value for either parameter at 0, MySQL removes the setting.

MySQL will take care of the row settings in this case.

The average length (compressed or uncompressed) of table rows in the table space.

This setting is only enabled for a Storage Type of MyISAM. It lets you specify a PACK

KEYS option value of 0 (keys packing disabled), 1 (smaller indexes), or DEFAULT (pacl long columns only).

This setting is only enabled for a Storage Type of MyISAM. When selected the CREATE

TABLE statement is issued with a CHECKSUM = 1 option. When deselected, the CREATE

TABLE statement is issued with a CHECKSUM = 0 option.

This setting is only enabled for a Storage Type of MyISAM. When selected, the CREATE

TABLE statement is issued with a DELAY_KEY_WRITE = 1 option. When deselected, the

CREATE TABLE statement is issued with a DELAY_KEY_WRITE = 0 option.

T

ABLES

- C

OLUMNS

When creating or editing a table, this tab/panel lets you modify the table’s column setup, as follows:

• Use the Add Column button to add the columns to the table. After providing a Name for a new column, you can select a Type and modify other Datatype properties corresponding to the type you selected. When selected, the Allow Nulls property corresponds to a CREATE

TABLE with a NULL attribute, while unselected it corresponds to a NOT NULL attribute.

When available the Default Value property corresponds to a DEFAULT attribute.

• Modify a column definition by selecting the column from the column list and modifying values under Column Attributes.

• Delete a column definition by selecting the column from the column list and clicking Delete.

• Use the arrow buttons to change the position of a selected column.

T

ABLES

- I

NDEXES

When creating or editing a table, this tab/panel lets you build an associated PRIMARY KEY,

UNIQUE KEY, FULL TEXT, or SPATIAL clause that will be included with the CREATE TABLE statement.

• Use the Insert a New Index button to add an index. In the Index field, type a name for the index, select a Constraint Type of PRIMARY KEY, UNIQUE KEY, FULL TEXT, or SPATIAL, and select an Index Type of BTREE, HASH, or RTREE as appropriate to the constraint type.

Under Specify Columns in Index, select the column or columns that are to make up the index.

32 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• Modify an index definition by selecting the index from the list and modifying the Index name, Constraint Type, Index Type or the columns making up the index.

• Delete an index by selecting the index from the list and clicking the Remove button.

T

ABLES

- F

OREIGN

K

EYS

When creating or editing a table, this tab/panel lets you work with foreign keys for a table:

NOTE:

This tab/panel is only available for a table with a Storage Type property value of

INNODB.

• Use the Insert a New Foreign Key button to add a foreign key. Provide a Foreign Key Name, select the referenced database and table from the Ref. Database and Ref. Table dropdowns, and select On Delete and On Update actions of NONE, CASCADE, DEFAULT,

SET NULL, NO ACTION, or RESTRICT. Under Main Table, select the foreign key column and then under Referenced Table, select the column that the foreign key is to reference.

• Modify a foreign key definition by selecting the foreign key from the list and changing the name, referenced database or table, delete or update actions, or the column specifications.

• Delete a foreign key by selecting the key from the list and clicking the Remove the selected foreign key button.

T

ABLES

- MERGE T

ABLES

When creating or editing a table, this tab/panel lets you work with a c ollection of identical

MyISAM tables that are to be used as a single table.

NOTE:

This tab/panel is only available for a table with a Storage Type property value of

MRG_MyISAM.

• Use the New button to add a MyISAM table to the collection, selecting a table from the associated dropdown.

• Use the Delete button to remove a selected MyISAM table from the collection.

• Use the arrow buttons to change the ordering position of a selected table.

U

SERS WIZARD

(M

Y

SQL)

The MySQL Users Wizard lets you provide basic identification, grant privileges, and specify valid host information for a user definition.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 327

C RE A T I N G O B J E C TS

To create a new user using a wizard:

1

Open an Object Wizard

for a user.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

User Information panel - for details, see Users - User Information

User Hosts panel - for details, see Users - User Hosts

System Privileges and Object Privileges panels - for details, see Set Permissions for an

Object

DDL View panel - for details, see

Create the New Object

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

U

SERS

- U

SER

I

NFORMATION

When creating or editing a user definition, this tab/panel lets you work with the following settings:

Setting

User Name

Full Name

Description

Email

Contact

Information

User Icon

Description

The name of the new user. At this time, the name cannot exceed 16 characters, although the field accepts 34. DBArtisan can’t enforce the discrepancy, so we urge you to show a little restraint. This is the name that is displayed in the User branch of the Explorer tree.

If you leave this field blank and complete the process, you create an <anonymous> user. Only one anonymous user per datasource is allowed.

OPTIONAL. At this time, the name cannot exceed 16 characters, although the field accepts

34. If you entered a nickname or an alias in the user name field, you can display the user’s true identity here.

OPTIONAL. Write a brief description of the user if you want.

OPTIONAL. The new user’s email address.

OPTIONAL. The new user’s title, address, phone number or whatever contact information you want to include.

OPTIONAL. If you want to identify your new user by color or pattern, you can use the icon editor to make a distinguishing mark. You can assign groups of users the same icon or assign each user his or her own icon. This tool helps you distinguish users at a glance. Note: If you don’t want to use the head that’s preloaded, simply click the red X and start designing your own with the other tools.

U

SERS

- U

SER

H

OSTS

When creating or editing a user definition, this tab/panel lets you specify the valid hosts from which the user can connect to the server.

32 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• Add a new host to the list by clicking the New button. Use the associated dropdown to select a valid host-name value (such as localhost or %), overwriting the text as necessary to provide a specific quoted identifier. Provide a password in the Password and Confirm fields and click Apply.

NOTE:

Click Apply To All to assign the current password for each host currently in the list.

• Remove a selected host from the list by clicking the Delete button.

O

RACLE

O

BJECT

W

IZARDS

DBArtisan lets you create Oracle objects using the following wizards:

• Cluster Wizard (Oracle)

• Database Link Wizard (Oracle)

• Directory Wizard (Oracle)

Disk Groups Wizard (Oracle)

• Foreign Key Wizard (Oracle)

• Function Wizard (Oracle)

• Index Wizard (Oracle)

• Job Queue Wizard (Oracle)

• Library Wizard (Oracle)

• Materialized View Wizard (Oracle)

• Materialized View Log Wizard (Oracle)

• Outline Wizard (Oracle)

• Package Wizard (Oracle)

• Primary Key Wizard (Oracle)

Procedure Wizard (Oracle)

• Profile Wizard (Oracle)

• Redo Log Group Wizard (Oracle)

• Role Wizard (Oracle)

• Rollback Segment Wizard (Oracle)

• Sequence Wizard (Oracle)

• Synonym Wizard (Oracle)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 329

C RE A T I N G O B J E C TS

• Table Wizard (Oracle)

• Tablespace Wizard (Oracle)

• Trigger Wizard (Oracle)

• Object Type Wizard (Oracle)

• Unique Key Wizard (Oracle)

• User Wizard (Oracle)

• View Wizard (Oracle)

C

LUSTER

W

IZARD

(O

RACLE

)

The Cluster Wizard lets you create a cluster. A cluster is a schema object that has one or more tables that all have one or more common columns. Rows of one or more tables that share the same value in these common columns are stored together in the database. The related columns of tables stored in a cluster are known as the cluster key.

Important Notes

• To create a cluster, you need the CREATE CLUSTER or CREATE ANY CLUSTER system privilege.

T

O

O

PEN THE

C

LUSTER

W

IZARD

1 On the Explorer, find the schema where you want to add the new cluster.

2 On the Cluster branch, right-click and select New.

OR

1 On the main toolbar, click Datasource and scroll to Objects

2 Click Clusters and then click New from the toolbar.

The tables below describe the fields you may encounter as you complete the wizard.

Required Information

Who owns the cluster?

Description

Pick an owner

What is the name of the cluster?

Type a unique name

On which tablespace do you want to create the cluster?

Self-explanatory

Add columns that are in this cluster

These are the columns that are common between the tables you are “clustering”

Add or Edit Button - For more information, see

Adding or modifying a cluster column

.

Drop Button - Drops the column.

33 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

What is the size of this cluster?

What is the cluster type?

If this is a hash cluster, what is the number of hash keys?

If this is a hash cluster, what is the hash function?

How many transaction entries are allowed for each data block in the cluster?

Type the number of hash keys. Oracle will round the value up to the nearest prime number.

Oracle uses a hash function to generate a distribution of numeric values, called hash values, which are based on specific cluster key values. The key of a hash cluster, like the key of an index cluster, can be a single column or composite key

(multiple column key). To find or store a row in a hash cluster, Oracle applies the hash function to the row's cluster key value. The resulting hash value corresponds to a data block in the cluster, which Oracle then reads or writes on behalf of the issued statement.

Default is the Oracle internal hash function, otherwise specify the hash expression you want to use.

Each transaction that updates a data block requires a transaction entry.

Initial (1-255): The initial parameter ensures that a minimum number of concurrent transactions can update a data block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum (1-255): The maximum parameter limits concurrency on a data block.

What is the percent of space reserved for future updates?

Description

This is the estimated number of bytes/KB/MB required by an average cluster key and its associated rows. Do not exceed the size of a data block.

Index: Rows having the same cluster key value are stored together. Each separate cluster key is stored only once in each data block. An indexed cluster is helpful if your clustered tables might grow unpredictably.

Hash: Rows with the same hash key value are stored together. This is helpful if the tables are static.

What is the minimum percentage of used space that Oracle maintains for each data block?

How large are the cluster’s extents?

Specify the number of free lists

Percent Free (0-99): This sets the percentage of a data block to be reserved for possible row updates that are included in the block. The value you set is the percent kept free.

The storage parameter lets you tune performance by minimizing the occurrence of row migration and chaining caused by update operations that extend the length of rows stored on the data block.

Percent Used (1-99)

The unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Free lists are lists of data blocks that have space available for inserting rows.

Identifying multiple free lists can reduce contention for free lists when concurrent inserts take place and potentially improve the performance of the cluster.

Free Lists: The default and minimum value is 1; this option should be set higher if multiple processes access the same data block.

This is the number of groups of free lists for the database objects being created. Specify the number of free list groups (specify only if you are using the parallel server option)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 331

C RE A T I N G O B J E C TS

Required Information

Define a default buffer pool for this cluster

Oracle’s parallel query option

Choosing Cache

Description

Default - Select to retain the default.

Keep - Select to retain the object in memory to avoid I/O conflicts.

ORACLE 8i ONLY: Recycle - Select to rid data blocks from memory as soon as they are no longer in use.

The parallel server query option lets you process queries using many query server processes running against multiple CPUs, which provides substantial performance gains such as reducing the query completion time.

Cache: This keeps the data block in memory by placing it at the most recently used end. This option is useful for small lookup tables.

No Cache

A

DDING OR MODIFYING A CLUSTER COLUMN

The Add or Modify Cluster Column dialog box lets you manage cluster columns. You can open the dialog box in the Oracle Cluster Wizard. For details, see

Cluster Wizard (Oracle) .

The table below describes the options and functionality on the Add or Modify Cluster Column dialog box:

Option

Column Name

Datatype

Description

Lets you type the column name.

Lets you select the datatype for the cluster.

If you select CHAR, RAW or VARCHAR2, in the Width box, type the width value.

If you select NUMBER, in the Width box, type the width value and in the Scale box, type the scale value.

Completing the Add or Modify Cluster Column Dialog Box

To complete this dialog box, do the following:

1 In the Add Cluster Column dialog box, in the Column Name box, type the column name.

2 Click the Datatype list, click the datatype for the cluster.

• If you clicked CHAR, RAW or VARCHAR2, in the Width box, type the width value.

• If you clicked NUMBER, in the Width box, type the width value and in the Scale box, type the scale value.

3 Click the Add button.

4 To continue adding columns to the cluster, repeat steps 1-3.

5 When you finish adding columns, click Close.

DBArtisan closes the Add Cluster Column dialog box.

For more information, see

Adding or modifying a cluster column

.

33 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

D

ATABASE

L

INK

W

IZARD

(O

RACLE

)

A database link specifies a communication path from one database to another. If you’re creating a link to a remote database, a database session is established in the remote database on behalf of the local application request. By creating either a public or private database link, you can determine which schema on the remote database the link will establish connections to by creating fixed, current, and connected database links. By creating a link you can reuse connectivity instructions each time you connect to the remote database.

To Open the Database Link Wizard

1 On the Explorer, find the schema where you want to add the new database link.

2 On the Database Links branch, right-click and select New.

OR

1 On the main toolbar, click Datasource and scroll to Objects

2 Click Database Links and then click New from the toolbar.

The table that follows describes the fields you will encounter as you complete the wizard.

NOTE:

To create a public database link, you need CREATE PUBLIC DATABASE LINK privileges.

Required Information

What is the name of the database link?

Should the database link be made public?

Description

Create a unique name

A public link is a link on a local database that’s accessible to all users on that database.

If you keep the database link private by selecting No, a link is created in a specific schema of the local database and only the owner of the link can use it to access database objects in the corresponding remote database.

Self-explanatory What is the name of the remote user?

What is the remote user’s password?

What is the connection string?

Create a password for the remote user.

Self-explanatory.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 333

C RE A T I N G O B J E C TS

D

ISK

G

ROUPS

W

IZARD

(O

RACLE

)

This wizard builds a CREATE DISKGROUP statement with redundancy and state properties, the associated disks and their properties, and attribute templates.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

Before working with disk groups, consult Oracle documentation for general information on disk groups and ASM instances, and details on ASM operation and

related permissions requirements. For more information, see Accessing Third Party

Documentation .

To create a disk group using a wizard

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 Right-click the Disk Groups node and select Create from the context menu.

NOTE:

If this is the first time you have initiated a disk group action since connecting, you are prompted to choose between a connection to the ASM instance or to continue using

the default datasource connection. For details on the implications, see Manage ASM

Connection .

3 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Disk Groups (Oracle) - Properties .

Disks panel - for details, see Disk Groups (Oracle) - Disks .

Templates panel - for details, see Disk Groups (Oracle) - Templates .

DDL View panel - for details, see

Create the New Object

.

4 Finally, use the Finish button to create the object. For more information, see

Create the New

Object .

The Disk Groups Editor has properties and options over and above those in the Disk Groups

Wizard. For details, see Disk Groups Editor (Oracle) .

D

ISK

G

ROUPS

(O

RACLE

) - P

ROPERTIES

When creating or editing a disk group, this tab/panel lets you work with the following settings:

Setting

Name

Redundancy Type

Group State After

Creation (labelled

Group State when editing an existing disk group)

Description

Provide a name for the disk group

Lets you select a REDUNDANCY clause value of NORMAL, EXTERNAL, or HIGH,

Lets you select an initial disk group state of MOUNTED or DISMOUNTED. By default the disk group is MOUNTED after creation. If you select DISMOUNTED, an ALTER statement is executed to change the state of the disk group to DISMOUNTED after creation.

33 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Allocation Unit Size

(available as of Oracle

11gR1)

Compatibility (available as of Oracle 11gR1)

Description

Specify the size of the allocation unit for the disk group.

Specify the ASM instance minimum software version.

Database Compatibility

(available as of Oracle

11gR1)

Specify the database instance minimum software version.

ADVM Compatibility

(available as of Oracle

11gR2)

Lets you add an ATTRIBUTE ‘COMPATIBLE.ADVM’ =... clause, specifying whether the disk group can contain ASM columns.

D

ISK

G

ROUPS

(O

RACLE

) - D

ISKS

When creating or editing a disk group, this tab/panel lets you manage the disks of the disk group and their properties.

To add a disk to the group

1 Click Add, select an entry from the Disks dropdown, optionally provide a Name for the disk, and press TAB or ENTER.

The disk is added to the Path list on the left, with default attribute values.

2 Proceed to edit the disk attributes.

3 Add more disks as necessary.

To edit disk attributes

1 Select the disk in the Path list on the left. The controls in the Property/Values list are updated with values of the selected disk.

2 Use the following table as a guide to providing additional property values.

Property or group

Size

Failure Group

Type (available as of

Oracle 11GR1)

Force

Description

Specify a disk size in KB, MB, or GB.

Specify the failure group to which the disk is to be added.

Lets you select a REGULAR or QUORUM failure group or disk qualifier. If QUORUM is specified at creation, the QUORUM keyword will be specified in any subsequent ALTER statements that will affect the disk or the failgroup.

If selected, the disk is added to the disk group even if the disk is already a member of a different disk group.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 335

C RE A T I N G O B J E C TS

To delete a disk from the disk group

1 Select a disk from the Path list.

2 Click Delete.

D

ISK

G

ROUPS

(O

RACLE

) - T

EMPLATES

When creating or editing a disk group, this tab/panel lets you manage disk group template clauses submitted with the CREATE/ALTER DISKGROUP statement. Each template is a named set of attributes applied to files on the disk group.

NOTE:

Only custom templates need to be added when creating a disk group. The System

Templates (CONTROL, DATAFILE, ONLINELOG, ARCHIVELOG, TEMPFILE,

BACKUPSET, PARAMETERFILE, DATAGUARDCONFIG, FLASHBACK,

CHANGETRACKING, DUMPSET, XTRANSPORT, and AUTOBACKUP) are automatically created for the disk group when the group is created. For more

information, see Disk Groups Editor (Oracle)

.

To add a template to the list of disk template clauses for this disk group

1 Click the New button. The Add new template dialog opens.

2 Use the following table as a guide to providing information on this dialog:

Setting

Name

Stripe

Description

Provide a name for the template.

Select COARSE to stripe files every 1MB. Select FINE to stripe files every 128KB.

Redundancy

Primary Region and

Mirror Region (available as of Oracle 11GR2)

Select a redundancy level of UNPROTECTED, MIRROR, PARITY, or HIGH.

Let you add an ATTRIBUTE disk region clause of HOT/COLD and MIRRORHOT/

MIRRORCOLD values to the template definition.

3 Click OK.

To modify a template already in the list

1 Select the template and click the Edit button. The Edit template dialog opens.

2 Use the table above as a guide to providing information on this dialog.

3 Click OK.

To delete a template from the list

1 Select the template and click the Drop button. You are prompted to verify.

2 Click Yes.

33 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

D

IRECTORY

W

IZARD

(O

RACLE

)

A directory object specifies an alias for a directory on the server file system where external binary file LOBs and external table data are located. The wizard completes a CREATE DIRECTORY statement from the information you supply. The Directory Wizard prompts you to name the directory and provide the full-qualified directory path.

To Open the Directory Wizard

1 On the Explorer, find the Datasource where you want to create a directory and expand the

Storage node.

2 Right-click Directories and select New.

The table that follows describes the fields you will encounter as you complete the wizard.

Required Information

What is the name of the directory?

Description

Type a meaningful name for the directory.

What is the directory path?

Type the full path name of the outside operating system directory that you want to alias in the directory (for example, /Video/Library/G_Rated). NOTE: Oracle trusts that directory you’re specifying exists. The onus is on you to make sure it’s valid and in the correct format (as required by your operating system).

After you have created the Directory, you can give other users Read or Write privileges by opening the new Directory on the Directories node, and making changes at the Privileges tab.

F

OREIGN

K

EY

W

IZARD

(O

RACLE

)

A foreign key value in one table (child table) refers to a primary key value in another table (parent table). For example, the Author Name column in a publisher’s database may be the primary key for a table of addresses that includes the Author Name column. If an author isn’t included in the parent table, you can’t add the address to the dependent address table. So foreign keys enforce referential integrity between tables by verifying the existence of foreign key values in the parent table before letting you insert or update foreign key values in the child table. In other words, a foreign key is an integrity constraint that requires each value in one table’s column to match a value in a related table’s data.

To create a new foreign key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Foreign Keys (Oracle) - Properties .

Column Mapping panel - Foreign Keys (Oracle) - Column Mapping

.

DDL View panel - for details, see

Create the New Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 337

C RE A T I N G O B J E C TS

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

F

OREIGN

K

EYS

(O

RACLE

) - P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Table Owner

Table Name

Name

Enabled

Delete Rule

Description

The owner of the table where the foreign key is being created.

This is the table where the foreign key link originates--the child table.

Lets you select a constraint name.

System Generated Name - DB2 automatically generates a name.

User Specified Constraint Name - You type the name.

Enable or disable the foreign key. Enabled ensures that all data modifications to a given table

(or tables) satisfy the conditions of the constraints. When disabled, the constraint is temporarily not operational.

Select an action:

NO ACTION - ensures that referenced values cannot be updated or deleted if to do so would violate referential integrity.

CASCADE permits a referenced row in a child table to be deleted/updated if it is deleted/ updated in the parent table. A row in the child table is SET NULL when rows in the parent table are deleted/updated.

F

OREIGN

K

EYS

(O

RACLE

) - C

OLUMN

M

APPING

Under Referenced Table, choose the Owner and then the Name of the referenced, or parent, table.

Under the Main Table, select check boxes corresponding to the columns that are to reference columns in the referenced table. Then, under Referenced Table, select the corresponding column check boxes.

F

UNCTION

W

IZARD

(O

RACLE

)

Functions are subroutines that you define and are useful for reusing application logic. You can use functions to determine the best methods for controlling access and manipulation of the underlying data contained in an object. A function returns a value, unlike a procedure, which does not.

33 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Functions (Oracle) - Properties .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

F

UNCTIONS

(O

RACLE

) - P

ROPERTIES

When creating or editing a function, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the function.

Provide a name for the function.

F

UNCTIONS

(O

RACLE

) - D

EFINITION

Complete the CREATE FUNCTION outline provided by typing or pasting the body of the function. Finally, use the Execute button to

Create the New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 339

C RE A T I N G O B J E C TS

I

NDEX

W

IZARD

(O

RACLE

)

Indexes are optional structures associated with tables. You can create indexes specifically to speed SQL statement execution on a table. When properly used, indexes are the primary means of reducing disk I/O. Indexes are logically and physically independent of the data in the associated table. Unique Indexes guarantee that no two rows of a table have duplicate values in the columns that define the index.

NOTE:

The Index Wizard varies slightly in content based on the version of Oracle to which you are connected.

NOTE:

To create indexes in your own schema, you need INDEX privileges on the target table.

To create indexes in other schema, you need CREATE ANY INDEX privileges.

NOTE:

For Oracle 8i or later, you can place a unique key constraint on an Index-Organized table.

TIP:

Index-organized tables take up less storage space and quickly access table rows. Indexorganized tables stores rows in primary key order reducing the amount of storage space needed.

TIP:

An advantage of using index-organized tables is that the tables use less memory because key columns are not duplicated in the table and index. DBArtisan stores the remaining non-key columns in the index structure.

To create a new index using a wizard:

1

Open an Object Wizard

for an index.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Indexes (Oracle) - Properties .

Columns panel - Indexes (Oracle) - Columns

.

Storage panel -

Indexes (Oracle) - Storage

.

Partition panel -

Indexes (Oracle) - Partition .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

I

NDEXES

(O

RACLE

) - P

ROPERTIES

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Owner and Name

Description

Choose the owner and name of the table in which the index is being created.

Choose the owner and provide the name of the index being created.

34 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Index Type

No Sort

Logging

Reverse

Function-Based

Invisible (Oracle

11g)

No Parallel

Execution

Parallel Degree

Parallel Instances

Description

NONUNIQUE - In a non-unique index, the ROWID is treated as part of the key. Oracle treats a constraint as deferrable.

UNIQUE - Select if the index is a unique constraint.The values in the indexed columns must be distinct.

BITMAP - Widely used in data warehousing environments. The environments typically have large amounts of data and ad hoc queries, but a low level of concurrent DML transactions.

Enable this feature if the rows in the table already stored in ascending order. This increases the speed of the index creation process. Oracle does not sort the rows.

Enabling logs this operation to the redo file.

Enabling this feature stores the bytes of the index block in reverse order and excludes the

ROWID. The ROWID is a globally unique identifier for a row in a database. It is created at the time the row is inserted into a table, and destroyed when it is removed from a table.

Permits the results of known queries to be returned much more quickly. When you select this option, you are asked for the expression that governs the function-based index you are creating.

Adds an INVISIBLE keyword to the DDL generated to create or edit this index. The optimizer ignores an invisible index unless the OPTIMIZER_USE_INVISIBLE_INDEXES is set to TRUE at the session or system level.

The parallel server query option lets you process queries, using many query server processes, running against multiple CPUs. This option provides substantial performance gains such as reduction of the query completion time.

After creation, ALTER INDEX for NOPARALLEL execution - when you use multiple query servers and you select this option, the parallel query option remains in place, but parallel processing will be removed. If, for example, multiple users on numerous nodes are modifying the same small set of data, the cost of synchronization from the parallel processing may have an unnecessarily large drag on throughput.

The value you select indicates the number of query server processes that should be used in the operation.

The value you select indicates how you want the parallel query partitioned between the

Parallel Servers.

I

NDEXES

(O

RACLE

) - C

OLUMNS

From the Column dropdown, select a column for the index and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 341

C RE A T I N G O B J E C TS

I

NDEXES

(O

RACLE

) - S

TORAGE

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Data Block Storage group

Extents group

Description

Select the DEFAULT Tablespace only if you are creating a local partitioned index and want the partitions in the same tablespace as the partitions in the underlying table. (Each partition of a local index is associated with one partition of the table. Oracle can then keep the index partitions in synch with table partitions.)

A transaction entry is needed for each INSERT, UPDATE, DELETE, etc. statement that accesses one or more rows in the block. Transaction entries in many operating systems require approximately 23 bytes.

Percent Free identifies how much space you want to allocate for new rows or updates to existing rows.

Initial Transactions ensures that a minimum number of concurrent transactions can update an index block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum Transactions limits concurrency on an index block.

An extent is the unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Percentage Increase - Lets you type the percentage.

NOTE: You should be careful when setting Percent Increase because it magnifies how an object grows and, therefore, can materially affect available free space in a tablespace.

Minimum Extents - For a dictionary managed tablespace, this is the total number of extents to be allocated when the index is first created. For a locally managed tablespace, this is simply the initial amount of space allocated.

Maximum Extents - For a dictionary managed tablespace, this is the total number of extents that can ever be allocated to the index. In a locally managed tablespace, the database will automatically manage the extents.

Freelists group

Buffer Pool

Free lists let you manage the allocation of data blocks when concurrent processes are issued against the index. You can potentially improve the performance of the index by identifying multiple free lists, which can reduce contention for free lists when concurrent inserts take place.

The default and minimum value is 1. You should increase this number if multiple processes access the same data block.

Free List Groups is the number of groups of free lists.

NOTE: This option is only applicable for the parallel server option.

DEFAULT - Choose this if you want to use the default bufferpool.

KEEP - Use this to retain the object in memory to avoid I/O conflicts. This type of bufferpool stores frequently referenced data blocks in a separate cache.

RECYCLE - Select this option to save cache space by ridding data blocks from memory as soon as they are no longer in use.

I

NDEXES

(O

RACLE

) - P

ARTITION

Clicking Create Partition opens a wizard that lets you create a partition.

34 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

J

OB

Q

UEUE

W

IZARD

(O

RACLE

)

Job Queues are built-in mechanisms that let you schedule a variety of SQL-based or commandline driven tasks.

The Job Queue Wizard lets you:

• Specify the PL/SQL code that will run in the job.

• Specify when the job will run, if it will run again, and if it should be enabled to run.

To Open the Job Queue Wizard

1 On the Explorer, find the datasource where you want to create an Oracle job and expand the

Instance node.

2 Right-click the Oracle Job Queue node, and select New.

The table that follows describes the fields you may encounter using this wizard:

Required Information

Enter the PL/SQL code you would like submitted

No Parse/Parse

Description

Type PL/SQL code or retrieve a previously saved PL/SQL script.

When would you like for the job to begin execution?

Self-explanatory.

Would you like to have the job run on an ongoing basis?

Would you like to have the job submitted as disabled?

Parsing can be expensive resource-wise, so think carefully before you choose the parse option. For a parse call, Oracle checks the syntactic and semantic validity of the

SQL statement, whether the process has the correct permissions, and allocates a private SQL area for the statement. Oracle will also check to see whether the statement exists in a shared library cache.

Self-explanatory.

Self-explanatory.

L

IBRARY

W

IZARD

(O

RACLE

)

Libraries are an object type introduced in Oracle8 that represent a call to an operating system shared library cache. After the call is made, libraries can be used by SQL or PL/SQL to link to external procedures or functions. Libraries are only to be used on operating systems that support shared libraries and dynamic linking. Libraries serve as pointers or aliases to physical operating system shared library files and do not exist as a physical object; rather they rely on the physical existence of the files in the external operating system library to which they refer. To access the function or procedures stored in the library, you need execute privileges at the operating system level where the shared library resides.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 343

C RE A T I N G O B J E C TS

• To create a library in your own schema, you need CREATE ANY LIBRARY privileges. To use the functions or procedures stored in the library, you need object EXECUTE privileges on the library.

To Open the Library Wizard

1 On the Explorer, find the datasource where you want to create a Library and expand the

Schema node.

2 Right-click the Libraries node, and select New.

The table that follows describes the fields you may encounter using this wizard:

Required Information

Who owns the library?

What is the name of the library?

What is the file specification?

Description

Self-explanatory.

Self-explanatory.

Lets you type the file name and location. You must type the complete location (for example,

D:\Embarcadero\ETLIB21D.DLL).

M

ATERIALIZED

V

IEW

W

IZARD

(O

RACLE

)

A materialized view gives you indirect access to table data by storing a query’s results in a separate schema object. Essentially, a materialized view is a database object that contains the results of a query.

The Materialized View Wizard lets you:

• Specify the materialized view owner and to name the materialized view.

• Specify the materialized view's refresh configuration.

• Place the materialized view on a tablespace and specify the query that should be used to populate the materialized view.

• Specify how Oracle should allocate data blocks to store the materialized view.

• Specify how Oracle should manage the growth of the materialized view.

• Specify if Oracle updates the materialized view, register an existing table, and specify how to populate a materialized view.

• Specify if the data for the materialized view is cached, if you want the updates logged, and to specify a number of threads for a parallel operation.

• Specify rollback segments, and enable query rewrites.

34 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To Open the Materialized View Wizard

1 On the Explorer, find the datasource where you want to create a Materialized View and expand the Schema node.

2 Right-click the Materialized Views node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard:

Required Information

Who owns the materialized view?

What is the name of the materialized view?

How should the materialized view be refreshed?

Description

Self-explanatory

Self-explanatory.

Fast - Using the information logged on the materialized view logs or a partition maintenance operation, the refresh applies incremental changes. See

Fast Refresh

Requirements

for more information.

Complete - This refresh recalculates the materialized view’s defining query.

Force - Applies fast refresh when feasible, otherwise uses a complete refresh.

Never - Materialized view will not be refreshed with the optional refresh mechanisms.

Choose a refresh mechanism

How many transaction entries are allowed for each datablock in the materialized view?

On Demand - This option requires that all refreshes be manually executed.

On Commit - Select to refresh the materialized view whenever Oracle processes a transaction. Only select this option for materialized views on single table aggregates and materialized views containing joins.

Automatically - Select to refresh the materialized view automatically. In the On this date: boxes select a time and date, and then select a refresh amount and a unit of time.

Select the tablespace where you want the materialized view placed.

Where do you want to place the materialized view?

What is the materialized view query?

Select a refresh method

Type the SQL query to be used to populate and to refresh the materialized view.

Primary Key - A primary key's values uniquely identify the rows in a table. Changes are propagated according to row changes as identified by the primary key value of the row. Only one primary key can be defined for each table.The primary key of the master table is the basis for this refresh option, which is the default option.

ROWID - A globally unique identifier for a row in a database based on the physical row identifiers. A RowID is created at the time the row is inserted into a table, and destroyed when it is removed from a table. ROWID materialized views cannot contain distinct or aggregate functions or GROUP BY subqueries, joins and set operations.

A transaction is a logical unit of work that contains one or more SQL statements. Each transaction that updates a data block requires a transaction entry.

Initial (1-255) - Ensures that a minimum number of concurrent transactions can update a data block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum (1-255) - Limits concurrency on a data block.

What is the percent of space reserved for future updates?

Percent Free (0 99) - This sets the percentage of a data block to be reserved for possible row updates that are included in the block. The value you set is the percent kept free.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 345

C RE A T I N G O B J E C TS

Required Information

What is the minimum percentage of used space that Oracle maintains for each datablock?

How large are the materialized views extents?

Description

Percent Used (0-99) - Set the amount of space to be used for each datablock.

NOTE: The sum of percent free and the percent used cannot exceed 100.

The unit of space allocated to an object whenever the object needs more space. An extent is a specific number of contiguous data blocks set aside for storing a specific type of information.

Initial Extent (KB) - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Minimum Extents - The appropriate minimum extents value for the object.

Maximum Extents - The appropriate maximum extents value for the object.

How many extents should be allocated to the materialized view?

What is the growth rate for sizing additional materialized views?

Can the materialized view be updated?

Do you want to register a prebuilt table to the view?

Should the materialized view be immediately filled?

Should data for the materialized view be cached?

Percent Increase - Magnifies how an object grows and can materially affect available free space in a tablespace. Select a value in the corresponding box.

Yes/No

Yes/No. This option is particularly useful for registering large materialized views in a data warehousing environment.

Yes/No: Select Yes if you want the materialized view populated immediately or during the next refresh operation.

Yes/No: Select if you want Oracle to put data you access frequently at the most recently used end of the list in the buffer cache when a full table scan is performed.

This option is useful for small lookup tables.

Yes/No.

Do you want updates to be logged?

Do you want to specify the number of threads used in a parallel operation?

Would you like to specify rollback segments to be used for the materialized view refresh?

Is the materialized view eligible for query rewrite?

Parallel processes means that multiple processes work simultaneously to run a single statement. This can cut the amount of time it takes to get a response.

Specify the degree of parallelism if you so desire. If you leave the default at 1, the operation will not be “parallelized.”

A rollback segment temporarily stores old data that has changed in a SQL statement transaction until it is committed. The “before” image of the database, as it were.

Local Rollback Segment - Default indicates that Oracle will select the rollback segment to use on the local machine.

Master Rollback Segment - Specify the remote rollback segment used at the remote master site for the individual materialized view.

Select to enable the materialized view for query rewrite. Only enable query rewrite if expressions in the statement are repeatable.

34 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

Do you want to partition this materialized view?

Do you want to enable Row

Movement?

Description

Yes/No

Partitioning methods available are:

Range: Data is mapped to partitions based on ranges of column values. This is the default.

Composite: Based on the range method of partitioning, you can create subpartitions within each partition.

Hash: Data is distributed evenly over a specified number of partitions. Data need not fit into a logical range.

List: You control explicitly how rows map to partitions. List partitions allow you to group and organize unrelated sets of data.

Yes/No

Enabling row movement allows you to specify whether Oracle can move a table row when you are compressing a table or performing an update on partitioned data.

Self-explanatory Select the partitioning columns

Select the subpartitioning method

Self-explanatory

Select the subpartitioning columns

Self-explanatory

Hash Partitioning methods None

Partition Definition:

Specify number of partitions and (optionally) tablespaces

Specify individual partitions by name and (optionally) tablespaces

Create list/ordered list of partitions

Self-explanatory

The Add Partition dialog box may open.

Specify number of subpartions

Self-explanatory

Click Add, Insert, or Edit to open a dialog box that lets you work with subpartition properties.

Self-explanatory Select the default tablespaces to contain the subpartitions (optional)

Fast Refresh Requirements

Detail tables only

Single table only

Table Appears only once in the

FROM list

X

X

When the

Materialized View has:

Only Joins Joins and Aggregates Aggregate on a Single

Table

X X

X

X X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 347

C RE A T I N G O B J E C TS

X

X

When the

Materialized View has:

X No non-repeating expressions like

SYSDATE and ROWNUM

No references to RAW or LONG

RAW

No GROUP BY

X

X X

Rowids of all the detail tables must appear in the SELECT list of the query

Expressions are allowed in the

GROUP BY and SELECT clauses provided they are the same

X

Aggregates allowed but cannot be nested

AVG with COUNT

SUM with COUNT

X

VARIANCE with COUNT and SUM

STDDEV with COUNT and SUM

WHERE clause includes join predicates which can be ANDed bit not ORed.

No WHERE clause

Only Joins

X

X

X

X

X

X

X

X

X X

X

Joins and Aggregates Aggregate on a Single

Table

X

X

No HAVING or CONNECT BY

No subqueries, inline views, or set functions like UNION or MINUS

COUNT(*) must be present

X X

X X

X

X

X

X

X No MIN and MAX allowed

If outer joins, then unique constraints must exist on the join columns of the inner join table

Materialized View logs must exist and contain all columns referenced in the materialized view and have been created with the LOG NEW VALUES clause

Materialized View Logs must exist with rowids of all the detail tables

Non-aggregate expression in

SELECT and GROUP BY must be straight columns

DML to detail table

X

X

X

X

X

X

34 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Direct path data load

ON COMMIT

ON DEMAND

X

X

When the

Materialized View has:

X X

X

X

X

X

M

ATERIALIZED

V

IEW

L

OG

W

IZARD

(O

RACLE

)

Materialized view logs are tables that maintain a history of modifications to the master table, and they are used to refresh simple materialized views. When you create a materialized view log,

Oracle automatically creates a log table to track data changes in the master table and a log trigger to maintain the data in the log table. A log can refresh the materialized view incrementally and is therefore often less time-consuming than a complete refresh.

The Materialized View Log Wizard lets you:

• Specify the materialized view log owner and master table.

• Select refresh types and select column filters.

• Specify how Oracle should allocate data blocks to store the materialized view log.

• Specify how Oracle should manage the growth of the materialized view.

• Specify if you want the data for the materialized view log cached, if you want updates logged, and to enable parallel query.

• Specify if you want the log to hold new values.

To Open the Materialized View Log Wizard

1 On the Explorer, find the datasource where you want to create a Materialized View Log and expand the Schema node.

2 Right-click the Materialized View Log node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard:

Required Information

Who owns the materialized view log’s master table?

Which table will serve as the materialized view log’s master table?

On which tablespace do you want to place the log?

Description

Self-explanatory

Self-explanatory

Self-explanatory

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 349

C RE A T I N G O B J E C TS

Required Information

Which refresh types would you like to use?

Optional: Select any filter column(s) to be recorded in the materialized view log.

How many transaction entries are allowed for each data block in the materialized view log?

What is the percent of space reserved for future updates?

What is the minimum percentage of used space that Oracle maintains for each data block?

Description

Primary Key - The log records changes to the master table based on the primary key of affected rows. A primary key's values uniquely identify the rows in a table. Changes are propagated according to row changes as identified by the primary key value of the row. Only one primary key can be defined for each table.The primary key of the master table is the basis for this refresh option, which is the default option.

ROWID - The log records changes to the master table based on the RowID of the affected rows. A ROWID is a globally unique identifier for a row in a database based on the physical row identifiers. A ROWID is created at the time the row is inserted into a table, and destroyed when it is removed from a table. ROWID materialized views cannot contain distinct or aggregate functions or GROUP BY subqueries, joins and set operations.

A filter column is a column whose values you want to be recorded in the materialized view log for any rows that are changed. You can specify only one primary key, one ROWID, and one filter column list per materialized view log.

A transaction is a logical unit of work that contains one or more SQL statements. Each transaction that updates a data block requires a transaction entry.

Initial (1-255) - Ensures that a minimum number of concurrent transactions can update a data block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum (1-255) - Limits concurrency on a data block.

Percent Free (0 99) - This sets the percentage of a data block to be reserved for possible row updates that are included in the block. The value you set is the percent kept free.

Percent Used (0-99) - Set the amount of space to be used for each datablock.

NOTE: The sum of percent free and the percent used cannot exceed 100.

How large are the materialized view log’s extents?

Should the data for a materialized view log be cached?

Do you want updates to be logged?

Do you want to enable parallel query for the log?

Should the log hold new values?

Initial Extent (KB) -The default is the value specified for the tablespace where the materialized view log resides.

Yes/No - Select Yes if you want Oracle to put data you access frequently at the most recently used end of the least recently used list in the buffer cache when a full table scan is performed. This option is useful for small lookup tables.

No indicates that your most frequently accessed data blocks are put at the least recently used end of the least recently used list of the buffer cache.

Yes/No

Degree. The integer is number of parallel threads used in the parallel operation.

The Parallel server query option lets you process queries using many query server processes running against multiple CPUs. This option provides substantial performance gains such as reduction of the query completion time.

Yes/No - Yes indicates both old and new values should be saved in the materialized view log.

No disables recording of new values in the log. This is the default.

35 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

O

UTLINE

W

IZARD

(O

RACLE

)

Outlines are a set of results for the execution plan generation of a particular SQL statement.

When you create an outline, plan stability examines the optimization results using the same data used to generate the execution plan. That is, Oracle uses the input to the execution plan to generate an outline, and not the execution plan itself.

NOTE:

To create an outline, you must have CREATE ANY OUTLINE system privileges.

To create a new outline using a wizard:

1

Open an Object Wizard

for an outline.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Outlines (Oracle) - Properties .

Definition panel - Outlines (Oracle) - Definition .

DDL panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

O

UTLINES

(O

RACLE

) - P

ROPERTIES

When creating or editing an outline, this tab/panel lets you work with the following settings:

Setting

Stored Outline

Name

Category

Description

Provide a unique name for the outline.

The category is a name you want to use to group stored outlines. (You can type over the word

Default that appears automatically.)

O

UTLINES

(O

RACLE

) - D

EFINITION

Type the SQL statement you want to store as an outline.

NOTE:

The only SQL statements possible with stored outlines are SELECT, DELETE, UPDATE,

INSERT…SELECT, and CREATE TABLE…AS SELECT.

P

ACKAGE

W

IZARD

(O

RACLE

)

A package is a collection of related program objects stored together in the database. A package specification or package header, declares variables, constants, etc., that are visible outside the package’s immediate scope. The package body defines objects declared by the specification but are not visible to applications outside the package. Packages contain all the information needed to process SQL statements from a single source file. You can use packages to process and call batches of SQL.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 351

C RE A T I N G O B J E C TS

To Open the Package Wizard

1 On the Explorer, find the datasource where you want to create a package and expand the

Schema node.

2 Right-click the Packages node, and select New.

You’re asked to name an owner for the package and give it a name. When you click Finish, the

Packages editor opens to the header tab where you indicate any package specifications and create the package body. For more information, see

Package Bodies Editor (Oracle)

.

P

RIMARY

K

EY

W

IZARD

(O

RACLE

)

Primary key (constraint)s are a set of table columns that can uniquely identify every row of a table. No fields that are a part of the primary key can have null values, and each table can have only one primary key.

To create a new primary key using a wizard:

1

Open an Object Wizard

for a primary key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Primary Keys (Oracle) - Properties .

Columns panel - Primary Keys (Oracle) - Columns

.

Storage panel -

Primary Keys (Oracle) - Storage

.

Partition panel -

Primary Keys (Oracle) - Partition .

DDL panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

P

RIMARY

K

EYS

(O

RACLE

) - P

ROPERTIES

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Name

No Sort

Logging

Reverse

Description

Choose the owner and name of the table in which the primary key is being created.

Provide a name for the primary key being created.

Enable this feature if the rows in the table already stored in ascending order. This increases the speed of the index creation process. Oracle does not sort the rows.

Enabling logs this operation to the redo file.

Enabling this feature stores the bytes of the index block in reverse order and excludes the

ROWID. The ROWID is a globally unique identifier for a row in a database. It is created at the time the row is inserted into a table, and destroyed when it is removed from a table.

35 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Setting

Validate

Deferrable

Deferred

Enabled

C RE AT I N G O B J E C T S

Description

Enabling this option indicates that existing data is checked against the constraint when the primary key is enabled. Leaving it disabled indicates that only new data is to be cheeked against the constraint.

Dictates whether constraint checking can be deferred until the end of a transaction.

This option is enabled only if you enabled the Deferrable option. Select IMMEDIATE to have the constraint checked at the end of every DDL statement. Select DEFERRED to have the constraint checked only at the end of a transaction.

Enables or disables the primary key.

P

RIMARY

K

EYS

(O

RACLE

) - C

OLUMNS

From the Column dropdown, select a column for the index and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

P

RIMARY

K

EYS

(O

RACLE

) - S

TORAGE

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting Description

Data Block Storage group

Select the DEFAULT Tablespace only if you are creating a local partitioned index and want the partitions in the same tablespace as the partitions in the underlying table. (Each partition of a local index is associated with one partition of the table. Oracle can then keep the index partitions in synch with table partitions.)

A transaction entry is needed for each INSERT, UPDATE, DELETE, etc. statement that accesses one or more rows in the block. Transaction entries in many operating systems require approximately 23 bytes.

Percent Free identifies how much space you want to allocate for new rows or updates to existing rows.

Initial Transactions ensures that a minimum number of concurrent transactions can update an index block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum Transactions limits concurrency on an index block.

Extents group An extent is the unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Percentage Increase - Lets you type the percentage.

NOTE: You should be careful when setting Percent Increase because it magnifies how an object grows and, therefore, can materially affect available free space in a tablespace.

Minimum Extents - For a dictionary managed tablespace, this is the total number of extents to be allocated when the index is first created. For a locally managed tablespace, this is simply the initial amount of space allocated.

Maximum Extents - For a dictionary managed tablespace, this is the total number of extents that can ever be allocated to the index. In a locally managed tablespace, the database will automatically manage the extents.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 353

C RE A T I N G O B J E C TS

Setting

Freelists group

Buffer Pool

Description

Free lists let you manage the allocation of data blocks when concurrent processes are issued against the index. You can potentially improve the performance of the index by identifying multiple free lists, which can reduce contention for free lists when concurrent inserts take place.

The default and minimum value is 1. You should increase this number if multiple processes access the same data block.

Free List Groups is the number of groups of free lists.

NOTE: This option is only applicable for the parallel server option.

DEFAULT - Choose this if you want to use the default bufferpool.

KEEP - Use this to retain the object in memory to avoid I/O conflicts. This type of bufferpool stores frequently referenced data blocks in a separate cache.

RECYCLE - Select this option to save cache space by ridding data blocks from memory as soon as they are no longer in use.

P

RIMARY

K

EYS

(O

RACLE

) - P

ARTITION

Clicking Create Partition opens a wizard that lets you create a partition.

P

ROCEDURE

W

IZARD

(O

RACLE

)

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly. Procedures do not return values, unlike functions.

NOTE:

To create a procedure in your own schema, you need CREATE PROCEDURE privileges.

To create a procedure in someone else's schema, you need CREATE ANY

PROCEDURE privileges.

To create a new procedure using a wizard:

1

Open an Object Wizard

for a procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Procedures (Oracle) - Properties .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

35 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P

ROCEDURES

(O

RACLE

) - P

ROPERTIES

When creating or editing a procedure, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the procedure.

Provide a name for the procedure

C RE AT I N G O B J E C T S

P

ROCEDURES

(O

RACLE

) - D

EFINITION

Complete the CREATE PROCEDURE outline provided by typing or pasting the body of the

procedure. Finally, use the Execute button to Create the New Object

.

P

ROFILE

W

IZARD

(O

RACLE

)

Profiles are a mechanism for allocating system and database resources to users. In essence, a profile is a set of limits with a name attached to them. If the profile is active, Oracle will limit use and resources to the limits defined by the profile.

The Profile Wizard lets you:

• Name the profile.

• Set composite limit.

• Set session limits for SGA shared pool.

• Set limits on total connection time per session and Idle time per session.

• Set limits on concurrent sessions per user, CPU time per session, and data blocks read per session.

• Set limits on CPU time per call, and number of data blocks read for a call to process an SQL statement.

• Set the number of failed login attempts, and the days an account locks.

NOTE:

To create a profile, you need the CREATE PROFILE system privilege.

The Default option is subject to the limit specified for that particular resource. The default profile initially permits unlimited resources. Limits to the default profile can be made using an Alter statement.

The Unlimited option allows the user with that profile to take use unlimited amounts of that resource.

The Other options take on the resource limits that you indicate.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 355

C RE A T I N G O B J E C TS

To Open the Profile Wizard

1 On the Explorer, find the datasource where you want to create a procedure and expand the

Security node.

2 Right-click the Profile node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

Required Information

What is the name of the profile?

What is the composite limit on resources per session?

What is the limit on the amount of private space a session can allocate in the shared pool of the

SGA?

What is the limit on the total connection time per session?

Description

Write a name that’s 30 characters or less

You can set a single composite limit for all resource limits in a profile in addition to setting specific resource limits for a profile. Explicit and composite limits can peaceably coexist. The limit that is reached first stops the session’s activity.

Service units are a weighted sum of CPU per session, connect time, logical reads per session, and private SGA.

Default/Unlimited/Other (service units)

This limit only applies if you are using Shared Server architecture.

Default/Unlimited/Other (KB)

The total elapsed time limit for a session

Default/Unlimited/Other (Minutes)

What is the limit on idle time per session?

Permitted periods of continuous inactive time during a session, expressed in minutes. Long-running queries and other operations are not subject to this limit.

Default/Unlimited/Other (Minutes)

Default/Unlimited/Other What is the limit on concurrent sessions per user?

What is the limit on CPU time per session?

What is the limit on data blocks read per session?

What is the limit on CPU time per call?

Default/Unlimited/Other (Hundredths of a Second)

Default/Unlimited/Other

What is the limit on the number of data blocks read for a call to process a SQL statement?

How many failed login attempts will be allowed before an account is locked?

How long will an account be locked after the specified number of failed login attempts?

The limit on a parse, execute, or fetch.

Default/Unlimited/Other (Hundredths of a Second)

This is the number of logical reads per call.

Default/Unlimited/Other

Default/Unlimited/Other

Default/Unlimited/Other (Days)

What is the lifetime of the password?

How many days must pass before a password can be reused?

Default/Unlimited/Other (Days)

Default/Unlimited/Other (Days)

35 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

How many password changes are required before the current password can be reused?

What is the grace period allowed for a password to be changed without expiring?

What is the name of the password complexity verification routine?

Description

Default/Unlimited/Other

Default/Unlimited/Other (Days)

Default

Null - Specifies no password verification is performed.

Function Name

R

EDO

L

OG

G

ROUP

W

IZARD

(O

RACLE

)

A redo log makes it possible to replay SQL statements because a redo log stores all changes made to a database as they occur. If something unanticipated happens to a datafile, you can restore a backed-up datafile and use the redo log to bring the datafile back to the state it was in before the unanticipated activity. The redo log can consist of two parts: the online redo log and the archived redo log. In archive log mode, redo log files will not be overwritten unless they have been archived somewhere. Each log is a member of the group.

NOTE:

Redo should not be confused with Undo, which is a transaction based process.

If you find that you have problems with redo log group availability and Oracle consistently has to wait for redo log groups to become free, you can create additional redo log groups. DBArtisan lets you create additional redo log groups to ensure that there is always a recycled redo log group available.

The Redo Log Group Wizard lets you:

• Assign a number to the new redo log group and determine the file size for the group members.

• Choose a thread for the redo log group for Oracle Parallel Server.

• Add redo log members with the Add Redo Log Member dialog box.

To Open the Redo Log Wizard

1 On the Explorer, find the datasource where you want to create a redo log and expand the

Storage node.

2 Right-click the Redo Log Groups node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 357

C RE A T I N G O B J E C TS

Required Information

Do you want to use Oracle Managed Files

(OMF) for the redo log group?

You must be set up to use OMF to use this option

Description

Lets you specify to use Oracle Managed Files to automatically create the redo log group. Oracle automatically creates and removes operating system files as you create and drop storage objects.

NOTE: If you select OMF, you do not have to enter a redo log group number or file size.

What is the group number for the redo log group?

What file size should the group’s redo log members be? Note: All members of the group must be the same. With OMF, you can let Oracle assign a size or enter it manually.

To which thread should the redo log group be added?

For this option to be available, you need to be using Oracle with the parallel server option in parallel mode.

Add redo log group members

When numbering your redo log groups, it is better not to skip numbers (e.g., 5, 10, 15). Skipping numbers causes Oracle to consume extra space in the control files of the database. size in KB or MB

OPTIONAL: If you are using Oracle Parallel Server, type the thread.

A thread is an operating system component that allows the logic of multiuser applications to be performed as several separate, asynchronous execution paths. Threads help ensure that work is being performed for some user connections even when other connections are blocked (for example, when waiting for a disk read or write operation to complete).

The name of each group member should be a file name. For example, D:\ORACLE\ORADATA\FINANCEDB\REDO02.LOG is a valid group member name. If you do not specify a full path,

DBArtisan creates files in either the default or current directory of the database server.

R

OLE

W

IZARD

(O

RACLE

)

As you complete the Role Wizard, DBArtisan constructs the necessary CREATE ROLE statement from the information that you have supplied. The Role Wizard lets you specify a name for the role and whether or not the role should be identified.

NOTE:

To create a role, you need the CREATE ROLE system privilege.

To Open the Role Wizard

1 On the Explorer, find the datasource where you want to create a role and expand the

Security node.

2 Right-click the Roles node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

35 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Required Information

What is the name of the role?

How should the role be identified?

Description

Self-explanatory.

Not identified - Selecting this means the role you are creating will be enabled immediately.

Identified: If this is your choice, you’re indicating one of the following authorization methods will be followed:

Globally - Select to indicate that Oracle permits access to the user by obtaining user name and password information from the security domain central authority.

Externally - Select to indicate that Oracle should verify the database user name against an existing operating system user name.

Password - Select to indicate that Oracle should identify the role with the password you provide. In the Password box, type the password for the user.

For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

R

OLLBACK

S

EGMENT

W

IZARD

(O

RACLE

)

Rollback segments manage all transactions in your Oracle databases. A transaction is a read, modify, and write cycle for an Oracle database. A rollback entry is made for all transactions unless a particular clause is specified. So, a rollback segment is a transaction log that consists of a pre-update image value and transaction status, among other things. The rollback segments maintain read consistency among concurrent users in a database and if the transaction fails for any reason, the old image is taken from the rollback segment. By maintaining a history of data changes, rollback segments can rollback uncommitted transactions so that data is rolled back to the prior state. SYS owns all rollback segments no matter who created them and are not accessible to users, just Oracle.

Oracle, it should be mentioned, strongly recommends that you use automatic undo management to simplify managing databases. Tuning rollback segments is a manual process that has largely been deprecated by Oracle, but it is supported for backward compatibility reasons.

The Rollback Segment Wizard lets you:

• Name the rollback segment and to place it online or off-line.

• Place the rollback segment on a tablespace.

• Specify the initial next and optimal extent size as well a the minimum and maximum number of extents that should be allocated to the rollback segment.

NOTE:

This wizard is not available if auto-UNDO management is enabled.

TIP:

Make sure enough rollback segments exist on a database to handle the imposed workload. One rule of thumb is to create one rollback segment for every four concurrent users.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 359

C RE A T I N G O B J E C TS

To Open the Rollback Segment Wizard

1 On the Explorer, find the datasource where you want to create a rollback segment and expand the Storage node.

2 Right-click the Rollback Segments node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

Required Information

What is the name of the rollback segment?

Should this rollback segment be made public?

Description

Self-explanatory.

Yes - A public rollback segment can be brought online by any instance in a parallel server. Public rollback segments form a pool of rollback segments that can be used by any instance that needs one.

No - This is the default. A private rollback segment can only be acquired by the instance specifying the segment in its initialization file.

Do you want to place the rollback segment to be online following its creation?

Online - To be useful, a rollback segment must be online.

Offline - You may want to take rollback segments offline if you want to take a tablespace offline and it contains rollback segments that you want to keep from being used.

On which tablespace do you want to place this rollback segment?

Self-explanatory.

Oracle suggests that you create one or more tablespaces specifically to hold all rollback segments. This way, the data contained in the rollback segments is held apart from other data types.

What extent sizes do you want to assign to this rollback segment?

What are the minimum and maximum number of extents to allocate to the rollback segment?

Initial size (KB)

Next size (KB)

Optimal size (KB) Null/Default

Minimum

Maximum

S

EQUENCE

W

IZARD

(O

RACLE

)

Sequences are programmable database objects that provide numbers in sequence for input to a table. A sequence can be used to automatically generate primary key values for tables.Once defined, a sequence can be made available to many users. When you create a sequence, you can define its initial value, increment interval, and maximum value.

The Sequence Wizard lets you:

• Specify the name and owner of the sequence.

• Set both the value of the sequence, and an interval and ranges for incrementing it.

36 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• Cache the sequence, cycle the sequence when it reaches its minimum or maximum values, and guarantee that Oracle generates sequence numbers in the order of request.

NOTE:

To create a sequence, it must belong to your schema or you need CREATE SEQUENCE privilege.

To Open the Sequence Wizard

1 On the Explorer, find the datasource where you want to create a rollback segment and expand the Schema node.

2 Right-click the Sequences node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

Required Information

Who owns the sequence?

What is the sequence name?

Description

Self-explanatory.

Self-explanatory.

What is the first sequence number to be generated?

Start with: Pick an integer.

What is the interval between sequence numbers?

What is the sequence’s minimum value?

What is the sequence’s maximum value?

Increment by: Positive numbers will generate ascending values, and a negative number will generate descending numbers

The default is 1 for ascending sequences; This integer value can have 28 or fewer digits.

None

Minimum value - Identify how low the sequence can go.

For descending values, the default is 1. Lets you specify the maximum value the sequence can generate. This integer value can have 28 or fewer digits.

Should Oracle preallocate sequence numbers and cache them for faster access?

Should the sequence continue to generate values after reaching either its maximum or minimum value?

None

Maximum value - Indicate the highest sequence value that will be allowed.

This is the number of sequence values you want to specify in the SGA buffers.

This speeds access, but cached numbers are erased when the database is shut down. The default value is 20.

Yes

Number of values

No

If you say no, the sequences will automatically recycle to the minimum value when you’ve hit the maximum for ascending sequences and vice versa for descending sequence values.

Yes

No

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 361

C RE A T I N G O B J E C TS

Required Information

Should the sequence numbers be generated in the order of request?

Description

This may be required when sequences are required for timestamping. But generally, because sequences are naturally ordered, this is only necessary for if you use Oracle RAC clusters for parallel mode.

Yes

No

S

NAPSHOT AND

S

NAPSHOT

L

OG

W

IZARDS

(O

RACLE

)

Oracle has replaced the snapshot functionality with materialized views. Refer to the

Materialized

View Wizard (Oracle)

and Materialized View Log Wizard (Oracle)

.

S

YNONYM

W

IZARD

(O

RACLE

)

Synonyms are alternate names for database objects to be used as a reference by users or applications. A synonym offers you security and convenience so that you can refer to an object without revealing who owns it or what database it belongs to. Synonyms Depending on the platform, you can define synonyms on tables, views, sequences, procedures, functions, packages, and materialized views. If an underlying object needs to be renamed or moved, it’s easy enough to redefine the synonym without having to modify any applications based on the synonym.

NOTE:

To create a private synonym, you need CREATE SYNONYM privileges. To create a public synonym, you need CREATE PUBLIC SYNONYM privileges.

To create a new synonym using a wizard:

1

Open an Object Wizard

for a synonym.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel -

Synonyms (Oracle) - Properties .

Definition panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

S

YNONYMS

(O

RACLE

) - P

ROPERTIES

When creating or editing a synonym, this tab/panel lets you work with the following settings:

Setting

Owner and Name

Description

Choose the owner and provide a name for the synonym being created.

Referenced Object

Owner

Select the owner of the object to which the synonym is to refer.

36 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Referenced Object

Type

Referenced Object

Name

Database Link

Description

Select the type of the object to which the synonym is to refer.

Select the specific object to which the synonym is to refer.

If the object resides on a remote database, select a database link.

T

ABLE

W

IZARD

(O

RACLE

)

Tables are the most basic data storage units for Oracle. As you might expect, data is stored in rows and columns. By completing the Table Wizard, DBArtisan constructs the necessary CREATE

TABLE statement from the information that you supply. The Table Wizard varies slightly in content based on the version of Oracle on the target datasource. But in all cases, you name columns and determine column width or precision and scale depending on the column’s data type. A row collects the column information that corresponds to a single record.

You can set rules for the columns to live by, and these are called integrity constraints. For example, if you select NOT NULL, that column will have to have a value in each row.

Also, before beginning, consider what kind of table you want to create as the wizard will ask you to choose:

Heap organized table

Index-organized table

Partitioned table

Clustered table

This is a basic table where data is stored as an unordered collection, i.e., heap.

A B-tree index structure stores data, sorted by primary key. Nonkey column values are stored too.

Data is broken down into smaller, more manageable pieces called partitions or subpartitions. Each partition can be managed individually and operate independent of the other partitions.

This is a table that, once created, is part of a cluster. A cluster is a group of tables that share some data blocks and columns and are often used together. To create a cluster, use the

Cluster Wizard (Oracle) .

NOTE:

The table wizard panels differ depending on what options you select.

NOTE:

To simplify the process of creating a table, the Table Wizard focuses on creating the basic table definition with a primary key constraint. After you create the basic table definition you can add unique and foreign keys to the table on the Constraints Tab of the Tables Editor.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 363

C RE A T I N G O B J E C TS

To create a new table using a wizard:

1

Open an Object Wizard

for a table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Tables (Oracle) - Properties .

Columns panel - for details, see

Tables (Oracle) - Columns .

Indexes panel

(not available with a Row Organization of EXTERNAL)

- for details, see Tables

(Oracle) - Columns

.

Constraints panel (not available with a Row Organization of EXTERNAL) - for details, see

Tables (Oracle) - Constraints

.

Storage panel (not available with a Row Organization of EXTERNAL) - for details, see

Tables (Oracle) - Storage

.

IOT Properties panel (not available with a Row Organization of EXTERNAL) - for details,

see Tables (Oracle) - IOT Properties

.

Partition (not available with a Row Organization of EXTERNAL) - for details, see Tables

(Oracle) - Partition

.

Comment panel - for details, see Add a Comment to an Object

.

Permissions panel - for details, see

Set Permissions for an Object .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

T

ABLES

(O

RACLE

) - P

ROPERTIES

When creating or editing a table, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Cache

Row Movement

Parallel Degree

Parallel Instances

Physical group

Logging

Description

Select the owner of the table.

Provide a name for the table

Enabling this feature keeps a block in memory by placing it at the most recently used end.

This option is useful for small lookup tables.

Enabling this option permits the migration of a row to a new partition if its key is updated.

A value indicating the number of query server processes that should be used in the operation.

A value indicating how you want the parallel query partitioned between the Parallel Servers.

Choose a Row Organization of INDEX, HEAP, or EXTERNAL.

If you chose INDEX or HEAP, enable or disable Logging.

If you chose EXTERNAL, provide an External Type, Default Directory, Access Parameters,

Reject Limit, and Location.

Redo logs minimize the loss of data in the event that an uncontrolled shutdown happens.

36 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

T

ABLES

(O

RACLE

) - C

OLUMNS

When creating or editing a table, this tab/panel lets you manage the columns for the table.

To add a column to the table

1 Click Add Column, provide a Name he column in the Property/Value list, and press TAB or

ENTER.

The column is added to the columns list on the left, with default attribute values.

2 Proceed to edit the column attributes.

To edit column attributes

3 Select the column in the columns list on the left. The controls in the Property/Values list are updated with values of the selected column.

4 Use the following table as a guide to providing additional property values, noting that availability of a property differs by data type and other property selections.

Property or group

Virtual

Datatype

Allow Nulls

Encryption

Default Value

Comment

Description

Selecting this check box defines the column as an Oracle virtual column, with a value calculated from a column expression. Virtual columns do not use any disk space as there is o data to store, and INSERT/UPDATE operations are not supported. Consult Oracle documentation before working with virtual columns to familiarize yourself with topics such as column expressions and virtual column-specific details such as automatic type conversion.

For more information, see Accessing Third Party Documentation .

After specifying a column as virtual, use the Default Value box to provide the calculation.

This group lets you select a valid Type for the column. Depending on your selection, additional properties such as Scale, Size, Width, and Unused may be available.

Select this check box to allow nulls in this column.

Use controls in this group to have the column encrypted using transparent data encryption.

Select the Encrypted check box to enable transparent data encryption for the column.

Type a Password value used to build an IDENTIFIED BY clause. The column key will be derived from the value you provide.

Select the Salted check box to add a SALT option, appending a random ‘salt’ string, to the clear text of the column before encrypting. Leaving the check box unselected adds a

NO SALT option.

From the Encryption Algorithm dropdown, select an algorithm (AES256, NONE,

DES168, AES192, AES128, or DES156) that will be used to build a USING clause.

If you selected the Virtual check box, type a valid Oracle column expression that will calculate the value of the column.

Otherwise, either select a pseudocolumn (CURRENT_TIMESTAMP, USER, SYSDATE, or

UID) from the dropdown or type an expression resulting in a value that matches the selected Datatype.

Lets you add a comment to the column.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 365

C RE A T I N G O B J E C TS

Property or group

LOB Storage

Description

This group is available for bfile, blob, clob, and nclob types. Settings include Segment

Name, Configuration properties (Tablespace, Chunk, Percent Version, Enable

Storage In Row, Cache, and Logging), and Storage properties (Initial Extent, Next

Extent, Percent Increase, Minimum Extents, Maximum Extents, Free Lists, and Free

List Groups).

To delete a column

1 Select a column from the column list on the left.

2 Click Delete to remove the column from the table.

To change a column’s ordering position

1 Select a column from the column list on the left.

2 Use the arrow buttons to move the column up or down.

T

ABLES

(O

RACLE

) - I

NDEXES

NOTE:

This tab/panel is not available with a Row Organization of EXTERNAL.

Click Add to open the

Index Wizard (Oracle) .

T

ABLES

(O

RACLE

) - C

ONSTRAINTS

NOTE:

This tab/panel is not available with a Row Organization of EXTERNAL.

Selecting a constraint type and clicking Add opens the object wizard for that object type. For details see:

Primary Key Wizard (DB2 LUW)

Unique Key Wizard (DB2 LUW)

Foreign Key Wizard (IBM DB2 LUW)

T

ABLES

(O

RACLE

) - S

TORAGE

NOTE:

This tab/panel is not available with a Row Organization of EXTERNAL.

36 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

When creating or editing a table, this tab/panel has the following settings:

Settings Description

Data Block Storage group

Select the DEFAULT Tablespace only if you want the partitions in the same tablespace as the partitions in the underlying table.

Percent Free identifies how much space you want to allocate for new rows or updates to existing rows.

Initial Transactions ensures that a minimum number of concurrent transactions can update a primary key block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum Transactions limits concurrency on a primary key block.

Extents group An extent is the unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Percentage Increase - Lets you type the percentage.

NOTE: You should be careful when setting Percent Increase because it magnifies how an object grows and, therefore, can materially affect available free space in a tablespace.

Minimum Extents - For a dictionary managed tablespace, this is the total number of extents to be allocated when the index is first created. For a locally managed tablespace, this is simply the initial amount of space allocated.

Maximum Extents - For a dictionary managed tablespace, this is the total number of extents that can ever be allocated to the index. In a locally managed tablespace, the database will automatically manage the extents.

Freelists group

Buffer Pool

Free lists let you manage the allocation of data blocks when concurrent processes are issued against the primary key. You can potentially improve the performance of the primary key by identifying multiple free lists, which can reduce contention for free lists when concurrent inserts take place.

The default and minimum value is 1. You should increase this number if multiple processes access the same data block.

Free List Groups is the number of groups of free lists.

NOTE: This option is only applicable for the parallel server option.

DEFAULT - Choose this if you want to use the default bufferpool.

KEEP - Use this to retain the object in memory to avoid I/O conflicts. This type of bufferpool stores frequently referenced data blocks in a separate cache.

RECYCLE - Select this option to save cache space by ridding data blocks from memory as soon as they are no longer in use.

T

ABLES

(O

RACLE

) - IOT P

ROPERTIES

NOTE:

This tab/panel is not available with a Row Organization of EXTERNAL.

Provide compression and space details for an index-organized table.

T

ABLES

(O

RACLE

) - P

ARTITION

NOTE:

This tab/panel is not available with a Row Organization of EXTERNAL.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 367

C RE A T I N G O B J E C TS

Prior to working with partitions, you should be familiar with the material in DBArtisan and Oracle

Partitioning .

Click Create Partition to Partition a table

.

DBA

RTISAN AND

O

RACLE

P

ARTITIONING

Partitioning your tables lets you get around the problem of supporting large tables. Partitioning lets you break large tables into smaller pieces, which are called partitions. Partitions make the data in your table easier to manage and analyze. Your SQL statements can access the partitions rather than the entire table. Partitions are most useful in data warehouse applications, which store large amounts of data.

The table below describes the types of partitions in Oracle:

Partition Type

Range

Hash

Composite

List

Description

Use range partitioning to map rows to partitions based on ranges of column values. This type of partitioning is useful when dealing with data that has logical ranges into which it can be distributed; for example, months of the year. Performance is best when the data evenly distributes across the range. If partitioning by range causes partitions to vary dramatically in size because of unequal distribution, you may want to consider one of the other methods of partitioning.

Use hash partitioning if your data does not easily lend itself to range partitioning, but you would like to partition for performance and manageability reasons. Hash partitioning provides a method of evenly distributing data across a specified number of partitions. Rows are mapped into partitions based on a hash value of the partitioning key. Creating and using hash partitions gives you a highly tunable method of data placement, because you can influence availability and performance by spreading these evenly sized partitions across I/O devices (striping).

In Oracle 8i, Oracle introduced both hash and composite partitioning. Hash partitions partition the table according to a hash function. Composite partitions use both range and hash types, first partitioning the data by a range of values, and then further dividing the partitions into subpartitions by way of a hash function. This option is not available for indexorganized tables.

Use list partitioning when you require explicit control over how rows map to partitions. You can specify a list of discrete values for the partitioning column in the description for each partition. This is different from range partitioning, where a range of values is associated with a partition, and from hash partitioning, where the user has no control of the row to partition mapping.

P

ARTITION A TABLE

The Add partition wizard lets you set up partitions for a table. Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Step

Properties

Columns

Settings and tasks

Select a Partition Type and optionally, a Subpartition Type.

For each column, click the New button and select a name from the Column dropdown. Use the Delete button to drop a selected column.

36 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Step

Subpartition

Columns (only available with a

Partition Type of

RANGE and

Subpartition Type of HASH or LIST)

Settings and tasks

For each column, click the New button and select a name from the Column dropdown. Use the Delete button to drop a selected column.

Subpartitions (only available with a

Subpartition Type of HASH)

Range Definitions

(only available with a

Partition Type of

RANGE)

Specify a Default number of partitions. For each partition, click the New button and then select a tablespace from the dropdown.

Click the New button to Add a partition definition .

Partition Definition

(only available with a

Partition Type of

HASH)

List Definitions (only available with a

Partition Type of

List)

To specify a partition method other than None, take one of the following actions: (1) Select the Number Of Partitions radio box, specify the Number Of Partitions, and for each partition, click the New button and choose a tablespace from the dropdown, or (2) select the

By Partition Name radio box and for each partition, click the New button provide a name and then choose a tablespace from the dropdown.

Click New to Add a partition definition

.

A

DD A PARTITION DEFINITION

Use the following topics as a guide in completing the settings in this wizard:

Step Settings and tasks

Partition Definition Name

Tablespace

Logging

Subpartitions

Storage

Provide a name.

Select a tablespace from the dropdown

Enable or disable logging.

To specify a partition method other than None, select the By Subpartition Name radio box and for each partition, click the New button to open a dialog that lets you provide subpartition values.

NOTE: When you split a range-list partition, you cannot specify the new partitions’ subpartition information.

Provide or select Data Block Storage, Extents, Freelists, and Buffer Pool values.

T

ABLESPACE

W

IZARD

(O

RACLE

)

Tablespaces are logical storage structures that act as partitions for the database. Each tablespace consists of one or more datafiles which are the physical structures holding the data.

You can create a tablespace to store table data and other objects related to table performance such as indexes or large object data. Tablespaces are used to manage large complex databases.

Once you have created a tablespace, you can place objects on it.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 369

C RE A T I N G O B J E C TS

The Tablespace Wizard lets you:

• Name the tablespace, and specify space management.

• Specify what types of objects are stored on the tablespace, and place the tablespace online or offline.

• Add the datafiles that comprise the tablespace and specify the parameters for the datafiles.

• Specify how Oracle should manage the growth of the tablespace.

Important Notes

• For auto-UNDO management to be in effect, set init.ora parameter to undo_management.

When set to MANUAL (the default), it disables auto-UNDO management. When to set

AUTO, auto-UNDO management is enabled.

• To determine if the undo_management parameter is set to AUTO, use the following query:

SELECT VALUE

FROM SYS.V_$PARAMETER

WHERE NAME = 'undo_management'

NOTE:

This parameter cannot be set dynamically via the ALTER SYSTEM or ALTER SESSION.

For users using a version earlier than Oracle 8i and locally managed tablespaces, there are manual methods you can use to assist in the fight against tablespace fragmentation. They include:

• Setting PCTINCREASE to zero for all tablespaces and objects to promote same-sized extents.

• Specifying equal-sized allotments for your INITIAL and NEXT object storage parameters.

• Grouping objects with like growth and storage needs together in their own tablespaces.

One of the best ways to avoid fragmentation in a tablespace is to pre-allocate the space that your objects will use. If possible, plan for one to two years' growth for each object and allocate your space accordingly. Having initial empty objects will not affect table scan times as Oracle only scans up to the high-water mark (the last used block) in a table.

Of all your tablespaces, you want to avoid fragmentation problems in your SYSTEM tablespace the most as this is the major hotbed tablespace for Oracle activities. The easiest way to avoid this is to not allow any user (even the default DBA ID's SYS and SYSTEM) to have access to it.

There are three ways to do this:

• Ensure no user has a DEFAULT or TEMPORARY tablespace assignment of SYSTEM.

• Ensure no user has a quota set for SYSTEM.

• Ensure no user has been granted the UNLIMITED TABLESPACE privilege.

37 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new tablespace using a wizard:

1

Open an Object Wizard

for a tablespace.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - see Tablespaces (Oracle) - Properties .

Datafiles panel - see Tablespaces (Oracle) - Datafiles .

DDL panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

T

ABLESPACES

(O

RACLE

) - P

ROPERTIES

When creating or editing a tablespace, this tab/panel lets you work with the following settings:

Setting

Name

Big File

Type

Tablespace Group

Retention Guarantee

Description

Provide a name for the tablespace.

Selecting this check box results in a CREATE BIGFILE TABLESPACE statement being generated. This results in a large, single file tablespace.

Leaving this check box unselected results in a tablespace containing multiple smaller datafiles.

Leaving the default PERMANENT selection creates a permanent tablespace, intended to contain schema objects you want to keep on an ongoing basis. The objects are stored in datafiles.

The other two options let you generate a CREATE TABLESPACE statement that specifies

TEMPORARY or UNDO keywords.

An Undo tablespace is a kind of permanent tablespace that holds undo data if your database is operating in automatic undo mode. Oracle recommends the automatic undo mode as the wiser choice than using rollback segments to undo.

In a Temporary tablespace, shema objects will last only as long as your session continues.

This option is only available with a Type value of TEMPORARY.

If there are currently entries in the SYS.DBA_TABLESPACE_GROUPS table, you can either select an existing group or type the name for a new tablespace group. If there are currently no entries in the SYS.DBA_TABLESPACE_GROUPS table, you can type the name of a new tablespace group to be created.

When editing a tablespace, clearing the entry from the Tablespace Group box deletes the <tablespace_name, group_name> entry from the SYS.DBA_TABLESPACE_GROUPS table.

This option is only available with a Type value of UNDO.

Selecting this check box specifies that unexpired data should be preserved for all Undo segments of the tablespace, regardless of whether this may force failure of ongoing operations that require space in those segments.

Leaving this check box unselected specifies default RETENTION NOGUARANTE behavior. Space currently being used by unexpired undo data in undo segments can be consumed as necessary by ongoing transactions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 371

C RE A T I N G O B J E C TS

Setting

Status

Logging

Force Logging

Compression Type

Flashback

Encrypted and

Algorithm

Locally Managed,

Uniform Allocation,

Size, Automatic

Segment Space

Management, and

Minimum Extent Size

Use Default Block Size and Block Size

Description

This option is only available with a Type value of PERMANENT.

Use this control to specify an ONLINE/OFFLINE clause in the generated DDL. The

ONLINE selection makes the tablespace available immediately after creation. The

OFFLINE selection results in a table is unavailable immediately after creation.

This option is only available with a Type value of PERMANENT.

Use this control to specify a LOGGING/NOLOGGING clause in the generated DDL. This sets the default logging attributes of all tables, indexes, materialized views, materialized view logs, and partitions within this tablespace.

This option is only available with a Type value of PERMANENT.

Selecting this check box specifies that a FORCE LOGGING clause be included in the generated DDL.

Changes to all objects in the tablespace (temporary segments excepted) are logged, overriding any NOLOGGING setting for individual objects.

This option is only available with a Type value of PERMANENT.

This lets you select default compression type of ALL OPERATIONS (corresponds to

COMPRESS FOR ALL OPERATIONS in the DDL), COMPRESS_DIRECT_LOAD

(corresponds to COMPRESS FOR DIRECT_LOAD OPERATIONS in the DDL) or no compression.

This option is only available with a Type value of PERMANENT.

Use this control to specify a FLASHBACK ON/FLASHBACK OFF clause in the generated

DDL. Select this check box to put the tablespace in FLASHBACK mode. In FLASHBACK mode, Oracle saves Flashback log data for the tablespace and the tablespace can participate in a FLASHBACK DATABASE operation.

If you leave this check box unselected, Oracle does not save Flashback log data for the tablespace. Prior to FLASHBACK DATABASE operations, you must either take datafiles in the tablespace off line or drop them OR take the entire tablespace offline. The database does not drop existing Flashback logs.

This option is only available with a Type value of PERMANENT.

Selecting the Encryption check box enables the Algorithm control. Together, they let you add an ENCRYPTION USING clause to the generated DDL. The Algorithm lets you select from AES 128, AES192, AES256, DES56, DES168, or NONE encryption algorithms.

These option are only available with a Type value of PERMANENT or UNDO.

These controls let you work with the extent-related clauses that will be included in the generated DDL.

Selecting the Locally Managed check box lets you generate an EXTENT

MANAGEMENT LOCAL clause. Subsequently leaving the Uniform Allocation check box deselected adds an AUTOALLOCATE option. Alternatively, selecting the Uniform

Allocation check box enables the Size check box, letting you add a UNIFORM SIZE option. Select the Automatic Segment Space Management check box to generate a

SEGMENT SPACE MANAGEMENT AUTO or leave it deselected to generate a

SEGMENT SPACE MANAGEMENT MANUAL clause.

Leaving the Locally Managed check box deselected generates an EXTENT

MANAGEMENT DICTIONARY clause. This also enables the Minimum Extent Size control, letting you select a MINIMUM EXTENT clause value.

Disabling the Use Default Block Size check box enables the Block Size control, generating a BLOCKSIZE clause to specify a nonstandard block size for the tablespace.

37 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

T

ABLESPACES

(O

RACLE

) - D

ATAFILES

When creating or editing a tablespace, this tab/panel lets you build DATAFILE or TEMPFILE clauses that will be submitted with the CREATE TABLESPACE statement creating or editing this tablespace. This lets you manage the files that make up the tablespace.

To add a datafile

1 Click Add, either select an existing file name from File Name dropdown or type the name of a new file, and then press TAB or ENTER.

The file is added to the datafiles list on the left, with default attribute values.

2 Proceed to edit the datafile attributes.

To edit datafile attributes

3 Select the file from the list on the left. The controls in the Property/Values list are updated with values of the selected file.

4 Use the following table as a guide to modifying property values.

Properties

Size

Reuse Existing File

Auto Extend and

Growth Amount

Unlimited and Value

Description

Lets you specify the SIZE option for the DATAFILE/TEMPFILE clause, to specify the size of the file

Lets you specify the REUSE option for the DATAFILE/TEMPFILE clause, to specify that an existing file can be reused.

Use these options to select an AUTOEXTEND option for the DATAFILE/TEMPFILE clause.

Leaving the Auto Extend check box unselected disables the Growth Amount disabled and specifies an AUTOEXTEND OFF option in the generated DDL.

Selecting the Auto Extend check box lets you specify an AUTOEXTEND ON NEXT clause. Selecting Auto Extend enables the Growth Amount control, letting you specify the size of the next increment of disk space automatically allocated when more extents are required.

These options are only available with Auto Extend selected. They let you specify a

MAXSIZE clause.

Selecting the Unlimited check box lets you specify a MAXSIZE UNLIMITED clause, placing no limit on the size of the file.

Leaving the Unlimited check box unselected enables the Value disabled. This specifies a

MAXSIZE clause with a size provide by the Value control.

To delete a datafile

1 Select a datafile from the column list on the left.

2 Click Delete to remove the datafile from the tablespace.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 373

C RE A T I N G O B J E C TS

T

RIGGER

W

IZARD

(O

RACLE

)

A trigger is a special type of procedure that automatically fires when defined data modification operations (insert, update, or delete) occur on a designated table or view. Triggers fire after an insert, update or delete, but belong to the same transaction as the data modification operation.

A stored procedure, on the other hand, is activated explicitly by the user or application (or trigger). Triggers should only be used for centralized, global operations that should be initiated by the triggering statement and should not be based on whether a particular user or database application issues the statement.

Important Notes

• To create triggers in your own schema, you need CREATE TRIGGER privileges. To create triggers in other schemas, you need CREATE ANY TRIGGER privileges.

To create a new trigger using a wizard:

1

Open an Object Wizard

for a trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Triggers (Oracle) - Properties

.

Column Selection panel - for details, see Triggers (Oracle) - Column Selection

.

Action panel - for details, see

Triggers (Oracle) - Action .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

T

RIGGERS

(O

RACLE

) - P

ROPERTIES

When creating or editing a trigger, this tab/panel lets you work with the following settings:

Setting

Parent Type,

Parent Owner, and

Parent Name

Name

Enabled

Trigger Timing

Description

Select the type (TABLE or VIEW), owner and specific object for which the trigger is being created.

Provide a name for the trigger being created.

Enable or disable the trigger.

BEFORE: These triggers serve as extensions to the constraint subsystem and are most often used to validate input data, generate values for newly inserted rows, and read from other tables for cross-reference purposes. Note: Before triggers must be created as a For Each Row.

AFTER: Such a trigger is run after the integrity constraint validations; they can be used to modify operations in the database or be used for activities beyond the database, like supporting an alert notification.

37 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Setting

Fire On Insert, Fire

On Update, and

Fire On Delete

Trigger Type

Old Table Alias

New Table Alias

When Clause

Description

Enable the events that fire the trigger.

An INSERT trigger must be associated with an INSERT statement. For example, if a data load operation doesn’t include an INSERT statement, the trigger won’t be invoked.

An UPDATE trigger can be associated with specific columns of the base table and will only be activated if those columns are updated.

A DELETE trigger fires automatically after items in the table are deleted.

STATEMENT: (only fires once).

ROW (fires for each affected row): The trigger runs as many times as there are rows in the affected section. If the set of affected rows is empty, the trigger doesn’t run.

Type the name of a temporary table of rows as they exist before they’re updated or deleted.

Type a name for a temporary table of rows as they exist after they’re inserted or updated.

Type a WHEN clause or open a WHEN CLAUSE wizard to further qualify the trigger behavior.

T

RIGGERS

(O

RACLE

) - C

OLUMN

S

ELECTION

If you chose UPDATE as the Trigger Event, select the columns, select the check box beside each column that is to fire the trigger.

T

RIGGERS

(O

RACLE

) - A

CTION

Provide the body of trigger. If the SQL statement you have in mind for a trigger is longer than 60 lines of code, you would be better off creating a stored procedure.

INSTEAD OF statements can only be used by view triggers. BEFORE and AFTER options cannot be used for view triggers.

O

BJECT

T

YPE

W

IZARD

(O

RACLE

)

Types define an abstract data type or object composed of a collection of similar types of data.

For example, you can create an object type that defines a full address rather than the pieces of an address, such as city, state and postal code. An object type stores the pieces of an address in a single type, storing them in the same location, and allowing the full address to be accessed and manipulated as single unit rather than multiple units.

To Open the Object Type Wizard

1 On the Explorer, find the datasource where you want to create a Type and expand the

Schema node.

2 Right-click the Type node, and select New.

The single page wizard asks that you pick an owner for the type and name the type. The fun begins after you make your choices and click Finish. The Object Editor, where you can finalize the object type’s creation, opens.

The Object Type Editor’s tabs are:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 375

C RE A T I N G O B J E C TS

Header: Here you flesh out the specification for the type you’re creating including any methods

(a subprogram), attributes, and any parameters or return types for a function.

Body: For every specification, the object type body defines the code for the method. If the object type header declares only attributes, not a method, the body is unnecessary.

You need to create the object type before you can see the following tabs. After you’ve added what you need to the Header and Body pages of the Editor, click Create on the toolbar.

Information: Read-only page that indicates the vital statistics for the object type.

Dependencies: A tree structure displays the objects that depend on the type you have created.

Privileges: Displays individual, group, and role permissions associated with the object type.

U

NIQUE

K

EY

W

IZARD

(O

RACLE

)

A unique key constraint requires that every value in a column or set of columns be unique. Thus, no two rows of a table have duplicate values in the column or set of columns you identified. So, for example, you can use a unique key constraint to make sure you haven’t duplicated a social security number in a list of employees.

To create a new unique key using a wizard:

1

Open an Object Wizard

for a unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Unique Keys (Oracle) - Properties .

Columns panel - for details, see

Unique Keys (Oracle) - Columns

.

Storage panel - for details, see

Unique Keys (Oracle) - Storage

.

Partition panel - for details, see

Unique Keys (Oracle) - Partition .

DDL panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

NIQUE

K

EYS

(O

RACLE

) - P

ROPERTIES

When creating or editing a unique key, this tab/panel lets you work with the following settings:

Setting

Table Owner and

Table Name

Name

No Sort

Description

Choose the owner and name of the table in which the unique key is being created.

Provide a name for the unique key being created.

Enable this feature if the rows in the table already stored in ascending order. This increases the speed of the index creation process. Oracle does not sort the rows.

37 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Setting

Logging

Reverse

Validate

Deferrable

Deferred

Enabled

C RE AT I N G O B J E C T S

Description

Enabling logs this operation to the redo file.

Enabling this feature stores the bytes of the index block in reverse order and excludes the

ROWID. The ROWID is a globally unique identifier for a row in a database. It is created at the time the row is inserted into a table, and destroyed when it is removed from a table.

Enabling this option indicates that existing data is checked against the constraint when the primary key is enabled. Leaving it disabled indicates that only new data is to be checked against the constraint.

Dictates whether constraint checking can be deferred until the end of a transaction.

This option is enabled only if you enabled the Deferrable option. Select IMMEDIATE to have the constraint checked at the end of every DDL statement. Select DEFERRED to have the constraint checked only at the end of a transaction.

Enables or disables the primary key.

U

NIQUE

K

EYS

(O

RACLE

) - C

OLUMNS

From the Column dropdown, select a column for the index and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the

Delete button to drop columns.

U

NIQUE

K

EYS

(O

RACLE

) - S

TORAGE

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting Description

Data Block Storage group

Select the DEFAULT Tablespace only if you are creating a local partitioned index and want the partitions in the same tablespace as the partitions in the underlying table. (Each partition of a local index is associated with one partition of the table. Oracle can then keep the index partitions in synch with table partitions.)

A transaction entry is needed for each INSERT, UPDATE, DELETE, etc. statement that accesses one or more rows in the block. Transaction entries in many operating systems require approximately 23 bytes.

Percent Free identifies how much space you want to allocate for new rows or updates to existing rows.

Initial Transactions ensures that a minimum number of concurrent transactions can update an index block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum Transactions limits concurrency on an index block.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 377

C RE A T I N G O B J E C TS

Setting

Extents group

Freelists group

Buffer Pool

Description

An extent is the unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Percentage Increase - Lets you type the percentage.

NOTE: You should be careful when setting Percent Increase because it magnifies how an object grows and, therefore, can materially affect available free space in a tablespace.

Minimum Extents - For a dictionary managed tablespace, this is the total number of extents to be allocated when the index is first created. For a locally managed tablespace, this is simply the initial amount of space allocated.

Maximum Extents - For a dictionary managed tablespace, this is the total number of extents that can ever be allocated to the index. In a locally managed tablespace, the database will automatically manage the extents.

Free lists let you manage the allocation of data blocks when concurrent processes are issued against the index. You can potentially improve the performance of the index by identifying multiple free lists, which can reduce contention for free lists when concurrent inserts take place.

The default and minimum value is 1. You should increase this number if multiple processes access the same data block.

Free List Groups is the number of groups of free lists.

NOTE: This option is only applicable for the parallel server option.

DEFAULT - Choose this if you want to use the default bufferpool.

KEEP - Use this to retain the object in memory to avoid I/O conflicts. This type of bufferpool stores frequently referenced data blocks in a separate cache.

RECYCLE - Select this option to save cache space by ridding data blocks from memory as soon as they are no longer in use.

U

NIQUE

K

EYS

(O

RACLE

) - P

ARTITION

Clicking Create Partition opens a wizard that lets you create a partition.

U

SER

W

IZARD

(O

RACLE

)

Whoever you add as a user will have access to the Oracle database. You also can set up the means by which the database recognizes the user.

Important Notes

• To create a user, you need the CREATE USER system privilege.

37 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new user using a wizard:

1

Open an Object Wizard

for a user.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Users (Oracle) - Properties

.

Roles panel - for details, see Users (Oracle) - Roles .

Quotas panel - for details, see

Users (Oracle) - Quotas

.

DDL panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

SERS

(O

RACLE

) - P

ROPERTIES

When creating or editing a user, this tab/panel lets you work with the following settings:

Setting

Name

Default Tablespace

and Temporary

Tablespace

Profile

Identified By

Description

Provide a name for the user.

Select the default tablespace for objects the user creates and the tablespace to be used for the user’s temporary segments.

If you do not specify a default tablespace when creating a user, the assigned tablespace will

be that set using the Set Default function. For details, see Set Default .

The profile you choose affects the amount of database resources available to the user.

REQUIRED_YES - A user identified by password is a local user.

REQUIRED_EXTERNAL - This is a user who is validated by an external service like an operating system or third-party service. The login authentication is handled by that external entity.

REQUIRED_GLOBAL - The user you’re creating is a global user who is authenticated by the enterprise directory service.

Password

External Name

Account Locked

If you specified an Identified By value of REQUIRED_YES, provide a password for the user.

If you specified an Identified By value of REQUIRED_EXTERNAL, provide an external name for the user.

When enabled, the account cannot be altered by anyone but the creator. It also means that after a specified number of failed attempts to access the database, the database will remain closed to the user for a period of time.

Password Expired

Marks the password as expired, forcing the user to change the password before being allowed to connect to the database.

U

SERS

(O

RACLE

) - R

OLES

For each role to be assigned to the user, select the check box beside that role.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 379

C RE A T I N G O B J E C TS

U

SERS

(O

RACLE

) - Q

UOTAS

To assign a tablespace quota for a user, select a tablespace, select the Other radio button, and provide the value in the Quota box.

V

IEW

W

IZARD

(O

RACLE

)

Views are SQL queries stored in the system catalog that customize the display of data contained in one or more tables. Views behave like tables because you can query views and perform data manipulation operations on them. However, views do not actually store any data. Instead, they depend on data contained in their base tables. You can use views to help enforce corporate security policies by creating a view that limits information a user can see.

Important Notes

• To create a view in your own schema, you need CREATE VIEW privileges. To create a view in someone else's schema, you need CREATE ANY VIEW privileges.

To create a new view using a wizard:

1

Open an Object Wizard

for a view.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Views (Oracle) - Properties

.

Definition panel - for details, see Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

V

IEWS

(O

RACLE

) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the view. The owner of the view must have SELECT privileges for the tables in the CREATE view statement or DBADM authority on the database that contains the table.

Provide a name for the view.

V

IEWS

(O

RACLE

) - D

EFINITION

This is where you build the query that will display the data you’re interested in seeing. The template is CREATE VIEW <name> AS

SELECT: Identify the columns you want to show in the view

FROM: Identify the table(s) you want to draw the data from

WHERE: Write the equivalence you want to view.

38 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

You can use the Query Builder to help you write the appropriate SQL statement. For details, see

Query Builder .

S

YBASE

ASE O

BJECT

W

IZARDS

DBArtisan lets you create Sybase objects using the following wizards:

• Alias Wizard (Sybase)

• Database Device Wizard (Sybase)

• Database Wizard (Sybase)

• Data Cache Wizard (Sybase)

• Default Wizard (Sybase)

• Dump Device Wizard (Sybase)

• Extended Procedure Wizard (Sybase)

• Foreign Key Wizard (Sybase)

Functions Wizard (Sybase)

• Group Wizard (Sybase)

• Index Wizard (Sybase)

Login Wizard (Sybase)

• Primary Key Wizard (Sybase)

• Procedure Wizard (Sybase)

• Remote Server Wizard (Sybase)

• Role Wizard (Sybase)

• Rule Wizard (Sybase)

• Segment Wizard (Sybase)

• Table Wizard (Sybase)

• Trigger Wizard (Sybase)

• Unique Key Wizard (Sybase)

• User Datatype Wizard (Sybase)

• User Message Wizard (Sybase)

• User Wizard (Sybase)

• View Wizard (Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 381

C RE A T I N G O B J E C TS

A

LIAS

W

IZARD

(S

YBASE

)

The Alias Wizard lets you map a login to an existing user in the database. You can set up aliases so that multiple users log in to the same account and therefore have the same privileges. You can also set up an alias based on individual log ins and give those users access to the same alias with the advantage that you can track their activity within the database.

To create a new alias using a wizard:

1

Open an Object Wizard

for an alias.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Aliases (Sybase) - Properties

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

A

LIASES

(S

YBASE

) - P

ROPERTIES

When creating or editing an alias, this tab/panel lets you work with the following settings:

Setting

Name

User

Description

Provide a name for the alias being created.

Select the user to which the alias refers. The user has to have a valid account on SQL Server but cannot be a user in the current database.

D

ATABASE

D

EVICE

W

IZARD

(S

YBASE

)

A database device is part or all of a disk device used for storing a database and its transaction log.

The Database Device Wizard lets you specify basic creation attributes and override many obscure, rarely-used parameters of the DISK INIT statement.

NOTE:

Make sure that your Sybase ASE is configured for enough devices that it can accommodate the creation of another device. If not, increase that parameter from the

Server Configuration dialog box. For details, see Configuring the Server

.

To Open the Database Device Wizard

1 On the Explorer, find the datasource where you want to add a database device and expand the Storage node.

2 Right-click the Database Devices node, and select New.

38 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

3 Use the following topics as a guide to understanding and setting options on the panels of this wizard:

Properties panel - for details, see Database Devices (Sybase) - Properties .

DDL View panel - for details, see

Create the New Object .

4 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D

ATABASE

D

EVICES

(S

YBASE

) - P

ROPERTIES

When creating or editing a database device, this tab/panel lets you work with the following settings:

Setting

Creation

Attributes

Autogrowth

Description

Name - the abstract name you want to assign to the device. If for any reason the physical device is down, you can redefine the logical name to a new device.

Physical Name - specify the full path for the file, including the hard drive letter or machine name, directory and full file name with the *.DAT extension (for example,

D:\SYB\DATA\TEST.DAT)

Device Number - DBArtisan automatically calculates the next open device number and defaults its value in the box. Numbering is sequential.

Controller number - Normally, Sybase ASE uses 0

Size - in kilobytes, megabyes, gigabytes, or terabytes.

Default Device - The default device is where all new DBArtisan databases are placed unless the user specifies an exact device in the CREATE DATABASE statement.

Virtual Address, Dsync, and DirectIO - Let you specify DISK INIT and DISK REINIT parameters.

Lets you enable/disable Auto Growth and if enabled, to specify Growth rate and Maximum

Size values.

D

ATABASE

W

IZARD

(S

YBASE

)

The Database Wizard lets you create a database (a structured collection of data that can be updated or queried) without knowing the underlying commands. Databases can be simple, that is one file with many records and the same fields, or much more complicated with multiple files with different fields.

To create a new database using a wizard:

1

Open an Object Wizard

for a database.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Databases (Sybase) - Properties

.

Placement panel - for details, see

Databases (Sybase) - Placement

.

DDL View panel - for details, see

Create the New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 383

C RE A T I N G O B J E C TS

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D

ATABASES

(S

YBASE

) - P

ROPERTIES

When creating or editing a database, this tab/panel lets you work with the following settings:

Setting

Database Name

For Load

With Override

Type

Options group

Description

Provide a name for the database.

This option speeds loading by eliminating the step for pre-initializing panels. The for load option is appropriate when creating a database for recovering from media failure or moving a database from one machine to another.

Enable this option to specify whether logs and data are to be kept on the same logical device

Optionally, use the TEMP option to designate this as a temporary database.

Enable or disable the following Sybase database options: abort tran on log full, allow nulls

by default, auto identity, dbo use only, ddl in tran, identity in nonunique index, no chkpt

on recovery, no free space acctg, read only, select into/bulkcopy/pllsort, single user,

trunc log on chkpt, and unique auto_identity index.

D

ATABASES

(S

YBASE

) - P

LACEMENT

In the Fragment Properties area provide or select values for the default fragment: Device

Name, Size for the fragment, and a Device Type value of data only, log only, or data and log.

If necessary use the New button to add a new fragment and repeat the steps above to provide details for that fragment. Use the Delete button to drop a fragment.

D

ATA

C

ACHE

W

IZARD

(S

YBASE

)

This wizard lets you build and submit an sp_cacheconfig call, creating a new data cache. One or more sp_bindcache calls can also be built and submitted simultaneously, letting you bind databases, tables, indexes, text object, or image object to the new data cache. For each object bound, you can specify sp_cachestrategy parameters, letting you select caching strategies for those objects.

To create a new data cache using a wizard

1

Open an Object Wizard

for a data cache.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Data Caches (Sybase) - Properties .

Objects panel - for details, see Data Caches (Sybase) - Objects .

DDL View panel - for details, see

Create the New Object .

38 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

On creating a data cache, all space is allocated to the logical page size memory pool. You can subsequently use the Data Cache Editor to subdivide the data cache into additional pools with larger I/O sizes. For details, see

Data Cache Editor (Sybase) .

D

ATA

C

ACHES

(S

YBASE

) - P

ROPERTIES

When creating or editing a data cache, this tab/panel lets you work with the following settings:

Setting

Name

Description

Lets you provide a name for the cache.

General properties Type - lets you specify a cache type of MIXED or LOGONLY.

Policy - lets you specify a replacement policy of STRICT or RELAXED.

Status - displays the current status of the cache: ACTIVE, PENDING ACTIVE, or PENDING

DELETE. You can only change a mixed data cache if it does not have any non-log objects bound to it.

Partitions - lets you specify the number of partitions to be created for the cache. Selecting a legal value (1 - 64, in powers of 2) adds that sp_cacheconfig cache_partition parameter value to the DDL generated to create the data cache.

Size properties Configured Size - Lets you specify the size of the cache after the server is restarted.

Consult

Sybase documentation for details on this property. See

Accessing Third Party

Documentation .

Run Size - displays the size that the cache is currently using. For the default cache, this is the amount of all cache space not explicitly configured for another cache

D

ATA

C

ACHES

(S

YBASE

) - O

BJECTS

When creating or editing a data cache, this tab/panel lets you manage the objects bound to the data cache. You use it to bind and unbind objects and to specify the caching strategy for each bound object.

The Objects list on the left displays objects currently bound to the data cache. Specific objects are grouped under the Databases, Tables, and Index subfolders.

The Property/Value list on the right lets you work with caching strategy parameters for a selected table or index. Consult Sybase documentation for information on the Apply to text

only (applies to indexes only), Prefetch Strategy, and MRU Replacement Strategy caching strategies. See

Accessing Third Party Documentation

.

Maintain the Objects list as follows:

Adding a new database, table, or index to the bound objects list - click the Bind button.

This opens a Bind wizard. For detailed information, see Binding Databases, Indexes, or

Tables to a Sybase Data Cache . Use this process repeatedly to bind objects of different

types.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 385

C RE A T I N G O B J E C TS

Enabling or disabling caching strategy options for an object - select an object from the

Objects list and use the check box associated with a strategy to enable or disable that strategy.

Removing an object from the bound objects list - select the object in the Objects list and click Unbind.

B

INDING

D

ATABASES

, I

NDEXES

,

OR

T

ABLES TO A

S

YBASE

D

ATA

C

ACHE

When creating or editing a data cache, the Bind Wizard lets you select the specific objects that are to be bound to the cache.

To bind one or more databases, tables or indexes to a data cache

1 Open the Data Cache Wizard or Data Cache Editor and select the Objects tab. For more information, see

Data Cache Wizard (Sybase) or

Data Cache Editor (Sybase)

.

2 Click Bind to open the Bind Wizard.

3 From the Objects dropdown select Entire Database, Tables, or Indexes.

4 If you selected Tables, or Indexes, from the Databases dropdown select the database containing the specific table or index.

5 If you selected Tables, optionally select the Bind text or image from table objects check box to bind storage of text and images from the table to this cache.

6 Click Objects in the navigation frame to display the Objects panel.

7 Select the check box associated with each specific object that is to be bound to the cache.

8 Click Finish.

D

EFAULT

W

IZARD

(S

YBASE

)

Here you create a default for table column or user-defined datatype in the event that no value is available when the data is inserted. The default value you specify will be inserted only in the current database. You can then bind the default to a specific column or user-datatype.

To create a new default using a wizard:

1

Open an Object Wizard

for a default.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Defaults (Sybase) - Properties

.

Dependencies panel - for details, see Defaults (Sybase) - Dependencies

.

DDL View panel - for details, see

Create the New Object .

38 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

Defaults (Sybase) - Properties

When creating or editing a default, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Value

Description

Select the schema that is to own the default.

Provide a name for the default.

Provide the value of the default.

D

EFAULTS

(S

YBASE

) - D

EPENDENCIES

From the Type dropdown, choose Column or Datatype, and if you chose Column, choose a

Table from the Table dropdown. The list on the left is populated with candidate columns or datatypes. To move a candidate from the list on the left to the dependencies column on the right, select the candidate and click Add. Remove columns or datatypes from the dependencies list on the right by selecting the column or datatype and clicking Remove.

D

UMP

D

EVICE

W

IZARD

(S

YBASE

)

Your system writes its memory image to a dump device so you can retrieve data if your system crashes. All load and dump operations require that you name a device before the operation will complete. When you create a new dump device, ASE adds a row to the sysdevices table in the master database. Sybase recommends that you back up the master database before you create a new device and again after you have created the device. Be sure you have enough disk space on the physical drive to perform these operations.

To create a new dump device using a wizard:

1

Open an Object Wizard

for a dump device.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Dump Devices (Sybase) - Properties

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 387

C RE A T I N G O B J E C TS

D

UMP

D

EVICES

(S

YBASE

) - P

ROPERTIES

When creating or editing a dump device, this tab/panel lets you work with the following settings:

Setting

Name

Physical Name

Device Type

Description

This is the device’s logical name.

The device or file name that is recognized by the operating system. (For example, a:sqltable.dat).

Select TAPE or DISK.

E

XTENDED

P

ROCEDURE

W

IZARD

(S

YBASE

)

Extended stored procedures provide a method for calling external procedural language functions from within the Adaptive Server. A procedural language is a language capable of calling a C language function or manipulating C language datatypes.

To create a new extended procedure using a wizard:

1

Open an Object Wizard

for an procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Extended Procedures (Sybase) - Properties

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

E

XTENDED

P

ROCEDURES

(S

YBASE

) - P

ROPERTIES

When creating or editing an extended procedure, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Library Name

Description

Select the owner of the extended procedure.

Provide the name of the procedure.

Provide the name of the library containing the procedure.

38 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

F

OREIGN

K

EY

W

IZARD

(S

YBASE

)

Foreign keys are used to relate information from one table to another. Foreign keys are unique values that refer to specific columns of other tables. Thus, a foreign key links two tables together.

Embarcadero DBArtisan’s Foreign Key Wizard makes it easy for you to create a relational link between two tables, thereby speeding queries and giving you faster access to data. The column in the initial table, the parent table, is called the primary key. The corresponding column in the

(child) table that references the primary key, is the foreign key. Foreign keys can also refer to columns within the same table.

To create a new foreign key using a wizard:

1

Open an Object Wizard

for a foreign key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Foreign Keys (Sybase) - Properties

.

Column Mapping panel - for details, see Foreign Keys (Sybase) - Column Mapping

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

F

OREIGN

K

EYS

(S

YBASE

) - P

ROPERTIES

When creating or editing a foreign key, this tab/panel lets you work with the following settings:

Setting

Table Owner

Table Name

Match Full

Description

Select the owner of the referring, or child, table

Select the name of the referring, or child, table.

Specify a referential integrity option.

F

OREIGN

K

EYS

(S

YBASE

) - C

OLUMN

M

APPING

Under Referenced Table, choose the Owner and then the Name of the referenced, or parent, table.

Under the Main Table, select check boxes corresponding to the columns that are to reference columns in the referenced table. Then, under Referenced Table, select the corresponding column check boxes.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 389

C RE A T I N G O B J E C TS

F

UNCTIONS

W

IZARD

(S

YBASE

)

The Functions Wizard creates and submits a CREATE FUNCTION command. This lets you create a user-defined function, a saved Transact-SQL routine that returns a specified value. The wizard collects basic identifying information and generates basic CREATE FUNCTION statement syntax, letting you provide the body of the function.

NOTE:

This functionality is supported for Sybase ASE 12.5.

To create a new function using a wizard:

1

Open an Object Wizard

for a function.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Functions (SQL Server) - Properties

.

Definition panel - for details, see

Functions (SQL Server) - Definition .

3 Finally, use the Execute button to create the object. For more information, see Create the

New Object .

Functions (Sybase) - Properties

When creating or editing a function, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the function.

Provide a name for the function.

Functions (Sybase) - Definition

Complete the CREATE FUNCTION outline provided by typing or pasting the body of the function. Finally, use the Schedule or Execute buttons to

Create the New Object .

G

ROUP

W

IZARD

(S

YBASE

)

A group is a collection of privileges that the DBA assigns to designated users.

39 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new group using a wizard:

1

Open an Object Wizard

for a group.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Groups (Sybase) - Properties .

Object Permissions and System Permissions panels - see

Set Permissions for an Object

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

After you click Finish and Execute, use the Group Editor to assign users to the new group. For

details, see Groups Editor (Sybase)

.

G

ROUPS

(S

YBASE

) - P

ROPERTIES

When creating a group, this panel lets you provide a name for the group.

I

NDEX

W

IZARD

(S

YBASE

)

Like an index in a book, a table index helps you get at the data you want without having to read through the whole table. Indexes can exist on single column or on multiple columns. Indexes appear in the form of B-trees. And, as for books, you can have multiple indexes for a single table.

To create a new index using a wizard:

1

Open an Object Wizard

for an index.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Indexes (Sybase) - Properties

.

Columns panel - for details, see

Indexes (Sybase) - Columns .

Partition panel - for details, see

Indexes (Sybase) - Partition .

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 391

C RE A T I N G O B J E C TS

I

NDEXES

(S

YBASE

) - P

ROPERTIES

When creating or editing an index, this tab/panel lets you work with the following settings:

Setting

Table Owner, Table

Name, and Name

Attributes

Description

Select or provide identifying information.

Provide or select values for the following Sybase options: Index Type,

Clustered, Ignore Duplicate Key, Ignore Duplicate Rows, and Maximum

Rows Per Page properties.

Storage

Provide or select values for the following Sybase options: Reserve Page

Gap, Segment Name, Fill Factor, Prefetch Strategy, and MRU

Replacement Strategy.

I

NDEXES

(S

YBASE

) - C

OLUMNS

Select a column from the Columns dropdown and specify a Sort option.

Use the New button to add more columns to the index. Use the Delete button to remove selected columns from the index.

I

NDEXES

(S

YBASE

) - P

ARTITION

Click Add to open the

Index Partition wizard (Sybase)

.

I

NDEX

P

ARTITION WIZARD

(S

YBASE

)

The Sybase Index Partition wizard can be opened from the following editors and wizards:

Index Wizard (Sybase)

Indexes Editor (Sybase)

Use the following topics as a guide to understanding and setting the options on this wizard:

Step

Properties

Partition

Definitions

Settings and tasks

Select a Locality.

Click the Define a new partition button to open a dialog that lets you provide a name, select a segment, click the New button to add values, and then Add the partition definition.

When finished, click the Finish button.

L

OGIN

W

IZARD

(S

YBASE

)

The Login wizard lets you build and submit an sp_addlogin call, adding a new login with a basic set of specified database, language, and password properties. An additional sp_locklogin call can be issued to lock the new login. The Login wizard also lets you:

39 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

• Grant roles to the login

• Create user accounts on databases for the role, optionally with an alias or by changing ownership

To create a new login using a wizard:

1

Open an Object Wizard

for a login.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Logins (Sybase) - Properties .

Roles panel - for details, see Logins (Sybase) - Roles .

Users panel - for details, see Logins (Sybase) - Users .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

NOTE:

DBArtisan also provides support for login triggers, configured for individual logins. For

details, Logins Editor (Sybase)

.

L

OGINS

(S

YBASE

) - P

ROPERTIES

When creating or editing a login, this tab/panel lets you work with the following settings:

Group

Creation

Setting

Name

Full Name

Default Database

Description

The user login name.

The full name of the user, an optional but useful identifier.

The database where the user starts each session.

General

Default language

Locked

The language in which prompts and messages are displayed.

If selected, the sp_addlogin call is immediately followed by an sp_locklogin call, locking the new login and effectively disabling it.

NOTE: After creating a login, this group also displays an assigned Login trigger. For details, see

Logins Editor (Sybase)

.

Authentication Password

The initial password for the new user.

The duration, in days, before the password expires.

The minimum number of characters a password can contain.

Password expiration

Minimum password length

Maximum login attempts

Authentication mechanism

The maximum number of login attempt failures before the login is suspended.

Lets you select ASE, LDAP, PAM, or ANY authentication.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 393

C RE A T I N G O B J E C TS

L

OGINS

(S

YBASE

) - R

OLES

When creating or editing a login, this tab/panel lets you grant roles to the login by selecting the the check boxes assocaited with those roles.

For information on creating roles, see

Role Wizard (Sybase) .

For information on activating and deactivating roles for the current login in the current session, see Activating/Deactivating Roles in the Current Session .

L

OGINS

(S

YBASE

) - U

SERS

When creating or editing a login, this tab/panel lets you maintain database user accounts for a login as follows:

• Add a user account for this login to a database by selecting a database from the Databases

where the Login does NOT have a User Account and clicking the Add button. This opens the Add User dialog letting you provide additional details. For more information, see

Adding a login account to a database .

• Remove a user account for this login from a database by selecting a database from the

Databases where the Login HAS a User Account and clicking the Remove button.

A

DDING A LOGIN ACCOUNT TO A DATABASE

When adding a user account for a login to a database, the Add user dialog lets you provide details on the method used (sp_adduser, sp_addalias, or sp_changedbowner). Use the following table as a guide to setting options in this dialog:

Setting or Group

User Type

Creation

Alias dbo

Description

Lets you select the method by which the user account will be added to the database: USER (sp_adduser), ALIAS (sp_addalias) or DBO

(sp_changedbowner).

Login Name - displays the user name from the Master database.

If you selected a User Type of USER, the following settings are available:

User Name - is a new name for the user in the target database.

Group Name - lets you select a group in the target database to which the user will be added.

LoginUserName - If you selected a User Type of ALIAS, this control lets you select the database user name to alias the login name to.

TransferAliasesAndPermissions - If you selected a User Type of DBO, this control lets you transfer aliases and their permissions to the new database owner.

For more information, see

Login Wizard (Sybase)

and

Logins Editor (Sybase)

.

39 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

P

RIMARY

K

EY

W

IZARD

(S

YBASE

)

Primary key constraints make sure that no duplicate values or NULLS are entered in the columns you specify. You can use primary key constraints to enforce uniqueness and referential integrity.

A table can only have a single primary key constraint.

To create a new primary key using a wizard:

1

Open an Object Wizard

for a primary key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Primary Keys (Sybase) - Properties

.

Columns panel - for details, see

Primary Keys (Sybase) - Columns .

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

P

RIMARY

K

EYS

(S

YBASE

) - P

ROPERTIES

Provide or select the following:

• The Table Owner and Table Name of the table for which to create the index.

• A Name for the Index.

• Whether the index is Clustered.

• The Maximum Rows Per Page.

• A Reserve Page Gap.

• A Segment Name.

• A Fill Factor value.

P

RIMARY

K

EYS

(S

YBASE

) - C

OLUMNS

Use the Column dropdown to choose a column name and choose a Sort option for that column.

Use the New button to add an additional column to the index or use the Drop button to delete selected columns.

P

ROCEDURE

W

IZARD

(S

YBASE

)

Procedures are a reusable block of PL/SQL, stored in the database, that applications can call.

Procedures streamline code development, debugging, and maintenance by being reusable.

Procedures enhance database security by letting you write procedures granting users execution privileges to tables rather than letting them access tables directly.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 395

C RE A T I N G O B J E C TS

To create a new procedure using a wizard:

1

Open an Object Wizard

for a procedure.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Procedures (Sybase) - Properties

.

Definition panel - for details, see

Procedures (Sybase) - Definition .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

P

ROCEDURES

(S

YBASE

) - P

ROPERTIES

When creating or editing a procedure, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the procedure.

Provide the name of the procedure.

Procedure Number

Provide a procedure number if you want to group identically-named procedures.

Recompile

Optionally, enable this feature to prevent Sybase from saving a plan for the procedure.

Procedures (Sybase) - Definition

Complete the provided CREATE PROCEDURE statement by typing or pasting the body of the procedure.

R

EMOTE

S

ERVER

W

IZARD

(S

YBASE

)

Remote Servers are servers on a network that you can access through your local server. Instead of logging directly into a remote server, you can log into your local server and execute a remote procedure call to it.

NOTE:

Only stored procedures are allowed against remote servers. You can use a linked server to execute distributed queries and stored procedures.

Before beginning

• Before you can set up a remote server, you first configure both the local and remote servers to accept remote access. To configure the Microsoft SQL Servers for remote access, you need to log into each server. The table below describes the parameters you need to configure on each server:

Parameter

Remote Access

Remote Connections

Description

1(enabled)

Number of remote connections required

39 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Parameter

Remote Logins

Remote Sites

Description

Number of remote logins required

Number of remote sites required

• After setting these server configuration parameters, shut down and restart the server so the new values can take effect. When you have configured both servers, proceed to the steps below.

To create a new remote server using a wizard:

1

Open an Object Wizard

for a remote server.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Remote Servers (Sybase) - Properties .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

R

EMOTE

S

ERVERS

(S

YBASE

) - P

ROPERTIES

When creating or editing a remote server, this tab/panel builds an sp_addserver stored procedure call and a set of sp_serveroption calls defining and configuring a remote server. It lets you work with the following settings:

Setting

Name

Network Name

Server Type

Timeout Inactive Connections (only available with a Server Type of REMOTE)

Network Password Encryption (only available with a Server Type of REMOTE)

Security Model (only available with a

Server Type of REMOTE)

Description

Provide a name for the remote server.

Optionally, provide the server’s physical/network name?

Select a server type of LOCAL or REMOTE.

Indicate whether SQL server should time out inactive physical connections with this remote server.

Indicate whether encryption should be used to protect passwords sent to this remote server

Security Model A: This is equivalent to the level of security in release

11.0.x and prior releases.

Security Model B: Implements security using DCE, Kerberos, or NT

LAN Manager.

Specify a security mechanism Security Mechanism (only available with a

Server Type of REMOTE)

Message Integrity (only available with a

Server Type of REMOTE and a Security

Model of SECURITY MODEL B)

Message Confidentiality (only available with a Server Type of REMOTE and a

Security Model of SECURITY MODEL B)

If enabled, messages between the servers are checked for tampering.

If enabled, messages between the local and remote servers are encrypted.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 397

C RE A T I N G O B J E C TS

Setting

Mutual Authentication (only available with a Server Type of REMOTE and a

Security Model of SECURITY MODEL B)

Description

If enabled, the local server authenticates the remote server by retrieving and verifying the remote server credentials using the security mechanism. The credentials of both servers are authenticated and verified.

R

OLE

W

IZARD

(S

YBASE

)

Roles are sets of user privileges you associate with access to objects within a database. Roles streamline the process of granting permissions. You can use roles to grant sets of permissions and privileges to users and groups. Roles can help you comply with Sarbanes Oxley regulations by limiting which users can have access to what privileges, for example a Human Resources Role versus an Accounting Role.

To create a new role using a wizard:

1

Open an Object Wizard

for a role.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Roles (Sybase) - Properties .

Object Permissions and System Permissions panels - see

Set Permissions for an Object

.

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

After creating a role, you can use the Roles Editor to assign the role to logons or other roles. For

details, see Roles Editor (Sybase)

.

For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

R

OLES

(S

YBASE

) - P

ROPERTIES

When creating or editing a role, this tab/panel lets you work with the following settings:

Settings

Name

Password

Password Expiration

Minimum Password Length

Maximum Failed Logins

Description

The name of the role?

Enter the password, if any, that must be entered to activate the role (seven characters is the default).

Enter the time, in days, after which users must change the password

Enter the minimum password length, if any.

Enter the minimum number of login attempts, if any, after which the role is locked out.

39 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

R

ULE

W

IZARD

(S

YBASE

)

Rules promote data integrity by allowing you to validate the values supplied to a table column.

They are reusable objects that you can bind to table columns or user datatypes. Check constraints are similar to rules, and are in fact the preferred way of restricting data. A column or user-defined data type can have only one rule bound to it, but a column can have both a rule and one or more check constraints associated with it. Not that a rule cannot apply to data already existing in the database at the time you’re creating the rule and can’t be bound to a system-created data type. If you create a new rule when one already exists, the new rule will override the previous one.

To create a new rule using a wizard:

1

Open an Object Wizard

for a rule.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Rules (Sybase) - Properties .

Dependencies panel - for details, see Rules (Sybase) - Dependencies

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

R

ULES

(S

YBASE

) - P

ROPERTIES

When creating or editing a rule, this tab/panel lets you work with the following settings:

Setting

Owner and Name

Restriction

Type

Description

Select an Owner and provide a Name for the rule.

Type the condition. The rule restriction is the condition that defines the rule and can be any expression valid in a WHERE clause and can include such elements as arithmetic operators, relational operators, and predicates (for example, IN, LIKE, BETWEEN).

Choose STANDARD_RULE, AND_ACCESS_RULE, or OR_ACCESS_RULE.

R

ULES

(S

YBASE

) - D

EPENDENCIES

From the Type dropdown, choose Column or Datatype, and if you chose Column, choose a

Table from the Table dropdown. The list on the left is populated with candidate columns or datatypes. To move a candidate from the list on the left to the dependencies column on the right, select the candidate and click Add. Remove columns or datatypes from the dependencies list on the right by selecting the column or datatype and clicking Remove.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 399

C RE A T I N G O B J E C TS

S

EGMENT

W

IZARD

(S

YBASE

)

Segments allow you to control the placement of objects on database storage devices. A segment is a subset of the database devise on which a specific database is stored. Each database can contain as many as 32 segments. Each database includes system, logsegment, and default segments. Others can be added using the Segment Wizard. By judiciously placing large tables and nonclustered indexes on segments on different devices or segments of specific sizes, you can improve I/O throughput or control space usage.

To Open the Segment Wizard

1 On the Explorer expand the database node where you want to add the Segment.

2 Right-click the Segments node and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

Required Information

What is the name of the segment?

On which devices do you wish to place the segment?

Description

Self-explanatory

Self-explanatory

When you click Execute, DBArtisan opens the Segments Editor. Here you can extend the segment and see the objects stored in the segment.

T

ABLE

W

IZARD

(S

YBASE

)

A table is a column-based arrangement of data in which the content of one column has a bearing on the other column(s). So, for example, a table might have a column for authors, another column for the books each author has written, and a third for the number of copies each title by a given author has sold. The data moves across the columns in rows.

NOTE:

You must have CREATE TABLE permissions to generate a new table.

40 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new table using a wizard:

1

Open an Object Wizard

for a table.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Tables (Sybase) - Properties .

Columns panel - for details, see

Tables (Sybase) - Columns

.

Indexes panel - for details, see Tables (Sybase) - Indexes .

Constraints panel - for details, see

Tables (Sybase) - Constraints

.

Partitions panel - for details, see Tables (Sybase) - Partition

.

Permissions panel - for details, see Tables (Sybase) - Permissions .

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

T

ABLES

(S

YBASE

) - P

ROPERTIES

When creating or editing a table, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Description

Select the owner of the table.

Provide a name for the table

Segment Name

Maximum Rows

Per Page

Specify the segment on which you want to place the table.

Specifying a number allows you to override the default. The default, 0, creates indexes with full pages and nonclustered indexes with full leaf pages. This number can be changed at any time.

Reserve Page Gap

Identity Gap

MRU Replacement

Strategy

Specify the size of the identity gap for the table.

When enabled, new pages are read into the least recent end of the page chain. When pages reach the most recent end of the chain, the pages are flushed.

Prefetch Strategy

Enabling this feature allows you to fetch as many as eight 2K data pages simultaneously instead of one at a time (the default).

Lock Scheme

Select a locking scheme of ALLPAGES, DATAPAGES, or DATAROWS.

Expected Row Size

If you specified a Lock Scheme of DATAROWS or DATAPAGES, provide an expected row size

T

ABLES

(S

YBASE

) - C

OLUMNS

For each column in the table, click the Add Column button to create a column, provide a Name for the column and provide or select the remaining column attributes.

Use the Delete button to drop a selected column.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 401

C RE A T I N G O B J E C TS

Use the arrow buttons to reposition the columns.

NOTE:

Because the smalldatetime datatype stores dates and time with less precision than the datetime datatype, before outputting you use the CAST or CONVERT functions to convert any boxes with the smalldatetime datatype to either VARCHAR or datetime datatypes.

T

ABLES

(S

YBASE

) - I

NDEXES

Click Add to open the

Index Wizard (Sybase) .

T

ABLES

(S

YBASE

) - C

ONSTRAINTS

Selecting a constraint type and clicking Add opens the object wizard for that object type. For details see:

Primary Key Wizard (Sybase)

Unique Key Wizard (Sybase)

Foreign Key Wizard (Sybase)

Create Synonym

T

ABLES

(S

YBASE

) - P

ARTITION

Click Add to open the

Table Partition wizard for Sybase ASE

.

T

ABLES

(S

YBASE

) - P

ERMISSIONS

Set up the user permissions for this table.

T

ABLE

P

ARTITION WIZARD FOR

S

YBASE

ASE

The Sybase Table Partition wizard can be opened from the following editors and wizards:

Table Wizard (Sybase)

Tables Editor (Sybase)

Use the following topics as a guide to understanding and setting the options on this wizard:

Step

Properties

Columns (not available with a

Partition Type of

ROUNDROBIN)

Settings and tasks

Select a Partition Type of ROUNDROBIN, RANGE, HASH, or LIST

For each column, click the Insert a new column button to create a column, provide a Name for the column and provide or select the remaining column attributes.

Use the Delete button to drop a selected column.

Use the arrow buttons to reposition the columns.

40 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Step

Partition Definition

(only available with a

Partition Type of

HASH or

ROUNDROBIN)

Settings and tasks

Take one of the following actions: (1) Select the Number Of Partitions radio box, specify the

Number Of Partitions, and for each partition, click the New button and choose a tablespace from the dropdown, or (2) select the By Partition Name radio box and for each partition, click the New button provide a name and then choose a tablespace from the dropdown.

Range Definitions

(only available with a

Partition Type of

RANGE)

Click the Define a new partition button to open a dialog that lets you provide a name, select a segment and Add the partition definition.

List Definitions

(only available with a

Partition Type of

LIST)

Click the Define a new partition button to open a dialog that lets you provide a name, select a segment, click the New button to add values, and then Add the partition definition.

When finished, click the Finish button.

T

RIGGER

W

IZARD

(S

YBASE

)

The Triggers Wizard lets you build and submit a CREATE TRIGGER command, selecting a parent object type of table or view, and selecting the triggering events for the trigger. Depending on whether you are creating a trigger for a view or a table, the Wizard generates customizable

CREATE TRIGGER syntax as follows:

• Tables - The wizard generates a FOR INSERT, UPDATE, DELETE trigger code template (all supported Sybase versions)

• Views - The wizard generates an INSTEAD OF trigger code template (Sybase ASE 15.0.2)

In both cases, you provide the SQL statements that are to make up the body of the FOR or

INSTEAD OF trigger.

To create a new trigger using a wizard:

1

Open an Object Wizard

for a trigger.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see Triggers (Sybase) - Properties .

Definition panel - for details, see Triggers (Sybase) - Definition .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 403

C RE A T I N G O B J E C TS

Triggers (Sybase) - Properties

When creating or editing a trigger, this tab/panel lets you work with the following settings:

Setting

Parent Type, Parent

Owner, and Parent

Name

Owner and Name

Fire On Insert, Fire

On Update, and Fire

On Delete

Description

Provide or select details on the target table or view.

Select the owner and provide a name for the trigger being created.

Enable the events that fire the trigger.

An INSERT trigger must be associated with an INSERT statement. For example, if a data load operation doesn’t include an INSERT statement, the trigger won’t be invoked.

An UPDATE trigger can be associated with specific columns of the base table and will only be activated if those columns are updated.

A DELETE trigger fires automatically after items in the table are deleted.

NOTE:

For triggers with a table parent type, the editor lets you enable and disable the trigger, after creation. For details, see

Triggers Editor (Sybase)

.

T

RIGGERS

(Sybase) - D

EFINITION

Complete the CREATE TRIGGER statement by typing or pasting in content.

• See the Microsoft SQL Server Transact-SQL documentation for information on the syntax for

Trigger bodies. For more information, see

Accessing Third Party Documentation .

U

NIQUE

K

EY

W

IZARD

(S

YBASE

)

Unique keys can enforce logical keys that are not chosen as the primary key. In other words, you can use a unique key to ensure no duplicate values are entered in specific columns that are not a part of the primary key. Although you can only attach one primary key to a table, you can attach multiple unique keys. Also, you can use unique keys on columns that allow null values.

To create a new unique key using a wizard:

1

Open an Object Wizard

for a unique key.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Unique Keys (Sybase) - Properties .

Columns panel - for details, see

Unique Keys (Sybase) - Columns

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

40 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

Important Notes

• If you are creating a non-clustered index constraint, you should place it on a separate segment from the target table.

U

NIQUE

K

EYS

(S

YBASE

) - P

ROPERTIES

Provide or select the following:

• The Table Owner and Table Name of the table for which to create the index.

• A Name for the Index.

• Whether the index is Clustered.

• The Maximum Rows Per Page.

• A Reserve Page Gap.

• A Segment Name.

• A Fill Factor value.

U

NIQUE

K

EYS

(S

YBASE

) - C

OLUMNS

Use the Column dropdown to choose a column name and choose a Sort option for that column.

Use the New button to add an additional column to the index or use the Drop button to delete selected columns.

U

SER

D

ATATYPE

W

IZARD

(S

YBASE

)

User datatypes promote domain consistency by streamlining the definition of commonly used table columns in a database. You can build a customized datatype from system datatypes and bind defaults and rules to it to enhance integrity. When you reference the user datatype in a column, the column assumes all of the properties of the user datatype.

To create a new user datatype using a wizard:

1

Open an Object Wizard

for a user datatype.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

User Datatypes (Sybase) - Properties .

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 405

C RE A T I N G O B J E C TS

U

SER

D

ATATYPES

(S

YBASE

) - P

ROPERTIES

When creating or editing a user datatype, this tab/panel lets you work with the following settings:

Setting

Datatype

Type

Size

Allow Nulls

Identity

Default Binding

Rule Binding

Description

Provide a name for the datatype.

Select the base datatype.

Provide the size of the datatype.

Null has no explicitly assigned value. Null is not equivalent to zero or blank. A value of null is not considered to be greater than, less than, or equivalent to any other value, including another value of null.

This allows you to specify whether or not you want to limit access to the new datatype based on the user’s privileges.

Defaults promote data integrity by supplying a default value to a column if the user does not explicitly provide one. They are reusable objects that you can bind to user datatypes.

Rules promote data integrity by allowing you to validate the values supplied to a column.

They are reusable objects that you can bind to user datatypes.

U

SER

M

ESSAGE

W

IZARD

(S

YBASE

)

A user message let’s you write the error message users will see when a user-defined event transpires. The User Message Wizard lets you multiple language versions of a user message, specifying the message numbers, specifying the text for each language version, and binding the message to one or more integrity constraints.

To create a new user message using a wizard:

1

Open an Object Wizard

for a user message.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see User Messages (Sybase) - Properties .

Information panel - for details, see User Messages (Sybase) - Information .

Bindings panel - for details, see User Messages (Sybase) - Bindings .

DDL View panel - for details, see

Create the New Object

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

U

SER

M

ESSAGES

(S

YBASE

) - P

ROPERTIES

When creating or editing a user message, this tab/panel lets you provide the message number parameter for the sp_addmessage system procedure calls that will create each language-based version of this user message.

40 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To specify the message number for this user message

In the Message Number box, type a unique message number (20000 or greater).

U

SER

M

ESSAGES

(S

YBASE

) - I

NFORMATION

For each language in which the user message is to be available, the User Message Wizard/Editor builds a sp_addmessage system procedure call. This tab/panel manages the language and message text parameters for each sp_addmessage call.

To add a language version of the user message

1 Click the Add new text for the user message button. The Create User Message Text dialog opens.

2 From the Language dropdown, select the language for the message.

3 In the Message Text box, type the text of the message.

4 Click OK.

To edit an existing language version of the message

1 Select the version from the Language/Message list.

2 Click the Modify user message text button. The Edit User Message Text dialog opens.

3 In the Message Text box, replace the text of the message.

4 Click OK.

To delete an existing language version of the message

1 Select the version from the Language/Message list.

2 Click the Remove user message text button and verify when prompted.

U

SER

M

ESSAGES

(S

YBASE

) - B

INDINGS

When creating or editing a user message, this tab/panel manages one or more sp_bindmsg system procedure calls that will be issued with the sp_addmessage calls that create or edit a user message. This lets you bind the user message to, or unbind the user message from foreign keys or check constraints.

To bind a user message to an integrity constraint

1 From the Constraint Type dropdown, select the type of integrity constraint (Check

Constraints or Foreign Keys) to which you are binding the user message.

2 Select one or more check constraints or foreign keys from the list on the left and click Bind.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 407

C RE A T I N G O B J E C TS

To unbind a user message from a currently bound integrity constraint

1 Select one or more check constraints or foreign keys from the list on the right and click

Unbind.

U

SER

W

IZARD

(S

YBASE

)

The User Wizard lets you create a user who will then have access to the database where you are registering him or her. You can also identify the appropriate user group and the system privileges you want to assign to the new user.

To create a new user using a wizard:

1

Open an Object Wizard

for a user

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Users (Sybase) - Properties

.

DDL View panel - for details, see

Create the New Object .

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

You can use the User Editor to assign System and Object privileges as well as create an alias.

U

SERS

(S

YBASE

) - P

ROPERTIES

When creating or editing a user, this tab/panel lets you work with the following settings:

Setting

Login Name

Name

Group Name

Description

Choose a login ID from the drop-down list.

Provide the user name.

Specify a group for the user.

V

IEW

W

IZARD

(S

YBASE

)

Views are SQL queries stored in the system catalog that customize the display of data contained in one or more tables. Views behave like tables because you can query views and perform data manipulation operations on them. However, views do not actually store any data. Instead, they depend on data contained in their base tables. Views can only be

40 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C RE AT I N G O B J E C T S

To create a new view using a wizard:

1

Open an Object Wizard

for a view.

2 Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:

Properties panel - for details, see

Views (Sybase) - Properties

.

Definition panel - for details, see

Views (Sybase) - Definition

.

3 Finally, use the Execute button to create the object. For more information, see

Create the

New Object .

You can use the User Editor to assign System and Object privileges as well as create an alias.

V

IEWS

(S

YBASE

) - P

ROPERTIES

When creating or editing a view, this tab/panel lets you work with the following settings:

Setting

Owner

Name

Check Type

Description

Select the owner of the view.

Provide a name for the view.

When enabled, when a row is modified through a view, this option makes sure the data remains visible through the view after the modification is committed.

V

IEWS

(S

YBASE

) - D

EFINITION

Complete the CREATE VIEW statement by typing or pasting in the relevant query. Finally, use the Execute button to

Create the New Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 409

C RE A T I N G O B J E C TS

41 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M

ODIFYING OBJECTS USING EDITORS

An Object editor is a tabbed dialog box that stores information about existing server and database types and objects, and lets you modify those items. For an introduction to object

editors, see Overview and common usage of object editors .

NOTE:

Availability of editors for specific object type varies from DBMS to DBMS. Similarly, functionality offered for an editor for an object type common to two or more DBMS, will differ from DBMS to DBMS.

See the following topics for information the object editors available for each supported platform:

IBM DB2 for Linux, Unix, and Windows Object Editors

IBM DB2 for z/OS Object Editors

Microsoft SQL Server Object Editors

MySQL editors

Oracle Object Editors

Sybase ASE Object Editors

O

VERVIEW AND COMMON USAGE OF OBJECT EDITORS

An Object editor lets you view and modify settings and properties of existing object types and servers on a datasource. It also lets you add new resources and provides access to related, datasource management facilities. For example, the Tables editor lets you add or insert, edit, or drop columns, work with permissions to work with that table, access information on physical storage and the distribution of data and indexes across table spaces, and so on.

Each tab on the Object editor lets you perform a logical task or collection of logical tasks for that object type. The Object editor toolbar has a set of commands common to all object types and also includes a Command menu with commands specific to the object type you are currently working with. For example:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 411

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

In order to work with object editors, you must be familiar with the following tasks:

Opening an Object Editor

on a server or database object.

Viewing and Modifying Object Properties using functionality common to all object editors as

well as object-specific functionality available to specific object editors.

Previewing and Submitting Object Editor Changes

to effect your changes to the datasource.

O

PENING AN

O

BJECT

E

DITOR

Object editors are accessed from the Datasource Explorer pane of the DBArtisan main window.

To open an Object editor on a specific database object

1 Connect to the datasource that contains the object you want to modify. For more information, see

Datasource Management

.

2 On the Datasource Explorer, expand the target datasource.

3 Continue to expand folders under the datasource until the type of object you want to view or modify is visible.

41 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

4 On the Datasource Explorer, click on the specific type of object that you want to view or modify.

All objects of that type on the datasource are displayed in the right pane of the explorer window.

5 In the right pane of the Explorer window, right-click the specific object you want to view or modify, and then select Open.

DBArtisan opens an editor for that object type on the object you selected.

For information on editing objects, see Viewing and Modifying Object Properties

.

V

IEWING AND

M

ODIFYING

O

BJECT

P

ROPERTIES

There are two categories of tasks you can perform using an Object editor:

Work with Tasks and Settings of Specific Object Types

Work with Tasks and Settings Common to Object Editors

W

ORK WITH

T

ASKS AND

S

ETTINGS OF

S

PECIFIC

O

BJECT

T

YPES

Many of the tasks you perform using an Object editor are specific to the object type you are working with. For example, the Triggers editor lets you work directly with SQL code for the trigger while the Tables editor lets you work with columns of the table. Object-specific tasks are documented in the topics for specific Object editors provided later in this chapter.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 413

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

W

ORK WITH

T

ASKS AND

S

ETTINGS

C

OMMON TO

O

BJECT

E

DITORS

The following tasks can be performed against many of the supported Object editors:

Using the object editor toolbar

Opening Another Object in the Same Object Editor Explorer

Viewing the SQL/DDL for an Object

Working with Privileges and Permissions

Working with Object Dependencies

Adding a Comment to an object

U

SING THE OBJECT EDITOR TOOLBAR

The Object editor toolbar appears above the tabs of the Object editor.

It provides the following functions:

Create - Launches a DBArtisan object creation wizard. For more information, see Creating objects .

Alter - Enabled when a property of the current database has been modified. Opens a dialog that lets you preview the SQL code that will effect the modification and then submit the change. For more information, see

Preview

.

Drop -Lets you drop one or more database objects and remove their definition from the system catalog. For more information, see

Drop

.

Extract - DBArtisan lets you extract data from one database to another database and extract the statements required to create objects into an Interactive SQL window. For more information, see

Extract

.

Migrate - Lets you move object schema between DBMS or servers by copying the DDL between the source and target databases. For details, see

Migrate .

Report - Lets you generate detailed or summary reports on database objects. For details, see

Report .

Command Menu - Provides menu commands specific to the object being viewed or modified. For a listing of commands available, see the topic for the specific Object editor, later in this chapter.

Refresh - Refreshes or clears Object editor contents.

Close - Closes the Object editor and if appropriate, prompts you to verify any changes.

Commands on the Object editor toolbar are disabled if they do not apply to the object type being viewed or modified.

41 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

O

PENING

A

NOTHER

O

BJECT IN THE

S

AME

O

BJECT

E

DITOR

E

XPLORER

When an object editor is open, the area between the object editor toolbar and the tabs has one or more dropdown lists. For example:

These lists allow you to qualify any object of the same type as the object currently displayed in the Object editor, and display information for that object in the current Object editor. The number of, and specific dropdown lists, differ according to the type of Object editor but there are always sufficient controls to uniquely identify another object of the same type.

To display the information for another object of the same type

• Use the dropdown lists to specify a different object.

V

IEWING THE

SQL/DDL

FOR AN

O

BJECT

The object editors for most object types feature a DDL tab that lets you view an object’s underlying SQL code.

To view the underlying DDL/SQL for a database object

1 Open an editor on an object type for which DDL code can be displayed. For details, see

Opening an Object Editor

.

See the topics for specific Object editors later in this chapter for information on whether that object type supports display of underlying SQL code.

2 Click the DDL tab.

NOTE:

Right-clicking in the Comment area opens a context menu that lets you perform edit text operations such as search, selection, copying and pasting, as well as codingspecific operations such as enabling/disabling line numbers and indenting lines.

W

ORKING WITH

P

RIVILEGES AND

P

ERMISSIONS

When you open an Object editor on an object with associated privileges, the Permissions (or

Object Permissions or System Permissions) tab for that editor displays the relevant privileges and lets you make changes accordingly:

For database objects such as tables or procedures, to which permissions or privileges are granted, a Permissions tab lets you manage permissions or privileges to that object from all grantees, such as users or groups, on that datasource. The tab has a navigation area, a command area, and a display area.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 415

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

The Navigation area lets you change the content of the Display area to view more specific privilege details. For example, when viewing privileges for a database object such as a table, the dropdown lists in the navigation area, if present, let you drill down to populate the display area with privileges for a lower level component, such as a particular column. Similarly, when viewing privileges for a grantee such as a user, the Object Permissions tab’s Navigation area lets you populate the display area with that user’s permissions on specific object types, such as tables or procedures.

The Display area shows privilege details for an object or grantee. When viewing privileges for a grantee such as a user or role, the display area shows privileges for that recipient on objects currently qualified by the current selection in the Navigation area. When viewing privileges for an object such as a table, the display area shows the privileges for all grantees. Each cell in the

Display area corresponds to a specific permissions and a cell representing a granted permission shows a distinctive icon.

The Command area lets you initiate granting or revocation of permissions.

41 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To view or modify privileges using an Object editor

1 Open an editor on a database object with associated privileges or permissions. For details, see

Opening an Object Editor .

2 Click the Permissions (or Privileges or Object Privileges or System Privileges) tab.

3 Use the dropdown lists in the navigation area, if present, to populate the Display area with details for more specific or different permissions.

4 In the Display area, select a cell corresponding to a specific permission.

5 Use the Command area controls to grant or revoke permissions.

6 Submit your changes. For details, see

Previewing and Submitting Object Editor Changes .

W

ORKING WITH

O

BJECT

D

EPENDENCIES

For objects such as views and procedures, whose definition references other objects, such as tables, DBArtisan lets you view all dependencies. The Object editors for referencing or referenced objects have a Dependencies tab that shows all dependencies for an object.

In addition to letting you view dependencies, Object editors let you drop a referencing or referenced object, or open an Object editor on that object.

To manage dependences for an object

1 Open an editor on a database object with referencing or referenced objects. For details, see

Opening an Object Editor

.

See the object editor descriptions in subsequent topics to verify that an Object editor supports display of dependencies.

2 Click the Dependencies tab.

The Dependency Name area lists all referenced or referencing objects. Objects are grouped according to their object type.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 417

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 Optionally, select a referenced or referencing object in the right pane and either:

• Use the Edit button to open an Object editor on that object

• Use the Drop button to initiate dropping that object.

A

DDING A

C

OMMENT TO AN OBJECT

The object editors for certain object types feature a Comment tab that lets you add an explanatory note to specific object definitions. Comments are stored in the REMARKS column of the object’s system-catalog.

To add a comment to an object

1 Open an editor on an object type that permits comments. For details, see Opening an

Object Editor .

2 Click the Comment tab.

3 In the Comment area, type an explanatory note of up to 254 characters long.

NOTE:

Right-clicking in the Comment area opens a context menu that lets you perform edit text operations such as search, selection, copying and pasting, as well as codingspecific operations such as enabling/disabling line numbers and indenting lines.

4 Submit your changes. For details, see

Previewing and Submitting Object Editor Changes .

P

REVIEWING AND

S

UBMITTING

O

BJECT

E

DITOR

C

HANGES

After you use an Object editor to modify the settings or properties of a database object, you can preview the SQL that will be executed to effect those changes on the datasource. You can then submit the SQL for execution on the server.

To preview and submit object editor changes to a database object

1 Click the Alter button on the Object editor toolbar. For details, see Overview and common usage of object editors

.

A Preview: Alter dialog opens.

41 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

2 Use one of the following options to submit and execute your changes:

Execute button - executes the changes immediately.

Schedule button - opens a dialog that lets you schedule the change. For more information, see

Scheduling .

Batch button - (IBM DB2 for z/OS only) lets you specify the job cards used to execute the changes as a batch job. For information on how to check status, see

Database Monitor .

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

O

BJECT

E

DITORS

DBArtisan includes an Object Editor for all supported IBM DB2 or Linux, Unix, and Windows objects. To see an Editor for a specific object, click the corresponding link below:

Aliases Editor (IBM DB2 LUW)

Bufferpool Editor (IBM DB2 LUW)

Check Constraints Editor (IBM DB2 LUW)

Databases Editor (IBM DB2 LUW)

Event Monitor Editor (IBM DB2 LUW)

Foreign Keys Editor (IBM DB2 LUW)

Functions Editor (IBM DB2 LUW)

Groups Editor (IBM DB2 LUW)

Indexes Editor (IBM DB2 LUW)

Materialized Query Tables Editor (IBM DB2 LUW)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 419

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Packages Editor (IBM DB2 LUW)

Nodegroups Editor (IBM DB2 LUW)

Primary Keys Editor (IBM DB2 LUW)

Procedures Editor (IBM DB2 LUW)

Sequences Editor (IBM DB2 LUW)

Structured Types Editor (IBM DB2 LUW)

Tables Editor (IBM DB2 LUW)

Tablespaces Editor (IBM DB2 LUW)

Triggers Editor (IBM DB2 LUW)

Unique Keys Editor (IBM DB2 LUW)

User Datatypes Editor (IBM DB2 LUW)

Users Editor (IBM DB2 LUW)

Views Editor (IBM DB2 LUW)

A

LIASES

E

DITOR

(IBM DB2 LUW)

The Aliases Editor lets you view basic alias properties, change the comment associated with an alias, and view the DDL that will be issued to alter the alias definition.

To edit an alias

1 Open an editor on the alias. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

DDL View

Settings and tasks

In addition to the owning Schema, this tab lets you view the Target Owner, Target

Type, and Target Name, of the referenced object.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

42 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

B

UFFERPOOL

E

DITOR

(IBM DB2 LUW)

The Bufferpool editor lets you manage the basic properties, nodegroups, and partitions size of a bufferpool.

To edit a bufferpool

1 Open an editor on the bufferpool. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Nodegroups

Partitions

DDL View

Settings and tasks

Deferred - controls IMMEDIATE or DEFERRED update of the bufferpool.

Page size - displays the current page size.

Automatic Size and Number of Pages - Lets you specify the size of the bufferpool. You can use the Automatic Size option to enable resizing based on self-tuning or you can specify a fixed Number of Pages.

No. of Block Pages and Block Size - Let you specify NUMBLOCKPAGES and

BLOCKSIZE values.

Displays all defined nodegroups and lets you associate nodegroups with this bufferpool by selecting the relevant check boxes.

Displays all partitions for the bufferpool. Optionally you can click in the Size field of an entry to activate editing and provide a new size.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

HECK

C

ONSTRAINTS

E

DITOR

(IBM DB2 LUW)

The Check Constraints Editor lets you modify and enable/disable check constraints.

To edit a check constraint:

1 Open an editor on the check constraint. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Comment

DDL View

Settings and tasks

Use the Enabled control to enable/disable the check constraint.

You can also edit the condition in the Check Condition box. The Table Column button opens a dialog that lets you select and paste column names into the check condition expression.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 421

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATABASES

E

DITOR

(IBM DB2 LUW)

The Databases Editor lets you manage database tablespace placement details and modify configuration parameters for the database.

To edit a database

1 Open an editor on the database. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Placement

Options

DDL

Settings and tasks

Select a tablespace and click the Edit button to open an object editor on that tablespace. For more information, see

Tablespaces Editor (IBM DB2 LUW) .

Lets you modify the DB2 Database Manager configuration file parameters for the database. Select a parameter and click the Edit button to open a dialog that lets you change the current value.

NOTE: To set database options for all future databases, set the database options on the model database.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

E

VENT

M

ONITOR

E

DITOR

(IBM DB2 LUW)

The event monitor editor lets you manage the event types associated with an event monitor, modify the condition for each event type, and specify where and how records are written.

42 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

To edit an event monitor

1 Open an editor on the event monitor. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Conditions

DDL

Settings and tasks

Lets you work with the following settings:

Auto Start - lets you specify whether the event monitor is activated each time the database starts.

Target Type - lets you specify where the output is written: FILE, PIPE, or TABLE.

If you specify a Target Type of TABLE, you also have options to provide a Buffer SIze and specify whether the event monitor is to be Blocked.

If you specify a Target Type of PIPE, you must also specify the Target named pipe identifier.

If you specify a Target Type of FILE, you also have options to provide a Buffer SIze and whether the event monitor is to be Blocked. You also specify a Write Mode of APPEND or REPLACE, provide a Max Files value and a Max File Size value.

Lets you modify the Event Types used to construct the CREATE EVENT MONITOR statement FOR clause.

The base set of event types is BUFFERPOOLS, CONNECTIONS, DATABASE,

DEADLOCKS, DEADLOCK WITH DETAILS, STATEMENTS, TABLES, TABLESPACES, and

TRANSACTIONS.

For IBM DB2 for Linux, Unix, and Windows version 9.0, DEADLOCK WITH DETAILS

HISTORY and DEADLOCKS WITH DETAILS HISTORY VALUES event types are available.

For IBM DB2 for Linux, Unix, and Windows version 9.5, ACTIVITIES, THRESHOLD

VIOLATIONS, and STATISTICS event types are available.

NOTE: If your choices are all from the DEADLOCKS... types, you can also specify

Deadlock Monitoring of Global or Local. If you select Local, specify the Database

Partitions the event monitor is to run against.

Available only for CONNECTION, STATEMENT, and TRANSACTION Event Types, this tab lets you modify a condition used to determine which CONNECTION, STATEMENT, or TRANSACTION the event monitor will collect data for.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

OREIGN

K

EYS

E

DITOR

(IBM DB2 LUW)

The Foreign Keys Editor lets you manage column mapping for a foreign key, modify update and delete rule actions, and specify a NOT ENFORCED value.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 423

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a foreign key

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mapping

Properties

Comment

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you modify the Delete Rule (NO ACTION, RESTRICT, CASCADE, SET NULL) and

Update Rule (NO ACTION, RESTRICT) actions. This tab also lets you deselect the

Enforced check box to specify a NOT ENFORCED option.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

UNCTIONS

E

DITOR

(IBM DB2 LUW)

The Functions Editor lets you manage the body, inputs and outputs, and properties for a function.

To edit a function

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Parameters

Settings and tasks

Displays the Language, Return Type, External Name, SQL Access Level,

Origin, Threadsafe, Fenced, Scratchpad, Scratchpad Length, Allow Parallel,

Final Call, Parameter Style, Inherit Special Registers, DBInfo, Deterministic,

External Action, Called on Null Input, and Parameter CCSID properties.

Lets you manage function parameters. On opening, this tab shows the existing parameters. Optionally you can:

Select a parameter from the list, modify the Type and if appropriate, the

Precision, Size, and Scale of the parameter.

Click the New button, provide a name for the new parameter and modify its attributes.

Select a parameter and click the Drop button to delete the parameter.

Select a parameter and use the arrow buttons to reorder the parameter list.

42 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Return Scalar (only available for functions created with a Function

Type of EXTERNAL SCALAR,

SOURCED or TEMPLATE and for

SQL Function Type functions with an explicit Return Type of

SCALAR)

)

Return Columns (only available for functions created with a

Function Type of OLEDB and

EXTERNAL TABLE and for SQL

Function Type functions with an explicit Return Type of TABLE or

ROW

Settings and tasks

Lets you change the Type of a return scalar and depending on the type specified, modify the Precision, Scale, and Size of the return scalar.

Lets you manage return columns for a function. On opening, this tab shows the existing columns. Optionally you can:

Select a column from the list, modify the Type and if appropriate, the

Precision, Size, and Scale of the parameter. You can also specify that the return column is to be treated As Locator.

Click the New button, provide a name for the new column and modify its attributes.

Select a parameter and click the Drop button to delete the parameter.

Body

Comment

Dependencies

Permissions

DDL View

Select a parameter and use the arrow buttons to reorder the parameter list.

Lets you edit the body of the function.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

G

ROUPS

E

DITOR

(IBM DB2 LUW)

The group editor lets you manage privileges for a group.

To edit a group

1 Open an editor on the group. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Object Permissions and

System Permissions

DDL View

Settings and tasks

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 425

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

I

NDEXES

E

DITOR

(IBM DB2 LUW)

The Index Editor lets you manage columns and properties, and view space details for an index.

NOTE:

IBM DB2 for Windows, Unix, and Linux, lets you segregate Include columns; columns that are to be part of the index but not part of the unique key.

To edit an index

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Include Columns

Space

Comment

Permissions

DDL View

Settings and tasks

Lets you manage columns that make up the index. On opening, this tab shows the existing columns. Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Select a column and use the arrow buttons to reorder the columns in the index.

Lets you work with properties in the following categories:

Attributes

Lets you view the Defined By property. Lets you set the Index Type

(UNIQUE or NONUNIQUE), specify the index as Clustered, and Allow

Reverse Scans.

Storage

Lets you set Percent Free and Minimum Percent Used settings.

Lets you Include columns that are to be part of the index but not part of the unique key.

On opening, the tab shows a listing of the Include columns currently defined as part of this index.

Optionally, take one of the following actions:

Click the New button to add a new column to the index.

Select an existing column and click the Delete button to delete that column.

Lets you view the following property groups:

Attributes

Make Unique, System Required, Total Keys, Page Fetch Pairs, and

Distinct Keys

Statistics

Index Level, Cluster Ratio, Cluster Factor, Leaf Pages, Sequential

Pages, and Density

Cards

First Key, First 2 Keys, First3 Keys, First 4 Keys, and Full Keys

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

42 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

M

ATERIALIZED

Q

UERY

T

ABLES

E

DITOR

(IBM DB2 LUW)

The Materialized Query Tables Editor lets you manage the columns, base query and options for a materialized query table, and work with storage and performance settings.

To edit a materialized query table

1 Open an editor on the materialized query table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Definition

Performance

Space

Comment

Permissions

Dependencies

DDL View

Settings and tasks

Displays the currently defined columns for the materialized Query Table. Optionally, you can Add, Insert, or Edit columns for the materialized query table.

Base Query

Lets you view the query that this materialized query table is based on.

Materialized Query

Table Options

Lets you specify an immediate or deferred Refresh, and explicitly set a Materialized Query Table as Enabled or

Disabled or go with the Default. This tab also displays whether the Materialized Query Table is maintained by the system or by a user.

Tablespace Placement

Displays Table Tablespace, Index Tablespace, and Long

Tablespace settings for the materialized query table.

Log Options

Lets you select logging options:

Logged initially

Data Capture - Lets you select none or change to Include

Longvar Columns.

NOTE: If you select the Data Capture option, the table name

/ column name cannot be longer than 18 bytes.

Options

Partition Columns

Let you set the Percent Free, Locksize, Append, and

Volatile settings for the materialized query table.

Use the Add and Delete buttons to manage the partition columns for the materialized query table.

Page Information

Row Information

Lets you view Row Count and Num. of Overflow Rows values.

Lets you view Num. of Pages with Rows, Num. of Pages,

Percent Free values.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 427

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

N

ODEGROUPS

E

DITOR

(IBM DB2 LUW)

The nodegroup editor lets you add partitions to, and delete partitions from the nodegroup.

To edit a nodegroup

1 Open an editor on the nodegroup. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Partitions

Comment

DDL View

Settings and tasks

Use the Join Nodegroup and Leave Nodegroups buttons to move partitions between the Partitions Not in Nodegroup and Partitions in Nodegroup lists.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ACKAGES

E

DITOR

(IBM DB2 LUW)

The Packages Editor lets you view contents and settings for a package.

To edit a package

1 Open an editor on the package. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Statements

Comment

Dependencies

DDL View

Settings and tasks

Lets you view the following settings: Binder, Definer, Default Schema, Degree,

Function Path, Language Level, SQL Math Warn, SQL Warn, Buffered Inset, Status,

Code Page, Total Sections, Multi-node Bound, Intra-partition, Query Optimization,

Cursor Blocking, Isolation Level, Date Time Format, Last Bind Time, Explicit Bind

Time, Explain Level, Explain Snapshot, and Explain Mode.

Shows the contents of a package statement. Optionally, you can select a statement and click Explain to copy the statement to an ISQL Editor window. For more information, see

ISQL Editor .

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

42 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

RIMARY

K

EYS

E

DITOR

(IBM DB2 LUW)

The Primary Keys Editor lets you manage columns and properties for a primary key, and view space usage/allocation details.

To edit a primary key

1 Open an editor on the primary key. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Space

Comment

DDL View

Settings and tasks

Displays the columns that make up the primary key. Optionally, you can:

Select a column and use the Delete key to remove the column from the primary key.

Select a column and use the arrow keys to reorder the columns in the primary key.

Displays the owning Table Schema and Table Name, the Name of the primary key, a

Defined By property, and Percent Free and Minimum Percent Used properties.

Lets you view the following property groups:

Attributes

Make Unique, System Required, Total Keys, Page Fetch Pairs, and

Distinct Keys

Statistics

Index Level, Cluster Ratio, Cluster Factor, Leaf Pages, Sequential

Pages, and Density

Cards

First Key, First 2 Keys, First3 Keys, First 4 Keys, and Full Keys

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ROCEDURES

E

DITOR

(IBM DB2 LUW)

The Procedures Editor lets you manage the body and parameters for a procedure.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 429

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a procedure

1 Open an editor on the procedure. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Parameters

Settings and tasks

Lets you modify the following settings: SQL Access Level (MODIFIES SQL DATA, CONTAINS

SQL, READS SQL DATA, NO SQL), number of Result Sets, External Action, New Save Point,

Inherit Special Registers, Deterministic, and Parameter CCSID.

Lets you view the following settings: Language (C, COBOL, JAVA, OLE, SQL CLR), External

Name, Threadsafe, Fenced, Parameter Type (GENERAL, DB2, GENERAL WITH NULLS, SQL),

Program Type (MAIN, SUB and not enabled for a Parameter Style of SQL), and DBInfo.

Lets you manage procedure parameters. On opening, this tab shows the existing parameters.

Optionally you can:

Select a parameter from the list, modify the Type, and if appropriate, the Precision, Size, and

Scale of the parameter. You can also set the Parameter Mode to INPUT, OUTPUT, or

INPUT_OUTPUT.

Click the New button, provide a name for the new parameter and modify its attributes.

Select a parameter and click the Drop button to delete the parameter.

Select a parameter and use the arrow buttons to reorder the parameter list.

NOTE: You cannot use host variables in the CALL statement for the name of the procedure.

For details on using this tab, see

Adding a Comment to an object .

Comment

Body

Lets you modify the body of the procedure.

Dependencies

For details on using this tab, see

Working with Object Dependencies .

Permissions

DDL View

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

EQUENCES

E

DITOR

(IBM DB2 LUW)

The Sequences Editor lets you manage cycle numbers, increments, the datatype, and other options for a sequence.

43 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a sequence

1 Open an editor on the sequence. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Dependencies

DDL View

Settings and tasks

Lets you work with settings in the following categories:

Parameters

Increment By - Lets you specify the interval between sequence numbers. This integer value can be any positive or negative integer, but it cannot be 0. This value can have 28 or fewer digits. The absolute of this value must be less than the difference of MAXVALUE and

MINVALUE. If this value is negative, then the sequence descends. If the increment is positive, then the sequence ascends. If you omit this clause, the interval defaults to 1.

Minimum Value - Lets you specify the minimum value of the sequence. This integer value can have 28 or fewer digits.

Maximum Value - Lets you specify the maximum value the sequence can generate. This integer value can have 28 or fewer digits.

Next Sequence

Numbers

Lets you work with sequence cycle numbers.

Sequence

Datatype

Lets you specify the datatype and width for the sequence.

Options

Lets you specify Cache Size, Cycle When Reach Max/Min, and

Generate Numbers in Order (useful when you are using the sequence number as a timestamp) values.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

TRUCTURED

T

YPES

E

DITOR

(IBM DB2 LUW)

The Structured Types Editor lets you manage the attributes, methods and body for a structured type.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 431

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a structured type

1 Open an editor on the structured type. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Attributes

Methods

Body

DDL View

Settings and tasks

Displays the initially-defined values for the following properties: Instantiable, Final Type,

With Function Access, Without Comparisons, Inline Length, Supertype Schema,

Supertype Name, Cast (Source as Ref) With, Cast (Ref as Source) With, Reference Using,

Size, Precision, and Scale.

For details on these properties, see

Structured Type Wizard (DB2 LUW) .

Displays the currently defined attributes for the structured type. Optionally, take one of the following actions:

Select an attribute and change the Datatype in the Property/Value list. Depending on the datatype you choose you can also provide additional datatype options. For details

on option availability, see Structured Type Wizard (DB2 LUW)

.

Add an attribute by clicking the New button and typing a name for the attribute.

Select an attribute and click Drop to delete the attribute.

This tab lets you initiate creation of method specifications and prepopulate associated method bodies. On opening, this tab lists all method specifications associated with the structured type and for each method, includes name and language details. Optionally, take one of the following actions:

Click Add to begin the process of adding a new method specification. Similarly, select a method and click Edit to modify the method specification. For more information, see

Adding or editing structured type methods

.

Select a method specification and click Drop to delete that method specification from the structured type.

The Create Body and associated controls are available for selected methods for which no method body has yet been defined. They lets you prepopulate the method body definition:

External name - lets you provide a ‘string” or SQL identifier for a method specified with a

Language of C, JAVA, or OLE.

Transform group - lets you specify the transform group used when invoking the method. This setting is available for methods specified with a Language of C, JAVA, or OLE.

As identifier - This setting is available for methods specified with a Language of C. When this check box is checked, the method body is created with the external name as provided.

Otherwise, the external named provided will appear within quotes in the CREATE METHOD statement on the Body tab.

Inherit isolation level with lock request - specifies whether the INHERIT clause is specified as INHERIT ISOLATION LEVEL WITHOUT LOCK REQUEST or INHERIT ISOLATION LEVEL

WITH LOCK REQUEST. This setting is available for methods specified with a Language of

SQL.

After specifying options, click Create Body to work with the CREATE METHOD statement you generated on the editor’s Body tab.

Lets you view and modify the CREATE METHOD statement generated with your choices on the Methods tab.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

43 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

A

DDING OR EDITING STRUCTURED TYPE METHODS

The Add Method and Edit Method wizards let you work with the methods of a structured type.

They let you specify basic properties, parameter and return value details for methods.

To add or edit a structured type method:

1 Open an editor on a structured type. For details, see

Opening an Object Editor

.

2 Navigate to the Methods panel, and then open a wizard using one of the following techniques:

• Click Add to create a new method

• Select an existing method and click Edit.

3 Use the following table as a guide to understanding and modifying the settings on the tabs of this wizard:

Tab

Properties

Advanced (available after clicking the

Advanced button on the Properties pane)

Parameters

Return

Settings and tasks

When adding a method this pane lets you specify a Name, Specific Name, Language (OLE,

SQL, JAVA, C), and SQL Access Level (CONTAINS SQL, READS SQL DATA, NO SQL). When editing a method, these properties are for display only.

Lets you select or enable the following ADD METHOD options: Deterministic, External

Action, Called on NULL Input, DBINFO, Fenced, Allow Parallel, Scratchpad, Scratchpad

Length, Parameter Style (SQL, DB2GENERAL), and Final Call.

Lets you work with input parameters:

Add a parameter by clicking the New button and typing a name for the parameter.

Select a parameter and change the Datatype in the Property/Value list. Depending on the datatype you choose you can also provide Precision, Size, and Scale options.

Delete a selected parameter by clicking the DELETE button.

Order the parameters using the arrow buttons.

Lets you provide details of the return value of the method:

Return

Datatype

Cast

Datatype

Lets you specify the base Type of the return value. Depending on the datatype you choose you can also provide Precision, Size, and Scale options.

This group lets you optionally use the CAST FROM form of the ADD METHOD

RETURN clause. It lets you have the method return a different datatype, cast from the datatype specified in the Return Datatype group. This feature must be Enabled and provide the same type options as the Return Datatype group.

An As Locator option specifies that the method return a LOB locator instead of the actual value. The option is only available for LOB and LOB-based datatypes. As Locator applies to a

LOB type in the Cast Datatype group, if specified. Otherwise it applies to a LOB type in the

Return Datatype group

4 When ready click Finish.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 433

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

T

ABLES

E

DITOR

(IBM DB2 LUW)

The Tables Editor lets you manage basic properties, columns, dimension columns, distribution key columns, partitions, tablespaces, and constraints for a table.

TIP:

Before modifying a table, familiarize yourself with the material in Altering Tables for

IBM DB2 LUW for Linux, Unix, and Windows .

To edit a table

1 Open an editor on the table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Status

Partition

Tablespaces

Dimensions

Distribution Key

Columns

Settings and tasks

Displays the currently defined columns in the table. Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Select a column and click Delete to remove the column from the table.

Displays the Name, Created, Last RunStats, Invalidate Time, and Defined By properties.

Lets you set Percent Free, Lock Size, Append Data, Volatile, Compress, Row

Compression, Security Policy, RestrictDrop, LogIndexBuild, CCSID, Do not initially log, and Data Capture properties.

Lets you view the following statistics: Total Number of Rows, Number of Overflow Rows,

Number of Pages With Rows, Number of Pages, Table Status, Row Organization,

RowTypeSchema, RowTypeName, AccessMode, ActiveBlocks, AvgCompressedRowSize,

AvgRowCompressionRatio, CodePage, PercentOfPagesSaved, LastRegeneratedTime, and ProtectionGranularity.

This tab provides details on the partition columns and data partitions for the table. Optionally you can:

Use the New or Delete buttons to create or drop a partition column or data partition.

Use the Edit button to edit a data partition.

Use the Commands menu to attach or detach a data partition.

Data Tablespace,

Long Tablespace, and Index

Tablespace

Lets you view the Database partition Group, Managed By, Page

Size, and Extent Size properties. Lets you choose the Name of a tablespace.

Lets you group columns to form a dimension:

Click the New button to add a new column to the dimension for the table.

Select a column and click the Edit button to modify the dimension column properties.

Select a column and click the Delete button to drop a column from the dimension.

Lets you group one or more columns to form a distribution key:

Click the New button to add a new column to the dimension for the table.

Select a column and click the Edit button to modify the dimension column properties.

Select a column and click the Delete button to drop a column from the dimension.

43 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Indexes

Constraints

Comment

Dependencies

Permissions

DDL View

Settings and tasks

Lets you manage indexes for a table:

Click Add to open a dialog that lets you add a new index to the table.

Select an index and click Edit to open a dialog that lets you edit index properties.

Select an index and click Drop to open a dialog that lets you remove the index from the table.

Lets you manage primary key, unique key, foreign key, and check constraints for a table.

Constraints are grouped by type, under folders:

Select a constraint type folder and click Add to open a dialog that lets you add a constraint of that type.

Select a constraint and click Edit to open a dialog that lets you modify the constraint details.

Select a constraint and click Drop to remove the constraint.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

A

LTERING

T

ABLES FOR

IBM DB2 LUW

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

The ALTER TABLE command of Transact-SQL is limited to adding NULL columns to the end of a table and to adding or dropping constraints. Unfortunately, this scenario does not address many requirements of administrators and developers who need to add, delete or modify columns more broadly:

• Add columns anywhere in a table, not just the end

• Add columns that do not permit a NULL value.

• Change the NULL/NOT NULL status of table columns

• Change column datatypes to other compatible types

• Change the length of datatypes

• Delete a column

Due to the limitations of the ALTER TABLE command, the only way to make broader modifications is to write SQL scripts that step through all desired changes. To perform an enhanced table alter, DBArtisan constructs an SQL script that completes the following steps:

1 Renames the existing table so that the original and its data remain intact

2 Builds a CREATE TABLE statement with the new table definition, including declared defaults, primary key and check constraints

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 435

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 Builds an INSERT statement to copy data from the original, renamed table to the new one

4 Builds foreign keys on the new table

5 Reapplies any privileges granted on the table

6 Rebuilds all dependencies on the new table, including indexes, triggers, procedures, packages, functions and views. When rebuilding procedures, functions, packages and views,

DBArtisan also rebuilds any permissions on them.

T

ABLESPACES

E

DITOR

(IBM DB2 LUW)

The Tablespaces Editor lets you manage containers, basic properties, performance, space usage, and associated objects for a tablespace.

To edit a tablespace

1 Open an editor on the tablespace. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Container

Settings and tasks

Lets you work with settings in the following categories:

Tablespace

Lets you view the Type (REGULAR, LARGE, TEMPORARY, or USER

TEMPORARY), Use Automatic Storage, Managed By, and Database Partition

Group properties.

Lets you modify the Buffer Pool and Drop Recovery properties.

Performance

Lets you view the Page SIze and Extent Size properties.

Lets you specify or select the Prefetch Automatic, Overhead, Transfer Rate, and File System Caching properties.

Automatic

Storage

Lets you work with the AutoResize (enables following size settings), Initial Size,

Increase Size, Max Size Unlimited, and Max Size (enabled if Max Size

Unlimited is not set) attributes.

The Initial Size and Max Size values can be provided as kB, mB, or gB values.

This option is only available for database managed tablespaces. This tab lets you add or delete containers of a tablespace.

Select an existing container and in the Property/Value list, use the Size controls to RESIZE, EXTEND, or REDUCE the container.

Add a container by clicking New, and then in the Property/Value list, provide

Name, number of Database Partitions, Type (DEVICE, FILE) and original Size.

Click Delete to remove a container.

43 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Tab

Performance

Comment

Space

Objects

Privileges

DDL View

Settings and tasks

Lets you manage settings in the following categories:

Page Setting

I/O Setting

Dropped Table

Settings

Defaults

Lets you view Page SIze and Extent Size settings and modify the Prefetch Size setting.

Let you modify the Overhead and Transfer Rate settings.

Lets you view the Recovery Status.

Lets you view the Nodegroup and specify a Bufferpool.

For details on using this tab, see

Adding a Comment to an object .

Lets you view the table usage and the distribution of space for a tablespace. Specific statistics include Free Pages, Used Pages, Reserved Pages, and Total Pages.

Lets you manage database objects associated with the tablespace. Objects are organized in a tree structure with folders containing the objects. Optionally, take one of the following actions:

Select an object and click Edit to open an object editor on the selected object.

Select an object and click Drop to initiate dropping the selected object.

For details on using this tab, see

Previewing and Submitting Object Editor Changes .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

RIGGERS

E

DITOR

(IBM DB2 LUW)

The Triggers Editor lets you view properties for a trigger.

To edit a trigger

1 Open an editor on the trigger. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

Dependencies

Definition

Settings and tasks

Lets you view the Trigger Timing, Trigger Events, Trigger Type, Object Status,

Definer, and Function Path properties.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

Lets you view and modify the CREATE TRIGGER DDL that will implement your changes.

To modify a trigger, DBArtisan must drop then create the trigger.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 437

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

U

NIQUE

K

EYS

E

DITOR

(IBM DB2 LUW)

The Unique Keys Editor lets you manage columns and basic properties for a unique key, as well as view space details.

To edit a unique key

1 Open an editor on the unique key. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Space

Comment

DDL View

Settings and tasks

Lets you manage columns that make up the unique key. On opening, this tab shows the existing columns. For each column, the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Displays the owning Table Schema and Table Name, the Name of the primary key, a Defined By property, and Percent Free and Minimum Percent Used properties.

Lets you view settings in the following categories:

Attributes Lets you view Make Unique, System Required, Total Keys, Distinct Keys, and

Page Fetch Pairs settings.

Statistics

Lets you view Index Level, Cluster Ration, Cluster Factor, Leaf Pages, Sequential

Pages, and Density settings.

Cards

Lets you view First Key, First 2 Keys, First 3 Keys, First 4 Keys and Full Keys settings.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SER

D

ATATYPES

E

DITOR

(IBM DB2 LUW)

The User Datatypes Editor lets you manage the basic properties of a user datatype.

43 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a user datatype

1 Open an editor on the user datatype. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

DDL View

Settings and tasks

Displays the user Datatype name. Lets you select a new Owner or Type, and depending on the type specified, offers additional type-specific properties such as Size. Also lets you modify the Allow Bit Data property, if appropriate.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS

E

DITOR

(IBM DB2 LUW)

The Users editor lets you manage object dependencies and permissions for a user.

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Objects

Settings and tasks

Displays the user Name.

Lets you manage database objects associated with the user. Objects are organized in a tree structure with folders containing the objects. Optionally, take one of the following actions:

Select an object and click Edit to open an object editor on the selected object.

Object Permissions and

System Permissions

DDL View

Select an object and click Drop to initiate dropping the selected object.

For details on using these tabs, see Working with Privileges and Permissions .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

V

IEWS

E

DITOR

(IBM DB2 LUW)

The Views Editor lets you manage the columns as well as view and modify properties for a view.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 439

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a view

1 Open an editor on the view. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Comment

Dependencies

Permissions

Settings and tasks

Displays all columns for the view. Details for each column include the Column Name, the

Datatype (and if applicable, with the precision in parentheses), and whether or not Nulls are allowed for that column.

You can also set the EnableQueryOptimization property for the view.

Lets you view and modify the CREATE VIEW DDL that will implement any changes you make in this editor. To modify a view, DBArtisan must drop then create the view.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

IBM DB2

FOR Z

/OS O

BJECT

E

DITORS

DBArtisan includes an Object Editor for all supported IBM DB2 for z/OS objects:

Aliases Editor (IBM DB2 Z/OS)

Buffer Pools Editor (IBM DB2 Z/OS)

Check Constraints Editor (IBM DB2 Z/OS)

Databases Editor (IBM DB2 Z/OS)

DBRMs Editor (IBM DB2 Z/OS)

Foreign Keys Editor (IBM DB2 Z/OS)

Functions Editor (IBM DB2 Z/OS)

Indexes Editor (IBM DB2 Z/OS)

Packages Editor (IBM DB2 Z/OS)

Plans Editor (IBM DB2 Z/OS)

Primary Keys Editor (IBM DB2 Z/OS)

Procedures Editor (IBM DB2 Z/OS)

Stogroups Editor (IBM DB2 Z/OS)

Synonyms Editor (IBM DB2 Z/OS)

44 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tables Editor (IBM DB2 Z/OS)

Tablespaces Editor (IBM DB2 Z/OS)

Triggers Editor (IBM DB2 Z/OS)

Unique Keys Editor (IBM DB2 Z/OS)

User Datatypes Editor (IBM DB2 Z/OS)

Users Editor (IBM DB2 Z/OS)

Views Editor (IBM DB2 Z/OS)

A

LIASES

E

DITOR

(IBM DB2 Z/OS)

The Aliases Editor lets you view details of an alias definition.

To edit an alias

1 Open an editor on the alias. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

DDL View

Settings and tasks

In addition to the owning Schema and Name of the alias, this tab lets you view the

Target Owner, Target Type, and Target Name, of the referenced object.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

B

UFFER

P

OOLS

E

DITOR

(IBM DB2 Z/OS)

The buffer pool editor lets you manage basic properties of a buffer pool and view usage details.

To edit a buffer pool

1 Open an editor on the buffer pool. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Settings and tasks

Lets you work with settings in the following areas:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 441

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Usage Details

Privileges

Settings and tasks

Storage

Lets you set the Size (VPSIZE), Type (VPTYPE), Hiperpool Size

(HPSIZE), Castout, Page Stealing Algorithm (PGSTEAL) properties.

Threshold Lets you set the Sequential Steal (VPSEQT), Parallel Sequential

(VPPSEQT), Assisting Parallel Sequential (VPXSEQT), Hiperpool

Sequential Steal Threshold (HPSEQT), Deferred Write Threshold

(DWQT), and Vertical Deferred Write Threshold (DDWQT) properties

Displays space utilization details for each associated database.

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

HECK

C

ONSTRAINTS

E

DITOR

(IBM DB2 Z/OS)

The Check Constraints Editor lets you view definition details and edit a check condition expression.

To edit a check constraint

1 Open an editor on the check constraint. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Lets you view basic identification information on the check constraint: Table Schema and

Table Name, the Name of the constraint and the date it was Created.

You can also edit the condition in the Check Condition box. The Table Columns button acts a time saver in editing the condition. It opens a dialog that lets you select and paste column names into the check condition expression.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATABASES

E

DITOR

(IBM DB2 Z/OS)

The Databases Editor lets you manage basic properties, permissions, and object dependencies for a database.

44 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a database

1 Open an editor on the database. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Permissions

Dependencies

DDL View

Settings and tasks

The Database Creation group lets you view the Name and Group Member properties and set the Type property. The Database Attributes group lets you view the Encoding

Scheme, Create Date, and Last Altered properties and lets you set the Tablespace

Buffer Pool, Index Buffer Pool, Storage Group, and CCSID properties.

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

DBRM

S

E

DITOR

(IBM DB2 Z/OS)

The DBRM Editor lets you view into the metadata of each DBRM, view and cross-reference all associated Plans and Packages as well as view and Explain all Package SQL Statements.

To edit a DBRM

1 Open an editor on the DBRM. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Description

Plans

Settings and tasks

Displays the main contents of the DBRM header information, including the Precompile

Timestamp, Language, and Consistency Token, as well as String Delimiter, Katakana

Charset, Mixed Character Set, and Decimal Point specifiers.

Lists details of the plans containing the DBRM. Optionally, you can:

Select a plan and click Edit to open the Plans editor on the plan. For more

information, see Plans Editor (IBM DB2 Z/OS) .

Select a plan and click Rebind to initiate rebinding the plan. For more information,

see Rebind Plans .

Select a plan and click Free to initiate deleting the plan. For more information, see

Drop .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 443

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Packages

Statements

Settings and tasks

Displays a cross-reference to the collections, packages, and plans where the DBRM was bound. Optionally, you can:

Select a package and click Edit to open the Packages editor on the package. For more information, see

Packages Editor (IBM DB2 Z/OS)

.

Select a package and click Rebind to initiate rebinding the package. For more

information, see Rebind Packages .

Select a package and click Free to initiate deleting the package. For more

information, see Free (Packages) .

Displays the information about the SQL statements in the DBRM. The information is for programmers reference only.

Optionally, click Explain to copy the selected statement(s) to an ISQL window. The

Explain output displays in the report pane. For more information, see ISQL Editor

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

OREIGN

K

EYS

E

DITOR

(IBM DB2 Z/OS)

The Foreign Keys Editor lets you manage column mapping and specify a delete rule for a foreign key.

To edit a foreign key

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mapping

Properties

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you specify a Delete Rule (CASCADE, NO ACTION, RESTRICT, SET NULL).

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

UNCTIONS

E

DITOR

(IBM DB2 Z/OS)

The Functions Editor lets you view and modify properties for a function, manage its inputs and outputs, and modify the code in the body of the function.

44 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a function

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab Settings and tasks

Properties

Lets you work with properties in the following categories:

Identification

Lets you view the Create Timestamp, Schema, Routine ID, and Origin properties. Lets you set the External Name and Collection ID properties.

Run Time

Lets you view the Result Sets property. Lets you set the WLM Environment,

WLM For Nested, ASU Time, and Run Options properties.

Structure

Lets you view the Language, Parameter Style, Number of LOB Columns,

Number of Parameters, and Allow Parallel properties. Lets you set the

Program Type, Security Type, SQL Access Level, Inherit Special

Registers, Fenced, DBINFO, Deterministic, Called On Null Input, External

Action, Stay Resident, Final Call, Scratchpad, and Scratchpad Length properties.

Run

Estimates

Java

Structure

Lets you view the Initial I/Os, I/Os Per Invocation, Initial Instructions, and

Instructions Per Invocation properties.

Lets you view the Java Class, Jar ID, Package ID, Method ID, Jar Schema, and Java Signature properties.

Parameters, Return

Columns, and

Return Scalar

On opening, these tabs displays the current function parameters, return columns or return scalar. Optionally, take one of the following actions:

Select a parameter, return column, or return scalar in the Attributes area, modify values, as permissible. Attributes differ by the tab you chose but typically include items such as Type, Precision, Scale, As Locator, and Size.

Body

Comment

Permissions

DDL View

Click the New button to provide datatype and size details for a new parameter, return column, or return scalar.

Select a parameter, return column, or return scalar and click Drop to delete that parameter.

Lets you modify the code in the text area of the tab.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

I

NDEXES

E

DITOR

(IBM DB2 Z/OS)

The Indexes Editor lets you manage basic, storage, and space properties for an index, as well as work with its columns and partitions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 445

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit an index

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Storage

Partitions

Space

Comment

DDL View

Settings and tasks

Lets you manage the columns or key-expressions that make up the index. On opening, this tab shows the existing columns/key-expressions.

NOTE: Key-expression functionality is only enabled if the Index on Expression setting is enabled on the Properties tab.

Optionally you can:

Change the Sort order of a column or key-expression.

If Index on Expression is disabled, click the New button and select a column name from the dropdown to add a column to the index.

If Index on Expression is enabled, click the New button and type a valid key-expression in the Expression field, to add an expression to the index.

Select a column or key-expression and click the Drop button to delete the column from the index.

Lets you work with the Buffer Pool, Piece Size, Close, Copy, Compress, Index on

Expression, and Padded properties. For more information on these properties, see

Indexes (DB2 z/OS) - Properties

.

Lets you select a dataset management scheme and provide associated attribute values. For details, see

Indexes (DB2 z/OS) - Storage .

Lets you work with partitions for the index. For each data partition, the listing shows the storage group, VCAT Catalog, primary and secondary space allocations, and if appropriate, the free space percentage, GBP Cache, limit key value, and erase on delete settings. Optionally, you can select a partition and click the Edit button top open an editor that lets you edit that partition.

Lets you view the following property groups:

Attributes

Make Unique, System Required, Total Keys, Page Fetch Pairs, and

Distinct Keys

Statistics

Index Level, Cluster Ratio, Cluster Factor, Leaf Pages, Sequential Pages,

Density, DASD Storage, and Data Blocks/Key.

Cards

First Key and Full Keys

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ACKAGES

E

DITOR

(IBM DB2 Z/OS)

The Packages Editor lets you manage properties and bind parameters for a package, as well as view environment information, package contents and associated plans.

44 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a package

1 Open an editor on the package. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Bind Parameters

Plan/Packlists

Statements

Dependencies

Privileges

Environments

Command

Settings and tasks

Lets you work with the following properties: Average Size, Bind Time, Consistency

Token, Dec31, Decimal Point, Group Member, Katakana Charset, Language, Mixed

Character Set, Operative, Package Size, Package Source, PDS Name, Precompile

Timestamp, Release Bound, String Delimiter, SysEntries, Timestamp, and Valid.

Lets you set the Schema Path, Creator, Qualifier, Explain, Validate, Degree, Dynamic

Rules, Lock Isolation, Encoding, Page Writes, Resource Release, CurrentData, DB

Protocol, Reoptvar, Keep Dynamic, Defer Prepare, SQL Error, and Optimization Hint properties.

Displays the plans contained in the package if the package was bound individually, or as part of a complete collection ID.

Optionally, you can:

Select a plan and click Edit to open the Plans editor on the plan. For more

information, see Plans Editor (IBM DB2 Z/OS) .

Select a plan and click Rebind to initiate rebinding the plan. For more information,

see Rebind Plans .

Select a plan and click Free to initiate deleting the plan. For more information, see

Drop .

Shows the contents of any package statement on the datasource. Optionally, select a statement and click Explain to copy the statement to an ISQL Editor window.

NOTE: For more information, see

ISQL Editor .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

Displays run-time environments information for a package. Use the arrow buttons to move environments between the Enabled Environments and Disabled Environments lists.

To modify a connection, select the environment and click Edit Connections. For more

information, see Connection Editor .

Displays the command that originally built the package.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

ONNECTION

E

DITOR

The Connection Editor lets you modify plan and package connections. It is opened from the

Packages editor. For more information, see

Packages Editor (IBM DB2 Z/OS)

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 447

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

The table below describes the options and functionality of the Connection Editor:

Option

Connections

Add

Description

Displays the connections for the plan or package.

Click to add the connection.

P

LANS

E

DITOR

(IBM DB2 Z/OS)

The Plans Editor lets you manage plan properties, view DBRM information, manage packages and contents, and manage run-time environments for a plan.

To edit a plan

1 Open an editor on the plan. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DBRMs

Packages

DBRM/Packages

Dependencies

Privileges

Settings and tasks

Lets you work with the following attribute groups:

Properties

Bind

Parameters

Lets you view the Timestamp, Group Member, Plan Size, Average Size,

Valid, Operative, Pkg. List Entries, SysEntries, and Release Bound properties. Lets you set the Owner, Qualifier, and Current Server properties.

Lets you set the Schema Path, Explain, Validate, Degree, Dynamic Rules,

Lock Isolation, Resource Acquire, Resource Release, Disconnect, Current

Data, DB Protocol, Reoptvar, SQL Rules, Keep Dynamic, Defer Prepare,

Encoding, Page Writes, Flag, Optimization Hint, and Cache Size properties.

Lists details for each DBRM associated with a plan. Optionally, select a DBRM from the list

and click Edit to open the DBRM editor on that DBRM. For more information, see DBRMs

Editor (IBM DB2 Z/OS) .

Displays details for each package associated with a plan. Optionally, you can:

Select a package and click Edit to open the Package editor on that package.

For details, see

Packages Editor (IBM DB2 Z/OS)

.

Select a package and click Rebind to open the

Rebind Packages

dialog.

Select a package and click Free to open the

Free (Packages)

dialog.

Displays the entire contents of the plan, DBRMs and packages, in a single display. The first column contains either a 'D' for DBRM or 'P' for packages.

Optionally, take one of the following actions:

Select a package list entry and click Edit to open the Package editor on that package. For details, see

Packages Editor (Oracle) .

Select a package and click Rebind to open the

Rebind Packages

dialog.

Select a package and click Free to open the

Free (Packages)

dialog.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

44 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Environments

Settings and tasks

Displays run-time environments information for a plan. Optionally, you can:

Use the arrow buttons to move environments between the Enabled

Environments and Disabled Environments lists.

Select an environment and click Edit Connections to open the Connection editor.

Displays the command that originally built the plan.

Command

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

RIMARY

K

EYS

E

DITOR

(IBM DB2 Z/OS)

The Primary Keys Editor lets you manage primary key columns as well as work with storage, space, and partitions for a primary key.

TIP:

The r efresh button lets you refresh or clear the editor’s contents, and log SQL.

To edit a primary key

1 Open an editor on the primary key. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column

Properties

Storage

Partitions

Settings and tasks

Lets you manage columns that make up the primary key. On opening, this tab shows the existing columns. For each column, the listing shows the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the primary key.

Select a column and click the Drop button to delete the column from the primary key.

Select a column and use the arrow buttons to reorder the columns in the primary key.

Lets you set Buffer Pool, Close, Copy and Piece Size properties.

Lets you view Storage Group and VCAT Catalog properties. Lets you set Primary Space

Allocation, Secondary Space Allocation, Erase, Free Page, Percent Free, and GBP

Cache properties.

Lets you work with partitions for the primary key.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 449

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Space

Comment

DDL View

Settings and tasks

Lets you view values in the following property groups:

Attributes

Make Unique, System Required, Total Keys, Page Fetch Pairs, and

Distinct Keys.

Statistics

Index Level, Cluster Ratio, Cluster Factor, Leaf Pages, Sequential

Pages, and Density.

Cards

First Key and Full Keys.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ROCEDURES

E

DITOR

(IBM DB2 Z/OS)

The Procedures Editor lets you manage the properties and input/output parameters of a procedure.

To edit a procedure

1 Open an editor on the procedure. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Lets you work with properties in the following categories:

Identification

Lets you view the Schema and Routine ID properties. Lets you set the

External Name and Collection ID properties.

Run Time

Structure

Lets you set the Result Sets, WLM Environment, WLM For Nested,

ASU Time, and Run Options properties.

Lets you view the Language, Number of LOB Columns, Number of

Parameters, and DBINFO properties. Lets you set the Program Type,

Security Type, SQL Access Level, Parameter Style, Inherit Special

Registers, Fenced, Commit on Return, Deterministic, and Stay

Resident properties.

Run Estimates

Lets you view the Initial I/Os, I/Os Per Invocation, Initial Instructions, and Instructions Per Invocation properties.

Java Structure

Lets you view the Java Class, Jar ID, Package ID, Method ID, Jar

Schema, and Java Signature properties.

45 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Parameters

Comment

Body

Permissions

DDL View

Settings and tasks

Displays a listing of the existing input/output parameters for the procedure. For the selected parameter, the Datatype list shows details for that parameter, including the

Type and Parameter Mode (INPUT, OUTPUT, INPUT_OUTPUT). Depending on the type other parameters such as Size, Precision, or Scale may be available for viewing or modification.

Optionally you can:

Select a parameter and in the Datatype list, modify details for that parameter.

Click the Add button to add a new parameter, provide a name for the new parameter, and edit the parameter values in the Datatype list.

Click the Delete button to drop a selected parameter.

Use the arrow buttons to change the order location of a selected parameter.

For details on using this tab, see

Adding a Comment to an object .

Lets you modify the SQL code for procedures on the current datasource

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

TOGROUPS

E

DITOR

(IBM DB2 Z/OS)

The Stogroups Editor lets you view and modify volumes, manage function privileges, and view

DDL for a stogroup.

To edit a stogroup

1 Open an editor on the stogroup. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Volume Devices

Privileges

DDL View

Settings and tasks

Shows details on volumes associated with the stogroup. Optionally you can:

Click Add to open a dialog that lets you add volumes.

Select a volume and click Remove to delete the volume.

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 451

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

S

YNONYMS

E

DITOR

(IBM DB2 Z/OS)

The Synonyms Editor lets you view base object information and manage database object dependencies for a synonym.

To edit a synonym

1 Open an editor on the synonym. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you view the owning Schema, the Name of the synonym, and the synonym’s

Referenced Object Owner, Referenced Object Type, and the Referenced Object

Name.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

ABLES

E

DITOR

(IBM DB2 Z/OS)

The Tables Editor lets you: manage columns, basic properties, partitions, indexes, and constraints for a table.

NOTE:

Before editing tables, refer to the material in

Altering Tables for IBM DB2 z/OS .

To edit a table

1 Open an editor on the table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Settings and tasks

Displays the currently defined columns in the table. For each column, the Property/Value list displays the Name and Type for the column. In addition, depending on the Type selected, the list also displays Size, Scale, Identity Column, Allow Nulls, Default Value,

Comment, and For Data property values, as appropriate.

The Statistics group displays a Number of Distinct Values in the Column value.

Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Select a column and click Delete to remove the column from the table.

45 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Properties

Partitions

Indexes

Constraints

Comment

Dependencies

Permissions

DDL View

Settings and tasks

Lets you work with settings in the following categories:

Table

Lets you view EditProcedure, Table Type, Table Status, Check Flag,

DBID, and OBID properties. Lets you set Volatile, Audit, RestrictDrop,

Label, and ValidProc properties.

Tablespace

Placement

Lets you select a Tablespace.

Log

Options

Statistics

Lets you select a Data Capture option of DATA CAPTURE NONE or DATA

CAPTURE CHANGES.

Lets you view the following statistics: Last Runstats, Total number of

rows, Average Row Length, Number of Pages, Percent Compressed

Rows, Max Record Length, and DASD storage.

Displays existing partition columns and data partitions. Optionally you can add, edit, or delete partition columns and data partitions.

Displays the list of indexes for the table. Optionally, take one of the following actions:

Click Add to open a dialog that lets you add a new index to the table.

Select an index and click Edit to open a dialog that lets you edit index properties.

Select an index and click Drop to open a dialog that lets you remove the index from the table.

Displays constraints in a tree structure. The tree contains folders which contain all constraints associated with the target table. The objects are organized in folders based on the type of constraint.

Optionally take one of the following actions:

Select a constraint type folder and click Add to open a dialog that lets you add a constraint of that type.

Select a constraint and click Edit to open a dialog that lets you modify the constraint details.

Select a constraint and click Drop to remove the constraint.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

A

LTERING

T

ABLES FOR

IBM DB2

Z

/OS

The ALTER TABLE command of Transact-SQL is limited to adding NULL columns to the end of a table and to adding or dropping constraints. Unfortunately, this scenario does not address many requirements of administrators and developers who need to add, delete or modify columns more broadly:

• Add columns anywhere in a table, not just the end

• Add columns that do not permit a NULL value.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 453

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

• Change the NULL/NOT NULL status of table columns

• Change column datatypes to other compatible types

• Change the length of datatypes

• Delete a column

Due to the limitations of the ALTER TABLE command, the only way to make broader modifications is to write SQL scripts that step through all desired changes. To perform an enhanced table alter, DBArtisan constructs an SQL script that completes the following steps:

1 Renames the existing table so that the original and its data remain intact

2 Builds a CREATE TABLE statement with the new table definition, including declared defaults, primary key and check constraints

3 Builds an INSERT statement to copy data from the original, renamed table to the new one

4 Builds foreign keys on the new table

5 Reapplies any privileges granted on the table

6 Rebuilds all dependencies on the new table, including indexes, triggers, procedures, packages, functions and views. When rebuilding procedures, functions, packages and views,

DBArtisan also rebuilds any permissions on them

T

ABLESPACES

E

DITOR

(IBM DB2 Z/OS)

The Tablespaces Editor lets you work with the basic properties and partitions for a tablespace as well as view space details, status, and objects stored on the tablespace.

To edit a tablespace

1 Open an editor on the tablespace. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Lets you work with properties in the following categories:

Bufferpool Buffer Pool

Partitions and size

Number of partitions, Partition size (DSSIZE), Segment size, and Max rows per page

Other parameters

GBPCACHE, Compress, Track modified pages, Encoding scheme,

Log, Define, Member Cluster, Close rule, Lock Size, and Maximum

locks

For more information on these properties, see

Tablespaces (DB2 z/OS) - Properties .

45 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Partitions

Status

Space

Objects

Permissions

DDL

Settings and tasks

Displays a list of partitions for the tablespace. Details for each partition include the storage group, VCAT, primary and secondary space allocations, the free space portion of each page and free page frequency, the group buffer cache scheme, and whether modifications are tracked.

Optionally, you can:

Select a partition and click Edit to open a dialog that lets you modify properties for that partition.

Select a partition and click Clone to open a dialog that lets you apply the attributes of the selected partition to another partition.

Lets you display CLAIMERS, LOCKS, LPL, USE, or WEPR status details

Lets you view space usage and allocation details for the tablespace.

Displays the objects stored on the tablespace. Objects are organized in a tree structure with folders containing the objects.

Optionally, you can:

Select an object and click Edit to open an object editor on that object.

Select an object and click Drop to initiate dropping that object.

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

RIGGERS

E

DITOR

(IBM DB2 Z/OS)

The Triggers Editor lets you modify the CREATE TRIGGER statement and manage properties for a trigger.

To edit a trigger

1 Open an editor on the trigger. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

Dependencies

Definition

Settings and tasks

Lets you view the Trigger Timing, Trigger Events, Trigger Type, Object Status,

Definer, and Function Path properties.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

Lets you modify the CREATE TRIGGER body for a trigger. To modify a trigger, DBArtisan must drop then create the trigger.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 455

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

U

NIQUE

K

EYS

E

DITOR

(IBM DB2 Z/OS)

The Unique Keys Editor lets you manage columns, basic properties, and partitions for a unique key, as well as view storage details.

To edit a unique key

1 Open an editor on the unique key. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column

Properties

Storage

Partition

Space

Comment

DDL View

Settings and tasks

Lets you manage columns that make up the primary key. On opening, this tab shows the existing columns. For each column, the listing shows the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the primary key.

Select a column and click the Drop button to delete the column from the primary key.

Select a column and use the arrow buttons to reorder the columns in the primary key.

Lets you set the Buffer Pool, Piece Size, Close, and Copy properties.

Lets you view the Storage Group and VCAT Catalog properties. Lets you set the

Primary Space Allocation, Secondary Space Allocation, Erase, Free Page, Percent

Free, and GBP Cache properties.

Lets you work with partitions for the index.

Lets you view values in the following property groups:

Attributes

Make Unique, System Required, Total Keys, Page Fetch Pairs, and

Distinct Keys

Statistics

Index Level, Cluster Ratio, Cluster Factor, Leaf Pages, Sequential

Pages, and Density

Cards

First Key and Full Keys

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SER

D

ATATYPES

E

DITOR

(IBM DB2 Z/OS)

The User Datatypes Editor lets you manage basic properties of a user datatype.

45 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a user datatype

1 Open an editor on the user datatype. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Comment

Permissions

DDL View

Settings and tasks

Lets you work with properties in the following categories:

Base Datatype

Lets you set Type and Size settings.

Character Options

Lets you set the For Data and CCSID properties.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS

E

DITOR

(IBM DB2 Z/OS)

The Users Editor lets you manage permissions for a user and the objects owned by that user.

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Objects

Settings and tasks

Displays the user Name.

Lets you manage database objects associated with the user. Objects are organized in a tree structure with folders containing the objects. Optionally, take one of the following actions:

Select an object and click Edit to open an object editor on the selected object.

Select an object and click Drop to initiate dropping the selected object.

Object Permissions and

System Permissions

DDL View

For details on using these tabs, see Working with Privileges and Permissions .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 457

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

V

IEWS

E

DITOR

(IBM DB2 Z/OS)

The Views Editor lets you view columns for a view and work with the dependencies and permissions for the view.

To edit a view

1 Open an editor on the view. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Comment

Dependencies

Permissions

Settings and tasks

Displays all columns for the view. Details for each column include the Column Name, the

Datatype (and if applicable, with the precision in parentheses), and whether or not Nulls are allowed for that column.

Lets you view and modify the CREATE VIEW DDL that will implement any changes you make in this editor. To modify a view, DBArtisan must drop then create the view.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

M

ICROSOFT

SQL S

ERVER

O

BJECT

E

DITORS

DBArtisan includes an Object Editor for all supported Microsoft SQL Server objects. To see an

Editor for a specific object, click the corresponding link below:

Alerts Editor (SQL Server)

Backup Devices Editor (SQL Server)

Check Constraints Editor (SQL Server)

Databases Editor (SQL Server)

Database Triggers Editor (SQL Server)

Defaults Editor (SQL Server)

Extended Procedures Editor (SQL Server)

Foreign Keys Editor (SQL Server)

Full-text Catalogs Editor (SQL Server)

Full-text Indexes Editor (SQL Server)

Functions Editor (SQL Server)

45 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Indexes Editor (SQL Server)

Jobs Editor (SQL Server)

Linked Servers Editor (SQL Server)

Logins Editor (SQL Server)

Operators Editor (SQL Server)

Partition Functions Editor (SQL Server)

Partition Schemes Editor (SQL Server)

Primary Keys Editor (SQL Server)

Procedures Editor (SQL Server)

Remote Servers Editor (SQL Server)

Roles Editor (SQL Server)

Rules Editor (SQL Server)

Schemas Editor (SQL Server)

Server Roles Editor (SQL Server)

Server Triggers Editor (SQL Server)

Synonyms Editor (SQL Server)

Tables Editor (SQL Server)

Triggers Editor (SQL Server)

Unique Keys Editor (SQL Server)

Users Editor (SQL Server)

User Datatypes Editor (SQL Server)

User Messages Editor (SQL Server)

Views Editor (SQL Server)

A

LERTS

E

DITOR

(SQL S

ERVER

)

The Alerts Editor lets you modify the definition of a SQL Agent alert.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 459

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit an alert

1 Open an editor on the alert. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Response

DDL View

Settings and tasks

This tab/panels lets you view the ID, Name, and Error Description settings. It lets you modify the

Enabled, Type, Error #, Severity, Database, and Event Description settings. For details on these

settings, see Alerts (SQL Server) - Properties

.

The History and Occurrence groups display the following properties:

Last Occurrence Date

Last Response Date

Occurrence Count

Last Reset Date

Reset Count

The date and time that this alert was last raised.

The date and time that this alert was responded to by the

SQLServerAgent service.

The number of times this alert occurred since last being reset.

The date and time that the Occurrence Date was last reset.

Use this button to set the Occurrence Date to zero.

This tab lets you provide job execution details, set content of email, pager, and net send notifications, and select operators notified, for this alert. For details on the specific properties, see

Alerts (SQL Server) - Response .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

B

ACKUP

D

EVICES

E

DITOR

(SQL S

ERVER

)

The Backup Device editor lets you view key properties for a backup device.

To edit a backup device

1 Open an editor on the backup device. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Displays the following property values:

Name - the logical name.

Device Type - DISK or TAPE for Microsoft SQL Server 2005 or DISK, TAPE, or PIPE for

Microsoft SQL Server 2000.

Skip ANSI Labels - Available only with a Device Type of TAPE, indicates whether ANSI tape labels are ignored.

Physical Name - A file name (sqltable.dat for example) or full path (a:\sqltable.dat for example) identifying the device.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

46 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

HECK

C

ONSTRAINTS

E

DITOR

(SQL S

ERVER

)

The Check Constraints Editor lets yo view and modify check constraints properties and edit the check constraint expression.

To edit a check constraint

1 Open an editor on the check constraint. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Use the Enabled check box to enable or disable the check constraint. Use the Not For

Replication check box to enable or disable the check constraint for replication.

You can also edit the condition in the Check Condition box. The Table Column button opens a dialog that lets you select and paste column names into the check condition expression.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATABASES

E

DITOR

(SQL S

ERVER

)

The Databases Editor lets you manage basic properties, log and data files for a database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 461

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a database

1 Open an editor on the database. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Options

Placement

Transaction Log

Space

DDL View

Settings and tasks

Lets you work with options in the following categories:

Creation

Properties

Lets you choose values for the Compatible Level and Owner settings.

NOTE: The Compatible level option sets certain database behaviors to be compatible with the specified earlier version of Microsoft® SQL Server. The compatibility level affects the behaviors in the specified database, not the entire server.To set database options for all future databases, set the database options on the model database.

NOTE: When changing the database owner (dbo) select the check box to transfer the existing aliases of users who could act as the old dbo (including their permissions) to the new dbo.

Properties

Lets you set the following properties: ANSI null default, ANSI nulls, ANSI

padding, ANSI warnings, arithabort, auto create statistics, auto update

statistics, auto close, auto shrink, concat null yields nul, cursor close on

commit, db chaining, dbo use only, default to local cursor, merge

publish, numeric roundabout, offline, published, quoted identifier, read

only, recursive triggers, select into/bulkcopy/pllsort, single user,

subscribed, torn page detection, and trunc log on chkpt.

Displays the currently defined data files for the database. Optionally, you can:

Select a file from the list on the left and in the Device File Properties group, modify the Size, File Growth Rate, Max Size, and Unlimited Max

Size settings.

Click the New button, provide a Device File Name for the new file, and use the other settings in the Device File Properties group to provide additional details for the file.

Select a file from the list on the left and click Delete to remove the file.

Displays the currently defined transaction logs for the database. Optionally, you can:

Select a transaction log from the list on the left and in the Log Device

Properties group, modify the Size, File Growth Rate, Max Size, and

Unlimited Max Size settings.

Click the New button, provide a Device File Name for the new transaction log, and use the other settings in the Log Device Properties group to provide additional details for the transaction log.

Select a transaction log from the list on the left and click Delete to remove the transaction log.

Lets you view pie charts showing the data space usage and the transaction log (if available) space usage for the database.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

46 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

D

ATABASE

T

RIGGERS

E

DITOR

(SQL S

ERVER

)

The Database Triggers Editor lets you enable or disable a database trigger and modify the body of the generated CREATE TRIGGER statement.

NOTE:

This functionality is available for SQL Server 2005 and up.

To edit a database trigger:

1 Open an editor on the database trigger. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Select the Enabled check box to enable the database trigger or deselect it to disable the trigger.

In addition to the name and creation date details, this tab also lets you view the Trigger Timing and Encrypted property settings you chose when creating the trigger. For details on these properties, see

Database Triggers (SQL Server) - Properties

.

Definition

Lets you modify the CREATE TRIGGER statement.

Dependencies

Lists referring and referenced objects potentially impacted by the change. For details, see

Working with Object Dependencies .

Trigger Events

Lets you view the DDL events you selected to fire this trigger.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

EFAULTS

E

DITOR

(SQL S

ERVER

)

The Defaults Editor lets you change the owner and value of a default.

To edit a default

1 Open an editor on the default. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you modify the Value of the Default and the owning Schema.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 463

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

E

XTENDED

P

ROCEDURES

E

DITOR

(SQL S

ERVER

)

The Procedures Editor lets you modify the library name for an extended procedure. It also lets you work with dependencies and permissions.

NOTE:

Extended Procedures are only available on the master database.

To edit an extended procedure

1 Open an editor on the extended procedure. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

Permissions

DDL View

Settings and tasks

Lets you provide a dynamic-link library (DLL) Library Name for the extended procedure.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

OREIGN

K

EYS

E

DITOR

(SQL S

ERVER

)

The Foreign Keys Editor lets you manage the columns and basic properties of a foreign key.

To edit a foreign key

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mapping

Properties

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you specify Enabled and Not For Replication properties. This tab also lets you select a Delete rule and an Update rule (NONE, SET NULL, SET DEFAULT, CASCADE).

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

46 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

F

ULL

-

TEXT

C

ATALOGS

E

DITOR

(SQL S

ERVER

)

The Full-text Catalogs Editor lets you work with the basic definition and dependencies of a fulltext catalog.

To edit a full-text catalog:

1 Open an editor on the full-text catalog. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you view the Parent Type, Parent Schema, Parent Name, Key Index, and Full-text

Catalog Name properties for the partition scheme. It also lets you modify the Filegroup

Name (SQL Server 2008 ^), Change Tracking, and Stoplist (SQL Server 2008 ^) properties. For more information on these properties, see

Full-text Catalogs (SQL Server)

- Properties

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

ULL

-

TEXT

I

NDEXES

E

DITOR

(SQL S

ERVER

)

The Full-text Indexes Editor lets you work with the basic definition and dependencies of a fulltext index.

To edit a full-text index:

1 Open an editor on the full-text index. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you view the Name, property and modify the Accent Sensitive, Default, and

Authorization Owner properties. For more information on these properties, see

Fulltext Indexes (SQL Server) - Properties

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 465

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

F

UNCTIONS

E

DITOR

(SQL S

ERVER

)

The Functions Editor lets you view and modify function definitions and dependencies.

To edit a function

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Permissions

Settings and tasks

Lets you modify the owning Schema of the function.

Lets you view and modify the dynamic-link library (DLL) or view the data definition language (DDL).

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

I

NDEXES

E

DITOR

(SQL S

ERVER

)

The Indexes Editor lets you manage columns and basic properties of an index and view index statistics.

To edit an index

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Settings and tasks

Lets you manage columns that make up the index. On opening, this tab shows the existing columns. For each column, the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Select a column and use the arrow buttons to reorder the columns in the index.

46 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Properties

Statistics

Settings and tasks

Lets you work with settings in the following categories:

Creation

In addition to displaying identifying information, you can modify the Build

Online and Max degree of parallelism properties. For details on these properties, see

Index Wizard (SQL Server)

.

Attributes

Lets you set Index Type, Clustered, Ignore Duplicate Key (for Index

Type of UNIQUE), Statistics Recompute, Allow Row Locks, and Allow

Page Locks properties. For details on these properties, see Index Wizard

(SQL Server) .

NOTE: You cannot reorganize an index (primary key, or unique key) that has an Allow Page Locks property set to FALSE. For information on reorganizing indexes, see

Reorganize (SQL Server indexes, primary keys, and unique keys) .

Storage

Lets you set Partitioned, Partition Scheme, Parttition Column, Fill

Factor, File Group, Pad Index, and Sort in Tempdb settings.

Lets you view statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Reserved Pages, Used Pages, and Total Pages Modified.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index

Row, and Total Rows Modified.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

J

OBS

E

DITOR

(SQL S

ERVER

)

The Jobs Editor lets you modify the definition of a SQL Agent job.

To edit a job

1 Open an editor on the job. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Steps

Schedules

Settings and tasks

This tab/panels lets you specify an Enabled/disabled status and select a Category, as well as

specify notify and delete levels for the job. For details on these settings, see Jobs (SQL Server) -

Properties

.

This tab/panels lets you work with the steps for a job, including subsystem specifics, success/

failure/ retry details, and logging and file specifications. For details on these settings, see Jobs

(SQL Server) - Steps .

This tab/panels lets you create new schedules for this job, add schedules that were defined in other job definitions, delete schedules currently associated with the current job definition, and

display all jobs using a selected schedule. For detailed instructions, see Jobs (SQL Server) -

Schedules

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 467

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Alerts

Target

Settings and tasks

On opening, this tab provides a list of all alerts that specify this job as the target job to be executed in response to those alerts. You can create new alert definitions and edit existing definitions from the list. When you execute the job that creates or edits this job, DDL to create all

alerts on this tab is submitted. For detailed instructions, see Jobs (SQL Server) - Alerts

.

Lets you specify the server or servers where the job executes. For details, see

Jobs (SQL Server) -

Target

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

L

INKED

S

ERVERS

E

DITOR

(SQL S

ERVER

)

The Linked Servers Editor lets you manage basic properties and logins for a linked server.

46 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a linked server

1 Open an editor on the linked server. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab Settings and tasks

Properties

This panel lets you work with settings in the following categories:

General

Is SQL Server - Setting this check box indicates a linked server defined through

Microsoft SQL Server. Any tables retrieved from the server are from the default database defined for the login on the linked server. Setting this check box disables the remaining

OLE DB Provider settings.

Product Name - The product name of the OLE DB datasource to which you are linking.

Datasource - The name of the OLE DB provider managing access to the linked server.

OLE DB Provider Name - Select the name of the OLE DB provider managing access to the specified linked server.

Provider Location - The OLE DB location property corresponding to the linked server.

Provider Connection String - The OLD DB provider-specific connection string that identifies a unique datasource.

Catalog - The name of the catalog to be used when making a connection to the OLE

DB provider.

Server

Options

Data Access Server - Indicates whether the target linked server is enabled for distributed query access.

RPC Out Server - Lets you select the server with RPC encryption.

RPC - Enables RPC encryption from the server.

Collation Compatible Server - Indicates Change DIstributed Query execution against linked servers. If you select this option, Microsoft SQL Server assumes that all characters in the linked server are compatible with the local server, with regard to character set and collation sequence (or sort order). This option is for Microsoft SQL Server 8.0 or later.

Lazy Schema Validation - This option lets you optimize performance by ensuring the query processor does not request metadata for any of the linked tables until data is actually needed from the remote member table. This option is for Microsoft SQL Server

8.0 or later.

Use Remote Collation and Collation Name - Let you indicate that the linked server should use remote collation and select the name of the collation. This option is for

Microsoft SQL Server 8.0 or later.

Query Timeout - Type the query timeout value. This option is for Microsoft SQL Server

8.0 or later.

Connection Timeout - Type the connection timeout value. This option is for Microsoft

SQL Server 8.0 or later.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 469

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Logins

Settings and tasks

Includes a table listing every user who has a login on the target linked server and their local login names. Optionally, you can:

Create a new login by clicking Add linked login button and providing the following information in the dialog that opens:

SQL Server Authentication - Use SQL Server authenticated login credentials to login to linked server. If you choose this option, you must provide a Local Login Name.

No Remote Login - Indicates that no remote login or password are required login to the linked server.

All Users - All users will use the same login when connecting to the linked server. If you choose this option, you must provide a Linked Login Name and a Password.

Local Login Name - Lets you select a local login name.

Linked Login Name - Lets you type in a linked login name.

Password - Lets you set a password.

Select a login, click the Modify button, and change the login names and password.

Select a login and click the Drop button to delete that login.

DDL View

For details on using this tab, see Viewing the SQL/DDL for an Object .

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

L

OGINS

E

DITOR

(SQL S

ERVER

)

The Logins Editor lets you manage basic properties for a login, associated users and roles, and accounting.

To edit a login:

1 Open an editor on the login. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Server Roles

Settings and tasks

Lets you view or modify the following properties set when creating the login: Name, Default

Database, Default Language, Password, Check Policy, Check Expiration, Must Change,

Certificate, and Asymmetric Key. For detailed information on these settings, see

Login Wizard

(SQL Server) .

In addition, when editing an existing login, you have access to the following settings:

Displays whether the user is currently logged in.

Currently

Logged In

Enabled

Enabled, an ALTER LOGIN... ENABLE is submitted following the CREATE

LOGIN statement issued by the editor. Disabled, an ALTER LOGIN... DISABLE is submitted

Lets you add the login as a member of one or more fixed server roles. For more information, see

Logins (SQL Server) - Server Roles .

47 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Users

Settings and tasks

Lets you add and remove user accounts for this login to specified databases. For more detailed

information, see Logins (SQL Server) - Users

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

O

PERATORS

E

DITOR

(SQL S

ERVER

)

The Operators Editor lets you modify the definition of a SQL Agent operator.

To edit an operator

1 Open an editor on the operator. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Notifications

DDL View

Settings and tasks

This tab/panel lets you change the operator’s enabled/disabled status, modify contact information, and change the pager duty schedule. For details, see

Jobs (SQL Server) - Properties

.

This tab lets you modify the set of SQL Agent alerts for which this operator will be notified. For details, see

Operators (SQL Server) - Notifications

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ARTITION

F

UNCTIONS

E

DITOR

(SQL S

ERVER

)

The Partition Functions Editor lets you view the basic definition and work with dependencies of a partition function.

To edit a partition function:

1 Open an editor on the partition function. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

Settings and tasks

Lets you view the Name, Input Parameter Type, Range, and Function Values properties for the partition function. For more information on these properties, see

Partition Functions (SQL Server) - Properties .

For details on using this tab, see

Working with Object Dependencies .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 471

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

DDL View

Settings and tasks

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ARTITION

S

CHEMES

E

DITOR

(SQL S

ERVER

)

The Partition Schemes Editor lets you view the basic definition and work with dependencies of a partition scheme.

To edit a partition scheme:

1 Open an editor on the partition scheme. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you view the Name, Partition Function, and Filegroup Name properties for the partition scheme. For more information on these properties, see

Partition Schemes (SQL

Server) - Properties

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

RIMARY

K

EYS

E

DITOR

(SQL S

ERVER

)

The Primary Keys Editor lets you manage the columns and basic properties for a primary key and lets you view page and row statistics.

47 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a primary key

1 Open an editor on the primary key. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Statistics

DDL View

Settings and tasks

Lets you manage columns that make up the primary key. On opening, this tab shows the existing columns. For each column, the listing shows the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the primary key.

Select a column and click the Drop button to delete the column from the primary key.

Select a column and use the arrow buttons to reorder the columns in the primary key.

Lets you work with settings in the following categories:

Creation

Attributes

Clustered - Indicates whether the target primary key is clustered.

Ignore Duplicate Key - Indicates whether the target primary key ignores duplicate key values. If you select his option, the transaction that generated the duplicate key values can continue.

Statistics Recompute - Indicates that index statistics are automatically recomputed as the index is updated. Microsoft does not recommend this.

Storage

In addition to displaying identifying information, you can modify the Build Online and Max degree of parallelism properties. For details on these properties, see

Primary Key Wizard (SQL Server)

.

File Group - Lets you select a file group.

Fill Factor - Lets you specify the fill factor that specifies how full each index page can be. If no fill factor is specified, Microsoft SQL Server uses the database's default fill factor.

Pad Index - If you specified a Fill factor of more than 0 percent, and you selected the option to create a unique index, you can specify to use the same percentage you specified in Fill Factor as the space to leave open on each interior node. By default,

Microsoft SQL Server sets a 2 row index size.

Lets you view statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Reserved Pages, Used Pages, and Total Pages Modified.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index Row, and

Total Rows Modified.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 473

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

P

ROCEDURES

E

DITOR

(SQL S

ERVER

)

The Procedures Editor lets you manage properties, the definition, dependencies, and permissions for a procedure.

To edit a procedure

1 Open an editor on the procedure. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Permissions

Settings and tasks

Lets you change the owning Schema.

Lets you view the SQL code for the procedure.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

EMOTE

S

ERVERS

E

DITOR

(SQL S

ERVER

)

The Remote Server Editor lets you manage the connection and security properties for a remote server, and manage the associated logins.

47 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a remote server

1 Open an editor on the remote server. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab Settings and tasks

Properties

Lets you work with the following settings:

Server Type

Displays the server type, LOCAL or REMOTE. The local server routes all commands to the remote server. To communicate with a remote server, you log into a local server and submit your remote procedure calls for remote servers. The remote server receives remote procedure calls from the local server and processes them accordingly.

Logins

Publication Server

Specifies database publishing. When replication is installed, this option permits the tables of a database to be published for replication.

When selected, this option enables publication. When not selected, this option disables publishing, drops all publications, and unmarks all transactions that were marked for replication in the transaction log.

Distribution Server

Enables the remote server to be a distribution server.

Subscription Server

Specifies database subscriptions. When selected, the database can be subscribed for publication. When not selected, the database cannot be subscribed for publication.

Enables the remote server to be a publisher/subscriber server.

Publisher/

Subscriber

Collation

Compatible Server

Indicates Change DIstributed Query execution against remote servers. If you select this option, Microsoft SQL Server assumes that all characters in the remote server are compatible with the local server, with regard to character set and collation sequence (or sort order).

Data Access Server

Indicates whether the target remote server is enabled for distributed query access.

RPC Out Server

Enables the remote server to execute stored procedures on the local server using a remote procedure call (RPC).

Includes a table listing the remote name, local name, and trusted status of logins for a remote server.Optionally you can:

Click Add to open a dialog that lets you add a new login. The dialog displays or lets you provide:

Remote Server Name - Displays the remote server name.

Remote Login Name - Lets you specify a remote login name.

All remote users - Select this box if you want to use this name for all remote logins.

Local Login Name - Lets you select a local user name.

Is Trusted - Lets you specify this remote login as a trusted login.

Select a login, click Modify, and use the table above as a guide to modifying login options.

Select a login, and click Drop to delete the login.

DDL View

For details on using this tab, see Viewing the SQL/DDL for an Object .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 475

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

OLES

E

DITOR

(SQL S

ERVER

)

The Roles Editor lets you manage the users for a role.

To edit a role

1 Open an editor on the role. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Users

Settings and tasks

Displays the Name, and either a Role Type of STANDARD and an Authorization Owner or a Role Type of APPLICATION and a Password.

Let you manage users for the role. A user becomes associated with an application role after running the target application.

Use the Join Rule and Leave Role buttons to move users between the Users In Role and

Users Not In Role lists.

For details on using these tabs, see Working with Privileges and Permissions .

Object Privileges and

System Privileges

DDL View

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

ULES

E

DITOR

(SQL S

ERVER

)

The Rules Editor lets you view or modify basic properties of a rule.

To edit a rule

1 Open an editor on the rule. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Settings and tasks

Lets you specify whether the rule is Enabled and view the Fire On Insert, Fire On

Update, Fire On Delete, and Encrypted settings.

Lets you view and modify the SQL code that will implement any changes you make using this editor.

For details on using this tab, see

Working with Object Dependencies .

47 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

CHEMAS

E

DITOR

(SQL S

ERVER

)

The Schemas Editor lets you change the owner of a group and manage the objects contained in the schema.

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Permissions

Objects

DDL View

Settings and tasks

Lets you modify the Owner of the schema.

For details on using this tab, see

Working with Privileges and Permissions

.

Displays the specific objects owned by the schema, grouped under object type folders.

Optionally, you can:

Select an object and click Edit to open an object editor on that object.

Select an object and click Drop to initiate dropping the object.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

ERVER

R

OLES

E

DITOR

(SQL S

ERVER

)

The Server Roles Editor lets you generate a set of sp_addsrvrolemember calls. This lets you change the login members of SQL Server’s fixed server roles: bulkadmin, dbcreator, diskadmin, processadmin, securityadmin, serveradmin, setupadmin, and sysadmin.

To edit the login members of a server role:

1 Open an editor on the server role. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Logins

DDL View

Settings and tasks

Select all check boxes associated with logins that are to be members of this server role.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 477

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

ERVER

T

RIGGERS

E

DITOR

(SQL S

ERVER

)

The Server Triggers Editor lets you enable or disable a logon-based or other event-based server trigger and modify the body of the generated CREATE TRIGGER statement.

NOTE:

This functionality is available for SQL Server 2005 and up.

To edit a server trigger:

1 Open an editor on the server trigger. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Settings and tasks

Select the Enabled check box to enable the server trigger or deselect it to disable the trigger.

In addition to the name and creation date details, this tab also lets you view the Trigger Timing,

Fire On Logon, and Encrypted property settings you chose when creating the trigger. For details

on these properties, see Server Triggers (SQL Server) - Properties

.

Lets you modify the CREATE TRIGGER statement.

Trigger Events

Lets you view the DDL events you selected to fire this trigger.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

YNONYMS

E

DITOR

(SQL S

ERVER

)

The Synonyms Editor lets you view the basic definition and work with dependencies of a partition scheme.

To edit a synonym:

1 Open an editor on the synonym. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

Settings and tasks

Lets you view the Schema, Name, Server, Database, Referenced Object Type,

Referenced Object Owner, and Referenced Object Name properties for the synonym.

For more information on these properties, see

Synonyms (SQL Server) - Properties

.

This tab also includes a CreateDate property showing the data and time the synonym was created.

For details on using this tab, see

Working with Object Dependencies .

47 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

DDL View

Settings and tasks

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

ABLES

E

DITOR

(SQL S

ERVER

)

The Tables Editor lets you manage columns, basic properties, indexes, and constraints for a table and view space usage details.

To edit a table

1 Open an editor on the table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Indexes

Settings and tasks

Displays the currently defined columns in the table. Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Select a column and click Delete to remove the column from the table.

Lets you work with settings in the following categories:

Physical Storage

Lets you view the Partitioned and Partition Scheme properties. Lets you specify a Filegroup and Text Image Filegroup. This is only available for

Microsoft SQL Server 7.0 and later.

Full-Text Index

Lets you view whether Full-Text Indexing is installed and active.

The full-text index feature provides support for sophisticated word searches in character string data. A full-text index stores information about significant words and their location within a given column. This information is used to quickly complete full-text queries that search for rows with particular words or combinations of words.

This feature is available for Microsoft SQL Server 8.0 or later.

Text In Row

Lets you enable Text In Row Data and specify a limit.

Displays any indexes currently defined for the table. Optionally, you can:

Click Add to open an Index editor, letting you create a new index for this

table. For more information, see Index Wizard (SQL Server)

.

Select an index and click Edit to open an wizard that lets you modify that index. For more information, see

Indexes Editor (SQL Server)

.

Select an index and click Drop to open a dialog that lets you confirm that you want to drop the index. When dropping an index with the Clustered option enabled, the confirmation dialog includes an Online option that lets you specify an online drop (ONLINE-ON clause).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 479

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Constraints

Settings and tasks

Lets you manage constraints for the table. Constraints are grouped by type, under folders.

Optionally take one of the following actions:

Select a constraint type folder and click Add to open a dialog that lets you add a constraint of that type.

Select a constraint and click Edit to open a dialog that lets you modify the constraint details.

Select a constraint and click Drop to open a dialog that lets you confirm that you want to drop the index. When dropping a clustered unique key or clustered primary key, the confirmation dialog includes an Online option that lets you specify an online drop (ONLINE-ON clause).

Space

Lets you view pie charts showing the space usage for the table. Optionally you can double-click a slice in the pie chart for detailed statistics.

Dependencies

For details on using this tab, see

Working with Object Dependencies .

Permissions

DDL View

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

RIGGERS

E

DITOR

(SQL S

ERVER

)

The Triggers Editor lets you enable and disable a trigger, view and modify the CREATE TRIGGER statement that will implement changes, and manage dependencies.

To edit a trigger

1 Open an editor on the trigger. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Settings and tasks

Lets you set the Enabled property. It also lets you view the Trigger Timing (AFTER,

INSTEAD OF), Fire On Insert, Fire On Update, Fire On Delete, and Encrypted properties.

Lets you modify the CREATE TRIGGER body for a trigger. To modify a trigger, edit the text of the trigger body in the Trigger Text area. DBArtisan must drop then create the trigger.

For details on using this tab, see

Working with Object Dependencies .

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

48 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

U

NIQUE

K

EYS

E

DITOR

(SQL S

ERVER

)

The Unique Keys Editor lets you manage columns and properties for a unique key and view associated statistics.

To edit a unique key

1 Open an editor on the unique key. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Settings and tasks

Lets you manage columns that make up the unique key. On opening, this tab shows the existing columns. For each column, the listing displays the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Select a column and use the arrow buttons to reorder the columns in the index.

Lets you work with settings in the following categories:

Creation

In addition to displaying identifying information, you can modify the Build

Online and Max degree of parallelism properties. For details on these properties, see

Unique Key Wizard (SQL Server) .

Attributes

Clustered - Indicates whether the target index is clustered.

Ignore Duplicate Key - Indicates whether the target primary key ignores duplicate key values. If you select his option, the transaction that generated the duplicate key values can continue.

Statistics Recompute - Indicates that index statistics are automatically recomputed as the index is updated. Microsoft does not recommend this.

Storage

File Group - Lets you specify the filegroup on which to place the index.

This is for Microsoft SQL Server 7.0 or later.

Fill Factor - Lets you specify a percentage that indicates how full Microsoft

SQL Server should make the leaf level of each index page during index creation. When an index page fills up, Microsoft SQL Server must take time to split the index page to make room for new rows, which is quite expensive. For update-intensive tables, a properly chosen Fill factor value yields better update performance than an improper Fill factor value.

Pad Index - If you specified a Fill factor of more than 0 percent, and you selected the option to create a unique index, you can specify to use the same percentage you specified in Fill Factor as the space to leave open on each interior node. By default, Microsoft SQL Server sets a 2 row index size.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 481

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Statistics

Settings and tasks

Displays statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Pages Reserved, Used Pages, and Total Pages Modified.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index

Row, and Total Rows Modified Since Last.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS

E

DITOR

(SQL S

ERVER

)

The Users Editor lets you manage properties, assign roles, and manage object bindings for a user.

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Roles

Objects

Settings and tasks

Lets you view the Without Login, Login Name, Name, User Type, Certificate,

Asymmetric Key, and Default Schema properties.

Lets you assign roles to a user by selecting the check boxes associated with the roles to be assigned.

Lets you manage database objects (Defaults, Indexes, Procedures, Rules, Tables,

Triggers, User Datatypes, Views) associated with the user. Objects are organized in a tree structure with folders containing the objects. Optionally, take one of the following actions:

Select an object and click Edit to open an object editor on the selected object. For

information on each editor, use the links in Microsoft SQL Server Object Editors

.

Object Permissions and

System Permissions

DDL View

Select an object and click Drop to initiate dropping the selected object.

For details on using these tabs, see Working with Privileges and Permissions .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

48 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

U

SER

D

ATATYPES

E

DITOR

(SQL S

ERVER

)

The User Datatypes Editor lets you modify the base datatype, rule and default bindings, and referencing or referenced objects for a user datatype.

To edit a user datatype

1 Open an editor on the user datatype. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Usage

DDL View

Settings and tasks

In addition to letting you change the Schema, this tab lets you work with settings in the following categories:

Base Datatype

Lets you modify the Type and Allow Nulls properties. Depending on the Type selected, Precision, Scale, or Size properties are available as appropriate.

Bindings

Default Binding - Lets you select a default. For information on

creating defaults, see Default Wizard (SQL Server) .

Rule Binding - Lets you select a rule. For information on creating rules,

see Rule Wizard (SQL Server) .

Lets you manage database objects referencing or referenced by a user datatype. Objects are grouped within object type folders. Optionally, you can:

Select an object and click Edit to open an object editor on the selected object.

Select an object and click Drop to initiate dropping the selected object.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SER

M

ESSAGES

E

DITOR

(SQL S

ERVER

)

NOTE:

User Messages are only on the master database.

The User Messages Editor lets you view or modify basic properties of a user message. It also lets you add, edit, or delete individual language versions of the message.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 483

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a user message

1 Open an editor on the user message. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Information

DDL View

Settings and tasks

Lets you work with the following properties:

Message Number

Displays the message number chosen when the user message was created.

Severity

Lets you modify the SQL Server error severity level (001-025).

Write to NT Event Log

Lets you specify that the message is always written to the

Windows NT Event Log.

Displays the currently-defined language versions for this message number. Optionally you can:

Create a new language version for this message number. Click the Add new text for the

user message button, and in the dialog box that opens, select a Language and provide the Message Text.

Select a language version of the message and click the Modify user message text button. This opens a dialog that lets you modify the Language or Message Text.

Select a language version of the message and click the Remove user message text button.

NOTE: You cannot create two versions of a message for the same language.

NOTE: FOr a given message number there should always be a least one, us_english version of the message.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

V

IEWS

E

DITOR

(SQL S

ERVER

)

The Views Editor lets you view columns and change the schema of a view.

To edit a view

1 Open an editor on the view. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Settings and tasks

Displays a list of the columns that make up the view. Details include the column Name, its Datatype, and whether the definition allows Nulls.

This tab also lets you change the Schema owning the view.

Lets you view the SQL for the View.

48 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Dependencies

Permissions

Settings and tasks

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

M

Y

SQL

EDITORS

DBArtisan includes an Object Editor for all supported MySQL objects. To see an Editor for a specific object, click the corresponding link below:

Foreign Keys editor (MySQL)

Functions editor (MySQL)

Indexes, Primary Keys, and Unique Keys editors (MySQL)

Tables editor (MySQL)

Users editor (MySQL)

F

OREIGN

K

EYS EDITOR

(M

Y

SQL)

The Foreign Keys Editor lets you manage column mapping, delete, and update actions for a foreign key.

To edit a foreign key:

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mapping

Properties

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you modify the On Delete and On Update (NO ACTION, RESTRICT, CASCADE,

SET NULL) reference options.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 485

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

F

UNCTIONS EDITOR

(M

Y

SQL)

The MySQL Functions editor lets you view properties of a basic function declaration.

To edit a function:

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

DDL View

Settings and tasks

Lets you view the Function Name, Return Type, and Shared Object Library properties.

For details on these properties, see

Functions - Properties

.

Under Specify Columns in Index, you can change the selection of columns that make up the index, primary key, or unique key.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

I

NDEXES

, P

RIMARY

K

EYS

,

AND

U

NIQUE

K

EYS EDITORS

(M

Y

SQL)

These editors lets you manage columns and view properties of an index, primary key, or unique key.

To edit an index:

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

DDL View

Settings and tasks

Lets you view the Table Name, Index Name, Constraint Type, and Index Type

properties. For details on these properties, see Indexes, Primary Keys, or Unique Keys -

Properties

.

Under Specify Columns in Index, you can change the selection of columns that make up the index, primary key, or unique key.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

48 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

T

ABLES EDITOR

(M

Y

SQL)

The MySQL Tables editor lets you modify basic properties and view usage statistics for a MySQL table.

To edit a table:

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Settings and tasks

Displays the currently defined columns in the table. Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Properties

Select a column and click Delete to remove the column from the table.

Lets you work with the following settings: Table Name, Storage Type, Row Format, Default

Character Set, Default Collation, Auto Increment, Comment, Min Rows, Max Rows, Average

Row Length, Pack Keys, Checksum, and Delay Key Write. For details on these properties, see

Tables - Properties

.

Indexes

Foreign Keys

Lets you add, delete, or modify table indexes. For details on available options, see Tables -

Indexes

.

For INNODB tables, this tab lets you add, delete, or modify table foreign keys. For details on available options, see

Tables - Foreign Keys

.

MERGE tables

For MRG_MyISAM tables, this tab lets you work with the collection of identical MyISAM tables that are to be used as a single table. For more information, see

Tables - MERGE Tables .

Privileges

For details on using this tab, see

Working with Privileges and Permissions

.

Space

DDL View

Lets you view graphical and numerical table usage statistics. Values include Data Length, Index

Length, Data Free, Max Data Length, Rows, and Average Row Length.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS EDITOR

(M

Y

SQL)

The MySQL Functions editor lets you work with basic properties, host details, and privileges for a user.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 487

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a user:

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

User Information

User Hosts

Settings and tasks

Lets you view the User Name property and lets you modify the Full Name, Description,

Email, and Contact Information properties. For details on these properties, see Users wizard (MySQL)

.

Add a new host to the list by clicking the New button. Use the associated dropdown to select a valid host-name value (such as localhost or %), overwriting the text as necessary to provide a specific quoted identifier. Provide a password in the Password and Confirm fields and click Apply.

Remove a selected host from the list by clicking the Delete button.

For details on using these tabs, see Working with Privileges and Permissions .

Object Privileges and

System Privileges

DDL View

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

O

RACLE

O

BJECT

E

DITORS

DBArtisan includes an Object Editor for all supported Oracle objects. To see an Editor for a specific object, click the corresponding link below.

NOTE:

If an objects has dependent objects, such as tables, triggers, procedures and views, you can view and access their dependent objects in the editor.

Check Constraints Editor (Oracle)

Clusters Editor (Oracle)

Database Links Editor (Oracle)

Directories Editor (Oracle)

Disk Groups Editor (Oracle)

Foreign Keys Editor (Oracle)

Functions Editor (Oracle)

Groups Editor (Oracle)

Indexes Editor (Oracle)

Job Queue Editor (Oracle)

Libraries Editor (Oracle)

48 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Materialized Views Editor (Oracle)

Materialized View Logs Editor (Oracle)

Outlines Editor (Oracle)

Package Bodies Editor (Oracle)

Packages Editor (Oracle)

Primary Keys Editor (Oracle)

Procedures Editor (Oracle)

Profiles Editor (Oracle)

Redo Log Groups Editor (Oracle)

Roles Editor (Oracle)

Rollback Segments Editor (Oracle)

Sequences Editor (Oracle)

Synonyms Editor (Oracle)

Tables Editor (Oracle)

Tablespaces Editor (Oracle)

Triggers Editor (Oracle)

Type Bodies Editor (Oracle)

Types Editor (Oracle)

Unique Keys Editor (Oracle)

Users Editor (Oracle)

Views Editor (Oracle)

C

HECK

C

ONSTRAINTS

E

DITOR

(O

RACLE

)

The Check Constraints Editor lets you modify and enable/disable check constraints.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 489

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a check constraint

1 Open an editor on the check constraint. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Use the Enabled control to enable/disable the check constraint.

You can also edit the condition in the Check Condition box. The Table Columns button acts a time saver in editing the condition. It opens a dialog that lets you select and paste column names into the check condition expression.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

LUSTERS

E

DITOR

(O

RACLE

)

The Clusters Editor lets you manage cluster column and table details, view and modify storage and space parameters, and manage performance settings for a cluster.

To edit a cluster

1 Open an editor on the cluster. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Settings and tasks

Use the controls in the General Properties group to specify a hash or index Cluster Type and to specify a Key Size for the cluster.

If you specify a hash cluster type, use the controls in the Hash Specifications group to specify the number of hash keys and to specify use of either the default hash function or a specified expression used as the hash function.

49 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Storage

Performance

Space

Tables

Settings and tasks

Lets you manage storage for a cluster:

Data Block

Storage

Each transaction that updates a data block requires a transaction entry.

Percent Free - minimum percentage of free space in a block

Percent Used - minimum percentage of used space in a block.

Initial transactions - The initial parameter ensures that a minimum number of concurrent transactions can update a data block, avoiding the overhead of allocating a transaction entry dynamically.

Maximum transactions - The maximum parameter limits concurrency on a data block.

Extents The unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Minimum Extents - The appropriate minimum extents value for the object.

Maximum Extents - The appropriate maximum extents value for the object.

Percent Increase - Magnifies how an object grows and, can materially affect available free space in a tablespace. Select a value in the corresponding box.

Optionally, you can modify the Percent Free, Percent Used, or Max Transactions values.

Lets you modify the following performance settings:

Parallel Query

Option group

Lets you specify Degrees and Instances settings for processing queries using many query server processes running against multiple CPUs, which provides substantial performance gains such as reduction of the query completion time.

Cache group The Cache setting keeps the blocks in memory by placing it at the most recently used end. This option is useful for small lookup tables.

Lets you view the following usage and the space distribution details:

Space

Utilization group

Displays the percent of space reserved for future updates.

FreeLists group Displays the allocation of data blocks when concurrent processes are issued against the cluster. Identifying multiple freelists can reduce contention for freelists when concurrent inserts take place and potentially improve the performance of the cluster.

Extents group The unit of space allocated to an object whenever the object needs more space.

Lets you view details for each cluster column. Details for each column include the key column in the cluster, the clustered table name, and the key column in the table.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 491

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

D

ATABASE

L

INKS

E

DITOR

(O

RACLE

)

The Database Links Editor lets you view connection string information for a database link.

To edit a database link

1 Open an editor on the database link. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL

Settings and tasks

Displays connection string information for a database link. Details include the Public setting, the User name and Password associated with the database link, and a Connect

String.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

IRECTORIES

E

DITOR

(O

RACLE

)

The Directories Editor lets you change the path for a directory and modify associated privileges.

To edit a directory object

1 Open an editor on the directory. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Privileges

Settings and tasks

Lets you view or modify the SQL code for the directory.

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

49 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

D

ISK

G

ROUPS

E

DITOR

(O

RACLE

)

This editor lets you work with basic properties, individual disks, and attribute templates for an existing disk group. It also lets you work at the individual file and alias level as well as view current operations executing against the disk group.

NOTE:

This functionality is available for Oracle 10 g.

NOTE:

When opening the editor, if this is the first time you have initiated a disk group action since connecting, you are prompted to choose between a connection to the ASM instance or to continue using the default datasource connection. For details on the implications, see

Manage ASM Connection

.

NOTE:

If you do not have a connection to the ASM instance, you van view but cannot modify property values in the Disk Groups Editor.

To edit a disk group:

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 In the right-hand pane, right-click a disk group and select Edit from the context menu.

3 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Later versions of Oracle offer different properties for this object type:

10G

11GR1

This tab lets you view the Name, Redundancy Level, and Group State values you chose on creating the disk group. For details on these

properties, see Disk Groups (Oracle) - Properties

. A Group Number for the disk group is also displayed.

The General group displays properties corresponding to disk group attributes or information available from V$ASM views: Block Size, Total

MB, Free MB, Required Mirror Free MB, Usable File MB, Offline Disks, and Is Unbalanced.

The Attributes group displays Allocation Unit Size, Compatibility,

Database Compatibility, and Sector Size properties.

As of Oracle 11GR1, the Compatibility and Database Compatibility, properties can be modified. For details on these properties, see

Disk

Groups (Oracle) - Properties

.

A Disk Repair Time property can also be modified.

11GR2 The File Access Control Enabled and Access Control Unmask properties let you add ACCESS_CONTROL.ENABLED (whether Oracle ASM File

Access Control is enabled for the disk group) or

ACCESS_CONTROL.UMASK

(a three-digit number that masks out permissions) attributes. Consult Oracle documentation for details on these attributes.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 493

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Disks

Volumes (available as of

Oracle 11GR2)

Templates

Files (disabled unless you have a direct connection to the ASM instance)

This tab lets you maintain the list of named attributes applied to disks in this disk group.

Note that System Templates are automatically created for the disk group when the group is created.

For details on template attributes and information on adding, editing, and deleting templates, see

Disk Groups (Oracle) - Templates

.

The Directories list is a representation of the ASM virtual folder. On creation, the list is populated with the system directory hierarchy dictated by the ASM fully qualified file name convention. Use the associated buttons to create new directories, delete usercreated directories, or modify the directory name or base directory of a user-created directory.

The Files and Aliases list contains files generated automatically as part of database operations (including tablespace creation) and user-created aliases. Selecting a file or alias from the list displays its attributes in the Property/Value list on the right. Use the associated buttons to create an alias to a selected file, delete files or aliases, or modify the name or base directory of a user-created alias.

Displays any commands currently running on the ASM instance.

Operations (disabled unless you have a direct connection to the ASM instance)

Settings and tasks

The Path list on this tab lets you view the disks currently assigned to this disk group. With a Path list disk selected, the Property/Value list displays attributes for that disk. The

Creation category shows disk creation and mount date details as well as the setting you chose when adding this disk. For details on these properties, see

Disk Groups (Oracle) -

Disks

.

The Property/Value list differs by version

10G

The General, Status, Size, and Statistics categories display information returned from the LSATTR, LSDSK, and LSDG commands

(V$ASM_ATTRIBUTE, V$ASM_DISKGROUP_STAT, V$ASM_DISKGROUP,

V$ASM_DISK_STAT, and V$ASM_DISK views) as follows:

General - Compound Index, Incarnation, Redundancy, Library, Label,

UdID, and Product.

Status - Mount Status, Header Status, and Mode Status.

Size - Free MB.

Statistics - Repair Timer, Reads, Writes, Read Errors, Write Errors, Read

Time, Write Time, Bytes Read, and Bytes Written.

11GR1

11GR2

The key differences for the 11gR1 release are the Mode Status, Online

Wait, and Offline Timeout controls.

Mode Status - Lets you bring a single disk ONLINE or OFFLINE.

Online Wait - Enabled when bring a disk ONLINE, lets you select WAIT or

NOWAIT.

Offline Timeout - Enabled when taking a disk offline, lets you specify the amount of time after which the disk will be dropped after the status changes to OFFLINE.

A Type property with REGULAR and QUORUM values is available.

Lets you manage (add, edit, delete) volumes associated with the disk group.

49 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Users and Groups

(available as of Oracle

11GR2)

Settings and tasks

These tabs apply only to Oracle 11GR2 datasources installed on Linux/Unix computers.

Permissions/ownership are also dependent on the File Access Control Enabled and

Access Control Unmask values on the Properties tab.

These tabs lets you manage the File Access Control users and user groups.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

4 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

OREIGN

K

EYS

E

DITOR

(O

RACLE

)

The Foreign Keys Editor lets you enable a foreign key, manage its column mappings, and specify a delete rule.

To edit a foreign key

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mapping

Properties

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you set the foreign key as Enabled and specify a Delete Rule of CASCADE or NO

ACTION.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

UNCTIONS

E

DITOR

(O

RACLE

)

The Functions Editor lets you modify basic properties and modify the CREATE/REPLACE DDL for a function.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 495

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a function

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Permissions

Settings and tasks

Lets you view properties in the following categories:

Properties

Lets you view Status and Last Modified details for the function

Size Information

Lets you view Source SIze, Parsed Size, Code Size, and

Error Size for the function

Lets you modify the CREATE OR REPLACE FUNCTION DDL for the function.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

G

ROUPS

E

DITOR

(O

RACLE

)

The Groups Editor lets you modify privileges for a group.

To edit a group

1 Open an editor on the group. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Object Privileges and

System Privileges

DDL View

Settings and tasks

For details on using these tabs, see Working with Privileges and Permissions .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

I

NDEXES

E

DITOR

(O

RACLE

)

The Indexes Editor lets you manage columns, basic properties, storage, space, and partitioning for an index.

49 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit an index

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Storage

Space

Settings and tasks

Displays a listing of the columns making up the index. Optionally, you can:

Use the Sort column check box to specify a sort option.

Click the New button to add a new column to the index.

Select an existing column and click the Delete button to delete that column from the index.

Lets you work with settings in the following categories:

Attributes

Lets you view IsValid and Function-Based properties. Lets you set Index Type

(UNIQUE, NONUNIQUE, BITMAP), No Sort, Logging, Reverse, and Invisible properties.

Parallel Query

Option

Lets you view the No Parallel Execution property. Lets you set the Parallel

Degree and Parallel Instances values.

Lets you work with settings in the following categories:

Data Block

Storage

Extents

Lets you choose the Tablespace, and specify Percent Free, Initial

Transactions, and Max Transactions values.

Lets you specify Initial Extent, Next Extent, Minimum Extents, Maximum

Extents, and Percent Increase values.

Freelists

Buffer Pool

Lets you specify Freelists and Freelist Groups values.

Lets you specify a buffer pool.

Lets you view settings in the following categories:

Space

Utilization

Lets you view the Size and number of Blocks settings.

Statistics

Lets you view Index Level, Distinct Keys, Cluster Factor, Leaf Blocks, Leaf

Blks/Key and Data Blks/Key properties.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 497

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Partition

Settings and tasks

If the index is not currently partitioned, you can click the Convert To Partitioned button to partition the index. For more information, see

Partitioning Oracle indexes, primary keys, and unique keys .

If the index is currently partitioned, this tab displays the following partition details:

Properties

Lets you view the Locality (Global/Local), Alignment (Prefixed/Non-Prefixed),

Partition Type (RANGE or HASH), and Subpartition type properties.

Click the Edit Partition button to edit partition details. or more information, see

Partitioning Oracle indexes, primary keys, and unique keys

.

Click the Drop Partition button to revert to an unpartitioned index.

Use the following Partition Commands menu items:

Allocate Extent

Analyze

Coalesce

Deallocate Unused Space

Mark Unusable - opens a dialog that lets you select one or more partitions/ subpartitions to be marked as unusable.

Rebuild - opens a dialog that lets you select one or more unusable subpartitions to be rebuilt.

Split - opens a dialog that lets you divide a single partition into two partitions.

You can split partitions if a single partition is causing maintenance problems because it is too large.

NOTES:

If you are preparing to drop or rebuild an index, mark local indexes as unusable.

If you want to make unusable indexes valid or to recover space and improve performance, rebuild the unusable indexes.

You cannot split a local index partition defined on a hash or composite table.

Make sure that you specify an upper bound for the column that is lower than the upper bound for that column in the original partition.

Displays partitioning columns.

Columns

Partition

Definitions

Displays the list of partition definitions. For each partition definition, listing shows the partition definition Value, the associated Tablespace, and whether the index is

Usable or has been marked as Unusable by Oracle. Use the Partition Commands menu Mark Unusable or Rebuild commands to change the current Usable value.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

J

OB

Q

UEUE

E

DITOR

(O

RACLE

)

The Job Queue lets you modify the job's definition (code) and manage the schedule and status for a job.

49 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a job queue

1 Open an editor on the job queue. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Properties

DDL

Settings and tasks

Lets you modify the statement, function call, or procedure call in the Job Definition area.

Use the settings in the Schedule group to specify that the job is to run once only or is to run according to a schedule. If it is to run on a schedule, specify the interval in days or using a custom date expression.

Use the settings in the Status group to Enable or Disable the job.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

L

IBRARIES

E

DITOR

(O

RACLE

)

The Libraries Editor lets you view and modify library definitions and manage dependencies and privileges for the library.

To edit a library

1 Open an editor on the library. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Dependencies

Privileges

DDL View

Settings and tasks

The Definition tab of the Libraries Editor lets you modify the file name and path for a library and view the current status and whether the library is dynamic.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

M

ATERIALIZED

V

IEWS

E

DITOR

(O

RACLE

)

The Materialized Views Editor lets you view and modify materialized view information and partitions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 499

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a materialized view

1 Open an editor on the materialized view. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Information

Storage

Performance

Query

Partitions

Settings and tasks

Lets you work with properties in the following categories:

Master

Lets you work with the Table Name and Master View properties.

Last Refresh

Refresh

Configuration

Lets you work with the Last Date and Errors properties.

Lets you work with the Type, Refresh Method, and Mode properties.

Rollback Usage Lets you work with the Local and Master properties.

Options

Lets you work with the Updatable and Enable Query Rewrite properties.

Lets you work with properties in the following categories:

Placement

Data Block

Storage

Extents

Lets you work with Tablespace and Cluster values.

Lets you work with Percent Free, Percent Used, Initial transactions, and

Maximum transactions values.

Lets you work with Initial Extent, Next Extent, Minimum Extents, Maximum

Extents, and Percent Increase values.

Lets you work with settings in the following categories:

Parallel Query

Option

Logging

The Parallel server query option lets you process queries using many query server processes running against multiple CPUs. This option provides substantial performance gains such as reduction of the query completion time.

Degrees - Lets you type a value indicating the number of query server processes that should be used in the operation.

Instances - Lets you type a value indicating how you want the parallel query partitioned between the Parallel Servers.

Select Logging to create a log for all Materialized View updates.

Cache

Select Cache if you want Oracle to put data you access frequently at the most recently used end of the list in the buffer cache when a full table scan is performed. This option is useful for small lookup tables.

Displays the associated query.

Partitioning

Method

Row

Movement

Displays the partitioning method, including Range-Hash Composite or Range-

List Composite.

Hash partitions partition the table according to a hash function. Composite partitions use both range and hash types, first partitioning the data by a range of values, and then further dividing the partitions into subpartitions by way of a hash function.

List partitioning lets you control how rows map to partitions.

You can specify a list of discrete values for the partitioning column in the description for each partition.

If its key is updated, migrates the row to a new partition.

50 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Dependencies

Privileges

DDL View

Settings and tasks

Partitioning

Columns

Displays partitioning columns.

Subpartitionin g Columns

Partitions

Displays subpartitioning columns.

Subpartition

Template

Click Add or Edit to open the Partition dialog box.

Click Drop to drop a partition.

If the partitioning type is Range-Hash Composite, displays a list of subpartitions in the subpartition template.

Click Add, Insert, or Edit to open the Subpartition dialog box.

Click Drop to drop a subpartition.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

M

ATERIALIZED

V

IEW

L

OGS

E

DITOR

(O

RACLE

)

The Materialized View Logs Editor lets you view replication log table details, and manage space, storage, and performance details for a materialized view log.

To edit a materialized view log

1 Open an editor on the materialized view log. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Information

Storage

Settings and tasks

Displays information on the log table used for replication.

Lets you work with settings in the following categories:

Data Block Storage

Lets you view the associated Tablespace and Initial

Transactions value, and modify the Percent Free, Percent

Used, and Max Transactions values.

Extents

Column Filtering

Lets you view Initial Extent, Next Extent, Minimum Extents,

Maximum Extents, and Percent Increase values.

Lets you select the filter columns to be recorded in the materialized view log. You can specify only one primary key, one ROWID and one filter column list per materialized view log.

The ROWID is a globally unique identifier for a row in a database. It is created at the time the row is inserted into a table, and destroyed when it is removed from a table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 501

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Performance

Dependencies

DDL View

Settings and tasks

Lets you work with settings in the following categories:

Parallel Query Option

The Parallel server query option lets you process queries using many query server processes running against multiple

CPUs. This option provides substantial performance gains such as reduction of the query completion time.

Degrees - Lets you type a value indicating the number of query server processes that should be used in the operation.

Instances - Lets you type a value indicating how you want the parallel query partitioned between the Parallel Servers.

Logging

Cache

Select Logging to create a log for all Materialized View updates.

Select Cache if you want Oracle to put data you access frequently at the most recently used end of the list in the buffer cache when a full table scan is performed. This option is useful for small lookup tables.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

O

UTLINES

E

DITOR

(O

RACLE

)

The Outlines Editor lets you view information on an outline, and modify its category and associated SQL statement.

NOTE:

The only SQL statements possible with stored outlines are SELECT, DELETE, UPDATE,

INSERT…SELECT, and CREATE TABLE…AS SELECT.

To edit an outline

1 Open an editor on the outline. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

DDL View

Settings and tasks

In addition to displaying basic creation and identification properties, this tab lets you select a new Category for the outline.

Lets you view and modify the SQL Statement associated with the outline.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

50 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

P

ACKAGE

B

ODIES

E

DITOR

(O

RACLE

)

While listed as separate objects in the Datasource Explorer, package bodies are created and edited on the Body tab of the Packages Editor. For details, see

Packages Editor (Oracle) .

P

ACKAGES

E

DITOR

(O

RACLE

)

The Packages Editor lets you view and modify header and body specifications of a package.

To edit package

1 Open an editor on the package. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Header

Body

Information

Dependencies

Permissions

Settings and tasks

Lets you modify the package header specifications.

Lets you modify the package body specifications.

Lets you work with status and size properties in the following categories:

Header and Body Lets you view Status, Created, and Last Modified Source

SIze, Parsed Size, Code Size, and Error Size details for the header and body of the package.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

RIMARY

K

EYS

E

DITOR

(O

RACLE

)

The Primary Keys Editor lets you manage columns, basic properties, storage and space, and partitions for a primary key.

To edit primary key

1 Open an editor on the primary key. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Settings and tasks

Displays a listing of the columns making up the primary key. Optionally, you can:

Click the New button to add a new column to the index.

Select an existing column and click the Delete button to delete that column from the index.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 503

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Properties

Storage

Space

Partition

Settings and tasks

Lets you work with settings in the following categories:

Enforcing

Index

Lets you view User Defined, Index Owner, and Index Name properties.

Attributes

Lets you work with No Sort (only available if Enabled is set), Logging (YES, NO, or

NONE), Reverse (disabled if No Sort is enabled), Validate, Deferrable, Deferred

(IMMEDIATE or DEFERRED and only enabled if Deferrable is enabled), Enabled,

Cascade (disabled if Enabled is set), Rely and Update Date properties.

Lets you work with settings in the following categories:

Data Block

Storage

Lets you specify Tablespace, Percent Free, Initial Transactions, and Max

Transactions values.

NOTE: You should never place primary keys on the SYSTEM tablespace.

Extents

Displays Initial Extent, Next Extent, Percent Increase, Minimum Extents and

Maximum Extents values.

Freelists

Buffer

Pool

Lets you specify Freelists and Freelist Groups values.

Lets you specify a buffer pool.

Lets you work with settings in the following categories:

Lets you view Size and Blocks properties.

Space

Utilization

Statistics

Lets you view Index Level, Distinct Keys, Cluster Factor, Leaf Blocks, Leaf Blks/

Key, and Data Blks/Key properties.

If the primary key is currently partitioned, this tab displays the following partition details:

Properties

Lets you view the Locality (Global/Local), Alignment (Prefixed/Non-Prefixed),

Partition Type (RANGE or HASH), and Subpartition type properties.

Click the Edit Partition button to edit partition details. or more information, see

Partitioning Oracle indexes, primary keys, and unique keys

.

Click the Drop Partition button to revert to an unpartitioned primary key.

Columns

Partition

Definitions

Use the following Partition Commands menu items:

Allocate Extent

Analyze

Coalesce

Deallocate Unused Space

Mark Unusable - opens a dialog that lets you select one or more partitions to be marked as unusable.

Rebuild - opens a dialog that lets you select a partition to be rebuilt.

Split - opens a dialog that lets you divide a single partition into two partitions. You can split partitions if a single partition is causing maintenance problems because it is too large.

Displays partitioning columns.

Displays details for each partition.

If the primary key is not currently partitioned, you can click the Convert To Partitioned button to partition the primary key. For more information, see

Partitioning Oracle indexes, primary keys, and unique keys .

50 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

DDL View

Settings and tasks

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ROCEDURES

E

DITOR

(O

RACLE

)

The Procedures Editor lets you view and modify the SQL code and properties of a procedure.

To edit a procedure

1 Open an editor on the procedure. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Permissions

Settings and tasks

Lets you work with properties in the following categories:

Properties

Lets you view Status, and Last Modified properties.

Size Information

Lets you view Source Size, Parsed Size, Code Size, and

Error Size

Lets you modify the SQL code for a procedure.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ROFILES

E

DITOR

(O

RACLE

)

The Profiles Editor lets you manage limits and manage user assignments for the profile.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 505

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a profile

1 Open an editor on the profile. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Resources

Users

DDL

Settings and tasks

Lets you work with settings in the following categories:

General Limits

Lets you specify Composite Limit and Private SGA settings.

Session Limits

Time Limits

Lets you specify the limit on the amount of private space a session can allocate in the shared pool of the SGA. Specific settings are Sessions Per User, CPU Per Session, Logical

Reads.

Lets you specify the limit on total connection time per session. Specific settings are Connect Time and Idle Time.

Call Limits

Login Limits

Password Limits

Lets you specify the CPU time limit for a call (a parse, execute, or fetch), expressed in hundredths of seconds. Specific settings are CPU Per Call and Logical Reads.

Lets you specify the number of Failed Login Attempts on the user account before the account is locked and the Account

Lock Time.

Lets you specify the Lifetime, Reuse Time, Reuse Max,

Grace Period and a Verify Function for passwords.

Use the Assign button to open a dialog that lets you assign a user to this profile or select a user from the list, and click the Unassign button to open a dialog prompting you to confirm that the user is to be unassigned.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

EDO

L

OG

G

ROUPS

E

DITOR

(O

RACLE

)

The Redo Log Groups Editor lets you manage the members in a redo log group.

To edit a redo log group

1 Open an editor on the redo log group. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Redo Log Members

DDL View

Settings and tasks

Lets you add new members to the redo log group, edit existing members, and delete members from the redo log group.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

50 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

OLES

E

DITOR

(O

RACLE

)

The Roles Editor lets you manage authentication and grant/revoke profiles for users and logins.

To edit a role

1 Open an editor on the role. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Authentication

User/Roles

Settings and tasks

Lets you manage role identity. When creating a role, you must establish certain rules governing its use. You can specify whether or not a role must be identified when used.

If you require role identification, you can authenticate the user externally through the operating system, or with a specific password.

If you specified that the role requires identification, provide a Password and specify whether the role is to be authenticated Globally or Externally.

Displays permissions for this role to logins or users. Click Grant to open a dialog that lets you grant this role to a login or another role. Select a role or login and click Revoke to revoke the role or login.

For details on using this tab, see

Working with Privileges and Permissions

.

Object Privileges and

System Privileges

DDL View

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

R

OLLBACK

S

EGMENTS

E

DITOR

(O

RACLE

)

The Rollback Segments Editor lets you view rollback segment status, manage rollback segment storage, and view activity levels.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 507

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a rollback segment

1 Open an editor on the rollback segment. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Status

Storage

Activity

DDL

Settings and tasks

Lets you enable and disable a rollback segment and displays status details for the rollback segment. The tab displays whether the rollback segment is online or offline and provides the associated Tablespace, Size, and No. of Extents.

Lets you work with settings in the following categories:

Extents

The unit of space allocated to an object whenever the object needs more space.

Initial Extent - The initial space extent (in bytes) allocated to the object.

Next Extent - The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

Optimal Size - optimal extent size

Minimum Extents - The appropriate minimum extents value for the object.

Maximum Extents - The appropriate maximum extents value for the object.

Displays extent details.

Extent Detail

Lets you work with settings in the following categories:

Activity Levels

Displays Active Transactions, Writes, Gets and Waits values.

Dynamic Sizing

Displays High Watermark, Extends, Shrinks, and Wraps values.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

EQUENCES

E

DITOR

(O

RACLE

)

The Sequences Editor lets you manage parameters for a sequence, manage database objects dependent on the sequence, and manage privileges for the sequence.

50 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a sequence

1 Open an editor on the sequence. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Settings and tasks

Lets you work with settings in the following categories:

Parameters

Lets you specify increment, minimum value and maximum value settings.

Current/Next

Sequence Numbers

Lets you work with sequence cycle numbers.

Options

Lets you specify Cache Size, Cycle When Reach Max/Min, and Generate

Numbers in Order (useful when you are using the sequence number as a timestamp) values.

Dependencies

For details on using this tab, see

Working with Object Dependencies .

Privileges

DDL

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

S

YNONYMS

E

DITOR

(O

RACLE

)

The Synonyms Editor lets you view base object information and manage database objects dependent on a synonym.

To edit a synonym

1 Open an editor on the synonym. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Displays the type, owner, name, and other details of the object referenced by the synonym.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 509

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

T

ABLES

E

DITOR

(O

RACLE

)

The Tables Editor lets you manage columns, constraints, storage and space, and partitions for a table.

To edit a table

1 Open an editor on the table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Settings and tasks

Displays the currently defined columns in the table. For any selected column, the Property/

Value list provides additional detail on that column. Available properties depend on the datatype you choose as well as on the property values you select:

Virtual - indicates whether this column is defined as an Oracle virtual column. If selected, the value is provided by the calculation in the Default Value box.

Datatype properties- Lets you select a type and depending on your selection, additional properties such as Scale, Width, and Unused may be available.

Allow Nulls - Select this check box to allow nulls in this column.

Encryption properties include Password, Salted, and EncryptionAlgorithm.

Default Value - If Virtual is selected, this box lets you specify a valid Oracle column expression. Otherwise, it can contain a pseudocolumn (CURRENT_TIMESTAMP, USER,

SYSDATE, or UID) or an expression.

lets you choose among CURRENT_TIMESTAMP, USER, SYSDATE, and UID.

Comment lets you add a comment to the column.

LOB Storage settings are available for bfile, blob, clob, and nclob types. They include

Segment Name, Configuration properties (Tablespace, Chunk, Percent Version, Enable

Storage In Row, Cache, and Logging), and Storage properties (Initial Extent, Next Extent,

Percent Increase, Minimum Extents, Maximum Extents, Free Lists, and Free List Groups).

Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Select a column and click Delete to remove the column from the table.

Lets you work with settings in the following categories:

Table Lets you work with the following properties, corresponding to CREATE

TABLE clauses: Cache, Row Movement, Parallel Degree, and Parallel

Instances.

Physical Lets you view the Row Organization property. Lets you set the Logging and

Table Compression properties.

51 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Indexes

Constraints

Storage

IOT Properties

Space

LOB columns

Partition

Settings and tasks

Lets you manage indexes for a table. On opening, the list of current indexes for the table is displayed. Optionally, take one of the following actions:

Click Add to open a dialog that lets you add a new index to the table.

Select an index and click Edit to open a dialog that lets you edit index properties.

Select an index and click Drop to open a dialog that lets you remove the index from the table.

Lets you manage constraints for the table. Constraints are grouped by type, under folders.

Optionally take one of the following actions:

Select a constraint type folder and click Add to open a dialog that lets you add a constraint of that type.

Select a constraint and click Edit to open a dialog that lets you modify the constraint details.

Select a constraint and click Drop to remove the constraint.

Lets you work with settings in the following categories:

Data Block

Storage

Extents

Lets you choose the Tablespace Name, and specify Percent Free, Initial

Transactions, and Max Transactions values.

Lets you view Initial Extent, Next Extent, Minimum Extents, Maximum

Extents, and Percent Increase values.

Freelists

Bufferpool

Lets you specify Freelists and Freelist Groups values.

Lets you specify a Buffer Pool.

Lets you work with settings in the following categories:

Ungrouped Lets you specify an overflow segment.

Percent

Threshold

Key

Compression

Lets you specify the percentage of space reserved for an index-organized table.

Lets you enable or disable compression and provide a compression value.

Lets you work with settings in the following categories:

Space

Utilization

Lets you view Size and number of Blocks.

Row

Information

Extents

Lets you view the Number of Rows, Average Row Length, and Chain Rows properties.

Let you view the Number of Extents and Maximum Extents values.

Lets you work with settings in the following categories:

LOB Column

Segment and

LOB Column

Index

Lets you view the Segment Name, No. of Extents, Max Extents, Size, and

Blocks properties.

Segment

Extents and

Index

Extents

Lets you view the Extent ID, File ID, Block ID and number of Blocks properties for segment and index extents.

Lets you work with table partitions

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 511

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Comment

Dependencies

Permissions

DDL View

Settings and tasks

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

ABLESPACES

E

DITOR

(O

RACLE

)

The Tablespaces Editor lets you manage datafiles, space, storage, quotas, and objects for a tablespace.

To edit a tablespace

1 Open an editor on the tablespace. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Datafiles

Properties

Settings and tasks

The tab lists details for each datafile on the tablespace. Optionally you can add or delete files or

edit file attributes. For detailed information on using this tab, see Tablespaces (Oracle) - Datafiles .

This tab lets you view the Name, Big File, Type, Encrypted, Locally Managed, Minimum Extent

Size, Uniform Allocation, Use Default Block Size, Block Size, Automatic Segment Space

Management, Initial Extent, Next Extent, Minimum Extents, Maximum Extents, and Percent

Increase properties. This tab lets you modify the Status, Logging, Force Logging, and

Compression Type properties. For more information on these properties, see Tablespaces

(Oracle) - Properties .

Extent Details

Provides details (Name, Type, File ID, Extent ID, Block ID, Blocks, and Bytes) for each extent in the tablespace.

Space

Displays free blocks versus used blocks statistics for the tablespace, including a pie chart representation.

51 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Map

Objects

Quotas

Settings and tasks

This tab presents a graphical, segment map of the tablespace. The map is color-coded to show usage of each segment (FREE, SELECTED, OTHER, TEMPORARY, ROLLBACK, CACHE, TABLE,

INDEX, TABLE PARTITION, NESTED TABLE, INDEX PARTITION, INDEX SUBPARTITION, TEXT,

CLUSTER, LOB, LOBSEGMENT, LOBINDEX, or LOB PARTITION).

Optionally you can:

Click Legend to view the color legend of the map.

Hover the mouse over a segment to display its Segment ID, Block ID, Size (kb), Size (in blocks), Tablespace File ID, and Segment Type details.

Click Display to open a window that aids in navigating the graphical segment map. The

Overview window displays a smaller version of the segment map. The selected area can be dragged up and down the window, displaying the selected area in the larger, main map. The selected area can also be resized, to display a larger or smaller area in the main map.

Select an INDEX or TABLE segment on the map and click Reorganize to initiate a Rebuild

Indexes or Reorganize (respectively) action. For details, see

Rebuild Index

and

Reorganize /

Reorg

.

The Object Demographics area provides a tabular representation of the tablespace map. It provides details on a segment-by-segment basis.

For background information, see About Oracle Tablespace Storage .

Displays the objects currently stored on the tablespace, grouped under object type folders.

Optionally you can:

Specify a logging option using the Log Changes When Scheme/Data is Modified? radio set.

Select an object under one of the object folders and click Edit to open an object editor on that object.

Oracle limits the amount of space that can be allocated for storage of a user's objects within the specified tablespace to the amount of the quota. Users with privileges to create certain types of objects can create those objects in the specified tablespace.

The Quotas tab of the Tablespace editor lets you manage user space quotas for tablespaces on the current datasource. Optionally, you can:

Click Add or select a user and click Edit to assign a user unlimited or a specific space usage quota on the tablespace. For details, see Adding or Editing User Tablespace Quotas .

Select an existing user and click Drop to delete the quota for that user

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

A

DDING OR

E

DITING

U

SER

T

ABLESPACE

Q

UOTAS

When you assign a quota:

• Users with privileges to create certain types of objects can create those objects in the specified tablespace.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 513

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

• Oracle limits the amount of space that can be allocated for storage of a user's objects within the specified tablespace to the amount of the quota.

NOTE:

This functionality is available for Oracle only.

User tablespace quotas are added and modified from the Tablespaces editor. For more

information, see Tablespaces Editor (Oracle) .

The table below describes the options and functionality on the Add User Quota... or Edit User

Quota... dialog boxes:

Option

User selection

list (Add only)

Quota

Description

Lets you select one or more users to assign a quota.

Lets you set a quota for the selected user or users. You can select an unlimited, or a specified size.

Unlimited - Lets you place an unlimited quota on the tablespace.

Other - Lets you place a specified quota in KB or MB on the tablespace.

A

BOUT

O

RACLE

T

ABLESPACE

S

TORAGE

The Storage tab of the Tablespace Editor lets you view storage details for tablespaces on the current datasource.

TIP:

Always create tablespaces for user data and never place user tables and indexes in the

SYSTEM tablespace. Placing user objects in the SYSTEM tablespace can degrade performance and introduce space-related headaches to the database.

Oracle8i or later supports locally managed tablespaces, which can all but eliminate the problem of tablespace fragmentation. It totally does away with the storage parameters of MINEXTENTS,

MAXEXENTS, PCTINCREASE, and NEXT. With locally managed tablespaces you either specify the initial extent size and let Oracle automatically size all other extents, or specify a uniform extent size for everything.

For users using a version earlier than Oracle 8i and locally managed tablespaces, there are manual methods can employ to assist in the fight against tablespace fragmentation. They include:

• Setting PCTINCREASE to zero for all tablespaces and objects to promote same-sized extents.

• Specifying equal-sized allotments for your INITIAL and NEXT object storage parameters.

• Grouping objects with like growth and storage needs together in their own tablespaces.

TIP:

One of the best ways to avoid fragmentation in a tablespace is to pre-allocate the space that your objects will use. If possible, plan for one to two years' growth for each object and allocate your space accordingly. Having initial empty objects will not affect table scan times as Oracle only scans up to the high-water mark (the last used block) in a table.

51 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Of all your tablespaces, you want to avoid fragmentation problems in your SYSTEM tablespace the most as this is the major hotbed tablespace for Oracle activities. The easiest way to avoid this is to not allow any user (even the default DBA ID's SYS and SYSTEM) to have access to it.

There are three ways to do this:

• Ensure no user has a DEFAULT or TEMPORARY tablespace assignment of SYSTEM.

• Ensure no user has a quota set for SYSTEM.

Ensure no user has been granted the UNLIMITED TABLESPACE privilege.

T

RIGGERS

E

DITOR

(O

RACLE

)

The Triggers Editor lets you modify actions, events, and other details for a trigger.

To edit a trigger

1 Open an editor on the trigger. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Events

Column Selection

Action

Dependencies

DDL View

Settings and tasks

In addition to displaying basic identification and creation properties, this tab lets you work with settings in the following categories:

Attributes

Lets you specify whether the trigger is Enabled, select the

Trigger Timing (BEFORE, AFTER), and the Trigger Type

(ROW, STATEMENT).

Correlation Names

Status

Lets you provide an Old Table Alias and a New Table Alias as well as construct a When Clause.

Lets you view Object Status, Create Date, Last Modified, and Base Object Type properties.

Size Information

Lets you view Source Size, Parsed Size, Code Size, and

Error Size properties.

Lets you select the INSERT, UPDATE, or DELETE event for the trigger.

Lets you select the associated columns.

Lets you modify the trigger action PL/SQL block for any trigger on the datasource. You modify the body of the trigger in the Trigger Action (PL/SQL Block) area.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 515

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

T

YPE

B

ODIES

E

DITOR

(O

RACLE

)

The Type Bodies Editor contains the code for the methods that implement an object type. To create or replace a type body in one of your schema, you must have the CREATE TYPE or

CREATE ANY TYPE system privilege. To replace a type in another user’s schema, you must have the DROP ANY TYPE system privilege.

While listed as separate objects in the Datasource Explorer, type bodies are created and edited

on the Body tab of the Types Editor. For details, see Types Editor (Oracle)

.

T

YPES

E

DITOR

(O

RACLE

)

The Types Editor lets you manage header text and body text for a type.

To edit a type

1 Open an editor on the type. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Header

Body

Information

Dependencies

Privileges

Settings and tasks

Lets you manage the type header text.

Lets you create and modify type body text for the type. For information on creating type

bodies, see Object Type Wizard (Oracle)

.

Displays the header and body information for a type.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

NIQUE

K

EYS

E

DITOR

(O

RACLE

)

The Unique Keys Editor lets you manage columns, basic properties, storage and space, and partitions for a unique key.

51 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a unique key:

1 Open an editor on the unique key. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Storage

Space

Settings and tasks

Displays a listing of the columns making up the index. Details include the Column name, the

Datatype, and whether the definition allows Nulls. Optionally, you can:

Click the New button to add a new column to the index.

Select an existing column and click the Delete button to delete that column from the index.

In addition to displaying basic identification information, this tablets you work with settings in the following categories:

Enforcing

Index

Lets you view User-Defined, Index Owner, and Index Name settings.

Attributes

Lets you set No Sort, Logging, Reverse, Validate, Deferrable, Deferred,

Enabled, Cascade, Rely, and Update Date properties.

Lets you work with settings in the following categories:

Data Block

Storage

Extents

Lets you choose the Tablespace Name, and specify Percent Free, Initial

Transactions, and Max Transactions values.

Lets you specify Initial Extent, Next Extent, Minimum Extents, Maximum

Extents, and Percent Increase values.

Freelists

Buffer Pool

Free lists let you manage the allocation of data blocks when concurrent processes are issued against the cluster. Identifying multiple free lists can reduce contention for free lists when concurrent inserts take place and potentially improve the performance of the cluster.

This tab lets you specify Freelists and Freelist Groups values.

Lets you select a Buffer Pool.

Lets you work with settings in the following categories:

Space

Utilization

Displays the Size and number of Blocks properties.

Statistics

Extents

Lets you view Index Level, Distinct Keys, Cluster Factor, Leaf Blocks, Leaf

Blks/Key and Data Blks/Key settings.

The unit of space allocated to an object whenever the object needs more space. This tab lets you view Number of Extents and Maximum Extents properties.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 517

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Partition

Settings and tasks

If the unique key is currently partitioned, this tab displays the following partition details:

Properties

Lets you view the Locality (Global/Local), Alignment (Prefixed/Non-Prefixed),

Partition Type (RANGE or HASH), and Subpartition type properties.

Click the Edit Partition button to edit partition details. For more information,

see Partitioning Oracle indexes, primary keys, and unique keys

.

Click the Drop Partition button to revert to an unpartitioned unique key.

Use the following Partition Commands menu items:

Allocate Extent

Analyze

Coalesce

Deallocate Unused Space

Mark Unusable

Rebuild

Split

Displays partitioning columns.

Displays details for each partition.

Columns

Partition

Definitions

If the unique key is not currently partitioned, you can click the Convert To Partitioned button to partition the unique key. For more information, see

Partitioning Oracle indexes, primary keys, and unique keys .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS

E

DITOR

(O

RACLE

)

The Users Editor lets you manage basic properties, roles, tablespace quotas, and associated objects for a user.

51 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Role

Quota

Objects

Object Privileges and

System Privileges

DDL View

Settings and tasks

Lets you work with settings in the following categories:

Defaults

Lets you select a Default Tablespace and Temporary Tablespace as well as select the Profile used by this user. For more on creating profiles, see

Profile Wizard (Oracle) .

Account

Identified By - Lets you select among REQUIRED YES, REQUIRED

EXTERNAL, and REQUIRED_GLOBAL.

Password - (available with Identified By value of REQUIRED_YES only) lets you specify a password.

External Name - (available with Identified By value of

REQUIRED_GLOBAL only) lets you specify the name of the user in the enterprise directory service.

Account Locked - lets you lock this user account.

Password Expired - (available with Identified By value of REQUIRED_YES only) lets you mark the password as expired, forcing the user to change their password before being allowed to connect.

Lets you select the roles that are to be assigned to this user.

Lets you set tablespace quotas for the user. Set an unlimited quota by selecting a tablespace and selecting the Unlimited radio button. Set a specific quota by selecting a tablespace, selecting the Other radio button, and providing a Quota value in kilobytes or megabytes.

Lets you manage database objects associated with a user. Objects are grouped within object type folders. Optionally, you can:

Select an object and click Edit to open an object editor on the selected object.

Select an object and click Drop to initiate dropping the selected object.

For details on using these tabs, see Working with Privileges and Permissions .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

V

IEWS

E

DITOR

(O

RACLE

)

The Views Editor lets you work with view columns and manage the dependencies and permissions for the view.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 519

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a view

1 Open an editor on the view. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Comment

Dependencies

Permissions

Settings and tasks

Displays a listing of the columns making up the view.

Lets you view and modify the DDL that will implement any changes made with the editor.

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ARTITIONING

O

RACLE INDEXES

,

PRIMARY KEYS

,

AND UNIQUE KEYS

The Add Partition wizard lets you partition an Oracle index, primary key, or unique key.

To partition an index, primary key, or unique key

1 Open an editor on the index, primary key, or unique key. For details, see

Opening an Object

Editor .

2 On the Partition tab, click Convert to Partitioned.

NOTE:

If the object is already partitioned, the Convert to Partitioned button is not present.

3 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Columns

Range Definitions

(only available for a

Partition Type of

RANGE)

Settings and tasks

In addition to displaying basic identification and ownership properties, this pane lets you work with the following settings:

Locality - GLOBAL or LOCAL.

Alignment - displays whether this partitioned object is prefixed or non-prefixed.

Partition Type - RANGE or HASH.

Subpartition Type - displays the subpartition type.

For each column to be added, click New to add a column, select a Column name, and specify a Sort order.

Lets you create an ordered list of partitions. For each partition, click New to open the Add

Partition Definition wizard. On the Partition Definition pane, provide a Name, select a

Tablespace, and enable or disable Logging. On the Storage pane, provide Data Block

Storage, Extents, and Freelists property values. Click Add.

The Range Definitions pane also lets you edit and remove partitions.

52 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Hash Definitions

(only available for a

Partition Type of

HASH)

Settings and tasks

Lets you specify a Partition method:

None

Number of Partitions - Specify a Number of Partitions, and then for each partition, click the

New button and select a tablespace.

By Partition Name - For each partition, click New, specify a Name and select a Tablespace.

4 When ready, click Finish.

S

YBASE

ASE O

BJECT

E

DITORS

DBArtisan includes an Object Editor for all supported Sybase ASE objects. To see an Editor for a specific object, click the corresponding link below:

NOTE:

If an objects has dependent objects, such as tables, triggers, procedures and views, you can view and access their dependent objects in the editor.

Aliases Editor (Sybase)

Check Constraints Editor (Sybase)

Database Devices Editor (Sybase)

Databases Editor (Sybase)

Data Cache Editor (Sybase)

Defaults Editor (Sybase)

Dump Devices Editor (Sybase)

Extended Procedures Editor (Sybase)

Foreign Keys Editor (Sybase)

Functions Editor (Sybase)

Groups Editor (Sybase)

Indexes Editor (Sybase)

Logins Editor (Sybase)

Primary Keys Editor (Sybase)

Procedures Editor (Sybase)

Remote Servers Editor (Sybase)

Roles Editor (Oracle)

Rules Editor (Sybase)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 521

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Segments Editor (Sybase)

Tables Editor (Sybase)

Triggers Editor (Sybase)

Unique Keys Editor (Sybase)

User Datatypes Editor (Sybase)

User Messages Editor (Sybase)

Users Editor (Sybase)

Users Editor (Sybase)

A

LIASES

E

DITOR

(S

YBASE

)

The Aliases Editor lets you view and modify an alias definition.

To edit an alias

1 Open an editor on the alias. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

DDL View

Settings and tasks

Lets you change the user referenced by the alias.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

C

HECK

C

ONSTRAINTS

E

DITOR

(S

YBASE

)

The Check Constraints Editor lets you manage a check constraint definition and modify the condition expression.

52 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a check constraint

1 Open an editor on the check constraint. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Lets you edit the condition in the Check Condition box. The Table Columns button acts a time saver in editing the condition. It opens a dialog that lets you select and paste column names into the check condition expression.

NOTE: If the Check Condition box shows a Source text for this compiled object is

hidden message, source text for this compiled object has been hidden. For more

information, see Hide Text .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATABASE

D

EVICES

E

DITOR

(S

YBASE

)

The Database Devices Editor lets you view or modify basic properties of a database device and view space usage details.

To edit a database device

1 Open an editor on the database device. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Lets you work with settings in the following categories:

Attributes Displays values for the Physical Name, Device Number, Controller

Number, Virtual Address, and Description settings.

Default Device - lets you specify whether the database device is the default device. CREATE and ALTER DATABASE commands that do not specify a location use the default database device.

Dsync and DirectIO - let you modify DISK INIT and DISK REINIT parameters.

Autogrowth Lets you enable/disable Auto Growth and if enabled, to specify Growth

rate and Maximum Size values.

Page range The First Virtual Page and Last Virtual Page numbers for the target database device.

Mirror These controls are only enabled if mirroring is enabled on the server.

Mirrored - enables/disables mirroring for this device.

Mirror Enabled - enables/disables the existing mirror.

Mirror Name - name of the existing mirror.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 523

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Space

Settings and tasks

Details include the Device Size, SpaceUsed, FreeSpace, and the size and usage for all

Database fragments.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATABASES

E

DITOR

(S

YBASE

)

The Databases Editor lets you manage properties, placement, and binds for a database as well as view associated space statistics.

To edit a database

1 Open an editor on the database. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Placement

Space

Bindings

DDL View

Settings and tasks

Lets you work with the following categories:

Creation

Properties

Options

Has the Database Name, Owner, Transfer aliases and permissions, and Type properties.

Lets you work with the abort tran on log full, allow nulls by default,

auto identity, dbo use only, ddl in tran, identity in nonunique index,

no chkpt on recovery, no free space acctg, read only, select into/

bulkcopy/pllsort, single user, and trunc log on chkpt properties.

Displays device fragments. Optionally you can:

Select a fragment to view the Device Name, Size, and Device Type

(DATA AND LOG or DATA ONLY) for the fragment.

Click the New button to open a dialog that lets you provide the data device and log device details for a new database fragment.

NOTE: We strongly recommend that you place the transaction log on a separate device from all other database fragments.

Lets you view pie charts showing the data space usage and the transaction log (if available) space usage for the database.

This tab is only available for databases created with a Type of TEMP. It displays all applications or logins bound to the database. Optionally, you can:

Bind another application or login to the database by selecting the

APPLICATION or LOGIN folder as appropriate, clicking Add, and in the dialog that opens select a login or provide an application name.

Remove bindings by selecting the specific application or login and clicking Drop.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

52 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

ATA

C

ACHE

E

DITOR

(S

YBASE

)

This editor lets you modify a data cache’s basic properties, object binding, and pool configuration.

NOTE:

Consult Microsoft SQL Server documentation for detailed information on cache creation and configuration. Before creating or editing a data cache, be familiar with caching strategies, pool configuration, object binding, and server restart requirements.

For assistance, see

Accessing Third Party Documentation

.

To edit a data cache:

1 Open an editor on the data cache. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Objects

Pools

DDL View

Settings and tasks

Lets you view the Name, Status, Partitions, and Run Size properties and modify the Type, Policy, and Configured Size properties. For more information on these properties, see

Data Caches

(Sybase) - Properties

.

Lets you bind and unbind databases, tables and indexes for this data cache as well as modify the caching strategy for bound objects. For details on these tasks, see

Data Caches (Sybase) -

Objects .

Generates the sp_poolconfig calls required to add or modify buffer pools for this cache. It lets you add or delete pools, change the configured size of a pool, or modify the wash size or asynchronous prefetch percentage for a pool.

The list on the left displays the pools currently configured for the cache. The Memory Pool

Attributes list on the right displays the following attributes for a selected pool:

Configured Size - total size of the memory pool

Wash Size - the cache location at which dirty pages are written.

Run Size - (display only)

Async Prefetch - the percentage of buffers in the pool that can be used to hold buffers that have been read into cache using asynchronous prefetch, but that have not yet been used.

Affected Pool - the size of I/O performed in the memory pool where the memory is to be deallocated.

Optionally, you can:

Modify pool attributes

Select a pool from the list and modify values in the Memory Pool

Attributes list

Add a new pool

Click Add Pool and select an I/O Size (in kilobytes). Modify pool attributes as required.

Delete a pool

Select a pool from the list and click Delete Pool.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 525

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

EFAULTS

E

DITOR

(S

YBASE

)

The Defaults Editor lets you modify the value and manage bindings for a default.

To edit a default

1 Open an editor on the default. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you change the Value of the default.

NOTE: If the Value box shows a Source text for this compiled object is hidden message, source text for this compiled object has been hidden. For more information,

see Hide Text .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D

UMP

D

EVICES

E

DITOR

(S

YBASE

)

The Dump Devices Editor lets you view basic properties of a dump device.

To edit a dump device

1 Open an editor on the dump device. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

DDL View

Settings and tasks

Displays the Name, Physical Name, and Device Type for the dump device. For more

information, see Dump Devices (Sybase) - Properties

.

If the Device Type is TAPE, this tab also shows a Tape capacity setting.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

52 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

E

XTENDED

P

ROCEDURES

E

DITOR

(S

YBASE

)

The Procedures Editor lets you view and modify an extended procedure definition.

To edit an extended procedure

1 Open an editor on the extended procedure. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

DDL View

Dependencies

Permissions

Settings and tasks

Lets you specify the Library Name for the extended procedure.

NOTE: If the Library Name box shows a Source text for this compiled object is hidden message, source text for this compiled object has been hidden. For more information,

see Hide Text .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

F

OREIGN

K

EYS

E

DITOR

(S

YBASE

)

The Foreign Keys Editor lets you modify the column mapping and specify properties of a foreign key.

To edit a foreign key

1 Open an editor on the foreign key. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Column Mappings

Properties

DDL View

Settings and tasks

The existing column mapping for the foreign key is represented by selected columns in the Main Table and Referenced Table lists. Additional candidates in the Referenced

Table list are indicated by enabled column check boxes.

If necessary, use the Table dropdown in the Referenced Table group to choose a new table for this foreign key. Select or deselect columns in the Main Table list and

Referenced Table list to form the referential constraint between the two tables.

Lets you specify a Match Full value of TRUE or FALSE.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 527

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

F

UNCTIONS

E

DITOR

(S

YBASE

)

The Functions Editor lets you view and modify the body of a function, as well as work with permissions and dependencies.

To edit a function:

1 Open an editor on the function. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Dependencies

Permissions

Settings and tasks

Lets you view and modify the CREATE FUNCTION statement, including the function body, for the function.

NOTE: If the Definition tab for the function shows a Source text for this compiled

object is hidden message, source text for this compiled object has been hidden. For more information, see

Hide Text

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

G

ROUPS

E

DITOR

(S

YBASE

)

The Groups Editor lets you manage users in a group and the group’s associated privileges.

TIP:

The r efresh button lets you refresh or clear the editor’s contents, and log SQL.

To edit a group

1 Open an editor on the group. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Users

Object Privileges

System Privileges

DDL

Settings and tasks

Lets you add users to, or remove users from the group. To move a user from one of the

Users Not In Group or Users In Group lists to the other list, select the user in the list and click the Join Group or Leave Group button.

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

52 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

I

NDEXES

E

DITOR

(S

YBASE

)

The Indexes Editor lets you manage columns, properties, and partitions, and view statistics for an index.

To edit an index

1 Open an editor on the index. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Partition

Statistics

DDL View

Settings and tasks

Lets you manage columns that make up the index. On opening, this tab shows the existing columns. For each column, the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Select a column and use the arrow buttons to reorder the columns in the index.

Lets you work with settings in the following categories:

Attributes

Has the Index Type (UNIQUE or NONUNIQUE), Clustered, Ignore

Duplicate Key (available with Index Type of UNIQUE), Ignore Duplicate

Rows (available with Clustered enabled), Allow Duplicate Rows (available with Clustered enabled), and Maximum Rows Per Page properties.

Storage

Lets you set Reserve Page Gap, Segment Name, Fill Factor, Prefetch

Strategy, MRU Replacement Strategy settings

Lets you work with settings in the following categories:

Properties Lets you view the Locality (Global/Local), Alignment (Prefixed/Non-

Prefixed), Partition Type (including Range-Hash Composite or Range-List

Composite), and Subpartition type properties.

Columns

Partition

Definitions

Displays partitioning columns.

Displays details for each partition.

Lets you view statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Reserved Pages, Used Pages, OAM Page Ratio, and Index

Page Ratio.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index

Row, and Maximum Rows Per Page.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 529

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

L

OGINS

E

DITOR

(S

YBASE

)

The Logins Editor lets you manage basic properties for a login, associated users and roles, and accounting.

To edit a login:

1 Open an editor on the login. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Users

Roles

Accounting

DDL

Settings and tasks

Lets you work with the following properties set when creating the login: Name, FullName, Default database, Default language, Locked, Password, Password expiration, Minimum password length,

Maximum Login attempts, and Authentication Mechanism. For detailed information on these

settings, see Login Wizard (Sybase) .

In addition, when editing an existing login, you have access to the following settings:

Is currently logged in

Login trigger

Displays whether the user is currently logged in.

Displays the login trigger currently configured for this login. This is the stored procedure automatically executed when the user logs on.

For information on configuring login triggers for a login, see Add/Modify Login

Trigger and

Drop Login Trigger

.

Lets you maintain database user accounts for a login. For more detailed information, see Logins

(Sybase) - Users

.

Lets you maintain the roles granted to this login. For more detailed information, see Logins

(Sybase) - Users

.

For information on activating and deactivating roles for the current login in the current session,

see Activating/Deactivating Roles in the Current Session .

The Accounting tab of the Logins Editor lets you manage chargeback accounting statistics for every login on the current server. Chargeback accounting statistics are CPU and I/O usage statistics that Sybase ASE accumulates for every login. To start a new accounting period, the system administrator must clear all previous login statistics.

Optionally, you can click the Clear Statistics button to start a new accounting interval. The Clear

Statistics dialog lets you clear statistics immediately or use scheduling options.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

RIMARY

K

EYS

E

DITOR

(S

YBASE

)

The Primary Keys Editor lets you manage the columns that make up the primary key and its basic properties, as well as view statistics for the primary key.

53 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a primary key

1 Open an editor on the primary key. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Statistics

DDL View

Settings and tasks

Lets you manage columns that make up the primary key. On opening, this tab shows the existing columns. For each column, the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the primary key.

Select a column and click the Drop button to delete the column from the primary key.

Select a column and use the arrow buttons to reorder the columns in the primary key.

Lets you work with settings in the following categories:

Attributes

Lets you set the Clustered and Maximum Rows Per Page properties.

Storage

Lets you set Reserve Page Gap, Segment (DEFAULT, LOGSEGMENT or

SYSTEM), and Fill Factor properties.

Lets you view statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Reserved Pages, Used Pages, OAM Page Ratio, and Index

Page Ratio.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index

Row, and Maximum Rows Per Page.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ROCEDURES

E

DITOR

(S

YBASE

)

The Procedures Editor lets you view and modify procedure definitions and modify associated privileges and dependencies.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 531

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a procedure

1 Open an editor on the procedure. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Definition

Dependencies

Permissions

Settings and tasks

Lets you modify the SQL code for a procedure.

NOTE: If the Definition tab for the procedure shows a Source text for this compiled

object is hidden message, source text for this compiled object has been hidden. For more information, see

Hide Text

.

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

EMOTE

S

ERVERS

E

DITOR

(S

YBASE

)

The Remote Server Editor lets you manage the connection and security properties for a remote server, and manage the associated logins.

NOTE:

Before using this editor, consult Sybase documentation for information on configuring

remote server logins. For more information, see Accessing Third Party Documentation

.

To edit a remote server

1 Open an editor on the remote server. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Lets you work with the Network Name, Server Type, Timeout Inactive Connections,

Network Password Encryption, Security Model, Security Mechanism, Message

Integrity, Message Confidentiality, and Mutual Authentication settings. For details on

these settings, see Remote Servers (Sybase) - Properties .

53 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Logins

Settings and tasks

Lets you build pairs of sp_addremotelogin and sp_remoteoption system procedure calls that authorize a new remote server user and configures remote login options for that user:

Click the Add Remote Login button to open a dialog that displays or lets you provide:

Remote Server Name - Displays the remote server name.

Remote Login Name - Lets you specify a remote login name. Select the All remote

users box if you want to use this name for all remote logins.

Local Login Name - Lets you select a local user name.

Trusted Remote Login - Lets you specify this remote login as a trusted login.

Select a login, click Modify, and use the table above as a guide to modifying login options.

Select a login, and click Drop to delete the login.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

DDL View

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

R

OLES

E

DITOR

(S

YBASE

)

The Roles Editor lets you manage authentication, logins, and privileges for a role.

NOTE:

User-defined roles are available in Sybase ASE 11.5 or later.

To edit a role

1 Open an editor on the role. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Settings and tasks

Displays the role Name, and lets you wok with the Password, Password Expiration,

Minimum Password Length, and Maximum Failed Logins settings. For detailed information on these settings, see

Roles (Sybase) - Properties .

This tab also lets you work with the following settings:

Apply Server

Wide

Displays whether the maximum failed logins server configuration parameter has been set. If Apply Server Wide is unselected, the

Maximum Failed Logins setting applies only to the current role.

For information on setting the maximum failed logins configuration

parameter, see Configuring the Server

.

Role Locked

Lets you manually lock the role.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 533

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Logins/Roles

Settings and tasks

Displays the logins or roles that have been granted to this role in the Objects that have

this Role granted list. Other roles and logins available to be granted to this role are shown in the Objects that don’t have this Role granted list.

Optionally, you can:

Use the Logins/Roles radio boxes to toggle the two lists between logins and roles display.

Grant a login or another role to this role by selecting the login/role from the Objects that don’t have this Role granted list and clicking Grant.

Revoke a login or role from this role by selecting the login/role from the

Objects that have this Role granted list and clicking Revoke.

For details on using these tabs, see Working with Privileges and Permissions .

Object Privileges and

System Privileges

DDL

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

For information on activating and deactivating roles for the current login in the current session, see

Activating/Deactivating Roles in the Current Session

.

R

ULES

E

DITOR

(S

YBASE

)

The Rules Editor lets you modify basic properties of a rule.

To edit a rule

1 Open an editor on the rule. For details, see

Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Dependencies

DDL View

Settings and tasks

Lets you specify a Restriction and select a Type (STANDARD_RULE,

AND_ACCESS_RULE, OR_ACCESS_RULE).

NOTE: If the Restriction box shows a Source text for this compiled object is hidden message, source text for this compiled object has been hidden. For more information,

see Hide Text .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

53 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

S

EGMENTS

E

DITOR

(S

YBASE

)

The Segments Editor lets you manage segment location, associated objects, segment space, and segment thresholds.

To edit a segment

1 Open an editor on the segment. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Location

Objects

Space

Threshold

DDL

Settings and tasks

Lets you Drop or Extend selected segments.

Lets you manage database objects associated with the segment. Objects are organized in a tree structure. You can open an object editor on a table, index, or constraint by double-clicking that object

Lets you view Segment Usage, Distribution of Segment Space, AutoGrowth

Properties, and Object Space Usage for the segment.

Shows the Hysteresis value for the segment and for each threshold for the segment, the number of Free Pages and an associated Procedure Name. Manage thresholds as follows:

Click the Add button to specify the number of free pages and procedure name for a new segment threshold

Select an existing threshold and click the Edit button to modify the threshold’s procedure name value

Select an existing threshold and click the Drop button to delete that threshold

Shows the Hysteresis value for the segment and for each threshold for the segment, the number of Free Pages and an associated Procedure Name. Manage thresholds as follows:

Click the Add button to specify the number of free pages and procedure name for a new segment threshold

Select an existing threshold and click the Edit button to modify the threshold’s procedure name value

Select an existing threshold and click the Drop button to delete that threshold

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

T

ABLES

E

DITOR

(S

YBASE

)

The Tables Editor lets you manage columns, basic properties, constraints, storage and space, and partitions of a table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 535

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a table

1 Open an editor on the table. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Indexes

Settings and tasks

Displays the currently defined columns in the table. For any selected column, the Property/Value list provides additional detail on that column. Available properties depend on the datatype you choose as well as on the property values you select:

Computed and Computed Expression - Let you define a column as a computed column and provide the computed column expression.

Type - Lets you select a datatype (depending on the type, additional properties such as Size,

Width, and Scale may be available).

Identity Column - Select this check box to define the column as an identity column.

Allow Nulls - Select this check box to allow nulls in this column.

Default Collation - available for text/character datatypes, lets you specify a default collation.

Default Value - Lets you type a constant value or select a function returning a constant value to serve as the default for the column

Default Binding and Rule Binding - Let you bind a rule or default to a column.

Optionally, you can:

Select a column, and in the Property/Value list modify property values for that column.

Click Add Column, provide a name for the new column, and set property values for the column.

Select a column and click Delete to remove the column from the table.

Lets you work with properties in the following categories:

Physical

Storage

Lets you set the Segment Name (DEFAULT, SYSTEM), Maximum Rows Per

Page, Reserve Page Gap, and Identity Gap properties.

Cache Strategy Lets you set MRU Replacement Strategy and Prefetch Strategy properties.

Row Locking

Strategy

Lets you view the Expected Row Size property and set the Lock Scheme

(ALLPAGES, DATAPAGES, ROWPAGES) property.

Lets you manage indexes for a table. On opening, the list of current indexes for the table is displayed. Optionally, take one of the following actions:

Click Add to open a dialog that lets you add a new index to the table.

Select an index and click Edit to open a dialog that lets you edit index properties.

Select an index and click Drop to open a dialog that lets you remove the index from the table.

53 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

Tab

Constraints

Settings and tasks

Lets you manage constraints for the table. Constraints are grouped by type, under folders.

Optionally take one of the following actions:

Select a constraint type folder and click Add to open a dialog that lets you add a constraint of that type.

Select a constraint and click Edit to open a dialog that lets you modify the constraint details.

Select a constraint and click Drop to remove the constraint.

Space

Lets you view the table usage and the distribution of table space for a table. Optionally, doubleclick a slice in the pie chart for detailed statistics.

Partitions

Displays partition details for the table including the Partition Type (ROUNDROBIN, HASH, LIST,

RANGE), partitioning Columns (name and datatype) and Partition Definitions (Name, values, segments).

You can also add or modify partition definitions. For more information, see Partitioning Sybase

Tables

.

Dependencies

For details on using this tab, see

Working with Object Dependencies .

Permissions

DDL View

For details on using this tab, see

Working with Privileges and Permissions

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

P

ARTITIONING

S

YBASE

T

ABLES

The Create Partition and Edit Partition wizards let you work with table partitions.

To create or edit table partitions

1 Open an editor on a table. For details, see Opening an Object Editor .

2 On the Partition tab, click the Create Partition or Edit Partition button.

3 Use the following table as a guide to understanding and modifying the settings on the tabs of this wizard:

Tab

Properties

Columns (not available for a

Partition Type of

ROUNDROBIN)

Range Definitions

(only available for a

Partition Type of

RANGE)

Settings and tasks

In addition to displaying basic identification and ownership properties, this pane lets you select a Partition Type (ROUNDROBIN, HASH, LIST, RANGE).

For each column to be added, click New to add a column and select a Column name.

Lets you create an ordered list of partitions. For each partition, click New to open the Add

Partition Definition wizard. Provide a Name, select a Segment, (DEFAULT, SYSTEM,

LOGSEGMENT) and click Add.

The Range Definitions pane also lets you edit and remove partitions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 537

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

Tab

Partitions

Definitions (only available for a

Partition Type of

HASH)

List Definitions

(only available for a

Partition Type of

LIST)

Settings and tasks

Lets you specify a Partition method:

None

Number of Partitions - Specify a Number of Partitions, and then for each partition, click the

New button and select a segment.

By Partition Name - For each partition, click New, specify a Name and select a Segment.

Lets you create a list of partition definitions. For each partition, click New to open the Add

Partition Definition wizard. Provide a Name, select a Segment, (DEFAULT, SYSTEM,

LOGSEGMENT) and click Add.

The List Definitions pane also lets you edit and remove partitions.

4 When ready, click Finish.

T

RIGGERS

E

DITOR

(S

YBASE

)

The Triggers Editor lets you modify the trigger body of a trigger and change its enabled/ disabled status.

To edit a trigger:

1 Open an editor on the trigger. For details, see Opening an Object Editor .

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Settings and tasks

Lets you view the basic identifying properties of the trigger and its parent view or table:

Parent Type, Parent Owner, Parent Name, Owner, Name, Create Date, Fire On

Insert, Fire On Update, and Fire On Delete. For details on these properties, see

Triggers (Sybase) - Properties

.

This panel also lets you specify whether the trigger is Enabled.

Lets you modify the CREATE TRIGGER body for a trigger. To modify a trigger, DBArtisan must drop then create the trigger.

NOTE: If the Definition tab for the trigger shows a Source text for this compiled object

is hidden message, source text for this compiled object has been hidden. For more

information, see Hide Text .

For details on using this tab, see

Working with Object Dependencies .

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes

U

NIQUE

K

EYS

E

DITOR

(S

YBASE

)

The Unique Keys Editor lets you manage the columns and basic properties for a unique key as well as view page and row statistics.

53 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a unique key

1 Open an editor on the unique key. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Columns

Properties

Statistics

DDL View

Settings and tasks

Lets you manage columns that make up the unique key. On opening, this tab shows the existing columns. For each column, the datatype (and if applicable the precision in brackets) and whether the table definition permits nulls in the target table column.

Optionally you can:

Change the Sort order of a column.

Click the New button and select a column name from the dropdown, to add a column to the index.

Select a column and click the Drop button to delete the column from the index.

Select a column and use the arrow buttons to reorder the columns in the index.

Lets you work with properties in the following categories:

Attributes

Lets you set Clustered and Maximum Rows Per Page properties.

Storage

Lets you set the Reserve Page Gap, and Segment (DEFAULT,

LOGSEGMENT, SYSTEM) properties.

Lets you view statistics in the following categories:

Page

Statistics

Row

Statistics

Data Pages, Reserved Pages, Used Pages, OAM Page Ratio, and Index

Page Ratio.

Maximum Row Size, Minimum Row Size, Max Size of Non-Leaf Index

Row, and Maximum Rows Per Page.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SER

D

ATATYPES

E

DITOR

(S

YBASE

)

The User Datatypes Editor lets you view and modify user datatype definitions and view objects associated with a user datatype.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 539

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

To edit a user datatype

1 Open an editor on the user datatype. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Usage

DDL View

Settings and tasks

Lets you work with properties in the following categories:

Base datatype

Lets you set Type, Size, Allow Nulls, and Identity settings.

Bindings

Lets you set Default Binding and Rule Binding properties.

Displays all objects referring to or referenced by a user datatype.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SER

M

ESSAGES

E

DITOR

(S

YBASE

)

The User Messages Editor lets you manage user messages and their respective object bindings.

NOTE:

On Sybase, user messages are only available under the Master database.

To edit a user message

1 Open an editor on the user message. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Information

Bindings

DDL View

Settings and tasks

Displays the message text for each language version of the message and offers the options to add a new language version, drop a language version, or modify a language version. For detailed instructions, see

User Messages (Sybase) - Information

.

Displays any constraints to which the user message is bound. This tab also lets you create

new bindings and delete current bindings. For details, see User Messages (Sybase) -

Bindings

.

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

U

SERS

E

DITOR

(S

YBASE

)

The Users Editor lets you view and modify user definitions and manage associated logins and objects.

54 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

M O D I F Y I N G O B J E C T S U S I N G E D I T O R S

To edit a user

1 Open an editor on the user. For details, see Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Logins

Objects

Settings and tasks

Lets you view the user Name and Login Name for the user. Lets you specify a Group

Name for the user.

Lets you assign logins to a user by selecting associated check boxes.

Lets you manage database objects associated with the user. Objects are organized in a tree structure with folders containing the objects. Optionally, take one of the following actions:

Select an object and click Edit to open an object editor on the selected object.

Select an object and click Drop to initiate dropping the selected object.

Object Permissions and

System Permissions

For details on using these tab, see Working with Privileges and Permissions

.

Comment

DDL View

For details on using this tab, see

Adding a Comment to an object .

For details on using this tab, see

Viewing the SQL/DDL for an Object

.

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

V

IEWS

E

DITOR

(S

YBASE

)

The Views Editor lets you view the columns for the view and work directly with the SQL to create the view.

To edit a view

1 Open an editor on the view. For details, see

Opening an Object Editor

.

2 Use the following table as a guide to understanding and modifying the settings on the tabs of this editor:

Tab

Properties

Definition

Dependencies

Permissions

Settings and tasks

Displays all columns for the view. Details for each column include the Column Name, the

Datatype (and if applicable, with the precision in parentheses), and whether or not Nulls are allowed for that column.

Displays the SQL (CREATE VIEW) for the view.

NOTE: If the Definition tab for the view shows a Source text for this compiled object is

hidden message, source text for this compiled object has been hidden. For more

information, see Hide Text .

For details on using this tab, see

Working with Object Dependencies .

For details on using this tab, see

Working with Privileges and Permissions

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 541

M O D I F Y I N G O B J E C T S U S I N G E D I TO R S

3 When finished, you can submit your changes. For details, see

Previewing and Submitting

Object Editor Changes .

54 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

O

BJECT ACTIONS

In addition to letting you create and perform basic editing on various object types, DBArtisan offers a number of actions that can be applied to objects. While object action support differs by

DBMS platform, they are most commonly implementations of:

• ALTER OBJECT TYPE clauses/options not typically available from object editors, such as

REBUILD INDEX and RENAME

• Other SQL commands such as TRUNCATE, REORG, and LOCK

• System procedures and other available utilities

Most object actions are implemented as multi-panel wizards that guide you through the action.

For an introduction to invoking object actions and working through the panels, see Overview of object actions/operations execution

.

For a listing of available actions and access to detailed instructions, see Available object actions by DBMS

.

O

VERVIEW OF OBJECT ACTIONS

/

OPERATIONS EXECUTION

Most commonly, initiating an object operation opens a wizard with panels that guide you through initiating the action. For details, see the following topics

Initiating an object operation

Using object operation wizards

I

NITIATING AN OBJECT OPERATION

Object operations are most commonly available as right-click context menu selections or

Datasource Explorer toolbar Command menu options, available with one or more displayed objects selected.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 543

OB JEC T A C TIO N S > OB JE CT A C TIO N S

NOTE:

To verify availability of an object action for a specific object type and DBMS platform, see the topic covering that object type in

Supported Objects

.

To initiate an object operation

1 Connect to the datasource that contains the object you want to perform the operation

against. For more information, see Connecting to a Datasource .

2 On the left pane of the Datasource Explorer, expand nodes until the target object type is visible and then click the target object type. See the following topics for more information:

Datasource Explorer . - for general information on working with the Explorer.

Supported Objects , specific object type topic - for information on navigating Datasource

Explorer nodes to the target object type.

DBArtisan displays objects of that type in the right pane of the Explorer window.

3 Take one of the following actions:

• To initiate an operation against a single object, right-click the object in the right pane, and select the operation from the context menu. Alternatively, select the object and then, from the Datasource Explorer Toolbar’s Command menu, select the action.

• To initiate an operation against a multiple objects, first use CTRL-clicking in the right pane to select multiple objects. Then, either right-click one of the selected objects in the right pane and select the operation from the context menu, or select an operation from the

Datasource Explorer toolbar’s Command menu.

NOTE:

Not all object operations can be applied to multiple objects.

DBArtisan opens the wizard for the selected object operation.

54 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

For information on using the wizard panels to provide required information and execute an operation, see

Using object operation wizards .

U

SING OBJECT OPERATION WIZARDS

A typical object operation wizard is a multi-panel window that walks you through the steps necessary to execute the operation. The wizard typically opens on a first panel named either

Action Options or using a name specific to that object action. For example, the first panels for the Rename and Drop operations:

The wizard’s Next and Back buttons let you navigate through the wizard panels. While the remaining panels of the wizard differ by action type, the following are the most common:

Dependencies

Preview

After providing information and inspecting settings on the panels, there are two execution options:

• Use the Execute (or Finish) button to execute the operation immediately

• Use the Schedule button to schedule the operation to execute the operation at a later time

or to be executed on a regular basis. For more information, see Scheduling .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 545

OB JEC T A C TIO N S > OB JE CT A C TIO N S

D

EPENDENCIES

For those object action wizards that include a Dependencies panel, it lists the objects potentially impacted by this object action. Within the main categories of Referencing Objects and Referenced Objects, objects are grouped within object type folders.

CAUTION:

A Dependencies panel, if present, is provided for information only. DBArtisan does not attempt to resolve the current action in referenced or referring objects.

P

REVIEW

The Preview panel lets you inspect the SQL generated by wizards or editors when you create, edit, or perform other actions against a database object. Depending on the action being taken, this panel may contain the following controls:

Button Description

Lets you save the SQL.

Lets you print the SQL.

Lets you send the SQL via e-mail.

Opens an SQL Editor on the SQL contained in the Preview dialog. For more information, see

ISQL

Editor

.

Opens a dialog that lets you select job scheduling options. Once you have selected your options, a third-party job scheduler opens. For more information, see

Scheduling .

Executes the SQL.

Closes the Preview dialog without executing the SQL and returns you to the wizard, editor, or dialog box from which you invoked the Preview dialog. Since you cannot edit the SQL in the

Preview dialog, this lets you make changes before once again previewing and then executing the

SQL.

A

VAILABLE OBJECT ACTIONS BY

DBMS

The table below lists the object actions provided by DBArtisan

MySQL

Add or Modify Check

Constraint

Add/Modify Login Trigger

Allocate Extent

Analyze

DB2 LUW DB2 z/OS ITB/FBD

9 9

9

9

Oracle

9

9

9

SQL SVR Sybase

9 9

9

54 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

DB2 LUW DB2 z/OS ITB/FBD

Analyze Tables

Attach Database

Backup

Bind Package

Bind To Temporary

Database

Build

Build Query

Change Access Status

Change Category

Change Job’s Owner

Change Password

Change Status

Check Data

Check Disk Group

Check Index

Check Tables

Checkpoint

Checksum Tables

Coalesce

Compile

Convert Tables

Copy Object Names

Copy Schema

Copy to Copy

Create Alias

Create Clone

Create Insert Statements

Create Like

Create Synonym

Create View

DBCC

Deallocate Unused Space

Delete Statistics

Describe

Detach Database

Disable Index

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

MySQL

9

9

9

9

9

9

9

Oracle

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

SQL SVR Sybase

9

9 9

9

9

9

9

9

9

9

9

9

9

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 547

OB JEC T A C TIO N S > OB JE CT A C TIO N S

DB2 LUW DB2 z/OS ITB/FBD

Disable Job

Disable Keys

Disable/Enable Triggers

Disconnect ASM

Connection

Drop

Drop By Category

Drop Clone

Drop Login Trigger

Drop Materialized Query

Table

Drop Unused

Drop Unused Columns

Edit Data

Enable/Disable Job (SQL

Agent Job)

Enable Job (Job Queue)

Enable Keys

Enable Recycle Bin

Estimate Size

Exchange Data With Clone

9

9

9

9

9

9

9

Execute

Extract

Extract Data as XML

Flashback Recycle Bin

Entry

Flashback Table

Flush Cache

Flush Tables

Free (Packages)

Free Plan

Hide Text

Import Data From File

Load Java

Lock

Manage ASM Connection

Merge Copy

Migrate

9

9

9

9

9

9

9

9

9

9

9

9

MySQL

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

Oracle

9

9

9

9

9

SQL SVR Sybase

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

54 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

DB2 LUW DB2 z/OS ITB/FBD MySQL Oracle

Rebuild Outlines

Rebuild Table

Recompile

Recover

Redistribute

Refit

Refresh Table

Reinitialize

Rename

Reorganize /Reorg

Repair Tables

Report

Resize

Restart

Run Job

Runstats Index

Mirror

Modify Recovery

Modify Statistics

Mount Disk Group

Move Log

Next Used Filegroup

Open Control Files

Optimize Tables

Place

Population status

Purge Recycle Bin

Purge Recycle Bin Entry

Quiesce

Quiesce Tablespaces

Reassign By Category

Rebalance Disk Group

Rebind Packages

Rebind Plans

Rebuild (Full-text

Catalogs)

Rebuild Index

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

SQL SVR Sybase

9

9 9

9

9

9

9

9

9

9

9

9

9

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 549

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Runstats Tablespace

Schema

Select * From

Set Default

Set Integrity

Set Online/Offline

Set UNDO

Shrink

Start Database

Stop Database

Start/Stop Job

Switch Logfile

Switch Online

Take Checkpoint

Transfer Ownership

Truncate

Unbind From Temporary

Database

Undrop Disk

Unmirror (Sybase)

Unquiesce

Update Statistics

View Contents

View Job History

9

9

9

9

9

9

9

9

DB2 LUW DB2 z/OS ITB/FBD

9

9

9

9

9

9

9

MySQL

9

9

9

Oracle

9

9

9

9

9

9

9

9

9

9

9

9

9

9

9

SQL SVR Sybase

9

9

9

9

9

9

9

9

9

A

DD OR

M

ODIFY

C

HECK

C

ONSTRAINT

NOTE:

This functionality is available for DB2 LUW, DB2 z/OS, Oracle, SQL Server, and Sybase.

55 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To open the Check Constraint Editor or Check Constraint Wizard

1 Take one of the following actions:

• On the Explorer, right-click the Check Constraints node and select Create.

• Select the Check Constraints node and in the right hand side of the Explorer, right-click a check constraint and select Edit.

• Expand the Check Constraints node to display existing check constraints, right-click a check constraint and select Edit.

• On the Constraints tab of a Table Wizard or Table Editor, select the Check Constraints folder and click Add.

2 Use the following table as a guide to creating or editing the constraint:

Step

Definition

Settings and tasks

Table Owner or Table Schema

(DB2 LUW, DB2 z/OS, SQL Server, Oracle,

Sybase)

Table or Table Name (DB2 LUW, DB2 z/

OS, SQL Server, Oracle, Sybase)

Name (DB2 LUW, DB2 z/OS, SQL Server,

Oracle, Sybase)

Select the owner of the table for which the check constraint is to be created.

Lets you select where you want to place the check constraint.

Lets you type the name of the constraint, which can be up to 30 characters long and must be unique across the entire database.

Enables or disables the check constraint.

Enabled or Enforced (DB2 LUW, DB2 z/

OS, SQL Server, Oracle)

Not for Replication (SQL Server)

Check Condition (DB2 LUW, DB2 z/

OS,SQL Server, Oracle, Sybase)

Enabling this feature ensures that the constraint is not enforced if the table is replicated for another database.

Type the check constraint condition. As a convenience, use the Table Columns button to paste in column names as part of the condition.

Comment (DB2

LUW)

Lets you type a comment.

DDL View

Preview the DDL generated by your choices. Finally, use the Execute button to create the check constraint.

A

DD

/M

ODIFY

L

OGIN

T

RIGGER

This action lets you build and submit an sp_modifylogin call that specifies a login script option.

The target login trigger can be any stored procedure located on the user’s default database, and the procedure will run each time the user successfully logs in. The action can be used to:

• Add a login trigger to a login that currently has no login trigger configured

• Change the specified stored procedure for a login that already has a login trigger configured

NOTE:

This functionality is available for Sybase.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 551

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To specify the stored procedure used as a login trigger for a login:

1 On the Datasource Explorer, expand the data source nodes until the Logins node is visible and then select the Logins node. DBArtisan displays the logins in the right pane of the

Explorer window.

2 Right-click a login and select Login Trigger Actions > Add/Modify Login Trigger from the context menu. DBArtisan opens the Add/Modify Login Trigger dialog box.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

From the Login Procedure dropdown, choose the default database stored procedure that is to be configured as the login trigger for this login.

Review the referring and referred objects that will be automatically resolved when you execute this operation. For details, see

Dependencies .

Preview the DDL generated for the operation and when ready, click Execute.

After executing this action, the specified stored procedure name is available in the Login editor.

For details, see Logins Editor (Sybase) .

For related information, see Drop Login Trigger

.

A

LLOCATE

E

XTENT

NOTE:

This functionality is available for Oracle only.

The Allocate Extent dialog box lets you explicitly allocate extents for clusters, tables, and indexes in Oracle. Though Oracle dynamically allocates extents when additional space is required, explicit allocation of additional extents can be useful if you know that an object grows.

Explicit allocation of additional extents can be particularly helpful when using Oracle Parallel

Server. When using Oracle Parallel Server and allocating additional extents, you can allocate an extent explicitly to a specific instance in order to minimize contention for free space among multiple instances.

Important Notes

For composite-partitioned tables, you can allocate extents to subpartitions as well as partitions.

To allocate an extent for a cluster, table, or index

1 Initiate an Allocate Extent action against a table, cluster, index, primary key, or unique key.

For more information see

Initiating an object operation

.

2 Use the following table as a guide to setting the options on this dialog:

Option Describe

Extent Size

Specify an extent size in KBs or MBs.

55 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Option

Datafile

Instance

Describe

Lets you select the new datafile. You can choose a specific datafile from which to take space for the added extent. If you choose (Default), Oracle takes the space from any accessible datafile in the tablespace containing the table, index, or cluster.

Lets you specify a freelist from which to draw the extent. If you are using Oracle Parallel Server, you can assign the new extent to a free list group associated with a specific instance. The number you enter in the Instance text box should be the number of the freelist group that you wish to use, rather than the number of the specific instance. If you are using Oracle Parallel Server and you omit this parameter, Oracle allocates the extent, but the extent is drawn from the master freelist by default.

Only use this parameter for Oracle Parallel Server.

NOTE: The number you enter in the Instance field should be the number of the free list group that you wish to use, rather than the number of the specific instance.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

A

NALYZE

This action lets you work with statistics for tables, indexes (primary keys and unique keys), and clusters. When using this action, DBArtisan lets you build and submit the following ANALYZE statement variations or DBMS_STATS package procedure calls:

DBArtisan options

Compute Statistics

Gather Statistics

Delete Statistics

Estimate Statistics

Validate Structure

Import Statistics

List Chained Row Into Table

ANALYZE statement variation or DBMS_STATS call generated

ANALYZE INDEX/CLUSTER/TABLE... COMPUTE STATISTICS

DBMS_STATS.GATHER_INDEX_STATS

DBMS_STATS.GATHER_TABLE_STATS,

ANALYZE INDEX/CLUSTER/TABLE... DELETE STATISTICS

DBMS_STATS.DELETE_INDEX_STATS

DBMS_STATS.DELETE_TABLE_STATS

ANALYZE INDEX/TABLE/CLUSTER... ESTIMATE STATISTICS

ANALYZE INDEX/TABLE/CLUSTER... VALIDATE STRUCTURE

DBMS_STATS.IMPORT_INDEX_STATS

DBMS_STATS.IMPORT_TABLE_STATS

ANALYZE TABLE/CLUSTER... LIST CHAINED ROWS INTO

NOTE:

Before using this object action, consult Oracle documentation for information on the

ANALYZE statement and relevant DBMS_STATS package procedures. Be familiar with restrictions, required permissions, partition options, parameter values, and requirements. For more information, see

Accessing Third Party Documentation .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 553

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To obtain or modify statistics for a database object:

1 Initiate an Analyze action against one or more clusters, indexes, primary keys, unique keys,

or tables. For more information see Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Analyze wizard:

Step

Action Options

Preview

Settings and tasks

Take the following steps:

If you are not working against a cluster, either select the Use dbms_stats_package check box to generate one of the DBMS_STATS procedure calls or deselect the Use

dbms_stats_package check box to generate an ANALYZE statement variation.

From the Type dropdown, select one of the DBArtisan options from the table above.

Additional options are offered depending on the Type value you choose. They correspond to ANALYZE statement clauses or DBMS_STATS procedure parameters. See

Oracle documentation for details.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

A

NALYZE

T

ABLES

DBArtisan lets you issue an ANALYZE TABLE statement, analyzing and storing the key distribution for a table.

NOTE:

This functionality is available for MySQL only.

To analyze a table:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Analyze Tables.

DBArtisan opens the Analyze Tables dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you review the tables you selected.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

55 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

A

TTACH

D

ATABASE

The Attach Database object action lets you specify a set of previously detached data and transaction files to be used to attach a database to a Microsoft SQL Server instance. This makes the database available in exactly the same state it was in when it was detached

NOTE:

This functionality is available for Microsoft SQL Server 2000 or later only.

To attach a database

1 Initiate an Attach Database action against a database. For more information see

Initiating an object operation

.

DBArtisan opens the Attach Database File(s) dialog box.

2 In the Database Name to be Attached box, type the database name.

3 In the grid, do one of the following:

• Select the target database file(s).

• To add database file(s), click Add and then enter the name of the MDF (master data file) of the database to attach.

DBArtisan automatically adds the appropriate *.ldf file.

4 To drop database file(s), click Drop and then select the target file(s).

5 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see Detach Database

B

ACKUP

Right-clicking a SQL Server or Sybase database and selecting Backup opens a tool that lets you

backup that database. For details, see Database Backup Wizard .

B

IND

P

ACKAGE

The Bind Package Wizard lets you set package parameters, add environments, and set package properties.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 555

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To package parameters, add environments, and set package properties:

1 In the explorer, under the Schema node, expand an owning schema, right-click Packages, and select Bind from the context menu.

DBArtisan opens the Bind Package wizard.

2 Use the following table as a guide to understanding and setting options on this wizard:

Step

1

2

Settings and tasks

Location

Collection

Lets you select the name of the location to connect to.

Lets you select the location of the DBMS where the package binds and where the description of the package resides.

Would you like to Copy an Existing Package from Another Collection

New Package (available if you select No for the

Would you like... control)

Lets you select a Package Name and PDS Name.

Copy Package (available if you select Yes for the

Would you like... control)

Lets you qualify with the following:

Collection - the collection to copy from.

Options - COMMAND or COMPOSITE.

Package - Lets you select a package.

Version - Lets you select a version of the package.

Lets you select a package Owner, a Qualifier (the package creator), an Action of ADD or REPLACE, and the Version of the package.

55 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

3

Settings and tasks

Isolation

Determines how far to isolate an application from the effects of other running applications.

Keep Dynamic

Specifies that DB2 keeps dynamic SQL statements after commit points. The application does not need to prepare an SQL statement after every commit point. DB2 keeps the dynamic SQL statement until the application process ends, a rollback operation occurs or the application executes an explicit PREPARE statement with the same statement identifier.

If the prepared statement cache is active, DB2 keeps a copy of the prepared statement in the cache. If the prepared statement cache is not active, DB2 keeps only the SQL statement string past a commit point. DB2 then implicitly prepares the SQL statement if the application executes an OPEN, EXECUTE, or DESCRIBE operation for that statement.

Current Data

Determines whether to require data currency for read-only and ambiguous cursors when the isolation level of cursor stability is in effect. It also determines whether block fetching can be used for distributed, ambiguous cursors.

Degree

DB Protocol

Determines whether to attempt to run a query using parallel processing to maximize performance. Lets you select an option.

Specifies which protocol to use when connecting to a remote site that is identified by a three-part name statement.

Dynamic Rules

Determines what values apply at run time for the following dynamic SQL attributes:

The authorization ID that is used to check authorization

The qualifier that is used for unqualified objects

The source for application programming options that DB2 uses to parse and semantically verify dynamic SQL statements

Whether dynamic SQL statements can include GRANT, REVOKE, ALTER, CREATE, DROP, and RENAME statements

Release

Validate

Commit - Releases resources at each commit point.

Deallocate - Releases resources only when the program terminates.

Determines whether to recheck, at run time, errors found during bind. The option has no effect if all objects and needed privileges exist.

Bind - If not all objects or needed privileges exist at bind time, the wizard displays an error messages, and does not bind the package.

Run - If not all objects or privileges exist at bind time, the process issues warning messages, but the bind succeeds. DB2 checks existence and authorization again at run time for SQL statements that failed those checks during bind. The checks use the authorization ID of the package owner.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 557

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step

4

5

Settings and tasks

Explain

Obtains information about how SQL statements in the package are to execute, and then inserts that information into the table owner.PLAN_TABLE, where owner is the authorization ID of the owner of the plan or package. This option does not obtain information for statements that access remote objects.

Query optimization hints are used for static SQL.

Optimization

Hint

Reoptvars

Re-determines the access path at run time.

Encoding

Lets you select type of language for the package.

Defer Prepare

Optionally, prepares dynamic SQL statements that refer to remote objects. Lets you choose from DEFER(PREPARE) and NODEFER(PREPARE).

Degree

1 or ANY.

Page Writes

Flag

NO, PH1, or YES.

Lets you select flag for messages to display: all (default), completion, error or warning, and informational.

Use the arrow buttons to move system connections between the Disabled Environments and Enabled

Environments lists.

3 When ready, click Finish.

B

IND

T

O

T

EMPORARY

D

ATABASE

This action builds and submits a sp_tempdb bind system procedure call. It lets you bind a login to a temporary database.

NOTE:

This functionality is available for Sybase only.

To bind a login to a temporary database

1 Initiate a Bind To Temporary Database action against one or more logins. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Bind To

Temporary Database wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Select the target temporary database from the Bind To Temporary Database dropdown.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

55 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

B

UILD

This action lets you build a procedure, specifying a Build utility function (ALTER_REBUILD,

REBUILD, REBIND, or DESTROY), a Build owner, Precomplie options, Compile options,

Prelink options, Link options, and Bind options.

NOTE:

This functionality is available for DB2 z/OS only.

To build a procedure

1 Initiate a Build action against a procedure. For more information see

Initiating an object operation .

2 Type or select the build options in the Procedure Build Options dialog:

3 Click Build.

B

UILD

Q

UERY

Right-clicking a table and selecting Build Query opens a tool that lets you create, structure, and manipulate queries. For details, see

Query Builder

.

C

HANGE

A

CCESS

S

TATUS

This action builds and submits a basic ALTER TABLE... READ ONLY/READ WRITE statement. This lets you toggle the table between READ ONLY and READ/WRITE modes.

NOTE:

This functionality is available as of Oracle 11g.

NOTE:

The Datasource Explorer listing for an Oracle table has a Read-Only field that displays the current mode for a table.

To change between READ ONLY and READ WRITE modes for a table

1 Initiate a Change Access Status action against one or more tables. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

Select the Read-only check box to generate a ALTER TABLE... READ ONLY statement, putting the table into read-only mode. Deselect the Read-only check box to generate a

ALTER TABLE... READ WRITE statement, putting the table into read-write mode.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 559

OB JEC T A C TIO N S > OB JE CT A C TIO N S

C

HANGE

C

ATEGORY

DBArtisan lets you change the category of a target Stored Outline.

NOTE:

This functionality is available for Oracle only.

To change the category of a stored outline

1 Initiate a Change Category action against a stored outline. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Change

Category wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

From the Category dropdown, choose a new, target category.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see the following topics:

Drop By Category

Reassign By Category

C

HANGE

J

OB

S

O

WNER

This action builds and submits an sp_update_job call with an @owner_login_name argument. It lets you change the owner of a SQL Agent job.

NOTE:

This functionality is available for SQL Server only.

To change the owner of a job

1 Initiate a Change job’s owner action against a job. For more information see Initiating an object operation .

DBArtisan opens the Change job’s owner dialog box.

2 Use the following table as a guide to understanding and modifying settings in the Change

job’s owner wizard:

Step

Action Options

Preview

Settings and tasks

From the New Owner dropdown, select the new owner for the job.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

56 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

C

HANGE

P

ASSWORD

NOTE:

This functionality is available for Microsoft SQL Server, MySQL, Oracle, and Sybase ASE only.

The Change Password dialog box lets you change user or login passwords, which you should do on a regular basis to guard against security leaks.

To change the password for a user or login

1 Take one of the following actions:

• For Sybase or SQL Server, select the Logins node.

• For MySQL and Oracle, select the Users node.

DBArtisan displays the Users or Logins in the right pane of the Explorer window.

2 Right-click the user or login, and then select Change Password from the context menu.

DBArtisan opens the Change Password dialog box.

3 For Oracle and SQL Server datasources, in the Old Password box, type the old password.

Providing the old password is optional on SQL Server datasources.

4 In the New Password box, type the new password.

5 In the Confirm Password box, type the new password.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

C

HANGE

S

TATUS

You can change the status of a number of relevant object types. For details, see the following topics:

Change Status (SQL Server and Sybase triggers)

Change Status (SQL Server DDL triggers)

Change Status (Full-text Indexes)

Change Status (check constraints)

Change Status (tablespaces)

C

HANGE

S

TATUS

(SQL S

ERVER AND

S

YBASE TRIGGERS

)

The Change Status object action lets you build an issue an ALTER TABLE statement that specifies a DISABLE TRIGGER or ENABLE TRIGGER option. This lets you enable or disable any triggers.

NOTE:

This functionality is available for Microsoft SQL Server and Sybase ASE only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 561

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Loading a database from a previous dump causes any triggers defined in the database to fire. To speed the time required to load a database you should disable triggers.

NOTE:

Disabling triggers can lead to problems with maintaining referential integrity and business rules

To enable or disable a trigger:

1 Initiate a Change Status action against one or more triggers. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Change

Status wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Select the Enabled check box to enable the trigger. Deselect it to disable the trigger.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

C

HANGE

S

TATUS

(SQL S

ERVER

DDL

TRIGGERS

)

The Change Status object action lets you build and issue a DISABLE TRIGGER... ON

DATABASE/ON ALL SERVER or ENABLE TRIGGER... ON DATABASE/ON ALL SERVER statement. This lets you enable or disable one or more database triggers or server triggers.

NOTE:

This functionality is available for SQL Server 2005 and up.

NOTE:

The Datasource Explorer listing for a server trigger or database trigger indicates its current status.

To enable or disable a trigger:

1 Initiate a Change Status action against one or more triggers. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Change

Status wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Select the Enabled check box to enable the trigger. Deselect it to disable the trigger.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

56 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

C

HANGE

S

TATUS

(F

ULL

-

TEXT

I

NDEXES

)

The action builds and submits an ALTER FULLTEXT INDEX statement with an ENABLE or

DISABLE argument, letting you enable or disable the full-text index. Full-text searching is unavailable on tables or views with a disabled full-text index.

NOTE:

This functionality is available as of SQL Server 2005.

To enable or disable a full-text index:

1 Initiate a Change Status action against one or more full-text indexes. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action Options

Preview

Settings and tasks

Select the Enabled check box to enable the full-text index. Deselect the Enabled check box to disable the full-text index.

Note that on opening the dialog, the Enabled check box state reflects whether the index is currently enabled or disabled.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

C

HANGE

S

TATUS

(

CHECK CONSTRAINTS

)

DBArtisan lets you change the enabled/disabled status of check constraints, foreign key constraints, primary key constraints, and unique key constraints.

For detailed instructions, see:

• Setting constraint status for Microsoft SQL Server objects

• Setting Constraint Status for Oracle Objects

S

ETTING CONSTRAINT STATUS FOR

M

ICROSOFT

SQL S

ERVER OBJECTS

The Set Constraint Status dialog box lets you specify the ability of a group of constraints to be replicated, and (for Microsoft SQL Server version 7 or later) enable or disable check constraints, foreign key constraints, primary key constraints, and unique key constraints.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 563

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Completing the Set Constraint(s) Status Dialog Box

To complete this dialog box, do the following:

1 Initiate a Change Status action against one or more check constraints. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings on the

Change Status wizard:

Step

Action Options

Dependencies

Preview

Functionality

Enabled

Deselect to temporarily override listed check constraints. Useful when you need to execute special processes that would ordinarily incur constraint-related errors.

Not for Replication

When you duplicate the table schema and data of a source database containing constraints marked "Not for Replication", these objects are not carried over to the duplicate of the schema.

View the dependencies on the tablespace.

Preview the DDL generated from your choices.

3 Use the Execute or Schedule button to complete the operation.

S

ETTING

C

ONSTRAINT

S

TATUS FOR

O

RACLE

O

BJECTS

The Set Constraint(s) Status dialog box lets you change the status of check constraints, foreign key constraints, primary key constraints, and unique key constraints. DBArtisan lets you enable or disable selected constraints and, in the case of primary key and unique key constraints, lets you enable with or without validation and disable with or without the changes cascading.

When enabled, the rule defined by the constraint is enforced on the data values in the columns on which the constraint is placed. When disabled, the constraint rule is not enforced but the constraint continues to be stored in the data dictionary.

Temporarily disabling constraints can improve performance when you are loading large amounts of data or when you are making massive changes to a table. Disabling constraints also can be useful if you are importing or exporting one table at a time.

NOTE:

Primary keys for index-organized tables cannot be disabled.

NOTE:

You cannot drop a unique or primary key constraint that is part of a referential integrity constraint without also dropping the foreign key. To drop the referenced key and the foreign key together, select the Cascade check box in the Set Constraint(s) Status dialog box.

56 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

The table below describes the options and functionality on the Set Constraint(s) Status dialog box.

NOTE:

The options differ by object.

Option

Enable

Validate

Cascade

Description

Enabling the constraint and not selecting the Validate check box automatically uses Oracle

ENABLE NOVALIDATE clause which enables a constraint so that it does not validate the existing data. A table using constraints in enable novalidate mode can contain invalid data but you cannot add new invalid data to that table.The enable novalidate mode is useful as an intermediate state or when you do not want the constraint to check for possible exceptions (e.g., after a data warehouse load).

Enabling the constraint and selecting the Validate check box causes Oracle to validate all existing data in the key columns of the table with the constraint. If an exception exists, Oracle returns an error and the constraint remains disabled.

Selecting the Cascade check box when disabling a primary key or foreign key constraint instructs

Oracle to simultaneously disable any constraints that depend on the primary or unique key.

Selecting the Delete Cascade check box instructs Oracle to delete data in the child table (on which the foreign key is defined) if the referenced data is the parent table is deleted.

Completing the Set Constraint(s) Status Dialog Box

To complete this dialog box, do the following:

1 On the Datasource Explorer, select the target object node.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane of the application, select one or more check constraints.

3 From the Command menu select Change Status.

DBArtisan opens the Change Status dialog box.

4 Use the table above to select dialog box options.

5 Use the Execute or Schedule button to complete the operation.

C

HANGE

S

TATUS

(

TABLESPACES

)

You can change the online, offline, or read only status of a tablespace to control access to its segments. In addition, when setting a tablespace offline, you can choose between NORMAL,

TEMPORARY, or IMMEDIATE modes of taking the tablespace offline.

NOTE:

This functionality is available for Oracle only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 565

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To change the status of a tablespace

1 Initiate a Change Status action against one or more tablespaces. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Change

Status wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

From the Change Status dropdown, select ONLINE, OFFLINE, or READ ONLY. If you select

OFFLINE, from the OfflineMode dropdown, select NORMAL, TEMPORARY, or IMMEDIATE.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, click Execute. For information on the other options, see

Preview

and

Scheduling .

C

HECK

D

ATA

The Check Data Wizard checks tablespaces for violations of referential and check constraints.

The wizard also checks for consistency between a base tablespace and a LOB tablespace.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

Upon completion, the wizard reports information about violations that are detected and the status of tablespaces that violate any constraints is set to CHECK-PENDING. Also, the CHECK-

PENDING status of all tablespaces that do not violate any constraints is reset. Optionally, the utility deletes rows that violate constraints.

Important Notes

• Run the Check Data Wizard after a conditional restart or a point-in-time recovery on all tablespaces where parent and dependent tables might not be synchronized or where base tables and auxiliary tables might not be synchronized.

• Run the Check Data Wizard against a base tablespace only, not a LOB table space.

56 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To check tablespace data

1 Initiate a Check Data action against a tablespace. For more information see Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Check

Data Utility wizard:

Step

1

2

3

Settings and tasks

Select tablespaces:

If the Wizard is opened from the Tablespaces Editor, the target tablespaces are initially displayed. To check additional tablespaces, click the Add button.

Add

Opens the Object Selector Dialog Box .

Delete

Do you want the utility to be restartable?

Deletes selected tablespace.

Lets you specify to execute Wizard in restartable mode. You can restart it from the

Datasource Explorer.

Would you like to specify the scope?

Would you like to specify the auxiliary error?

Exceptions

Error ddn

Work ddn

Lets you specify scope options:

Pending (default) - DBArtisan keeps track of the data rows that must be checked to ensure referential integrity.

Auxonly - Select if you only want to check tables with LOB columns.

All - Select whenever the scope information is in doubt. The scope information is recorded in the DB2 catalog. The scope information can become in doubt whenever you start the target table space with ACCESS(FORCE), or the catalog is recovered to a point in time.

RefOnly - Select if you want to check all dependent tables in the specified tablespaces except tables with LOB columns.

Lets you specify the auxiliary error options:

Report (default) - DBArtisan sets the base tablespace to the auxiliary CHECKpending (ACHKP) status. If CHECK DATA encounters only invalid LOB columns and no other LOB column errors, the base table space is set to the auxiliary warning status.

Invalidate - DBArtisan sets the base table LOB column to an invalid status, and sets the base table space to the auxiliary warning (AUXW) status. You can use SQL to update a LOB column in the AUXW status, however, any other attempt to access the column will result in a -904 SQL return code.

Lets you specify the number or exceptions, from 0 to 2147483647.

Lets you specify the name of a error data definition (DD) statement that corresponds to a data control block that contains the same name. Lets you select a previously saved dataset template or click Edit to open the Dataset Template Editor.

Lets you specify the name of a work data definition (DD) statement that corresponds to a data control block that contains the same name. Lets you select a previously saved dataset template or click Edit to open the Dataset Template Editor.

Exceptions

Add

Delete

Displays the Source and Destination tables for each exception. You can select one or more rows from the grid.

Opens the Exceptions dialog box. For details, see Exceptions Dialog Box .

Deletes the selected exception.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 567

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step

4

Settings and tasks

Do you want to specify the device type for temporary data sets by

DFSORT?

Do you want to specify the sort number?

Lets you specify the device type for temporary data sets to be dynamically allocated by DFSORT.

Lets you type the number of datasets to be dynamically allocated by the sort program. The range of the text field is 0 to 2147483647.

3 When ready, click Finish.

E

XCEPTIONS

D

IALOG

B

OX

The table below describes the options and functionality on the Exceptions dialog box:

Option

Base Table Owner

Base Table

Exception Table Owner

Exception Table

Description

Lets you select the base table owner.

Lets you select the base table.

Lets you select the exception table owner.

Lets you select the exception table.

C

HECK

D

ISK

G

ROUP

This action builds and submits an ALTER DISKGROUP CHECK... statement with FILE/DISK/

FAILGROUP/ALL and REPAIR options, letting you verify the internal consistency of disk group metadata.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

Before this object action is available you must have a direct connection to the ASM

instance. For details, see Manage ASM Connection .

To verify internal consistency of metadata for a mounted disk group

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 Right-click the Disk Groups node and select Create from the context menu.

3 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Settings and tasks

Repair - Select this check box to include a REPAIR clause, instructing Oracle to attempt to repair any errors found during the check. Deselect this check box to include a NOREPAIR clause.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

56 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

Preview

Settings and tasks

Displays the DDL that will execute the object action. For details, see Preview

.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

C

HECK

I

NDEX

The Check Index Wizard lets you test whether indexes are consistent with the data they index.

The Wizard issues warning messages when an inconsistency is found.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

Run the Check Index Wizard after a conditional restart or a point-in-time recovery on all tablespaces where you suspect that the indexes may not be consistent with the data. Also run the wizard before executing the

Check Data wizard to ensure that the indexes used by the

Check Data Wizard are valid. This is especially important before using the Check Data with

DELETE YES.

When checking an auxiliary table index, the Check Index Wizard verifies that each LOB is represented by an index entry, and that an index entry exists for every LOB.

To check index/data consistency

1 Initiate a Check Index action against a tablespace or index. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Check

Index Utility wizard:

Step

1

2

3

Settings and tasks

Select Index

Add

Delete

Select tablespaces

Add

Delete

Do you want the utility to be restartable?

Work DDN

If you initiated the Check Index operation against one or more indexes, the target indexes are initially displayed. To check additional Indexes, click the

Add button.

Opens the Indexes Selector dialog box.

Deletes selected index.

If you initiated the Check Index operation against one or more tablespaces, the target tablespaces are initially displayed. To check additional tablespaces, click the Add button.

Opens the Object Selector Dialog Box .

Deletes selected tablespace.

Lets you specify to execute Wizard in restartable mode. You can restart it from the Datasource Explorer.

Lets you specify the name of a work data definition (DD) statement that corresponds to a data control block that contains the same name. Lets you select a previously saved dataset template or click Edit to open the Dataset

Template Editor.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 569

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step Settings and tasks

Do you want to specify the device type for temporary data sets by DFSORT?

Do you want to specify the sort number?

Lets you specify the device type for temporary data sets to be dynamically allocated by DFSORT.

Lets you type the number of datasets to be dynamically allocated by the sort program. The range of the text field is 0 to 2147483647.

3 When ready, click Finish.

C

HECK

T

ABLES

DBArtisan lets you issue a CHECK TABLE statement, checking one or more tables for errors. This operation returns a standard CHECK TABLE result set. Each returned message consists of Table

(name), Op (with a value of CHECK), Msg_type (STATUS, ERROR, INFO, WARNING), and

Msg_text components.

NOTE:

This functionality is available for MySQL only.

To check a table for errors:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Check Tables.

DBArtisan opens the Check Tables dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Preview

Settings and tasks

Changed

Only check tables that have changed since the last check.

Extended

Fast

Medium

Perform a full key lookup for all keys in each row.

Check only tables that have not been properly closed.

Scan rows to verify that deleted links are valid. Calculate a key checksum for the rows and verify using a calculated checksum for keys.

Quick

Perform a full key lookup for all keys in each row.

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

The results set opens on the Results tab of an ISQL editor window. For more information, see

Results Editor

.

57 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

C

HECKPOINT

Running a Checkpoint lets you force all dirty pages for the current database to be written to disk.

A dirty page is any data or log page which, after being read into the buffer cache, is modified but not yet written to disk. The Checkpoint statement saves time in a subsequent recovery by creating a point at which all modifications to data and log pages are guaranteed to have been written to disk. If the current database is in log-truncate mode, CHECKPOINT also truncates the inactive portion of the log.

NOTE:

This functionality is available for Microsoft SQL Server, and Sybase ASE only.

Important Notes

The default permission for executing a checkpoint is the db_owner fixed database role.

To run a Checkpoint against one or more databases

1 Initiate a Checkpoint action against one or more databases. For more information see

Initiating an object operation .

2 Use the following table as a guide to working through the panels of the Checkpoint dialog box

Step

Action options

Preview

Description

Displays the names of the database(s) you chose.

Displays the DDL generated to execute the Checkpoint operation.

3 Use one of the Schedule or Execute buttons to execute the Checkpoint.

C

HECKSUM

T

ABLES

DBArtisan lets you issue a CHECKSUM TABLE statement, returning a live checksum.

NOTE:

This functionality is available for MySQL only.

To check a table for errors:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Checksum Tables.

DBArtisan opens the Checksum Tables dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 571

OB JEC T A C TIO N S > OB JE CT A C TIO N S

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Preview

Settings and tasks

Extended

Quick

Specifies that the whole table is to be read, row by row.

Specifies that the live checksum is to be reported. For information on

enabling a live checksum for a table, see Tables wizard (MySQL)

.

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

The results set opens on the Results tab of an ISQL editor window. For more information, see

Results Editor

.

C

OALESCE

You can maximize the size of free space chunks in tablespaces to avoid the situation in which an object cannot acquire enough contiguous free space to accommodate its next extent size.

Towards this goal, look for opportunities to coalesce adjacent blocks of free space into a single, larger block.

Oracle automatically coalesces adjacent free space chunks with a background process. However, it still supports the commands for coalescing free space manually. Depending on the size of the tablespace, coalescing its free space can take a long time. So determine when to perform this operation. It you coalesce immediately, DBArtisan locks the tablespace.

Important Notes

• You cannot coalesce on an UNDO tablespace.

To coalesce a tablespace

1 Initiate a Coalesce action against one or more tablespaces. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Coalesce wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Verify display of the tablespaces to be coalesced.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, click Execute. For information on the other options, see

Preview

and

Scheduling .

57 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

C

OMPILE

DBArtisan lets you recompile specific objects by issuing the proper ALTER statement. The explicit recompilation of invalid objects eliminates the need for implicit run-time recompilation which, in turn, can cause run-time compilation errors and performance overhead. Recompile objects after you make changes to that object or dependent objects.

The following table lists the object types by DBMS for which the Compile operation is available:

DB2 LUW

Oracle

Functions Java

Sources

Procedures

Materialized

Views

Packages Package

Bodies

Procedures Schema Types and

Type

Bodies

Views

NOTE:

The objects you can compile and the steps in compiling them differ according to the type of data source you are working against. Before proceeding, make sure you are familiar with the material in

Compiling Oracle Objects

.

To compile an object

1 Initiate a Compile action against one or more supported objects (see the table above). For

more information see Initiating an object operation .

DBArtisan opens the Compile wizard. Options offered on the Action Options tab differ by object type. For example, no options are provided when compiling Java Sources, while a full range of dependent object-based and debug options are provided when compiling procedures.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 573

OB JEC T A C TIO N S > OB JE CT A C TIO N S

2 Use the following table as a guide to working through the panels of the dialog box

Step Settings and tasks

Action options Compile dependents

If enabled, this option compiles statements for all objects referenced by the object being compiled.

For example, if you compile a function that references a specific procedure and you select to compile the dependent objects, an ALTER

COMPILE statement is created for that referenced procedure.

If disabled, only the current object is compiled and the object’s dependencies are ignored. This is the default setting.

Availability

DB2 LUW Procedures

Oracle Functions,

Packages, Procedures,

Types, and Views

Compile only invalid dependents

Compile system dependents

Compile with debug

If you enabled the Compile dependents option, enabling this option compiles only invalid dependent objects - Creates ALTER COMPILE statements for only those objects that are currently invalid.

If you enabled the Compile dependents option, enabling this option compiles dependent system objects - Compiles all of the referenced objects with the debug option.

Enabling this option instructs the Oracle PL/SQL compiler to generate and store the code for use in debugging sessions.

DB2 LUW Procedures

Oracle Functions,

Packages, Procedures,

Types, and Views

DB2 LUW Procedures

Oracle Functions,

Packages, Procedures,

Types, and Views

DB2 LUW Procedures

Oracle Functions,

Packages, Package

Bodies, Procedures,

Types, Type Bodies, and

Views

DB2 LUW Procedures

Keep specific name

When enabled, compilation will keep the current name.

Dependencies

Lets you review any dependencies before you proceed.

Preview

Displays the DDL generated to execute the Checkpoint operation.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

C

OMPILING

O

RACLE

O

BJECTS

To recompile an object it must belong to your schema or you need ALTER ANY privileges on that object. You must also have appropriate privileges for any associated objects. Prior to compiling objects of a particular type, see the relevant topic below:

• Notes on Compiling Oracle Functions

• Notes on Compiling Oracle Java Sources

Notes on Compiling Oracle Materialized Views

Notes on Compiling Oracle Packages and Package Bodies

Notes on Compiling Oracle Procedures

57 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Notes on Compiling Oracle Types and Type Bodies

Notes on Compiling Oracle Views

N

OTES ON

C

OMPILING

O

RACLE

F

UNCTIONS

DBArtisan lets you recompile a function. Oracle first recompiles any invalid objects on which the function depends. In addition, it marks any objects that depend on the function as invalid.

To recompile a function that is part of a package, compile the package itself. DBArtisan uses the

ALTER FUNCTION statement to compile a stand-alone function. However, you should not use the ALTER FUNCTION statement to individually recompile a function that is part of a package.

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

J

AVA

S

OURCES

Oracle lets you compile a Java source. Oracle resolves references to other Java sources.

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

M

ATERIALIZED

V

IEWS

DBArtisan lets you compile materialized views. If a materialized view fails to revalidate after you recompile, that materialized view cannot be fast refreshed ON DEMAND or used for query rewrite.

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

P

ACKAGES AND

P

ACKAGE

B

ODIES

DBArtisan lets you recompile a package, and recompiles all package objects together.

Recompiling a package in DBArtisan compiles both the package specification and the package body by issuing two consecutive ALTER statements. However, DBArtisan shows only the ALTER statement for the specification in the Preview: Confirm Compile dialog box. You can recompile only the package body by explicitly compiling the package body itself.

When recompiling the entire package, Oracle recompiles the package even if it is invalid.

However, if there are compilation errors, the package remains invalid and Oracle invalidates all dependent objects.

Recompiling only a package body does not invalidate objects that depend upon the package specification regardless of whether or not the package body has compilation errors.

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

P

ROCEDURES

DBArtisan lets you compile a procedure that is part of a package, by compiling the package itself. DBArtisan uses the ALTER PROCEDURE statement to compile a stand-alone procedure.

However, you should not use the ALTER PROCEDURE statement to individually recompile a procedure that is part of a package.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 575

OB JEC T A C TIO N S > OB JE CT A C TIO N S

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

T

YPES AND

T

YPE

B

ODIES

DBArtisan lets you recompile a type. DBArtisan recompiles both the type specification and the type body.

For more information, see

Compile.

N

OTES ON

C

OMPILING

O

RACLE

V

IEWS

DBArtisan lets you recompile a view when you have altered an object referenced by that view.

When you recompile a view, Oracle invalidates all dependant objects.

For more information, see

Compile.

C

ONVERT

T

ABLES

This action lets you build and submit an ALTER TABLE statement, specifying an ENGINE= option, specifying any available storage engine.

NOTE:

This functionality is available for MySQL only.

NOTE:

For information on how to quickly convert a table to use the INNODB storage engine,

see Rebuild Table

.

To change the storage engine for a table:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 Right-click the table or tables and select Convert Tables from the context menu.

DBArtisan opens the Convert Tables dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Use the Convert To dropdown to select an available storage engine.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

57 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

C

OPY

O

BJECT

N

AMES

NOTE:

This functionality is available for Microsoft SQL Server and Oracle only.

The Copy Object Names functionality lets you copy and then paste object name(s) into other applications.

To copy an object name to be pasted into another application

1 On the left pane of the Datasource Explorer, select the node corresponding to the object type whose name you want to copy.

DBArtisan displays objects of that type in the right pane of the Explorer window.

2 Right-click on the specific database object and select Copy.

C

OPY

S

CHEMA

For IBM DB2 for Windows, Unix, and Linux (version 9), the Copy Schema function lets you quickly make copies of a database schema and its corresponding objects.

To copy a schema

1 In the data sources pane, right-click a data source and select Copy Schema from the context menu.

2 Use the following table as a guide to understanding and choosing options the options in the

Copying Schema dialog:

Pane

Action Options

Tablespace mapping

Preview

Options

Lets you specify Copying Schema, Target Schema, specify a Copy Mode of COPY,

COPYNO, or DDL, specify a Log filename (COPY and COPYNO modes only), select an

Object Owner, and Error table schema, provide an Error table name, and specify a

Drop error table after action execution options.

Lets you specify source and target tablespace options.

Displays the DDL generated to execute the operation.

3 Execute or Schedule the action.

C

OPY TO

C

OPY

NOTE:

This functionality is available for IBM DB2 for z/OS only.

The Copy to Copy dialog box lets you make image copies. Starting with either the local primary or recovery site primary copy, the Copy to Copy dialog box can make up to three copies of the following types:

• Local primary

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 577

OB JEC T A C TIO N S > OB JE CT A C TIO N S

• Local backup

• Recovery site primary

• Recovery site backup

The copies are used by the RECOVER utility when recovering a table space or index space to the most recent time or to a previous time. These copies can also be used by MERGECOPY,

UNLOAD, and possibly a subsequent Copy to Copy execution.

To perform a Copy To Copy operation

1 Initiate a Copy To Copy action against a tablespace or index. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Copy To

Copy Utility wizard:

Step

1

2-4

Settings and tasks

Do you want the utility to be restartable?

Tape Stacking

Object Grid

Add

Delete

Set Properties

Lets you specify to execute Wizard in restartable mode. You can restart it from the Datasource Explorer.

Stacks similar output data sets as successive files on one logical tape volume, where a logical tape volume can consist of a multi-volume aggregate, if any of the resulting data sets on the tapes span volumes.

Within one utility execution, output data sets are stacked on a logical tape volume of the same usage type. For example, local primary image copies are stacked separately from local backup image copies. Also lets you specify the Copy and Recovery dataset information once as variable names appended with generated values.

Displays the target tablespaces, indexspaces, or indexes. Your can select multiple items in the list.

The Partition column is editable. You can add the partition numbers in this column, separated by commas.

For details, see Object Selector Dialog Box .

Deletes the selected objects.

For details, see Object Properties Dialog Box .

3 When ready, click Finish.

O

BJECT

P

ROPERTIES

D

IALOG

B

OX

The Object Properties dialog box opens when you click the Set Properties button against a

selected object when performing a Copy To Copy operation. For more information, see Copy to

Copy

.

57 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

The table below describes the options and functionality on this dialog box:

Option

From

Dataset Name

Would you like to specify the volume information

Local Site Primary Copy

Local Site Backup Copy

Description

Copy - The particular image copy data set (dsn) as the input to COPYTOCOPY job.

Specify the name in the Dataset Name field.

Last Copy - The most recent image copy that was taken for the tablespace or index space to be the input to COPYTOCOPY job. This could be a full or incremental copy.

Last Full Copy - The most recent full image copy that was taken for the object to be the input to COPYTOCOPY job.

Last In CR Copy - The most recent incremental image copy that was taken for the object to be the input to COPYTOCOPY job.

Only available if you selected a From Value of Copy.This field lets you specify a dataset name.

Only available if you selected a From Value of Copy. If you select Yes, you can specify a Volume and view the Sequence Number.

Lets you specify a dataset name for the local site primary image copy. This relates to the copydsn1 parameter in the stored procedure.

Lets you specify the device for the image copy. This relates to the copydevt1 parameter in the stored procedure.

Recovery Site Primary Copy

Lets you specify the primary space allocation amount for the image copy. This relates to the copyspace1 parameter in the stored procedure.

Recovery Site Backup Copy

Lets you specify a dataset name for the local site backup image copy. This relates to the copydsn2 parameter in the stored procedure.

O

BJECT

S

ELECTOR

D

IALOG

B

OX

The table below describes the options and functionality on the panel of the Object Selector dialog box:

Option

Database Like

Tablespace Like

Creator Like

Index Like

Match Case

Object Grid

Query

Select All

Unselect All

Description

Lets you type the pattern for querying the tablespaces. You can type multiple words, separated by spaces.

Lets you type the pattern for querying the tablespaces. You can type multiple words, separated by spaces.

Lets you type the pattern for querying the creator. You can type multiple words, separated by spaces.

Lets you type the pattern for querying the index. You can type multiple words, separated by spaces.

Lets you specify match case.

Lets you select one or more rows in this list.

Repopulates grid based on the object query.

Selects all rows in Object Grid.

Unselects all rows in Object Grid.

For more information, see

Copy to Copy

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 579

OB JEC T A C TIO N S > OB JE CT A C TIO N S

C

REATE

A

LIAS

The Create Alias object action lets you create an alias to a selected object. The following table shows the object types for which this action is available:

DB2 LUW

DB2 z/OS

Materialized Query Tables

X

Sequences

X

Tables

X

X

Views

X

X

To create an alias to one of the supported object types:

1 Initiate a Create Alias action against a supported object (see the table above). For more information see

Initiating an object operation

.

DBArtisan opens the Alias Editor. For information on using the Alias editor, see the topic corresponding to the DBMS you are working against:

Alias Wizard (DB2 LUW)

Alias Wizard (DB2 Z/OS)

C

REATE

C

LONE

DBArtisan provides support for the ADD CLONE option functionality, letting you create a clone on an existing base table. This creates a table with a cloned definition but with no data.

NOTE:

This functionality is available as of IBM DB2 for z/OS version 9. The base table must

reside on a universal tablespace. For more information, see Tablespace Wizard (DB2 Z/

OS) .

To create a clone for one or more tables:

1 Initiate a Create Clone action against one or more tables. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Create

Clone wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you provide a Clone Name.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

The clone for a table is not displayed in the Datasource Explorer listing of tables for a data source. To determine whether a table has a clone, see the Dependencies tab/panel on a Table editor or on the wizard for object actions such as Drop or Rename.

58 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

After creating a clone for a table, you can exchange data between the base table and the clone.

For related information, see the following topics:

Exchange Data With Clone

Drop Clone

C

REATE

I

NSERT

S

TATEMENTS

The Create Insert Statements dialog box lets you automatically create a set of Insert Statements for selected columns and records and based on the data in a table.

NOTE:

This functionality is available for all DBMS platforms.

To create Insert Statements based on existing table data

1 In the left pane of the application, select the Tables node.

DBArtisan displays the Tables in the right pane of the Explorer window.

2 In the right pane of the application, right-click a table, and then select Create Insert

Statements.

DBArtisan opens the Create Insert Statements dialog box.

3 In Columns, select columns to be included in the INSERT statement.

4 Optionally, in the Where box, type a WHERE clause.

5 Enable or disable Include owner information in insert statements.

6 Enable or disable

Set row count

, which lets you specify a row count, the number of rows in a table that were affected by the Insert statement executed against the table, or a view based on the table.

7 Click OK.

An ISQL window opens with a set of Insert statements corresponding to the criteria you provided and the table data. For more information, see

ISQL Windows .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 581

OB JEC T A C TIO N S > OB JE CT A C TIO N S

C

REATE

L

IKE

The Create Like Editor lets you create a new object based on an existing object. The following table shows availability of the Create Like function for particular object types by DBMS:

DB2 LUW

Materialized Query Tables

Tables

DB2 Z/OS

Tables

ITB/FBD

Tables

MySQL

Tables

SQL Server Oracle

Logins

Tables

Users

Tables

Sybase

Logins

Tables

Users

To create an object based on another object

1 Initiate a Create Like action against a table. For more information see Initiating an object operation .

DBArtisan opens a Create Like wizard.

2 Provide a name for the new object.

3 Modify settings on each panel of the wizard as required.

For particular object types, tasks and settings on the panels of the Create Like wizard are similar to those for the object editors for that object type. For information, see:

Materialized Query Tables Editor (IBM DB2 LUW)

Tables Editor (IBM DB2 LUW)

Tables Editor (IBM DB2 Z/OS)

Tables editor (MySQL)

Logins Editor (SQL Server)

Tables Editor (SQL Server)

Users Editor (SQL Server)

Tables Editor (Oracle)

Logins Editor (Sybase)

Tables Editor (Sybase)

Users Editor (Sybase)

4 Click Execute to create the new object.

C

REATE OR

E

DIT

J

AVA

S

OURCE

NOTE:

This functionality is available for Oracle only.

58 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

The Java Editor lets you enter Java code. The table below describes the Java Editor toolbar options:

Option

Lock/Unlock Connection

Create

Errors

Description

Click to lock or unlock connection.

Click to open the Create Options dialog box, which lets you select the options for creating the java source.

Click to split the workspace in half, displaying the error messages in the lower half of the workspace.

When you add a script in a new file, you not only choose a name for the file, but choose among create options. Finally, when you complete your script, you can Preview, Schedule or immediately Execute it.

C

REATE

S

YNONYM

DBArtisan lets you perform an ad hoc Create Synonym operation against a specific object

displayed in the Datasource Explorer. For background information, see Synonyms

.

NOTE:

This function is available for Oracle.

You can perform this operation against the following object types:

Functions

Procedures

Materialized Views

Sequences

Packages

Tables

Package Bodies

Views

To create a synonym for an object

1 Expand the node corresponding to one of the object types supported for this operation, listed in the table above.

The right-hand pane is populated with all objects of that type.

2 Right-click the target object and select Create Synonym from the context menu.

3 A Create Synonym wizard opens.

For information on using the wizard, see

Synonym Wizard (Oracle)

.

C

REATE

V

IEW

Right-clicking one or more tables in the right pane of the explorer and selecting Create View opens a wizard that lets you create a new view. For more information, see the following topics:

View Wizard (DB2 LUW)

View Wizard (DB2 Z/OS)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 583

OB JEC T A C TIO N S > OB JE CT A C TIO N S

View Wizard (SQL Server)

View Wizard (Oracle)

View Wizard (Sybase)

DBCC

DBArtisan’s DBCC (Database Consistency Check) function box lets you:

• Specify single or multiple tables or indexes for validation.

• Perform database-wide validations.

• Perform object-level validations of databases.

NOTE:

This functionality is available for Microsoft SQL Server and Sybase ASE only.

To perform a Database Consistency Check

1 On the left pane of the Datasource Explorer, expand the Databases, Tables, or Indexes node.

DBArtisan displays objects of that type in the right pane of the Explorer window.

2 In the right pane of the Explorer window, select the specific object.

3 Initiate the DBCC operation using the method appropriate to the DBMS and object type:

• If you are checking consistency of a Sybase or SQL Server database or a SQL Server table, right-click the object and select DBCC from the context menu, as appropriate.

• If you are checking consistency of a Sybase table, right-click the table and select either

DBCC > Check Allocation, DBCC > Check Table, DBCC > Check Text, or DBCC >

Rebuild Index from the context menu, as appropriate.

• If you are checking consistency of a Sybase index, right-click the index and select either

DBCC > Check Allocation, or DBCC > Check Index from the context menu, as appropriate.

• If you are checking consistency of a SQL Server index, right-click the table and select either

DBCC > Check Fragmentation, DBCC > Update Usage, DBCC > Check Index, DBCC >

Show Statistics, or DBCC > Rebuild Indexes from the context menu, as appropriate.

DBArtisan opens a dialog that lets you specify DBCC options.

58 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

4 See the following topics as a guide to understanding and setting options on the dialog:

• DBCC for Microsoft SQL Server Databases

• DBCC for Microsoft SQL Server Tables

• DBCC for Microsoft SQL Server Indexes

• DBCC for Sybase ASE Databases

• DBCC for Sybase ASE Tables

• DBCC for Sybase ASE Indexes

5 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

DBCC

FOR

M

ICROSOFT

SQL S

ERVER

The DBCC (Database Consistency Check) dialog box lets you specify single or multiple tables or indexes for validation in Microsoft SQL Server. Use this dialog box to perform table-level or index-level validations of databases which are too large to undergo database-level DBCC operations in a time-efficient manner.

The DBCC dialog box includes the following elements:

• A window displaying the target database objects

• A drop-down list of DBCC Operations

• Buttons for previewing the operation’s SQL code, scheduling the operation, and executing the operation

For more information, see:

DBCC for Microsoft SQL Server Databases

DBCC for Microsoft SQL Server Tables

DBCC for Microsoft SQL Server Indexes

DBCC

FOR

M

ICROSOFT

SQL S

ERVER

D

ATABASES

The DBCC dialog box for databases lets you perform database-wide validations. You should validate your databases as part of regular database maintenance to guard against corruption and failure. Microsoft SQL Server offers a set of DBCC commands to validate the integrity of your databases. Generally, you should perform these DBCC commands prior to dumping your databases to ensure that you are capturing clean backups of your databases.

The fundamental difference between the DBCC dialog box for databases, tables and indexes is the content of the DBCC Operation drop-down list.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 585

OB JEC T A C TIO N S > OB JE CT A C TIO N S

The table below describes the options and functionality on the DBCC dialog box.

DBCC Operation

Check Allocation

Check Catalog

Check Database

Check FileGroup

Show Oldest

Transaction

Update Usage

Description

Executes a DBCC CHECKALLOC command. Makes sure that all data and index panels are correctly allocated and used. It reports on the amount of space allocated and used in the database. When checking allocation, you have the option to skip non-clustered indexes by selecting the Skip non-clustered indexes check box.

Executes a DBCC CHECKCATALOG command. Checks for consistency in and between system tables.

Executes a DBCC CHECKDB command. Verifies that all tables and indexes are properly linked, that indexes are in proper sorted order, that all pointers are consistent, that the data on each panel is reasonable, and that panel offsets are reasonable. When checking a database, you have the option to skip non-clustered indexes by selecting the Skip nonclustered indexes check box.

Executes a DBCC CHECKFILEGROUP command. Verifies that all tables and indexes for the specified filegroup are properly linked, that indexes are in proper sorted order, that all pointers are consistent, that the data on each panel is reasonable, and that panel offsets are reasonable. When checking filegroups, you have the option to skip non-clustered indexes by selecting the Skip non-clustered indexes check box.

Executes a DBCC OPENTRAN command. Displays information on the oldest active transaction and the oldest distributed and non distributed replicated transactions, if any, within the specified database.

Executes a DBCC UPDATEUSAGE command. Reports and corrects the rows, used, reserved, and dpanels columns of the sysindexes table for any clustered indexes on objects of the type

U (user-defined table) or S (system table).

For more information, see

DBCC.

DBCC

FOR

M

ICROSOFT

SQL S

ERVER

T

ABLES

The DBCC dialog box for tables lets you perform table-level validations of databases. The fundamental difference between the DBCC dialog box for tables and indexes is the content of the DBCC Operation drop-down list.

The table below describes the options and functionality on the DBCC dialog box.

Option

Check Current Identity

Value

Check Fragmentation

Description

Checks the current identity value for the target objects, correcting values if needed depending on parameter specifications. Identity columns created with a NOT FOR

REPLICATION clause in either the CREATE TABLE or ALTER TABLE statement are not corrected by this operation.

Displays the target table's data and index fragmentation information, determining whether the table is heavily fragmented.

When a table is heavily fragmented, you can reduce fragmentation and improve read performance by dropping and recreating a clustered index (without using the

SORTED_DATA option). Doing so reorganizes the data, resulting in full data pages. To adjust the level of fullness, use the Rebuild Index operation’s FILLFACTOR option.

When INSERT, UPDATE, and DELETE statements fragment tables, they usually do so with unequal distribution across the entire database so that each page varies in fullness over time, forcing additional page reads for queries that scan part or all of a table.

58 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Option

Check Table

Check Text/Image

Allocation

Pin Table

Rebuild Index

Unpin Table

Update Usage

Description

Checks the linkages and sizes of text, ntext and image pages for selected tables. For the data, index, text, ntext, and image pages of the target tables, this operation also checks that index and data pages are correctly linked, indexes are in their proper sorted order, pointers are consistent, the data on each page is reasonable, and the page offsets are reasonable. DBCC CHECKTABLE requires a shared lock on all tables and indexes in the database for the duration of the operation. However, DBCC

CHECKTABLE does not check the allocations of pages in the specified table (for this, use DBCC CHECKALLOC). To perform DBCC CHECKTABLE on every table in the database, use DBCC CHECKDB.

Checks the allocation of text, ntext, or image columns for a table. In later versions of

Microsoft SQL, use DBCC CHECKTABLE to check the integrity of the data, index, text, ntext, and image pages for the target table.

Pins target tables in memory so that they are not flushed when Microsoft SQL Server needs space to read in new pages. DBCC PINTABLE is best used for keeping small, frequently referenced tables in memory.

Pinning a large table can consume a large portion of the buffer cache, leaving inadequate memory to service other tables in the system. A pinned table that is larger than the buffer cache itself can fill the entire cache, necessitating a shut down of the system by a sysadmin user, who must then restart Microsoft SQL Server and unpin the table. Pinning too many small tables can result in a similar problem.

This option is not available for Microsoft SQL Server 2005.

Dynamically rebuilds one, multiple, or all indexes for a table in the target database, allowing indexes which enforce either primary key or unique constraints to be rebuilt without need for dropping and recreating. This operation is not supported for use on system tables.

Marks target tables as unpinned, rendering their pages flushable from the buffer cache if space is needed to read in a new page from disk.

This option is not available for Microsoft SQL Server 2005.

Reports and corrects inaccuracies in the sysindexes table (which can result in incorrect space usage reports by the sp_spaceused system stored procedure) and corrects the rows, used, reserved, and dpages columns of the sysindexes table for tables and clustered indexes. If there are no inaccuracies in sysindexes, DBCC UPDATEUSAGE returns no data. Use this operation to synchronize space-usage counters. Executing this operation on large tables or databases can require some time, so it should typically be used only when you suspect incorrect values returned by sp_spaceused.

For more information, see

DBCC.

DBCC

FOR

M

ICROSOFT

SQL S

ERVER

I

NDEXES

The DBCC dialog box for indexes lets you perform index-level validations of databases. The fundamental difference between the DBCC dialog box for tables and indexes is the content of the DBCC Operation drop-down list.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 587

OB JEC T A C TIO N S > OB JE CT A C TIO N S

The table below describes the options and functionality on the DBCC dialog box.

Option

Check

Fragmentation

Check Index

Rebuild Index

Show Statistics

Update Usage

Description

Displays the target index's table data and fragmentation information, determining whether the table is heavily fragmented. For more information, see tip below.

When a table is heavily fragmented, you can reduce fragmentation and improve read performance by dropping and recreating a clustered index (without using the SORTED_DATA option). Doing so reorganizes the data, resulting in full data pages. To adjust the level of fullness, use the Rebuild Index operation’s FILLFACTOR option. When INSERT, UPDATE, and

DELETE statements fragment tables, they usually do so with unequal distribution across the entire database so that each page varies in fullness over time, forcing additional page reads for queries that scan part or all of a table.

Checks the linkages and sizes of text and image pages for selected indexes. DBCC

CHECKTABLE requires a shared lock on all tables and indexes in the database for the duration of the operation.

Dynamically rebuilds all target indexes, allowing those which enforce either primary key or unique constraints to be rebuilt without need for dropping and recreating. This operation is not supported for use on system tables.

Displays the current distribution statistics for the target indexes. The results returned indicate the selectivity of each target index (a lower density equals a higher selectivity) and provide the basis for determining the usefulness of target indexes to the optimizer.

Reports and corrects inaccuracies in the sysindexes table (which can result in incorrect space usage reports by the sp_spaceused system stored procedure) and corrects the rows, used, reserved, and dpages columns of the sysindexes table for tables and clustered indexes. If there are no inaccuracies in sysindexes, DBCC UPDATEUSAGE returns no data. Use this operation to synchronize space-usage counters. Executing this operation on large tables or databases can require some time, so it should typically be used only when you suspect incorrect values returned by sp_spaceused. Additional Options: Update Index Option, and

DBCC General Option.

For more information, see

DBCC.

DBCC

FOR

S

YBASE

ASE

The DBCC (Database Consistency Check) dialog box lets you specify single or multiple databases, tables or indexes for validation in Sybase ASE. Use this dialog box to perform tablelevel or index-level validations of databases which are too large to undergo database-level

DBCC operations in a time-efficient manner.

The DBCC dialog box includes the following elements:

• A window displaying the target database objects

• A drop-down list of DBCC Operations

• Buttons for previewing the operation’s SQL code, scheduling the operation, and executing the operation

For more information, see:

DBCC for Sybase ASE Databases

DBCC for Sybase ASE Tables

58 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

DBCC for Sybase ASE Indexes

DBCC

FOR

S

YBASE

ASE D

ATABASES

The DBCC dialog box for databases lets you perform database-wide validations. The fundamental difference between the DBCC dialog box for databases, tables and indexes is the content of the DBCC Operation drop-down list.

The table below describes the options and functionality on the DBCC dialog box.

Option

Check Allocation

Check Catalog

Check Database

Check Storage

Database Repair

Description

Checks the allocation and use of all pages in the target database.

Checks for consistency in and between system tables in the target database.

Checks the allocation and structural integrity of all the objects in the target database.

Checks the target database for allocation, OAM page entries, page consistency, text valued columns, allocation of text valued columns, and text column chains. The results of this operation are stored in the dbccdb database.

Drops a damaged database.

For more information, see

DBCC.

DBCC

FOR

S

YBASE

ASE T

ABLES

The DBCC dialog box for tables lets you perform table-level validations of databases. The fundamental difference between the DBCC dialog box for tables and indexes is the content of the DBCC Operation drop-down list.

The table below describes the options and functionality on the DBCC dialog box.

Option

Check Allocation

Check Table

Check Text

Rebuild Index

Description

Checks the database to see that every page is correctly allocated, and that no allocated page is unused. Use TABLEALLOC frequently (daily) to check page linkages in the Adaptive Server before performing a database dump to ensure the integrity of the dumped data.

Checks the linkages and sizes of text, ntext and image pages for selected tables. For the data, index, text, ntext, and image pages of the target tables, this operation also checks that index and data pages are correctly linked, indexes are in their proper sorted order, pointers are consistent, the data on each page is reasonable, and the page offsets are reasonable.

DBCC CHECKTABLE requires a shared lock on all tables and indexes in the database for the duration of the operation. However, DBCC CHECKTABLE does not check the allocations of pages in the specified table (for this, use DBCC CHECKALLOC). To perform DBCC

CHECKTABLE on every table in the database, use DBCC CHECKDB.

Upgrades text values after you have changed an Adaptive Server's character set to a multibyte character set.

Dynamically rebuilds one, multiple, or all indexes for a table in the target database, allowing indexes which enforce either primary key or unique constraints to be rebuilt without need for dropping and recreating. This operation is not supported for use on system tables.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 589

OB JEC T A C TIO N S > OB JE CT A C TIO N S

DBCC Operation Options

DBArtisan offers additional options for selected operations which you can specify to further customize a database consistency check. The table below describes each option:

Option

Error Option

Job Scope

Update Index

Option

Description

Click Fix Error to instruct DBArtisan to fix any allocation errors it finds. You must put your database in single-user mode to fix errors, so specify this option during times of low usage.

Select Optimize to produce a report based on the allocation pages listed in the object allocation map (OAM) pages for the table. It does not report and cannot fix unreferenced extents on allocation pages that are not listed in the OAM pages. The optimized option is the default. Select Full to perform the equivalent of a table-level

CHECKALLOC, reporting all types of allocation errors. Select Fast to produce an exception report of pages that are referenced but not allocated in the extent. Fast does not produce an allocation report.

Click this check box to skip non-clustered indexes when updating index options.

For more information, see

DBCC.

DBCC

FOR

S

YBASE

ASE I

NDEXES

The DBCC dialog box for indexes lets you perform index-level validations of databases. Unlike the DBCC dialog box for tables, this DBCC dialog box offers only one option on the DBCC

Operation drop-down list: Check Allocation. This option checks the specified database to see that all pages are correctly allocated and that no allocated page is unused.

The table below describes the options and functionality on the DBCC dialog box.

Option

Error Option

Description

DBCC Option Checks the specified database to see that all pages are correctly allocated and that no page that is allocated is not used.

DBArtisan to fixes any allocation errors it finds. You must put your database in single-user mode to fix errors, so specify this option during times of low usage

Job Scope Produces a report based on the allocation pages listed in the object allocation map (OAM) pages for the table. It does not report and cannot fix unreferenced extents on allocation pages that are not listed in the OAM pages. The optimized option is the default. A full job is the equivalent to a table-level CHECKALLOC, reporting all types of allocation errors. A fast job does not produce an allocation report, but produces an exception report of pages that are referenced but not allocated in the extent.

For more information, see

DBCC.

D

EALLOCATE

U

NUSED

S

PACE

NOTE:

This functionality is available for Oracle only.

59 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

The Deallocate Unused Space dialog box lets you deallocate space from clusters, indexes, and tables. You can also deallocate unused space from table partitions and subpartitions. When you find that allocated space is not being used, you can free that space for use by other objects by explicitly deallocating space. Oracle releases the freed space to the user quota for the tablespace in which the deallocation occurs.

Oracle deallocates unused space from the end of the object toward the high water mark. In other words, Oracle frees space starting with the space that would have been used last. If an extent is completely contained in the space to be deallocated, then the whole extent is freed. If an extent is only partially contained in the space to be deallocated, then Oracle shrinks that extent to the size of the used space up to the high water mark, and frees the unused space in the extent.

If you are deallocating unused space from and index and the index is range-partitioned or hashpartitioned, Oracle deallocates unused space from each partition in the index. If an index is a local index on a composite-partitioned table, Oracle deallocates unused space from each of the subpartitions in the index.

TIP:

You can verify that the deallocated space is freed by going to the Space Tab in the appropriate DBArtisan editor.

To deallocate unused space from an index or table:

1 On the Datasource Explorer, select the Clusters, Indexes, Primary Keys, Tables, or Unique

Keys node.

DBArtisan displays the objects of the selected type in the right pane of the Explorer window.

2 In the right pane of the application, select one or more objects, and from the Command menu select Deallocate Unused Space.

DBArtisan opens the Deallocate Unused Space dialog box.

3 Use the following table as a guide to understanding and specifying options on this dialog:

Option

Specify the number of bytes above the high-water mark that the objects will have after deallocation. If no value is specified, all unused space will be freed.

Description

If you do not specify an amount of unused space and the high water mark is above the size of INITIAL and MINEXTENTS, then all of the unused space is freed. If the high water mark is less than the size of

INITIAL or MINEXTENTS, then all unused space above MINEXTENTS is freed.

If you specify an amount of unused space and the remaining number of extents is smaller than MINEXTENTS, then the MINEXTENTS value changes to reflect the new number. If the initial extent becomes smaller as a result of the deallocation, the INITIAL value changes to reflect the new size of the initial extent.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 591

OB JEC T A C TIO N S > OB JE CT A C TIO N S

D

ELETE

S

TATISTICS

Lets you create and issue a DELETE STATISTICS statement, allowing you to delete statistics for a table or for specified columns of a table.

NOTE:

This functionality is available for Sybase only.

To delete statistics for a table

1 Initiate a Delete Statistics action against one or more tables. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Delete

Statistics wizard:

Step

Action options

Columns (Sybase 15 only)

Settings and tasks

Displays the names of the tables you selected and if appropriate, lets you select a specific

Partition Name.

All columns - lets you delete statistics for all columns in the table.

Specific columns - select this option and then select check boxes associated with each specific column for which statistics are to be deleted.

Dependencies

Preview

Review the referring and referred objects that will be automatically resolved when you

execute this operation. For more information, see Dependencies

.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D

ESCRIBE

RIght-clicking a table, view, procedure or function in the right pane of the explorer and selecting

Describe opens a window that lets you view columnar information (for tables and views) or input

parameter information (for procedures and functions). For details, see Describe Window .

D

ETACH

D

ATABASE

The Detach Database object action removes the database from the server but leaves the database intact within the data and transaction log files that compose the database. These data and transaction log files can then be used to attach the database to any instance of Microsoft

SQL Server, including the server from which the database was detached. This makes the database available in exactly the same state it was in when it was detached.

NOTE:

This functionality is available for Microsoft SQL Server 2000 or later only.

59 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To detach data and transaction files for a database

1 On the Datasource Explorer, select the Databases node.

DBArtisan displays the Databases in the right pane of the Explorer window.

2 In the right pane of the application, right-click a database, and then select Detach Database.

DBArtisan opens the Detach Database(s) dialog box.

3 To skip the UPDATE STATISTICS operation when detaching the database, select the Skip

Checks check box for the target database(s).

TIP:

This option is useful for databases that are to be moved to read-only media.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see Attach Database.

D

ISABLE

I

NDEX

The Disable Index(es) action lets you mark an index as disabled or inactive and unavailable for use.

NOTE:

This functionality is available for Microsoft SQL Server 2005 and above.

NOTE:

On SQL Server this action can also be applied to primary keys and unique keys.

To disable an index

1 Initiate a Disable Index(es) action against one or more indexes. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the name of the index, primary key, or unique key being disabled.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D

ISABLE

J

OB

DBArtisan lets you enable or disable any job queue. Job Queues are built-in mechanisms that let you schedule a variety of SQL-based or command-line driven tasks.

NOTE:

This functionality is available for Oracle only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 593

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To disable a job queue

1 On the Datasource Explorer, select the Job Queues node.

DBArtisan displays the job queues in the right pane of the Explorer window.

2 In the right pane of the application, right-click the target job queue, and then select Disable

Job.

DBArtisan opens the Disable dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see Enable Job (Job Queue)

and Run Job .

D

ISABLE

K

EYS

DBArtisan lets you issue an ALTER TABLE statement that specifies the DISABLE KEYS option.

This action tells MySQL stop updating nonunique indexes.

NOTE:

This functionality is available for MySQL only.

To stop updates to nonunique indexes:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Disable Keys.

DBArtisan opens the Disable Keys dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you review the tables you selected.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

NOTE:

You can subsequently recreate missing indexes. For details, see Enable Keys

.

59 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

D

ISABLE

/E

NABLE

T

RIGGERS

These actions let you build and submit ALTER TABLE statements that specify ENABLE TRIGGER or DISABLE TRIGGER options.

NOTE:

This functionality is available for Microsoft SQL Server and Sybase ASE only.

To enable or disable triggers for a table

1 On the Database Explorer, select the Tables node. DBArtisan displays the tables in the

Database Explorer.

2 On the Database Explorer, right-click one or more selected tables and select Enable

Triggers or Disable Triggers.

DBArtisan opens the Enable Triggers or Disable Triggers dialog box, as appropriate.

3 Click Execute.

D

ISCONNECT

ASM C

ONNECTION

This action disconnects a direct connection to an ASM instance and reverts to the default datasource login.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

For information on connecting directly to an ASM instance, see

Manage ASM

Connection .

To disconnect from an ASM instance

1 On a connected Oracle datasource, expand the Instance node.

2 Right-click the ASM node and select Disconnect ASM Connection from the context menu.

D

ROP

NOTE:

This functionality is available for all DBMS platforms.

The Confirm Drop dialog box lets you drop one or more database objects and remove their definition from the system catalog.

To drop an object

1 On the Datasource Explorer, select the node corresponding to the object type to be dropped.

DBArtisan displays the target objects in the right pane of the Explorer window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 595

OB JEC T A C TIO N S > OB JE CT A C TIO N S

2 In the right pane of the application, right-click one or more selected objects, and then select

Drop from the context menu.

DBArtisan opens the Confirm Drop dialog box on the Action Options panel.

3 On the Action Options panel, select any options specific to the object type or configuration of the object you are dropping.

4 Navigate to the Dependencies pane to view database objects that are dependent on the object you are dropping.

NOTE:

For Microsoft SQL Server 2005, when dropping Logins, you also have the option to delete corresponding user objects.

NOTE:

For Microsoft SQL Server, when dropping Databases, you also have the option to delete the backup and restore history for the database.

5 Navigate to the Preview pane to verify that the correct DDL was created, and if necessary navigate backward and modify your choices.

6 Click Execute to drop the object.

D

ROP

B

Y

C

ATEGORY

This action lets you build and submit one or more calls to the outln_pkg.drop_by_cat subprogram, letting you drop outlines belonging to specified categories.

NOTE:

This functionality is available for Oracle only.

To drop one or more stored outlines of a particular category

1 Initiate a Drop By Category action against one or more stored outlines. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in this Drop By

Category wizard:

Step

Action Options

Preview

Settings and tasks

Select the categories to drop.

Displays the DDL that will execute the object action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see the following topics:

Change Category

Reassign By Category

59 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

D

ROP

C

LONE

If you have created a clone from a base table, you can drop that clone. To determine whether a table has a clone, see the Dependencies tab/panel on a Table editor or on the wizard for object actions such as Drop or Rename.

NOTE:

This functionality is available as of IBM DB2 for z/OS version 9.

To drop the clones of one or more tables:

1 Initiate a Drop Clone action against one or more tables. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Confirm

Drop Clone wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you review the action you initiated.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see the following topics:

Create Clone

Exchange Data With Clone

D

ROP

L

OGIN

T

RIGGER

The Drop Login Trigger action lets you build and submit an sp_modifylogin call that specifies a

NULL login script option. This removes the configured login trigger for the login, the default database stored procedure that executes each time the user successfully logs in.

NOTE:

This functionality is available for Sybase.

NOTE:

If a login has a login trigger configured, the specified stored procedure name is visible in the Login editor. For details, see

Logins Editor (Sybase)

.

To remove the currently configured login trigger for a login:

1 On the Datasource Explorer, expand the data source nodes until the Logins node is visible and then select the Logins node. DBArtisan displays the logins in the right pane of the

Explorer window.

2 Right-click a login and select Login Trigger Actions > Drop Login Trigger from the context menu. DBArtisan opens the Drop Login Trigger dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 597

OB JEC T A C TIO N S > OB JE CT A C TIO N S

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the login you selected to run the action against.

Review the referring and referred objects that will be automatically resolved when you execute this operation. For details, see

Dependencies .

Preview the DDL generated for the operation and when ready, click Execute.

For related information, see Add/Modify Login Trigger

.

D

ROP

M

ATERIALIZED

Q

UERY

T

ABLE

The Drop Materialized Query action lets you convert a materialized query table to a regular table.

NOTE:

This functionality is available for DB2 LUW.

To convert a materialized query table to a regular table

1 On the Datasource Explorer, expand the Materialized Query Tables node.

DBArtisan displays the materialized query tables in the right pane of the Explorer window.

2 In the right pane of the application, select one or more materialized query tables.

3 From the Command menu select Drop Materialized Query Table.

DBArtisan opens the Confirm MQT Conversion to Regular dialog box.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D

ROP

U

NUSED

This action lets you build and submit one or more calls to the outln_pkg.drop_unused subprogram, letting you drop outlines that have not been used since being created.

NOTE:

This functionality is available for Oracle only.

To drop one or more stored outlines that have not been used since being created

1 On the Datasource Explorer, expand the Stored Outlines node.

DBArtisan displays the stored outlines in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected stored outlines and select Drop Unused from the context menu.

DBArtisan opens the Drop Unused dialog box.

59 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

3 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Preview

Settings and tasks

Displays the DDL that will execute the object action.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D

ROP

U

NUSED

C

OLUMNS

This action lets you build and submit an ALTER TABLE... DROP UNUSED COLUMNS statement, letting you remove columns currently marked as unused.

NOTE:

This functionality is available for Oracle.

To drop the clones of one or more tables:

1 Initiate a Drop Unused Columns action against one or more tables. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Drop

Unused Columns wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the tables you selected

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

/.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

E

DIT

D

ATA

Right-clicking a table and selecting Edit Data lets you edit table data. For details, see

Data

Editor .

E

NABLE

/D

ISABLE

J

OB

(SQL A

GENT

J

OB

)

This action builds and submits an sp_update_job call with an @enabled argument. It lets you change the enabled/disabled status of a SQL Agent job.

NOTE:

This functionality is available for SQL Server only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 599

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To change the enabled/disabled status of a job

1 Initiate an Enable/Disable Job action against one or more jobs. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Enable/

Disable jobs wizard:

Step

Action Options

Preview

Settings and tasks

Select the Enable check box to enable the selected jobs. Deselect the Enable check box to disable the selected jobs.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

E

NABLE

/D

ISABLE

S

TORED

O

UTLINE

A

UTO

-

CREATION

/A

UTO

-

USE

DBArtisan provides two operations that can be performed against one or more stored outlines, that dictate whether execution plans are automatically generated or used:

Enable/disable stored outline auto-creation

Enable/disable stored outline auto-use

Lets you specify whether Oracle to create a stored outline for every query submitted to the server.

Lets you specify whether Oracle uses stored outlines to generate execution plans.

NOTE:

This functionality is available for Oracle only.

To specify whether stored outlines are automatically created and used

1 On the Datasource Explorer, expand the Stored Outlines node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 Select one or more stored outlines, on the Datasource Explorer tool bar click Command, and then select the item corresponding to the feature you want to enable or disable:

• Enable/disable stored outline auto-use

• Enable/disable stored outline auto-creation

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step Settings and tasks

Action Options Automatically create stored

outlines or Automatically use

stored outlines

Category

Lets you enable or disable the feature assocaited with your selection.

No Override

Lets you select an outline category. This option is only available if you enabled the feature.

If selected, outlines will not override. This option is only available if you enabled the feature.

60 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step Settings and tasks

Dependencies

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

4 When ready, click Execute.

E

NABLE

J

OB

(J

OB

Q

UEUE

)

DBArtisan lets you enable or disable any job queue. Job Queues are built-in mechanisms that let you schedule a variety of SQL-based or command-line driven tasks.

NOTE:

This functionality is available for Oracle only.

To enable a job queue

1 On the Datasource Explorer, select the Job Queues node.

DBArtisan displays the job queues in the right pane of the Explorer window.

2 In the right pane of the application, right-click the target job queue, and then select Enable

Job.

DBArtisan opens the Enable dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see Disable Job

and Run Job .

E

NABLE

K

EYS

DBArtisan lets you issue an ALTER TABLE statement that specifies the ENABLE KEYS option.

This action tells MySQL to recreate missing indexes.

To recreate missing indexes:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Enable Keys.

DBArtisan opens the Enable Keys dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 601

OB JEC T A C TIO N S > OB JE CT A C TIO N S

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you review the tables you selected.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

NOTE:

You can also instruct MySQL to stop updating nonunique indexes. For details, see

Disable Keys .

E

NABLE

R

ECYCLE

B

IN

This action builds and submits an ALTER SYSTEM SET "_recyclebin"=TRUE or ALTER SYSTEM

SET "_recyclebin"=FALSE statement, letting you enable or disable the Oracle Recycle Bin.

This action lets you enable or disable the Oracle Recycle Bin, building and submitting one of the following version-specific statement variations:

Oracle 10g R1 - ALTER SYSTEM SET "_recyclebin" TRUE / FALSE

Oracle 10g R2 - ALTER SYSTEM SET RECYCLEBIN ON / OFF SCOPE=BOTH

Oracle 11g - ALTER SYSTEM SET RECYCLEBIN ON / OFF DEFERRED SCOPE=BOTH (note that in this case, the change takes effect after reconnecting to the datasource)

When the Recycle Bin is enabled, dropped objects are stored in the Recycle Bin until explicitly purged.

NOTE:

This functionality is available for Oracle 10g.

60 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To enable or disable the Recycle Bin

1 Right-click an Oracle datasource node, and select Command > Enable Recycle Bin from the context menu.

2 Use the following table as a guide to understanding and modifying settings in this wizard:

Panel

Action Options

Preview

Settings and tasks

Select the Enable check box to enable Recycle Bin functionality. Deselect the Enable check box to disable the feature.

Displays the DDL that will execute the object action. For details, see Preview

.

NOTE:

In general, you can determine the current enabled/disabled state of the Recycle Bin by opening the Enable Recycle Bin dialog. If the Enable check box is selected, the

Recycle Bin is currently Note however, that the Enable Recycle Bin action reads the current state of the Recycle Bin by querying the v$parameter object. On some Oracle

10g R1 servers, the "_recyclebin" parameter does not appear listed in v$parameter – it is hidden. As a result, for this specific case, the value of the check box when opening the Enable Recycle Bin dialog will always be TRUE, regardless of the actual value.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

4

For related information, see:

Recycle Bin

(for a support summary including topics such as displaying Recycle Bin contents)

Flashback Recycle Bin Entry

Purge Recycle Bin Entry

Purge Recycle Bin

E

RROR

The Error message displays a warning. After reading the warning, click Close to continue.

E

STIMATE

S

IZE

The Estimate Size dialog box for tables and indexes lets you estimate how large a table or index will become given a row growth projection. The results let you proactively plan your spacerelated object needs.

NOTE:

This functionality is available for Oracle and Sybase ASE only.

To estimate size for a table or index:

1 On the Datasource Explorer, expand a Tables or Indexes node.

DBArtisan displays the tables or indexes in the right pane of the Explorer window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 603

OB JEC T A C TIO N S > OB JE CT A C TIO N S

2 In the right pane of the application, select one or more tables or indexes.

3 From the Command menu select Estimate Size.

DBArtisan opens the Estimate Size dialog box.

4 Use the following topics as a guide to estimating size and using the other options offered on this dialog:

Estimating Oracle index or table sizes

Estimating Sybase index or table sizes

E

STIMATING

O

RACLE INDEX OR TABLE SIZES

The Estimate Size dialog remains open until you manually close it. This lets you run several estimations, varying the method and various metrics. Each estimation run is a three-step process:

1 Select a size estimation method:

Use current row data from current statistics - The table or index must have been previously analyzed for statistics to be obtained. Note that the Analyze Index(es) and

Analyze Table(s) buttons can be used to initiate this action. For more details, see

Analyze .

Use table/index definition source - The maximum row length for the index or table will be calculated. Note that this usually produces much higher space estimates.

Manually enter estimation metrics - Manually enter in data for space estimates if the objects have no data or if the index definition source method is not desired.

2 Depending on the method you chose, provide additional metrics:

• Percent Free

• Row Size

• Number of rows

3 Click the Estimate Size button and view the estimate in the Estimated Index Size box.

Other options include:

• Use the Report button to generate an HTML report of results

• Use the Save As button to save a result grid file

• Use the Owner and Name controls to select another table or index for size estimates.

• Use the Add Index or Add Table button to add another table or index to your size estimates. Similarly, use the Remove Index or Remove Table button to remove a table or index from the dialog.

60 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

E

STIMATING

S

YBASE INDEX OR TABLE SIZES

The Estimate Size dialog remains open until you manually close it. This lets you run several estimations, varying the available metrics. Each estimation run is a two-step process:

1 Provide the metrics for your estimate:

Fill Factor (indexes only) - Specify a percentage of how full each index page can become.

Number of rows - Specify the number of rows for your size estimate.

NOTE:

Optionally you can use the Update Statistics button to open a dialog that lets you generate new statistics for the index or table. For details, see

Update Statistics .

2 Click the Estimate Size button and view the estimate in the Estimated Index Size box.

Other options include:

• Use the Report button to generate an HTML report of results

• Use the Save As button to save a result grid file

• Use the Database, Owner, Table Name, and Index Name controls to select another table or index for size estimates.

• Use the Add Index or Add Table button to add another table or index to your size estimates. Similarly, use the Remove Index or Remove Table button to remove a table or index from the dialog.

E

XCHANGE

D

ATA

W

ITH

C

LONE

This action lets you issue an EXCHANGE statement with the DATA BETWEEN TABLE table1

AND table2 syntax, letting you swap data between a base table and its clone. To determine whether a table has a clone, see the Dependencies tab/panel on a Table editor or on the wizard for object actions such as Drop or Rename.

NOTE:

This functionality is available as of IBM DB2 for z/OS version 9.

To exchange data between one or more tables and their clones:

1 On the Datasource Explorer, expand the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

2 In the right pane of the application, select one or more tables.

3 From the Command menu select Clone Actions > Exchange Data With Clone.

DBArtisan opens the Exchange Data With Clone dialog box.

4 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Settings and tasks

Lets you review the action you initiated.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 605

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step

Dependencies

Preview

Settings and tasks

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

5 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see the following topics:

Create Clone

Drop Clone

E

XECUTE

The Execution dialog box lets you execute extended procedures, functions, and procedures.

Platform and object type availability

DB2 LUW DB2 z/OS MySQL

Extended procedures

Functions

Procedures

9 9

Oracle

9

9

SQL Server Sybase

9

9 9

To compile an extended procedure, function, or procedure

1 In the left pane of the Datasource Explorer, select a valid object node. Valid object nodes for this object operation are shown in the table above.

2 In the right pane, right click the target object and select Execute from the context menu.

NOTE:

If the extended procedure, function, or procedure takes input parameters, DBArtisan

opens an execution dialog. For more information, see Working With Execution

Parameters

.

The Results editor opens, showing either results of a successfully executed extended procedure, function, or procedure, or showing error messages if execution was not successful. For details, see

Results Editor

.

W

ORKING

W

ITH

E

XECUTION

P

ARAMETERS

If you initiate an Execute action against an extended procedure, function, or procedure that takes input parameters, DBArtisan opens a dialog that lets you provide parameter values and otherwise manage parameters.

The Procedure Execution dialog box lets you:

60 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

• Save input parameters as *.prm files to preserve specific input parameter configurations.

• Open *.prm files to save the effort of reentering specific input parameters.

• Reset parameters to their default setting.

The table below describes the options and functionality of the Procedure Execution dialog box:

Option

Parameter

Open

Save

Reset

Default

Continue

Description

Specify the required input parameters in this window. If input parameters are not required for the execution of the target procedure, a message displays in this window, stating that the procedure

“has no input parameters. Press execute to run it.”

Click to open an Open dialog box, from which you can open an existing *.prm file. The saved parameters immediately populate the dialog box upon opening.

Click to save the values of your input parameters as a *.prm file. You can reopen a saved *.prm file from this dialog box at any time.

Click to reset the parameters in the Parameter window to their default values.

Select to gather default information from the data dictionary. ORACLE ONLY: You can not specify non-default parameters after specifying a default parameter.

Click to execute the procedure once you have entered values for all required parameters in the

Parameter window.

For more general information on the Execute operation, see Execute

.

E

XTRACT

DBArtisan lets you extract the statements required to create existing objects into an Interactive

SQL window.

NOTE:

This functionality is available for all DBMS platforms.

To extract the DDL for an object

1 On the Datasource Explorer, expand the node corresponding to the object type you want to extract.

DBArtisan displays objects of that type in the right pane of the Explorer window.

2 In the right pane of the application, select one or more objects.

3 On the Datasource Explorer tool bar, click Extract.

DBArtisan opens the DDL Editor with the DDL to create the selected objects. For more

information, see DDL Editors .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 607

OB JEC T A C TIO N S > OB JE CT A C TIO N S

E

XTRACT

D

ATA AS

XML

This function allows you to take SQL data, extract it, and make it available as XML data. The XML

Editor Filter allows you to pick and choose among columns and designate rows and then creates the For XML statement that enables the operation. The resulting XML document is created and presented in an active XML Editor. At this point the document can be saved in XML format.

NOTE:

This functionality is available for Oracle 9i, SQL Server 8.0, and Sybase 12.5.1 or later.

CAUTION:

To use the Extract Data as XML feature in Sybase, you must first purchase and install an XML Services license from Sybase.

To Open the XML Editor Filter

1 On the Datasource Explorer, expand the target data source.

2 Expand the Tables node.

3 In the right pane of the Explorer window, right-click any table listed, and then select Extract

Data as XML.

DBArtisan opens an XML Editor Filter dialog.

4 In the Columns area, select the check boxes corresponding to the columns with data you want to extract.

5 Optionally, in the Where box, type a WHERE clause to qualify the records that will be extracted.

NOTE:

As you select options, inspect the Select box to verify the query you are creating.

6 Use the table below as a guide to understanding and specifying the optional DBMS-specific settings in this dialog:

DBMS

Sybase

Oracle

Setting or group

Description

Refer to Sybase online documentation at http://infocenter.sybase.com

. Search the documentation corresponding to your Sybase version/product for XML mapping information.

Row Set Tag

Row Tag

Max Rows.

Identify the XML element name you want to use to replace the Row Set tag.

Identify the XML element names you want to use to replace the Row tag.

The maximum number of rows to fetch

60 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

DBMS Setting or group

XML Mode

Description

SQL Server

XML Options

AUTO mode returns query results as nested XML elements. For any table in the From clause with a column in the Select clause, it is represented as an XML element.

When you select RAW mode, each row in the query result set is transformed into an XML element with the generic row identifier. The

XML attribute name will be the same as the column name for non-null columns.

XML DATA specifies that an XML data schema will be returned.

ELEMENTS specifies that columns will be returned as subelements-otherwise they are mapped to XML attributes. This is an option only if

AUTO is selected.

When BINARY BASE64 is selected, any binary data is encoded in base-64 format. You must specify this option in RAW mode. It is the default for AUTO.

7 When ready, click OK. DBArtisan opens an XML representation of the extracted data in an

XML editor.

F

LASHBACK

R

ECYCLE

B

IN

E

NTRY

This action lets you build and submit a FLASHBACK TABLE... TO BEFORE DROP statement against a table in the Recycle Bin. This recovers the table and restores it to its state immediately before the drop.

NOTE:

This functionality is available for Oracle 10g.

NOTE:

The Datasource Explorer entry for a Recycle Bin entry has a Can Undrop field that indicates whether a Flashback Recycle Bin Entry action can be performed against the item

To recover a table currently in the Recycle Bin

1 In the left-hand pane of the Datasource Explorer, under an Oracle Schema node, select the

Recycle Bin node. Contents of the Recycle Bin are displayed in the right-hand pane.

2 Right-click one or more selected tables in the Recycle Bin and select Flashback Recycle Bin

Entry from the context menu. The Flashback Recycle Bin Entry dialog opens.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the table entries you selected to restore.

Review the referring and referred objects that will be automatically resolved when you execute this operation. For details, see

Dependencies .

Preview the DDL generated for the operation and when ready, click Execute.

4 Click Execute. For information on the other options, see

Preview

and Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 609

OB JEC T A C TIO N S > OB JE CT A C TIO N S

5

For related information, see:

Recycle Bin

(for a support summary including topics such as displaying Recycle Bin contents)

Enable Recycle Bin

Purge Recycle Bin Entry

Purge Recycle Bin

F

LASHBACK

T

ABLE

This action builds and submits a FLASHBACK TABLE statement, letting you restore a table to a state at some specified time in the past.

NOTE:

This functionality is available for Oracle 10g and above. Available options differ by the version of Oracle that DBArtisan is working against.

NOTE:

Before using this object action, consult Oracle documentation for information on restrictions, required permissions, and details on System Change Numbers and

Restore Points. For more information, see

Accessing Third Party Documentation

.

61 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To restore a table to some previous state

1 Initiate a Flashback Table action against a table. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings on the dialog:

Panel Settings and tasks

Action Options Type

SCN

Lets you select a specific FLASHBACK TABLE clause:

BEFORE DROP - If the table is currently in the Recycle Bin, the table will be restored to its state immediately before being dropped.

SCN - restores the table to a time corresponding to a specified System Change

Number.

TIMESTAMP - restores the table to a time corresponding to a specified timestamp value.

RESTORE POINT - (10g R2 ^) restores the table to a time corresponding to a specified name associated with an SCN.

If you selected a Type value of SCN, type a System Change Number.

Timestamp

If you selected a Type value of TIMESTAMP, use this control to provide a timestamp.

If you selected a Type value of RESTORE POINT, select a restore point.

Restore Point

(10g R2 ^)

Enable Trigger

If you selected a Type value of SCN, TIMESTAMP, or RESTORE POINT, selecting this check box overrides the default behavior, ensuring that triggers remain enabled during the flashback process.

Rename To

If you selected a Type value of BEFORE DROP, specify a new name for the table being retrieved from the Recycle Bin.

Dependencies

For details on using this tab, see

Dependencies .

Preview

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

4

For related information, see Flashback Recycle Bin Entry .

F

LUSH

C

ACHE

DBArtisan lets you clear all dynamic SQL in the cache for a package and forces IBM DB2 for

Linux, Unix, and Windows to recompile the SQL the next time it is called.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows 8.1 only.

To flush the cache for a package

1 On the Datasource Explorer, expand the target data source.

2 Expand the Packages node.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 611

OB JEC T A C TIO N S > OB JE CT A C TIO N S

3 In the right pane of the Explorer window, right-click any package listed, and then select

Flush Cache from the context menu.

DBArtisan opens the Flush Package Cache dialog box.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

F

LUSH

T

ABLES

This action lets you build and submit a FLUSH statement, specifying a TABLE or TABLES option.

This flushes the specified tables and removes all query results from the query cache.

NOTE:

This functionality is available for MySQL only.

To flush one or more tables:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 Right-click the table or tables and select Flush Tables from the context menu.

DBArtisan opens the Flush Tables dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the tables selected for this flush operation.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

F

REE

(P

ACKAGES

)

DBArtisan lets you delete one or more packages.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

61 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To delete packages:

1 Initiate a Free Packages action against one or more packages. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Confirm

Free wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the names of the packages you chose to free. This panel also lets you select a Order

Drop By Selection setting, which dictates whether drop statements are generated in the order objects are selected.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

F

REE

P

LAN

This action lets you drop plans associated with packages or DBRMs.

To drop a plan, use one of the following techniques

• Click the Free button on the Plans tab of the DBRMs editor. For more information, see

DBRMs Editor (IBM DB2 Z/OS)

.

• Click the Free button on the Plans/Packlists tab of the Packages editor. For more information, see

Packages Editor (IBM DB2 Z/OS)

.

For more information on dropping database objects, see Drop .

H

IDE

T

EXT

This action lets you build and submit sp_hidetext calls against one or more objects. This allows you to hide the source text for particular object types:

NOTE:

This functionality is supported for Sybase only.

CAUTION:

The Hide Text action is irreversible. Once hidden, source text cannot be made viewable or otherwise retrievable again.

NOTE:

For details on the specific elements hidden, consult Sybase documentation. See

Accessing Third Party Documentation

.

Within DBArtisan, when viewing an object after hiding text, hidden elements occupying entire tabs or individual property boxes, are annotated with a Source text for this compiled object is

hidden message.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 613

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Hide Text can be applied both to individual objects and to objects containing or owning other objects. Supported object types for which Hide Text can be applied to individual objects, and the resulting DBArtisan-specific hidden elements in object editors are as follows:

Check constraints

Defaults

Extended procedures

Functions

Procedures

Rules

Triggers

Views

Check Condition box, Definition tab.

Value box, Properties tab.

Library name box, Properties tab.

Definition tab.

Definition tab.

Restriction box, Properties tab.

Definition tab.

Definition tab.

Object-containing or object-referencing object types to which Hide Text can be applied are as follows:

Databases

Tables

Users

Hides the source text of all compiled objects in the selected database.

Hides the source text of all check constraints, defaults, and triggers defined on the selected table.

Hides the source text of all compiled objects owned by the selected user.

CAUTION:

Because of the potentially broad scope of hiding text for users and databases, you should exercise extreme care when applying Hide Text to those object types.

To permanently hide the source text for one or more objects:

1 In the left pane of the Datasource Explorer, expand nodes until the node corresponding to one of the target object types is visible, and select that node. Objects of that type are shown in the right pane.

2 In the right pane, right-click one or more selected objects, and then select Hide Text from the context menu. The Confirm Hide Text dialog opens.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Settings and tasks

Displays the name of the objects you selected.

61 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

Dependencies

Preview

Settings and tasks

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

4 Click Execute. For information on the other options, see

Preview

and Scheduling

.

Datasource Explorer views for supported objects show a Hidden property that indicates whether

Hide Text has been applied to the object. Y indicates that source text for this compiled object has been irreversibly hidden.

I

MPORT

D

ATA

F

ROM

F

ILE

RIght-clicking a table in the right pane of the explorer and selecting Import Data From File opens a dialog that lets you import table data from a file. For details, see

Import Data

.

L

OAD

J

AVA

Before you can call Java stored procedures, you must load them into the Oracle database and publish them to SQL.

NOTE:

This functionality is available for Oracle 8i or later.

The Java Load Wizard lets you:

• Select the owner of the Java object and the files to load.

• Select options for the loading of the files.

• Select Resolver options.

For more information, see

Java Load Wizard - Panel 1

.

J

AVA

L

OAD

W

IZARD

- P

ANEL

1

The table below describes the options of the first panel of the Java Load Wizard.

Option Description

Who owns the Java Object? Lets you select the owner of the Java object.

Select files to be loaded Select a file, and then click Add.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 615

OB JEC T A C TIO N S > OB JE CT A C TIO N S

J

AVA

L

OAD

W

IZARD

- P

ANEL

2

The table below describes the options of the second panel of the Java Load Wizard.

Option

When do you want the Java files to be resolved?

Description

Lets you specify when the source file is loaded as a source schema object, the source file is compiled, class schema objects are created for each class defined in the compiled .java file, and the compiled code is stored in the class schema objects.

Lets you specify the encoding of the .java file.

Select the Encoding

Options

Grant Access to the following users

Lets you select one or more users.

J

AVA

L

OAD

W

IZARD

- P

ANEL

3

The table below describes the options of the third panel of the Java Load Wizard.

Option Description

Other Load Options OPTIONAL: Lets you select options.

Add Resolver

Options

Lets you specify the objects to search within the schemas defined.

Add - Click to open the Select a Resolver Option dialog box to add a new resolver option in the list.

Edit - Click to open the Resolver Edit dialog box to modify a resolver option.

Remove - Select one or more resolver option and click to delete.

L

OCK

The Lock Table dialog box lets you lock tables to prevent other users from reading or updating the table data. Locking a table saves the time of locking each row of the table that needs to be updated. Lock mode options preventing other users from viewing or modifying table data, or allowing other users to view but not modify table data. DBArtisan releases locks at the end of a transaction.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows only.

To lock a table:

1 On the Datasource Explorer, select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected tables, and then select

Lock.

DBArtisan opens the Lock Table dialog box.

61 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

3 Select a Lock Mode option:

• Share - Lets other users view but not modify the table data.

• Exclusive - Prevents other users from viewing or modifying the table data.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

M

ANAGE

ASM C

ONNECTION

For working against ASM disk groups, DBArtisan lets you toggle the login between the general datasource and a specific connection to the associated ASM instance.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

When registering an Oracle datasource that has an ASM instance, you can use the

Connect as control to specify the SYSASM privilege. This give you full administrative privilege for the ASM instance. For details, see

Registering or Editing a Datasource

.

While you can create or edit disk groups using the basic datasource connection, you must connect directly to the ASM instance in order to use the following disk group object actions:

Check Disk Group

Mount Disk Group

Rebalance Disk Group

Undrop Disk

The Manage ASM Connection action lets you toggle between the two connection types.

To toggle the login between the datasource and the specific ASM instance

1 On a connected Oracle datasource, expand the Instance and ASM node.

2 Right-click the Disk Groups or ASM node and select Manage ASM Connection from the context menu. A Manage ASM Instance Connection dialog opens, prompting you to choose a connection type. Take one of the following actions:

• To connect directly to the ASM instance, deselect the Use existing connection to DB

instance check box, provide the connection details and logon credentials.

• To use the default connection to the associated datasource, select the Use existing

connection to DB instance check box.

3 Click OK.

NOTE:

The Manage ASM Instance Connection dialog also opens automatically on the first object action against a disk group after connecting to an Oracle datasource.

When connected to the ASM instance you can revert to the default datasource connection with a single step. For details, see

Disconnect ASM Connection .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 617

OB JEC T A C TIO N S > OB JE CT A C TIO N S

M

ERGE

C

OPY

The Merge Copy function makes a merged copy of the data sets within a table space. You can merge incremental copies of a tablespace to make one incremental copy, or you can merge incremental copies with a full image copy to make a new full image copy.

NOTE:

This functionality is available for IBM DB2 for z/OS.

To create a Merge Copy

1 On the Datasource Explorer, expand the Tablespaces node.

DBArtisan displays the Tablespaces in the right pane of the Explorer window.

2 Right-click the target tablespace and select MergeCopy from the context menu.

DBArtisan opens the MERGECOPY Utility wizard.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

1

2

Settings and tasks

Do you want the utility to be restartable?

Tape Stacking Properties

Yes or No

Yes or no. When you select Yes, you can then set the dataset

Properties.

Self-evident

Do you want to merge all incremental copies with the full image copy to make a new full image copy?

WorkDDN

Select tablespaces

Here you are setting the dataset information for the working data definition name.

lets you work with the list of tablespaces.

4 When ready, click Finish.

M

IGRATE

Right-clicking one or more objects and selecting Migrate from the context menu opens the

Migration Wizard, letting you migrate an object definition to another supported DBMS. For

information on using the wizard, see Using the Schema Migration Wizard

.

M

IRROR

The Mirror object action lets you build and submit a DISK MIRROR command, creating a mirror that immediately takes over when the primary device fails.

NOTE:

This functionality is available for Sybase.

61 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To create a database device mirror

1 Initiate a Mirror action against a database device. For more information see Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Mirror wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the database device you selected and lets you work with the following settings:

Mirror Name

Lets you specify the full path name of the database mirror device that is to be the secondary device.

Serial Writes

Contiguous (VMS only)

Lets you specify whether serial writes to the devices are enforced

If the mirror is a file rather than a device, this option forces the file to be created contiguously.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

/.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

M

ODIFY

R

ECOVERY

The Modify Recovery Wizard lets you delete records from SYSIBM.SYSCOPY, related log records from SYSIBM.SYSLGRNX, and entries from the DBD. You can delete records based on a specific age or based on the date the record was written.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

You should run the wizard regularly to clear outdated information from SYSIBM.SYSCOPY and

SYSIBM.SYSLGRNX. These tables, and particularly SYSIBM.SYSLGRNX, can become very large and take up considerable amounts of space. By deleting outdated information from these tables, performance for processes that access data from these tables can be improved.

To run the Modify Recovery utility

1 Initiate a Modify Recovery action against a tablespace. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Modify

Recovery Utility wizard:

Step

1

Settings and tasks

Select tablespaces

Add

Delete

Displays the available tablespaces.

Opens the Object Selector Dialog Box .

Deletes the selected items.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 619

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step

2

Settings and tasks

Delete history record(s) by

Age lets you delete history records by age, specifying a Number of

Days between 1 and 32767.

Date lets you delete all records written before a specified Date in eight digit format yyyymmdd (e.g. 20000218).

3 When ready, click Finish.

M

ODIFY

S

TATISTICS

The Modify Statistics Wizard lets you delete unwanted statistics history records from the statistics catalog tables. You can delete statistics history records that were written before a specific date, or records of a specific age. You can delete the records for an entire tablespace, index space, or index.

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS only.

You should run the wizard regularly to clear outdated information from the statistics history catalog tables. Deleting outdated information from the statistics history catalog tables, improves the performance of processes that access data from those tables.

To run the Modify Statistics utility

1 Initiate a Modify Statistics action against a tablespace. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Modify

Statistics wizard:

Step

1

2

3

Settings and tasks

Select tablespaces

Add

Delete

Select indexes

Add

Delete

Select indexspaces

Add

Delete

Displays the available tablespaces.

Opens the Object Selector Dialog Box .

Deletes the selected items.

Displays the available indexes.

Opens the Index Selector Dialog Box .

Deletes the selected items.

Displays the available indexspaces.

Opens the Indexspaces Selector dialog box.

Deletes the selected items.

62 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

4

Settings and tasks

Delete history record(s) by

Delete options

Age lets you delete history records by age, specifying a Number of

Days between 1 and 32767.

Date lets you delete all records written before a specified Date in eight digit format yyyymmdd (e.g. 20000218).

Lets you choose among Delete All statistics rows, Delete Access

path statistics rows, and Delete Space tuning statistics rows options

3 When ready, click Finish.

M

OUNT

D

ISK

G

ROUP

This action builds and submits an ALTER DISKGROUP... MOUNT or ALTER DISKGROUP...

DISMOUNT FORCE/NOFORCE statement. This lets you manually make disk groups available or unavailable to all database instances running on the same node.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

Before this object action is available you must have a direct connection to the ASM

instance. For details, see Manage ASM Connection .

To mount or dismount a disk group

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 Right-click the Disk Groups node and select Mount Disk Group from the context menu.

3 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

All - Selected, an ALTER DISKGROUP ALL... statement is generated, letting you the mount or dismount operation to occur in all disk groups.

Dismount - select this check box to make the disk group unavailable. Deselect this check box to have the disk group mounted.

Force - only available with Dismount selected. If Force is selected, ASM will dismount the disks even if some files in the disk group are open. If deselected, a NOFORCE option is used.

Restricted (available as of Oracle 11GR1) - When selected, a RESTRICTED clause is included in the generated ALTER DISKGROUP statement, mounting the disk in single-instance exclusive mode, making the disk group unusable by any ASM client.

When unselected, a NORMAL clause is included in the generated ALTER DISKGROUP statement, mounting the disk group in shared mode, and other ASM instances and clients can access the disk group.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 621

OB JEC T A C TIO N S > OB JE CT A C TIO N S

M

OVE

L

OG

DBArtisan lets you move a transaction log from one device to another.

NOTE:

This functionality is available for Sybase ASE only.

To move a database transaction log to another device:

1 On the Datasource Explorer, select the Databases node.

DBArtisan displays the Databases in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected databases, and then select Move Log from the context menu.

DBArtisan opens the Move Log dialog box.

3 From the New Device dropdown, select the defined device to which you want to move the transaction log. For information on creating database devices, see Database Device Wizard

(Sybase) .

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

N

EXT

U

SED

F

ILEGROUP

This action builds and submits an ALTER PARTITION SCHEME... NEXT USED statement, letting you alter the designated NEXT USED filegroup for a partition scheme.

NOTE:

This functionality is available as of SQL Server 2005.

To change a partition scheme’s next used filegroup:

1 Initiate a Next Used Filegroup action against a partition scheme. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Next Used

Filegroup

Preview

Settings and tasks

Select the new filegroup from the Filegroup Name dropdown.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

62 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

O

PEN

C

ONTROL

F

ILES

The control file contains information about the associated database that is required for the database to be accessed by an instance, both at startup and during normal operation.

NOTE:

This functionality is available for Oracle 8 or later only.

NOTE:

Only the Oracle database server can modify a control file's information; no user can edit a database's control file directly.

The Control File Information dialog box lets you view statistics (Type, Record Size, Records

Total, Records Used, First Index, Last Index, and Last Recid) on the following control file entries:

BACKUP DATAFILE BACKUP PIECE ACM OPERATION ARCHIVED LOG BACKUP

CORRUPTION

BACKUP REDOLOG BACKUP SPFILE BACKUP SET

DATABASE DATABASE BLOCK

CORRUPTION

DATAFILE HISTORY DELETED OBJECT

DATABASE

INCARNATION

FILENAME

CKPT PROGRESS

DATAFILE

FLASHBACK LOG

COPY CORRUPTION

DATAFILE COPY

MTTR

FOREIGN ARCHIVED

LOG

OFFLINE RANGE GUARANTEED

RESTORE POINT

PROXY COPY

RESTORE POINT

TEMPORARY

FILENAME

INSTANCE SPACE

RESERVATION

RECOVERY

DESTINATION

RMAN

CONFIGURATION

THREAD INSTANCE

NAME MAPPING

LOG HISTORY

REDO LOG

RMAN STATUS

REDO THREAD

STANDBY

DATABASE MATRIX

REMOVABLE

RECOVERY FILES

TABLESPACE

To view the control file for a database:

1 On the Datasource Explorer, under Storage select the Control Files node.

DBArtisan displays the Control Files in the right pane of the Explorer window.

2 In the right pane of the application, right-click a control file, and then select Open.

DBArtisan opens the Control File Information dialog box.

O

PTIMIZE

T

ABLES

DBArtisan lets you issue an OPTIMIZE TABLE statement, reclaiming unused space and defragmenting the data file.

NOTE:

This functionality is available for MySQL only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 623

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To optimize table storage:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 In the right pane of the application, select one or more tables.

4 From the Command menu select Optimize Tables.

DBArtisan opens the Optimize Tables dialog box.

5 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Lets you review the tables you selected.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

6 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

P

LACE

The Placement dialog box lets you place tables and indexes on different segments. From a performance standpoint it is not recommended to have a table and its supporting indexes on the same device or disk segment. It is also good to have more frequently accessed indexes and tables grouped together on higher speed devices, if possible.

NOTE:

Place functionality is available for Sybase ASE.

To place an index or table on a segment:

1 Initiate a Place action against one or more tables or indexes. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Place wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Use the Segment dropdown to specify the segment on which you can place objects, the default, logsegment or system.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

62 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

P

OPULATION STATUS

This action builds and submits an ALTER FULLTEXT INDEX statement with a START

{FULL|INCREMENTAL|UPDATE} POPULATION or STOP | PAUSE | RESUME POPULATION argument, letting you start, stop, pause or resume population of the full-text index.

NOTE:

This functionality is available as of SQL Server 2005.

NOTE:

Before using this action, consult Microsoft SQL Server documentation for detailed information on topics such as timestamp column restrictions on the INCREMENTAL option and the interaction of these options with the background update index and auto change tracking features

. For more information, see Accessing Third Party

Documentation .

To control population of a full-text index:

1 Initiate a Population Status action against one or more full-text indexes. For more information, see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action Options

Preview

Settings and tasks

Select an option from the Action dropdown:

START FULL - every row of the table is retrieved for full-text indexing, even rows that have already been indexed.

START INCREMENTAL - only the rows modified since the last population are retrieved. This option only works properly against tables with a timestamp column.

START UPDATE - only insertions, updates, or deletions processed since the last changetracking index update. Change-tracking population must be enabled on the table, but the background update index or the auto change tracking should be disabled.

STOP - stops a paused population or population in progress.

PAUSE - pauses a FULL population in progress

RESUME - resumes a paused FULL population.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

P

URGE

R

ECYCLE

B

IN

This action builds and submits a PURGE RECYCLEBIN, PURGE DBA_RECYCLEBIN, PURGE

TABLESPACE tablespacename, or PURGE TABLESPACE tablespacename USER username statement. This lets you select one of the following purge Recycle Bin options:

• Purge all objects belonging to the current user

• Purge all objects belonging to all users

• Purge all objects residing on a specified tablespace

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 625

OB JEC T A C TIO N S > OB JE CT A C TIO N S

• Purge all objects residing on a specified tablespace and belonging to a specified user

NOTE:

This functionality is available for Oracle 10g.

To purge objects in the Recycle Bin tables and associated objects

1 Expand the Schema node, right-click the Recycle Bin node and select Purge Recycle Bin from the context menu.

2 Use the following table as a guide to understanding and modifying settings on the Confirm

Purge Recycle Bin wizard:

Panel

Action Options

Preview

Settings and tasks

Purge

Tablespace

Select a PURGE option type:

RECYCLEBIN purges all objects belonging to the current user.

DBA_RECYCLEBIN purges objects system wide.

TABLESPACE purges objects residing on a specific tablespace.

If you selected a Purge value of TABLESPACE, select the tablespace for which all residing objects will be purged. Optionally, use the User control to further qualify the objects that will be purged.

User

If you selected a Purge value of TABLESPACE, you can use this control to restrict purging to only those tablespace-residing objects belonging to a particular user.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

4

For related information, see:

Recycle Bin

(for a support summary including topics such as displaying Recycle Bin contents)

Enable Recycle Bin

Flashback Recycle Bin Entry

Purge Recycle Bin Entry

P

URGE

R

ECYCLE

B

IN

E

NTRY

This action builds and submits a PURGE INDEX or PURGE TABLE statement, letting you permanently delete tables or indexes from the Oracle Recycle Bin. Once purged, the tables or indexes and any associated objects that were contained in the Recycle Bin are no longer retrievable.

NOTE:

This functionality is available for Oracle 10g.

NOTE:

The Datasource Explorer entry for a Recycle Bin entry has a Can Purge field that indicates whether a Purge Recycle Bin Entry action can be performed against the item

62 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To permanently purge selected tables or indexes currently in the Recycle Bin

1 In the left-hand pane of the Datasource Explorer, under an Oracle Schema node, select the

Recycle Bin node. Contents of the Recycle Bin are displayed in the right-hand pane.

2 Right-click one or more selected tables or indexes in the Recycle Bin and select Purge

Recycle Bin Entry from the context menu. The Confirm Purge Recycle Bin Entry dialog opens.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the table and index entries you selected to purge.

Review the referring and referred objects that will be automatically resolved when you execute this operation. For details, see

Dependencies .

Preview the DDL generated for the operation and when ready, click Execute.

4 Click Execute. For information on the other options, see

Preview

and Scheduling

.

5

NOTE:

When dropping tables on a datasource with the Recycle Bin feature enabled, the

DBArtisan Drop action has an option that lets you immediately purge the table.

For related information, see:

Recycle Bin

(for a support summary including topics such as displaying Recycle Bin contents)

Enable Recycle Bin

Flashback Recycle Bin Entry

Purge Recycle Bin

Q

UIESCE

DBArtisan lets you quiesce at the instance or database level. For details, see the following topics:

Quiesce (Database)

Quiesce (Instance)

Q

UIESCE

(D

ATABASE

)

This action lets you restrict user access to a database.

NOTE:

This functionality is available for IBM DB2 for Windows/Unix 8.1 only. DBArtisan does not support Quiesce Database for an IBM DB2 8 server from a IBM DB2 for Windows/

Unix 7 client or for an IBM DB2 for Windows/Unix 7 server from an IBM DB2 for

Windows/Unix 7 client.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 627

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To quiesce an database

1 On the Explorer, right-click a datasource node and select Command > Quiesce from the context menu. Provide login credentials if prompted.

2 Use the following table as a guide to understanding and modifying settings on the Quiesce

Database dialog:

Setting

Connections

Description

Lets you select an Immediate quiesce or Defer.

3 Click Execute.

For related information, see Unquiesce .

Q

UIESCE

(I

NSTANCE

)

This action lets you restrict user access to an instance.

NOTE:

This functionality is available for DB2 LUW 8.1 only.

To quiesce an instance

1 On the Explorer, right-click the Instance node.

2 Select Command > Quiesce from the context menu. Provide login credentials if prompted.

3 Use the following table as a guide to understanding and modifying settings on the Quiesce

Instance dialog:

Setting

For user

For group

Connections

Description

Select this radio button to restrict a user and then type the user name in the associated box.

Select this radio button to restrict a group and then type the group name in the associated box.

Lets you select an Immediate quiesce or Defer.

4 Click Execute.

For related information, see Unquiesce .

Q

UIESCE

T

ABLESPACES

The Quiesce Tablespaces action lets you build and submit a call to the online QUIESCE utility with a TABLESPACES option, establishing a quiesce point on a table space.

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS only.

62 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To quiesce a tablespace:

1 On the Datasource Explorer, select the Tablespaces node.

DBArtisan displays the Tablespaces in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected tablespaces, and then select Quiesce Tablespaces from the context menu.

DBArtisan opens the Quiesce Utility Wizard dialog box.

3 Optionally, deselect Write To Disk so that changed pages are not written to disk.

4 Click Finish.

For related information, see Recover .

R

EASSIGN

B

Y

C

ATEGORY

DBArtisan lets you reassign the category of stored outlines in Oracle.

NOTE:

This functionality is available for Oracle only.

Outlines are a set of results for the execution plan generation of a particular SQL statement.

When you create an outline, plan stability examines the optimization results using the same data used to generate the execution plan. That is, Oracle uses the input to the execution plan to generate an outline, and not the execution plan itself.

To reassign a stored outline to a different category

1 Initiate a Reassign By Category action against one or more stored outlines. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Reassign

By Category wizard:

Step

Action options

Preview

Settings and tasks

Displays the outlines you selected. Select a new category for the outline or outlines from the

Category dropdown.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see the following topics:

Change Category

Drop By Category

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 629

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EBALANCE

D

ISK

G

ROUP

This action builds and submits an ALTER DISKGROUP... REBALANCE statement with an optional

POWER option. This lets you manually rebalance the disk group, distributing datafiles evenly across drives.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

Before this object action is available you must have a direct connection to the ASM

instance. For details, see Manage ASM Connection .

To manually rebalance a disk group

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 Right-click the Disk Groups node and select Rebalance Disk Group from the context menu.

3 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

Power - If deselected, ASM executes rebalance operations at the power rate set by the

ASM_POWER_LIMIT initialization parameter. If selected, you can specify the power rate using the Power value control.

Power value - If Power is selected, specify a value between 0 and 11. A 0 value stops the rebalance operation and at the other extreme, 11 lets ASM execute the rebalance as quickly as possible.

Wait (available as of Oracle 11GR1) - Lets you specify a WAIT/NOWAIT clause, letting you specify when during the rebalance that control is returned to the user.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EBIND

P

ACKAGES

The Rebind Package dialog box lets you update the best access path for SQL statements when the contents of a package changes.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows and IBM DB2 for z/OS only.

TIP:

If the physical storage of a package is changed or dropped, rebinding updates the path of the SQL statements.

To rebind one or more packages:

1 On the Datasource Explorer, select the Packages node.

DBArtisan displays the Packages in the right pane of the Explorer window.

63 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

2 In the right pane of the application, select one or more packages, right-click the selected packages, and select Rebind from the context menu.

DBArtisan opens the Rebinding Package dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EBIND

P

LANS

This action lets you update the best access path for SQL statements when the contents of a plan change.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

TIP:

If the physical storage of a plan is changed or dropped, rebinding updates the path of the SQL statements.

To rebind a plan, use one of the following techniques

• Click the Rebind button on the Plans tab of the DBRMs editor. For more information, see

DBRMs Editor (IBM DB2 Z/OS)

.

• Click the Rebind button on the Plans/Packlists tab of the Packages editor. For more information, see

Packages Editor (IBM DB2 Z/OS)

.

R

EBUILD

(F

ULL

-

TEXT

C

ATALOGS

)

This action builds and submits a basic ALTER FULLTEXT CATALOG catalogname REBUILD statement, with no additional options or arguments. This lets you rebuild the entire catalog by deleting the existing catalog and building a new one.

NOTE:

This functionality is available as of SQL Server 2005.

To rebuild a full-text catalog:

1 Initiate a Rebuild action against one or more full-text catalogs. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the catalogs you selected.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 631

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EBUILD

I

NDEX

See the following topics for DBMS-specific instructions on rebuilding indexes:

• Rebuild Index (DB2 z/OS)

Rebuild Index (Oracle)

Rebuild Index (SQL Server)

R

EBUILD

I

NDEX

(DB2

Z

/OS)

The Rebuild Index Wizard reconstructs indexes from the table that they reference.

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS.

To rebuild one or more indexes

1 On the Datasource Explorer, expand the Indexes node.

DBArtisan displays the indexes in the right pane of the Explorer window.

2 Right-click the target index select Rebuild Index from the context menu.

DBArtisan opens the Rebuild Index Utility wizard.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Panel Option

1

Select Indexes

Add

2

3

Delete

Select tablespaces

Add

Delete

Do you want the utility to be restartable?

Do you want to reuse the db2 managed dataset?

WorkDDN

Description

Lets you select an index to rebuild.

For more information, see Index Selector Dialog Box .

Deletes the selected index(es).

Lets you select the target tablespace.

For more information, see Table Selector Dialog Box .

Deletes the selected items.

Select to make the utility restartable.

Default is No.

Do you want to specify to sort device type?

Do you want to specify the sort number?

Do you want to specify the sort keys?

Lets you select a work ddn template from the list or click

Edit to specify the dataset information.

Default is No.

Default is No.

Default is No.

63 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Panel Option

4

Do you want to specify the stats online?

5

Do you want to output message to SYSPrint?

Do you want to specify the correlation stats option?

Do you want to force aggregation or rollup processing to be done even though some parts do not contain data?

KeyCard

Description

Lets you specify the stats online.

The default is no.

Lets you specify correlation stats on the next panel of the wizard.

The default is Default.

6

Frequent Item

Add

Update Statistics

History Statistics

Collects all of the distinct values in all of the 1 to n key column combinations for the specified indexes. n is the number of columns in the index.

Lets you add items to the grid.

For more information, see Add Frequent Item Dialog

Box .

Lets you specify update statistics.

Lets you specify history statistics.

R

EBUILD

I

NDEX

(O

RACLE

)

NOTE:

This functionality is available for Oracle only.

The Rebuild Indexes dialog box lets you rebuild an index that has become fragmented.

Rebuilding an index is a good alternative to coalescing an index because you can move the index to a different tablespace and change both tablespace and storage parameters while eliminating fragmentation. However, rebuilding an index has a higher cost than coalescing an index. These same qualities also make rebuilding an index a viable alternative to dropping an index then re-creating it.

As a rule of thumb, check indexes for rebuilds when their level (or tree depth) reaches four or greater, or many deleted leaf rows are found. The Rebuild Indexes dialog box can also be used to easily move an index from one tablespace to another.

Important Notes

• If you are rebuilding a function-based index, the index is enabled when the rebuild is finished.

• You cannot rebuild a partitioned index. You must rebuild each partition or subpartition individually.

The table below describes the options and functionality on the Rebuild dialog box.

Option

New Tablespace

Logging

Description

Defaults to the tablespace which currently includes the index. To change the tablespace containing the index, choose a new tablespace from the list.

Recoverable - The creation of the index logs in the redo log file.

Non-Recoverable - The creation of the index is not logged in the redo log file.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 633

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Option

Use Parallel Processes

Order

Description

Performs processes for the sequential execution of a SQL statement in parallel using multiple parallel processes. One process, known as the parallel execution coordinator, dispatches the execution of a statement to several parallel execution servers and coordinates the results from all of the server processes to send the results back to the user.

NOTE: Only available for Oracle with the Parallel Server option.

NOPARALLEL execution - Select this if you are concerned that the cost of synchronizing parallel processes will impede the throughput of data.

Reverse - Instructs Oracle to store the bytes of the index block in reverse order and to exclude the ROWID when rebuilding the index.

No Reverse - Instructs Oracle to store the bytes of the index block in normal order when rebuilding the index.

To rebuild an Oracle index

1 On the Datasource Explorer, select the Indexes node.

DBArtisan displays the Indexes in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected indexes, and then select

Rebuild from the context menu.

DBArtisan opens the Rebuild Indexes dialog box.

3 To move the index to a new tablespace, click the New Tablespace list and then click the new tablespace.

4 In the Logging box, click:

• The Recoverable option button to make the operation log in the redo file.

• The Non-Recoverable option button if you do not want the operation logged in the redo file.

5 If you are using Parallel Server, select the Parallel Server check box and:

• Type a value indicating the number of query server processes that should be used in the operation in the Degree box.

• Type a value indicating how you want the parallel query partitioned between the Parallel

Servers in the Instances box.

6 In the Order box:

• Click the Reverse option button to rebuild the index to store the bytes of the index block in reverse order.

• Click the No Reverse option button to rebuild the index to store the bytes of the index block in order.

NOTE:

This option is only available for Oracle8.

7 Click Execute. For information on the other options, see

Preview

, and

Scheduling .

63 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

R

EBUILD

I

NDEX

(SQL S

ERVER

)

The Rebuild Indexes dialog box lets you rebuild an entire index, primary key, or unique key or a single partition of those objects. Depending on your choice, a number of REBUILD WITH clause options are available.

NOTE:

This functionality is available for Microsoft SQL Server 2005 and above.

To rebuild an index

1 Initiate a Rebuild Index action against one or more indexes, primary keys, or unique keys.

For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Rebuild

Index wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

To rebuild a single partition, specify a Partition number and optionally, provide Sort in

tempdb and MaxDOP property values used to create the REBUILD WITH clause.

To rebuild the entire index, primary key, or unique key, DO NOT provide a Partition Number, and optionally, provide Pad Index, Sort in tempdb, Ignore Duplicate Key, Statistics no

recompute, Online, Allow Row Locks, Allow Page Locks, MaxDOP, and Fill Factor property values used to create the REBUILD WITH clause.

For more information on these properties, see

Index Wizard (SQL Server)

.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

, and

Scheduling .

R

EBUILD

O

UTLINES

DBArtisan lets you rebuild one or more stored outlines in a single operation.

NOTE:

This functionality is available for Oracle only.

To rebuild a stored outline:

1 Initiate a Rebuild Outlines action against one or more stored outlines. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Rebuild

Outlines dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the stored outlines you selected.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 635

OB JEC T A C TIO N S > OB JE CT A C TIO N S

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EBUILD

T

ABLE

This action builds and submits an ALTER TABLE statement with an ENGINE=InnoDB option.

NOTE:

This functionality is available for MySQL only.

To rebuild a table:

1 Initiate a Rebuild Table action against one or more tables. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Rebuild

Table dialog:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the tables you selected.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

ECOMPILE

DBArtisan lets you recompile one or more tables. Recompilation causes each procedure and trigger that uses the target table to be recompiled the next time it runs.

NOTE:

This functionality is available for Microsoft SQL Server and Sybase ASE only.

The queries used by procedures and triggers are optimized only once, when they are compiled.

As you add indexes or make other changes to your database that affect its statistics, your compiled procedures and triggers may lose efficiency. By recompiling the procedures and triggers that act on a table, you can optimize the queries for maximum efficiency.

To recompile one or more tables:

1 On the Datasource Explorer, select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected tables, and then select

Recompile from the context menu.

DBArtisan opens the Recompile Tables dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

63 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

R

ECOVER

This action lets you build and submit a call to the RECOVER utility, recovers data to the current state or to a previous point.

NOTE:

This functionality is available for DB2 z/OS only.

To recover data to the current state or to some previous state

1 On the Datasource Explorer, select the Tablespaces or Indexes node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 In the right pane of the application, right-click a tablespace or index and then select Recover from the context menu.

DBArtisan opens the RECOVER Utility Wizard dialog box.

3 Complete the panels of the wizard and when complete click Finish.

R

EDISTRIBUTE

DBArtisan lets you redistribute the data in a nodegroup. The Redistribute action implements the

REDISTRIBUTE NODEGROUP and lets you specify UNIFORM, USING DISTFILE, USING

TARGETMAP, -CONTINUE, or ROLLBACK parameters.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows only.

To redistribute the data in a nodegroup:

1 On the Datasource Explorer, select the Nodegroups node.

DBArtisan displays the nodegroups in the right pane of the Explorer window.

2 In the right pane of the application, select one or more nodegroups, right-click the selected objects, and then select Redistribute from the context menu.

DBArtisan opens the Redistribute Nodegroup dialog box.

3 Select one of the following methods:

• Uniform

• Using Dist File (provide the distinct file name in the corresponding box)

• Using Target Map (provide the target file name in the corresponding box)

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 637

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EFIT

DBArtisan lets you refit a database device. If you are restoring a damaged master database, or have added devices since the last database or transaction log dump, then refit a device after reinitializing. Refitting a device ensures that the information in sysusages and sysdatabases is consistent with the information in sysdevices.

NOTE:

This functionality is available for Sybase ASE only.

To refit a database device

1 Initiate a Refit action against one or more database devices. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Refit wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Displays the database devices you selected for refitting.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EFRESH

T

ABLE

The Refresh Table Dialog box lets you reload materialized query tables that have been defined with refresh options.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows 8.1 and later.

To reload a materialized query table

1 Initiate a Refresh Table action against one or more materialized query tables. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings on the Refresh

Materialized Query Table dialog:

Pane

Action Options

Preview

Description

Select an Online Option of ALLOW NO ACCESS, ALLOW READ ACCESS or ALLOW

WRITE ACCESS.

Enable or disable Query Optimization.

Select an INCREMENTAL or NOT INCREMENTAL Refresh Option.

Preview the DDL generated by the options you chose.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

63 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Important Notes

For procedures on restoring a damaged master database, consult the Commands Reference

Manual.

R

EINITIALIZE

The reinitialize function allows you to keep a database device on the Sybase server open while resetting the device to its state immediately after it was opened.

NOTE:

This functionality is available for Sybase ASE only.

To reinitialize a database device

1 Initiate a Reinitialize action against a database device. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings on the

Reinitialize dialog:

Pane

Action Options

Dependencies

Preview

Description

Displays the database device you selected to reinitialize.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated by the options you chose.

3 Click Execute. For information on the other options, see

Preview

, and

Scheduling .

R

ENAME

This action lets you rename an object. In general, all referenced or referring objects are updated to reflect the new name.

The following table outlines object type support for the operation for all supported DBMS:

Alerts

Check constraints

Databases

Database links

Defaults

Extended procedures

Foreign keys

Indexes

Jobs

DB2 LUW DB2 z/OS MySQL

9

9

9

9

9

Oracle

9

9

9

9

9

9

SQL SVR Sybase

9

9

9

9

9

9

9

9

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 639

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Materialized Views

Operators

Primary keys

Procedures

Roles

Rules

Sequences

Stored outlines

Synonyms

Tables

Tablespaces

Unique keys

Views

DB2 LUW DB2 z/OS MySQL

9

9

9

9

9

9 9

9

9

9

9

9

9

9

9

9

Oracle

9

SQL SVR Sybase

9

9

9

9

9

9

The following table notes the exceptions and provides prerequisite tasks to be performed before renaming an object.

DBMS

Microsoft SQL Server

IBM DB2 for OS/390 and z/OS

Sybase ASE

Notes and restrictions on renaming

Microsoft SQL Server lets you rename a database if you own it. Before renaming a database, set it to single-user mode.

Microsoft SQL Server will not rename a table if it is referenced within the body of other objects that call it, such as tables, triggers or views. As a result, renaming a table can result in broken dependencies with other objects. Also, Microsoft SQL Server does not let you rename System Tables.

DBArtisan lets you rename a primary key if the underlying table has only one owner.

The rename operation does not rename the table if it is referenced within the body of other objects, such as tables, triggers or views, that call it. As a result, renaming a table can result in broken dependencies with other objects.

Before renaming a database, set it to single-user mode.

System indexes can not be renamed.

The rename operation does not rename the stored procedure if it is referenced within the body of other objects, such as another stored procedure, that call it. As a result, renaming a stored procedure can result in broken dependencies with other objects.

The rename operation does not rename the table if it is referenced within the body of other objects, such as tables, triggers or views, that call it. As a result, renaming a table can result in broken dependencies with other objects.

The rename operation does not rename the view if it is referenced within the body of other objects, such as stored procedures, triggers or other views, that call it. As a result, renaming a view can result in broken dependencies with other objects.

64 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To rename an object

1 Initiate a Rename action against a supported object (see the table above). For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Rename dialog:

Step

Rename

Dependencies

Preview

Settings and tasks

Name

Provide the new name for the object.

Review the referring and referred objects for which naming will be automatically resolved when you execute the renaming operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EORGANIZE

/R

EORG

DBArtisan offer Reorganize or Reorg options against the following DBMS platform/object types:

Reorganizing IBM DB2 for Linux, Unix, and Windows Objects

Reorganizing Oracle Objects

Reorganize (SQL Server indexes, primary keys, and unique keys)

Reorganize (SQL Server Full-text Catalogs)

Reorganize (Sybase Indexes and Tables)

Reorg Index (DB2 z/OS)

Reorg (DB2 z/OS Tablespaces)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 641

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EORGANIZING

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

O

BJECTS

Reorganize Dialog Box (One Table)

The table below describes the options and functionality on the Reorganize dialog box.

Step

Action Options

Partitions

Preview

Description

• Choose a Reorg Type of table or all indexes of the table.

• Optionally, choose an Index Schema and specify an Index name.

• Enable or disable Inplace Reorg and if you enable, choose an

Inplace reorg mode of Start, Stop, Pause, or Resume.

• Select an Access mode to control read and write access.

• Select an Index reorg mode to clean up empty pages, delete after cleaning up empty pages, or convert to a type 2 index.

• If you did not enable Inplace Reorg, select a Tablespace.

• Select a Long Tablespace.

• Enable or disable the following options: Index scan, Reorg long

field and LOB data, Reset Dictionary, No truncate table, and

Reorganize all partitions.

If you did not enable Reorganize all partitions, select the partitions to reorganize.

Preview the DDL code generated from your choices.

Reorganize Dialog Box (Multiple Tables)

The table below describes the options and functionality on the Reorganize dialog box.

Option

Temporary Tablespace

Description

Associates a temporary tablespace with the table's tablespace. You can select another tablespace from the list.

R

EORGANIZE

(SQL S

ERVER INDEXES

,

PRIMARY KEYS

,

AND UNIQUE KEYS

)

The Reorganize Indexes dialog box lets you reorganize an entire index, primary key, or unique key or a single partition of that object. It also lets you specify a LOB_COMPACTION option.

NOTE:

This functionality is available for Microsoft SQL Server 2005 and above.

NOTE:

You cannot reorganize an index (primary key, or unique key) that has an Allow Page

Locks property set to FALSE. For information on setting index properties, see Indexes

Editor (SQL Server)

.

64 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To reorganize an index

1 On the Datasource Explorer, expand nodes until Microsoft SQL Server index nodes, primary keys, or unique keys are displayed.

2 Right-click an index, primary key, or unique key and select Reorganize from the context menu. The Reorganize Index wizard opens.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

To reorganize a single partition, specify a Partition number and optionally, specify Lob

Compaction used to create the REORGANIZE WITH clause.

To reorganize the entire index, primary key, or unique key, DO NOT provide a Partition

Number, and optionally, specify Lob Compaction used to create the REORGANIZE WITH clause.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EORGANIZING

O

RACLE

O

BJECTS

The Reorganize dialog box lets you reduce query processing time against tables.

To reorganize an Oracle table

1 Initiate a Reorganize action against a table. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the

Reoganize dialog:

Panel Group

Action Options Reorganize method

Tablespace

Data Block

Storage

Setting and description

Online - If selected, reorganization is carried out online, using

DBMS_REDEFINITION procedures. DBMS_REDEFINITION is Oracle’s online table reorganization package and is available for Oracle 9i.

During an online reorganization, the table can still be accessed using DML statements like SELECT and UPDATE.

If this check box is unselected, reorganization is carried out using a series of simple ALTER TABLE statements. This method is intended for offline usage.

If you want to move the table(s) to a new tablespace, select the new tablespace from this list.

Type ALTER TABLE property values for the Percent Free (PCTFREE property),

Percent Used (PCTUSED property), Initial Transactions (INITTRANS property), and Max Transactions (MAXTRANS property).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 643

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Panel Group

Extents

Setting and description

Type an ALTER TABLE MOVE STORAGE property value for the Initial Extent

(INITIAL) property).

Type ALTER TABLE STORAGE property values for the Next Extent (NEXT property), Percent Increase (PCTINCREASE property), Minimum Extents

(NEXT property), and Maximum Extents (MAXEXTENTS property).

Freelists

Use the Free Lists and BufferPool (DEFAULT, KEEP, RECYCLE) settings to provide values for the FREELISTS and BUFFER_POOL components of a

STORAGE clause.

Use the Free List Groups setting to provide a value for the FREELIST GROUPS component of a STORAGE clause

Parallel Query

Use the Parallel Degree setting to provide a value for the DEGREE component of a PARALLEL clause. This specifies the number of servers used in processing operations.

Physical

Logging - When disabled, a NOLOGGING clause is added to the ALTER TABLE statement.

Dependencies

For details on using this tab, see

Dependencies .

Preview

For details on using this tab, see

Preview .

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EORGANIZE

(SQL S

ERVER

F

ULL

-

TEXT

C

ATALOGS

)

This action builds and submits a basic ALTER FULLTEXT CATALOG catalogname REORGANIZE statement, with no additional options or arguments. This lets you merge smaller indexes into a larger, master index.

NOTE:

This functionality is available as of SQL Server 2005.

To reorganize a full-text catalog:

1 Initiate a Reorganize action against one or more full-text catalogs. For more information, see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the catalogs you selected.

Lets you review the objects potentially impacted by this action.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

EORGANIZE

(S

YBASE

I

NDEXES AND

T

ABLES

)

The Reorganize dialog box lets you reduce query processing time against tables. This functionality is available for both tables and indexes.

64 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

For more information, see

Reorganizing Sybase ASE Tables

Reorganize Sybase ASE Indexes

R

EORGANIZING

S

YBASE

ASE T

ABLES

This action lets you build and submit one of four REORG subcommands: FORWARDED_ROWS,

RECLAIM_SPACE, COMPACT, or REBUILD. REORG optimizes the use of table space and improves performance.

The Reorganize Table dialog box lets you reduce the query processing time against a table by reorganizing the table to ensure that space is properly allocated to it. For lengthy reorganization processes, this dialog box also lets you execute a process in increments, lets you resume an incomplete process, and lets you specify the duration of each increment. For more information, see

Incremental Reorganizations

.

TIP:

Frequent update activity on a table can cause data rows to migrate and to chain over multiple data pages. Chained or forwarded rows can degrade performance because more physical reads are required to access a row of data. Consequently, you should monitor chained rows regularly to spot performance bottlenecks before they become severe. In addition, altering physical storage parameters can lead to fragmentation of space on your data pages, which also results in reduced performance levels.

You should consider reorganizing a table if you are experiencing slow performance due to:

• A large number of chained or forwarded rows on your data pages

• A large amount of fragmentation in your data pages

NOTE:

You can reorganize tables in Sybase ASE versions 12 and 12.5.

The table below describes the options and functionality on the Reorganize Table dialog box:

Option

Compact

Description

Lets you reclaim space and undo row forwarding.

Minimizes interference with other activities by using multiple small transactions of brief duration. Each transaction is limited to eight pages of reorg processing. These three commands also provide resume and time options that allow you to set a time limit on how long a reorg runs and to resume a reorg from the point at which the previous reorg stopped, making it possible to use a series of partial reorganizations at off-peak times to reorg a large table.

For information on result options, see

Incremental Reorganizations

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 645

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Option

Reclaim Space

Rebuild

Undo Row

Forwarding

Options

Description

Lets you reclaim unused space resulting from deletions and row-shortening updates on a page.

Minimizes interference with other activities by using multiple small transactions of brief duration. Each transaction is limited to eight pages of reorg processing. These three commands also provide resume and time options that allow you to set a time limit on how long a reorg runs and to resume a reorg from the point at which the previous reorg stopped, making it possible to use a series of partial reorganizations at off-peak times to reorg a large table.

For information on result options, see

Incremental Reorganizations

.

Lets you undo row forwarding and reclaim unused page space. It also rewrites all rows to comply with the target table's clustered index, writes rows to data pages to comply with space management setting changes (via sp_chgattribute), and drops and re-creates all the target table's (or tables') indexes.

Reorg rebuild holds an exclusive table lock for its entire duration. On a large table this can be a significant amount of time. However, reorg rebuild accomplishes everything that dropping and re-creating a clustered index does and takes less time. In addition, reorg rebuild rebuilds the table using all of the table's current space management settings. Dropping and recreating an index does not use the space management setting for reservepagegap. In most cases, reorg rebuild requires additional disk space equal to the size of the table it is rebuilding and its indexes.

Lets you undo row forwarding, a process that occurs when an update increases a row's length in a data-only-locked table such that the row is too large to fit on its original page.

Start at the point where a previous reorg left off - Select to resume a previously initiated but incomplete partial reorganization. Then specify the duration for which you want the resumed reorganization to continue before stopping again. This box is disabled for the rebuild command.

I

NCREMENTAL

R

EORGANIZATIONS

If target tables are too long to reorganize in one session, DBArtisan lets you reorganize them in increments over multiple sessions by specifying a maximum duration for each session. After

DBArtisan reorganizes tables for the specified duration, the operation stops until you resume it again from the Options box of the ReOrganize Table dialog box. The Options box lets you specify to resume a previously initiated but incomplete partial reorganization. It also lets you specify the duration for which you want a resumed reorganization to continue before stopping again. The Option box is disabled for the rebuild command.

NOTE:

The duration you specify refers to elapsed time, not CPU time

64 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

In the option box, if you select the check box without specifying a duration, DBArtisan executes the reorg at the point where the previous reorg stopped and continues to the end of the target tables. If you clear the check box and specify a duration, the reorg starts at the beginning of the target tables and continues for the specified number of minutes. If you select the check box and specify a duration, DBArtisan runs the reorg from the point where it last left off, and continues for the specified number of minutes.

NOTE:

If you reorganize a table using one command (Compact, Reclaim Space, or Undo

Forwarding) for a specified duration, you cannot resume the process from its resume point using a different command. For example, you cannot compact a table for an hour, and then reclaim space on the remainder of the table. A resumed reorganization process must utilize the same command from start to finish. Selecting a different command begins a new reorganization process.

CAUTION:

While this option lets you reorganize a large table in multiple manageable pieces, any updates to the table between reorganization runs can cause pages to be skipped or processed more than once.

R

EORGANIZE

S

YBASE

ASE I

NDEXES

The Reorganize Index dialog box lets you reduce the query processing time against a table by running a reorg rebuild command on the target index.

This operation:

• Undoes row forwarding and reclaim unused page space

• Rewrites all rows in the table to comply with the table's clustered index

• Writes rows to data pages to comply with space management setting changes (via sp_chgattribute)

• Drops and re-creates the table's indexes

Reorg rebuild holds an exclusive table lock for its entire duration. On a large table this can be a significant amount of time. However, reorg rebuild accomplishes everything that dropping and re-creating a clustered index does and takes less time. In addition, reorg rebuild rebuilds the table using all of the table's current space management settings. Dropping and re-creating an index does not use the space management setting for reservepagegap. In most cases, reorg rebuild requires additional disk space equal to the size of the table it is rebuilding and its indexes.

R

EORG

I

NDEX

(DB2

Z

/OS)

This action lets you build and submit a REORG INDEX utility call.

NOTE:

Before using this action consult IBM documentation for details on REORG INDEX utility

options. For online access to DB2 documentation, see Accessing Third Party

Documentation .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 647

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To reorganize an index

1 Initiate a Set Default action against a tablespace. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in this wizard.

Note that some settings are only available based on other selections.

Setting

Select Indexes

Description

On opening, the list displays the index you chose to reorganize.

Optionally, you can add more indexes to the list that are to be reorganized by clicking Add. Adding indexes using the Index Selector dialog is a two-step process. Use the Database Like, Index Creator, Index Like, and Match Case controls to provide a search criteria pattern and then click Query to display qualified indexes in the Index Selector list. Then select one or more indexes from the list, click Add, and close the dialog.

To remove a selected index from the list to be reorganized, select the index in the list and click Delete.

Select this check box to make the utility restartable.

Do you want the utility to be reusable

Share Level

Deadline

Lets you select share level that allows users to view but not modify the table data: REFERENCE, CHANGE, or None.

Lets you specify a deadline for the switch phase of reorganization to start. If

DBArtisan estimates that the switch phase will not start by the deadline,

DBArtisan terminates reorganization.

None - Specifies that there is no deadline for the read-only iteration of log processing.

Timestamp - Specifies the deadline for the switch phase to start processing.

labeled-duration-expression

-

Click the ... button to open a dialog that lets you build a custom CURRENT_TIMESTAMP or CURRENT_DATE value.

Drain Specification

Fast Switch

Maxro (only available with a

Share Level of CHANGE)

Drain (only available with a Share

Level of CHANGE)

Lets you specify that DB2 drains the write claim class after the delay. The number of log records, and thus the estimated time, for a future iteration of log processing will be 0.

Keeps the data set name unchanged and updates the catalog to reference the newly reorganized data set.

Lets you DEFER or specify the maximum amount of time for the last iteration

(read-only access iteration) of log processing.

Lets you specify drain behavior (WRITERS or ALL) at the end of the log phase after the MAXRO threshold is passed and when the last log iteration is to be applied:

Lets you provide a LONGLOG value of CONTINUE, DRAIN, or TERM Long Log (only available with a

Share Level of CHANGE)

Delay (only available with a Share

Level of CHANGE)

Timeout (only available with a

Share Level of CHANGE)

Lets you specify the minimum interval between the time REORG sends the

LONGLOG message to the console and the time REORG performs the action specified by the Long Log setting.

Lets you specify a timeout option of ABEND or TERM.

64 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Setting

Leaf dist limit

Report

Unload

Do you want to specify the stats option

Do you want to output message to SYSPRINT

Do you want to specify the correlation stats option

Do you want to force aggregation or rollup processing to be done event though some parts do not contain data

Work DDN

Would you like to preformat

Description

Lets you specify the value that is to be compared to the LEAFDIST value for the specified partitions of the index in SYSIBM.SYSINDEXPART. If any LEAFDIST value exceeds the specified Leaf dist limit, REORG is performed or, if you specify REPORTONLY, recommended.

If selected, REORG is only recommended.

Specify a continue or terminate value of CONTINUE, ONLY, or PAUSE.

Specifies that statistics are to be collected and either reported or stored in the

DB2 catalog.

Specifies that a set of messages is to be generated to report the collected statistics and output to SYSPRINT.

Lets you specify a correlation-stats-spec for statistics reporting.

Specifies whether statistics are to be aggregated or rolled up when RUNSTATS is executed.

Lets you specify a DD name or a TEMPLATE name from a previous TEMPLATE control statement.

Lets you specify that remaining pages are to be preformatted up to the highallocated RBA in the index space.

3 When ready, click Finish.

R

EORG

(DB2

Z

/OS T

ABLESPACES

)

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS only.

The Reorganize Tablespace Wizard reorganizes a tablespace to improve access performance and reclaim fragmented space. The wizard can also reorganize a single partition or range of partitions of a partitioned table space. You can specify the degree of access to the data during reorganization, and optionally collect inline statistics.

Completing the Reorganize Tablespace Wizard

To complete the Reorganize Tablespace Wizard, do the following:

1 On the Datasource Explorer, select the tablespaces node.

DBArtisan displays the tablespaces in the right pane of the Explorer window.

2 On the Datasource Explorer tool bar, click Command, and then select Reorganize.

DBArtisan opens the Reorganize Tablespace Wizard.

3 Complete the wizard panels, and then click Finish.

DBArtisan opens the

Preview

dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 649

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Do you want the utility to be restartable?

Database

Description

Select to make the utility restartable.

Tablespace

Partition

Reuse

Displays the list of databases in the system. You can select the tablespace database or click the filter button to limit the list of databases to a string pattern.

Displays the list of tablespaces.

Lets you specify a partition or a range of partitions.

Select to reuse this tablespace.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Log

Sort Data

No Sysrec

Sortkeys

Description

List of the sequence of events after you execute the wizard.

Sorts columns alphanumerically in single result sets.

Select Yes for no sysrec.

Select Yes for sortkeys. Specifies that index keys are to be sorted and built in parallel during the

SORTBLD phase to improve performance.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

3

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Share level

Deadline

Drain Specification

Fast Switch

Description

Lets you select share level that allows users to view but not modify the table data: None,

Reference, or Change.

Lets you specify a deadline for the switch phase of reorganization to start. If DBArtisan estimates that the switch phase will not start by the deadline, DBArtisan terminates reorganization.

None - Specifies that there is no deadline for the read-only iteration of log processing.

Timestamp - Specifies the deadline for the switch phase to start processing.

Click the button to open the

Deadline Expression Builder dialog box.

Lets you specify that DB2 drains the write claim class after the delay. The number of log records, and thus the estimated time, for a future iteration of log processing will be 0.

Keeps the data set name unchanged and updates the catalog to reference the newly reorganized data set.

65 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Deadline Expression Builder

The table below describes the options and functionality on the Deadline Expression Builder dialog box:

Option

Current Date

Current Timestamp

Description

Lets you select today as the basis of the deadline, click + or -, type the number of years, months, days, hours, minutes, seconds and microseconds.

Lets you select the current timestamp as the basis of the deadline, click + or -, type the number of years, months, days, hours, minutes, seconds and microseconds.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

4

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Local Site Primary

Local Site Backup

Recovery Site Primary

Recovery Site Backup

Description

Lets you specify the Local Site Primary.

Lets you specify the Local Site Backup.

Lets you specify the Recovery Site Primary.

Lets you specify the Recovery Site Backup.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

5

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Off Pos Limit

Ind Ref Limit

Report Only

Description

The specified value is compared to the result of the calculation (NEAROFFPOSF +

FAROFFPOSF) × 100 / CARDF for the specified partitions in SYSIBM.SYSINDEXPART for the explicit clustering indexes for every table in the specified table space. Alternatively, the values in SYSINDEXPART are checked for a single non-partitioned table space, or for each partition if you specified an entire partitioned table space as the target object. If at least one calculated value exceeds the OFFPOSLIMIT value, REORG is performed or recommended.

NOTE: This option is valid for non-LOB table spaces only.

The specified value is compared to the result of the calculation (NEARINDREF + FARINDREF)

× 100 / CARDF for the specified partitions in SYSIBM.SYSTABLEPART for the specified table space. Alternatively, the values in SYSTABLEPART are checked for a single non-partitioned table space, or for each partition if you specified an entire partitioned table space as the target object. If at least one calculated value exceeds the INDREFLIMIT value, REORG is performed or recommended.

NOTE: This option is valid for non-LOB table spaces only.

The reorganization is only recommended, not performed.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 651

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Option

Unload

Description

Specifies whether the utility job is to continue processing or end after the data is unloaded.

Continue - Specifies that, after the data has been unloaded, the utility continues processing.

Pause - Specifies that after the data has been unloaded, processing ends.

Only - Specifies that after the data has been unloaded, the utility job ends and the status in

SYSIBM.SYSUTIL corresponding to this utility ID is removed.

External - Specifies that after the data has been unloaded, the utility job is to end and the status in SYSIBM.SYSUTIL corresponding to this utility ID is removed.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

5

NOTE:

This panel is displays only if the share level is Change.

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Table Owner

Table

Maxrow

Drain

Long Log

Delay

Timeout

Description

Displays the schema names in the system.

Displays all tables for the selected schema.

Lets you specify the maximum amount of time for the last iteration of log processing. During that iteration, applications have read-only access. Type an integer value or select DEFER. DEFER

Specifies that the iterations of log processing with read/write access can continue indefinitely.

Lets you select Writers or All. Specifies that DBArtisan drains the write claim class after the delay.

The number of log records, and thus the estimated time, for a future iteration of log processing will be 0.

Lets you specify the action that DBArtisan performs (after sending the LONGLOG message to the console) if the number of log records that are processed during the next iteration is not sufficiently lower than the number of log records that were processed during the previous iterations.

Continue - Specifies that DBArtisan continues performing reorganization.

Term - Specifies that DBArtisan terminates reorganization after the delay.

Drain - Specifies that DBArtisan drains the write claim class after the delay. The number of log records, and thus the estimated time, for a future iteration of log processing will be 0.

Lets you type a lower bound for the interval between the time when REORG sends the LONGLOG message to the console and the time when REORG performs the action specified by the

LONGLOG parameter.

Lets you select timeout option:

Abend - Abnormal end of task

Term - Termination

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

6

NOTE:

This panel is displays only if the share level is Reference or Change.

65 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Local Site Primary Copy

Description

Lets you specify the Local Site Primary Copy.

Local Site Backup Copy Lets you specify the Local Site Backup Copy.

Recovery Site Primary Copy Lets you specify the Recovery Site Primary Copy.

Recovery Site Backup Copy Lets you specify the Recovery Site Backup Copy.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

7

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Off Pos Limit

Ind Ref Limit

Report Only

Unload

Description

The specified value is compared to the result of the calculation (NEAROFFPOSF +

FAROFFPOSF) × 100 / CARDF for the specified partitions in SYSIBM.SYSINDEXPART for the explicit clustering indexes for every table in the specified table space. Alternatively, the values in SYSINDEXPART are checked for a single non-partitioned table space, or for each partition if you specified an entire partitioned table space as the target object. If at least one calculated value exceeds the OFFPOSLIMIT value, REORG is performed or recommended.

NOTE: This option is valid for non-LOB table spaces only.

The specified value is compared to the result of the calculation (NEARINDREF + FARINDREF)

× 100 / CARDF for the specified partitions in SYSIBM.SYSTABLEPART for the specified table space. Alternatively, the values in SYSTABLEPART are checked for a single non-partitioned table space, or for each partition if you specified an entire partitioned table space as the target object. If at least one calculated value exceeds the INDREFLIMIT value, REORG is performed or recommended.

NOTE: This option is valid for non-LOB table spaces only.

The reorganization is only recommended, not performed.

Specifies whether the utility job is to continue processing or end after the data is unloaded.

Continue - Specifies that, after the data has been unloaded, the utility continues processing.

Pause - Specifies that after the data has been unloaded, processing ends.

Only - Specifies that after the data has been unloaded, the utility job ends and the status in

SYSIBM.SYSUTIL corresponding to this utility ID is removed.

External - Specifies that after the data has been unloaded, the utility job is to end and the status in SYSIBM.SYSUTIL corresponding to this utility ID is removed.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 653

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

6

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Do you want to keep the dictionary?

Description

A collection of language-related linguistic information used during text analysis, indexing, retrieval, and highlighting of documents in a particular language.

NOTE: Available only if Continue or Pause option was specified for Unload on the previous panel.

Do you want to specify statistics?

Lets you include statistics for the tablespace in the SQL statement.

Enabled only if Continue or Pause option was specified for Unload on the previous panel.

Lets you specify to output message to SYSPRINT.

Do you want to output message to SYSPRINT?

Do you want to force aggregation or rollup processing to be done even though some parts do not contain data?

Lets you specify to process with forced aggregation, gathered into a mass, or rollup.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- S

TATISTICS

T

ABLES

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Select Tables

Description

Lets you select tables (and columns) to collect statistics for.

The sample column is editable and you can type an integer value into this column.

Add Opens .

Set Properties Lets you customize the selection of columns in the selected tables.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- S

TATISTICS

I

NDEXES

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Select Index

Description

Lets you specify the indexes and the correlation values for collecting the statistics.

The sample column is editable and you can type an integer value into this column.

Add Opens .

Set Properties Lets you specify the correlation information for each index.

65 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

7

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Punch DDN

Discard DDN

Unload DDN

Work DDN

Description

Lets you select punch DDN from the list. Contains generated LOAD statements that let you reload the discarded data. Required if Unload External option is chosen on Panel 5.

Lets you select discard DDN from the list.

Lets you select DD name of the unload data set. Required unless NOSYSREC on Panel 2 or

Share level CHANGE Panel 3 is selected.

Lets you select the DD statement for a temporary data set used for intermediate output.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

7

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Discard

No Pad

Description

Lets you select discard DDN from the list.

DBArtisan does not add a character to fill empty space.

Add Opens .

Set Condition Lets you customize the selection of columns in the selected tables.

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

8

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard

Option

Would you like to specify the device type?

Do you want to specify the sort number?

Preformat

Description

Lets you specify the device type.

Lets you type the number of datasets to be dynamically allocated by the sort program. The range of the text field is 0 to 2147483647.

Lets you specify that the remaining pages are preformatted up to the high allocated

RBA in the table space and index spaces associated with the table specified in tablename. The preformatting occurs after the data has been loaded and the indexes are built.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 655

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

EORGANIZE

T

ABLESPACE

W

IZARD

- P

ANEL

9

The table below describes the options and functionality on this panel of the Reorganize

Tablespace Wizard:

Option

Punch DDN

Discard DDN

Unload DDN

Work DDN

Description

Lets you select punch DDN from the list. Contains generated LOAD statements that let you reload the discarded data. Required if Unload External option is chosen on

Panel 5.

Lets you select discard DDN from the list.

Lets you select DD name of the unload data set. Required unless NOSYSREC on

Panel 2 or Share level CHANGE Panel 3 is selected.

Lets you select the DD statement for a temporary data set used for intermediate output.

Condition Dialog Box

The Condition Dialog Box lets you type free form condition text.

NOTE:

DBArtisan does not test the correctness of the condition text.

R

EPAIR

T

ABLES

This action builds and submits a REPAIR TABLE statement, letting you repair a corrupted table.

This operation returns a standard REPAIR TABLE result set. Each returned message consists of

Table (name), Op (with a value of REPAIR), Msg_type (STATUS, ERROR, INFO, WARNING), and

Msg_text components.

NOTE:

This functionality is available for MySQL only.

To repair a possibly corrupted table:

1 On the Datasource Explorer, expand nodes until the Tables node is visible.

2 Select the Tables node.

DBArtisan displays the tables in the right pane of the Explorer window.

3 Right-click one or more selected tables and select Repair Tables from the context menu.

DBArtisan opens the Repair Tables dialog box.

4 Use the following table as a guide to understanding and modifying settings in this wizard:

Step

Action Options

Settings and tasks

Quick

Extended

Use FRM file

Only the index tree is fixed.

Creates the index row by row instead of creating one index at a time with sorting.

Recreates the

.MYI

file header using information in the

.frm

file.

65 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

Dependencies

Preview

Settings and tasks

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action.

5 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

The results set opens on the Results tab of an ISQL editor window. For more information, see

Results Editor

.

R

EPORT

DBArtisan offers two basic object reporting options:

• You can generate a simple summary of all objects of a given type for a single database. For each object, the report contains similar information to that shown in the Datasource Explorer for that object type. The report opens in DBArtisan’s built-in HTML browser. You can find data in the report, save it, or print the report.

• You can generate a detailed report of one or more objects of a given type for a single database. For each object, the report contains information similar to that available in the object editor for that object type. In addition to opening in the built-in HTML browser, the report file is written to an .htm file.

NOTE:

This functionality is available for DB2 LUW, DB2 z/OS, Oracle, SQL Server, and Sybase.

To generate a summary report on all objects of a selected type

1 On the Datasource Explorer, select a node corresponding to the object type you want to report on.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane of the application, right-click an object, and then select Report from the context menu.

DBArtisan opens the Generate Report dialog box.

3 Select the Summary Report option and click OK.

To generate a Detail Report on one or more objects

1 On the Datasource Explorer, select the target object node.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane of the application, right-click one or more selected objects, and then select

Report from the context menu.

DBArtisan opens the Generate Report dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 657

OB JEC T A C TIO N S > OB JE CT A C TIO N S

3 Select the Detail Report option and click OK.

DBArtisan opens the Report dialog box.

4 In Report Home Page File Name, type the report name or click Browse to locate the report.

5 Use the Append date and time stamp to report file name and Save report in date

specific folders controls to ensure that the disk files are not overwritten each time you generate reports against the specified file name.

6 In Report Title, type the title that is to appear in the report.

7 If you selected multiple objects, use the Report Options controls to specify a Single HTML

File for All Objects or Separate HTML Files for Each Object.

8 Click Execute.

DBArtisan opens the report in the built-in browser and writes a copy to disk.

R

ESIZE

The Resize dialog box lets you dynamically increase the size of database devices without having to add and configure additional database devices.

NOTE:

This functionality is available for Sybase ASE 12.5.01 only.

To resize a database device by a specified number of pages

1 Initiate a Resize action against one or more database devices. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Resize wizard:

Step Settings and tasks

Action Options Pages

Lets you type the amount in server pages to increase the device(s). 512 pages equals 1MB.

NOTE: Whether the Sybase database is configured for 2K, 4K, or 8K page sizes does not impact the sizing.

Dependencies

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

65 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

R

ESTART

The Restart Sequence dialog box lets you restart a sequence, starting at the value specified in the sequence definition or starting at a specified value.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows only.

To rebuild a stored outline:

1 On the Datasource Explorer, select the Sequences node.

DBArtisan displays the sequences in the right pane of the Explorer window.

2 In the right pane of the application, right-click a sequence and select Restart from the context menu.

DBArtisan opens the Restart Sequence dialog box.

3 Select one of the following Restart Sequence at options:

Originating Value use the value specified in the object definition

This value lets you specify a custom start value

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

R

UN

J

OB

DBArtisan lets you immediately run any defined job queue, regardless of its current schedule.

Job Queues are built-in mechanisms that let you schedule a variety of SQL-based or commandline driven tasks.

NOTE:

This functionality is available for Oracle only.

To run a job

1 On the Datasource Explorer, select the Job Queues node.

DBArtisan displays the job queues in the right pane of the Explorer window.

2 In the right pane of the application, right-click the target job queue, and then select Run

Job.

DBArtisan opens the Run dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

For related information, see Enable Job (Job Queue)

and Disable Job .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 659

OB JEC T A C TIO N S > OB JE CT A C TIO N S

R

UNSTATS

I

NDEX

The Runstats Index Wizard gathers statistics on indexes. If no statistics are available, DB2 makes fixed default assumptions which may result in inefficiencies.

NOTE:

This functionality is available for IBM DB2 for z/OS.

To ensure the effectiveness of the paths selected, you can run the wizard:

• After a table is loaded.

• After an index is physically created.

• After running Rebuild Index (DB2 z/OS) or

Reorganize /Reorg

without collecting inline statistics.

• Before running

Reorganize /Reorg

with the OFFPOSLIMIT, INDREFLIMIT, or LEAFDISTLIMIT options.

To gather statistics on an index

1 On the Datasource Explorer, expand the Tablespaces or Indexes node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 Right-click the target tablespace and select RunStats Index from the context menu.

DBArtisan opens the RunStats Index Utility wizard.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

1

Settings and tasks

Select Index

2

Add

Delete

Set Properties

Select tablespaces

Add

Delete

Set Properties

If you initiated the RunStats Index operation against one or more indexes, the target indexes are initially displayed. To check additional Indexes, click the Add button.

Opens the Indexes Selector dialog box.

Deletes selected index.

Opens the Set Correlation Option Dialog Box for the selected row.

If you initiated the RunStats Index operation against one or more tablespaces, the target tablespaces are initially displayed. To check additional tablespaces, click the Add button.

Opens the Object Selector Dialog Box .

Deletes selected tablespace.

Opens the Set Correlation Option Dialog Box for the selected row.

66 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

3

4

Settings and tasks

Access level while RUNSTATS is running

Do you want to output message to

SYSPRINT?

Do you want to force aggregation or rollup processing to be done even though some parts do not contain

data?

Update Statistics

History Statistics

Lets you select an access level, either Readonly or Change.

Lets you specify to output message to SYSPRINT.

Lets you specify to process with forced aggregation, gathered into a mass, or rollup.

Lets you update the catalog statistics.

Lets you update the history statistics.

4 When ready, click Finish.

S

ET

C

ORRELATION

O

PTION

D

IALOG

B

OX

The table below describes the options and functionality on the Set Correlation Option Dialog

Box:

Option

KeyCard

Frequent Item

Add

Description

Collects all of the distinct values in all of the 1 to n key column combinations for the specified indexes. n is the number of columns in the index.

Lets you add items to the grid.

Opens the Add Frequent Item Dialog Box

A

DD

F

REQUENT

I

TEM

D

IALOG

B

OX

The table below describes the options and functionality on the Add Frequent Item Dialog Box:

Option

Number of Columns

Count

Description

Lets you type the number of columns. Default is 1.

Lets you type the count. Default is 10.

R

UNSTATS

T

ABLESPACE

The Runstats Tablespace Wizard gathers statistics on tablespaces, indexes, and columns.

DBArtisan records this information in the DB2 catalog and uses it to select access paths to data during the bind process. The wizard lets you evaluate database design and helps you decide to reorganize tablespaces or indexes.

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 661

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To perform a RunStats operation against a tablespace

1 On the Datasource Explorer, expand the Tablespaces node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 Right-click the target tablespace and select RunStats Tablespace from the context menu.

DBArtisan opens the RunStats Tablespace Utility wizard.

3 Use the following table as a guide to understanding and modifying settings in the wizard:

Step

Preliminary options

Settings and tasks

Database Name

Tablespace Name

Partition Number

Do you want to runstats on all tables in this tablespace?

Do you want to runstats on all indexes in this tablespace?

Table Sample

Table sample and key card details (Panel is displays only if you selected Yes to either of the all indexes... or all

tables... options on the first panel)

KeyCard

Add

Delete

Select Tables

Default is Yes.

Table selection (Panel is displays only if you selected No to the all

tables... options on the first panel)

Lets you select a database.

Lets you select a tablespace.

Lets you specify on which the command needs to be run.

Default is Yes.

Lets you type a table sample. Default is 25. You can enter any value between 1 and 100.

Collects all of the distinct values in all of the 1 to n key column combinations for the specified indexes. n is the number of columns in the index.

Opens the Add Frequent Item Dialog Box

Deletes selected item(s.)

Lets you select the tables in the table that runstats will be run on.

The Sample column is blank initially for each row. It is editable with values between 1 - 100.

The Indicator column is blank initially for each new row that is added. However if you set the custom columns for a row (via set properties button), this column shows an asterisk (*).

Opens the Table Selector Dialog Box .

Index selection (Panel is displays only if you selected No to the all

indexes... options on the first panel)

Runstats options

Add

Delete

Set Properties

Select Indexes

Add

Delete

Set Properties

Access level while RUNSTATS is running

Deletes the selected table(s.)

Lets you customize the selection of columns in the selected table(s.)

Lets you select index(es) for the runstats operation.

Opens the Select Column for Table Dialog Box .

Deletes selected index(es).

Opens the Set Correlation Option Dialog Box .

Lets you select an access level, either Readonly or Change.

66 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Step

Statistics

Settings and tasks

Do you want to output message to

SYSPRINT?

Do you want to force aggregation or rollup processing to be done even though some parts do not contain

data?

Update Statistics

History Statistics

Lets you specify to output message to

SYSPRINT.

Lets you specify to process with forced aggregation, gathered into a mass, or rollup.

Lets you update the catalog statistics.

Lets you update the history statistics.

4 When ready, click Finish.

S

ELECT

C

OLUMN FOR

T

ABLE

D

IALOG

B

OX

The table below describes the options and functionality on the Select Column for Table Dialog

Box:

Option

Column Name

Included

Select All

Unselect All

Description

Displays the column name.

Select to include column.

Click to select all columns.

Click to deselect all columns.

T

ABLE

S

ELECTOR

D

IALOG

B

OX

The table below describes the options and functionality on the panel of the Table Selector dialog box:

Option

Tablespace Like

Table Creator

Table Name

All Columns

Table Selector

Query

Select All

Unselect All

Add

Description

Displays the tablespace.

Displays the table(s) creator of the tablespace that was selected on Panel 2.

Displays the table(s) of the tablespace that was selected on Panel 2.

Selects all columns.

Lets you select one or more rows per table, up to 10.

Repopulates Table Selector based on the tablespace query.

Selects all rows in Table Selector.

Unselects all rows in Table Selector.

Click to add the table to the wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 663

OB JEC T A C TIO N S > OB JE CT A C TIO N S

I

NDEX

S

ELECTOR

D

IALOG

B

OX

The table below describes the options and functionality on the panel of the Index Selector dialog box:

Option

Index Creator

Index

Index Selector

Query

Select All

Unselect All

Add

Description

Displays the index(es) creator of the tablespace that was selected on Panel 2.

Displays the index(es) of the tablespace that was selected on Panel 2.

Lets you select one or more rows in this list.

Repopulates Index Selector based on the tablespace query.

Selects all rows in Index Selector.

Unselects all rows in Index Selector.

Click to add the index to the wizard.

S

CHEMA

The Schema dialog box lets you view key properties of the columns in a table or view.

NOTE:

This functionality is available for all DBMS platforms.

To view a column summary for a table or view

1 On the Datasource Explorer, select the target object node.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane of the application, right-click the target object, and then select Schema from the context menu.

DBArtisan opens Schema results in a Results Editor. For information on functionality offered, see

Results Editor

.

S

ELECT

* F

ROM

This action lets you retrieve all data contained in tables or views. Results are displayed in a row and column grid.

NOTE:

This functionality is available for all DBMS platforms.

To select all data in one or more tables or views

1 Initiate a Select * From action against one or more tables or views. For more information see

Initiating an object operation .

For each selected table or view, DBArtisan opens a two-tabbed window:

66 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

• The Results tab displays the data selected from the table, in a grid similar to a spreadsheet.

Right-click and toolbar options offer many of the functions provided in the Results editor.

For more information, see Results Editor .

• The Query tab displays the full query generated for the operation. Right-click and toolbar options offer many of the functions provided in the ISQL editor. For more information, see

ISQL Editor .

S

ET

D

EFAULT

This function lets you set a tablespace as the default tablespace. Users created without a specified default tablespace will be assigned this default tablespace. If no default tablespace is set, users created without a specified tablespace will have their default tablespace set to

SYSTEM.

NOTE:

This functionality is available for Oracle 10g and above.

To set a tablespace as the default

1 Initiate a Set Default action against a tablespace. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Set

Default wizard:

Step

Action options

Dependencies

Preview

Settings and tasks

Verify that the panel displays the tablespace to be set as default.

Review the referring and referred objects that will be automatically resolved when you execute this operation.

Preview the DDL generated for the operation and when ready, use the Schedule or Execute button to perform this action.

S

ET

I

NTEGRITY

DBArtisan provides an implementation of the DB2 SET INTEGRITY statement, letting you perform tasks such as taking tables into and out of set integrity pending state, placing tables into full access state, and pruning the contents of one or more staging tables.

NOTE:

This functionality is available for IBM DB2 LUW only.

NOTE:

This operation should not be performed without an in-depth understanding of the SET

INTEGRITY statement. For online access to DB2 documentation, see

Accessing Third

Party Documentation .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 665

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To Open the Set Integrity Wizard

1 On the Explorer, expand a DB2 database, and click the Table node.

2 Select the appropriate table(s), right-click, and choose Set Integrity from the menu. You can select more than one table by clicking CTRL + the tables you want.

OR

Select the appropriate table, click Command on the toolbar, and then choose Set Integrity from the drop-down menu.

The table below lists all fields you can see in the Set Integrity Wizard. Depending on the options you choose, you may not see them all.

Required Field

Tables

Integrity Option

Description

Tables

The list of one or more tables you selected appear.

Integrity Option

OFF--When selected, tables have their foreign key and check constraints, and column generation disabled and so are put in a pending state. This also means materialized query or staging tables are not immediately refreshed and are put in a pending state.

TO DATALINK RECONCILE PENDING--When selected, DATALINK integrity is disabled and tables are put in a check pending no access state. Dependent and descendant tables are not affected.

IMMEDIATE CHECKED--This turns on a table’s integrity checking turned on. Any checking that was deferred is carried out.

FULL ACCESS--Tables become fully accessible as soon as the SET INTEGRITY statement executes.

PRUNE--This is appropriate only for staging tables. The content of the staging table is pruned and set to an inconsistent state. If any table in the table-name list is not a staging table, an error is returned.

UNCHECKED--Allows you turn on some or all integrity checking but the table will not be checked for integrity violations. This can affect data integrity.

Table Readability/Cascade/Descendent Types

Specifies the readability of the table while it is in check pending state:

Specifies whether to be immediately cascaded to all descendents

Descendent Types

NO ACCESS--The table(s) are put in a check pending no access state so read/write access to the table is prohibited.

READ ACCESS--The table(s) are put in a check pending read state. This allows read access to the non-appended portions of any tables.

CASCADE IMMEDIATE--The check pending state for foreign key constraints is immediately extended to descendant foreign key constraints or to materialized query or staging tables.

CASCADE DEFERRED--Only the selected tables are put in the check pending state.

Descendant foreign key, materialized query, or staging tables remain unchanged.

Materialized Query Tables--When selected, the check pending state is immediately cascaded to only descendant materialized query tables.

Foreign Key Tables--When selected, the check pending state is cascaded immediately only to descendant foreign key tables.

Staging Tables--When selected, the check pending state is cascaded immediately only to descendant staging tables.

66 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Required Field

Do you want to check on the appended portion (if any) of the table?

List of Base Tables

Description

Check Appended Portion?

Default/Yes/No

Force Generated--If you do not specify this generated column current values will be compared to the computed value of the expression as if an equality check constraint existed. If this is specified, generated columns are computed only for the appended portion.

Prune--Possible only for staging tables. When you check this, the contents of the staging table are pruned and the staging table is set to an inconsistent state.

Full Access--When selected, tables will become accessible after the SET INTEGRITY statement executes.

Specify Exception Tables

Any row that is in violation of a foreign key or check constraint is copied to the exception table you select.

IMMEDIATE

UNCHECKED options

Integrity Options: IMMEDIATE UNCHECKED

Foreign Key--These constraints are turned on when the table is removed from check pending status.

Check--Check constraints are turned on when the table is removed from check pending status.

Datalink Reconcile Pending--DATALINK integrity constraints are turned on when the table is removed from check pending status.

Materialized Query--Immediate refreshing is turned on for a materialized query table when it is removed from a check pending state.

Generated Column--When the table is removed from check pending status, generated columns are turned on.

Staging--Immediate propagation is turned on for a staging table.

Do you want tables to become fully accessible after the SET

INTEGRITY statement executes?

Yes/No

3 When ready, click the Finish button to preview and submit the generated DDL. For more information, see

Preview

.

S

ET

O

NLINE

/O

FFLINE

The Set Database(s) Online/Offline dialog box lets you disable your databases to prevent access, and enable your databases to grant access through the Datasource menu.

NOTE:

This functionality is available for Microsoft SQL Server and Sybase ASE only.

Important Notes

For Sybase, DBArtisan only lets you set databases online.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 667

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To set one or more databases online or offline

1 Initiate a Set Online/Offline action against one or more databases. For more information see

Initiating an object operation .

2 Use the following table as a guide to working through the panels of the Set Online/Offline dialog box

Step

Action options

Dependencies

Preview

Settings and tasks

Set offline (SQL

Server only)

Set this to TRUE to set the database offline or set it to True to set the database online.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

ET

UNDO

Set UNDO Tablespace dialog box lets you dynamically set an UNDO tablespace if the tablespace is running in AUTO UNDO mode.

NOTE:

This functionality is available for Oracle 9 or later.

To dynamically set an UNDO tablespace

1 Initiate a Set Undo action against a tablespace. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings on the Set

Undo Tablespace wizard:

Step

Action Options

Dependencies

Preview

Functionality

Displays the tablespace you selected to be set as an Undo tablespace.

Lists referring and referenced objects potentially impacted by the change. For details,

see Dependencies

.

Preview the DDL generated from your choices.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

HRINK

For details on using DBArtisan Shrink operations to save or reclaim space, see the following topics:

Shrinking SQL Server databases

Shrinking Oracle rollback segments

66 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

Shrinking Oracle tables or indexes

S

HRINKING

SQL S

ERVER DATABASES

DBArtisan lets you reclaim space from a database that is too large.

To shrink a SQL Server database

1 Initiate a Shrink action against one or more databases. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying the settings on the

Shrink wizard:

Step Description

Action Options Displays the databases you selected and lets you work with the following settings:

Move data pages to beginning of file before shrink

Release All Unused Space

Select to move data pages to the beginning of the file before the shrink.

Deselect to set the target free space to retain, and then in the Target Free Space to Retain (percent) box, type the new value of free space to retain.

The new size for the database must be at least as large as the Minimum Allowable Size displayed in the Current File

Size box.

Preview

Target free space percent after shrink

Lets you specify the target free space percent after the shrink.

Preview the DDL generated from your choices.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

HRINKING

O

RACLE ROLLBACK SEGMENTS

DBArtisan lets you shrink the size of rollback segments. The proper sizing of rollback segments is critical to their overall performance. Performance degrades whenever a rollback segment must extend, wrap or shrink in response to transaction loads. Ideally, you want to make the extents of rollback segments as small as possible while still ensuring that each transaction can fit into a single extent.

After an abnormally large transaction load, you might consider shrinking a rollback segment to eliminate unnecessary space. Oracle lets you shrink a rollback segment manually by a specific amount or back to its Optimal Size.

Important Notes

For Oracle 9 or later, Shrink is not available if auto-UNDO management is enabled.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 669

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To shrink the size of one or more rollback segments

1 Initiate a Shrink action against one or more rollback segments. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings on the

Shrink wizard:

Step

Action Options

Preview

Description

Displays the rollback segments you selected and lets you work with the following settings:

Specify the size...

If you do not provide a specific number the Rollback Segment uses the OPTIMAL value specified in the Storage clause. If an

OPTIMAL value is not specified, the size defaults to the

MINEXTENTS value of the Storage clause.

Preview the DDL generated from your choices.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

HRINKING

O

RACLE TABLES OR INDEXES

DBArtisan lets you shrink the size of tables or indexes.

Important Notes

Shrink is only available for tables in which the Row Movement property is enabled. For information on setting the Row Movement when creating or editing a table, see

Table Wizard

(Oracle)

and

Tables Editor (Oracle)

.

To shrink the size of one or more indexes or tables

1 Initiate a Shrink action against one or more indexes or tables. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings on the

Shrink wizard:

Step

Action Options

Description

Displays the objects you selected and lets you work with the following settings:

Dependencies

segment space and compact rows.

Cascade

Enable Cascade to simultaneously shrink all dependent objects.

Lists referring and referenced objects potentially impacted by the change. For details,

see Dependencies

.

Preview the DDL generated from your choices.

Preview

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

67 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

S

TART

D

ATABASE

The Start Database dialog box lets you start a database:

• When the database that has been stopped with a Stop Database dialog box. For more information, see

Stop Database

.

• After a tablespace, partition, or index has been placed in group buffer pool RECOVER pending status (GRECP) or if pages have been put on the logical page list (LPL) for that object.

NOTE:

This functionality is available for IBM DB2 for OS/390 and z/OS only.

Depending on the specified options, the database can be made available for read-only processing, read-write processing, or utility-only processing. In a data sharing environment, the command can be issued from any DB2 on the group that has access to the database.

To start a database

1 On the Datasource Explorer, expand the Databases or Tablespaces node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 In the right pane, right-click the target object and select Start Database from the context menu.

DBArtisan opens the Start Database dialog.

3 Use the following table as a guide to understanding and settings options on this dialog:

Option Functionality

Database Grid The Partition column is editable and can include one or more unique numeric values separated by commas. Initially the Partition column is blank. No validation is made for the correctness of partition numbers so make sure that the partitions exist.

Access

Lets you select access options of Read/Write, Read only, Utility only or Force.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

TOP

D

ATABASE

The Start Database dialog box lets you stop a database, optionally letting you allow running applications access until their next COMMIT.

NOTE:

This functionality is available for IBM DB2 for z/OS only.

To stop a database

1 On the Datasource Explorer, expand the Databases or Tablespaces node.

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 671

OB JEC T A C TIO N S > OB JE CT A C TIO N S

2 In the right pane, right-click the target object and select Stop Database from the context menu.

DBArtisan opens the Stop Database dialog.

3 Use the following table as a guide to understanding and settings options on this dialog:

Option Functionality

Database Grid The Partition column is editable and can include one or more unique numeric values separated by commas. Initially the Partition column is blank. No validation is made for the correctness of partition numbers so make sure that the partitions exist.

Stop at

COMMIT

Enabling this option sends the STOP DATABASE statement.with an AT(COMMIT) clause, allowing running applications to continue access until their next commit.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

S

TART

/S

TOP

J

OB

This action builds and submits an sp_start_job or sp_stop_job call for one or more SQL Agent jobs. It lets you immediately start or halt execution of a job.

NOTE:

This functionality is available for SQL Server only.

To immediately start or halt execution of one or more jobs

1 Initiate a Start/Stop action against one or more jobs. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying settings in the Start/

Stop jobs wizard:

Step

Action Options

Preview

Settings and tasks

Select the Start check box to start the selected jobs. Deselect the Start check box to stop the selected jobs.

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and Scheduling

.

S

WITCH

L

OGFILE

The Switch Logfile action issues an ALTER SYSTEM SWITCH LOGFILE statement. This forces a log switch to make the currently active group inactive and available for maintenance activities.

NOTE:

The Switch Online functionality is available for Oracle only.

67 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To force a log switch

1 Expand the Storage node and select the Redo Log Groups node

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 Right-click one or more selected objects and select Switch Logfile from the context menu.

DBArtisan opens the Preview: Switch Logfile dialog.

3 Click Execute.

For related information, see Take Checkpoint .

S

WITCH

O

NLINE

NOTE:

The Switch Online functionality is available for IBM DB2 for Linux, Unix, and Windows only.

The Switch Online dialog box lets you access a tablespace by switching it online after the parent container(s) have been recovered or restored.

To switch a tablespace online:

1 On the Datasource Explorer, select the Tablespaces node.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane, right-click one or more selected tablespaces and then select Switch Online from the context menu.

DBArtisan opens the Switch Online dialog box.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

T

AKE

C

HECKPOINT

The Take Checkpoint action issues an ALTER SYSTEM CHECKPOINT statement. This forces a fast database checkpoint.

NOTE:

The Take Checkpoint functionality is available for Oracle only.

To force a fast database checkpoint

1 Expand the Storage node and select the Redo Log Groups node

DBArtisan displays objects of the selected type in the right pane of the Explorer window.

2 Right-click one or more selected redo log groups and select Take Checkpoint from the context menu.

DBArtisan opens the Preview: Take Checkpoint dialog.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 673

OB JEC T A C TIO N S > OB JE CT A C TIO N S

3 Click Execute.

For related information, see Switch Logfile .

T

RANSFER

O

WNERSHIP

DBArtisan lets an object owner or a user with SECADM authority transfer ownership of an object to another user. The new user is automatically granted the same privileges as the former owner.

Ownership can be transferred on an object-by-object basis or you can transfer all objects currently owned by an individual user.

NOTE:

This functionality is available for IBM DB2 for Linux, Unix, and Windows version 9.1 and higher.

The following table lists the object types that support ownership transfer:

Aliases Check Constraints

Functions Indexes

Materialized Query Tables Schema

Tables

User Datatypes

Tablespaces

Views

Event Monitors

Primary Keys

Sequences

Triggers

Foreign Keys

Procedures

Structured Types

Unique Keys

To transfer ownership of an object

1 Initiate a Transfer Ownership action against one or more supported objects (see table above). For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Transfer

Ownership wizard:

Step

Action options

Preview

Settings and tasks

If you initiated the ownership transfer against a user, select the specific objects belonging to that user that are to be assigned to a new user.

Use the New Owner dropdown to select a defined user as the new owner of the selected object or objects.

Preview the DDL generated for the operation and when ready, click Execute. For information on the other options, see

Preview

and

Scheduling .

T

RUNCATE

DBArtisan lets you quickly delete the rows of one or more tables or clusters. Truncating a table is a faster alternative to deleting all of its rows.

67 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

CAUTION:

If you truncate a table, DBArtisan deletes all the rows. These rows are not logged as individual drops and cannot be recovered from a transaction log or other type of log.

NOTE:

This functionality is available for DB2 LUW, DB2 z/OS, MySQL, Oracle, SQL Server, and

Sybase.

To truncate a table or cluster:

1 On the Datasource Explorer, select the target object node.

DBArtisan displays the target objects in the right pane of the Explorer window.

2 In the right pane of the application, right-click the target object or multiple, selected objects, and then select Truncate or Truncate Table from the context menu.

DBArtisan opens the Truncate wizard/dialog box.

3 For help with DBMS-specific settings and additional information, see the following topics:

Notes on truncating Oracle objects

Notes on truncating Sybase ASE objects

Notes on truncating IBM DB2 z/OS objects

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

N

OTES ON TRUNCATING

O

RACLE OBJECTS

You can truncate any table or cluster in their schema or, if you have the DROP ANY TABLE system privilege, you can truncate any table in any schema.

Observe the following when truncating tables or clusters:

• Before truncating a cluster or table containing a parent key, disable all referencing foreign keys existing in different tables.

• Truncating a cluster or table does not generate any rollback information and commits immediately.

• Oracle alters the storage parameter NEXT to the size of the last extent deleted from the segment.

• Oracle automatically deletes all data in the table's indexes and any materialized view directload INSERT information associated with a truncated table.

• If the table is not empty, all associated nonpartitioned indexes and all partitions of associated global partitioned indexes are marked unusable.

• You cannot truncate a hash cluster nor can you truncate individual tables in a hash cluster or an index cluster.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 675

OB JEC T A C TIO N S > OB JE CT A C TIO N S

When you truncate a table or cluster, you can specify whether space currently allocated for the table is returned to the containing tablespace or if it is returned to the system. The table below describes the Truncate dialog options available when truncating an Oracle table or cluster:

Option

Drop Storage

Reuse Storage

Description

Select if you want the freed extents returned to the system where they can be used by other objects.

Select if you want the space to remain allocated to the table or cluster you have just truncated.

For more information, see

Truncate

.

N

OTES ON TRUNCATING

S

YBASE

ASE

OBJECTS

Truncate against a Sybase table can be applied to the entire table or to a single partition.

NOTE:

You cannot truncate a table referenced by a foreign key constraint. Instead, use a

DELETE statement without a WHERE clause.

TIP:

When you truncate a table, Sybase ASE removes all rows from the target table, but retains the table structure (its indexes, columns, constraints, etc.). The counter used by an identity for new rows is reset to the seed for the column. To retain the identity counter, use a DELETE statement instead of TRUNCATE. To remove the target table definition and its data, use a DROP TABLE statement.

The following table shows the settings on the Truncate Table dialog:

Option

Partition Name (only available with a single table selected)

Description

Selecting a partition name from the dropdown restricts the truncate operation to a single partition.

For more information, see

Truncate

.

N

OTES ON TRUNCATING

IBM DB2

Z

/OS

OBJECTS

When truncating an IBM DB2 z/OS table, the Action Options tab offers the following settings:

Setting

Reuse Storage

Restrict When Delete

Triggers

Immediate

Description

Corresponds to the DROP STORAGE/REUSE STORAGE clause of a TRUNCATE TABLE statement. This setting specifies whether storage currently allocated to the table is reused or dropped.

Corresponds to the RESTRICT WHEN DELETE TRIGGERS/IGNORE DELETE TRIGGERS clause of a TRUNCATE TABLE statement. When enabled, an error is returned if triggers are defined for the table. When disabled, triggers defined for the table are not activated by the Truncate operation.

Corresponds to the IMMEDIATE clause of a TRUNCATE TABLE statement. If enabled, the truncate operation is executed immediately and cannot be undone. If disabled, a

Rollback can undo the Truncate operation.

67 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

For more information, see

Truncate

.

U

NBIND

F

ROM

T

EMPORARY

D

ATABASE

This action builds and submits a sp_tempdb unbind system procedure call. It lets you unbind a login from a temporary database.

NOTE:

This functionality is available for Sybase only.

To unbind a login from a temporary database

1 Initiate a Unbind From Temporary Database action against one or more logins. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying settings in the Unbind

From Temporary Database wizard:

Step

Action Options

Dependencies

Preview

Settings and tasks

Displays the logins you selected for unbinding.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Displays the DDL that will execute the object action. For details, see Preview

.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

U

NDROP

D

ISK

This action builds and submits an ALTER DISKGROUP... UNDROP statement. This lets you cancel pending drops of disks in one or all disk groups.

NOTE:

This functionality is available as of Oracle 10g.

NOTE:

Before this object action is available you must have a direct connection to the ASM

instance. For details, see Manage ASM Connection .

To cancel pending disk drops

1 On a connected Oracle datasource, expand the Instance and ASM nodes.

2 Right-click the Disk Groups node and select Undrop Disk from the context menu.

3 Use the following table as a guide to understanding and modifying settings in the dialog:

Step

Action options

Dependencies

Settings and tasks

Undrop all - If unselected, this action applies only to the disk group you initiated the action against. If selected, the action is applied to disks in all disk groups on this ASM instance.

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 677

OB JEC T A C TIO N S > OB JE CT A C TIO N S

Step

Preview

Settings and tasks

Displays the DDL that will execute the object action. For details, see Preview

.

4 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

U

NMIRROR

(S

YBASE

)

The Unmirror operation lets you execute a DISK UNMIRROR command against a database device, suspending disk mirroring. Options include specifying the primary or secondary device, and whether unmirroring is permanent or temporary.

To suspend mirroring for a database device

1 Initiate an Unmirror action against a database device. For more information see

Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings on the

Unmirror wizard:

Step

Action Options

Dependencies

Preview

Description

Displays the database device you selected and lets you work with the following settings:

Side

Specifies whether to disable the PRIMARY device or the SECONDARY, or mirror, device.

Mode

Specifies RETAIN (unmirroring is temporary) or REMOVE (unmirroring is permanent).

Lists referring and referenced objects potentially impacted by the change. For details,

see Dependencies

.

Preview the DDL generated from your choices.

3 Click Execute. For information on the other options, see

Preview

and

Scheduling

.

U

NQUIESCE

The Unquiesce operation lets you restore user access to a single database or all databases of an instance previously quiesced.

NOTE:

This functionality is available for IBM DB2 for Windows/Unix 8.1 only. DBArtisan does not support Unquiesce Database for supported servers from IBM DB2 for Windows/

Unix 7 or earlier clients.

67 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To restore user access to a database:

1 Take one of the following actions, based on whether you are unquiescing a single database or all databases on an instance:

• Right-click a datasource node and select Command > Unquiesce from the context menu.

• Right-click the Instance node, select Command > Unquiesce from the context menu, and provide credentials if prompted.

DBArtisan opens the Unquiesce Database or Unquiesce Database dialog box.

2 Click Execute.

For related information, see Quiesce

.

U

PDATE

S

TATISTICS

The Update Statistics dialog box lets you update the statistics for an active table or index. As indexes grow and shrink in response to data modification, the accuracy of their statistics can deteriorate.

The following topics provide details on updating statistics by supported DBMS and object type:

Updating statistics for tables or indexes (IBM DB2 for Linux, Unix, and Windows)

Updating statistics for views (IBM DB2 for Windows, Unix, and Linux)

Updating statistics for databases, indexes, or tables (Microsoft SQL Server)

Updating statistics for indexes or tables (Sybase)

U

PDATING STATISTICS FOR TABLES OR INDEXES

(IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

)

To update statistics for an index or table

1 On the Datasource Explorer, expand datasource nodes until the Tables or Indexes node is visible and then select the Indexes or Tables node.

DBArtisan displays the objects of that type in the right pane of the Explorer window.

2 In the right pane of the Explorer window, select one or more indexes or tables.

3 On the Datasource Explorer tool bar, click Command, and then select Update Statistics.

DBArtisan opens the Update Statistics dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 679

OB JEC T A C TIO N S > OB JE CT A C TIO N S

4 Use the following table as a guide to understanding and modifying the settings in this dialog.

Tab

Table

Options

Index

Options

Access

Options

Options

Update table statistics

Distribution

Options

Description

Updates table statistics.

Column

Options

Do not collect column statistics - Column statistics provide information that the optimizer uses to choose the best access plans for queries.

Collect column statistics on key columns only - Collects column statistics on columns that make up all the indexes defined on the table.

Collect column statistics on all columns - Collects column statistics for all columns.

Column statistics provide information that the optimizer uses to choose the best access plans for queries.

Frequency - Lets you specify the maximum number of frequency values to collect, between 1 and 32767.

Quantiles - Lets you specify the maximum number of distribution quantile values to collect, between 1 and 32767.

Do not collect distribution statistics - Does not collect basic statistics or distribution statistics on the columns.

Collect distribution statistics on key columns only - Collects both basic statistics and distribution statistics on key columns only.

Collect distribution statistics on all columns - Collects both basic statistics and distribution statistics on all columns.

For efficiency both of RUNSTATS and subsequent query-plan analysis, you might collect distribution statistics on only the table columns that queries use in WHERE, GROUP BY, and similar clauses. You might also collect cardinality statistics on combined groups of columns. The optimizer uses such information to detect column correlation when it estimates selectivity for queries that reference the columns in the group.

Exclude XML columns - Lets you collect statistics on non-XML columns only. XML columns are not included in statistics collection.

Update index statistics

Collect extended index statistics

Collect sample statistics

Lets you enable and disable statistics updates for indexes and controls the following settings:

Collects extended index statistics, the CLUSTERFACTOR and PAGE_FETCH_PAIRS statistics that are gathered for relatively large indexes.

DBArtisan uses a CPU sampling technique when compiling the extended index statistics. If the option is not specified, every entry in the index is examined to compute the extended index statistics.

Allows read only access while DBArtisan updates the statistics.

Allow read only access during collection

Allow read/ write access during collection

Allows read and write access while DBArtisan updates the statistics.

68 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

5 Click Execute. For information on the Preview option, see

Preview

.

U

PDATING STATISTICS FOR VIEWS

(IBM DB2

FOR

W

INDOWS

, U

NIX

,

AND

L

INUX

)

For IBM DB2 for Windows, Unix, and Linux (version 9), DBArtisan lets you update the statistics for a view.

To update statistics for a view

1 Initiate an Update Statistics action against one or more views. For more information see

Initiating an object operation .

2 Use the following table as a guide to choosing options:

Pane

Action Options

Dependencies

Preview

Options

Lets you work with the following settings:

Column Statistics- lets you enable or disable collection of Column Statistics update,

Distribution Statistics, Frequency, and Quantiles - let you enable and disable collection of distribution statistics and provide num_freqvalues and num_quantiles RUNSTATS options

Allow Write Access - lets you enable or disable write access during statistics collection.

Lets you view referencing or referenced objects.

Lets you view the DDL generated for the operation.

3 Schedule or Execute the statistics update.

U

PDATING STATISTICS FOR DATABASES

,

INDEXES

,

OR TABLES

(M

ICROSOFT

SQL S

ERVER

)

You can update statistics so that Microsoft SQL Server performs the most efficient query possible. This feature updates statistical information on your database so that the query processor can determine the optimal strategy for evaluating a query. These statistics record the key values used for distribution in an database.

You can use the Update Statistics dialog box if there is significant change in the key values in the database, if a large amount of data in an indexed column has been added, changed, or removed, or if a table has been truncated causing significant changes in the distribution of key values.

The Update Statistics dialog box lets you specify tables and indexes for validation. This dialog box offers different update options depending on your version of Microsoft SQL Server.

TIP:

Avoid updating statistics on your target tables during busy access periods. Microsoft

SQL Server locks remote tables and indexes while reading data for update statistics.

For Microsoft SQL Server version 7 or later, the Update Statistics dialog box lets you specify a full or a percentage of a full scan to be used for updating table or index statistics. It also lets you enable or disable future automatic recomputations of statistics. These recomputations are made at Microsoft SQL Server’s discretion. When updating statistics for tables, this dialog box also lets you specify the type of statistics you require.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 681

OB JEC T A C TIO N S > OB JE CT A C TIO N S

To update statistics for a database, index, or table

1 Initiate an Update Statistics action against one or more databases, indexes, or tables. For

more information see Initiating an object operation .

2 Use the following table as a guide to understanding and modifying the settings in the

Update Statistics dialog:

Step

Action Options

Settings and tasks

Scan Range (tables and indexes only)

Full Scan - Select when you want index statistics on every available row.

Sample Scan - Select when database size prohibits a full scan and you can afford to rely on statistics extrapolated from a sample of all available rows.

If you specified a Scan Range of Sample Scan, provide a count.

Sample Count

(tables and indexes only)

Sample Unit (tables and indexes only)

If you specified a Scan Range of Sample Scan, specify either % or

Rows.

Statistics Type

(tables only)

Index - Select if you only require statistics on the target tables’ indexed columns.

Columns - Select if you require statistics on the target tables in their entirety.

All existing statistics - Select if you require statistics on the whole database.

Statistics

Recompute (tables and indexes only)

Select if you want Microsoft SQL Server to recompute and update the statistics for the index as part of its normal internal maintenance.

Deselect if you want the scheduling of future recomputations to be solely your responsibility.

Lets you view referencing or referenced objects.

Dependencies

(tables and indexes only)

Preview Lets you view the DDL generated for the operation.

3 Use the Execute or Schedule button to perform the operation.

U

PDATING STATISTICS FOR INDEXES OR TABLES

(S

YBASE

)

The Update Statistics dialog box lets you specify tables and indexes for validation. This dialog box offers different update options depending on your version of Sybase ASE.

TIP:

Avoid updating statistics on your target tables during busy access periods. Sybase ASE locks remote tables and indexes while reading data for update statistics.

68 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

OB JE CT A C TIO N S > OB JE CT A C TIO N S

To update statistics for a database, index, or table

1 Initiate an Update Statistics action against one or more tables or indexes. For more information see

Initiating an object operation

.

2 Use the following table as a guide to understanding and modifying the settings in the

Update Statistics dialog:

Step Settings and tasks

Action Options Index (tables only)

Table (tables only)

Enabling this option updates statistics for indexes of the table.

Enabling this option updates table-specific statistics. Column statistics stored in sysstatistiics are not affected.

The name of the partition to be updated.

Partition Name

(available when a single index or table is selected)

Step Values

Consumers

Lets you specify the number of histogram steps.

Specifies the number of consumer processes to be used for a sort when a list of columns is provided and parallel query processing is enabled.

Columns

Sampling Percent

(available only when a single table is selected)

Specifies the percentage of the column to be randomly sampled in order to gather statistics.

Lets you specify all columns or specific columns to be used for the operation.

Dependencies

Lists referring and referenced objects potentially impacted by the change. For details, see

Dependencies .

Preview

Lets you view the DDL generated for the operation.

3 Use the Execute or Schedule button to perform the operation.

V

IEW

C

ONTENTS

The Backup Device Information dialog box lets you view the contents of a Dump or Backup

Device which stores backups of databases and transaction logs.

NOTE:

This functionality is available for Microsoft SQL Server only.

To view the content of a backup or dump device:

1 On the Datasource Explorer, expand the Backup Devices node.

2 Right-click a backup device and then select View Contents.

DBArtisan opens the Backup Device Information dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 683

OB JEC T A C TIO N S > OB JE CT A C TIO N S

V

IEW

J

OB

H

ISTORY

This action opens a dialog showing the execution history for a job.

NOTE:

This functionality is available for SQL Server only.

To view the execution history for a job

1 On the Datasource Explorer, expand nodes until the Server > SQL Server Agent > Jobs node is visible.

2 Select the Jobs node.

DBArtisan displays the jobs in the right pane of the Explorer window.

3 In the right pane of the application, right-click a job and select View Job History from the context menu.

DBArtisan opens the Job History dialog box.

68 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S QL SCRI P TI NG > IS QL E D IT O R

SQL S

CRIPTING

DBArtisan incorporates a powerful SQL scripting environment, the ISQL Editor. The ISQL Editor lets you write, debug, test and deploy solid SQL code for your database applications. The scripting environment lets you:

• Open multiple interactive script windows.

• Execute multiple scripts on the same desktop.

• Capture multiple result sets on the same desktop.

DBArtisan's scripting environment is comprised of different windows:

ISQL Editor

DDL Editors

SQL Preprocessing: #define and #include

Automated Error Detection and Coding Aid Features

Results Editor

These windows are context sensitive to the type of script you are opening or extracting. For example, if you extract the schema for a table, DBArtisan opens a DDL Window containing the script. If you execute a script, a result window displays containing the results of your execution statement.

TIP:

Since you must drop a database object before you can recreate it, you can set the DDL

Editor to automatically include DROP statements for specified objects.

TIP:

You can have multiple ISQL windows open at the same time, with each running separate queries.

NOTE:

When you modify an ISQL window without performing a SAVE or RENAME operation, you will see an * in the tab, such as SQL 2*. The asterisk disappears as soon as you create a unique name for the script.

ISQL E

DITOR

The ISQL Editor includes the ISQL Window and DDL Editor.

The ISQL Window lets you:

• Insert files and open files.

• Rename and configure query tabs.

• Find and replace with regular expressions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 685

IS QL ED I TO R > I SQL ED I T OR

• Mail your script files.

TIP:

For Oracle, DBArtisan displays REF CURSOR contents in the ISQL Window and Results

Editor .

TIP:

To toggle to the next SQL window, press CTRL +T.

TIP:

For IBM DB2 for Linux, Unix, and Windows and Oracle, you can access the Code

Completion functionality with the CTRL+K shortcut.

Related Topics

• Toolbar Options

• ISQL Windows

• DDL Editors

• Open Files

• Insert File Into Current File

• Splitting Windows

Find and

Replace

• Regular Expressions

• Goto

• Scheduling

• Sending SQL Scripts

• Renaming and Closing Query Window Tabs

• Print

Saving and Closing Scripts

68 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

T

OOLBAR

O

PTIONS

The table below describes the options of the ISQL Editor toolbar:

Option

Lock

Execute

Step Execute

Schedule

SQL Begin Transaction

SQL Rollback

SQL Commit

Debug

Preprocess

Description

Lets you lock an ISQL Window to a specific datasource connection:

Locked (manual session termination) - the ISQL window will open a session and keep it open while the window remains open, unless the DBMS terminates the session due to a timeout, or the session is closed. The ISQL Window does not respond to datasource change events in other windows, and only uses the current connection for subsequent execution.

Unlocked (automatic session terminations) - the ISQL window will execute each statement in a new session with no session state maintained between them.

When explicitly unlocking an ISQL window, the connection can be returned to the connection pool or disconnected. For details, see the DBMS specific information under

ISQL Options .

Executes the script.

Initiates step execution of the script. For more information, see

Using the Step Execution

Facility

.

Opens a dialog that lets you schedule an SQL job. For more information, see

Scheduling .

Toggles the Begin Transaction status on and off.

Performs a rollback on the current transaction.

Commits the current transaction.

Opens the Embarcadero SQL Debugger.

Lets you set a preprocessing state for execution of the script.

If you select Pre-process Only, subsequent use of the Execute button will result in the script being preprocessed without being executed. The script opens n a new editor window with all #define and #include substitutions made.

If you select Pre-process and Execute, all #include and #define directives are carried out and the script is executed. No new editor window opens.

For more information, see SQL Preprocessing: #define and #include .

Script Execution Facility Provides a shortcut to opening the Script Execution Facility. For more information, see

Executing Scripts Against Multiple Datasources

.

Query Plan Activates and deactivates Query Plan mode. For more information, see

Plan Facility

.

Using the Query

Query Options

Format

Syntax Check

Errors

Provides a shortcut to opening the Query Options dialog. For more information, see

Query options .

Transforms spaghetti-style written SQL code into an easier read format.

Initiates a syntax check. This is only necessary if SQL parsing is disabled and automatic syntax checking is therefore disabled. For more information, see

Syntax Checking .

Closes the Errors tab.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 687

IS QL ED I TO R > I SQL ED I T OR

ISQL W

INDOWS

A script is a collection of SQL statements used to perform a task. Scripts, stored as files, form the foundation of most application projects. Definitions of tables, indexes, stored procedures, as well as reports and batch jobs, are usually stored in script files and shared by groups of developers using version control software. You can manage SQL scripts in SQL windows.

DBArtisan lets you open multiple SQL windows in one or more workspaces.

Opening ISQL Windows

To open the ISQL Window, do the following:

1 On the File menu, click New ISQL.

DBArtisan opens an SQL window in your current workspace.

For more information, see

ISQL Window Status Bar

ISQL Editor

ISQL W

INDOW

S

TATUS

B

AR

The ISQL window Status bar lets you view:

• Auto commit status (Oracle) - Automatically commits SQL statements as soon as the statements are run.

• Begin Transaction ON/OFF (SQL Server and Sybase)

• Keyboard Emulation Mode - Lets you customize your editing environment to an emulation mode.

TIP:

For Microsoft SQL Server and Sybase, to set Begin Transaction status to “Yes”, on the

ISQL Window toolbar, click the SQL Begin Tran button.

TIP:

For Oracle, you can apply auto commit status changes to all open ISQL windows. You can modify emulation node on the Editor Tab of the Options Editor. You can modify the Oracle Auto Commit status and ISQL Tab of the Options Editor.

DDL E

DITORS

NOTE:

This functionality is available for all platforms.

68 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

DBArtisan lets you open a new DDL Editor when you want to create a script that is tied to an object type in your database. The DDL Editor opens containing a template script for the selected object type. Because the DDL Editor is directly tied to a database, database warning messages can be issued. For example, if you have a create table script which includes a DROP

TABLE statement, the DDL Editor warns you about the existence of this statement and that you could lose existing table data.

The table below describes the options and functionality on the Create New Database Object dialog box.

Option

Object Type

Owner

Object Name

Description

Lets you select the object type to which you want to attach the script.

Lets you type the name of the object owner for the object. The name of the owner connected to the current datasource is used as the default.

Lets you type the name of the object type.

DBArtisan opens a DDL Editor containing a template for the object type you selected.

For more information, see

Opening DDL Editors .

O

PENING

DDL E

DITORS

To open DDL Editors, do the following.

1 On the File menu, select New > DDL Editor.

2 In Object Type select the object type to which you want to attach the script.

3 In Owner type the name of the object owner for the object. The name of the owner connected to the current datasource is used as the default.

4 In Object Name type the name of the object type.

5 Click OK.

DBArtisan pastes the DDL into the ISQL Editor.

For more information, see

ISQL Editor .

O

PEN

F

ILES

NOTE:

This functionality is available for all platforms.

The Open Files dialog box lets you open existing files.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 689

IS QL ED I TO R > I SQL ED I T OR

The table below describes the options and functionality on the Open Files dialog box.

Option

File Name

Files of Type

Open Button

Description

Lets you type a script file name. You can open multiple script files simultaneously by selecting multiple file names in the file list.

Lets you control the files displayed in the file list by changing the selection. DBArtisan displays multiple default file extensions.

Click to open one or more files into the current workspace.

Completing the Open Files Dialog Box

To complete the Open Files dialog box, do the following:

1 On the File menu, click Open.

2 Select a script file.

OR

3 In File Name, type a script file name.

4 In Files of type, select types of files to display.

5 Click Open to open one or more files into the current workspace.

DBArtisan pastes the script into the ISQL Editor.

For more information, see

ISQL Editor .

W

HAT

T

YPE OF

F

ILE

NOTE:

This functionality is available for all platforms.

The What Type of File Is dialog box lets you select options for unknown file types.

The table below describes the options and functionality on the What Type of File Is dialog box:

Option

The file is a general purpose SQL script

The file contains the DDL to create a database object of the file contains Oracle Anonymous PL/

SQL.

Always open unknown files into a SQL window without prompting.

Description

Select if the unknown file is a SQL script.

Lets you select object type, type the owner, and object name.

Select to hide What Type of File Is Dialog Box for future unknown file types.

69 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Completing the What Type of File Is Dialog Box

To complete the What Type of File Is dialog box, do the following:

1 On the File Menu, click Open.

DBArtisan opens the Open File(s) dialog box.

2 In the Open File(s) dialog box, select the target script, and then click Open.

DBArtisan opens the What type of file dialog box.

3 Select options, and then click OK.

DBArtisan opens the target script in an SQL Editor.

For more information, see

ISQL Editor .

I

NSERT

F

ILE

I

NTO

C

URRENT

F

ILE

NOTE:

This functionality is available for all platforms.

The ISQL Editor facilitates the reuse of SQL scripts by letting you insert an existing file into another script.

The table below describes the options and functionality on the Insert File into Current File dialog box.

Option

File Name

Files of Type

Open Button

Description

Lets you type a script file name. You can open multiple script files simultaneously by selecting multiple file names in the file list.

Lets you control the files displayed in the file list by changing the selection. DBArtisan displays multiple default file extensions.

Click to insert one or more files into the current workspace.

Completing the Insert File into Current File Dialog Box

To complete the Insert File into Current File dialog box, do the following:

1 On the Edit menu, click Edit Insert File.

DBArtisan opens the Insert File into Current File dialog box.

2 Select a script file.

OR

3 In File Name, type a script file name.

4 In Files of type, select types of files to display.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 691

IS QL ED I TO R > I SQL ED I T OR

5 Click Open to insert one or more files into the current workspace.

DBArtisan inserts the file.

For more information, see

ISQL Editor .

S

PLITTING

W

INDOWS

You can split an SQL window into four different screens so that you can view different sections of a document simultaneously. You have the option to split the ISQL Window horizontally, vertically or into quadrants.

Splitting the ISQL Window Horizontally

To split the ISQL Window horizontally, do the following:

1 Point to the split box at the top of the vertical scroll bar on the right side of the SQL window.

2 When the pointer changes, drag it to the desired position.

Splitting the ISQL Window Vertically

To split the ISQL Window vertically, do the following:

1 Point to the split box at the top of the horizontal scroll bar on the bottom left side of the SQL window.

2 When the pointer changes, drag it to the desired position.

Removing Splits from an ISQL Window

Double-click the appropriate split bar to return the SQL window to its normal state.

For more information, see

ISQL Editor .

F

IND

NOTE:

This functionality is available for all platforms.

The Find dialog box lets you search text in your SQL scripts.

The table below describes the options and functionality on the Find dialog box.

Option

Find What

Description

Lets you type your search string.

Match whole word only Select to search for only the complete word.

Match Case Select to make the search case-sensitive.

69 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Option

Regular expression

Wrap around search

Direction

Find Next Button

Mark All Button

Description

For more information, see Regular Expressions .

Lets you search from the end of the script and back to the insertion point.

Lets you specify the direction you want to search. Click the Up or Down option button.

Click to find the next occurrence of your search string.

Click to place a small blue dot next to every line number in the script which meets the required search string criteria.

Completing the Find Dialog Box

To complete the Find dialog box, do the following

1 On the Edit menu, click Find.

2 In Find What, type your search string.

3 Select Match whole word only to search for only the complete word.

4 Select Match Case to make the search case-sensitive.

5 Select Regular expression to search for a regular text expression.

6 Select Wrap around search to search from the end of the script and back to the insertion point.

7 In Direction, click Up or Down.

8 Click Find Next to find the next occurrence of your search string.

9 Click Mark All to place a small blue dot next to every line number in the script which meets the required search string criteria.

The ISQL Editor highlights the object name if it matches the search criteria.

R

EPLACE

NOTE:

This functionality is available for all platforms.

The Replace dialog box lets you search and replace text in your SQL scripts.

The table below describes the options and functionality on the Replace dialog box.

Option

Find What

Replace With

Match Case

Regular expression

Wrap around search

Description

Lets you type your search string.

Lets you type the replacement text.

Select to make the search case-sensitive.

For more information, see Regular Expressions .

Lets you search from the end of the script and back to the insertion point.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 693

IS QL ED I TO R > I SQL ED I T OR

Option

Direction

Find Next Button

Replace Button

Replace All Button

Description

Lets you specify the direction you want to search. Click the Up or Down option button.

Click to find the next occurrence of your search string.

Click replace the current selection.

Click to automatically find and replace all occurrences of your search string within the current window.

Completing the Replace Dialog Box

To complete the Replace dialog box, do the following:

1 On the Edit menu, click Replace.

2 In Find What, type your search string.

3 In Replace With, type the replacement text.

4 Select Match whole word only to search for only the complete word.

5 Select Match Case to make the search case-sensitive.

6 Select Regular expression to search for a regular text expression.

7 Select Wrap around search to search from the end of the script and back to the insertion point.

8 In Direction, click Up or Down.

9 Click Find Next to find the next occurrence of your search string.

10 Click Replace to replace the current selection.

11 Click Replace All to automatically find and replace all occurrences of your search string within the current window.

For more information, see

ISQL Editor .

R

EGULAR

E

XPRESSIONS

Regular Expressions are offered as an optional search criteria in the SQL windows search facility.

Regular Expressions serve as powerful notation for describing string matching patterns. Special characters are used to denote certain match criteria on which the ISQL Editor should conduct its search. The table below describes the special characters and their meanings:

Character

^

Meaning

Circumflex - Constrains the search to the start of a line

Example

^Rap -- Match lines beginning with Rap

^Emb -- Match lines beginning with Emb

69 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

.

Character

$

*

+

?

()

[ ]

\

Meaning

Dollar - A dollar as the last character of the string constrains matches to the end of lines.

Period - A period anywhere in the string matches any single character.

Example if$--Match lines ending with if

^end$-- Match lines consisting of the single word end

T..l -- Matches Tool, Till, Tail etc.

H.w -- Matches Huw, How, Haw etc.

^Sin.ers -- Matches lines beginning with Sinders, Sinners etc.

Asterisk - An expression followed by an asterisk matches zero or more occurrences of that expression.

to* -- Matches t, to, too etc.

00* -- matches 0, 00, 000, 0000 etc.

Plus - An expression followed by a plus sign matches one or more occurrences of that expression.

Question mark - An expression followed by a question mark optionally matches that expression.

Brackets - Brackets can be used to group characters together prior to using a * + or?.

Square brackets - A string enclosed in square brackets matches any character in that string, but no others. If the first character of the string is a circumflex, the expression matches any character except the characters in the string. A range of characters can be specified by two characters separated by a

-. These should be given in ASCII order (A-Z, a-z, 0-9 etc.).

Backslash - A backslash quotes any character. This allows a search for a character that is usually a regular expression specifier.

to+ -- Matches to, too etc.

10+ -- Matches 10, 100, 1000,

10000 etc.

/(:d+/) -- Matches (0), (12464), (12) etc.

for? -- Matches f and for

10? -- Matches 1 and 10

Rap(id)? -- Matches Rap and

Rapid

B(an)*a -- Matches Ba, Bana and

Banana

{[0-9]} -- Matches {0}, {4}, {5} etc.

/([0-9]+/) -- Matches (100), (342),

(4), (23456) etc.

H[uo]w -- Matches Huw and How

Gre[^py] -- Matches Green, Great etc. but not Grep, Grey etc.

[z-a] -- Matchesnothing

^[A-Z] -- Match lines beginning with an upper-case letter

\$ -- Matches a dollar sign $

\+ -- Matches a +

For more information, see

ISQL Editor .

G

OTO

NOTE:

This functionality is available for all platforms.

The Goto dialog box lets you move to a specific line or column in your script.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 695

IS QL ED I TO R > I SQL ED I T OR

The table below describes the options on the Goto dialog box:

Option

Line Number

Description

Lets you type or select the target line number.

Completing the Goto Dialog Box

To complete the Goto dialog box, do the following:

1 On the Edit menu, click Goto.

DBArtisan opens the Go To dialog box.

2 In Line Number, type or select the target line number.

3 Click OK.

DBArtisan moves the cursor to the target line.

For more information, see

ISQL Editor .

S

ENDING

SQL S

CRIPTS

If you have MAPI-compliant E-mail software installed on your computer, then you can send SQL scripts to other users.

To send a SQL script, do the following:

1 On the File menu, click Send.

DBArtisan opens your E-mail application.

2 In the Address box, type the name of the addressee(s) and any other options.

NOTE:

The ISQL Editor automatically attaches a file containing your SQL script to the e-mail message.

3 Click Send.

DBArtisan sends the result set to the specified addressee(s).

For more information, see

ISQL Editor .

R

ENAMING AND

C

LOSING

Q

UERY

W

INDOW

T

ABS

SQL windows are tabbed windows that can be closed or renamed.

To rename a Query Tab, you need an open SQL window that includes an executed script. For information on how to execute scripts, see:

Executing Scripts

69 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Script Execution Facility

Renaming a Query Window Tab

To rename a Query Window Tab, do the following:

1 Right-click the Query Tab on the SQL window, and then click Rename.

DBArtisan opens the Rename Tab dialog box.

NOTE:

The Query Tab can be located on the top or bottom of the SQL window. You can set the location of the tab when configuring datasource options.

2 In the New Name box, type the name of the new Query window.

3 Click OK.

DBArtisan changes the name and closes the Rename Tab dialog box. The new name of the tab displays directly on the Query Window Tab at the top of the window.

Closing a Query Window Tab

To close a Query Window Tab, do the following:

1 At the top of the ISQL window, right-click the Query Tab, and then click Close or Close All.

DBArtisan closes the Query.

For more information, see

ISQL Editor .

P

RINT

NOTE:

This functionality is available for all platforms.

The Print dialog box lets you can specify a range of panels to print, or print the contents of a script window to a file.

The table below describes the options and functionality on the Print dialog box.

Tab

Scope

Page Setup

Option

Printer

Print Range

Number of Copies

Header

Footer

Header/Footer not within Margins

Description

Displays default printer.

Lets you select the appropriate print range.

Lets you click the Up or Down arrow or type the number of copies you want.

Lets you type header type to display at the top of the page.

Lets you type header type to display at the bottom of the page.

Select to position header and footer outside the margins.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 697

IS QL ED I TO R > I SQL ED I T OR

Tab

Options

Documents

Configurations

Option

Margins

Chromacoding

Line Numbering

Other Options

Document Box

Clear

Invert

New Configuration

Name

Delete

Load

Update

Description

Lets you specify margins in either inches or centimeters.

Lets you select Use Color if you have a color printer. Lets you select Use Font if script includes italics and bold fonts.

Lets you specify the interval between numbered lines.

Lets you select other options.

Lets you select documents to print.

Click to clear list.

Click to switch printing order.

Lets you type a new configuration which saves you current settings, and then click Create.

Lets you delete an existing configuration.

Lets you load an existing configuration.

Lets you update an existing configuration.

The table below describes the buttons on the Print dialog box:

Button

Save Settings

Font

Setup

Preview

Print

Description

Lets you save settings.

Lets you open the Font dialog box and select fonts.

Lets you open the Print Setup dialog box and select printer options.

Lets you open the Print Preview dialog box that lets you preview the document before you print it.

Lets you print the document.

Completing the Print Dialog Box

To complete the Print dialog box, do the following:

1 On the File menu, click Print.

2 On the tabs, select options.

3 Click Print.

For more information, see

ISQL Editor .

S

AVING AND

C

LOSING

S

CRIPTS

Untitled scripts are named SQL1...SQLn by default, and all scripts are saved with the SQL extension. You can save your files with any valid name. If you have set the Auto-Save feature in the Options Editor, a temporary copy of your scripts is automatically saved periodically as you

work. For details, see ISQL Options

.

For more information, see:

69 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Saving a Script

Closing a Script

About the Error Pane

ISQL Editor

S

AVING A

S

CRIPT

With an ISQL window open, selecting File > Save or File > Save As opens a standard Save As dialog. It lets you save a new script, save an existing script with a new name and optionally with a different file suffix. The following Encoding schemes are supported:

• ANSI

• UNICODE

• UTF-16LE (No BOM)

• UTF-16 Big Endian

• UTF-16BE (No BOM)

• UTF-8

• UTF-8 (No BOM)

• UTF-32 Little Endian

• UTF-32LE (No BOM)

• UTF-32 Big Endian

• UTF-32BE (No BOM)).

S

AVING

M

ODIFIED

D

OCUMENTS

The table below describes the options and functionality on the Save Modified Documents dialog box:

Option

Save All

Save Selected

Invert

Save None

Description

Click to save documents in all open ISQL windows.

Click to save selected documents.

Click to clear selection.

Click to not save documents and close the application.

For more information, see

Saving a Script

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 699

IS QL ED I TO R > I SQL ED I T OR

C

LOSING A

S

CRIPT

To close a script, do the following:

1 On the on the Main menu, click Close.

DBArtisan starts closing the script.

2 If you have not saved your script, DBArtisan prompts you to save the file. Click Yes to save and No to close without saving.

For more information, see

Saving a Script

.

A

BOUT THE

E

RROR

P

ANE

You can view errors currently present in an ISQL editor window in a separate pane. The error pane provides a dynamic, line-by-line listing of the following error types:

Semantic - errors in specified object names. Semantic problems persist in the Error pane until they are corrected. For more information, see

Semantic Validation .

Syntactic - syntax problems associated with the SQL dialect of the datasource to which the

ISQL Editor session is connected. Syntax problems persist in the Error pane until they are corrected. For more information, see

Syntax Checking .

Execution - errors detected the last time the script was executed in the current ISQL editor window. Execution errors persist in the Error pane until they are refreshed by a subsequent execution.

A single menu command toggles the error pane open and closed.

To open or close the error pane:

1 On the Query menu, select Show Errors.

For more information, see

ISQL Editor .

E

DITING

S

CRIPTS

The ISQL Window incorporates a powerful editor that lets you edit your SQL scripts. The ISQL

Window includes editing features such as:

• Uppercase or lowercase character conversion.

• Commenting and uncommenting blocks of text.

• Selecting text.

• Inserting PL/SQL tags.

• Setting and navigating with bookmarks.

70 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

The ISQL Editor provides

Paste SQL Syntax

and Paste SQL Statements utilities from which you

can paste syntax for SQL commands and functions directly into an ISQL Window.

Editing a Script

To edit a script, do the following:

1 In the SQL window, type your changes or additions.

2 When you are finished with your changes, on the ISQL window tool bar, click Execute to compile the script. For more information, see

Executing Scripts .

For more information, see

ISQL Editor .

P

ASTE

SQL S

YNTAX

NOTE:

This functionality is available for all platforms.

The Paste SQL Syntax facility lets you paste SQL syntax without having to refer to documentation to find syntax for SQL commands. You can also paste the SQL directly into an

ISQL window.The Paste SQL Syntax facility that includes SQL syntax for:

• Commands

• Functions

• XML

• Other object syntax

The table below describes the options and functionality on the SQL Syntax dialog box.

Option

SQL Statements

Syntax

Paste Button

Description

Lets you select the target command, functions, or optimizer hint.

Displays the syntax.

Click to paste the SQL statement into your ISQL Window.

NOTE:

You must change the placeholders (e.g., expression) in the statements to reflect the specific objects in your database. For assistance with basic SQL statements, such as

Select, Insert, Update, or Delete, use the Paste SQL Statement facility instead.

The table below describes options for each RDBMS platform:

Oracle

SQL Commands

Number Functions

Character Functions

Sybase ASE

SQL Commands

Aggregate Functions

Datatype Conversion

Functions

Microsoft

SQL Commands

Aggregate Functions

Datatype Conversion

Functions

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 701

IS QL ED I TO R > I SQL ED I T OR

Oracle

Date Functions

Conversion Functions

Group Functions

Other Functions (User, NVL, etc.)

Optimizer Hints

Sybase ASE

Date Functions

Mathematical Functions

String Functions

System Functions

System Diagnostics

Microsoft

Date Functions

Mathematical Functions

String Functions

System Functions

Text/Image Functions

Completing the SQL Syntax Dialog Box

To complete the SQL Syntax dialog box, do the following:

1 Place your insertion point in an open SQL window.

2 On the Edit menu, click Paste SQL Syntax.

3 In SQL Statements, select the target command, functions, or optimizer hint.

4 To paste the SQL statement into your ISQL Window, click Paste.

For more information, see

Editing Scripts .

P

ASTE

SQL S

TATEMENTS

NOTE:

The functionality is available for all platforms.

The Paste SQL Statement facility lets you create Select, Insert, Update, and Delete SQL statements. The Paste SQL Statement window displays all available database object names from which you can choose to construct SQL statements. These statements are dependent on the object type you choose.

The table below describes the options and functionality on the Paste SQL dialog box.

Option

Datasource

Database

Owner

Object Type

Select

Update

Insert

Delete

Description

Lets you select the target datasource.

Lets you select the target database.

Lets you select the owner.

Lets you select the target object type.

Click if you want a SELECT SQL statement.

Click if you want an UPDATE SQL statement.

Click if you want an INSERT SQL statement.

Click if you want a DELETE SQL statement.

70 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Option

Object Type Box

Middle Box

Right Box

Description

DBArtisan displays a column of objects, given your selections of datasource, owner, and object type.

Lets you select the check box next to the target object type, or click All to select all.

Paste - Click to paste this object into your Editor window.

DBArtisan displays attributes appropriate to the type of object you selected. For example, if you select Tables, DBArtisan fills the second column with the columns of the table you select in the first column. If you select Procedures, DBArtisan fills the second column with available parameters for the procedure you select in the first column.

Lets you click the target object type properties or click All to select all. For example, if you selected a Table, then select one or more columns in the middle box; or, if you selected a Procedure, then select parameters in the middle box.

Paste - Click to paste the object properties into your Editor window, under the Object

Type box.

Displays the SQL statement.

Paste - Click when you are satisfied with the entire SQL statement. DBArtisan pastes the

SQL statement into your Editor window.

Completing the Paste SQL Dialog Box

To complete the Paste dialog box, do the following

1 Place your insertion point in an open Editor window.

2 On the Edit menu, click Paste SQL.

3 In Datasource, select the target datasource.

4 In Database, select the target database.

5 In Owner, select the owner.

6 In Object Type, select the target object type.

7 Click Select if you want a SELECT SQL statement.

8 Click Update if you want an UPDATE SQL statement.

9 Click Insert if you want an INSERT SQL statement.

10 Click Delete if you want a DELETE SQL statement.

11 In the Object Type Box, select the check box next to the target object type, or click All to select all.

12 Click Paste to paste this object into your Editor window.

13 In the Middle Box, click the target object type properties or click All to select all.

14 Click Paste to paste the object properties into your Editor window, under the Object Type box.

the SQL statement in the right box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 703

IS QL ED I TO R > I SQL ED I T OR

15 In the Right Box, click Paste when you are satisfied with the entire SQL statement.

DBArtisan pastes the SQL statement into your Editor window.

For more information, see

Editing Scripts .

S

ELECTING

T

EXT

The ISQL Editor lets you select a single word, a single line, or a block of text.

Selecting a Single Word

To select a single word, do the following:

1 In the ISQL Editor window, position the pointer in the word and double-click.

Selecting a Line of Text

DBArtisan offers two ways to select a line of text:

1 In the ISQL Editor window, click the line number listed on the left side of the window.

OR

2 Position the pointer at the beginning of the line of text, hold down the SHIFT key, and then click the end of the line of text.

NOTE:

For more keyboard commands, see Keyboard Commands

.

Selecting a Block of Text

To select a block of text, do the following:

1 In the ISQL Editor window, drag until the block of text is selected.

For more information, see

Editing Scripts .

M

OVING AND

C

OPYING

T

EXT IN AN

ISQL W

INDOW

You can move or copy information anywhere in an Editor window or into a different Editor window by dragging it.

Moving Text

To move text, do the following:

1 In the ISQL Editor window, select the text you want to move.

2 Drag to the target location.

70 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Copying Text

To copy text, do the following:

1 In the ISQL Editor window, select the text you want to copy.

2 On the Edit menu, click Copy.

3 Drag to the target location.

NOTE:

If you are dragging between different Editor windows, arrange the Editor windows so that the source and destination windows are open and visible. You must be able to see both the original and target locations.

For more information, see

Editing Scripts .

C

OMMENTING AND

U

NCOMMENTING

S

CRIPTS

For most developers and development teams, documenting code is a fundamental part of the coding process. Besides contributing explanatory material for others who need to analyze or maintain your code later, the ability to comment and uncomment code can be very useful for bypassing statements in a procedure during compilation.

Commenting Code

To commenting out code, do the following:

1 On the Edit menu, click Comment Out.

DBArtisan comments code.

Uncommenting Code

To uncomment code, do the following:

1 On the Edit menu, click Undo Comment Out.

DBArtisan uncomments code.

For more information, see

Editing Scripts .

C

HANGING

C

ASE

When writing SQL scripts, you can change the letter casing of certain statements or lines of code. You can change case from lowercase to uppercase, or from uppercase to lowercase, using the case functions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 705

IS QL ED I TO R > I SQL ED I T OR

Changing Case

To change case, do the following:

1 Select one or more letters in your script.

2 On the Edit menu, click Upper Case.

OR

On the Edit menu, click Lower Case.

DBArtisan changes the case.

For more information, see

Editing Scripts .

C

UTTING

, C

OPYING AND

P

ASTING

T

EXT AND

C

OLUMNS IN AN

ISQL

W

INDOW

The Editor window incorporates Cut, Copy and Paste text, and whole columns functions. You can move the selected text or columns to and from the Windows clipboard.

For more information, see:

Copying and Pasting Text

Cutting and Pasting Text

Copying and Pasting a Column

Cutting and Pasting a Column

C

OPYING AND

P

ASTING

T

EXT

To copy and paste text, do the following:

1 In the Editor window, select the target text.

2 On the Edit menu, click Copy.

DBArtisan copies the text.

3 On the Edit menu, click Paste.

DBArtisan pastes the text.

For more information, see

Cutting, Copying and Pasting Text and Columns in an ISQL Window

.

70 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

C

UTTING AND

P

ASTING

T

EXT

To cut and paste text, do the following:

1 In the Editor window, select the target text.

2 On the Edit menu, click Cut.

DBArtisan cuts the text.

3 On the Edit menu, click Paste.

DBArtisan pastes the text.

For more information, see

Cutting, Copying and Pasting Text and Columns in an ISQL Window

.

C

OPYING AND

P

ASTING A

C

OLUMN

To copy and paste a column, do the following:

1 In the Editor window, position the pointer in front of the column of the target text.

2 Press ALT and simultaneously drag the pointer over the target column.

3 On the Edit menu, click Copy.

DBArtisan copies the column.

4 In the Editor window, position the pointer where you want to paste the column.

5 On the Edit menu, click Paste.

DBArtisan pastes the column.

For more information, see

Cutting, Copying and Pasting Text and Columns in an ISQL Window

.

C

UTTING AND

P

ASTING A

C

OLUMN

To cut and paste a column, do the following:

1 In the Editor window, position the pointer in front of the column of the target text.

2 Press ALT and simultaneously drag the pointer over the target.

3 On the Edit menu, click Cut.

DBArtisan cuts the column.

4 In the Editor window, position the pointer where you want to paste the column.

5 On the Edit menu, click Paste.

DBArtisan pastes the column.

For more information, see

Cutting, Copying and Pasting Text and Columns in an ISQL Window

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 707

IS QL ED I TO R > I SQL ED I T OR

S

ETTING

B

OOKMARKS

Bookmarks are useful tools for navigating throughout an Editor window. You can jump back and forth between bookmarks easily, and there is no practical limit to the number of bookmarks you can set.

The table below describes the options for setting bookmarks:

Feature

Bookmarks:

Description

Bookmarks are valuable navigation aids for jumping from one portion of a script to another. You can add bookmarks in important areas of your scripts, then jump back and forth between bookmarks.

Setting a Bookmark

To set a bookmark, do the following:

1 In the Editor window, position the pointer in front of the line you want to bookmark.

2 On the Editor window tool bar, click Bookmark.

DBArtisan inserts a blue dot in the gutter next to the line you have book marked.

For more information, see:

Moving Between Bookmarks

Clearing Bookmarks

M

OVING

B

ETWEEN

B

OOKMARKS

You use the Next Bookmark and the Previous Bookmark buttons to move back and forth between bookmarks.

Goto the Next Bookmark

To goto the next bookmark, do the following:

1 In the Editor window, position the pointer where you have set bookmarks, and then click

Bookmark.

DBArtisan jumps to the next bookmark.

Goto the Previous Bookmark

To goto the previous bookmark, do the following:

1 In the Editor window, position the pointer where you have set bookmarks, and then click

Goto Bookmark.

DBArtisan jumps to the previous bookmark.

For more information, see

Setting Bookmarks

.

70 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

C

LEARING

B

OOKMARKS

To clear bookmarks, do the following:

1 On the Editor tool bar, click Clear Bookmark.

DBArtisan clears all bookmarks.

NOTE:

This does not clear any error indicators (red dots) that might be showing in the gutter.

For more information, see

Setting Bookmarks

.

E

XECUTING

S

CRIPTS

The ISQL Editor lets you execute all or part of your SQL scripts. Unless you are executing large scripts that have multiple statements within them, or you need to view optimizer statistics, you execute most of your SQL scripts without options.

NOTE:

For Oracle Client 8.0.5, if you execute a multi-line SQL statement with an error in the syntax, the cursor does not jump to the line of the error.

The ISQL Editor incorporates multiple features to refine and ease script execution. The table below describes these features:

Feature Description

Script Execution Facility

The Script Execution Facility lets you execute scripts in parallel against multiple datasources. The facility also lets you schedule a job to perform the script execution at the appointed time, which saves development time and ensures accuracy and integrity across your databases.

Step Execution Facility

The Step Execution Facility processes batches from one delimiter to the next.

Using the Query Plan

Facility

Query options

The Query Plan Facility provides a graphical display that lets you identify the execution path that your SQL follows.

DBArtisan's Query Plan window now displays data for the estimated costs, number of rows, and bytes returned by each plan step.

The Query Options dialog box lets you customize what you see when you execute your query.

Executing a Script

To execute a script, do the following:

1 On the Editor window tool bar, click Execute.

OR

In the Editor window, right-click, and then click Execute.

DBArtisan starts executing the script.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 709

IS QL ED I TO R > I SQL ED I T OR

Executing Partial Scripts

To execute a partial script, select the portion (see ISQL Options ) of the script to be executed and

follow the steps outlined above. This feature is helpful while debugging large scripts and stored procedures.

S

CRIPT

E

XECUTION

F

ACILITY

DBArtisan has a Script Execution Facility that lets you run parallel queries against multiple datasources. This facility is also a stand-alone utility that is available from the utilities tool bar. If used as a stand-alone utility, you can directly type your script or copy and paste a script in an additional tab. Once you have selected the desired options, DBArtisan establishes multiple threads and database connections to run the script simultaneously against the selected target datasources. Additionally, ANSI SQL scripts can run against multiple datasources from different

DBMS vendors. For example, you can simultaneously execute an ordinary SELECT statement against Oracle, Sybase ASE, Microsoft SQL Server and IBM DB2 for Linux, Unix, and Windows servers.

The Script Execution Facility runs with two output modes:

• Graphical

• File

Graphical output mode opens multiple result windows, one for each target datasource.

File output mode sends all output to a specified file or files. This feature allows for the execution of scripts against a large number of target datasources in a single operation and enables scheduling capabilities.

Once the scripts have finished executing, you have the option to send a notification message indicating that the script execution has completed via e-mail or Net Send. This message includes attachments of all the output files generated.

For more information, see

Executing Scripts Against Multiple Datasources .

E

XECUTING

S

CRIPTS

A

GAINST

M

ULTIPLE

D

ATASOURCES

To execute scripts against multiple datasources, do the following:

1 On the Tools menu, click Script Execution Facility.

The table below describes the options and functionality on the Script Execution Facility dialog box.

NOTE:

This option is not available for a DDL Editor or PL/ISQL Editor. To execute a script from a DDL or a PL/ISQL Editor, use the stand-alone Script Execution Facility.

2 If you selected File output:

Option

Script

Description

Lets you type, copy and paste, or cut and paste a script.

71 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Option

Target

Output

Notify

Schedule Button

Description

Only Connected Datasources - Select to see only your currently connected datasources.

All DBMS Types - Select to see all DBMS types.

In the Datasource grid, select the check boxes next to the datasources against which you want to run your query, or click Select All to select all datasources.

Database - Lets you type the name of the target database.

Specify how you want the output to be handled

Graphical Output - Select for graphical output.

File Output - Select for file output.

In the Directory box, type the full path and directory name in which you want to place the output file, or click Browse File icon to locate the directory.

Click the File Type list to specify the file type you want to apply to the output file.

Include column titles when saving - Select to include column titles in your saved file.

Open files with registered applications - Select to open the files with registered application.

Job Description - Lets you type a job description to supply a subject in your e-mail message.

E-mail addresses - Lets you type the e-mail address(es) separated by semi-colons.

Net Send User Names - Lets you type the Net Send user name(s) separated by semicolons.

This option is available when you select the File Output Option button and have the

Microsoft Task Scheduler installed. For more information regarding scheduling, see

Scheduling .

For more information, see

Script Execution Facility

C

OMPILATION

E

RROR

T

AB

DBArtisan displays any errors encountered when a package, function or procedure was last compiled by a user in a separate tab of those object editors. The Errors Tab provides the line number, column position and error message for each compilation error.

For more information, see

Executing Scripts .

C

OMMAND

H

ISTORY

The ISQL Editor is equipped with a command history box, which lets you keep a history of previously used SQL commands. The Command History is a list that is available in the Results window. Command history lets you go back and run previously used commands from the list rather than opening or inserting a script. For more information, see

Results Editor

.

You can set options on how you want to utilize this feature in the Editors tab of the Options

Editor. For details, see

ISQL Options - Editor Tab .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 711

IS QL ED I TO R > I SQL ED I T OR

Executing from Command History

To execute from Command History, do the following:

1 In the Results window, click the Command History list, and then click the command you want to execute.

The Query window is automatically populated with the selected command.

2 To execute the command, click Execute.

For more information, see

Executing Scripts .

C

ANCELING A

Q

UERY

The ISQL Editor lets you cancel a query while the rows are still being returned.

Canceling a Query

To cancel a query, do the following:

1 On the Editor window tool bar, click Cancel.

NOTE:

This button is only enabled after a script has begun executing.

For more information, see

Executing Scripts .

S

TEP

E

XECUTION

F

ACILITY

Step execution of scripts is an invaluable method to debug your scripts. The Step Execution facility lets you step through each batch in your script. While some batches can include many lines of code, some batches can consist of one line. DBArtisan parses the statements and moves from batch to batch during the step execution process, each step controlled by you clicking the step execution button.

The table below describes how DBArtisan provides a number of useful tools for working with step execution of your scripts:

Feature

ISQL Window

Gutter

Script Line

Numbers

Automatic Error

Flagging

Point and Click

Error

Navigation

Description

The ISQL Window Gutter is a vertical gray display bar located to the left of the ISQL window. It includes location indicators such as line numbers, error indicators, and bookmarks. The gutter is a quick visual cue to your current position in the script.

Line numbers are included to let you navigate large scripts. Error messages in the output window indicate the line number where the error occurred.

When using the Step Execution mode, DBArtisan flags errors with a red dot in the ISQL window gutter. The errors are flagged sequentially as they are stepped into.

DBArtisan displays errors in the output window at the bottom of the screen and selects the errors as they occur. You can click each error and DBArtisan takes you directly to the line where that error occurred.

71 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Feature

Step

Step Back

Step Over

Run to Cursor

Cancel Step

Execution

Description

Click the Step button to step into the next batch of code.

Click the Step Back icon to step back to the most previous batch of code.

Click the Step Over icon to jump over a batch to the next batch.

Click the Run to Cursor icon to execute all of the code between the beginning of the script to wherever you have inserted the pointer.

Click the Cancel Step Execution icon to change to regular execution mode.

U

SING THE

S

TEP

E

XECUTION

F

ACILITY

DBArtisan offers three ways to use the step execution facility:

1 Open a script.

2 On the Query menu, click Step-Execute.

DBArtisan starts the procedure and displays errors at the bottom of the Editor window.

NOTE:

DBArtisan indicates each executing line with a yellow arrow in the gutter of the Editor window. The gutter is that gray area between the line numbers on the left and the code window. As you step through your batches, DBArtisan moves the arrow to indicate your current location.

3 To continue stepping through the script, on the Editor window tool bar, click Step, which displays in the Editor window after you have started the Step Execute procedure.

4 To step back, on the Editor window tool bar, click Step Back, which displays in the Editor window after you have started the Step Execute procedure.

5 To step over a batch and execute the next batch, on the Editor window tool bar, click Step

Over, which displays in the Editor window after you have started the Step Execute procedure.

6 To stop Step Execution mode, on the Editor window tool bar, click Stop Step Execute, which displays in the Editor window after you have started the Step Execute procedure.

7 To Run to Cursor, on the Editor window tool bar, click Run to Cursor, which is available when the pointer is in the Editor window.

For more information, see

Executing Scripts .

U

SING THE

Q

UERY

P

LAN

F

ACILITY

Each RDBMS platform lets you view the execution path that your SQL follows. For details, see the following topics:

Viewing a Tree-based Query Plan (IBM DB2 for LUW, SQL Server, Sybase)

Viewing a Tree-based or Graphical Query Plan (Oracle)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 713

IS QL ED I TO R > I SQL ED I T OR

V

IEWING A

T

REE

-

BASED

Q

UERY

P

LAN

(IBM DB2

FOR

LUW, SQL S

ERVER

, S

YBASE

)

For IBM DB2 for Windows, Unix, and Linux, Microsoft SQL Server, and Sybase ASE, DBArtisan lets you view a tree-based representation of a query plan. The Query Plan toolbar button is a toggle. Set it to enable the Show Plan mode.

DBArtisan's Query Plan window displays data for the estimated costs, number of rows, and bytes returned by each plan step.

NOTE:

For IBM DB2 for Linux, Unix, and Windows, DBArtisan includes a tree view of statements and associated costs.

To view a tree-based representation of a query plan

1 Open a script.

2 On the Query menu, click Query Plan.

DBArtisan starts the Show Plan mode.

3 To generate the Show Plan in a separate result window, click Execute.

For more information, see

Query options

.

V

IEWING A

T

REE

-

BASED OR

G

RAPHICAL

Q

UERY

P

LAN

(O

RACLE

)

For Oracle, DBArtisan lets you view a graphical representation of a query plan. You can toggle the view between the graph-based view and a tree-based view, view details for each step, and work with a number of viewing options.

NOTE:

The Options editor has a Default Query Plan setting that controls whether the default

query plan display is tree-based or graphical. For details, see ISQL Options

.

The Query Plan toolbar button is a toggle. Set it to enable the Show Plan mode.

To view a graphical representation of a query plan

1 Open a script.

2 On the Query menu, click Query Plan.

DBArtisan starts the Show Plan mode.

3 To generate the Show Plan in a separate result window, click Execute.

Options when working with the graphical Query Plan view include:

• Hovering the mouse over an execution step node to display detailed cost details for that step

• Right-clicking and choosing Find Node or Find Next Node to search large plans for nodes whose label contains a specified text string

• Right-clicking and choosing Zoom In or Zoom Out

71 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

• Right-clicking and choosing an Orientation sub-menu command to change the orientation of the view

• Right-clicking and choosing Overview Window to open a small window showing the entire plan

• Right-clicking and choosing Save to File to open a dialog that lets you save the graphical plan as a graphics file

• Clicking the Query Plan button to toggle between the graphical view and a tree-based view

• For multiple plans created rom the same script/ISQL window, using the dropdown at the top of the plan to change the plan displayed

Q

UERY OPTIONS

DBArtisan offers a set of options corresponding to DBMS-specific query options. They let you customize the execution environment for an ISQL session with query-handling directives in areas such as performance, logging/reporting, and error handling.

See the following topics for descriptions of the options available for the DBMS you are working against:

• DB2 LUW Query options

• DB2 z/OS Query options

• MySQL Query options

• Oracle Query options

• SQL Server Query options

• Sybase Query options

If you do not change the default settings, DBArtisan will use a set of default query option settings to send to the server, one set per DBMS platform. You can, however save a set of query option settings for each DBMS, and have that set of settings used as the default for ISQL sessions against that platform. As well, during any ISQL session, you can modify the query option settings for the current session.

The query options you select apply only to the current ISQL window instance. In addition, nondefault query option settings you specify are not saved. You can however, save a set of query option settings to a file and subsequently open that file in other ISQL editor sections to have those settings applied to that session.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 715

IS QL ED I TO R > I SQL ED I T OR

To specify query options:

1 With the ISQL Editor open, select Query Options from the Query menu.

Once open, you have the following options:

• Set each option manually using the associated check box. For detailed descriptions of query options, see When query options are sent to the server .

• Use the Save button to open a dialog that lets you save the current option query settings to an XML file. The dialog also has a Load these query options as default option that lets you use the settings in the saved file as the default query option settings for the current platform. Exercising this option sets the Load Query Options feature on the DBMSspecific ISQL tab of the Options editor to specify the file you saved. For more information,

see ISQL Options

.

• Use the Load button to open a dialog that lets you locate and open a previously-saved

XML file containing query option settings.

• Use the Reset button to restore the DBArtisan query option defaults.

2 Click OK to set query options for the current ISQL window session.

NOTE:

For information on conditions for which query options are sent to the server, see When query options are sent to the server .

When query options are sent to the server

DBArtisan optimizes sending query options to the server for locked connections. Since an unlocked connection results in a new connection for each execution, query options must be sent with each execution. The following table outlines the specific cases:

Session unlocked

Session locked

When you open an ISQL window, if you not lock the connection, all query options are sent to the server each time you execute a script, immediately before executing the actual script. As long as the connection remains unlocked, all query options are sent to the server at each execution.

Similarly if you unlock a currently locked session, all query options are sent to the server at each subsequent execution.

For information on locking sessions, see Toolbar Options .

When you open an ISQL and lock the connection, all query options are sent to the server on the first execution. On subsequent executions, if you do not modify query option settings, no query options are sent to the server on subsequent executions.

If you open Query Options dialog and modify options, on the next execution only the modified settings are sent to the server. For more information, see The query options you select apply only to the current ISQL window instance. In addition, non-default query option settings you specify are not saved. You can however, save a set of query option settings to a file and subsequently open that file in other ISQL editor sections to have those settings applied to that session.

.

These rules apply as long as the connection remains locked.

71 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

DB2 LUW Q

UERY OPTIONS

The following settings are available when setting query options against a DB2 LUW datasource:

Category

Execution Options

Query Option

Batch Delimiter

Check syntax when executing

Create Explain plan tables if required

Description

The batch separator must be a viewable character and not a space, new line, or tab. The default (semi-colon) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

TRUE/FALSE

Create explain plan tables on the

SYSTOOLS schema

Max Errors Before

Aborting

Row Count

If set to TRUE, Explain Plan tables are created, as necessary. If set to FALSE and you don’t manually create tables, Explain Plan operations will fail.

If set to TRUE, Explain Plan tables are created on the SYSTOOLS schema. If the tables already exist in the user’s default schema,

DBArtisan continues to use those tables. Refer to DB2 documentation for a listing of Explain Plan tables that must be deleted in order to use the SYSTOOLS option.

If set to FALSE, Explain Plan tables are created under the user’s default schema.

Select the maximum number of errors encountered before

DBArtisan aborts a script. Setting this value to zero disables the feature.

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

TRUE/FALSE

Transactions

Run Script with batch execution

Isolation Level Lets you set DB2 Isolation Levels of UNCOMMITED READ, RESET,

CURSOR STABILITY, REPEATABLE READ, or READ STABILITY.

For more general information, see Query options

.

DB2

Z

/OS Q

UERY OPTIONS

The following settings are available when setting query options against a DB2 z/OS datasource:

Query Option

Batch Delimiter

Description

The batch separator must be a viewable character and not a space, new line, or tab. The default (semi-colon) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

TRUE/FALSE Check syntax when executing

Max Errors Before

Aborting

Select the maximum number of errors encountered before DBArtisan aborts a script. Setting this value to zero disables the feature.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 717

IS QL ED I TO R > I SQL ED I T OR

Query Option

Row Count

Description

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

TRUE/FALSE Run Script with batch execution

For more general information, see Query options

.

M

Y

SQL Q

UERY OPTIONS

The following settings are available when setting query options against a MySQL datasource:

Query Option

Batch Delimiter

Big Tables

Client Character

Insert ID

Description

The batch separator must be a viewable character and not a space, new line, or tab. The default (semi-colon) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

When set to TRUE, allows big result sets by saving all temporary sets to file. This can slow queries.

Default character set.

Choose a value to be used a following INSERT or ALTER TABLE statement when you supply an AUTO_INCREMENT value.

Interactive Timeout 28800 default

Last Insert ID Set the value to be stored in the binary log when you use LAST_INSERT_ID() in a statement that updates a table.

Max Errors Before

Aborting

Select the maximum number of errors encountered before DBArtisan aborts a script. Setting this value to zero disables the feature.

Query Cache Type The query is cached for ON or DEMAND.

Row Count

SET Other Variables Variables to be set at runtime.

SQL Auto IS NULL When set to TRUE, enables you to find the last inserted row for a table.

SQL Big Selects

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

When set to TRUE, SELECT statements likely to take a very long time to execute will be aborted (i.e., where the number of rows examined exceeds the max join size)

SQL Big Tables

SQL Buffer Result

SQL Log Bin

SQL Log Off

SQL Log Update

SQL Low Priority

Updates

TRUE/FALSE

When set to TRUE, forces results from SELECT statements into temporary tables.

When set to TRUE, allows logging to the binary log.

When set to TRUE, no logging is done to the general query log.

When set to TRUE, allows logging to the binary log.

When set to TRUE, gives table modifying operations lower priority than SELECT operations.

71 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Query Option Description

SQL Max Join Size When set to TRUE, you can catch SELECT statements where keys are not used properly and that would probably take a long time. Set it if your users tend to perform joins that lack a

WHERE clause, that take a long time, or that return millions of rows.

When set to TRUE, table and column names will be quoted.

SQL Quote Show

Create

SQL Safe Updates When set to TRUE, the query aborts UPDATE or DELETE statements that do not use a key in the WHERE clause or a LIMIT clause. This makes it possible to catch UPDATE or DELETE statements where keys are not used properly and that would probably change or delete a large number of rows

SQL Select

SQL Warnings

Transaction

Isolation

Unique Checks

The maximum number of records that should be returned from SELECT statements.

Defines whether or not single row insert statements generate an information string in the event of a warning.

Repeatable Read is the default. Read Committed, Read Uncommitted, and Serializable are the other options. Refer to MS SQL Query Options dialog box for an explanation.

Performs uniqueness checks for secondary indexes of MyISAM tables.

For more general information, see Query options

.

O

RACLE

Q

UERY OPTIONS

The following settings are available when setting query options against an Oracle datasource:

Category

Query Analysis

Query Option

Network Activity

Execution

Information

I/O Activity

Sort Activity

Index Activity

Parse Activity

Table Activity

OS Activity

Wait Activity

Description

True/False

True/False

True/False

TRUE/FALSE

True/False

TRUE/FALSE

True/False

TRUE/FALSE

True/False

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 719

IS QL ED I TO R > I SQL ED I T OR

Category

Miscellaneous

Query Option

Batch Delimiter

Check syntax when executing

LONG Size Bytes

Max Errors Before

Aborting

Row Count

Run Script with batch execution

Description

The batch separator must be a viewable character and not a space, new line, or tab. The default (“/”) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

TRUE/FALSE

8,192 is the default

Select the maximum number of errors encountered before

DBArtisan aborts a script. Setting this value to zero disables the feature.

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

TRUE/FALSE

For more general information, see Query options

.

SQL S

ERVER

Q

UERY OPTIONS

The following settings are available when setting query options against a SQL Server datasource:

Category

Query Analysis

Query Option

Show Plan

No Count

No Exec

Force Plan

Statistics I/O

Statistics Time

Parse Only

Description

When set to TRUE, reports data retrieval methods chosen by the

Microsoft SQL Server query optimizer.

Terminates the message indicating the number of rows affected by a Transact-SQL statement from being returned as part of the results.

When set to TRUE, compiles each query without executing it.

When set to TRUE, processes a join in the same order as tables appear in the FROM clause of a SELECT statement only.

Lets you display information regarding the amount of disk activity generated by Transact-SQL statements.

Displays the number of milliseconds required to parse, compile, and execute each statement.

When set to TRUE, checks the syntax of each Transact-SQL statement and returns any error messages without compiling or executing the statement.

When TRUE, makes Microsoft SQL Server only parse the statement. When FALSE, makes Microsoft SQL Server compile and execute the statement.

Do not use Parse Only in a stored procedure or a trigger.

72 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Category

Arithmetic

SET Options

Transactions

ISQ L E D IT O R > IS QL E D IT O R

Query Option

Ignore Overflow

Description

When set to TRUE, DBArtisan will ignore any overflow caused by a resulting value that is larger than a column’s specified size.

Abort On Overflow If set to TRUE, queries will be aborted on encountering a value greater than the specified size.

The Send Set Options setting dictates whether the remaining ANSI SQL Options in this category are sent to the server. The default for this option is set using the Enable SET query options setting on the ISQL tab of the Options editor. For details, see

ISQL

Options

.

If the Send Set Options setting is enabled, the remaining settings in this category let you specify the specific ANSI SQL options that are sent to the server: ansi_defaults, ansi_nulls, ansi_null_dflt_on, QUOTED IDENTIFIER, cursor_close_on_commit,

ANSI_PADDING, ANSI WARNINGS, IMPLICIT_TRANSACTIONS, and

CONCAT_NULL_YIELDS_NULL.

The initial default values are hard-coded, not obtained from server settings.

Isolation Level Read Committed: Microsoft SQL Server default transaction isolation level. Specifies that shared locks are held while data is read to avoid dirty reads. You can change the data before the end of the transaction, resulting in nonrepeatable reads or phantom data.

Read Uncommitted: The lowest level of transaction isolation.

Transactions are isolated to ensure that physically corrupt data is not read. Applies dirty read, or isolation level 0 locking, which ensures that no shared locks are issued and no exclusive locks are honored.

If set, it is possible to read uncommitted or dirty data values in the data can be changed and rows can appear or disappear in the data set before the end of the transaction.

Repeatable Read: Places locks on all data used in a query, preventing other users from updating the data. Other users can insert new phantom rows into the data and are included in later reads in the current transaction.

Concurrency is lower than Read Committed. Use this option only when necessary.

Serializable: The highest level of transaction isolation.

Transactions are completely isolated from one another.

Places a range lock on the data set, preventing other users from updating or inserting rows into the data set until the transaction is complete.

Concurrency is lower than Repeatable Read. Use this option only when necessary.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 721

IS QL ED I TO R > I SQL ED I T OR

Category

Miscellaneous

Query Option

Batch Delimiter

Max Errors Before

Aborting

Row Count

Description

The batch separator must be a viewable character and not a space, new line, or tab. The default (“go”) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

Select the maximum number of errors encountered before

DBArtisan aborts a script. Setting this value to zero disables the feature.

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

TRUE/FALSE Run Script with batch execution

Text Size 8,192 is the default

For more general information, see Query options

.

S

YBASE

Q

UERY OPTIONS

The following settings are available when setting query options against a Sybase datasource:

Category

Query Analysis

Query Option

Show Plan

No Count

No Exec

Statistics I/O

Statistics Time

Statistics Subquery

Cache

Force Plan

Prefetch

Parse Only

Description

When set to TRUE, reports data retrieval methods chosen by the Microsoft

SQL Server query optimizer.

Terminates the message indicating the number of rows affected by a

Transact-SQL statement from being returned as part of the results.

When set to TRUE, compiles each query without executing it.

Lets you display information regarding the amount of disk activity generated by Transact-SQL statements.

Displays the number of milliseconds required to parse, compile, and execute each statement.

Displays the number of cache hits, misses, and the number of rows in the subquery cache for each subquery.

When set to TRUE, processes a join in the same order as tables appear in the FROM clause of a SELECT statement only.

When set to TRUE, enables large I/Os to the data cache. When set to

FALSE, disables large I/Os to the data cache.

When set to TRUE, checks the syntax of each Transact-SQL statement and returns any error messages without compiling or executing the statement.

When TRUE, makes Microsoft SQL Server only parse the statement. When

FALSE, makes Microsoft SQL Server compile and execute the statement.

Do not use Parse Only in a stored procedure or a trigger.

72 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Category

Transactions

Arithmetic

Query Option

Chained

Isolation Level

Description

Invokes a begin transaction before the following statements: delete, insert, open, fetch, select, and update. You must still explicitly close the transaction with a commit.

0

1: Sybase default isolation level.

Prevents dirty reads.

2: Prevents dirty and non-repeatable reads.

3: Prevents dirty and non-repeatable reads and phantoms. This level is equivalent to performing all selects with holdlock.

Ignore Overflow When set to TRUE, DBArtisan will ignore any overflow caused by a resulting value that is larger than a column’s specified size.

Abort On Overflow If set to TRUE, queries will be aborted on encountering a value greater than the specified size.

Abort On

Truncation

DBCC

Traceflags

Index Selection

Join Selection

Output to Execution

Window

Output to Server

Error Log

Miscellaneous ANSI NULL

TRUE/FALSE

When set to TRUE, controls results of logical operations with NULL values.

TRUE/FALSE Set Quoted

Identifier

Batch Delimiter

Specifies behavior following a loss of scale by an exact numeric datatype during an implicit datatype conversion. When set to TRUE, a statement that causes the error is aborted but other statements in the transaction or batch continue to be processed. When set to FALSE, DBArtisan truncates the query results and continues processing.

Valuable when tuning query performance.

Valuable when tuning query performance.

TRUE/FALSE

The batch separator must be a viewable character and not a space, new line, or tab. The default (“go”) has been selected to ensure compatibility with the features of DBArtisan and the respective platform, but can be customized.

Note: A custom delimiter works only from within an ISQL window and can’t be used for extraction operations.

Row Count

Table Count

Text Size

Max Errors Before

Aborting

Run Script with batch execution

When set to TRUE, DBArtisan terminates the query after returning the specified number of rows.

Sets the number of tables that Sybase ASE considers at one time while optimizing a join.

8,192 is the default

Select the maximum number of errors encountered before DBArtisan aborts a script. Setting this value to zero disables the feature.

TRUE/FALSE

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 723

IS QL ED I TO R > I SQL ED I T OR

Category

Text Formatting

(Sybase 15)

Query Option

These options let you generate diagnostic output in text format, using the Sybase set option command. To use these options, you must be using the sa_role or have the set tracing permission.

You can select ON, OFF BRIEF, or LONG standard Sybase settings.

If you are not using the sa_role or do not have the set tracing permission, use only the DEFAULT selection for each Text Formatting Set option is available. That setting has no effect. Using other selections without the required role or permission will result in an error on the next execution.

For detailed information on these options and required permissions or roles, see the Sybase

documentation. For access, see Accessing Third Party Documentation

.

Short descriptions message content displayed for Text Formatting set option command options are:

Show

Description

Show Lop

A collection of details, where the collection depends on the choice of

BRIEF, LONG, ON, or OFF.

Logical operators used.

Show Managers

Show Props

Show Parallel

Show Histograms

Data structure managers used during optimization.

Logical properties evaluated.

Details of parallel query optimization.

Processing of histograms associated with SARG/join columns.

Show Abstract Plan Details of an abstract plan.

Show Search Engine Details of the join-ordering algorithm.

Show Counters

Show Best Plan

Optimization counters.

Details of the best query plan selected by the optimizer.

Show Code Gen

Show Pio Costing

Show Lio Costing

Show Pll Costing

Details of code generation.

Estimates ofreads/writes from/to disk.

Estimates of reads/writes from/to memory.

Estimates relating to costing for parallel execution.

Show Elimination Partition elimination.

Show Missing Stats Details of useful statistics missing from SARG/join columns.

For more general information, see Query options

.

R

ESULT

O

PTIONS

The Result Options dialog box lets you set the SQL Results Window options. The table below describes Results options:

NOTE:

The options you select only apply to the current window.

Interface

Element

Option Description

Result Window Single Window Displays all results in one tabbed result window. Multiple result sets are appended together in the window. Single

Window and Multiple Windows options are mutually exclusive.

Default

Selected

72 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Interface

Element

Placement

Format

Option Description Default

Multiple

Windows

Attached to

Editor

Displays multiple result sets one result set per window. Single

Window and Multiple Windows options are mutually exclusive.

Used in conjunction with Single Window option or Multiple

Window option. Indicates that results appear as tabbed windows attached to the ISQL Window. Attached to Editor and Unattached options are mutually exclusively.

Unattached

Standard Grid Displays all result sets in a standard grid format. Result sets are only displayed in grid format in SQL Editors that are opened after you have selected this option. It does not apply to SQL Editors that are already open.

HTML

Used in conjunction with Single Window option or Multiple

Windows option. Indicates that results appear in windows separate from the ISQL Window. Attached to Editor and

Unattached options are mutually exclusive.

Displays all result sets as HTML tables. Result sets are only displayed in HTML format in SQL Editors that are opened after you have selected this option. It does not apply to SQL

Editors that are already open.

ASCII Text Displays all result sets as ASCII Text. Result sets are only displayed in ASCII Text format in SQL Editors that are opened after you have selected this option. It does not apply to SQL

Editors that are already open.

Not selected

Selected

Not Selected

Selected

Not selected

Not selected

U

SING THE

T

OKEN

M

ATCHING

C

APABILITY

When you are working with a large script with multiple levels of embedded steps, compare left and right parentheses, curly braces, square brackets and BEGIN/END pairs to make sure that you have delimited your code properly.

The Token Matching capability of DBArtisan helps you achieve clean code.

Finding Matching Tokens

To find matching tokens, do the following:

1 Position the insertion pointer just to the left of the first token in a token pair you want to locate.

2 Click Match Token.

DBArtisan jumps the pointer to the next available token.

For more information, see

Using the Query Plan Facility

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 725

IS QL ED I TO R > I SQL ED I T OR

SQL P

REPROCESSING

: #

DEFINE AND

#

INCLUDE

DBArtisan provides SQL preprocessing similar to functionality provided by C language compiler directives. The ISQL Editor supports a simplified version of the following directives.

#include provides a means to include the contents of a file in a script at the location of the directive

#define provides a simple, global search and replace function within a script

The following figure illustrates the result of basic preprocessing of a script, nesting of #define directives/references, and the notations required by the ISQL editor. The original script includes two #define directives and a #include reference to a one-line file named fileForInclude.sql. The referenced file includes two identifiers to be replaced with #define processing.

The key steps in working with SQL preprocessing are:

Preparing the ISQL editor for #include and #define preprocessing - Prior to using SQL preprocessing features, you should set the paths that will be searched in processing

#include directives. For details, see

Setting up DBArtisan to Preprocess #include directives .

Using #define and #include directives in scripts - While the supported directives approximate typical C language #define and #include functionality, there are differences in functionality and required syntax. For example, identifiers in the #define directive and in all instances to be replaced, must be prefixed with two ampersand characters (#define &&PI

3.14159

). For detailed information, see #include Functionality and Syntax

and

#define

Functionality and Syntax

.

72 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Preprocessing and executing scripts containing #define and #include directives - The

ISQL Editor offers two preprocessing options. You can have a script preprocessed without being executed, opening the processed script in a new editor window with all #define and

#include substitutions made. This lets you view the processed script before execution or continue working with the processed SQL. Alternatively, you can have the script

preprocessed and executed in a single step. For details, see Preprocessing and Executing

Scripts Containing #define and #include Directives .

S

ETTING UP

DBA

RTISAN TO

P

REPROCESS

#

INCLUDE DIRECTIVES

In ISQL editor processing of a #include directive, DBArtisan searches the following locations, in the following order, for the specified file:

1 The location specified on the Datasource Properties tab of the Datasource Registration

Wizard/Editor. For details, see

Datasource Registration .

2 The location specified on the Directories tab of the Options editor. For details, see

Directories Options .

NOTE:

For detailed information on setting DBArtisan options, see

Specifying DBArtisan application and feature options .

Before using SQL preprocessing, ensure that server side or server side and local search paths for include files are specified.

#

INCLUDE

F

UNCTIONALITY AND

S

YNTAX

DBArtisan support for the #include directive provides a means to include the contents of a file in a script at the location of the directive. For example, if a script contains the following:

#include mydeclarations.sql

then on preprocessing of the script, there are two effects:

• The line containing the #include directive is commented out before the script is sent to the database

• The text in the file mydeclarations.sql is placed in the script following the commented out line with the #include directive.

The #include directive is supported for simple file names only. Supported syntax of the #include directive for use in the ISQL editor, Procedure Object Editor, or Package Body Object Editor, is as follows:

#include <

filename.ext> where:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 727

IS QL ED I TO R > I SQL ED I T OR

filename.ext is a simple filename and extension

NOTE:

For those familiar with C compiler functionality, angle bracket and quoted forms are supported only indirectly. While #include <filename.ext> and #include "filename.ext" forms are valid, they are functionally equivalent to the #include filename.ext. Using the angle bracket or quoted forms has no effect on locations searched for the target file.

Searches are performed in the locations specified in the setup for this feature. For details, see

Setting up DBArtisan to Preprocess #include directives .

Error processing is as follows:

• If the preprocessor fails to include the specified file, it displays an error message noting the reason for the failure (such as the file does not exist, insufficient permissions on the file, or file too large). Preprocessing or execution of the script cannot continue until the error is corrected.

• If the file is found in the first search location specified in

Setting up DBArtisan to Preprocess

#include directives

but cannot be opened (permission denied for example), no attempt will be made to locate the file in the second specified search location.

#

DEFINE

F

UNCTIONALITY AND

S

YNTAX

The #define directive provides a simple, global search and replace function within a script. For example, if a script contains the following:

#define &&PI 3.14159

then on execution of the script, there are two effects:

• All instances of &&PI in the script would be replaced by 3.14159 on execution of the script

• The line containing the #define directive is commented out before the script is sent to the database

The #define directive is supported for symbolic constants only. Supported syntax of the #define directive for use in the ISQL editor, Procedure Object Editor, or Package Body Object Editor, is as follows:

#define &&

Identifier Replacement_text where:

Identifier is any character string appearing in the script

Replacement_text is the string that will replace all instances of the string specified by the

Identifier argument. Valid values are strings, numbers or combinations consisting of the digits 0-9, characters a-z, characters A-Z, and the underscore character.

NOTE:

In addition to the actual #define directive appearing in a script, the ampersand notation is also required in all references that are to be replaced. References that are nor prefixed with ampersand characters are not processed.

Nested #define directives are also supported. For example if a script contains the following:

72 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

#define &&myTable Clients

#define &&embtClients Embarcadero

#define &&tempTable New&&myTable

#define &&embtTempTable &&embtClients&&myTable

Select * from &&tempTable;

Select * from &&embtTempTable then after preprocessing, the contents of the script would be as follows:

Select * from NewClients;

Select * from EmbarcaderoClients

P

REPROCESSING AND

E

XECUTING

S

CRIPTS

C

ONTAINING

#

DEFINE AND

#

INCLUDE

D

IRECTIVES

The ISQL editor offer two preprocess/execute modes:

• DBArtisan can preprocess the script, opening the script in a new tab, with all #define and

#include substitutions made. This lets you view your preprocessed script or continue with edits after preprocessing, before executing it in the new tab.

• DBArtisan can preprocess and execute the script in a single step.

Preprocessing or preprocessing/executing the script consists of selecting a mode and the executing the script. Preprocessing mode is controlled by the preprocessing dropdown on the

ISQL editor toolbar.

To preprocess a script and have the preprocessed script opened in a new tab:

1 From the Preprocess dropdown, select Pre-Process Only. The Preprocess dropdown icon takes on a distinctive appearance to indicate Pre-Process Only mode.

2 On the ISQL toolbar, click the Execute button.

The script with all #define and #include replacements made, opens in a new ISQL editor.

NOTE:

For details on error processing and specific handling of directives, see

#include

Functionality and Syntax

and #define Functionality and Syntax .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 729

IS QL ED I TO R > I SQL ED I T OR

To preprocess and execute a script in a single step:

1 From the Preprocess dropdown, select Pre-Process and Execute.

2 On the ISQL toolbar, click the Execute button.

The script executes. While the script sent to the server for execution includes all #define and #include substitutions, the new Query tab contains the original, unprocessed script.

For related information, see the following topics:

• See Executing Scripts

for other script execution options

• See SQL Preprocessing: #define and #include

for an introduction to SQL preprocessing in the ISQL editor

A

UTOMATED

E

RROR

D

ETECTION AND

C

ODING

A

ID

F

EATURES

DBArtisan analyzes code as you add content to an ISQL editor session and offers the following automated features:

Syntax Checking automatically flags syntactical errors in your scripts

Semantic Validation

detects object name references to objects not present in the datasource index.

Code Complete lets you insert or replace object names, selected from suggestion lists, as

you edit a script.

S

YNTAX

C

HECKING

The ISQL editor can perform on-the-fly or manually-initiated syntax checking. DBArtisan checks the syntax of the current contents of an ISQL Editor window against the SQL dialect native to the datasource to which the ISQL editor session is connected. Syntax checking can be performed regardless of whether an ISQL editor session is locked to a datasource.

For each syntax error detected, DBArtisan annotates your script and offers assistance as follows:

• Line numbers for lines containing syntax errors are flagged with an error icon.

• Hovering the mouse over an error icon displays a tooltip with an error message

• The specific error in the line of code is underlined in red

73 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

NOTE:

A line-by-line listing of individual syntax errors is also available in the ISQL editor’s Error pane. For more information, see

About the Error Pane

.

DBArtisan can be configured to perform syntax checks automatically or to require a syntax check to be initiated manually:

Automatic - Automatic syntax checking is enabled from the Options Editor. For details, see

ISQL Options - Code Assist Tab

.

If the Enable Real-time syntax checking check box is selected, a syntax check is performed whenever there is an interval of 1.5 seconds or more between key strokes. Syntax error annotations persist until the error is corrected and the next automatic syntax check is executed.

Manual - If automatic syntax checking is disabled, a syntax check is only performed when you click the Syntax button on the ISQL editor toolbar:

When automatic syntax checking is disabled, syntax error annotations persist until the error is corrected and you explicitly run another syntax check.

S

EMANTIC

V

ALIDATION

Semantic validation is an on-the-fly ISQL editor feature that verifies that object names are correctly specified. It ensures that the names of supported object types (columns, tables, synonyms, and views) present in a script match those for the connected datasource. Minimizing errors associated with typographical errors or references to obsolete object definitions,

DBArtisan analyzes the names of supported object types as you type, and raises an error condition when it detects a name not present on the datasource.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 731

IS QL ED I TO R > I SQL ED I T OR

A semantic error can indicate one of the following conditions:

• The object name as specified in the script is not present on the database

• The referenced object is hidden by a SQL filter

• The schema information that DBArtisan obtains to implement this feature is outdated. This can happen if other users or applications modify the schema during your ISQL editor

session. For information on refreshing this information, see ISQL Options - Code Assist Tab

.

When making use of this feature, always consider the following points

• For SQL Server and Sybase datasources, statements that contain temporary table names

(that is, tables whose name begins with the # character) are ignored by the semantic validation feature.

• Semantic errors in a statement are not displayed for a statement that currently has outstanding syntax errors. For more information, see

Syntax Checking

.

• For SQL Server and Sybase datasources, system table names (that is tables whose name begins with the # character) are ignored by the semantic validation feature.

• While semantic errors can be flagged with an ERROR severity level, they can be more easily distinguished from syntax errors by setting a severity level of WARNING. Similarly, if you do not want semantic errors flagged, you can set the severity level to IGNORE. For details, see

ISQL Options - Code Assist Tab

.

• Ensure that the ISQL Editor window is connected to a datasource. DBArtisan requires a datasource name in order to resolve an object name.

In the case of SQL Server and Sybase, you must also select a database. The exception to this requirement is scripts that have a USE statement, specifying a database, appearing before any object name references.

NOTE:

A line-by-line listing of individual semantic errors is also available in the ISQL editor’s

Error pane. For more information, see

About the Error Pane

.

73 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

Code Complete

Code Complete lets you quickly and accurately write DML and call\execute statements by providing a fast and intuitive lookup for database objects. Code Complete lets you select from a suggestion box that lists objects appropriate at the cursor location within a statement. Code

Complete offers intelligent suggestions in providing simple object names or in constructing fully-qualified names.

This feature becomes available at all points in INSERT, UPDATE, DELETE, SELECT, CALL, and

EXEC statements, including all legal clauses, where a reference to the name of one of the following object types is valid:

• Columns

• Tables

• Views

• Functions

• Procedures

• Packages

• Synonyms

When the Code Complete feature is enabled, it can be invoked in two ways:

• Automatically, if auto-activation is enabled. A Code Complete suggestion box is offered when you start typing an object name in a relevant location and then stop typing for an interval that exceeds the specified auto-activation delay.

• Manually, if auto-activation is disabled or if the specified auto-activation delay is sufficiently large, by pressing CONTROL+SPACE. or typing a period (.).

NOTE:

By default, Code Complete is enabled and configured for automatic invocation. For information on enabling or disabling this feature and configuring auto-activation and

other Code Complete preferences, see ISQL Options - Code Assist Tab .

Code Complete offers context sensitive suggestions based on the cursor location within the statement when Code Complete is invoked. For example:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 733

IS QL ED I TO R > I SQL ED I T OR

When invoked without any preceding text - Code Complete will supply basic suggestions appropriate to that clause.

For example, suggestions for the table name in a FROM clause would help a user construct a qualified table or view name. Against a SQL Server datasource for example, this would include schemas and databases.

Suggestions for the column name in a WHERE clause in the same statement would contain the schemas, databases and tables\views referenced in the FROM clause as well as a listing of the applicable columns based on the referenced tables\views.

After the delimiter within an object name - Code Complete offers a list that lets you select the next element to build a fully qualified object name.

73 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ISQ L E D IT O R > IS QL E D IT O R

After typing one or more characters of an object name - Code Complete offers a listing of the names of all object name elements, relevant to the cursor location within the object name, that start with the typed characters.

At any point within a partially-specified or complete object name - Code Complete offers all selections appropriate to the location of the cursor.

In addition, you can type additional characters while the suggestion list is available to further filter the items appearing in the list.

To insert or replace a suggestion:

1 Double-click an object name or object name element in the list. Alternatively, you can use the arrow keys and press ENTER.

To dismiss the suggestion list without making a selection:

1 Click anywhere outside the suggestion list or press ESC.

NOTE:

The schema information that DBArtisan obtains to implement this feature can be outdated by the actions of other users or applications during an ISQL editor session.

For information on refreshing this information, see ISQL Options - Code Assist Tab .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 735

RE SULTS E D ITO R > RES ULTS E D ITO R

R

ESULTS

E

DITOR

The results of your SQL queries are displayed in the Results Tab of each Editor Window, which captures result sets in a virtual data grid that accommodates large result sets. The data grid offers many of the features of a basic Windows spreadsheet, giving you a great deal of flexibility in editing the worksheet and formatting its contents.

TIP:

For Oracle, DBArtisan displays REF CURSOR contents in the ISQL Window and Results

Tab.

You have many choices for navigating and viewing your SQL query results. The Results window includes functionality to set result window options, find and replace, export data to other products such as Microsoft Excel, and mail your results files.

For more information, see

Configuring Result Set Windows

.

R

ESULTS

W

INDOW

T

OOLBAR

O

PTIONS

The table below describes the options of the Results window toolbar:

Option

Lock

Options

ReExecute

Close

Description

Lets you lock an ISQL Window to a specific datasource connection. When locked, the

ISQL Window does not respond to datasource change events in other windows, and only uses the current connection for subsequent execution.

Open the Options editor, letting you specify results window preferences. For more

information, see Results (ISQL) Options .

Lets you execute the script again without switching to the Query tab.

Lets you close the current results window.

C

ONFIGURING

R

ESULT

S

ET

W

INDOWS

Result set windows can be configured in a variety of ways. You can configure your result set windows to present result sets in multiple or single panels, attached or detached from the corresponding ISQL window. These options can be set globally to save you the hassle of setting options for each result window. Additionally, Result windows can be torn off and dropped onto an open area of the workspace to create separate windows. These are known as Tear Off Tab

Windows.

You can set the Result Window to display result sets in any of the following modes:

• Single result sets in one attached tab window.

• Multiple result sets in one attached tab window.

• Single result sets in one separate unattached tab windows.

73 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

• Multiple result sets in one separate unattached tab windows.

To configure result set windows

1 On the File menu, click Options.

2 In the Options Editor, click the list, and then click Results or click the Results tab.

3 Refer to

Results (ISQL) Options

for details on how to set result windows options.

C

ONFIGURING

R

ESULTS

W

INDOW

G

RID

P

ROPERTIES

You can alter the physical appearance in a results set window. Effects include items such as 3-D buttons, highlighted headings, and enabled or disabled row and column gridlines.

To configure the appearance of result set grids

1 On the File menu, click Options.

2 In the Options Editor, click the list, and then click Grid Properties or click the Grid Properties tab.

3 Refer to

Grid Properties (Results window) Options for details on how to set result windows

options.

E

XPORTING

D

ATA TO

O

THER

P

RODUCTS

You can export data from a result set to traditional spreadsheet products, such as Microsoft

Excel. You can copy part or all of a result set and paste it into your traditional spreadsheet product by way of the Microsoft Windows Clipboard function. You can also save your result sets as:

• Tab delimited files,

• Comma separated files

• Pipe delimited ( '|" ) files

• HTML

• Excel 2000 or higher

• XML

• User-specified delimited files

For more information, see

Results Editor

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 737

RE SULTS E D ITO R > RES ULTS E D ITO R

S

ETTING

R

ESULT

W

INDOWS TO

R

EAD

-

ONLY

M

ODE

To set your result windows to read only mode to keep anyone from accidentally editing or altering a result set, do the following:

1 Select a Result window that you want to make read only.

2 On the Edit menu, click Read Only.

DBArtisan places a check-mark next to read only and sets the command.

NOTE:

The Read Only command is a toggle. When it is set, the formatting buttons on the Edit menu are not available.

For more information, see

Results Editor

.

R

ESULT

W

INDOW

S

TATUS

B

AR

The Result Window Status Bar displays information about each Result window at the bottom of each window. You can display or hide the status bar by setting the Status Bar preference. This preference applies to all result windows.

For more information, see

Main Menu

.

M

AILING

R

ESULT

S

ETS

If you have MAPI-compliant electronic mail software installed on your computer, then you can mail result sets to other users.

Mailing a Result Set

To mail a result set, do the following:

1 Open the Message dialog box:

2 On the File menu, click Send.

DBArtisan opens the open Message dialog box.

3 In the Address box, type the name of the addressee(s) and any other options.

The ISQL Editor automatically attaches a file containing your result set to the mail message.

4 Click Send.

DBArtisan sends the result set to the specified addressee(s).

For more information, see

Results Editor

.

73 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

C

LOSING

R

ESULT

W

INDOW

T

ABS

DBArtisan lets you close tabbed Result set windows.

Closing a Result Window Tab

To close a Result Window Tab, do the following:

1 On the Result Window Tab tool bar, click Close.

OR

Right-click the Results Tab, and then click Close.

DBArtisan cl oses the Result Window Tab.

For more information, see

Results Editor

.

S

AVING AND

C

LOSING

R

ESULT

S

ETS

You can save your result sets using the standard Save and Save As functions. You can save multiple copies of the same result set and modify each copy to specific formatting requirements.

Saving Results

1 On the File menu, click Save. DBArtisan opens the Save Results dialog box.

2 In the File name box, type the name of the result set.

3 From the Save as type dropdown, select a file type of Excel 2000 or later .xls, tab-

delimited, comma-delimited, pipe-delimited, user-specified delimited .txt, HTML, or

XML.

4 From the Encoding dropdown, select an encoding scheme of ANSI, UNICODE, UTF-16LE

(No BOM), UTF-16 Big Endian, UTF-16BE (No BOM), UTF-8, UTF-8 (No BOM), UTF-32 Little

Endian, UTF-32LE (No BOM), UTF-32 Big Endian, or UTF-32BE (No BOM).

5 To include column titles, select Include column titles when saving.

6 If you chose User Specified Delimiter, in User Specified Delimiter type the delimiter.

7 Click Save.

Closing a Result Set

To close a result set, do the following:

1 On the Main menu, click Close.

DBArtisan closes the Result Set.

2 If you have not saved your result set, DBArtisan prompts you to save the file. Click Yes to save and No to close without saving.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 739

RE SULTS E D ITO R > RES ULTS E D ITO R

For more information, see

Results Editor

.

E

DITING

R

ESULT

S

ETS

The Results Editor provides many ways to edit and customize your result windows. The Data Grid offers a host of features for manipulating, sorting and formatting data.

Topics

• Cutting, Copying, and Pasting Cell Contents

• Cutting, Copying, and Pasting Rows

• Cutting, Copying, and Pasting Columns

• Adding and Inserting Rows

• Adding and inserting columns

• Deleting Rows and Columns

• Resizing Rows and Columns

• Sorting Data

C

UTTING

, C

OPYING

,

AND

P

ASTING

C

ELL

C

ONTENTS

The Result window supports standard cut, copy and paste functionality.

Cutting Cell Contents

To cut cell contents, do the following:

1 In the Results window, double click or tab to the target cell. A double line bounds the selected cell. You can also select text using standard text selection techniques.

2 On the Edit menu, click Cut.

DBArtisan cuts the cell.

Copying Cell Contents

To copy cell contents, do the following:

1 In the Results window, double click or tab to the target cell. A double line bounds the selected cell. You can also select text using standard text selection techniques.

2 On the Edit menu, click Copy.

DBArtisan copies the cell.

74 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

Pasting Cell Contents

To paste cell contents, do the following:

1 In the Results window, double click or tab to the target cell. A double line bounds the selected cell.

2 On the Edit menu, click Paste.

DBArtisan pastes the cell.

For more information, see

Editing Result Sets

C

UTTING

, C

OPYING

,

AND

P

ASTING

R

OWS

You can perform standard cut, copy, and paste functions on rows, just as you can on individual cells.

Cutting Rows

To cut a row, do the following:

1 In the Results window, click the numbered row heading on the left side of the row.

2 On the Edit menu, click Cut.

DBArtisan cuts the row.

Copying Rows

To copy rows, do the following:

1 In the Results window, double click or tab to the target row. A double line bounds the selected row. You can also select text using standard text selection techniques.

2 On the Edit menu, click Copy.

DBArtisan copies the row.

Pasting Rows

To paste rows, do the following:

1 In the Results window, double click or tab to the target row. A double line bounds the selected row.

2 On the Edit menu, click Paste.

DBArtisan pastes the row.

For more information, see

Editing Result Sets

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 741

RE SULTS E D ITO R > RES ULTS E D ITO R

C

UTTING

, C

OPYING

,

AND

P

ASTING

C

OLUMNS

You can perform standard cut, copy, and paste functions on columns, just as you can on rows.

Cutting Columns

To cut columns, do the following:

1 In the Results window, click the column heading above the first row.

2 On the Edit menu, click Cut.

DBArtisan cuts the column.

Copying Columns

To copy columns, do the following:

1 In the Results window, click the column heading.

2 On the Edit menu, click Copy.

DBArtisan copies the column.

Pasting Columns

To paste columns, do the following:

1 In the Results window, click the column heading above the first row to select the target column.

2 On the Edit menu, click Paste.

DBArtisan pastes the column.

For more information, see

Editing Result Sets

.

A

DDING AND

I

NSERTING

R

OWS

You can add or insert rows to expand or rearrange your result sets.

Adding a Row

To add a row, do the following:

1 To add a row as the last row of the result set, position the pointer inside the result set.

2 On the Edit menu, click Add Row.

3 To add a row inside the result set, click the numbered row heading where you want to add a row.

4 On the Edit menu, click Add Row.

74 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

Inserting a Row

To insert a row, do the following:

1 To insert a row as the last row of the result set, position the pointer inside the result set.

2 On the Edit menu, click Insert Row.

3 To insert a row inside the result set, click the numbered row heading where you want to insert a row.

4 On the Edit menu, click Insert Row.

For more information, see

Editing Result Sets

.

A

DDING AND INSERTING COLUMNS

You can add or insert columns to expand or rearrange your result sets.

Adding a Column

To add a column, do the following:

1 Position the pointer inside the result set.

2 Select Edit, Add Column from the main menu. The new column is added as the last column of the result set.

Inserting a Column

To insert a column, do the following:

1 Select the column where you want to insert a column.

2 Select Edit, Insert Column from the main menu. The new column is inserted to the left of the column that you selected.

For more information, see

Editing Result Sets

.

D

ELETING

R

OWS AND

C

OLUMNS

You can delete entire rows and columns to edit your result sets.

Deleting a Row

To delete a row, do the following:

1 Select the target row of data to delete.

2 On the Edit menu, click Delete Row.

DBArtisan deletes the row.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 743

RE SULTS E D ITO R > RES ULTS E D ITO R

Deleting a Column

To delete a column, do the following:

1 Select the target column of data to delete.

2 On the Edit menu, click Delete Column.

DBArtisan deletes the column.

For more information, see

Editing Result Sets

.

R

ESIZING

R

OWS AND

C

OLUMNS

Resizing rows and columns can aid readability of the spreadsheet contents or condense space for editing and formatting purposes.

Resizing Rows to Their Default Height

To resize rows to their default height, do the following:

1 Select one or more rows by clicking on the numbered row headings to the left of the rows.

2 Right-click the selected rows, and then click Resize Rows.

Resizing Rows to a New Height

To resize rows to a new height, do the following:

1 Select one or more rows by clicking the numbered row headings to the left of the rows.

2 Change the pointer to a solid horizontal bar with arrows on top and bottom by moving it to one of the upper or lower borders of the row heading.

3 Click and grab the row border and drag the pointer to enlarge or shrink the height of the row.

Resizing Columns to Their Default Widths

To resize columns to their default widths, do the following:

1 Select one or more columns by clicking the column headings.

2 Right-click the selected columns, and then click Resize Columns.

Resizing Columns to a New Width

To resize columns to a new width, do the following:

1 Select one or more columns by clicking the column headings.

2 Change the pointer to a solid horizontal bar with arrows on top and bottom by moving it to one of the upper or lower borders of the column heading.

74 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

3 Click and grab the column border and drag the pointer to enlarge or shrink the height of the column.

For more information, see

Editing Result Sets

.

S

ORTING

D

ATA

To order and organize data in a coherent manner, you can sort columns alphanumerically in single result sets.

Sorting Data

To sort data, do the following:

1 Double click the column header to sort the data in the column in ascending, alphanumeric order. To sort the column in descending order, double click the column header again.

NOTE:

This option is not valid for multiple result sets.

For more information, see

Editing Result Sets

.

F

ORMATTING

R

ESULT

S

ETS

The ISQL Editor provides flexibility in formatting result sets, for analysis and reporting, from within a Result Window. Result sets can be formatted to best suit your purpose, whether it be sending via e-mail, printing, or exporting a file to other programs, such as Microsoft Excel. Some of these features change only the screen display of the results, while others allow you to format for printing.

Topics

• Changing the Displayed View

• Format Border Styles

• Format Font Styles

• Format Color Styles

For information on general appearance of results, see Configuring Results Window Grid

Properties

.

C

HANGING THE

D

ISPLAYED

V

IEW

You can view results in a standard grid, in HTML format, or as flat ASCII. By default, when a result window is generated, the results are displayed according to the view option currently selected

on the Results (ISQL) Options . You can change the display in the results window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 745

RE SULTS E D ITO R > RES ULTS E D ITO R

To change the result view on the fly:

1 RIght-click in the results window.

2 On the shortcut menu, choose one of the View as Grid, View as HTML, or View as ASCII options.

F

ORMAT

B

ORDER

S

TYLES

You can use the shortcut menu to alter border properties.

Completing the Format Styles Dialog Box

To complete the Format Styles dialog box, do the following:

1 Right-click the Result data grid, and then click Border.

2 On the Border box, you can indicate whether or not a border should appear on the top, bottom, right, left, or for a range of cells by clicking the corresponding boxes.

3 To set a range of cells apart by setting a particular border style around that range, select the range in the result set before opening the Format Styles dialog box. To select the Range property, click the range box.

4 In the Type box, you can select the type of line you want to border the cell or cells by clicking the corresponding boxes.

5 To select a color, click the Color list, and then click the border color.

6 Click OK.

DBArtisan saves your changes and closes the Format Styles dialog box.

For more information, see

Formatting Result Sets .

F

ORMAT

F

ONT

S

TYLES

You can use the shortcut menu to alter font properties. Selecting the Font command displays the

Format Styles tabbed dialog box.

Completing the Format Styles Dialog Box

To complete the Format Styles dialog box, do the following:

1 Right-click the Result data grid, and then click Font.

DBArtisan opens the Format Styles dialog box.

2 In the Font box, type or click the font you want to use.

3 In the Style box, type or click the font style you want to use.

74 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

RE SU LTS EDITO R > RE SU LTS E D ITO R

4 In the Size box, type or click the size you want to use.

5 To make a line cross through the length of the text, in the Effects box, select the Strikeout check box.

6 To underline the text, in the Effects box, select the Underline check box.

7 To change the script style, click the Script list, and then click the new script style.

The Sample box displays the sample text of your selections

For more information, see

Formatting Result Sets .

F

ORMAT

C

OLOR

S

TYLES

You can use the shortcut menu to alter color properties. Selecting the Color command displays the Cell Properties dialog box.

Completing the Cell Properties Dialog Box

To complete the Format Styles dialog box, do the following:

1 Right-click the Result data grid, and then click Color.

DBArtisan opens the Cell Properties dialog box.

2 Change the Text Color and Background Color options.

For more information, see

Formatting Result Sets .

N

OTES ON

XML T

YPES AND

U

NICODE

D

ISPLAY IN THE

R

ESULTS

E

DITOR

When viewing data in the Results grid, keep the following in mind:

• XML data types are supported for IBM DB2 for Windows, Unix, and Linux, Microsoft SQL

Server, and Oracle. In the Results grid, XML data types are displayed as LOB content.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 747

RE SULTS E D ITO R > RES ULTS E D ITO R

• Support for display of Unicode characters is provided as follows:

• IBM DB2 for Windows, Unix, and Linux V8 and V9: character, clob, varchar, and

longvarchar types

• SQL Server 2000: for nchar, nvarchar, and ntext types

• SQL Server 2005: nchar, nvarchar, ntext, and nvarchar(max) types

• Oracle 8i, 9i, and 10g: NCHAR, NVARCHAR2 and NCLOB for non-Unicode UTF8

Character Set Instances and NCHAR, NVARCHAR2, CHAR, VARCHAR2, LONG, NCLOB and CLOB for Unicode UTF8 Character Set Instances

• Sybase 12.5 and 15.2: UNICHAR,UNIVARCHAR and UNITEXT for non-Unicode UTF8

Character Set Instances and UNICHAR, UNIVARCHAR, UNITEXT, NCHAR, NVARCHAR,

CHAR, VARCHAR and TEXT for Unicode UTF8 Character Set Instances

74 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U

TILITIES

DBArtisan incorporates a number of powerful utilities that let you create, edit and manage your development environment. You can use utilities to:

• Conduct extensive database searches across multiple databases.

• Perform complex cross-platform database migrations.

• Extract schema for multiple database objects.

• Load and unload table data.

• Configure your server.

• Monitor and analyze all processes on the server.

• Schedule tasks.

Cross-Platform Utilities

The table below describes the utilities for IBM DB2 for Linux, Unix, and Windows, IBM DB2 for z/

OS and OS/390, Microsoft SQL Server, MySQL, Oracle, and Sybase ASE:

Utility

Using the Schema

Extraction Wizard

Using the Schema

Migration Wizard

Using the Schema

Publication Wizard

Database Monitor

SQL Logfile

Description

The Schema Extraction Wizard lets you reverse-engineer an entire database or any portion of it.

The Schema Migration Wizard offers robust cross-DBMS-platform object migration capabilities that can migrate schema and table data between databases on the same or different servers.

The Schema Publication Wizard lets you generate HTML reports documenting the details of your databases.

The Database Monitor displays all processes connected to the server and lets you scan your databases to determine potential performance problems.

DBArtisan lets you log all of its SQL statements to a file so you have an audit trail of application activity.

IBM DB2 for Linux, Unix, and Windows Utilities

The table below describes the utilities for IBM DB2 for Linux, Unix, and Windows:

Utility

Data Export Wizard for IBM

DB2 for Linux, Unix, and

Windows

Data Import Wizard for IBM

DB2 for Linux, Unix, and

Windows

Database Manager

Description

The Data Export Wizard lets you export table data.

The Data Import Wizard lets you import table data.

The Database Manager lets you view and manage your databases.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 749

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Microsoft SQL Server Utilities

The table below describes the utilities for Microsoft SQL Server:

Utility

Data Unload Wizard for

Microsoft SQL Server and Sybase ASE

Description

The Data Unload Wizard lets you export table data.

Data Load Wizard for

Microsoft SQL Server and Sybase ASE

Database Manager

The Data Load Wizard lets you load data.

The Database Manager lets you view and manage your databases.

Database Backup Wizard

The Database Backup Wizard lets you backup your databases without having to know the underlying syntax.

Database Recovery

Wizard

The Database Recovery Wizard lets you restore your databases on a separate server to enhance system availability.

Oracle Utilities

The table below describes the utilities for Oracle:

Utility

Data Export Wizard for

Oracle

Data Import Wizard for

Oracle

Archive activity

Backup Control Files

Chained Row Analysis

Free space Deficit

Instance Parameter

Configuration

Configuring Resource

Cost

Session Information

Description

The Data Export Wizard lets you extract object definitions and table data from an Oracle database and create a binary export file.

The Data Import Wizard lets you extract object definitions from an Oracle Export file and inputting them into the database.

DBArtisan lets you operate an Oracle database in ARCHIVELOG or NOARCHIVELOG mode.

DBArtisan lets you use the graphical interface for constructing the ALTER DATABASE command needed to backup your control files.

DBArtisan lets you analyze chained rows.

The Free Space Deficit Monitor identifies any objects not be able to acquire their next extent.

The Instance Parameter Configuration lets you view and edit the settings for each Oracle instance.

DBArtisan lets you use the visual interface for constructing an ALTER RESOURCE COST command.

DBArtisan lets you view session information.

S

CHEMA

E

XTRACTION AND

M

IGRATION

U

TILITIES

DBArtisan lets you migrate schema and table data between databases on the same or different servers. Similarly, you can build and store a schema extraction script. Both features employ a wizard that walks you through the process and make use of similar options.

75 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

For detailed information, see the following topics:

Using the Schema Extraction Wizard

Using the Schema Migration Wizard

U

SING THE

S

CHEMA

E

XTRACTION

W

IZARD

The Schema Extraction wizard walks you through the process of building an extraction script, executing it for storage of the database or object schema in a file. The basic process includes choosing the server and database objects for extractions and specifying options that dictate how the extraction script is built. This utility allows you to:

• Extract and archive entire databases or sets of database objects.

• Generate the complete definition of any database object type.

• Reverse-engineer schema, and also place the SQL statements in their proper sequence, regardless of the objects you select.

• Create a new schema extraction operation.

• Reuse a previously defined schema extraction operation.

• Specify the target object types to extract.

• Specify the dependent object types automatically extracted for any object type.

• Set the general script type and options.

• Preview the definition of your schema extraction operation.

To build and execute a schema extraction script

1 Connect to the datasource where you want to extract schema. For details, see

Datasource

Management

.

2 On the Datasource Explorer, select the target database or database object.

3 On the Utilities menu, click Schema Extraction.

The Extraction Wizard opens.

4 Use the following table as a guide to understanding and setting options in the wizard:

Panel

Playback

Tasks and Settings

Perform new extraction and

Playback an existing

extraction

Description

Lets you start a new extraction or select an existing extraction script you want to replay from the drop-down list.

NOTE: When the script opens, you can make changes to the operation you are replaying. The changes you make will overwrite the current script.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 751

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Panel

Connection

Tasks and Settings

Source Datasource

Catalogs (only displayed for multiple database

DBMS datasources)

Object Selection

Source Database

Schemas

Options

Summary

Execute

Description

Lets you select the datasource from which you want to extract schema.

Lets you select one or more databases from which you want to extract schema.

Object Types

Objects

Opens a dialog that lets you narrow the choice of candidate objects by selecting only those associated with specified schema.

Lets you select the object types that will be extracted.

You can use the expand/collapse icons to hide and show the dependent object types for each object.

As you select object types, all objects of that type (that satisfy the Schemas criteria) are made available for selection in the Objects list. Selected dependent object types are also made available in the Objects list.

For information on setting the dependent object type automatically selected to be extracted along with each

object type, see DDL Extract Options .

Lets you select the specific objects that will be extracted.

For each object selected, you can also select the specific dependent objects that are to be extracted.

This panel lets you choose migration/extraction options and view an Example Preview script that is updated as you choose options. It also lets you save your options choices as a template, with an option to use the saved template as the default.

For a detailed descriptions of the options presented on this panel, see Common Schema

Migration and Extraction Options

.

Presents the following options:

Output script to file

Save existing operation

Lets you output the script performing the extraction to a file with the specified path and name.

Lets you save a copy the choices you made on the wizard panels. On subsequent schema extractions, you can then playback the existing extraction, optionally changing option settings, in creating an extraction script. You specify the path and name of the file in which to save the extraction operation.

Click Finish when ready to proceed with the extraction.

Displays the status of the extraction with details on the number of objects retrieved, the number of errors detected, and the elapsed time. On completion, the schema definition is stored in the file you specified on the previous panel.

Filter options (Show All, Show Errors, and Show Warnings) let you display specific types of messages generated during the extraction process.

When the extraction completes, you can also use the following options:

Continue

Report

Opens the extraction script in the ISQL Editor. For more

information, see SQL Scripting .

Opens a detailed report on the results of the schema extraction.

75 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

U

SING THE

S

CHEMA

M

IGRATION

W

IZARD

DBArtisan offers robust cross-DBMS-platform object migration capabilities that can migrate schema and table data between databases on the same or different servers. DBArtisan's migration capabilities automatically resolve differences between DBMS platforms, alleviating the responsibility of knowing the syntax and object variations inherent in database platforms. The

Schema Migration Wizard sequences the creation of objects in the proper order to eliminate dependency errors. It also has the intelligence to use the fastest method available for copying table data.

The Schema Migration Wizard lets you:

• Create a new schema migration operation.

• Re-use a previously defined schema migration operation.

• Specify a source and a target datasource.

• Specify server object types, database object types, and general migration options.

• Select specific objects and to set certain migration options for each object type.

• Specify the dependent object types automatically migrated for any object type.

• Specify object ownership.

• Specify if the migration operation is to be saved for reuse.

CAUTION:

Schema migration jobs created in earlier versions of DBArtisan that were saved with a .migrate file extension must be re-created in DBArtisan 8.1 or later. Only migration jobs with a .sav extension can be reused.

The table below describes the object types that can be migrated to different supported platforms and the utility used to accomplish the migration operation:

Source

DB2

Target

DB2

SQL Server

Sybase ASE

Oracle

SQL Server SQL Server

Sybase ASE

Oracle

DB2

Object Type

All Object Types & Data

Tables, data, views, indexes, users

Tables, data, views, indexes, users

Tables, data, views, indexes, users

All Object Types & Data

All Object Types & Data

Tables, data, views, indexes, logins

Tables, data, views, indexes, logins

Data Out Method Data In Method

DB2 Export API

Call

DB2 Import API Call

SQL SELECT

SQL SELECT

SQL SELECT

BCP Utility

BCP Utility

BCP Utility

SQL * Loader Utility

BCP Utility

BCP Utility

SQL SELECT

SQL SELECT

BCP Utility

SQL * Utility

DB2 Import API

Calls

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 753

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Source

Oracle

Target

SQL Server

Sybase ASE

Oracle

DB2

Sybase ASE Sybase ASE

SQL Server

Oracle

DB2

Object Type

All Object Types & Data

Tables, data, views, indexes, logins

All Object Types and Data

Tables, data, views, indexes, logins

All Object Types & Data

All Object Types & Data

Tables, data, views, indexes, logins

Tables, data, views, indexes, logins

Data Out Method Data In Method

BCP Utility BCP Utility

BCP Utility

SQL SELECT

SQL SELECT

BCP Utility

BCP Utility

SQL * Utility

SQL * Utility

BCP Utility

BCP Utility

SQL SELECT

SQL SELECT

BCP Utility

SQL * Utility

DB2 Import API

Calls

To copy objects between servers, the Schema Migration Wizard establishes separate connections to both the source and target servers. Based on the copy options you choose, it then migrates schema from the source to the target database. If the bulk copy command is used when copying table data, a temporary BCP file is built in the temp directory of your computer.

NOTE:

Before migrating, ensure that any object requirements, restrictions, or restrictions are satisfied. For details, see

Migration and Object Restrictions/requirements .

To Open the Schema Migration Wizard

1 Connect to the datasource from which you want to migrate schema. For details, see

Datasource Management

.

2 On the Datasource Explorer, select the target database or database object.

3 On the Utilities menu, click Schema Migration.

The Migration Wizard opens.

4 Use the following table as a guide to understanding and setting options in the wizard:

Panel

Playback

Connection

Catalogs (only displayed for multiple database

DBMS datasources)

Tasks and Settings

Perform new migration and Playback an

existing migration

Source Datasource and

Target Datasource

Source Database and

Target Database

Description

Lets you start a new migration or select an existing migration script you want to replay from the drop-down list.

NOTE: When the wizard opens, you can make changes to the operation you are replaying.

Lets you select the datasource from which you want to migrate the schema and the datasource to which you want to migrate.

Lets you select a source and target database.

75 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Panel

Object

Selection

Options

Summary

Execute

Tasks and Settings

Schemas

Object Types

Objects

Description

Opens a dialog that lets you narrow the choice of candidate objects by selecting only those associated with specified schema.

Lets you select the object types that will be migrated. You can use the expand/collapse icons to hide and show the dependent object types for each object.

As you select object types, all objects of that type (that satisfy the

Schemas criteria) are made available for selection in the Objects list.

Selected dependent object types are also made available in the

Objects list.

For information on setting the dependent object type automatically

selected to be extracted along with each object type, see DDL Extract

Options

.

Lets you select the specific objects that will be extracted. For each object selected, you can also select the specific dependent objects that are to be extracted.

This panel lets you choose migration options and view an Example Preview script that is updated as you choose options. It also lets you save your options choices as an template, with an option to use the saved template as the default.

For a detailed descriptions of the options presented on this panel, see

Common Schema

Migration and Extraction Options

.

This panel presents the following options:

Output script to file Lets you specify the name and path of a file to store the output script.

Save existing operation Lets you save a copy the choices you made on the wizard panels. On subsequent schema migrations, you can then playback the saved migration settings, optionally changing option settings. You specify the path and name of the file in which to save the migration operation.

Click Finish when ready to proceed with the extraction.

Displays the status of the migration with details on the number of objects retrieved and created, the number of errors detected, and the elapsed time.

Filter options (Show All, Show Errors, and Show Warnings) let you display specific types of messages generated during the migration process.

When the extraction completes, you can also use the following option:

Continue

Report

Opens the extraction script in the ISQL Editor. For more information,

see SQL Scripting .

Opens a detailed report on the results of the schema migration.

E

XECUTING

S

TATEMENTS

B

EFORE OR

A

FTER

C

REATION OF

F

UNCTIONS OR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 755

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

P

ROCEDURES

During migration, it can be necessary to have statements executed before and after creation of the procedure or function. This can be useful for example, if you need to create or drop temporary tables used by the function or procedure. DBArtisan supports the use of two tag pairs, ETStart and ETEnd, that let you embed statements in the first comment block of a stored procedure or function. The following shows the expected syntax: create procedure dbo.procname(@a numeric) as

/*

<ETStart>SQL Statement</ETStart>

<ETEnd>SQL Statement</ETEnd>

*/ begin

...

C

OMMON

S

CHEMA

M

IGRATION AND

E

XTRACTION

O

PTIONS

When extracting or migrating schema, the wizards present a set of options that let you specify how the extraction or migration script is created. The following table describes these options.

NOTE:

Depending on the DBMS you are working with, the types of objects you choose to migrate/extract, and the specific migration or extraction operation, not all options are available.

Tasks and Settings

Group Dependencies

Script... options

Script Owner

Owner

Change Owner To

Description

If set to True, objects that are dependent on each other are placed together in the script. For example, Table A would be followed by all objects dependent on Table A.

If set to False, all objects of the same type are extracted simultaneously.

Depending on the DBMS you working with and the types of objects you selected, these options let you specify whether you want to include Create statements, Drop statements, System Privileges, Object Privileges, and If Not Exists statements in the script.

True/False to include the owner in the scripts or not.

Retain Owner/Change Owner

If you opted to change the owner, choose the new owner to use when scripting options from the drop-down list.

Copy Owner (Migration only) Lets you retain the owner in the extraction/migration.

Overwrite Existing

(Migration only)

Choose one of the following options:

Overwrite Existing: objects are overwritten with no prompt. Objects on the target datasource are dropped before new objects are created

Prompt Whether To Overwrite: The user will be prompted before the object is dropped and re-created. (Note: this will be done on an object-by-object basis).

Do Not Overwrite Existing: If the object exists on the target datasource, no attempts is made to recreate it on the target.

Ignore Overwrite: (default) Artisan will try to create the migrated objects, without checking the existence on the target datasource.

Generate Script (Migration only)

If set to FALSE, the generated DDL is executed on the target datasource. If set to

TRUE, DBArtisan generates a script which could be used to migrate the schema at a later date.

75 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

For context information, see the following topics:

Using the Schema Extraction Wizard

Using the Schema Migration Wizard

M

IGRATION AND

O

BJECT

R

ESTRICTIONS

/

REQUIREMENTS

Some objects have additional requirements, exceptions, or options. Before migrating a database object, check your database platform for additional information:

Migrating IBM DB2 for Windows/Unix Objects

Migrating IBM DB2 for OS/390 and z/OS Objects

Migrating Microsoft SQL Server Objects

Migrating Oracle Objects

Migrating Sybase ASE Objects

M

IGRATING

IBM DB2

FOR

W

INDOWS

/U

NIX

O

BJECTS

The table describes the condition(s) that need to be satisfied on the target database to migrate objects:

Object

Aliases

Indexes

Nodegroups

Procedures

Condition(s) on Target Database

The login must already exist on the target server.

The user must already exist in the target database.

The base tables must already exist in the target database.

The base tables must already exist in the target database.

Any objects referenced by the stored procedure, including tables, views and other stored procedures, must already exist in the target database.

The owner of the stored procedure must already exist in the target database.

Tables Any referenced user datatypes must already exist in the target database.

Any defaults referenced by the table must already exist in the target database.

Any rules referenced by the table must already exist in the target database.

If the tables have foreign key references to tables not included in the migration, these tables must already exist in the target database.

The container mappings and directories must already exist on the target server. Tablespaces

Triggers The base tables and their owners must already exist in the target database.

Any objects referenced by the trigger, including other tables, views and other stored procedures, must already exist in the target database.

User Datatypes The owner of the user datatype must exist in the target database.

Users The database objects must already exist in the target database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 757

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

For more information, see:

M

IGRATING

IBM DB2

FOR

OS/390

AND Z

/OS O

BJECTS

The table describes the condition(s) that need to be satisfied on the target database to migrate objects:

Object

Aliases

Indexes

Procedures

Tables

Tablespaces

Triggers

Condition(s) on Target Database

The login must already exist on the target server.

The user must already exist in the target database.

The base tables must already exist in the target database.

Any objects referenced by the stored procedure, including tables, views and other stored procedures, must already exist in the target database.

The owner of the stored procedure must already exist in the target database.

Any referenced user datatypes must already exist in the target database.

Any defaults referenced by the table must already exist in the target database.

Any rules referenced by the table must already exist in the target database.

If the tables have foreign key references to tables not included in the migration, these tables must already exist in the target database.

The container mappings and directories must already exist on the target server.

The base tables and their owners must already exist in the target database.

Any objects referenced by the trigger, including other tables, views and other stored procedures, must already exist in the target database.

User Datatypes The owner of the user datatype must exist in the target database.

Users The database objects must already exist in the target database.

Views Any objects referenced by the view, including tables and other views, must already exist in the target database.

The owner of the view must already exist in the target database.

M

IGRATING

M

ICROSOFT

SQL S

ERVER

O

BJECTS

The table describes the condition(s) that need to be satisfied on the target database to migrate objects:

Object

Aliases

Defaults

Groups

Condition(s) on Target Database

The login must already exist on the target server.

The user must already exist in the target database.

The owner of the default must exist in the target database.

Any bound user datatypes must exist in the target database.

Any bound table columns must exist in the target database.

To migrate any object privileges granted to groups, the database objects must already exist in the target database.

75 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Object Condition(s) on Target Database

Linked Servers Links do not migrate. So, after you migrate a linked server, open the Linked Server Editor and

create new linked server logins. For more information, see Linked Servers Editor (SQL Server)

.

Procedures The user who owns the procedure(s) must already exist in the target database.

Any objects referenced by the procedure(s) must already exist in the target database.

Remote Servers DBArtisan lets you migrate the schema for one or more remote servers between cross-platform

DBMSs. Specifically, you can migrate remote servers between different versions of Microsoft SQL

Servers and Sybase ASE. To migrate remote servers, DBArtisan establishes separate connections to both the source and target servers and copies the DDL between the source and target databases.

Roles To migrate any object privileges granted to roles, the database objects must already exist in the target database.

Rules

Segments

Tables

The owner of the rule must exist in the target database.

Any bound user datatypes must exist in the target database.

Any bound table columns must exist in the target database.

To migrate segments successfully, all referenced database fragments must already exist in the target database.

Any referenced user datatypes must already exist in the target database.

If you are copying segment placement also, then the segments must already exist in the target database.

Any defaults referenced by the table must already exist in the target database.

Any rules referenced by the table must already exist in the target database.

If the tables have foreign key references to tables not included in the migration, these tables must already exist in the target database.

Triggers The base tables and their owners must already exist in the target database.

Any objects referenced by the trigger, including other tables, views and other stored procedures, must already exist in the target database.

User Datatypes The owner of the user datatype must exist in the target database.

Any bound defaults and rules must exist in the target database.

Users The logins must already exist in the target server.

The database objects must already exist in the target database.

Views Any objects referenced by the view, including tables and other views, must already exist in the target database.

The owner of the view must already exist in the target database.

M

IGRATING

O

RACLE

O

BJECTS

The table describes the condition(s) that need to be satisfied on the target database to migrate objects:

Object

Clusters

Directories

Condition(s) on Target Database

The user who owns the cluster(s) must already exist in the target database.

The tablespace on which the cluster(s) are placed must already exist in the target database.

To migrate directories successfully, the object must exist in the target database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 759

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Object

Functions

Indexes

Condition(s) on Target Database

The user who owns the function(s) must already exist in the target database.

Any objects referenced by the function(s) must already exist in the target database.

The tables on which the indexes are being built must already exist in the target database.

The user who owns the indexes must already exist in the target database.

The tablespace on which the indexes are being placed must already exist in the target database.

The object type must exist on the target server. Libraries

Materialized Views The user who owns the materialized view(s) must already exist in the target database.

Any objects referenced by the materialized view(s) must already exist in the target database.

Materialized View

Logs

Packages

The user who owns the materialized view log(s) must already exist in the target database.

Any objects referenced by the materialized view log(s) must already exist in the target database.

The user who owns the package(s) must already exist in the target database.

Any objects referenced by the package(s) must already exist in the target database.

Procedures The user who owns the procedure(s) must already exist in the target database.

Any objects referenced by the procedure(s) must already exist in the target database.

Rollback Segments The user who owns the rollback segment(s) must already exist in the target database.

The tablespaces where the rollback segment(s) are to be placed must already exist in the target database.

Sequences

Synonyms

The user who owns the sequence(s) must already exist in the target database.

Any objects referenced by the sequence(s) must already exist in the target database.

The user who owns the synonym(s) must already exist in the target database.

The base objects referenced by the synonym(s) already exist in the target database.

Tables

Triggers

Types

Users

Any referenced user datatypes must already exist in the target database.

If you are copying tablespace placement also, then the tablespaces must already exist in the target database.

If the tables have foreign key references to tables not included in the migration, these tables must already exist in the target database.

NOTE: Index-Organized tables are coded to automatically migrate as though Copy Table

Constraints in Alter Form is not selected, and Include Table Constraints is selected.

The user who owns the trigger(s) must already exist in the target database.

The base triggers must already exist in the target database.

Any objects referenced by the trigger(s) must already exist in the target database.

The user who owns the object type(s) must already exist in the target database.

The base object types must already exist in the target database.

Any objects referenced by the object type(s) must already exist in the target database.

The default and temporary tablespaces assigned to the user(s) must already exist in the target database.

The profiles assigned to the user(s) must already exist in the target database.

Any tablespaces on which quotas are defined must already exist in the target database.

Any roles granted to the user(s) must already exist in the target database.

76 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SC H E M A E X T R A C T IO N A N D MI G R A T IO N U T IL I T IE S > SC H E M A E X T R A C T I ON A N D M IG R A T I ON U T I LI T IE S

Object

Views

Condition(s) on Target Database

Any objects referenced by the view, including tables and other views, must already exist in the target database.

The owner of the view must already exist in the target database.

M

IGRATING

S

YBASE

ASE O

BJECTS

The table describes the condition(s) that need to be satisfied on the target database to migrate objects:

Object

Aliases

Defaults The owner of the default must exist in the target database.

Any bound user datatypes must exist in the target database.

Any bound table columns must exist in the target database.

Groups

Procedures

To migrate any object privileges granted to groups, the database objects must already exist in the target database.

The user who owns the procedure(s) must already exist in the target database.

Any objects referenced by the procedure(s) must already exist in the target database.

Remote Servers DBArtisan lets you migrate the schema for one or more remote servers between cross-platform

DBMSs. Specifically, you can migrate remote servers between different versions of Sybase ASE and Microsoft SQL Servers.

Roles To migrate any object privileges granted to roles, the database objects must already exist in the target database.

Rules

Condition(s) on Target Database

The login must already exist on the target server.

The user must already exist in the target database.

Segments

Tables

Triggers

The owner of the rule must exist in the target database.

Any bound user datatypes must exist in the target database.

Any bound table columns must exist in the target database.

To migrate segments successfully, all referenced database fragments must already exist in the target database.

Any referenced user datatypes must already exist in the target database.

If you are copying segment placement also, then the segments must already exist in the target database.

Any defaults referenced by the table must already exist in the target database.

Any rules referenced by the table must already exist in the target database.

If the tables have foreign key references to tables not included in the migration, these tables must already exist in the target database.

NOTE: DBArtisan no longer changes the table lock scheme from ALLPAGES back to DATAROWS on the target server when using BCP.exe version dated after December 1997.

The base tables and their owners must already exist in the target database.

Any objects referenced by the trigger, including other tables, views and other stored procedures, must already exist in the target database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 761

U SIN G T HE SC HE MA PU B L I C A T IO N W I ZA RD > U S I N G T H E S C H E M A P UB L I C A T I O N W IZ A RD

Object Condition(s) on Target Database

User Datatypes The owner of the user datatype must exist in the target database.

Any bound defaults and rules must exist in the target database.

Users The logins must already exist in the target server.

The database objects must already exist in the target database.

Views Any objects referenced by the view, including tables and other views, must already exist in the target database.

The owner of the view must already exist in the target database.

U

SING THE

S

CHEMA

P

UBLICATION

W

IZARD

The Schema Publication Wizard lets you generate HTML reports documenting the details of your schema, databases, and objects, which you can share over an intranet or the Internet.

DBArtisan uses HTML Templates to create the reports which you can manually edit to create customized reports.

Schema publication produces a two-pane report. The left-hand pane lets you navigate through all objects contained in the report while the right-hand pane shows details for an individual object. THe following example shows a report on three Microsoft SQL Server default objects, displaying details for a default named UTDS.DefaultObject.

76 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US I N G T H E S C H E M A P U B L I C A TI O N W I Z A RD > U SIN G T HE SC HE MA PU B L I C A T IO N W I ZA RD

The Schema Publication Wizard lets you:

• Generate reports for all or any level of your database.

• View, find, and print the HTML reports directly in DBArtisan with the built-in HTML browser.

• Create a new schema publication operation.

• Re-use a previously defined schema publication operation.

• Select a datasource for which you want to generate an HTML report.

• Select the server object type and database object type for which you want to publish a schema report and lets you customize the report.

• Select specific objects and to set certain script options for each object type.

• Specify the report directory, HTML file name, and report title.

• Save the schema publication operation for re-use.

• Preview the definition of your schema publication operation.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 763

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

To create a schema report

1 Connect to the datasource for which you want to produce a schema report. For details, see

Datasource Management

.

2 On the Utilities menu, click Schema Publication.

3 Use the following table as a guide to understanding and setting options in the wizard:

Panel

Playback

Execute

Tasks and Settings

Perform new publication

Description

Select to define a new schema publication operation.

Connection

Catalogs (SQL

Server, MySQL, and Sybase datasources only)

Lets you select the datasource to be published.

Lets you select the target database.

Object Selection Schemas

Object Types

Opens a dialog that lets you narrow the choice of candidate objects by selecting only those associated with specified schema.

Lets you select the object types and database object types that will be published.

Objects

As you select types from the Object Types list, an entry corresponding to that type is added to the Objects list. To publish only specific objects of that type, expand the list for that type and select the check boxes corresponding to the objects you want to publish.

Summary

Playback an existing publication

Lets you enable use of a previously defined publication operation and provide the path and file name of the operation.

This panel presents a visual summary of your selections and offers the following options:

Output script to file

Lets you specify the name and path of a file to store the output script.

Save existing operation Lets you save a copy the choices you made on the wizard panels. On subsequent publications, you can then playback the saved settings, optionally changing specific option settings. You specify the path and name of the file in which to save the migration operation.

Lets you store and name output files using time and date elements.

Append date and timestamp to output

file name and Save

output file in date specific folders

Click Finish when ready to proceed with the extraction.

Displays a real-time status of the operation and a summary of the results.

D

ATABASE

M

ONITOR

The Database Monitor displays all processes connected to the server. The Database Monitor:

76 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

• Lets you scan databases for potential performance problems.

• Includes tabs that provide a wealth of information about your servers.

• Color-codes each process to reflect its state and let you identify problems quickly.

TIP:

You can view some Database Monitor Information by clicking the Performance node of the Datasource Explorer.

Important Notes

• Processes and Locks are results of DB2 API calls and are not located in the system catalog tables.

• The Database Monitor may display incomplete SQL due to limitations set by the DBMS.

Platforms set limitations on the values returned by the commands that gather the information.

Opening the Database Monitor

1 On the Utilities menu, click Database Monitor.

DBArtisan opens the Database Monitor.

For more information, see:

• Color-coding

• Setting Scope Level in the Database Monitor

• Configuring the Database Monitor

• Processes Tab

• Locks Tab

• Utilities Tab

• Procedures Tab

• Functions Tab

• Traces Tab

• Logs Tab

Bufferpools Tab

• All Locks Tab

• Blocking Locks Tab

Active Rollback Segment Tab

Data Dictionary Cache Tab

Datafile I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 765

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

General Statistics Tab

Hit Ratio By User Tab

Latches Tab

Library Cache Tab

MTS Dispatcher Contention Tab

MTS Server Contention Tab

Open Cursors Tab

Parallel Queries Tab

SGA Detail Tab

SGA Hit Ratios Tab

SGA Summary Tab

Tablespace I/O Tab

• System I/O Summary Tab

• Database I/O Summary Tab

• User I/O Summary Tab

• Waits Tab

• Top SQL Cache Tab

• Last 50 Backups Tab

• File I/O Summary Tab

• Top Twenty SQL Tab

• Wait Events Tab

C

OLOR

-

CODING

The Database Monitor color-codes each process to reflect its state, to let you quickly spot problem conditions.

The table below describes the Database Monitor color-codes:

Color

Yellow

Green

Red

State

Sleeping or Inactive

Running

Blocked by another process

76 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

For more information, see

Database Monitor .

S

ETTING

S

COPE

L

EVEL IN THE

D

ATABASE

M

ONITOR

NOTE:

The functionality is available for IBM DB2 for z/OS and OS/390 only.

The Scope list lets you specify the scope of the element being monitored in a datasharing environment. Data Sharing lets one instance of the DB2 catalog to be shared equally among all members of the group.

The Scope list is available on the following tabs:

Traces Tab

Functions Tab

Procedures Tab

Utilities Tab

To set the scope level, do the following:

1 On the Database Monitor, click the target tab.

2 On the Threads, Traces, Procedures and Functions tabs:

• In Scope, select Group for the monitoring results of all datasharing members in the set.

OR

• In Scope, select Local for the monitoring results for the member that your machine is are connected to.

DBArtisan displays the results in the Database Monitor.

3 On the Utility Tab:

• In Scope, select Group for the monitoring results of all datasharing members in the set.

OR

• In Scope, select Member for data by the member name.

DBArtisan displays the results in the Database Monitor.

R

EFRESHING THE

D

ATABASE

M

ONITOR

1 On the Database Monitor tool bar, click the box to raise or lower the numbers, or type a new value in the box.

For more information, see

Database Monitor .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 767

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

C

ONFIGURING THE

D

ATABASE

M

ONITOR

The Database Monitor

lets you:

• Toggle to split the screen and display the target process SQL For details, see

SQL Toggle .

• Open a SQL window and display the SQL. For details, see ISQL .

• View a Query Plan for SQL running for selected processes. For details, see Query Plan .

SQL T

OGGLE

DBArtisan lets you split the Database Monitor screen and display the SQL running for selected processes.

1 On the Database Monitor tool bar, click Toggle.

NOTE:

To open a SQL window or view a Query Plan for SQL running on selected processes, you must have your Database Monitor Screen split to display SQL on the bottom.

For more information, see

Configuring the Database Monitor .

ISQL

DBArtisan displays the SQL running for selected processes in a SQL Editor. You must turn on the

SQL Toggle to display the target SQL in the split screen. To display the SQL in a separate window do the following:

1 On the Database Monitor, click the target process.

NOTE:

To open a SQL Editor or view a Query Plan for processes, SQL Toggle must be on, displaying the target SQL in the split screen.

2 If SQL Toggle is not on, on the Database Monitor tool bar, click Toggle.

3 On the Database Monitor tool bar, click ISQL.

DBArtisan opens a SQL window with the target process SQL.

4 To execute the SQL, click the SQL Window tool bar, click Execute.

For more information, see

Configuring the Database Monitor .

76 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

Q

UERY

P

LAN

The Database Monitor lets you view the Query Plan for target processes. To view the Query Plan, do the following:

1 On the Database Monitor, select the target process.

NOTE:

To open a SQL Editor or view a Query Plan for processes, SQL Toggle must be on, displaying the target SQL in the split screen.

2 If SQL Toggle is not on, on the Database Monitor tool bar, click Toggle.

3 On the Database Monitor tool bar, click Plan.

DBArtisan executes the SQL with query plan and opens a Results Editor with the results.

For more information, see

Configuring the Database Monitor .

S

ESSION

D

ETAILS

NOTE:

The functionality is available for Oracle only.

The Database Monitor lets you view user session details through the User Session Information dialog box. Once you open the User Session Information dialog box, you can view the SQL associated with the session.

The table below describes the tabs of the User Session Information dialog box:

Tab

Statistical Details

Waits

Current SQL

Description

Lets you can scroll up and down to see parameters and values.

Displays either historic or current wait statistics and lets you display or filter out idle wait events.

NOTE: Data returned for historic session waits is different than the data returned for current session waits.

Lets you view the SQL for this session.

Completing the Session Details Dialog Box

1 On the Database Monitor tool bar, click Session.

DBArtisan opens the User Session Information dialog box.

2 On the Statistical Details Tab, in the Session Parameters grid, you can scroll up and down to see parameters and values.

3 On the Waits Tab, view select Historical Waits or Current Waits.

4 Select Include Idle Waits to display idle wait events.

5 On the Current SQL Tab, view the SQL for this session.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 769

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

6 When you finish viewing SQL, click OK.

DBArtisan returns to the Database Monitor dialog box.

For more information, see

Configuring the Database Monitor .

P

ROCESSES

T

AB

The Database Monitor Processes Tab displays all processes connected to the server. The

Processes Tab of the Database Monitor lets you:

• Scan databases for potential performance problems.

• View each process for potential performance problems.

• View login time and seconds idle since last call.

For more information, see

Killing Processes

.

K

ILLING

P

ROCESSES

If you have system administrator privileges, DBArtisan lets you kill processes from the Database

Monitor.

1 On the Utilities menu, click Database Monitor.

DBArtisan opens the Database Monitor.

2 Click the target process to kill.

3 On the Database Monitor tool bar, click Kill.

4 Click Yes.

DBArtisan confirms you want to kill the process and closes the DBArtisan message.

For more information, see

Configuring the Database Monitor .

T

HREADS

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Threads Tab displays the threads on the target datasource.

For more information, see

Setting Scope Level in the Database Monitor

.

77 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

L

OCKS

T

AB

The Database Monitor Locks Tab displays all processes that are currently holding locks on an

IBM DB2 database.

Locks include:

• Shared Lock

A Shared Lock lets other users view and read objects concurrently. The Shared Lock owner or other concurrent processes cannot alter data in tablespaces, tables, or partitions.

• Exclusive Lock

DBArtisan promotes locks from Shared to Exclusive when a user decides to update an object.

Once DBArtisan promotes the lock, the user must complete the update before the lock can return to shared mode; another user cannot demote a shared lock. Exclusive locks exclude other users from viewing updates before they are committed. There can only be one exclusive lock for a set of objects. The first thread gets the exclusive lock and holds it until the update is committed. Once the update is committed, the exclusive lock returns to shared mode.

NOTE:

You cannot update a lock in DBArtisan.

For more information, see

Database Monitor

U

TILITIES

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Utilities Tab displays wizards that are typically run from the command line and do not apply to a particular type of schema object. Some of these wizards are also available via the command menus for objects. The wizards include:

• Check Data

• Check Index

• Copy to Copy

Load Java

Merge Copy

• Modify Recovery

• Modify Statistics

• Rebuild Index (DB2 z/OS)

• Reorganize /Reorg

• Reorg (DB2 z/OS Tablespaces)

• Runstats Index

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 771

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

• Runstats Tablespace

• Unload

• Maintain Template

TIP:

To run a wizard, select the command in the right pane of the application and click the

Execute button on the Datasource Explorer toolbar.

For more information, see:

Setting Scope Level in the Database Monitor

Database Monitor

P

ROCEDURES

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Procedures Tab displays the procedures on the target datasource.

For more information, see:

Setting Scope Level in the Database Monitor

Database Monitor

F

UNCTIONS

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Functions Tab displays the functions on the target datasource.

For more information, see:

Setting Scope Level in the Database Monitor

Database Monitor

T

RACES

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Traces Tab displays the traces on the target datasource.

For more information, see:

Setting Scope Level in the Database Monitor

77 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

Database Monitor

L

OGS

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Logs Tab displays the logs on the target datasource.

For more information, see

Database Monitor .

B

UFFERPOOLS

T

AB

NOTE:

This tab is available for IBM DB2 for z/OS and OS/390 only.

The Threads Tab displays the bufferpools on the target datasource.

For more information, see

Database Monitor .

A

LL

L

OCKS

T

AB

The Database Monitor All Locks Tab displays all processes that are currently holding locks on a database.

For more information, see

Database Monitor .

B

LOCKING

L

OCKS

T

AB

The Blocking Locks Tab displays the locks that are blocked.

TIP:

Detect blocking locks as they occur, as they can escalate into dead lock situations which can force you to shut down and restart your server to clear the traffic.

For more information, see

Database Monitor .

A

CTIVE

R

OLLBACK

S

EGMENT

T

AB

Rollback or undo segments are used to guarantee transactional integrity. When a transaction has not been committed or rolled back, a rollback segment will be in use with live transactional data.

The Active Rollback Segment tab displays information concerning active rollback segments.

For more information, see

Database Monitor .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 773

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

D

ATA

D

ICTIONARY

C

ACHE

T

AB

The Data Dictionary Cache Tab displays key indicators in determining the performance of the shared pool. It shows how often object definitions are found in memory vs. having to read them in from disk. Because Oracle references the data dictionary many times when an SQL statement is processed, it is imperative that as much of this vital reference information be kept in RAM as possible.

For more information, see

Database Monitor .

D

ATAFILE

I/O T

AB

The Datafile I/O Tab displays details concerning the physical I/O activity at the datafile level.

Physical I/O consists of Oracle going to disk to gather or write data. Logical I/O refers to data access performed in memory. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database against the physical datafile used to hold information The checkpoint and archive processes (CKPT and ARCH), also perform I/O work in the database.

For more information, see

Database Monitor .

G

ENERAL

S

TATISTICS

T

AB

The General Statistics Tab displays general statistics data, including names and values.

For more information, see

Database Monitor .

H

IT

R

ATIO

B

Y

U

SER

T

AB

The database server reads and updates all data from a bufferpool because memory access is much faster than disk access. Data is copied from disk to a bufferpool as needed by the applications using the database. When the server needs to read/write data and the data is already in the bufferpool, no disk access is required. However, if the data is not in the bufferpool, it needs to be read from the disk, which is significantly slower process.

The buffer pool hit ratio indicates the percentage of time that the database server did not need to load a page to service the request for a page.

For more information, see

Database Monitor .

77 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

L

ATCHES

T

AB

Latches protect many memory structures in Oracle's SGA. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you do not and are forced to continually retry.

For more information, see

Database Monitor .

L

IBRARY

C

ACHE

T

AB

The library cache holds commonly used SQL statements - basically database code objects. A method for improving performance in Oracle is to encourage the reuse of SQL statements so expensive parse operations may be avoided. The library cache assists this tuning effort.

For more information, see

Database Monitor .

MTS D

ISPATCHER

C

ONTENTION

T

AB

The MTS Dispatcher Contention Tab displays Microsoft Transaction Server data. DBArtisan lets you develop and deploy COM-based applications using Microsoft Transaction Server.

For more information, see

Database Monitor .

MTS S

ERVER

C

ONTENTION

T

AB

The MTS Server Contention Tab displays Microsoft Transaction Server data. DBArtisan lets you develop and deploy COM-based applications using Microsoft Transaction Server.

For more information, see

Database Monitor .

O

PEN

C

URSORS

T

AB

Open cursors consume Oracle resources and have the potential to degrade performance, especially if the SQL code being used in the cursor is inefficient. The Open Cursors Tab lets you quickly spot user accounts that have many cursors opened as well as the actual performance statistics for each opened cursor.

For more information, see

Database Monitor .

P

ARALLEL

Q

UERIES

T

AB

The Parallel Queries Tab displays the total number of queries eligible to be run in parallel.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 775

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

For more information, see

Database Monitor .

SGA D

ETAIL

T

AB

The Oracle System Global Area (SGA) is Oracle's memory structural area devoted to facilitating the transfer of data and information between clients and the Oracle database.

For more information, see

Database Monitor .

SGA H

IT

R

ATIOS

T

AB

The Oracle System Global Area (SGA) is Oracle's memory structural area devoted to facilitating the transfer of data and information between clients and the Oracle database.

For more information, see

Database Monitor .

SGA S

UMMARY

T

AB

The Oracle System Global Area (SGA) is Oracle's memory structural area devoted to facilitating the transfer of data and information between clients and the Oracle database.

For more information, see

Database Monitor .

T

ABLESPACE

I/O T

AB

The Tablespace I/O tab displays details concerning the physical I/O activity at the tablespace level.

Physical I/O consists of Oracle going to disk to gather or write data. Logical I/O refers to data access performed in memory. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database. Other processes like the checkpoint and archive processes (CKPT and ARCH) may also be used.

For more information, see

Database Monitor .

S

YSTEM

I/O S

UMMARY

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The System I/O Summary Tab displays a summary of I/O activities that occur at the system level.

For more information, see

Database Monitor .

77 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

D

ATABASE

I/O S

UMMARY

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The Database I/O Summary Tab displays an overview of I/O operations at the database level.

For more information, see

Database Monitor .

U

SER

I/O S

UMMARY

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The User I/O Summary Tab displays an overview of I/O operations at the user operation level.

For more information, see

Database Monitor .

W

AITS

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The Waits Tab displays a detailed view of all wait activity occurring on the server.

For more information, see

Database Monitor .

T

OP

SQL C

ACHE

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The Top SQL Cache Tab displays the top 100 objects in the SQL cache, ranked by use counts.

For more information, see

Database Monitor .

L

AST

50 B

ACKUPS

T

AB

NOTE:

This tab is available for Microsoft SQL Server only.

The Last 50 Backups Tab displays the last fifty backups performed by the Microsoft SQL Server and lets you reference hot backup details at the server level within DBArtisan.

For more information, see

Database Monitor .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 777

D A TA B AS E M O N IT O R > D A T AB AS E MO N IT O R

F

ILE

I/O S

UMMARY

T

AB

NOTE:

This tab is available for Microsoft SQL Server 8.0 only.

The File I/O Summary Tab displays an overview of I/O operations at the database file level.

For more information, see

Database Monitor .

T

OP

T

WENTY

SQL T

AB

NOTE:

This tab is available for Oracle only.

The Top Twenty SQL Tab lets you view the Top Twenty SQL, the top (worst) SQL running in the

Oracle shared pool.

For more information, see:

Database Monitor

SQL Toggle

Query Plan

ISQL

W

AIT

E

VENTS

T

AB

NOTE:

This tab is available for Oracle only.

The Wait Events Tab lets you analyze bottlenecks and discover what a database is waiting on.

For more information, see

Database Monitor .

77 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IN S T AN C E C O N FI G U R A T IO N > I N ST A N C E C ON F IG U R AT I ON

I

NSTANCE CONFIGURATION

To let you configure and tune your database(s), DBArtisan offers a utility that lets you view and edit the configuration parameters for each server. These configuration parameters are stored in the system catalog and used when restarting the server. For detailed information on the meaning and purpose of each server configuration parameter, see the System Administration

Guide and Performance and Tuning Guide.

NOTE:

Many changes to instance configuration parameters require you to shutdown and to restart the server before the changes take effect.

1 On the Datasources menu, click Configure.

2 To modify a parameter, double-click the parameter or click Edit.

DBArtisan opens the Edit Configuration dialog box.

NOTE:

To modify a parameter, the parameter must have a Yes in the Session Modifiable or

System Modifiable column of the Instance Parameter grid.

The table below describes the options and functionality on the Edit Configuration dialog box:

Option

New Value

Description

Lets you type the value for the parameter.

SQL L

OGFILE

You can instruct DBArtisan to log all of its SQL statements to a file so that you have an audit trail of application activity. The SQL Logfile captures all the SQL sent by the DBArtisan to populate its editors or to execute your commands. You can use this logfile not only to audit application activity, but also to build SQL scripts for querying system catalogs.

Topics

• Activating SQL Logging

• Opening the Logfile

• Logfile Options

• Truncating the Logfile

A

CTIVATING

SQL L

OGGING

You can activate SQL Logging directly from the DBArtisan main menu or toolbar.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 779

DA TA EXPO RT W I ZA RD FOR I BM DB 2 FOR LI NUX , U N I X, A N D W I NDOW S > DA TA EXPO RT W I ZA RD FO R

Activating SQL Logging

1 On the Logfile menu, click Log SQL.

O

PENING THE

L

OGFILE

You can open the SQL Logfile directly from the main menu.

Opening the Logfile

1 On the Logfile menu, click Open.

DBArtisan opens the SQL Logfile into an SQL window.

L

OGFILE

O

PTIONS

You can open the Options Editor from the Logfile menu option and make any changes to your logging options.

Opening the Options Editor

1 On the Logfile menu, click Options.

DBArtisan opens the Options Editor to the Logging Tab.

2 To make any changes to your logging options, make the appropriate changes and then click the OK button.

DBArtisan closes the Options Editor.

T

RUNCATING THE

L

OGFILE

If the SQL Logfile is growing too large, you can flush it directly from the main menu.

Truncating the Logfile

1 On the Logfile menu, click Truncate.

DBArtisan deletes the contents of the SQL Logfile.

D

ATA

E

XPORT

W

IZARD FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

78 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA EXPO RT W IZ ARD FO R I BM DB2 FO R LI NUX, UN I X , A N D W IN D O W S > D A T A E X PO R T W IZ ARD F O R

W

INDOWS

DBArtisan offers a simple, five-panel wizard that lets you export table data. After defining the data export operation, you have the opportunity to save the job definition for future reuse.

The Export Wizard lets you:

• Create a new Export operation.

• Re-use a previously defined Export operation.

• Specify source server, data export file format, and data export specification.

• Select the tables and view to be exported.

• Specify the Output Directory.

• Specify the Message Directory.

• Save the Job Definition for future reuse.

• Preview the definition of your data export operation.

Starting the Export Wizard

1 On the Datasource Explorer, select the database object.

DBArtisan displays the database objects in the right pane of the Explorer Window.

2 On the Utilities menu, click Data Unload.

For more information, see

Export Wizard - Panel 1

.

E

XPORT

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on the first panel of the Export Wizard:

Option

Do you wish to initiate a new export operation or

‘play back’ a previously saved operation?

Description

New Export Operation - Select to define a new data unload operation.

Previous Export Operation - Select to use a previously defined schema extraction operation. Then in the Export Definition File Name box type the location and name of the job file or click the browse button.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 781

DA TA EXPO RT W I ZA RD FOR I BM DB 2 FOR LI NUX , U N I X, A N D W I NDOW S > DA TA EXPO RT W I ZA RD FO R

E

XPORT

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on the second panel of the Export

Wizard:

Option

What datasource has the data you wish to export?

Specify the format for the data export file(s) to be generated.

Option Button

Description

Lets you click the list and select the datasource.

Lets you click the list and select the file format.

How would you like to specify the data to export?

Available if you select a delimited option. Click to open the File Type Options Dialog

Boxes

.

Enter a SELECT statement.

Select tables/views from a list (one export file per table/view).

E

XPORT

W

IZARD

- P

ANEL

3

Option

Specify the data to be extracted from the database by entering a SELECT statement

Would you like to store large objects

(LOBs) in separate files?

Description

Enter the statement that will retrieve the row(s) or column(s) you want from one or more tables. Statements can be complicated. Go to http:/

/msdn.microsoft.com/library and do a search on SELECT for help.

When you choose to store LOBs in separate files, you will be given the chance to store them in files outside the database tablespaces.

When you choose not to store your LOBs in separate files, they will exist in a table row in the database.

E

XPORT

W

IZARD

- LOB P

ATHS

Option

List paths where the LOB files are to be stored

List LOB file names

Description

Add, Edit, or Remove files where you want LOBs to be stored

Add, Edit, or Remove LOB file names.

78 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA EXPO RT W IZ ARD FO R I BM DB2 FO R LI NUX, UN I X , A N D W IN D O W S > D A T A E X PO R T W IZ ARD F O R

F

ILE

T

YPE

O

PTIONS

D

IALOG

B

OXES

The table below describes the options and functionality of the Integrated Exchange Format File

Type Options dialog box:

Option

Accept data despite code page mismatches and suppress translation

Drop existing indexes and create new ones

Load each row without checking target length

Index Schema

Description

The table below describes the options and functionality of the Integrated Exchange Format File

Type Options dialog box:

Option

Accept data despite code page mismatches and suppress translation

Drop existing indexes and create new ones

Load each row without checking target length

Index Schema

Description

The table below describes the options and functionality of the Delimited ASCII File Type

Options dialog box:

Option

Delimiters

Description

Lets you select character string and decimal point specifiers.

Prefix positive decimal values with a blank

Use ISO date format

The table below describes the options and functionality of the Non-Delimited ASCII File Type

Options dialog box:

Description Option

Do not recognize x’1A’ as the end of the file

Determine the location of an implied decimal point from the column definition

Record Length

Truncate trailing blanks OR Truncate trailing

NULLs (0x00) characters

Maximum is 32,767

Select one or the other

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 783

D A TA IM P OR T W I ZA RD F OR I BM D B 2 F OR L IN U X, U N I X , AN D W I N D O W S > D AT A I M P O R T W I Z A RD F O R

E

XPORT

W

IZARD

- P

ANEL

3

The table below describes the options and functionality on the third panel of the Export Wizard:

Option

Owner

Count Rows

Check All

Uncheck All

Description

Lets you select the tables and/or views you want to export or click the Check All button.

Lets you update the table row counts.

Lets you select all tables or views.

Lets you deselect all tables or views.

E

XPORT

W

IZARD

- P

ANEL

4

The table below describes the options and functionality on the fourth panel of the Export

Wizard:

Option

Select a directory for export files (including and LOB files)

Specify a path and name for the message file

Do you wish to re-use this data unload operation?

Description

Type the location and name of the export file or click the Browse button.

Type the location and name of the message file or click the Browse button.

To re-use this data unload operation, in type the location and name of the data unload definition file or find the file by clicking the Browse button. DBArtisan writes a migrate definition file using the *.unload file extension that includes your job definition.

E

XPORT

W

IZARD

- P

ANEL

5

Review the data export operation description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the data export operation, click Execute.

D

ATA

I

MPORT

W

IZARD FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

DBArtisan offers a simple, six-panel wizard that lets you load data via DBArtisan’s import utility.

After defining the data import operation, you have the opportunity to save the job definition for future reuse.

The Import Wizard lets you:

78 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D ATA I M PORT W IZ A RD FO R IBM DB2 FO R LINUX, U N IX, A N D W IN D O W S > D A T A I M PO R T W IZ ARD FO R

• Create a new Data Load operation.

• Re-use a previously defined Data Load operation.

• Specify data import file.

• Specify file format target datasource.

• Specify import mode.

• Specify target database.

• Specify target schema.

• Specify target table or view.

• Specify the method for selecting columns in a table and select the columns into which the table or view data should be imported.

• Specify import LOBs from separate files, and if so, then specify the location for the message file.

• Define the number of rows to skip in the data file import if the operation restarts.

• Define the number of rows imported before committing to the database.

• Specify the use of Compound SQL statements.

• Save the operation for re-use at a later time.

• Preview the definition of your data unload operation.

Starting the Import Wizard

1 On the Datasource Explorer, select the database object.

DBArtisan displays the database objects in the right pane of the Explorer Window.

2 On the Utilities menu, click Data Load.

DBArtisan opens the

Import Wizard - Panel 1

.

I

MPORT

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on the first panel of the Import Wizard:

Option

Do you wish to initiate a new import operation or ‘play back’ a previously saved operation?

Description

New Data Load Operation - Select to define a new data load operation.

Previous Data Load Operation - Select to open a previously defined schema extraction operation. In the Data Load Definition File Name box, type the location and name of the job file or click the browse button.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 785

D A TA IM P OR T W I ZA RD F OR I BM D B 2 F OR L IN U X, U N I X , AN D W I N D O W S > D AT A I M P O R T W I Z A RD F O R

I

MPORT

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on the second panel of the Import

Wizard:

Option

What file has the data you wish to import?

Specify the format of the file to be imported

What mode would you like to use for this import operation?

What is the target object into which the data will be imported?

Description

Lets you type the location and name of the file or click the browse button.

Lets you click the list and click the file format.

Options Button - Click if you want to set the ASCII file type options for a delimited

option. Opens the File Type Options Dialog Boxes .

INSERT - The target table must exist and imported rows are inserted into the table without affecting existing rows in the table.

INSERT_UPDATE - The target table must exist and have primary key constraint defined on it. Imported rows that match the existing row of data on which the primary key is defined are updated. New rows that do not match the primary key are inserted into the table.

REPLACE - The target table must exist and all data is replaced with the contents of the import data file.

CREATE - The table defined in the import data file is created and rows of data are inserted into the newly created table. You must use a *.IXF file to use this mode.

REPLACE_CREATE - If the target table exists, the data will be replaced with the data contained in the import data file and the table definition remains unchanged. If the target table does not exist, the table defined in the import data file is created and rows of data are inserted into the newly created table. You must use a *.IXF file to use this mode.

Database - Lets you select the database.

Schema - Lets you select the schema.

Object - Lets you select the table or view.

I

MPORT

W

IZARD

- P

ANEL

3

The table below describes the options and functionality on the third panel of the Import Wizard:

Option

What method should be used for selecting columns for the export file?

Indicate the columns into which data should be imported, specifying the relevant column selection attributes

Description

Lets you specify a method: Default, Position, Location, or Names.

Lets you select the columns. Click Edit to open the Column Position Attributes

dialog box.

78 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D ATA I M PORT W IZ A RD FO R IBM DB2 FO R LINUX, U N IX, A N D W IN D O W S > D A T A I M PO R T W IZ ARD FO R

C

OLUMN

P

OSITION

A

TTRIBUTES

The table below describes the options and functionality on the Column Position Attributes dialog box:

Option

Include

Position

Description

Select to include the column.

Lets you type the position.

I

MPORT

W

IZARD

- P

ANEL

4

The table below describes the options and functionality on the fourth panel of the Import

Wizard:

Option

Would you like to retrieve large objects

(LOB's) from separate files?

Description

Add Button - Click to open the Browse for Folder dialog box. Click the LOB path.

Edit Button - Click to open the Browse for Folder dialog box.

Remove - Click to remove the LOB path.

Specify a path and name for the message file

Type the directory location of the message file or click the Browse button to find the file.

I

MPORT

W

IZARD

- P

ANEL

5

The table below describes the options and functionality on the fifth panel of the Import Wizard:

Option

How many of the file’s records should be skipped before the import begins?

How many records should be imported before committing them to the database?

Use of Compound SQL may improve performance.

Description

Restart - Lets you type the value of the number of rows that should be skipped before the import operation begins.

Commit Records - Lets you type the value of the number of records that should be imported before they are committed to the database.

Statements - Lets you type the value of the number, which cannot exceed 100, of the number of SQL statements per compound block.

I

MPORT

W

IZARD

- P

ANEL

6

The table below describes the options and functionality on the sixth panel of the Import Wizard:

Option

Do you wish to re-use this data unload operation?

Description

To re-use the operation, type the location and name of the data load definition file or click the browse button. DBArtisan gives the operation a default extension of *.LOAD.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 787

LOA D D ATA U T ILI T Y W I ZA RD F OR DB2 O S39 0 > LO AD DA TA UTI L ITY W IZ ARD FO R DB 2 OS3 90

I

MPORT

W

IZARD

- P

ANEL

7

Review the data load operation description to verify its accuracy.

1 To make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the data load operation, click Execute.

L

OAD

D

ATA

U

TILITY

W

IZARD FOR

DB2 OS390

The DBArtisan Load Data Utility for DB2 z/OS enables you to load records into one or more tables in a tablespace without creating an intermediate exported file. If the tablespace already contains data, you can opt to add the new data to the existing data or to replace it. The data that’s loaded is subject to the same editing or validation routines currently associated with the table and any field procedure associated with particular table columns. As output, you get a loaded tablespace or partition, a file of records that have been discarded, and an error report if you specify the Enforce Constraints option or if unique indexes were part of the load operation.

To use this utility, you need a sufficient set of privileges.

One of the following conditions must be met:

• You must own the table

• Have load privileges for the database

• DBAdmin or DBCTRL authority for the database.

• SYSCTRL or SYSADM authority.

For more complete information than can be presented here, refer to the IBM Utility Guide and

Reference. You can find it here: http://www-306.ibm.com/software/data/db2/zos/ v8books.html

To Open the Load Data Utility Wizard

1 Connect to a DB2 OS390 database on the Explorer tree.

2 Expand the database and click the Tablespace subnode.

3 In the right window, select a tablespace and click Load Data from the Command down menu.

OR

On the Explorer node, click Utility Execution, and then click Load in the right pane.

drop-

78 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

L O AD D A T A UT I L IT Y W IZ ARD FO R D B 2 OS3 90 > L OA D D A T A U T IL I TY W IZ A RD F OR D B2 OS 39 0

C

REATING A

L

OAD

D

ATA

U

TILITY

O

PERATION

The DBArtisan Load Data Utility for DB2 z/OS enables you to load records into one or more tables in a tablespace without creating an intermediate exported file. If the tablespace already contains data, you can opt to add the new data to the existing data or to replace it.

The following sections describe fields you may encounter as you move through the Load Data

Utility Wizard:

Initial Settings

Required Information

Do you want the utility to be restartable?

Tape Stacking

Do you want to specify a cursor?

Specify the ln DDN

Would you like to preformat?

Description

The utility restart information will be included if a recover operation is required.

Select this if you are backing up this operation onto physical media.

Click Properties to specify the particulars for the dataset as it’s recorded by opening the

Load Utility - Tape Stacking Dialog Box

.

If you want to specify a cursor you need to type the name of the cursor for the input data set in the field below. No is the default. Any cursor name you specify cannot exceed eight characters.

The input template name. SYSREC is the default.

If you say yes, you are telling the operation to serialize at the tablespace level. This can inhibit concurrent processing of separate partitions. No is the default.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 789

LOA D D ATA U T ILI T Y W I ZA RD F OR DB2 O S39 0 > LO AD DA TA UTI L ITY W IZ ARD FO R DB 2 OS3 90

Resumption/ Replace/Statistics

Required Information

Resume

Replace

Would you like to specify the statistics option?

Description

If you say No, records load into an empty tablespace. This is the default.

If you say Yes, records are loaded into a non-empty tablespace. Loading begins at the current end of data in the tablespace. If you specify the sharelevel as change, the before and after triggers for each row that’s loaded are activated.

The default sharelevel is none--this specifies that applications cannot concurrently access the tablespace during the load operation.

When you select Yes, the remaining options on this panel are unavailable.

Here you indicate whether the tablespace and its indexes need to be resert to empty before records load. If you select Yes, you are telling the load operation to serialize at the tablespace level. No is the default.

Here you indicate whether you want to gather statistics for the tablespace. No is the default. If you select Yes, statistics are gathered on a base tablespace, but not an LOB tablespace.

If you gather statistics on encrypted data, the results may not be useful.

Do you want to output message to SYSPRINT?

Do you want to force aggregation or rollup processing to be done even though some parts do not contain data?

This is the output dataset for messages and printed output. Default is the default.

Yes, No, or default. Default is the default.

Here you specify whether you want statistics to aggregate or rollup when

RUNSTATS is executed even in the event that some parts are empty.

Select Tables (for running statistics)

Here you are presented with a dialog box where you identify the table you want to run statistics on. Click ADD to open the Table/Object Selector dialog box. Click Set Properties to open the

Select Column for Table dialog box. Click Delete to remove a table you selected from the run statistics operation.

Select Tables to Load Data Into

Here you are presented with the dialog box where you identify the tables you want to load the

data into. Click ADD to select one or more tables. Click Set Properties to open the Into Table

Specification Dialog Box

.

Select Indexes

Here you are presented with a dialog box where you identify the indexes you want to run statistics on. Click ADD to open the Index/Object Selector dialog box. Click Set Properties to open the Set Correlation option dialog box where you set the KeyCard and Frequent Item options. When you ADD Frequent Options, the Add Frequent Options dialog box opens which identifies the number of columns and the count.

79 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

L O AD D A T A UT I L IT Y W IZ ARD FO R D B 2 OS3 90 > L OA D D A T A U T IL I TY W IZ A RD F OR D B2 OS 39 0

Update/History Statistics

Required Information

Update Statistics

History Statistics

Description

All: Indicates that all collect statistics are to be updated in the catalog. All is the default.

Access Path: Indicates that updates are to be made only to the catalog table columns that provide statistics used for selecting the access path.

Space: Indicates that updates are to be made only to the catalog table columns that provide statistics that help assess the status of a particular tablespace or index.

None: Indicates no catalog tables will be updated. Note: This is enabled only when the

Report option is set to Yes.

This records all catalog table inserts or updates to the catalog history tables.

Default: The value specified on

All: Indicates all collected statistics are to be updated in the catalog history tables.

Access Path: Indicates that updates are to be made only to the catalog history table columns that provide statistics used for selecting the access path.

Space: Specifies that only space-related statistics are to be updated in catalog history tables.

None: Specifies that no catalog history tables are to updated with the statistics that have been collected.

Dictionary/Log

Required Information

Keep dictionary

Reuse

Description

If you specify No, the load operation is prevented from building a new compression dictionary, thereby saving you the costs related to such a build operation. No is the default.

When used with Replace (on an earlier panel of the wizard), this option indicates that the load operation should reset and reuse the datasets without deleting or refining them. No is the default.

Log

LOAD is not to set the tablespace in the COPY-pending status

The Default specifies normal logging during the load operation and is equivalent to Yes. All loaded records will be logged. No specifies no logging of data in the load operation and disables the copy-pending option below.

This, the NOCOPYPEND option will not turn off any copy pending options set prior the load operation. NOTE: Specify this option only if the data in this table can be recreated by another load operation if, for some reason, the data is lost.

You may not be able to recover the tablespace if you don’t take an image copy after the load operation. No is the default.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 791

LOA D D ATA U T ILI T Y W I ZA RD F OR DB2 O S39 0 > LO AD DA TA UTI L ITY W IZ ARD FO R DB 2 OS3 90

Enforce/Specify

Required Information

Enforce

Would you like to specify the

Work DDN?

Would you like to specify the

SORTKEYS?

Format

Description

Specifies whether the load operation should enforce check and referential constraints. Constraints indicates constraints will be enforced. If the operation detects a constraint violation, the errant row is deleted and identified by a message. If you elect this option, and there are referential constraints, you must define sort input and output datasets. Default enforces the constraints. No specifies constraints are not enforced. It also puts the tablespace in the Checkpending status if at least one referential or check constraint exists.

If you elected to enforce constraints, you must specify the work DDN. Here you establish DD names for the temporary sort input and output files. The default input is SYSUT1 and output is SORTOUT.

This specifies that the index keys are to be sorted in parallel during the sort build phase to improve performance. If you want, you can specify an integer value to provide an estimate of the number of index keys that are to be sorted.

The default is 0 if the input is on tape or a cursor.

This selection is for the format of the input data. Unload specifies that the input record format is compatible with DB2 unload format. SQL/DS indicates the input record format is compatible with SQL/DS format.

Input/CCSID

Required Information

Input data file type

CCSID(s)

Do not accept substitution characters in a string

Float

Specify the error DDN

Description

Select between EBCDIC, ASCII, or Unicode.

These coded character set identifiers for the input file generally correspond to the input data file type. If that’s not the case, the input data will be converted to the table CCSIDs before being loaded.

Specifies that the load operation should not accept substitution characters in the string. Use substitutions when a string is being converted from one data type to another. If you do not accept substitutions and the load operation determines that a substitution appears in the string because of a conversion, if discard processing is active, the record will be moved to the discard file. If discard processing is inactive, the load operation will terminate.

S390 specifies that the load operation should expect floating point numbers are in the System/390 hexadecimal floating point format.

IEEE specifies that the load operation should expect that floating point number are in IEEE binary floating point format.

If you specify IEEE, the binary format floats will be converted to hexadecimal floating points. If there’s a conversion error, the record goes in the discard pile.

Here you specify the DD statement or template for a work dataset that’s used during error processing. SYSERR is the default.

79 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

L O AD D A T A UT I L IT Y W IZ ARD FO R D B 2 OS3 90 > L OA D D A T A U T IL I TY W IZ A RD F OR D B2 OS 39 0

Map DDN/Discard DDN

Required Information

Would you like to specify the Map

DDN?

Description

Specifies the DD statement or template for a work data set to be used in error processing. This is used to correlate the identifier of a table row with the input record that’s causing the error. SYSMAP is the default.

Would you like to specify the

Discard DDN?

Would you like to specify the maximum number of source records to be written on the discard data set?

Would you like to specify the sort device type?

Specifies the DD statement or template for a discard dataset that will hold copies for records that aren’t loaded in the operation (e.g., a record with a conversion error). SYSDISC is the default.

Specify an integer with a value between 0 and 2146483647. If the maximum value is reached, the load operation abnormally terminates. When you enter 0, you are specifying that you do not want to set a maximum value and the entire input data set can be discarded.

Here you indicate, if available, the device type for temporary datasets that are to be dynamically allocated by DFSORT.

Specify Sort Number/CONTINUE-IF

Required Information

Do you want to specify the sort number?

Would you like to specify a

CONTINUE-IF condition?

Start/Finish

Hexidecimal

Condition

Description

This is the number of temporary datasets that will be allocated by the sort application program.

Yes indicates that you want to treat each input record as a portion of a larger record. If a record is true, the next record is concatenated with it before it is loaded.

Specifies the column numbers of the first and last columns.

The byte-string value in the continuation field indicates that the next input record is a continuation of the current load record. Records with this byte-string value are concatenated until the value in the continuation field changes.

After the CONTINUE-IF completes, write a condition as X’byte-string’ or

‘character-string’.

I

NTO

T

ABLE

S

PECIFICATION

D

IALOG

B

OX

At least one table INTO STATEMENT is required for each table that is to be loaded. Each Into

Table Specification:

• Identifies the table that is to be loaded.

• Describes fields within the input record.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 793

LOA D D ATA U T ILI T Y W I ZA RD F OR DB2 O S39 0 > LO AD DA TA UTI L ITY W IZ ARD FO R DB 2 OS3 90

• Defines the format of the input dataset.

NOTE:

All tables that are specified must belong to the same tablespace.

Required Information

Page 1:

Skip fields in the input data set that do not correspond to columns in the target table

Partition

Would you like to preformat?

Load records into a non-empty partition

Replace only the contents of the partition specified above, rather than the entire tablespace.

Reset and reuse DB2-managed data sets

Description

Specifies whether or not the load operation should skip fields in the input dataset that do not correspond to tables in the target table.

An integer value that applies to the number of the partition where records are to be loaded. This is an option that is enabled only for partitioned tablespaces.

Specifies that any remaining pages should be preformatted up to the high-allocated RBA in the partition and its corresponding partitioning index space. Preformatting happens after the data is loaded and the indexes are built.

No loads records into an empty partition. No is the default.

Yes loads records into a non-empty partition. If the partition is empty, you get a warning message, but the partition is loaded anyway.

NOTE: You cannot use Load Replace with the partition integer replace option. You can either replace an entire tablespace using the load replace option or the single partition option here.

When used with the replace option above, this specifies that the load operation should reset and reuse the DB2-managed datasets without deleting and redefining them.

Would you like to keep the dictionary?

This is an option only if a dictionary exists and the partition being loaded has the COMPRESS YES attribute. If the partition has the

COMPRESS YES attribute but no dictionary exists, a dictionary is built and you get an error message.

If desired, specify a cursor for the input dataset. Would you like to specify a cursor?

Select statement for cursor

In DNN

Discard DNN

Specifies the data definition statement or template for the input dataset for the partition. The default is SYSREC.

Specifies the data definition statement or template for the partition.

This dataset also holds copies of records that were loaded and removed. It must be a sequential data set.

Page 2:

Do you want to set criteria for which records are loaded?

If you do not want to specify load criteria, all records in the input dataset are loaded, except for data that is beyond the range of the specified partition.

Do you want to use field selection criteria?

Yes or No.

SQL/DS Table Owner: Select a table owner from the drop-down list.

Table: This is the name of the table that the SQL/DS table is loaded into.

79 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Fields

L O AD D A T A UT I L IT Y W IZ ARD FO R D B 2 OS3 90 > L OA D D A T A U T IL I TY W IZ A RD F OR D B2 OS 39 0

Required Information

Field selection Criteria

Description

The criteria describes a field and a character constant. A field must contain a character or graphic string. (When compared to a string constant, no datatype conversions are performed.)

If the field and the constant are not the same length, the shorter of the two is padded with blanks before a comparison is made.

Click Add to open the Field Specification Dialog Box

.

F

IELD

S

PECIFICATION

D

IALOG

B

OX

Required Information

Field Name

Would you like to specify a position?

Datatype

Length/Scale

Description

The name of a field defined by a field specification. This can be any name you choose.

Indicates where a field appears in the assembled load record. Start/End are the locations of the first and last field records. The first record is column 1.

Pick the appropriate datatype from the drop-down list.

Would you like to add a condition that causes the db2 column to be loaded with NULL or it’s default value?

Length is the length in bytes of the input field.

Scale is the number of digits to the right of the decimal point and must be greater than or equal to 0. 0 is the default.

NULLIF/CONDITION: Write a condition that causes the DB2 column to be loaded with NULL.

DEFAULTIF/CONDITION: Write a condition that causes the DB2 column to be loaded with its default value.

No

S

ET

D

ATASET

I

NFO

D

IALOG

B

OX

Required Information

Dataset Name

Template Name

SMS: Management class

Storage class

Data class

Unit: Device Type

Count

Volume: Private

Description

The name of the input dataset from which the table data should be loaded.

The management class name may not exceed 8 characters. This enables the dataset to be catalogued. MGMTCLAS name.

The storage class name must be valid and cannot exceed 8 characters.

STORCLAS name.

The data class name cannot exceed 8 characters. DATACLAS name.

Specifies the device type or group name for the data set.

A communications connection that’s specific to DB2.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 795

D A TA UN L O A D W I ZA RD F OR M I C ROS OFT SQ L SE R V E R A N D S YB AS E AS E > D A T A U N L OA D W IZ ARD FO R

Description Required Information

Sequence Number

Count

Serial no(s)

Space: Unit

Primary Allocation

Secondary Allocation

Release

Label: Sequence Number

Retention period

Expiration date

The serial number of the volume on which a new temporary or permanent data set resides.

L

OAD

U

TILITY

- T

APE

S

TACKING

D

IALOG

B

OX

Tape stacking allows you to make four copies of the same data set simultaneously. DB2 OS390’s

Copy to Copy utility allows you to make multiple image copies as well.

Required Information

Local Site Primary Copy

Local Site Backup Copy

Recovery Site Primary Copy

Recovery Site Backup Copy

In DDN

Discard DDN

Description

Name the data set where you want the output image copy to go at the local primary site. This relates to the copyddn1 parameter in the stored procedure.

Name the data set where you want the output image copy to go at the local backup site. This relates to the copyddn2 parameter in the stored procedure.

Name the data set where you want the output image copy to go at the recovery primary site. This relates to the recoveryddn1 parameter in the stored procedure.

Identify the image set where you want the image copy to go at the recovery backup site. This relates to the recoveryddn2 parameter in the stored procedure.

Identify the input data set that contains the table to be loaded.

Identify the work data set that will hold copies of records not included in the load operation.

D

ATA

U

NLOAD

W

IZARD FOR

M

ICROSOFT

SQL S

ERVER AND

S

YBASE

ASE

DBArtisan offers a simple, five-panel wizard that can export table data via Microsoft SQL Server's

BCP (bulk copy program) utility or Sybase ASE's BCP (bulk copy program) utility. After defining the data export operation, you can save the job definition for future re-use.

The Data Unload Wizard lets you:

79 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A T A UN LO A D W I ZA RD FO R M I C ROS OF T SQ L S E R V E R A N D S Y B A SE A SE > D A T A U N L OA D W IZ ARD FO R

• Create a new data unload operation.

• Reuse a previously defined data unload operation.

• Specify source server, data unload file format, and data unload specification.

• Select the tables that you want to unload.

• Save the job definition for future re-use.

For more information, see

Data Unload Wizard - Panel 1 .

D

ATA

U

NLOAD

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on the first panel of the Data Unload

Wizard:

Option

Do you wish to initiate a new data unload operation or ‘play back’ a previously saved operation?

Description

New Data Unload Operation - Select to define a new data unload operation.

‘Playback’ Previous Data Unload Operation - Select to use a previously defined schema extraction operation. Then in the Data Unload Definition File Name box type the location and name of the job file or click the browse button.

D

ATA

U

NLOAD

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on the second panel of the Data Unload

Wizard.

Option

In which directory should the unloaded files be placed?

Which database has the data you wish to unload?

What character should delimit columns in the unloaded data files?

Use BCP Utility

Description

Lets you specify the directory by typing the location and name of the directory or find the directory by clicking the browse button.

Lets you click the list, and then select the server. Then click the list, and then click the database.

Lets you click the list, and then select the character.

Select if you want to use the Microsoft SQL Server's BCP (bulk copy program) utility.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 797

D A TA UN L O A D W I ZA RD F OR M I C ROS OFT SQ L SE R V E R A N D S YB AS E AS E > D A T A U N L OA D W IZ ARD FO R

D

ATA

U

NLOAD

W

IZARD

- P

ANEL

3

The table below describes the options and functionality on the third panel of the Data Unload

Wizard for Microsoft SQL Server.

Option

Table Owner

Upd Stats button

Select All button

Unselect All button

Description

Lets you select the target tables to unload.

Select the target tables and click button to update the table row counts.

Click to select all tables.

Click to unselect all tables.

The table below describes the options and functionality on the fourth panel of the Data Load

Wizard for Sybase ASE:

Option

Row Terminator

Packet Size

Text/Image Size

Client Char Set

Description

Lets you enter a value for this common BCP option.

Lets you enter a value for this common BCP option.

By default, Sybase only copies the first 32K of data in a text or image field. To override default size, type a new size.

Lets you enter a value for this common BCP option.

D

ATA

U

NLOAD

W

IZARD

- P

ANEL

4

The table below describes the options and functionality on the fourth panel of the Data Unload

Wizard.

Option

Do you wish to re-use this data unload operation?

Description

To re-use this data unload operation, type the location and name of the data unload definition file or find the file by clicking the Browse button. DBArtisan writes a migrate definition file using the *.unload file extension that includes your job definition.

D

ATA

U

NLOAD

W

IZARD

- P

ANEL

5

Review the data unload operation description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the data unload operation, click Execute.

DBArtisan starts the Data Unload operation.

To schedule the data unload operation, click Schedule.

DBArtisan lets you schedule the task. For details, see

Scheduling

.

79 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D AT A L O AD W I ZA RD F OR M IC ROSO FT SQ L SE RV ER A N D S YB AS E AS E > D A T A L OA D W IZ ARD FO R

D

ATA

L

OAD

W

IZARD FOR

M

ICROSOFT

SQL S

ERVER AND

S

YBASE

ASE

DBArtisan offers a simple, six-step wizard that can load data via Microsoft SQL Server's BCP

(bulk copy program) utility or via Sybase ASE's BCP (bulk copy program) utility. After defining the data import operation, you have the opportunity to save the job definition for future re-use.

The Data Load Wizard lets you:

• Create a new data load operation.

• Re-use a previously defined data load operation.

• Specify data import file.

• Specify target database.

• Specify target schema.

• Specify target table or view.

• Specify the method for selecting columns in a table and select the columns into which the table or view data should be imported.

• Specify import LOBs from separate files, and if so, then specify the location for the message file.

• Define the number of rows to skip in the data file import if the operation restarts.

• Define the number of rows imported before committing to the database.

• Specify the use of Compound SQL statements.

• Save the operation for re-use at a later time.

• Preview the definition of your data unload operation.

For more information, see

Data Load Wizard - Panel 1 .

D

ATA

L

OAD

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on the first panel of the Data Load

Wizard.

Option

Do you wish to initiate a new data load operation or ‘play back’ a previously saved operation?

Description

New Data Load Operation - Select to define a new data load operation.

Previous Data Load Operation - Select to open a previously defined schema extraction operation. In the Data Load Definition File Name box, type the location and name of the job file or click the browse button.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 799

DATA LOAD W IZ ARD FO R MI CROS OF T SQ L S ERVER A N D S Y B A SE A SE > D A T A L O AD W I ZA RD F OR

D

ATA

L

OAD

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on the second panel of the Data Load

Wizard.

Option

Which database do you want to load the data into?

Which table do you want to load the data into?

Use BCP Utility

Description

Lets you click the list, and then select the server. Then click the list and select the database.

Lets you click the list, and then select the table.

Select to use the Microsoft SQL Server's BCP (bulk copy program) utility.

D

ATA

L

OAD

W

IZARD

- P

ANEL

3

The table below describes the options and functionality on the third panel of the Data Load

Wizard.

Option

Which rows do you want to import?

What restrictions do you want to place on the import?

Description

All Rows

Range - Lets you type the range in the First Row and Last Row boxes.

Max Errors or Batch Size.

D

ATA

L

OAD

W

IZARD

- P

ANEL

4

The table below describes the options and functionality on the fourth panel of the Data Load

Wizard for Microsoft SQL Server.

Option

Data File

Format

Error File

What character delimited the columns in the datafile?

Description

Lets you type the directory location of the data file or click the browse button to find the file.

To use a format file, type the directory location of the format file or click the browse button to find the file.

To output errors to an error file, type the directory location of the format file or click the browse button to find the file.

Lets you click the list, and then click the character.

The table below describes the options and functionality on the fourth panel of the Data Load

Wizard for Sybase ASE:

Option

Row Terminator

Description

Lets you enter a value for this common BCP option.

80 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Option

Packet Size

Text/Image Size

Client Char Set

Max Connections

Show-fi

Hide-vcc

D AT A L O AD W I ZA RD F OR M IC ROSO FT SQ L SE RV ER A N D S YB AS E AS E > D A T A L OA D W IZ ARD FO R

Description

Lets you enter a value for this common BCP option.

By default, Sybase only copies the first 32K of data in a text or image field. To override default size, type a new size.

Lets you enter a value for this common BCP option.

Lets you specify the maximum connection of connections in the connection pool.

Provides the option to add columns for each functional index.

Provides the option to hide virtual computed columns

D

ATA

L

OAD

W

IZARD

- P

ANEL

5

The table below describes the options and functionality on the fifth panel of the Data Load

Wizard for Microsoft SQL Server.

Option

Do you wish to re-use this data load operation?

Do you wish to DROP the index(es) on the target table

BEFORE copying data?

Description

To re-use the operation, type the location and name of the data load definition file or click the browse button to find the file.

DBArtisan gives the operation a default extension of *.LOAD.

Drop Index(es) Before Loading of Data - Select to drop the indexes on the target table before copying data.

Recreate Index(es) After Loading of Data - Select to recreate these indexes after the data loads.

The table below describes the options and functionality on the fifth panel of the Data Load

Wizard for Sybase ASE.

Option

Data File

Format

Error File

What character delimited the columns in the datafile?

Description

Lets you type the directory location of the data file or click the browse button to find the file.

To use a format file, type the directory location of the format file or click the browse button to find the file.

To output errors to an error file, type the directory location of the format file or click the browse button to find the file.

Lets you click the list, and then click the character.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 801

D A TA B AS E M A N A G E R > D AT A B A S E M A N A G E R

D

ATA

L

OAD

W

IZARD

- P

ANEL

6

For Microsoft SQL Server, the sixth panel of the Data Load Wizard lets you preview the definition of your data load operation.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the data load operation, click Execute.

DBArtisan starts the Data Load operation.

3 To schedule the data load operation, click Schedule.

DBArtisan lets you schedule the task. For details, see

Scheduling

.

The table below describes the options and functionality on the sixth panel of the Data Load

Wizard for Sybase.

Option

Do you wish to re-use this data load operation?

Do you wish to DROP the index(es) on the target table BEFORE copying data?

Description

To re-use the operation, type the location and name of the data load definition file or click the browse button to find the file.

DBArtisan gives the operation a default extension of *.LOAD.

Drop Index(es) Before Loading of Data - Select to drop the indexes on the target table before copying data.

Recreate Index(es) After Loading of Data - Select to recreate these indexes after the data loads.

D

ATA

L

OAD

W

IZARD

- P

ANEL

7

Review the data load operation description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the data load operation, click Execute.

DBArtisan starts the Data Load operation.

3 To schedule the data load operation, click Schedule.

DBArtisan lets you schedule the task. For details, see

Scheduling

.

D

ATABASE

M

ANAGER

DBArtisan lets you view and manage your databases through Database Manager. The Database

Manager lets you:

• Add, modify, and delete database files.

80 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A T AB AS E B A C K U P W I Z A RD > D A T AB AS E B A C K U P W I Z A RD

• Add, modify, and delete transaction logfiles.

• Add or delete database options.

• View data space and transaction log usage.

• View DDL.

Opening the Database Manager

1 On the Datasource Explorer, select the Databases node.

DBArtisan displays the databases in the right pane of the Explorer window.

2 In the right pane of the Explorer window, click the database link(s).

3 On the Utilities menu, click Database Manager.

D

ATABASE

B

ACKUP

W

IZARD

Implementing a plan to back up critical databases is perhaps the most important job for any database administrator. Without a sound disaster recovery plan, your company has no safeguards against hardware and software failures.

The Database Backup Wizard lets you backup your databases without knowing the underlying syntax. It provides support for backing up databases as well as transaction logs, including commands to stripe the backup across multiple devices.

The Database Backup Wizard lets you:

• Create a new dump operation.

• Reuse a previously defined operation.

• Specify the target server, database, and type of backup operation.

• Specify backup device type.

• Specify how to report the progress of the backup operation.

You can back up the Microsoft SQL Server while the database is online and in use. However, the backup will fail if you are performing one of the following operations while attempting the back up:

• Creating indexes.

• Performing non-logged operations.

• Shrinking the database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 803

D A TA B AS E B AC KU P W I ZA RD > D A TA BA S E B AC KU P W I ZA RD

• Creating or deleting database files.

NOTE:

Backups created with Microsoft SQL Server version 7 cannot be restored to an earlier version of SQL Server.

C

REATING OR

E

DITING A

B

ACKUP

O

PERATION

DBArtisan lets you create different backup operations using the Database Backup Wizard. After you have successfully created a backup operation, you can reopen and edit it using the same wizard and make the changes you want.

To Open the Database Backup Wizard

1 On the Datasource Explorer, select the Databases node.

DBArtisan displays the databases in the right pane of the Explorer window.

2 Select the target database.

3 On the Utilities menu, click Database Backup.

In the following sections, you’ll find all the fields you’ll encounter as you create or edit a backup operation:

Job Category Wizard

Database Backup Wizard

J

OB

C

ATEGORY

W

IZARD

The Job Category Wizard panels appear ONLY when you are performing a backup operation for a MS SQL datasource. The job categories are relevant to the Backup Analyst and are described below:

Option

Standard Backup

Advanced Backup

Recovery

Would you like to create the 16 popular SQL Server Alerts for common

Backup and Recovery Errors?

Description

Any backup job which is a full database, differential database, file and file group, transaction log or table backup which does not include the compression or encryption options.

Any backup job which is a full database, differential database, file and file group, transaction log or table backup which includes at least one of the compression or encryption options.

Any recovery job created by Backup Analyst.

Yes - Opens the Alerts wizard.

No - Opens the

Database Backup Wizard

.

80 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A T AB AS E B A C K U P W I Z A RD > D A T AB AS E B A C K U P W I Z A RD

D

ATABASE

B

ACKUP

W

IZARD

The first panel of the Database Backup Wizard welcomes you to the Backup Wizard.

Subsequent panels of the wizard are as follows:

Playback or New Operation

Database Selection for SQL Server

Backup Type for SQL Server

Backup Type for SQL Server

Backup Style

Backup Location for MS SQL

Sybase Server Selection

Backup Device and Location for Sybase

Backup and Media Information

Specify Device-handling Options for Sybase

Backup Options

Backup Operation Summary

Backup Operation Execution Selection

Playback or New Operation

Required Information

New Dump Operation

Previous Dump

Operation

Description

This initiates the process of creating a new backup operation.

If you want to replay a backup operation, when you select the radio button, the browse function is enabled so you can find the .DBDump file you want to reuse.

Database Selection for SQL Server

Here you select the database you want to backup from a drop-down list and name the backup operation. You can keep the default name for the operation or replace it with one you type. The job description is optional and you can accept the default or write another.

Sybase Server Selection

Required Information

What are the source

Sybase server and database?

Description

Select a server from the drop-down list and then the appropriate datasource.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 805

D A TA B AS E B AC KU P W I ZA RD > D A TA BA S E B AC KU P W I ZA RD

Required Information

What do you want to dump?

Description

Database - Backs up the entire database. The size of the database is listed in parentheses.

Transaction Log - Backs up the inactive portion of the transaction log. The size of the transaction log is listed in parentheses.

Transaction Log With No Log - Removes the inactive portion of the transaction log without making a backup of it. You should only use this command when you run out of room in the database and cannot issue DUMP TRAN WITH TRUNCATE_ONLY.

Transaction Log With Truncate Only - Removes the inactive portion of the transaction log without making a backup of it. You should use this command prior to backing up a database.

Transaction Log With No Truncate - Makes it possible to dump a transaction log even if the database is inaccessible. You can use this option when the data portion of your database is damaged and the transaction log resides on a separate device.

80 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A T AB AS E B A C K U P W I Z A RD > D A T AB AS E B A C K U P W I Z A RD

Backup Type for SQL Server

Required Information

Full Database

Differential Database

File and File Group

Transaction Log

Description

Backs up the entire database. The size of the database is listed in parentheses.

Records all modifications made to a database after the last database backup, not just the changes made after the last differential database backup.

Select to specify a file or file group.

Full Truncate- Backs up the inactive portion of the transaction log. The size of the transaction log is listed in parentheses.

With No Log - Removes the inactive portion of the transaction log without making a backup of it. You should only use this command when you run out of room in the database and cannot issue DUMP TRAN WITH TRUNCATE_ONLY.

Full No Truncate - Makes it possible to dump a transaction log even if the database is inaccessible. You can use this option when the data portion of your database is damaged and the transaction log resides on a separate device.

With Truncate Only - Removes the inactive portion of the transaction log without making a backup of it. You should use this command prior to backing up a database.

Backup Style

Required Information

Backup Analyst Backup

Standard SQL Server Backup

Description

Select to use the Backup Analyst for your backup, assuming the Backup Analyst is installed on the database you are backing up. Also lets you compress the backup and apply an encrypted password.

Select to continue the Database Backup Wizard.

Backup Location for MS SQL

Required Information

Backup Device

Description

Depending on what is available to you, you can choose to backup to a disk, floppy, pipe, or tape device.

Disk Directory and Name Lets you specify a backup location on your machine or click the browse button and select a location.

View Contents

Click to open the Backup Media Contents dialog box .

Backup Device and Location for Sybase

Required Information

What type of dump device do you want to use?

Where should messages about the dump operation be sent?

Dump file

Description

Choose among tape device, disk device, or file. When you select file, you need to type the file’s name.

Your options are the Operator Console, Client, or Default.

It’s up to you to specify the name of the dump file.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 807

D A TA B AS E B AC KU P W I ZA RD > D A TA BA S E B AC KU P W I ZA RD

Backup and Media Information

Here, for MS SQL, you specify the backup set name, backup description, backup set password, media name, media description, and media name password.

For Sybase, select the dump device you want to use, if applicable. Clicking Attribute opens the

Backup Device editor. For details, see

Backup Devices Editor (SQL Server)

.

Specify Device-handling Options for Sybase

Required Information

Overwrite Contents

Compress

Dismount After Completion

Description

Select to overwrite the contents of a tape, and in the Retain Days box, type the number of days to retain the contents of the tape.

Lets you compress dumps and logs using different levels of compression.

The valid levels are 1-9, with level 9 compressing the file to its smallest size.

Select to dismount the tape after backup.

Rewind and Unload After Completion Select rewind the tape and unload after the backup.

Backup Options

Required Information

Expire Date

Retain Days

Skip backup set expiration and name checking before overwriting

Overwrite all backup sets on the device

Format the entire media before backup operation

Read and verify the integrity after the backup after finish

Backup Threads

Description

The date when the backup set expires and can be overwritten. If supplied as a variable (@takeover), this date is specified as either a string constant (@takeover

= date), as a variable of character string data type (except for the text or text data types), a small datetime, or datetime variable, and must follow the configured system datetime format.

The number of days that must elapse before this backup media set can be overwritten. If supplied as a variable (@days_var), it must be specified as an integer.

Microsoft SQL Server will skip the set expiration and name checking before overwriting.

Microsoft SQL Server will overwrite the contents of the device.

Will format the entire media before the backup operation starts.

After the operation completes, the integrity of the backup is verified.

0 is the default. Zero enables the server default value.

Backup Operation Summary

Here you indicate whether or not you want to save the operation, and if so, where the file should be saved. Also displayed are the elements of the function you are creating. You can go back to earlier panels if you want to make changes before the job runs.

80 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

Backup Operation Execution Selection

Required Information

Open the backup script in an ISQL editor

Perform the backup now

Schedule the backup for later execution

Description

The backup script will be opened into a new ISQL session. NOTE: This option is not available for Sybase backups.

The backup will be executed immediately.

The backup will be scheduled to run at a specified date/time.

For more information, see:

Executing a Backup Script in the ISQL Window

E

XECUTING A

B

ACKUP

S

CRIPT IN THE

ISQL W

INDOW

To execute the actual command DBArtisan uses to backup your database in the ISQL Window, do the following:

1 On

Backup Operation Execution Selection

, click Open.

DBArtisan opens the ISQL Window, which is used to execute SQL and Transact-SQL commands. The ISQL Window displays the procedure call that Backup Analyst makes to back up SQL Server databases, complete with the parameters needed to perform the backup.

2 To execute your backup, on the ISQL Editor toolbar, click Execute.

DBArtisan completes your backup and displays a message "Procedure Succeeded" on the

Results tab of the ISQL Editor.

B

ACKUP

M

EDIA

C

ONTENTS DIALOG BOX

Here you find a read-only display of the backup media available for the backup/restore operation you are creating.

D

ATABASE

R

ECOVERY

W

IZARD

To both validate your back ups and practice the disaster recovery process, you should regularly restore your database dumps. If possible, every day, you should restore your databases on a separate server to enhance system availability. In this manner, you can maintain a warm backup of your database guarding against downtime from system failure.

The Database Recovery Wizard lets you:

• Create a new load operation.

• Reuse a previously defined operation.

• Specify the target server, database, and type of restore operation.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 809

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

• Specify the recovery completion state.

• Specify how to report the progress of the load operation.

• Specify which file to load from the device.

• Specify whether to perform safety checks before replacing the database.

• Save the definition of the dump operation for future reuse.

NOTE:

Backups created with Microsoft SQL Server version 7 cannot be restored to an earlier version of SQL Server.

NOTE:

If you perform a Database Backup, and then Perform a Data Unload on the same database, close all open windows or disconnect from the database before starting the

Database Recovery Wizard.

C

REATING OR

E

DITING A

R

ECOVERY

O

PERATION

DBArtisan lets you create different recover operations using the Recovery Wizard. After you have successfully created a recovery operation, you can reopen and edit it using the same wizard and make the changes you want.

To Open the Database Recovery Wizard

1 On the Datasource Explorer, select a connected datasource.

2 On the Utilities menu, click Database Restore.

The first panel of the Database Backup Wizard welcomes you to the Backup Wizard.

Subsequent panels of the wizard are as follows:

Playback or New Operation

Database Selection for MS SQL

Database Selection for Sybase ASE

Recovery Completion for MS SQL

Recovery Completion for Sybase ASE

Backup and Media Set Information for MS SQL

Dump Device Selection for Sybase ASE

Tape Handling Options for Sybase ASE

Recovery Options

Recover Operation Summary

Action Selection

81 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

Playback or New Operation

Required Information

New Recovery/Load Operation

Previous Recovery/Load

Operation

Description

This initiates the process of creating a new recovery operation.

If you want to replay a recovery operation, when you select the radio button, the browse function is enabled so you can find the .sqrc file you want to reuse.

Database Selection for MS SQL

Required Information

Target Database

Restore Type

Backup Source

Description

From the drop-down list, specify the target database for the recovery.

Elect to restore the database, filegroups or files, or a transaction log.

From Backup History - Find backup sets between the dates you specify and make your selection.

From Device - Specify the device. Click Add or Edit to open the

Recovery Wizard Dialog

Box . Or, click Remove or Remove All to eliminate the device(s) from this operation.

Database Selection for Sybase ASE

Here you select the Sybase server and database you want to recover from the drop-down lists.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 811

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

Recovery Completion for MS SQL

Required Information

Leave database operational

Leave database non-operational

Leave database read-only

Force restore over existing database

Eject tapes (if any) after restoring each backup

Point in time restore

Description

No more transaction logs can be recovered.

You can restore more transaction logs.

You can restore more transaction logs.

Eject tapes after the backup is restored.

Select the date and time from which you want the restore operation to take place.

Recovery Completion for Sybase ASE

Required Information

Which operation do you want to perform?

Description

Load Database - Specifies that the complete database and transaction log should be restored.

Load Transaction Log - Specifies that only the transaction log should be applied to the database.

List Database - Validates a load database operation without actually performing the load.

List Transaction Log - Validates a load transaction operation without actually performing the load.

Information type you want to see Header Only, Brief Description, or Detailed Description.

If you are loading or listing a transaction log...

If you are loading the transaction log, in the If you are loading or listing a transaction log... box, type the specific log time you want to load.

Backup and Media Set Information for MS SQL

Here, for MS SQL, you specify the backup set name, backup set password, media name, and media name password. Any existing backup files are listed.

If you are creating at Leave database read-only operation, the Undo File option is enabled.

Browse to find the file you want to undo.

Backup and Media Information for Sybase ASE

Required Information

What type of dump device do you want to use?

Description

Choose among:

Tape or Disk Device: Existing options for either of these choices become apparent on the next panel. If none are available, you won’t see any devices.

File: You must type the name of the file you want use

Select among: Default, Client, or Console.

Where should messages about the load operation be sent?

Dump File You must type the name of the file where you want to send the load operation messages.

81 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

Dump Device Selection for Sybase ASE

If you elected to use a tape or disk device, here you select which specific tape/disk device you want to use. You can choose one or more of the devices that appear in the panel. If none appear, you have to go Back to pick another device type. You can specify tape or disk properties by clicking each device, and then clicking the Attributes button. If you click Attribute, the Device

Attribute Editor dialog box opens.

Tape Handling Options for Sybase ASE

You can opt to dismount after the operation completes or rewind and unload after the operation completes.

Recovery Options

For MS SQL, the backup file is identified here, and if you are creating a new database from another database’s backup, you can rename files in the Recover As box.

For Sybase, you see the default backup file, which you can easily change. You also have the option, for tape device operations, to load the data with decompression.

Recover Operation Summary

You can elect to save the recovery operation. You can see the default location where the recovery operation will be saved or you can browse to another location. The summary panel displays the choices you have made to this point. Go back to make changes.

Action Selection

Option

Open the recovery script in an

ISQL editor

Perform the recovery now

Schedule the recovery for later execution

Description

The recovery script will be opened into a new ISQL session. See

Executing a

Recovery Script in the ISQL Window . NOTE: This option is not available for

Sybase recoveries.

The recovery will be executed immediately.

The recovery will be scheduled to run at a specified date/time.

D

EVICE

A

TTRIBUTE

E

DITOR

D

IALOG

B

OX

The Device Attribute Editor dialog box lets you configure tape/disk device attributes. The choices you make here apply to the device, not only to the current restore job you are configuring.

The table that follows describes the required information:

Required Information

Backup Server Name

Description

Type the name of the backup server where the dump device is located.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 813

D A TA B AS E R EC O V ERY W IZ ARD > DA TA BA SE RE COV ER Y W I ZA RD

Required Information

Density

Block Size

Capacity

Volume Name

Description

Use the drop-down list to select the appropriate value. This is the density of the tape, if a reel to reel tape is the storage device.

Enter the appropriate number of bytes. This is amount of data to read/write in a single operation.

Enter the appropriate value in megabytes. This is the backup storage capacity.

Enter name of the volume where the backup is stored.

R

ECOVERY

W

IZARD

D

IALOG

B

OX

The Recovery Wizard dialog box records your selection for the backup device and file you want to include in the backup operation.

NOTE:

The Backup Device and Disk Directory options are mutually exclusive.

The table below explains the information fields you encounter:

Required Information

Restore Type

Description

From the drop-down list, choose among Database, Filegroups or files, and

Transaction Log recovery operations.

Backup Device Your choices from the drop-down list are Disk Device, Floppy Device, Pipe

Device, and Tape Device. Only when a device is selected, and available, does the right drop-down list populate.

Disk Directory and Name

Backup Number

The default directory populates the directory and name field. You can browse or type to make changes to the default.

Indicate the backup number. When you select View Contents, the Backup

Media Contents dialog box opens.

Password/Password Confirmation Create a password if you want to restrict access to the recovery file.

E

XECUTING A

R

ECOVERY

S

CRIPT IN THE

ISQL W

INDOW

To execute the actual command DBArtisan uses to recover your database in the ISQL Window, do the following:

1 On

Database Recovery Wizard - Last panel,

click Open.

DBArtisan opens the ISQL Window, which is used to execute SQL and Transact-SQL commands. The ISQL Window displays the procedure call that Backup Analyst makes to recover SQL Server databases, complete with the parameters needed to perform the recovery.

2 To execute your recovery, on the ISQL Editor toolbar, click Execute.

DBArtisan completes your recovery and displays a message "Procedure Succeeded" on the

Results tab of the ISQL Editor.

81 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA EX PORT W IZ A RD F OR OR ACLE > D AT A E X P O R T W I Z A RD F O R O R A C L E

D

ATABASE

R

ECOVERY

W

IZARD

- L

AST PANEL

Review the database restore description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the database restore operation, click Execute.

D

ATA

E

XPORT

W

IZARD FOR

O

RACLE

DBArtisan provides comprehensive graphical support for the Oracle Export Utilities. DBArtisan offers a simple wizard that guides you through the process of extracting object definitions and table data from an Oracle database and creating binary export file. DBArtisan's Export Wizard ensures that the proper parameters and privileges are used, provides access to desired database information and resolves version compatibility differences.

The Export Wizard supports all four export modes:

• Table

• Users

• Full Database

• Point-in-time Recovery (available in Oracle8)

The benefits of using the Oracle Export Utilities range from moving data between different versions of Oracle quickly and efficiently, saving space on the database, to selectively backing up an entire or portion of a database using cumulative or incremental export functions.

To use the Export Wizard, you must specify the path and name for the Oracle Export utility in the

Oracle Utility Tab of the Options Editor.

NOTE:

If you do not have the EXP_FULL_DATABASE role assigned to you, you may not be able to access all the functionality of the export wizard.

Starting the Data Export Wizard

1 On the Datasource Explorer, select the database object.

DBArtisan displays the database objects in the right pane of the Datasource Explorer.

2 On the Utilities menu, click Database Export.

DBArtisan opens the

Data Export Wizard - Panel 1 .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 815

D A T A E X P O R T W I Z A RD F O R O RA C L E > DATA EX PO RT W IZ ARD FO R ORACLE

D

ATA

E

XPORT

W

IZARD

- P

ANEL

1

The first panel of the Export Wizard lets you specify the source datasource, name an existing parameter file or use the existing Oracle default parameter file.

The table below describes the options and functionality on the first panel of the Data Export

Wizard:

Option

Which database has the data you wish to export?

Edit an existing parameter file

Default values

Description

Click the list, and then click the database.

Type the location and name of the parameter file or click the browse button to find the file.

To use the Oracle default values for the parameter file, leave this box blank.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

2

The second panel of the Export Wizard lets you select the export mode that determines the database objects you will export.

• The full database mode makes available incremental, cumulative or complete export operations.

• The point-in-time export operation can export one or more tablespaces, which you can use in an import operation to recover a tablespace at a prior point in time without affecting the rest of the database.

The table below describes the objects, related objects and structures that are exported for each mode:

Mode

Table

User

Full Database

Object Types and Structures

Table definitions, object types defined on the table, table data by partition, nested table data, indexes defined on the table, table constraints, table permissions, column and table comments, table analysis information, triggers that refer to the table, and auditing information.

Libraries, object types, database links, sequence numbers, cluster definitions, table definitions, object types defined on the table, table data by partition, nested table data, indexes defined on the table, table constraints, table permissions, table analysis information, column and table comments, private synonyms, stored procedures, functions, packages, auditing information, views, cluster analysis information, referential constraints, triggers, snapshots, and snapshot logs.

Tablespace definitions, tablespace quotas, profiles, user definitions, roles, role privileges, system privileges, resource costs, rollback segment definitions, database links, sequence numbers, directories, libraries, object types, cluster definitions, password information, default and system auditing, object type tables, table definitions, table data by partition, nested table data, table indexes, table constraints, table privileges, table analysis information, column and table comments, auditing information, synonyms, views, stored procedures, functions, packages, triggers, cluster analysis information, snapshots, snapshot logs, refresh groups and children.

81 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA EX PORT W IZ A RD F OR OR ACLE > D AT A E X P O R T W I Z A RD F O R O R A C L E

Mode

Point-In-Time (available in Oracle8)

Object Types and Structures

Tablespaces.

The table below describes the options and functionality on the second panel of the Data Export

Wizard:

Option

Which mode would you like to use for this export?

Description

Click the option button that corresponds to the export mode you want to implement:

Table, User, Full Database, or Point-in-Time Recovery.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

3

The third panel of the Export Wizard lets you specify the objects you want to export based on the mode you selected in the second panel of the Export Wizard.

The table below describes the options and functionality on the third panel of the Data Export

Wizard for Table mode:

Option

Select the tables and/or partitions you would like to export

Tables

Description

To display list of available tables, click the Owner list, and then click the owner.

In the box, select the check boxes that correspond to the tables you want to export. If a table has partitions, select the check boxes that correspond the partitions you want to export. To select all tables, click the Select All button.

The table below describes the options and functionality on the third panel of the Data Export

Wizard for User mode:

Option

Select the users whose objects you would like to export

Description

To display list of available users, select the check boxes that correspond to the objects you want to export. To select all objects, click the Select All button.

The table below describes the options and functionality on the third panel of the Data Export

Wizard for Full Database mode:

Option

Would you like to perform an incremental export

Description

An incremental operation exports all database objects that have changed since the last incremental, cumulative, or complete export operation.

NOTE: To perform an incremental export operation, you must have the

EXP_FULL_DATABASE role.

A cumulative operation exports all database objects that have changed since the last cumulative or complete export.

A complete operation exports all objects.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 817

D A T A E X P O R T W I Z A RD F O R O RA C L E > DATA EX PO RT W IZ ARD FO R ORACLE

Option

Do you want to records this export in the system tables that track exports?

Description

To record the export operation in the SYS.INEXP, SYS.INCFIL, and SYS.INVID system tables, click the Yes button.

The table below describes the options and functionality on the third panel of the Data Export

Wizard for Point-in-Time Recovery mode:

Option

Select the tablespaces to be recovered

Description

To display list of available tablespaces, select the check boxes that correspond to the tablespaces you want to recover. To recover all tablespaces, click the Select All button.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

4

The fourth panel of the Export Wizard lets specify:

• The objects you want to export.

• To view the progress meter.

The table below describes the options and functionality on the fourth panel of the Data Export

Wizard:

Option

Check the objects you would like to export

Rows/Dot

Description

NOTE: This option is not available if you are performing a full database incremental export operation. The Oracle Export Utility automatically determines if a row has been changed since the last export operation.

Select the check box that corresponds to the object(s) you want to export:

To export indexes associated with the tables, select the Indexes check box.

To export check constraints or referential integrity constraints, select the

Constraints check box.

To export object privileges, select the Grants check box.

To export table data, select the Rows check box.

To view the progress meter which displays the status of rows being exported, in the box, type the value of the number of rows per dot you want displayed in the meter.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

5

The fifth panel of the Export Wizard lets you set the following options:

• The Export Path

• The Length of the File Record

• The Buffer Size

81 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA EX PORT W IZ A RD F OR OR ACLE > D AT A E X P O R T W I Z A RD F O R O R A C L E

The table below describes the options and functionality on the fifth panel of the Data Export

Wizard:

Option

Would you like to perform a direct path export?

Would you like to accept your platform's value for BUFSIZ as the length of the file record?

Would you like to accept your platform's default value for the buffer size used to fetch rows?

Description

A direct path export extracts data much faster as it bypasses the SQL Command processing layer and saves data copies whenever possible.

Lets you select the Yes or No option button.

If you clicked the No option button, in the Specify length box, type the KB value of the length.

The highest value you can specify is 64 KB.

NOTE: This option is only valid if you are performing a conventional path export.

Lets you select the Yes or No option button.

If you clicked the No option button, in the Specify size box, type the KB value of the length; the highest value you can specify is 64 KB.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

6

The sixth panel of the Export Wizard lets you specify:

• Handling storage of table data.

• Type of optimizer statistics to generate when the file is imported.

• Make the data remain unchanged during the export operation.

The table below describes the options and functionality on the sixth panel of the Data Export

Wizard:

Option

Would you like table data to be consolidated into one initial extent upon import?

What type of database optimizer statistics should be generated upon import?

Description

Lets you select the No or Yes option button.

Lets you click the appropriate option button: Estimate, Compute, or None.

Would you like to ensure that the data seen by this export operation does not change during execution?

NOTE: This option is not available for an incremental export operation.

Lets you select the No or Yes option button.

Click Yes to ensure that the data remains intact throughout the export operation.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

7

The seventh panel of the Export Wizard lets you specify names and locations for the export, parameter and logfiles.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 819

D A TA IM P OR T W I ZA RD F OR OR A C L E > D A T A IM P O R T W I Z A RD F O R O R A C L E

The table below describes the options and functionality on the seventh panel of the Data Export

Wizard:

Option

Supply the export file name

Logfile

None

Description

Lets you type the full location and name of the export file. Export file names use the.dmp file extension. (for example, C:\Temp\EXPBerlin.dmp).

If you expect to perform the same export operation again, type the location and name of the parameter file in the corresponding box. Parameter files are stored as.txt files. (for example, C:\Temp\EXPPARBerlin.txt).

To capture informational and error messages, click the option button and type the location and name of the logfile in the corresponding box. Export logfile names use the.logfile extension. (for example, C:\Temp\EXPLOGBerlin.log).

If you do not want to capture informational and error messages, click the option button.

D

ATA

E

XPORT

W

IZARD

- P

ANEL

8

Review the data export operation description to verify its accuracy.

Completing Panel 8

Review the export operation description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the export operation, click Execute.

DBArtisan starts the Export operation.

D

ATA

I

MPORT

W

IZARD FOR

O

RACLE

DBArtisan provides comprehensive graphical support for the Oracle Import Utilities. DBArtisan offers a simple wizard that guides you through the process of extracting object definitions from an Oracle Export file and inputting them into the database. The Oracle Import utility only reads export files created with the Oracle Export utility. DBArtisan's Import Wizard ensures that the proper parameters and privileges are used, provides access to desired database information and resolves version compatibility differences.

The Import Wizard supports all four import modes:

• Table

• Users

• Full Database

• Point-in-time Recovery (available in Oracle8)

82 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA I M P O R T W I Z A RD F O R O R A C L E > D A TA I M P O R T W I Z A RD F O R O R A C L E

The Oracle Import utilities build database objects in the proper sequence to avoid dependency problems. Tables are created first, then table data is input into the proper tables, next indexes are built, then triggers are imported and finally integrity constraints are built.

To use the Import Wizard, you must specify the path and name for the Oracle Import utility in the

Oracle Utility Tab of the Options Editor.

NOTE:

If you do not have the EXP_FULL_DATABASE role assigned to you, you may not be able to access all the functionality of the import wizard.

Starting the Import Wizard

1 On the Datasource Explorer, select the database object.

DBArtisan displays the database objects in the right pane of the Datasource Explorer.

2 On the Utilities menu, click Data Import.

DBArtisan opens the

Data Import Wizard - Panel 1

.

D

ATA

I

MPORT

W

IZARD

- P

ANEL

1

The first panel of the Import Wizard asks you to specify the target datasource and to name an existing import parameter file or use the existing Oracle default parameter file.

The table below describes the options and functionality on the first panel of the Data Import

Wizard:

Option

Into which database would you like to import data?

Edit an existing parameter file

Default values

Description

Click the list, and then click the database.

Type the location and name of the parameter file or click the browse button to find the file.

To use the Oracle default values for the parameter file, leave this box blank.

D

ATA

I

MPORT

W

IZARD

- P

ANEL

2

The second panel of the Import Wizard lets you specify the export file from which the data should be imported. You must also select the import mode you want to use which determines the database objects that DBArtisan imports. The table below describes the objects, related objects and structures that are imported for each mode:

Mode

Table

Object Types and Structures

Table definitions, object types defined on the table, table data by partition, nested table data, indexes defined on the table, table constraints, table permissions, column and table comments, table analysis information, triggers that refer to the table, and auditing information.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 821

D A TA IM P OR T W I ZA RD F OR OR A C L E > D A T A IM P O R T W I Z A RD F O R O R A C L E

Mode

User

Full Database

Object Types and Structures

Libraries, object types, database links, sequence numbers, cluster definitions, table definitions, object types defined on the table, table data by partition, nested table data, indexes defined on the table, table constraints, table permissions, table analysis information, column and table comments, private synonyms, stored procedures, functions, packages, auditing information, views, cluster analysis information, referential constraints, triggers, snapshots, and snapshot logs.

Tablespace definitions, tablespace quotas, profiles, user definitions, roles, role privileges, system privileges, resource costs, rollback segment definitions, database links, sequence numbers, directories, libraries, object types, cluster definitions, password information, default and system auditing, object type tables, table definitions, table data by partition, nested table data, table indexes, table constraints, table privileges, table analysis information, column and table comments, auditing information, synonyms, views, stored procedures, functions, packages, triggers, cluster analysis information, snapshots, snapshot logs, refresh groups and children.

Tablespaces.

Point-In-Time

(available in

Oracle8)

The table below describes the options and functionality on the second panel of the Data Import

Wizard:

Option

Specify the export file from which you want to import data?

Which database was used to create this export file?

Which mode would you like to use for this export?

Description

Lets you type the location and name export file to be used in the import operation, or find the file by clicking the Browse button.

Lets you choose the database used for export file creation from the list.

Lets you click the option button that corresponds to the import mode you want to implement.

Table

User

Full Database

ORACLE 8 OR LATER ONLY:

Point-In-Time

D

ATA

I

MPORT

W

IZARD

- P

ANEL

3

The third lets you specify which objects you want to import based on the mode you selected in the second panel of the Import Wizard.

The table below describes the options and functionality on the third panel of the Data Import

Wizard for Table mode:

Option

Select the tables and/or partitions you would like to import

Description

Displays a list of available tables. Lets you click the Owner list, and then click the owner.

82 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA I M P O R T W I Z A RD F O R O R A C L E > D A TA I M P O R T W I Z A RD F O R O R A C L E

Option

Tables

Description

To In the box, select the check boxes that correspond to the tables you want to import.

If a table has partitions, click the check boxes that correspond the partitions you want to import.

To select all tables, click the Select All button.

The table below describes the options and functionality on the third panel of the Data Import

Wizard for User mode:

Option

Select the users whose objects you would like to import

Description

To display list of available users, select the check boxes that correspond to the objects you want to import.

To select all objects, click the Select All button.

The table below describes the options and functionality on the third panel of the Data Import

Wizard for Full Database mode:

Option

Would you like to perform an incremental import

Description

An incremental operation imports all database objects that have changed since the last incremental, cumulative, or complete export operation.

D

ATA

I

MPORT

W

IZARD

- P

ANEL

4

The fourth panel lets you specify options to import dependent objects, privileges and table data, and to create a file for index-creation commands.

The table below describes the options and functionality on the fourth panel of the Data Import

Wizard:

Option

Check the objects you would like to import

Description

Select the check box that corresponds to the object(s) you want to export.

To import object privileges, click the Grants check box.

To import table data, select the Rows check box.

To import indexes associated with the tables, select the Indexes check box.

Lets you click the Yes or No option button. Would you like to skip unusable indexes?

Would you like specify a file to receive index-creation commands?

When this parameter is specified, index-creation commands for the requested mode are extracted and written to the specified file, rather than used to create indexes in the database. Tables and other database objects are not imported.

If you clicked the Yes option button, type the location and name of the file or find the file by clicking the Browse button.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 823

D A TA IM P OR T W I ZA RD F OR OR A C L E > D A T A IM P O R T W I Z A RD F O R O R A C L E

D

ATA

I

MPORT

W

IZARD

- P

ANEL

5

The fifth panel of the Import Wizard lets you:

• Set the data rows transfer buffer size.

• Indicate if the import operation should commit after each array insert.

• Specify the option to re-use existing data files.

• Specify the option to ignore creation errors.

The table below describes the options and functionality on the fifth panel of the Data Import

Wizard:

Option

Would you like to accept your platform's default value for buffer size used to fetch rows?

Description

If you select the No option button, in the Specify length box, type the

KB value of the length.

The highest value you can specify is 64 KB.

Lets you select the No or Yes option button.

Should Import commit after each array insert?

Would you like to reuse the existing datafiles making up the database?

Should Import ignore object creation errors when attempting to create database objects?

Select Yes to set the reuse option in the datafile clause of the CREATE

TABLESPACE command.

Select Yes if you selected Table as your mode of import in panel 2, and the tables exist in the database in the target database.

D

ATA

I

MPORT

W

IZARD

- P

ANEL

6

The sixth panel of the Import Wizard lets you specify:

• The length of the file record.

• How you want to implement SQL Analyze statements contained in the export file.

• To view the contents of the export file rather than import the database information.

• To view the progress meter.

The table below describes the options and functionality on the sixth panel of the Data Import

Wizard:

Option

Would you like to show the contents of the export file rather than import them?

Would you like to view the progress meter as rows are imported

Description

Lets you select the No or Yes option button.

Lets you enter the number of rows per dot displayed in the meter box, type the value of the number of rows per dot you want displayed in the meter.

82 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D A TA I M P O R T W I Z A RD F O R O R A C L E > D A TA I M P O R T W I Z A RD F O R O R A C L E

Option

Would you like to accept your platform's value for BUFSIZ as the length of the file record?

Would you like to accept your platform's default value for the buffer size used to fetch rows?

Description

If you select the No option button, in the Specify length box, type the

KB value of the length; the highest value you can specify is 64 KB.

NOTE: This option is only valid if you are performing a conventional path export.

If you click the No option button, in the Specify Size box, type the KB value of the length; the highest value you can specify is 64 KB.

Lets you select the No or Yes option button.

Would you like Import to execute SQL

Analyze statements found in the export file?

D

ATA

I

MPORT

W

IZARD

- P

ANEL

7

The seventh panel of the Import Wizard lets you specify names and locations for the parameter and logfiles. If you importing from an Oracle 6 export file, you can define the character set of the original file.

The table below describes the options and functionality on the seventh panel of the Data Import

Wizard:

Option

Character Set

Logfile Button

None Button

Parameter File

Description

For Oracle 6 export files, type the character set of the original file.

Click to capture informational and error messages, and then type the location and name of the logfile in the corresponding box. Export logfile names use the *.logfile extension.

(for example, C:\Temp\EXPLOGBerlin.log).

Click if you do not want to capture informational and error messages.

If you expect to perform the same export operation again, type the location and name of the parameter file in the corresponding box. Parameter files are stored as .txt files. (for example, C:\Temp\EXPPARBerlin.txt).

D

ATA

I

MPORT

W

IZARD

- P

ANEL

8

Review the data import operation description to verify its accuracy.

Completing Panel 8

Review the import operation description to verify its accuracy.

1 If you need to make any changes, click Back to scroll back to the appropriate panels of the wizard to make your corrections.

2 If you are satisfied with the import operation, click Execute.

DBArtisan starts the Import operation.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 825

A RC HI VE A C T IV I T Y > A RC H IV E AC TI V IT Y

A

RCHIVE ACTIVITY

Oracle uses Redo logs to record changes made to a database during operation. These files, which are active or online during normal operation, are referred to as the online redo logfiles.

Oracle uses these files to reapply changes made during the recovery process that were not written to datafiles before shutdown. You can operate an Oracle database in ARCHIVELOG or

NOARCHIVELOG mode. If you choose ARCHIVELOG mode, then Oracle uses a background process to copy the contents of the online redo logfiles as archive redo logfiles in a separate area. ARCHIVELOG mode lets you perform online backups and database media recovery of your

Oracle database.

The Archive Activity Monitor lets you to analyze the status, activity levels, proper sizing and performance of your archive redo logs. At a glance, you can determine the ARCHIVELOG mode, configuration and vital statistics about redo log performance. In particular, the Archive Activity

Monitor lets you to assess whether or not the redo logfiles are sized properly. It is very important to choose the right size for online redo logfiles. If the redo logs are too small, the Log Writer must switch logfiles too often, which hurts performance. If the redo logs are too big, recovery times are longer.

The table below describes the Archive Activity Monitor options:

Category

Log Archiving

Online Redo

Archive Activity

Redo Log

Buffer

Contention

Option

Log Mode

Auto Archival

Description

Whether or not ARCHIVELOG mode is active for the Oracle instance.

Whether or not the database has been configured to archive redo logs automatically.

Directory where the archive redo logs are contained.

Destination

Oldest Log

Sequence

Oldest system change number. As a precaution, your backups should include all archived logfiles starting with the oldest log sequence.

Current system change number. It marks the start of the backup.

Current Log

Sequence

Redo Entries Number entries made to the online redo logs by the Log Writer (LGWR) process.

Avg Redo Size Average size, in kilobytes, of a redo log entry.

Entry Requests Number of entries made to the redo log buffer by the Log Writer (LGWR) process.

Redo Log

Switches

Entry Wait

Times

Time

Record ID in

Controlfile

Number of times that the Oracle Log Writer has had to wait before making an entry to the redo log buffer. This number is accumulated since the last time that the database was started. A high number of waits indicates that the log buffer size is too small. To increase the size, you need to modify the LOG_BUFFER parameter in the Oracle configuration file (e.g., INITORCL.ORA).

When the redo log switch occurred. If redo log switches occur frequently, the redo logs are probably too small. As a rule-of-thumb, redo log switches should not occur more frequently than once every 30 minutes. If they are occurring more frequently, then you should increase the size of the redo logs.

Displays ID number in the control file.

82 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P C O N TRO L F IL E S > B A C K U P C O N T ROL F IL E S

Opening the Archive Activity Dialog Box

1 On the Utilities menu, click Archive Activity.

DBArtisan opens the Archive Activity dialog box.

B

ACKUP

C

ONTROL

F

ILES

You should keep many copies of your control files to safeguard against disk failure or loss of the primary control file. DBArtisan provides a graphical interface for constructing the ALTER

DATABASE command needed to backup your control files.

Using the Backup Control Files Utility

1 On the Utilities menu, click Backup Control File

DBArtisan opens the

Backup Controlfile Dialog Box .

B

ACKUP

C

ONTROLFILE

D

IALOG

B

OX

The table below describes the options and functionality available on the Backup Controlfile dialog box:

Option

Backup Controlfile Name

Reuse Existing Backup Controlfile check box

Trace SQL Statements

Description

Type the name of the backup control file in the box. To reuse an existing Back

Up Controlfile, type the name of the existing file, and then select Reuse Existing

Backup Controlfile.

NOTE: When you type in the Backup Controlfile Name box, the check box is activated.

Select this check box if you want to reuse an existing file. The name of the file and the name entered in the Backup Controlfile Name box must be the same.

Click the option button that corresponds to how you want Trace SQL statements handled:

None - No statements are traced.

Reset Logs - Traces reset logs.

No Reset Log - Does not trace reset logs.

C

HAINED

R

OW

A

NALYSIS

Updates can cause data rows to migrate and to chain over multiple data blocks. Chaining degrades performance because more physical reads are required to access a row of data.

Consequently, you should monitor chained rows regularly to spot performance bottlenecks before they become severe.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 827

FRE E S P ACE DE FI CIT > FRE E S P AC E DE FI CIT

To avoid chained rows, you can tune the Percent Free storage settings for that table or cluster.

By increasing the Percent Free on each data block, you decrease the likelihood that an update causes a data row to expand over multiple data blocks.

If the row length is greater than the size of a data block, you cannot avoid chained rows.

DBArtisan provides a utility that lets you identify chained rows quickly by displaying chained rows for all or any schema in your Oracle database.

Analyzing Chained Rows

1 On the Utilities menu, click Chained Row Analysis.

DBArtisan opens the Chained Row Analysis dialog box.

The table below describes the options and functionality on the Chained Row Analysis dialog box:

Option

Owner

Refresh Button

Description

Lets you select the owner for whom you want to scan for chained rows.

Click to refresh the list.

F

REE SPACE

D

EFICIT

One of the central tasks of every Oracle administrator is to monitor the availability of free space in tablespaces. When a data segment (e.g., table, index or cluster) is created on a tablespace, it acquires an initial extent of a determined size. As it grows, the data segment will eventually need to acquire another extent to store additional data. If a data segment cannot acquire its next extent, all further transactions on it will fail.

The Free Space Deficit Monitor identifies any objects that will not be able to acquire their next extent. Whenever it identifies a problem data segment, you should take corrective action as soon as possible. To address the problem, you can:

1 Reduce the object's Next Extent Size from the appropriate Object Editor.

2 Increase the availability of free space in the tablespace by:

• Adding datafiles.

• Activating autoextend for the tablespace's datafiles. Autoextend allows the datafiles to grow to fill available room on the physical drive. This option is only available with Oracle.

The table below describes the objects:

Category

Tablespace

Information

Name

Largest Free Section

Description

Name of the tablespace.

Largest contiguous section of free space in a tablespace.

82 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P I N N E D C O D E > P I N N E D C O D E

Category

Objects

Information

Object Name

Object Type

Next Extent

Description

Name of any object that will not be able to acquire its next extent because it will be larger than the Largest Free Section.

Type of the object, such as a table, index or cluster, that will not be able to acquire its next extent.

Specified size of the object's next extent. One of the options you have to correct the problem is to reduce the next extent size so that it is smaller than the Largest Free Section.

Opening the Free Space Deficit Dialog Box

1 On the Utilities menu, click Free Space Deficit.

DBArtisan opens the Free Space Deficit dialog box.

The table below describes the options and functionality on the Free Space Deficit dialog box:

Option

Owner

Description

Lets you click the owner for whom you want to analyze free space.

P

INNED

C

ODE

For Oracle, DBArtisan now offers a Pinned Code Utility that lets you pin or unpin code objects in memory. This ensures that frequently accessed database stored procedures, triggers, functions, etc., are available in memory, which improves their overall execution performance.

NOTE:

To create the DBMS_SHARED_POOL package log on as SYS and run the

DBMSPOOL.SQL script that is found in the ORACLE_HOME\RDBMS\ADMIN directory.

Opening the Pin Code Dialog Box

1 On the Utilities menu, click Pinned Code.

DBArtisan opens the Pin Code dialog box.

The table below describes the options and functionality on Pin Code dialog box.

Option

User

Pin Button

UnPin Button

Flush SGA Button

Description

Lets you select the object user.

To pin an object, select the target object, and then click the Pin button.

To unpin an object, select the target object, and then click the UnPin button.

Click to flush the Oracle shared pool to remove fragmentation and any unwanted code objects from memory.

You must install the SYS.DBMS_SHARED_POOL package on your Oracle server to use this utility.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 829

M AX IM U M E X T E N T L I M IT S > M A X I M U M E X TE N T L IM I T S

C

ONFIRM

S

HARED

P

OOL

F

LUSH

The Confirmed Shared Pool Flush dialog box lets you confirm that you want to flush the Shared

Pool. Flushing the Shared Pool causes all non-pinned code objects to be removed. After you flush the Shared Pool, all non-pinned objects are parsed and reloaded back into the pool on the next execution. This can extend first-time execution response times.

M

AXIMUM

E

XTENT

L

IMITS

When an object reaches its maximum extent limit, it cannot acquire any new free space. This can cause critical problems in a production database. DBArtisan’s Maximum Extent Limits for Oracle tool lets you quickly find and correct space problems.

Opening the Maximum Extent Limits Dialog Box

1 On the Utilities menu, click Maximum Extent Limits.

DBArtisan opens the Maximum Extent Limits dialog box.

The table below describes the options and functionality on Maximum Extent Limits dialog box.

Option

Object Owner

Objects

Edit Button

Description

Lets you select owner of the objects to display the Objects box.

Objects for the user account(s) that have reached their maximum extent limit.

To increase an object’s maximum extent limit, edit the object and adjust its maximum extent property to a higher value or to unlimited.

I

NSTANCE

P

ARAMETER

C

ONFIGURATION

DBArtisan lets you configure and tune your Oracle databases. DBArtisan offers a utility that lets you view and edit the settings for each Oracle instance. DBArtisan derives its information from the system catalog. To reconfigure your Oracle instance, you must edit the parameter settings in the applicable configuration file (for example, INITORCL.ORA).

NOTE:

After changing the settings, shut down and restart the database server for the changes to take effect.

Changing an Instance Parameter

1 On the Datasources menu, click Configure.

DBArtisan opens the Instance Parameters dialog box.

83 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IN S T A N C E P A R A M E T E R C O N FI G U R A T IO N > I N S T A N C E P A R A M E T E R C O N F I G U R A T I O N

2 To modify an instance parameter, double-click the target instance parameter or click the Edit button to open the Edit Configuration dialog box.

NOTE:

To modify an instance parameter, the parameter must have a Yes in the Session

Modifiable or System Modifiable column of the Instance Parameter grid.

The table below describes the options and functionality on the Edit Configuration dialog box:

Option

New Value

Description

Lets you type the value for the parameter.

E

XTRACTING

I

NSTANCE

C

ONFIGURATION

P

ARAMETERS

DBArtisan lets you extract the statements for setting and displaying your instance configuration parameters.

From the Datasource Explorer

1 On the Datasource Explorer, select the Configuration node.

DBArtisan displays the parameters in the right pane of the Datasource Explorer.

2 In the right pane of the Datasource Explorer, click the target parameter(s).

3 On the Datasource Explorer toolbar, click Extract.

OR

In the right-pane of the Datasource Explorer, right-click the parameters, and then click

Extract.

DBArtisan extracts the definition to a text window.

G

ENERATING A

R

EPORT ON

C

ONFIGURATION

P

ARAMETERS

DBArtisan lets you generate a detailed report containing information about your instance configuration parameters. The reports derive their contents from the information displayed in the right hand side of the Datasource Explorer. To facilitate the online publication of these reports, DBArtisan generates the report in Hypertext Mark-Up Language (HTML). You can view the report directly in DBArtisan's built-in HTML-browser.

NOTE:

For more information on generating reports, see

Using the Schema Publication Wizard

.

Generating a Instance Configuration Parameters Report

1 On the Datasource Explorer, select the Configuration node.

DBArtisan displays the parameters in the right pane of the Datasource Explorer.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 831

C O N F I G U RI N G R E S O URC E C O S T > C O N F I G URI N G R E S O U RC E C OS T

2 In the right pane of the Datasource Explorer, click the target parameter(s).

3 On the Datasource Explorer toolbar, click Report.

OR

In the right-pane of the Datasource Explorer, right-click the parameters, and then click

Report.

DBArtisan opens the Report dialog box.

The table below describes the options and functionality on the Report dialog box:

Option

Report Home Page File

Name

Report Title

Functionality

To change the report home page file name, in the box, type the location and name of the file or find the file by clicking the Browse icon.

To change the report title, in the box, type the location and name of the file or click the Browse Button to find the file.

C

ONFIGURING

R

ESOURCE

C

OST

When you create a profile, you can assign a composite resource limit to it. The composite limit is a weighted average of four individual resource limits:

• Connect time

• Private SGA

• CPU per session

• Logical reads per session

The default setting is to weight each of these measures equally. You can alter the weights by issuing an ALTER RESOURCE COST command. DBArtisan provides a visual interface for constructing such a command.

Altering Resource Cost

1 On the Utilities menu, click Alter Resource Cost.

DBArtisan opens the Alter Resource Cost dialog box.

The table below describes the options and functionality on the Alter Resource Cost dialog box:

Option

Weightings

Enable Resource Limits

Description

In the box, specify the weightings for each resource limit by typing the weight value in the corresponding box: Connect time, Private SGA, CPU per session, or Logical reads per session.

Select to To enable the resource limit changes immediately.

83 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SE SSI ON INF OR M A T IO N > S ES SI ON I N FO R M ATI ON

S

ESSION

I

NFORMATION

Oracle tracks detailed information about the resources used by each session on a database. This information is useful for analyzing resource utilization patterns between user sessions to monitor performance.

The information displayed is derived from the Oracle system tables, SYS.V_$STATNAME and

SYS.V_$SESSTAT. Consult the Oracle documentation or detailed descriptions in the meanings of each session parameter.

TIP:

Waits lets you analyze bottlenecks and discover what a database is waiting on.

V

IEWING

S

ESSION

I

NFORMATION

1 On the Utilities menu, click Session Information.

DBArtisan opens the User Session Information dialog box.

2 Complete the User Session Information Dialog Box .

3 When you finish viewing SQL, click Close to return to the User Session Information dialog box.

4 When you finish viewing the session information, click Close.

R

ESOURCE

L

IMITS

Resource limits are sets of parameters that let you maximize your datasource assets. By setting resource limits, you can prevent transactions and queries from congesting server resources. This ensures that you do not:

• Exceed estimated or actual input/output demands determined by the optimizer.

• Return a number of rows beyond a set limit.

• Exceed a defined elapsed time.

DBArtisan includes the Resource Limits dialog box that lets you perform the following tasks:

• Showing Resource Limits

• Adding Resource Limits

• Editing Resource Limits

• Dropping Resource Limits

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 833

RE SOURCE LI MI TS > RE SO URC E LI MITS

Opening the Resource Limits Dialog Box

You must connect to a datasource running Sybase before you can open the Resource Limits dialog box. To open the Resource Limits dialog box, do the following:

1 On the Datasource Explorer, select the target datasource node.

2 On the Utilities menu, click Resource Limits.

DBArtisan opens the Resource Limits dialog box.

The table below describes the columns in the Resource Limits table of the Resource Limits dialog box:

Column name appname rangename rangeid limitid limitvalue enforced action scope

Description

The login name for the resource limit.

The application for the resource limit.

The time range in which the resource limit is enforced. The time range is a contiguous block of time.

The value of the rangename.

The value and type of the resource limit.

The value of the resource limit.

The value and enforcement time for the resource limit.

The code number of the action for the resource limit. The codes numbers are:

1=Issue a warning

2=Abort the query batch

3=Abort the transaction

4=Kill the session

The code number of the scope for the resource limit. The codes numbers are:

1=Query

2=Query batch

4=Transaction

6=Batch and transaction

S

HOWING

R

ESOURCE

L

IMITS

DBArtisan displays all resource limits for the current datasource. In addition, DBArtisan lets you use the Resource Limits dialog box to search for and display specific resource limits. In the

Resource Limits dialog box, you can specify search criteria for resource limits. DBArtisan displays the resource limits that meet your search criteria in the Resource Limits table of the Resource

Limits dialog box.

83 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

R E S O U RC E L I M I TS > R E S O U RC E L I M I T S

Displaying Resource Limits

1 On the Datasource Explorer, select the target datasource node.

2 On the Utilities menu, click Resource Limits.

DBArtisan opens the Resource Limits dialog box.

3 Specify the search parameters. The table below describes the search parameters in the

Resource Limits dialog box:

Parameter

Login list

Application list

Limit Time check box

Limit Time list

Description

Lets you specify the target login or logins.

Lets you specify an application or applications for the limit criteria.

Lets you specify a time range in which to enforce the resource limit.

Limit Day list

Scope list

Action list

Lets you specify a start time for the resource limit. The start time must be within the proceeding 24 hours. To specify the start time, you must select the Limit Time check box.

Lets you specify the day or day(s) for the resource limit.

Lets you specify the scope of the target action(s). On the Scope list, the numbers next to each scope display in the scope column of the Resource Limits table.

Lets you specify the action to take place when a resource limit is exceeded. On the Action list, the numbers next to each action display in the action column of the Resource Limits table.

4 When you finish specifying search parameters, click List Limits.

DBArtisan lists the resource limits meeting the target criteria in the Resource Limits table.

TIP:

To sort the display of the Resource Limits list, click a column heading.

A

DDING

R

ESOURCE

L

IMITS

DBArtisan offers a simple graphical wizard that guides you through the process of creating a resource limit without requiring your to know any of the underlying commands.

Starting the Resource Limit Wizard

1 On the Datasource Explorer, select the target datasource node.

2 On the Utilities menu, click Resource Limits.

DBArtisan opens the Resource Limits dialog box.

3 In the Resource Limits dialog box, click Add.

DBArtisan opens the

Resource Limit Wizard - Panel 1

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 835

RE SOURCE LI MI TS > RE SO URC E LI MITS

R

ESOURCE

L

IMIT

W

IZARD

- P

ANEL

1

The first panel of the Resource Limit Wizard lets you identify the objects to which the resource limit will apply.

The table below describes the options and functionality on the first panel of the Resource Limit

Wizard:

Option

Add Button

Edit Button

Description

Click to open the Add/Edit Resource Limit Object Dialog Box .

Click to open the Add/Edit Resource Limit Object Dialog Box .

A

DD

/E

DIT

R

ESOURCE

L

IMIT

O

BJECT

D

IALOG

B

OX

The table below describes the options and functionality on the Add/Edit Resource Limit Object dialog box:

Option

Login

Application

Description

Lets you click the list, and then click the target user login.

Click the list, and then click the target application.

R

ESOURCE

L

IMIT

W

IZARD

- P

ANEL

2

The second panel of the Resource Limit Wizard lets you specify:

• The type of resource limit.

• The value of the resource limit type.

• The time during which the limit will be enforced.

The table below describes the options and functionality on the second panel of the Resource

Limit Wizard:

Option

Select the type of resource limit

Limit Value box

Time Range

Modify, Add, and Edit buttons

Pre-execution

Execution

Description

Lets you specify the type of resource limit by clicking one of the following option buttons:

Input/output cost, Elapsed time, or Row count.

NOTE: You must type the value for the limit to continue.

Lets you click the list, and then click the target named range.

Click to add or edit a named time range. DBArtisan opens the Named Time Ranges

Dialog Box

.

To specify the execution times during which the limit will be enforced, select the target check box(es):

To specify the execution times during which the limit will be enforced, select the target check box(es):

83 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

R E S O U RC E L I M I TS > R E S O U RC E L I M I T S

N

AMED

T

IME

R

ANGES

D

IALOG

B

OX

A time range is a contiguous set of days. For example if you designate a Friday start day and a

Monday end day, the time range includes the weekend.

The table below describes the options and functionality on the Named Time Ranges dialog box:

Option

Name

Start time

End time

Start day

End day

Description

In the box, type a name for the new time range.

In the box, specify the start time.

In the box, specify the end time.

In the box, specify the beginning of the time range.

In the box, specify the end of the time range.

R

ESOURCE

L

IMIT

W

IZARD

- P

ANEL

3

The third panel of the Resource Limit Wizard lets you specify the scope of the resource limit and the action to perform when the limit is exceeded. The available scopes are dependent on the type of resource limit you selected on the previous panel of the wizard.

The table below describes the types and available scopes:

Resource Limit Type

Input/output cost

Elapsed time

Row count

Available Scope

Query

Query batch, Transaction, and Query batch and transaction

Query

The table below describes the options and functionality on the third panel of the Resource Limit

Wizard:

Option

Scope

Action

Description

Click one of the option buttons to specify the scope of the resource limit:

Query

Query batch

Transaction

Query batch and transaction

Click one the following option buttons to specify the action to take when the resource limit is exceeded: Issue a warning, Abort the query batch, Abort the transaction, or

Kill the session.

R

ESOURCE

L

IMIT

W

IZARD

- L

AST

P

ANEL

The last panel of the Resource Limit Wizard lets you:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 837

RE SOURCE LI MI TS > RE SO URC E LI MITS

• Preview the SQL for function that adds the resource limit.

• Execute the SQL for function that adds the resource limit.

Completing the Last Panel

1 Review the SQL.

2 Click Execute.

E

DITING

R

ESOURCE

L

IMITS

DBArtisan lets you edit resource limits. To edit resource limits, do the following:

1 On the Datasource Explorer, select the target datasource node.

2 On the Utilities menu, click Resource Limits.

DBArtisan opens the Resource Limits dialog box.

3 In the Resource Limits grid, select the target resource limit.

4 Click Edit.

DBArtisan opens the Resource Limit Editor.

5 To modify the limit value, in the Limit Value box edit the value.

6 To change the type of action, click a different option button.

7 Click OK.

D

ROPPING

R

ESOURCE

L

IMITS

DBArtisan lets you drop resource limits. To drop resource limits, do the following:

1 On the Datasource Explorer, select the target datasource node.

2 On the Utilities menu, click Resource Limits.

DBArtisan opens the Resource Limits dialog box.

3 In the Resource Limits grid, select the target resource limit.

4 Click Drop.

DBArtisan opens a confirm drop message.

5 Click Yes.

83 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

TOP S ES SI ON S > TO P SE SS IO N S

T

OP

S

ESSIONS

Being able to identify the top resource users in an Oracle system is a valuable tuning asset. The

Top Sessions Options Dialog Box

lets you quickly pinpoint the heaviest users of I/O and memory usage. The Top Sessions utility quickly finds and ranks user sessions based on their resource usage.

Opening the Top Sessions Dialog Box

1 On the Utilities menu, click Top Sessions.

DBArtisan opens the Top Sessions dialog box.

The table below describes the options and functionality on the Top Sessions dialog box.

TIP:

Click the Options button to open the

Top Sessions Options Dialog Box

.

T

OP

S

ESSIONS

O

PTIONS

D

IALOG

B

OX

The table below describes the options and functionality on the Top Sessions Options dialog box:

Option Description

Exclude Sys and System Select to force the query used to display top session data to be changed.

Exclude Background Process Select to force the query used to display top session data to be changed.

Limit Top Session Display to Lets you specify the number of sessions to display. These options will force the query used to display top session data to be changed.

No Limit

Sort Top Sessions By Lets you custom soft the display

U

SER

S

ESSION

I

NFORMATION

D

IALOG

B

OX

The table below describes the options and functionality on the User Session Information dialog box:

Option

User

OS User Name

Session ID

Machine Name

Status

Terminal Name

Command

Description

Lets you select a user.

Displays the operating system user name.

Lets you select the application.

Displays the name of the datasource.

Displays the session status.

Displays the terminal name.

Displays the command.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 839

TOP SES SI ON S > TO P S ESS IO N S

Option

Program

Client Platform

Client Protocol

Session Parameters

User Session Information Dialog

Box - Statistical Details tab

User Session Information Dialog

Box - Waits Tab

User Session Information Dialog

Box - Current SQL Tab

Description

Displays the program used.

IBM DB2 FOR WINDOW/UNIX ONLY: Lets you select the client platform.

IBM DB2 FOR WINDOW/UNIX ONLY: Lets you select the client protocol.

IBM DB2 FOR WINDOW/UNIX ONLY: Lets you select the session parameters.

ORACLE ONLY: Displays statistical details.

ORACLE ONLY: Displays waits.

ORACLE ONLY: Displays the current SQL.

U

SER

S

ESSION

I

NFORMATION

D

IALOG

B

OX

- S

TATISTICAL

D

ETAILS TAB

The table below describes the options and functionality on the Statistical Details Tab of the User

Session Information Dialog Box:

Option

Statistical Details grid

Description

Displays the session parameters and value (if any).

U

SER

S

ESSION

I

NFORMATION

D

IALOG

B

OX

- W

AITS

T

AB

The table below describes the options and functionality on the Statistical Details Tab of the User

Session Information Dialog Box:

Option

Historical Waits

Current Waits

Include Idle Waits

Waits grid

Description

If selected, displays historical waits in the waits grid.

If selected, displays current waits in the waits grid.

If selected, displays idle waits in the waits grid.

Displays the wait information, including Session ID, Event,

Seconds in Wait, Wait Time, State, and other information.

U

SER

S

ESSION

I

NFORMATION

D

IALOG

B

OX

- C

URRENT

SQL T

AB

The table below describes the options and functionality on the Statistical Details Tab of the User

Session Information Dialog Box:

Option

SQL box

Description

Displays current SQL.

84 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

T

OOLS

DBArtisan incorporates a number of powerful tools to help you create, edit and manage your development environment. You can use Tools to:

• Conduct extensive database searches across multiple databases.

• Execute scripts or files across multiple databases.

• Schedule tasks.

• Identify differences in files or objects.

• Graphically build complex queries.

• Administer your ODBC datasources.

Tools is divided into sections. The table below describes each section:

Section

Find In Files

Description

This section describes the Find in Files dialog box that lets you find a phrase or character in your files.

Database Search

Script Execution Facility

This section describes the Script Execution Facility, a stand-alone utility that establishes multiple threads and database connections letting you simultaneously execute SQL statements against multiple Oracle, Sybase Adaptive Server, Microsoft SQL Server, and

IBM DB2 for Linux, Unix, and Windows datasources.

File Execution Facility

This section describes the powerful database search utility that helps you to find instances of a string across multiple databases.

This section describes the File Execution Facility, a stand-alone utility that establishes multiple threads and database connections that lets you execute parallel queries and

ANSI SQL files against multiple, cross-platform datasources.

Scheduling

Visual Difference

Query Builder

Import Data

Data Editor

The DBArtisan scheduling programs and utilities let you schedule and execute jobs on local datasources anytime.

DBArtisan lets you compare two files or database objects. Using the Visual Difference

Utility, you can easily synchronize and analyze database objects or files across multiple database platforms.

This section describes Query Builder, a tool that lets you construct, structure, and manipulate up to five different types of queries simultaneously.

How to bring data from an external source into a database table is described. You can import data from a text file or a Microsoft Excel document.

This section describes the Data Editor to edit your tables in real-time. The Data Editor supports all editable datatypes and is an alternative way to add, edit, or delete data from your tables.

Embarcadero Products

Code Workbench

The Tools menu lists all installed Embarcadero Technologies products. This lets you toggle to or start another Embarcadero product.

This section describes the Code Workbench that lets you define auto replacement expressions that can be used to quickly insert commonly used blocks of SQL syntax or commands in any open window and to import and export Code Workbench specific settings for client sharing purposes.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 841

FI ND I N F ILES > FI ND I N FI LES

F

IND

I

N

F

ILES

The Find in Files dialog box lets you find a phrase or character in your files.

Completing the Find in Files Dialog Box

1 On the Tools menu, click Find in Files.

DBArtisan opens the Find in Files dialog box.

The table below describes the options and functionality on the Find in Files dialog box.:

Option

Find what

Description

Specifies the character(s) or phrase you want to find. Use the browse arrow button next to the textbox to choose options from a pop-up list.

In files/file types

In folder

Specifies the files in which to search for the character(s) or phrase. Either enter the filename(s) in the drop-down box, or click the arrow to choose a file type.

Specifies the directory where the file(s) is located. Click the browse button to view your

Windows Explorer.

Match whole word only Specifies the application to find only the entire phrase.

Match case

Regular Expression

Look in subfolders

Specifies the application to find only the specified phrase in the case you have entered.

Tells the application whether the specified character(s) is a regular expression.

Output to Pane 2

Specifies the application to search the file(s) any folders located within the specified folder.

Specifies the application to display the results in another window.

NOTE:

You can also use the Find feature to locate a phrase or character in an ISQL window.

D

ATABASE

S

EARCH

The powerful database search utility helps you to find instances of a string across multiple databases.

Starting the Database Search Wizard

1 On the Tools menu, click Database Search.

DBArtisan opens the

Database Search Wizard - Panel 1

.

D

ATABASE

S

EARCH

W

IZARD

- P

ANEL

1

The first panel of the Database Search Wizard lets you specify the owner.

84 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

DATA BA SE S EA RCH > DA TA BA SE SE ARC H

The table below describes the options and functionality on the first panel of the Database

Search Wizard:

Option

Select the datasource(s) you want to search

Description

Search however many datasources you want. You can search more than one platform at a time and specific owners within each datasource.

1 Click Next.

DBArtisan opens the next panel of the wizard.

D

ATABASE

S

EARCH

W

IZARD

- P

ANEL

2

The second panel of the Database Search Wizard lets you specify the search criteria.

The table below describes the options and functionality on the second panel of the Database

Search Wizard:

Option

Search Database

For

Match Case

Search DDL of these

Objects

Description

Lets you enter the search string.

Strings can also be searched for using DB2-standard wildcards. And for multiple string searches, separate each string with a vertical bar (for example,

DEPARTMENTS|wage_cap|status). When searching for strings that already contain vertical bars, enclose each string in double quotation marks.

Select Yes to make the search case sensitive.

NOTE: IBM DB2 for OS/390, searches are always case insensitive.

In the grid, select the target object check boxes.

NOTE: Event Monitors are available for IBM DB2 for Linux, Unix, and Windows only.

1 Click Execute to start the operation.

DBArtisan displays a progress dialog box while the search runs. When the search completes,

DBArtisan opens the

Database Search Results

window.

D

ATABASE

S

EARCH

R

ESULTS

DBArtisan displays Database Search operation results in a Database Search Window, listing all of the objects containing the search string in the left pane. You can browse instances of the search string by selecting different objects in the tree. The DDL of the objects displays in the right pane and the search string is highlighted.

The table below describes the buttons on the Database Search Window toolbar:

Button

Search

Description

Opens the first panel of the Database Search Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 843

S C RI P T E X E C U T IO N F A C I L IT Y > S C RI P T E X E C U T IO N F A C I L IT Y

Button

Criteria

Open

Extract

Print

Description

Opens the Search Criteria dialog box.

Opens the editor for the target object.

Lets you extract the target object.

Lets you print the target object SQL.

S

CRIPT

E

XECUTION

F

ACILITY

DBArtisan’s Script Execution Facility is a stand-alone utility that establishes multiple threads and database connections letting you simultaneously execute SQL statements against multiple

Oracle, Sybase Adaptive Server, Microsoft SQL Server, and IBM DB2 for Linux, Unix, and

Windows datasources. After completing a scheduled job, DBArtisan generates a results report that lists errors, verifies script execution, and details the output of the job. The Script Execution

Facility also works in conjunction with DBArtisan’s scheduling facilities, letting you schedule script execution jobs. When used in conjunction with a scheduler, DBArtisan can automatically send the results report to any e-mail or network recipients. The Script Execution Facility is a tabbed dialog box where you set the parameters and options for the script execution. In the

Script Execution Facility dialog box you can:

• Type or paste the target SQL script.

• Specify the datasources against which to execute the script.

• Specify the output mode for the results report.

• Open a scheduling program to schedule the script execution.

• Specify execution notification e-mail and Net Send addresses.

For more information, see

File Execution Facility

.

F

ILE

E

XECUTION

F

ACILITY

DBArtisan’s File Execution Facility is a stand-alone utility that establishes multiple threads and database connections that lets you execute parallel queries and ANSI SQL files against multiple, cross-platform datasources. The Script Execution Facility also works in conjunction with

DBArtisan’s scheduling facilities, letting you schedule script execution jobs. After completing a scheduled job, DBArtisan generates a results report that lists errors, verifies execution, and details the output of the job. When used in conjunction with a scheduler, DBArtisan can automatically send the results report to any e-mail or network recipients. The File Execution

Facility is a tabbed dialog box where you set the parameters and options for the file execution.

In the File Execution Facility dialog box you can:

• Specify the target files or ANSI SQL scripts.

• Specify the datasources against which to execute the files.

84 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

FI LE E XEC UTI ON FA CILI TY > F IL E E X E C U T I O N F AC I L I T Y

• Specify the output mode for the results report.

• Open one of the DBArtisan scheduling programs to schedule the file execution.

• Specify execution notification e-mail and Net Send addresses.

Completing the Script/File Execution Facility

DBArtisan lets you run parallel queries against multiple datasources with the File Execution

Facility.

1 On the Tools menu, click Script Execution Facility or File Execution Facility.

DBArtisan opens the Script or File Execution Facility dialog box.

2 Complete the Script Execution Facility - Script Tab

3 Complete the File Execution Facility - Files Tab

4 Complete the File/Script Execution Facility - Target Tab

5 Complete the File/Script Execution Facility - Output Tab

6 Complete the File/Script Execution Facility - Notify Tab

For more information, see

Script Execution Facility

.

S

CRIPT

E

XECUTION

F

ACILITY

- S

CRIPT

T

AB

The table below describes the options and functionality on the Script Tab of the File/Script

Execution Facility:

Option

Script box

Description

Lets you type or paste a script.

For more information, see:

File Execution Facility

Script Execution Facility

F

ILE

E

XECUTION

F

ACILITY

- F

ILES

T

AB

The table below describes the options and functionality on the Files Tab of the File Execution

Facility:

Option

Show Full File Paths

Description

Select to display the full path. Deselect to display only the file name.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 845

FI LE E XEC UTI ON FA CILI TY > F ILE EX ECUTIO N F AC ILI TY

Option

File Name

Add

Remove

View

Up

Down

For more information, see:

File Execution Facility

Script Execution Facility

Description

Displays the file names.

Click to open the Select Files dialog box.

Click to remove the selected file.

Opens the View File dialog box.

Click to move the selected file up in the list.

Click to move the selected file down in the list.

F

ILE

/S

CRIPT

E

XECUTION

F

ACILITY

- T

ARGET

T

AB

The table below describes the options and functionality on the Target Tab of the File/Script

Execution Facility:

Option

Select the Target

Datasource(s) to Execute the

Script Against

Datasource grid

Description

Only Connected Datasources - Displays only datasources that are currently connected in the Datasource grid.

All DBMS Types - Displays all DBMS types in the Datasource grid.

Displays the target datasource(s) to execute the script/file against. Select a datasource name. If the datasource has multiple databases, type in a database in the

Database box.

For more information, see:

File Execution Facility

Script Execution Facility

F

ILE

/S

CRIPT

E

XECUTION

F

ACILITY

- O

UTPUT

T

AB

The table below describes the options and functionality on the Output Tab of the File/Script

Execution Facility:

Option

Graphical Output

Description

If selected, specifies a graphical output.

84 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S C H E D U L I N G > S C H E D U L I N G

Option

File Output

Description

If selected, specifies a file output.

Directory - Type or browse to enter the full path and directory name in which you want to place the output file.

File Type - Specifies a file type.

Include column titles when saving - If selected, lets you save column titles.

Open files with registered applications - If selected, opens files with registered applications.

For more information, see:

File Execution Facility

Script Execution Facility

F

ILE

/S

CRIPT

E

XECUTION

F

ACILITY

- N

OTIFY

T

AB

The table below describes the options and functionality on the Notify Tab of the File/Script

Execution Facility:

Option

Job Description

E-mail address

Net Send User Names

Description

Lets you enter a job description. This description will be the subject of the notification Email.

Lets you enter E-mail addresses. Separate each E-mail address with a semicolon (;).

Lets you enter net send user names. Separate each name with a semicolon (;).

For more information, see:

File Execution Facility

Script Execution Facility

S

CHEDULING

The DBArtisan scheduling programs and utilities let database administrators schedule and execute jobs on local datasources 24-hours-a-day, 7-days-a-week.

DBArtisan offers the following programs and utilities to let you schedule routine tasks and jobs:

• Microsoft Task Scheduler

• ETSQLX Command Line Utility

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 847

V I S U A L D I FFE RE N C E > V IS U A L D I FF E RE N C E

M

ICROSOFT

T

ASK

S

CHEDULER

DBArtisan lets you use the Microsoft Task Scheduler to schedule jobs. The Microsoft Task

Scheduler is included with various Microsoft applications. If you do not have this program on your system, the first time you attempt to schedule a job, DBArtisan provides you with a link to the Microsoft Web site where you can download the Microsoft Task Scheduler at no cost.

NOTE:

DBArtisan’s ETSQLX command line utility runs a scheduled job even if DBArtisan is not

running. For more information, see ETSQLX Command Line Utility

.

To open the Microsoft Job Scheduler from within DBArtisan

1 On the Tools menu, click Scheduler.

2 Use the associated online Help for assistance with using this Microsoft utility.

ETSQLX C

OMMAND

L

INE

U

TILITY

DBArtisan’s ETSQLX command line utility, is a multi threaded, cross-platform, SQL scripting engine. You can use ETSQLX in conjunction with the Microsoft Task Scheduler to schedule and automate routine jobs. ETSQLX creates batch files (with the extension.cfg) containing commands to execute automated and scheduled jobs. ETSQLX creates a directory, CFG, in which it stores the.cfg files. You can run.cfg files directly from the command line.

NOTE:

ETSQLX supports.csv, .tab, .htm, and.html formats for result reports attachments.

V

ISUAL

D

IFFERENCE

DBArtisan lets you compare two files or database objects. Using the Visual Difference dialog box, you can easily synchronize and analyze database objects or files across multiple database platforms. The files are displayed side by side in the Visual Difference dialog box. The Visual

Difference Utility highlights any differences between two files. Viewing differences between objects and files helps you negotiate between the different phases of development as well as providing a visual aid to rapidly changing and evolving production environments.

NOTE:

Because contents of the Visual Difference dialog box are read-only, you will not be able to modify your files or objects directly from this dialog box.

The Visual Difference dialog box is composed of two panes; the left pane displays your source object or file and the right pane shows your target object or file. The Visual Difference dialog box also contains its own toolbar which lets you:

• Search

• Navigate differences

• Set options

• Print

84 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Opening the Visual Difference Dialog Box

1 On the Tools menu, click Visual Diff.

DBArtisan opens the Visual Difference dialog box.

For more information, see:

Comparing Files

Comparing Database Objects

Navigating in the Visual Difference Dialog Box

Printing a Pane of the Visual Difference Dialog Box

Searching in the Visual Difference Dialog Box

Setting Options in the Visual Difference Dialog Box

V IS UA L D I FFE RE N C E > V I SU A L D IFF E RE N C E

C

OMPARING

F

ILES

You can compare two files side-by-side in the Visual Difference dialog box. The file you want to compare is called the Source. The file you want to compare the first file to is the Target.

Comparing Items

1 On the Tools menu, click Visual Diff.

DBArtisan opens the Visual Difference dialog box.

2 On the Visual Difference toolbar, click the Source icon or click the Down arrow next to the

Source icon and then click File.

DBArtisan opens the Select the 1st File to Compare dialog box.

3 Click the file that you want to be the Source file.

4 On the Visual Difference toolbar, click the Target icon or click the Down arrow next to the

Target icon and then click File.

DBArtisan opens the Select the 2nd File to Compare dialog box.

NOTE:

The Visual Difference Utility highlights all differences between the two files.

For more information, see

Visual Difference

C

OMPARING

D

ATABASE

O

BJECTS

The schema of database objects is automatically extracted so you can view the underlying differences between object and perform a side-by-side comparison in the Visual Difference

Dialog.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 849

V I S U A L D I FFE RE N C E > V IS U A L D I FF E RE N C E

Comparing Database Objects

1 On the Tools menu, click Visual Diff.

DBArtisan opens the Visual Difference dialog box.

2 On the Visual Difference toolbar, click the Down arrow next to the Source icon and then click

Database Object.

DBArtisan opens the Select the 1st Database Object to Compare dialog box.

3 Click the datasource and then click OK to connect.

4 Navigate through the datasource tree and double-click the database object that you want to be the Source.

5 On the Visual Difference toolbar, click the Down arrow next to the Target icon and then click

Database Object.

DBArtisan opens the Select the 2nd Database Object to Compare dialog box.

NOTE:

The Visual Difference Utility highlights all differences between the two database objects.

For more information, see

Visual Difference

N

AVIGATING IN THE

V

ISUAL

D

IFFERENCE

D

IALOG

B

OX

You can navigate through the Visual Difference dialog box using the up and down arrow buttons.

You can move back and forth between highlighted differences in your compared files or database objects.

Going To the Next Difference

1 From the Visual Difference dialog box, click down arrow to go to the next difference.

Going To the Previous Difference

1 From the Visual Difference dialog box, click up arrow to go to the next difference.

For more information, see

Visual Difference

P

RINTING A

P

ANE OF THE

V

ISUAL

D

IFFERENCE

D

IALOG

B

OX

You can print each pane of the Visual Difference dialog box.

85 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

V IS UA L D I FFE RE N C E > V I SU A L D IFF E RE N C E

Printing a Pane of the Visual Difference Dialog Box

1 Position your cursor inside the pane you want to print.

2 Click the Print icon on the Visual Difference toolbar.

DBArtisan opens the Print Setup dialog box.

3 Click OK to print the pane.

NOTE:

You can only print one pane of the Visual Difference dialog box at a time.

For more information, see

Visual Difference

S

EARCHING IN THE

V

ISUAL

D

IFFERENCE

D

IALOG

B

OX

The Visual Difference dialog box lets you search for text in your files or database objects.

Searching for Text

1 Place your cursor inside the pane you want to search.

2 Click the Find icon on the Visual Difference toolbar.

DBArtisan opens the Find dialog box.

3 In the Find What box, enter the search string.

4 To match whole words only, select the Match whole word only check box.

5 To make the search case sensitive, select the Match case check box.

6 Click Find Next to find the next occurrence of your search string. You can also click the Find

Next icon on the Visual Difference toolbar to search for the next occurrence at a later time.

For more information, see

Visual Difference

S

ETTING

O

PTIONS IN THE

V

ISUAL

D

IFFERENCE

D

IALOG

B

OX

The Visual Difference dialog box lets you set display and comparison options to help you customize the dialog box to view differences in a comprehensive manner.

Setting Options

1 Click the Options icon on the Visual Difference toolbar.

DBArtisan opens the Visual Diff Options dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 851

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

The following table describes the check box options:

Option

Display Line Numbers

Display Hidden

Characters

Ignore White Space

Description Default

Indicates that line numbers should appear in the Visual Diff dialog box. Off

Indicates that hidden characters (nonprintable) should be displayed.

Off

Indicates that White Space (such as spaces, carriage returns, line feeds, and tabs) should be ignored. If this option is set on, text will be considered equivalent regardless of white space, otherwise the text will be shown as being different.

Indicates that hidden characters (nonprintable) should be excluded.

On

Off Ignore Hidden

Characters

Ignore Case Indicates that case should not be a differentiating factor.

On

2 Click OK.

DBArtisan accepts the options.

For more information, see

Visual Difference

Q

UERY

B

UILDER

Query Builder is a database productivity tool that lets you construct, structure, and manipulate up to five different types of queries simultaneously. It includes a separate graphical interface that opens within your current workspace. You can run Query Builder against all Embarcadero

Technologies supported database platforms.

Query Builder displays the interconnections of your queries as you work. The powerful visual components of Query Builder let you see your query grow and change to fit your needs. Query

Builder eases the task of drawing data from tables by automatically creating correct SQL code as you build a statement. You can use Query Builder to create and execute SELECT statements for tables and views. You can also test queries, and easily adjust your information, before you save.

Query Builder does not rely on knowledge of the underlying SQL code.

You can save and reopen queries in Query Builder. Query Builder automatically checks for changes in your tables or columns between the time you save the query and the time you reopen it.

85 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

The table below describes the types of queries available in Query Builder:

Query Type

Building a SELECT Statement

Building an INSERT Statement

Building an UPDATE Statement

Building a DELETE Statement

Building a CREATE VIEW Statement

Description

Create, manipulate and execute SELECT Statements for tables and views.

Create and manipulate INSERT Statements for tables.

Create and manipulate UPDATE Statements for tables.

Create and manipulate DELETE Statements for tables.

Create and manipulate CREATE VIEW Statements for tables and views.

NOTE:

You can execute SELECT statements directly from Query Builder. INSERT, UPDATE,

DELETE, and CREATE VIEW statements must be moved to an ISQL Editor for execution.

For more information, see:

Query Builder Design

Using Query Builder

Q

UERY

B

UILDER

D

ESIGN

Query Builder lets you build DML statements using an intuitive, graphical interface. It offers you a powerful and flexible way to quickly create complex statements without sacrificing time manipulating SQL code. Query Builder lets you add tables or columns, create joins, and change statements within the graphic display without leaving DBArtisan. It also lets you have multiple sessions working at the same time.

Query Builder includes many different features to assist you in building and manipulating your query:

• Statement Properties

• Workspace Windows

• Query Builder Explorer Window

• Query Builder Toolbar

• SQL Diagram Pane

• SQL Statement Pane

For more information, see

Query Builder

W

ORKSPACE

W

INDOWS

The Workspace Windows provide a comprehensive view of your data structure and query. The table below describes the Workspace Windows:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 853

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

Pane

Query Builder Explorer

Window

SQL Diagram Pane

SQL Statement Pane

Description

Includes two tabs that display selected object details:

Tables/Views

DML

Displays tables or views included in the current query.

Displays the SQL code, and when appropriate, a Results Tab.

For more information, see

Query Builder

Q

UERY

B

UILDER

E

XPLORER

W

INDOW

The Query Builder Explorer is a separate tree that exposes all the tables and views in your target database. It also displays your current query structure. The Query Builder Explorer includes two tabs that display information about the selected objects:

Tables/Views Tab

The Tables/View Tab displays information about the selected tables or views. You can use the drop-down lists to change your table or view, and when appropriate, the owner. The table below describes each drop-down list on the Tables/Views Tab:

List

First

Second

Description

Displays all databases for a target Microsoft SQL Server or Sybase ASE.

Displays all valid owners.

NOTE:

To change your current database, select the new database in the Explorer, and then open another Query Builder session. Query Builder prompts you to save the current

session prior to opening a new session. For details, see Saving and Reopening Queries

.

DML Tab

The DML Tab displays all the basic elements of a query statement in the SQL Statement Tree.

You can access any element of the current statement display and perform SQL editing from the

SQL Statement Tree.

For more information, see:

Creating a Clause Using the SQL Statement Tree

Query Builder

85 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

SQL D

IAGRAM

P

ANE

The SQL Diagram Pane displays tables, views, and joins included in the current query. You can manipulate elements of your query, using the mouse functionality, in the SQL Diagram Pane.

From the SQL Diagram Pane you can:

Working with Tables and Views in the SQL Diagram Pane

Joins

Working with Columns in the SQL Diagram Pane

All changes in the SQL diagram reflect in correct SQL code in the SQL Statement Pane.

For more information, see

Query Builder

SQL S

TATEMENT

P

ANE

The SQL Statement Pane displays the current query SQL code. When you run a query, Query

Builder displays results to your query in the SQL Statement Pane. The SQL Statement Pane is divided into two tabs:

SQL Tab

The SQL Tab displays the query in progress. It displays each element of your query as you build it, and updates as you do edits such as selecting or deselecting columns, adding clauses, and creating joins. DBArtisan lets you open the current statement directly into an ISQL editor or copy it to the clipboard for later use.

Results Tab

The Results Tab displays the results of your executed query in the Results grid. To edit data, use the Data editor application from Query Builder. When you begin building a new query, the tab

title changes to Old Results until you execute the new query. For details, see Using Data Editor with Query Builder

.

For more information, see

Query Builder

Q

UERY

B

UILDER

T

OOLBAR

The Query Builder tool bar lets you access commonly used features.

The table below describes Query Builder tool bar functionality:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 855

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

Name

Copy

Statement Box

Stop Execution

Execute

New

Edit

Delete

Auto Layout

Auto Join

Statement Check

Edit Data

Close

Function

Copies the current SQL statement to the clipboard.

Displays the type of statement currently on display in the main workspace window.

Stops an executing query.

Executes the current SELECT or CREATE VIEW statement. If the button is not available, the statement is not executable.

Adjusts to the target node in the Query Builder Explorer window.

Displays, on the DML Tab, the ORDER BY or GROUP BY dialog boxes when target node is selected.

Deletes the target object.

Resets the main workspace to the auto layout mode.

Finds and joins, automatically, like items by name.

Checks query syntax.

Opens Data Editor.

Closes the current query.

NOTE:

Query Builder adjusts tool availability to match the current query functionality.

For more information, see

Query Builder

.

T

ABLES AND

V

IEWS

S

HORTCUT

M

ENUS

Query Builder includes a shortcut menu that lets you manipulate a table or view. The table below describes the table shortcut options:

Option

Delete

Title Font

Column Font

Background Color

Select Star

Select None

Bring to Front

Properties

Description

Removes the table from the SQL Diagram Pane, and the SQL

Statement.

Specifies the table title font for this diagram.

Specifies the column font for this diagram.

Specifies the table background color for this diagram.

Selects every column in the table.

Deselects every column in the table.

Moves the table to the top layer of the diagram.

For more information, see Table Properties

.

NOTE:

Your selection applies to all selected tables and views.

85 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

For more information, see

Query Builder

T

ABLES AND

V

IEWS

K

EYBOARD

C

OMMANDS

Query Builder provides a number of keyboard shortcuts that let you quickly construct queries.

The table below describes the keyboard commands:

Keyboard Command Location

ESCAPE SQL Diagram Pane

F5 Query Builder

CTRL A

F1

SQL Diagram Pane

Query builder and application

Description

Breaks off a join.

Refreshes screen and runs Schema Change Detection. In a CREATE VIEW, this key adds the new view to the Table

Tree Pane.

Selects all tables and joins in the current diagram.

Obtains context sensitive Help.

For more information, see

Query Builder

Q

UERY

B

UILDER

D

IALOG

B

OXES

Query Builder includes a number of dialog boxes to assist you in building and customizing your query.

Dialog Box

Statement Properties

Table Properties

Column Properties

Description

Specifies general properties in an individual Query Builder session.

Specifies column selection and alias names for a table or view.

Specifies column functionality within SELECT and CREATE VIEW statements.

For more information, see

Query Builder

S

TATEMENT

P

ROPERTIES

The Statement Properties dialog box lets you customize properties in an individual Query

Builder session. For example, you can set options to limit the number of rows returned in a query to save execution time, or turn off the auto join function to manually control all joins for an individual query. These properties override the global options set in the Options editor for the current session. For details, see

Query Builder Options .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 857

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

The table below describes the options and functionality of the Statement Properties dialog box.

Interface

Element

Code

Generation

Option

Generate Use

Database statement

Generate owner names

Include Row

Count limits

Description

Adds a line of SQL code indicating which database or instance is used in the statement.

Adds a line of SQL code showing the table owner name as part of the query.

Includes the output row limit set in the Execution settings.

Default

Selected

Selected

Selected

Execution Max Row Count in Results Set

Sets row count limits to build and check a query without congesting server processes when a query executes.

1000 rows

General

Auto Join

Show Column

Data types in

Query Diagram

Confirm on

Item delete

Lets Query Builder reveal the data type in each column for tables in the SQL Diagram Pane.

Lets Query Builder open a Confirm Delete dialog box when an item is deleted.

NOTE: Clearing this function can result in unexpected changes to your query diagram and statement.

Auto populate views

Require same data type

Lets Query Builder automatically populate views.

Require Indexes Joins indexed columns automatically, and requires indexed columns for joins.

Automatically joins columns with the same data type.

Syntax Checker Automatic

Syntax Check

Display

Run

Automatically

Lets Query Builder check syntax every time an execute statement, refresh or copy statement begins.

Lets Query Builder automatically detect like names and data types and create joins for multiple tables.

Columns Font Lets you set the font, font style, size, and color of column fonts.

Title Font

Not selected

Selected

Not selected

Selected

Selected

Selected

Selected

Available

Available

Table Color

Lets you set the font, font style, size, and color of table/view title fonts.

Lets you set the background color of your tables in the SQL

Diagram Pane.

Available

NOTE:

If you set options in the Options editor while Query Builder is running, DBArtisan displays a warning indicating that you are about to change options or properties. For details, see

Query Builder Options .

Completing the Statement Properties Dialog Box

To complete the Statement Properties dialog box, do the following:

1 On the Query Builder menu, click Statement Properties.

2 Set options.

85 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

3 Click OK.

Query Builder saves the options.

For more information, see

Query Builder

T

ABLE

P

ROPERTIES

The Tables Properties dialog box lets you set parameters for tables or views in your SQL

Diagram. The table below describes the options and functionality on the Table Properties dialog box.

Option

Table Alias

Show Datatypes

Displayed Columns

Hidden Columns

Hide All

Display All

Right Arrow

Left Arrow

Description

Creates an alias name for your table.

Shows or hides the datatype for every column in the target table.

Displays columns visible in the SQL Diagram.

Displays columns hidden in the SQL Diagram.

Moves all non selected columns in the table to the Hidden Columns window.

Moves all columns in the table to the Displayed Columns window.

Moves a target file from Displayed Columns to Hidden Columns.

Moves a target file from Hidden Columns to Displayed Columns.

Completing the Table Properties Dialog Box

To complete the Table Properties dialog box, do the following:

1 Double click the target table or view title bar.

OR

Right-click target table or view, and then click Properties.

2 If you only want to hide or display columns in your table, click the arrow button on the table title bar.

3 You can also edit view properties from the Table Properties dialog box.

4 Click OK.

Query Builder saves the changes.

For more information, see

Query Builder

C

OLUMN

P

ROPERTIES

The Column Properties dialog box lets you set properties for individual columns in your SELECT or CREATE VIEW statements. You can set aggregate functions and create an alias for an individual column.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 859

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

The Column Properties dialog box is not available for INSERT, UPDATE or DELETE statements.

The table below describes the options and functions Columns Properties dialog box:

Interface Element

Tables/Views

Aggregate

Alias

Available Columns

Selected Columns

Select All

Clear All

Right Arrow

Left Arrow

Select List Statement

Description

Displays all tables and views in the SQL Diagram Pane.

Specifies aggregate options for the target column.

AVG - An average is taken for a column with an int or numeric datatype.

COUNT - Returns the number of rows which contain data for the target column.

MAX - Returns the highest number in a row in the column.

MIN - Returns the lowest number in a row in the column.

SUM - Returns the sum of the target column in all rows which contain data. This function is only operable on int or numeric datatypes.

Displays the alias name for the target column. Lets you type the name of the alias.

NOTE: Query Builder displays the results of an aggregate column without a column name unless you create an alias for that column.

Displays all available columns in the target table or view.

Displays all selected columns in the target table or view. To create an aggregate function or alias for a different column, select target column, select an aggregate function, and then type the name of the alias.

Moves all columns in the Available Columns box to the Selected Columns box.

Moves all columns in the Selected Columns box to the Available Columns box.

Moves target column in the Available Columns box to the Selected Columns box.

Moves target column in the Selected Columns box to the Available Columns box.

Displays the current query.

Completing the Column Properties Dialog Box

To complete the Column Properties dialog box, do the following:

1 On the SQL Statement Tree, double-click target column.

2 Select options.

3 Click OK.

For more information, see

Query Builder

J

OIN

P

ROPERTIES

Query Builder lets you edit joins with the Join editor. You can edit join parameters in a SELECT,

UPDATE, DELETE, and CREATE VIEW Statement.

The table below describes the options and functionality on the Join dialog box.

86 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

Option

From Table Column

To Table Column

Select the join relation operator

Join Type: Inner

Join Type: Left Outer

Join Type: Right Outer

Description

The primary column in the join.

The secondary column in the join.

Click the target join operator. If it is not equals, the operator displays on the join in the

SQL Diagram Pane.

Click to make the join an inner join. Aggregates are only available for inner joins.

Click to make the join a left outer join.

Click to make the join a right outer join.

NOTE:

For IBM DB2 for Linux, Unix, and Windows and IBM DB2 for z/OS and OS/390 servers, there is an additional join object in the SQL Statement Tree. The Join On node displays join relations between columns in IBM DB2 for Linux, Unix, and Windows and IBM DB2 for z/OS and OS/390 tables and views.

Completing the Join Dialog Box

To complete the Join dialog box, do the following:

1 In the SQL Diagram Pane, right-click the target join, and then click Properties.

OR

In the SQL Diagram Pane, double-click the target join.

OR

On the SQL Statement Tree, expand the Where and And nodes, and then double-click the target join.

2 Select options.

3 Click OK.

For more information, see

Query Builder

U

SING

Q

UERY

B

UILDER

Query Builder provides a visual display of your queries as you construct them. You can run Query

Builder against any registered datasource in DBArtisan. Query Builder lets you build five separate types of queries simultaneously:

• Building a SELECT Statement

• Building an INSERT Statement

• Building an UPDATE Statement

• Building a DELETE Statement

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 861

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

• Building a CREATE VIEW Statement

You can execute a SELECT statement from Query Builder. To execute an INSERT, UPDATE,

DELETE, and CREATE VIEW statement, copy them to an ISQL Editor. You can also copy the statements to the clipboard for later use in the ISQL Editor.

Query Builder also lets you save a statement at any time so that you can open them later for

editing or execution. Saving and Reopening Queries

.

DBArtisan lets you open Query Builder with multiple tables or views with the same or different owners. If you open tables or views with different owners, Query Builder displays “All Owners” in the Owner drop-down list. You can start multiple Query Builder sessions from DBArtisan. You can use different tables and views for each query. You can also toggle back and forth among

each of the queries. For more information, see Working with Tables and Views in the SQL

Diagram Pane .

You can save and reopen queries in Query Builder. Query Builder automatically checks for changes in your database or instance between the time you save the query and the time you reopen it with the Schema Change detection component.

Query Builder is integrated with Data editor so you can edit data in real time and then continue to build your query with the new information embedded in the query. For details, see

Saving and

Reopening Queries

.

U

SING

Q

UERY

B

UILDER

To use Query Builder, do the following:

• Selecting a Database

• Selecting a Statement

• Selecting Tables and Views

• Selecting Columns

NOTE:

You can start Query Builder directly from a table or view which automatically selects the instance or database which contains that table or view.

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

S

ELECTING A

D

ATABASE

To create an SQL statement, first select an instance or database.

NOTE:

You can start Query Builder directly from a table or view which automatically selects the database which contains that table or view.

86 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

If you are working with Microsoft SQL Server or Sybase ASE, Query Builder provides two dropdown lists. The first drop-down list displays all available databases for the target server. The second drop-down list displays owners.

If you are working with Oracle, IBM DB2 for z/OS and OS/390 or IBM DB2 for Linux, Unix, and

Windows the first drop-down list is unavailable.

NOTE:

You can start Query Builder directly from a table or view which automatically selects the database which contains that table or view.

1 Start Query Builder.

2 In the database drop-down list, click the target instance or database.

3 In the owners drop-down list, select the appropriate owner.

Query Builder is ready for Statement selection.

4 To select different instances or databases while Query Builder is running, on the Tables/

Views Tab, in the database drop-down list, click the target instance or database.

DBArtisan clears the cu rrent query and displays a warning prompt.

5 To save the current query, click Yes.

DBArtisan opens the Save A s dialog box.

6 To continue without saving, click No.

DBArtisan clears the

SQL Diagram Pane and SQL Statement Pane.

For more information on saving queries in Query Builder, see Saving and Reopening Queriess

.

S

ELECTING A

S

TATEMENT

Query Builder lets you build SELECT, INSERT, UPDATE, DELETE, and CREATE VIEW queries simultaneously.

To select a statement, do the following:

1 On the Query Builder tool bar, click the statement drop-down list, and then click the target statement type.

OR

In the SQL Diagram Pane, right-click, and then click the target statement type.

For more information, see

Using Query Builder

.

S

ELECTING

T

ABLES AND

V

IEWS

To build a query, open one or more tables or views in the SQL Diagram Pane. For details, see

SQL Diagram Pane .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 863

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

You can use different tables or views for each type of query.

TIP:

For multiple tables: Press SHIFT+click for adjacent tables or CTRL+click for nonadjacent tables. You can also drag the bounding line with your pointer to select multiple tables.

To select a Table or View, do the following:

1 In the Tables/Views Tab, drag the target table or view to the Diagram Pane.

OR

In the Tables/Views Tab, click target table or view and then, on the Query Builder tool bar, click Add.

OR

In the Tables/Views Tab, right-click target table or view, and then click Add.

Query Builder displays the target table(s) and view(s) in the SQL Diagram Pane.

For more information, see

Using Query Builder

.

S

ELECTING

C

OLUMNS

You must select at least one column to build a query. Query Builder displays columns in each table in the SQL Diagram window. By default, Query Builder exposes every column in a table.

You can select the columns you want to use for your query. Query Builder orders them, in your statement, in the select order.

Query Builder lets you select columns. For details, see:

SQL Diagram Pane

.

Selecting Columns in the SQL Statement Tree .

You can select an individual column or all columns. Query Builder orders them, in your statement, in the select order. You can reorder columns after you set them in your diagram or statement.

For more information, see:

Selecting Columns in the SQL Diagram Pane

Selecting Columns in the SQL Statement Tree

Selecting all Columns

S

ELECTING

C

OLUMNS IN THE

SQL D

IAGRAM

P

ANE

To select a column in the SQL Diagram Pane, do the following:

1 Select the check box to the left of the target column name.

For more information, see

Using Query Builder

.

86 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

S

ELECTING

C

OLUMNS IN THE

SQL S

TATEMENT

T

REE

Query Builder lets you select and set individual properties using the Selected Column

Properties Dialog Box. For details, see Column Properties

.

For more information, see

Using Query Builder

.

S

ELECTING ALL

C

OLUMNS

Query Builder uses columns in statements based on the order of selection. When you select all columns, Query Builder displays the columns in the order they appear in the table.

NOTE:

Query Builder lets you select all columns in single or multiple tables.

To select all columns, do the following:

1 On the Query Builder menu, click Select Star.

For more information, see

Using Query Builder

.

B

UILDING A

Q

UERY

Query Builder lets you build SELECT, INSERT, UPDATE, SELECT, and CREATE VIEW statements, which you can run separately or simultaneously, depending on your needs.

To build a Query, do the following:

• Selecting a Database

Selecting a Statement

• Selecting Tables and Views

Selecting Columns

NOTE:

You can start Query Builder directly from a table or view which automatically selects the database which contains that table or view.

Query Builder lets you build queries that include both tables and views in the SQL Diagram Pane for SELECT and CREATE VIEW statements. For the INSERT, UPDATE, and DELETE statements, use one or the other object, but you cannot use both.

Once you make your selections, you can edit, restructure, and streamline your query. Query

Builder offers many options for streamlining your queries.

For more information, see:

Working with Tables and Views in the SQL Diagram Pane

Working with Columns in the SQL Diagram Pane

Joins

Creating a Clause Using the SQL Statement Tree

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 865

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

Selecting Columns in the SQL Statement Tree

Subqueries

Aliases

B

UILDING A

SELECT S

TATEMENT

Query Builder lets you construct and execute simple-to-complex SELECT statements using data from any table or view. You can also create and edit joins for SELECT statements. Query Builder can check your query and warn you if there are syntax errors with the Syntax Checker.

For related information, see Joins and

Syntax Checker .

To build a SELECT statement, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

2 In the statement drop-down list, click SELECT.

3 In the Table Tree Pane, select target table(s) or view(s) and move them to the SQL Diagram

Pane.

4 In the target table or view, click target column(s), or click Select Star to select every column.

5 To check syntax, click Check.

6 To copy the statement, click Copy.

7 To execute the statement, click Execute.

Copying a SELECT Statement from the SQL Statement Pane

To copy any part of a statement from the SQL Statement Pane, do the following:

1 Open Query Builder, then begin a new SELECT statement.

OR

Open an existing SELECT statement.

2 In the SQL Statement Pane, select all, or the target portion of the statement.

3 On the Query Builder tool bar, click Copy.

OR

In the SQL Statement Pane, right-click, and then click Copy.

Query Builder makes the target statement portion available on the clipboard.

For more information, see

Query Builder

86 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

B

UILDING AN

INSERT S

TATEMENT

Query Builder lets you construct and execute simple-to-complex INSERT statements using data from any table. To execute an INSERT statement, copy it to an ISQL Editor. You can also copy the statement to the clipboard for later use in the ISQL Editor.

Query Builder also lets you save your statement at any time so that you can open it later for

editing or execution. For details, see Saving and Reopening Queries

.

Building an INSERT Statement

To build an INSERT Statement, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

2 In the statement drop-down list, click INSERT.

3 In the Table Tree Pane, select target table, and move it to the SQL Diagram Pane.

4 In the target table, click target column(s).

Copying an INSERT Statement from the SQL Statement Pane

To copy any part of a statement from the SQL Statement Pane, do the following:

1 Open Query Builder, then begin a new INSERT statement.

OR

Open an existing INSERT statement.

2 In the SQL Statement Pane, select all, or the target portion of the statement.

3 On the Query Builder tool bar, click Copy.

OR

In the SQL Statement Pane, right-click, and then click Copy.

Query Builder makes the target statement portion available on the clipboard.

For more information, see

Query Builder

B

UILDING AN

UPDATE S

TATEMENT

Query Builder lets you construct and execute simple-to-complex UPDATE statement using data from any table. To execute an UPDATE statement, copy it to an ISQL Editor. You can also copy the statement to the clipboard for later use in the ISQL Editor.

Query Builder also lets you save your statement at any time so that you can open it later for

editing or execution. For details, see Saving and Reopening Queries

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 867

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

Building an UPDATE Statement

To build an UPDATE statement, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

2 In the statement drop-down list, click UPDATE.

3 In the Table Tree Pane, select target table and move it to the SQL Diagram Pane.

4 In the target table, click target column(s).

Copying an UPDATE Statement from the SQL Statement Pane

To copy any part of a statement from the SQL Statement Pane, do the following:

1 Open Query Builder, then begin a new UPDATE statement.

OR

Open an existing UPDATE statement.

2 In the SQL Statement Pane, select all, or the target portion of the statement.

3 On the Query Builder tool bar, click Copy.

OR

In the SQL Statement Pane, right-click, and then click Copy.

Query Builder makes the target statement portion available on the clipboard.

For more information, see

Query Builder

B

UILDING A

DELETE S

TATEMENT

Query Builder lets you construct DELETE statements using data from any table. Query Builder displays a Confirmation Option Message box when you create a DELETE statement. You can set the Statement Properties dialog box to display or hide this message when creating a DELETE

statement. For details, see Statement Properties

.

To execute a DELETE statement, copy it to an ISQL Editor. You can also copy the statement to the clipboard for later use in the ISQL Editor.

Query Builder also lets you save your statement at any time so that you can open it later for

editing or execution. For details, see Saving and Reopening Queries

.

Building a DELETE Statement

To build a DELETE statement, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

86 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

2 In the statement drop-down list, click DELETE.

3 In the Table Tree Pane, select target table, and move it to the SQL Diagram Pane.

Copying a DELETE Statement from the SQL Statement Pane

To copy any part of a statement from the SQL Statement Pane, do the following:

1 Open Query Builder, then begin a new DELETE statement.

OR

Open an existing DELETE statement.

2 In the SQL Statement Pane, select all, or the target portion of the statement.

3 On the Query Builder tool bar, click Copy.

OR

In the SQL Statement Pane, right-click, and then click Copy.

Query Builder makes the target statement portion available on the clipboard.

For more information, see

Query Builder

B

UILDING A

CREATE VIEW S

TATEMENT

Query Builder lets you construct and execute simple-to-complex CREATE VIEW statements using data from any table or view. You can also copy the statement to the clipboard for later use in the ISQL Editor.

Query Builder also lets you save your statement at any time so that you can open it later for

editing or execution. For details, see Saving and Reopening Queries

.

To build a CREATE VIEW statement, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

2 In the statement drop-down list, click CREATE VIEW.

3 In the Table Tree Pane, select target table or view and move it to the SQL Diagram Pane.

NOTE:

Query Builder supports multiple tables and views in a CREATE VIEW statement.

4 In the target table or view, click the target column(s).

5 To check syntax, click Check.

6 To copy the statement, click Copy.

7 To execute the CREATE VIEW Statement, click the SQL Statement Pane, and then press any key.

Query Builder opens the Edit SQL dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 869

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

8 Click OK.

CAUTION:

If you have used this method previously, and you selected the Please do not show me this dialog again check box, on the Edit SQL dialog box, Query Builder does not display the Edit SQL dialog box. It pastes your statement directly to the ISQL Editor.

DBArtisan opens the ISQL Editor.

9 In the ISQL Editor, on the line, CREATE VIEW NAME AS, replace the word NAME with a name for your view.

10 On the tool bar, click Execute.

DBArtisan executes the CREATE VIEW query.

11 To close the Editor, click Close.

DBArtisan opens the ISQL Editor save message.

12 Click No.

DBArtisan returns to Query Builder.

13 To add the view to the table tree, on the Query Builder menu, click Refresh.

Query Builder adds the view to the Table Tree Pane.

Copying a CREATE VIEW Statement from the SQL Statement Pane

To copy any part of a statement from the SQL Statement Pane, do the following:

1 Open Query Builder, then begin a new CREATE VIEW statement.

OR

Open an existing CREATE VIEW statement.

2 In the SQL Statement Pane, select all, or the target portion of the statement.

3 On the Query Builder tool bar, click Copy.

OR

In the SQL Statement Pane, right-click, and then click Copy.

Query Builder makes the target statement portion available on the clipboard.

For more information, see

Query Builder

87 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

W

ORKING WITH

T

ABLES AND

V

IEWS IN THE

SQL D

IAGRAM

P

ANE

Query Builder lets you organize your tables and views in the SQL Diagram Pane. You can also customize appearance, change visual aspects, and adjust layout while continuing to manufacture a query. You can resize or customize a selected table and view, or move them to the front or back of the diagram. The key symbol indicates a column that is indexed or participates in a primary key.

• Selecting and Deselecting Tables and Views

• Moving Tables and Views

• Moving Additional Tables and Views to the SQL Diagram Pane

• Deleting a Table or View

Query Builder can automatically dictate a layout in the SQL Diagram Pane using the Auto

Layout button. For details, see

Auto Layout .

S

ELECTING AND

D

ESELECTING

T

ABLES AND

V

IEWS

You can select tables and views in the SQL Diagram Pane. You can make changes to more than one table or view simultaneously by selecting multiple tables or views.

To select and deselect Tables and Views, do the following:

1 To select a table, click the table title bar.

2 To select more than one table, drag the pointer to enclose all target tables with the bounding line.

Query Builder selects all target tables; none have handles.

3 To select all tables, in the SQL Diagram, right-click, and then click Select All.

4 Click the SQL Diagram workspace to deselect all tables.

For more information, see

Working with Tables and Views in the SQL Diagram Pane

.

M

OVING

T

ABLES AND

V

IEWS

Query Builder lets you move tables and views in the SQL Diagram Pane. It also moves selections and joins with the tables and views.

To move Tables and Views, do the following:

1 To move a table or view, drag the title bar to the target location.

NOTE:

If you select more than one table or view, Query Builder moves all selected tables and views and any joins with the pointer.

For more information, see

Working with Tables and Views in the SQL Diagram Pane

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 871

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

M

OVING

A

DDITIONAL

T

ABLES AND

V

IEWS TO THE

SQL D

IAGRAM

P

ANE

Query Builder sets tables and views in your statement in the order that you move them to the

SQL Diagram Pane. Tables and views moved into the Diagram Pane appear first in your statement, including all joins connecting that table. To change the order of tables, move them back into the Table Tree and re-select them in the order in which you would like to join them.

Moving Additional Tables or Views

To move additional tables or views, do the following:

1 Click the target table or view and drag it to the Diagram Pane.

For multiple tables or views: Use SHIFT+click for adjacent tables or views or use CTRL+click for nonadjacent tables and views.

OR

Click the target table or view, and then on the Query Builder tool bar, click Add.

OR

Right-click the target table or view, and then click Add.

For multiple tables or views: Use SHIFT+click for adjacent tables or views or use CTRL+click for non-adjacent tables and views.

NOTE:

Moving a table or view to the SQL Diagram Pane is not available while a query is executing.

For more information, see

Working with Tables and Views in the SQL Diagram Pane

.

D

ELETING A

T

ABLE OR

V

IEW

To delete tables from the SQL Diagram Pane, do the following:

1 Right-click the target table or view, and then click Delete.

OR

In the SQL Diagram, click target table or view, and then on the Query Builder tool bar, click

Delete.

OR

In the SQL Diagram, right-click the target table or view, and then click Delete.

Query Builder deletes the table from the SQL Diagram, SQL Statement, and SQL Statement

Tree.

For more information, see

Working with Tables and Views in the SQL Diagram Pane

.

87 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

W

ORKING WITH

C

OLUMNS IN THE

SQL D

IAGRAM

P

ANE

You can customize queries by selecting and deselecting columns in the SQL Diagram Pane. You can customize columns using the Selected Column Properties dialog box. For details, see

Column Properties

.

S

ELECTING AND DESELECTING COLUMNS

You can select and deselect columns in the SQL Diagram. Query Builder lets you select and deselect individual columns or all columns. Your results reflect the order of selection. You can change the order of columns after you set them in your diagram or statement.

TIP:

You can also select, re-order and deselect columns in the SQL Statement Tree. For

more information, see Selecting Columns in the SQL Statement Tree

.

Selecting Individual Columns

To select individual columns, do the following:

1 To select a column, in the SQL Diagram, select the check box to the left of the target column name.

Deselecting Individual Columns

To deselect individual columns, do the following:

1 To deselect a column, in the

SQL Diagram

, select the check box to the left of the target column name.

NOTE:

When you clear the columns, Query Builder deletes the columns and any sub clauses from the SQL Statement Pane and SQL Statement Tree.

Selecting All Columns

To select all columns, do the following:

1 On the Query Builder menu, click Select Star.

NOTE:

Query Builder uses columns in statements based on the order of selection. When you select all columns, Query Builder displays the columns as they appear in the table.

Deselecting All Columns

To deselect all columns, do the following:

1 On the Query Builder menu, click Select None.

Query Builder adds or removes selected columns from the SQL Statement Tree and the SQL

Statement Pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 873

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

S

ELECTING

ALL

OR

DISTINCT C

OLUMNS

Selecting ALL or DISTINCT columns is a way to filter data in your query. Selecting ALL columns means all rows displays results in the grid regardless of duplication in non-primary key columns.

The DISTINCT column function is a query process that limits duplicate data in non-primary key columns to rows with the first iteration of any identical data. For example, if there are two identical addresses for different last names, and the column with a primary key does not participate in the query, only the row with the first instance of the address displays in the results of the query.

To select ALL or DISTINCT columns, do the following:

1 In the Statement Tree pane, right-click the ALL or DISTINCT node, click Properties, and then select the ALL or DISTINCT check box.

OR

In the Statement Tree pane, double click the ALL or DISTINCT node. Query Builder toggles to the opposite function.

NOTE:

You can change between ALL or DISTINCT at any time prior to executing or copying a query.

J

OINS

Joins let you distill the information in your database to a usable form. Query Builder lets you create, manipulate, and edit work with joins without requiring knowledge of the underlying SQL code. Query Builder lets you create any type of join for SELECT and CREATE VIEW Statements.

You can create self joins for UPDATE or DELETE Statements. You cannot create joins for INSERT

Statements.

Query Builder includes four types of joins. The table below describes joins and their availability in Query Builder:

Join

Inner Joins

Statement Availability

SELECT, CREATE VIEW,

DELETE, UPDATE

Description

Returns data from the joined tables that match the query’s join criteria and set a relation between tables or views. Inner joins return results where the join condition is true.

Left Outer Joins

SELECT, CREATE VIEW Returns all data from the primary table and data from the joined tables that match the query’s join criteria and set a join relation operator from a column in a primary table or view to a column in a secondary table or view.

Right Outer

Joins

SELECT, CREATE VIEW Returns all data from the primary table and data from the joined tables that match the query’s join criteria and set a join relation operator from a column in a secondary table or view to a column in a primary table or view.

Self Joins

SELECT, CREATE VIEW Set a relation between columns in the same table.

In the Query Builder SQL Diagram Pane, you can create, edit, and delete joins. You can edit joins

in the Join dialog box. For details, see Editing Joins .

87 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

You can set Query Builder options, in the Options editor, to automatically create joins. For

details, see Query Builder Options .

Joins are the way you can filter data in relational databases. Query Builder lets you change the types of joins between tables, views and columns. It is important that you have some knowledge of the data in your tables, and the datatypes for each column. This information helps you frame a better query, and filter your data for maximum effect.

I

NNER

J

OINS

Inner joins are the most common types of joins for SELECT statements. An inner join returns information from two tables where the relation between two target columns is true for both columns.

The join operand determines the relation results, for example, if the join operand is equals, then identical data, in two columns, is the only result. If the join operand is not equals, Query Builder only returns data that is different between two columns.

For example, if you have an inner join matching territory numbers between the table dbo.Managers and dbo.Clients, running the query returns all Managers and Clients with matching territory numbers:

Query Builder displays the following results from this query with an inner join

NOTE:

Query Builder displays results of columns in the order of selection. You can reorder columns by deselecting and selecting in the SQL Diagram Pane, the Selected Columns

Properties dialog box, or the SQL Statement Tree.

For more information, see

Joins

.

L

EFT

O

UTER

J

OINS

Left outer joins bring back a different data set than Inner Joins . Left outer joins retrieve all the

data in columns selected from the primary table, and only matching data from the joined or secondary table.

For example, in the same pair of tables, a left inner join from dbo.Managers to dbo.Clients, where the columns Current Territory and Territory are joined, displays different results.

NOTE:

There is one additional manager who does not have a client, but because a left outer join includes all data from selected columns in the primary table, the last entry in the illustration is displayed.

For more information, see

Joins

.

R

IGHT

O

UTER

J

OINS

Right outer joins return opposite results from Left Outer Joins . In a right outer join, you are

asking for all the information in the secondary table’s column, and the join operator’s matching information from the primary table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 875

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

For example, in the same set of data we used in the left outer join example, a right outer join returns all clients from dbo.Client, and only managers who match territory numbers, in the joined column.

NOTE:

The managers are the same as the first, inner join, but a right outer join returns the additional clients without matching managers.

For more information, see

Joins

.

S

ELF

J

OINS

A self join is a join within a single table. Query Builder lets you return specific information from a single table using a self join.

For example, in our example table, there is a column for the number of clients and another column with the goal client total for a territory.

A self join can ascertain which managers are reaching their quota. Notice that the join relation operator in the example is greater than or equal to, which shows managers exceeding quota as well.

For more information, see

Joins

.

A

DDING AND

D

ELETING A

J

OIN IN THE

SQL D

IAGRAM

P

ANE

Query Builder lets you add and delete joins. This method adds a WHERE clause in your query.

You can join different tables and or views in a SELECT or CREATE VIEW statement.

Adding a Join

To add a Join, do the following:

1 In the SQL Diagram Pane, drag the target column to the second column.

Query Builder displays both a line joining the two columns in the SQL Diagram Pane and the corresponding SQL code in the SQL Statement Pane.

Removing a Join

Query Builder lets you remove joins from your query. Query Builder automatically deletes joins from the query in the SQL Statement Pane, when you remove them from the SQL Diagram Pane.

To remove a join, do the following:

1 Click the target join, and then on the Query Builder tool bar, click Delete.

OR

Right-click the target join, and then click Delete.

Query Builder deletes the Join.

For more information, see

Joins

.

87 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

E

DITING

J

OINS

Query Builder lets you edit joins with the Join editor. You can edit join parameters in a SELECT,

UPDATE, DELETE, and CREATE VIEW Statement.

The table below describes the options in the Join dialog box:

Option

From Table Column

To Table Column

Select the join relation operator

Join Type: Inner

Join Type: Left Outer

Join Type: Right Outer

Description

The primary column in the join.

The secondary column in the join.

Click the target join operator. If it is not equals, the operator displays on the join in the

SQL Diagram Pane.

Click to make the join an inner join. Aggregates are only available for inner joins.

Click to make the join a left outer join.

Click to make the join a right outer join.

Completing the Join Dialog Box

1 In the SQL Diagram Pane, right-click the target join, and then click Properties.

OR

In the SQL Diagram Pane, double-click the target join.

OR

On the SQL Statement Tree, expand the Where and And nodes, and then double-click the target join.

Query Builder opens the Join dialog box.

NOTE:

For IBM DB2 for Linux, Unix, and Windows and IBM DB2 for z/OS and OS/390 servers, there is an additional join object in the SQL Statement Tree. The Join On node displays join relations between columns in IBM DB2 for Linux, Unix, and Windows and IBM DB2 for z/OS and OS/390 tables and views.

Changing a Join Color

Query Builder lets you change the color at a join in the SQL Diagram Pane. Complex statements using many tables and multiple joins can be easier to view if joins have different colors.

To change the color of a join, do the following:

1 Right-click the target join, and then click Color.

Query Builder opens the Color dialog box.

2 In the Basic colors grid, click a target color

OR

Click Define Custom Colors, then create a custom color.

NOTE:

Query Builder lets you save custom colors for the current color. Click Add to Custom

Color to have the option of using that color for your queries.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 877

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

3 Click OK.

For more information, see

Joins

.

A

UTO

L

AYOUT

The Auto Layout function displays tables and views in the SQL Diagram Pane. It makes the best use of the available area in the SQL Diagram Pane by placing your tables and views in the most efficient manner.

If the automatic join function is on, Query Builder displays all joins between columns in your diagram. Query Builder lets you run the automatic layout function any time you have tables or views in the SQL Diagram Pane. For details, see

Auto Joins .

Using Auto Layout

To use Auto Layout, do the following:

1 On the Query Builder menu, click Auto Layout.

Query Builder organizes your tables in the SQL Diagram Pane.

A

UTO

J

OINS

Query Builder includes an automatic join function that displays joins between selected tables and views in the SQL Diagram Pane. The Auto Join function seeks columns with the same name and data type. You can set global automatic join parameters in the DBArtisan Options Editor.

You can use the Statement Properties Editor to set local join parameters for the current Query

Builder session without changing the global parameters.For details, see Statement Properties

.

Using Auto Join

To use Auto Join, do the following:

1 On the Query Builder menu, click Auto Join.

Query Builder joins columns in the SQL Diagram Pane.

C

REATING A

C

LAUSE

U

SING THE

SQL S

TATEMENT

T

REE

Query Builder lets you build more detailed WHERE, ORDER BY, GROUP BY, and HAVING clauses using the SQL Statement Tree. Query Builder lets you add clauses to SELECT, UPDATE,

DELETE, and CREATE VIEW statements.

NOTE:

Query Builder does not support clauses for INSERT statements.

For more information, see the following topics:

87 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

Creating a WHERE Clause

Deleting a WHERE Clause

Creating an AND Clause in a WHERE Clause

Deleting an AND Clause

Inserting an AND or OR Clause

Deleting an OR Clause

Creating an ORDER BY Clause

Changing the Sort Order in an ORDER BY Clause

Deleting an ORDER BY Clause

Creating a GROUP BY Clause

Deleting a GROUP BY Clause

Creating a HAVING Clause

Deleting a HAVING Clause

C

REATING A

WHERE C

LAUSE

Query Builder lets you create a WHERE clause from the SQL Statement Tree which automatically displays in your query.

NOTE:

Any additional WHERE clauses are displayed as HAVING clauses.

The table below describes the options and functionality on the Where dialog box.

Option

Operand (Left)

Operator

Operand (Right)

Description

Lets you click the target column for the first part of your WHERE clause.

NOTE: Query Builder lists every column in all tables in the SQL Diagram in the Operand lists.

Lets you select the target operator.

Lets you click the target column for the second part of your WHERE clause.

Query Builder automatically writes the query language in the Statement option box.

NOTE:

Query Builder does not display clause phrases created from the SQL Statement Tree in the SQL Diagram Pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 879

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

Creating a WHERE Clause

To Create a WHERE clause, do the following:

1 Click the WHERE node, and then on the Query Builder tool bar, click New.

OR

Right-click the WHERE node, and then click New.

For more information, see

Selecting Columns in the SQL Statement Tree

.

D

ELETING A

WHERE C

LAUSE

To delete a WHERE clause, do the following:

1 Expand the AND node, and then on the Query Builder tool bar, click Delete.

OR

Expand the AND node, right-click target column and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

REATING AN

AND C

LAUSE IN A

WHERE C

LAUSE

Query Builder lets you add an AND clause from the SQL Statement Tree which automatically displays in your query.

The table below describes the options and functionality on the Where dialog box.

Option

Operand (Left)

Operator

Operand (Right)

New Button

Description

Lets you click the target column for the first part of your WHERE clause.

Lets you select the target operator.

Lets you click the target column for the second part of your WHERE clause.

Query Builder automatically writes the query language in the Statement option box.

Click to clear your selections but remain in the Where dialog box.

Query Builder adds another AND clause to your query.

To open the Where dialog box, do the following:

1 Click the AND node, and then on the Query Builder tool bar, click New.

OR

Expand the WHERE node, right-click the AND node, and then click New.

For more information, see

Selecting Columns in the SQL Statement Tree

.

88 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

D

ELETING AN

AND C

LAUSE

To delete an AND clause, do the following:

1 Expand the AND node, click target column, and then on the Query Builder tool bar, click

Delete.

OR

Expand the AND node, click target column, and then on the keyboard press DELETE.

OR

Expand the AND node, right-click the target column, and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

I

NSERTING AN

AND

OR

OR C

LAUSE

Query Builder lets you insert an AND or an OR WHERE clause from the SQL Statement Tree which automatically displays in your query. Query Builder lets you insert AND or OR clauses at any appropriate point in the SQL Statement Tree.

The table below describes the options and functionality on the Where dialog box.

Option

Operand (Left)

Operator

Operand (Right)

New Button

Description

Lets you click the target column for the first part of your WHERE clause.

Lets you select the target operator.

Lets you click the target column for the second part of your WHERE clause.

Query Builder automatically writes the query language in the Statement option box.

Click to clear your selections but remain in the Where dialog box.

Query Builder adds another AND clause to your query.

To insert an AND or OR Clause, do the following:

1 On the SQL Statement Tree, expand the WHERE node, right-click the target AND node, then click Insert, and then click And or Or.

For more information, see

Selecting Columns in the SQL Statement Tree

..

D

ELETING AN

OR C

LAUSE

To delete an OR clause, do the following:

1 Expand the OR node, and then on the Query Builder tool bar, click Delete.

OR

Expand the OR node, right-click the target column and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 881

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

REATING AN

ORDER BY C

LAUSE

Query Builder lets you create an ORDER BY clause from the SQL Statement Tree which automatically displays in your query.

The table below describes the Order By Columns dialog box.

Option Description

Available Columns Select target column(s) and click the right arrow. Query Builder moves target column from the

Available Columns list to the Order By Columns list.

NOTE: Query Builder sorts query results based on the order that columns are placed in the

ORDER BY clause.

Order Lets you select the target sort order.

ASC - Ascending

DESC - Descending

Query Builder displays the SQL language in the Order By Statement box.

To open the Order By Columns dialog box, do the following:

1 On the SQL Statement Tree, click the ORDER BY node, and then on the Query Builder tool bar, click Properties.

OR

On the SQL Statement Tree, right-click the ORDER BY node, and then click Properties.

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

HANGING THE

S

ORT

O

RDER IN AN

ORDER BY C

LAUSE

To quickly change the sort order of a column in a query, do the following:

1 On the SQL Statement Tree, expand the ORDER BY node, and then double-click the target column.

OR

On the SQL Statement Tree, expand the ORDER BY node, then right-click the target column, and then click Properties.

Query Builder opens the Order dialog box.

2 Click the target sort order, and then click OK.

Query Builder appends the Order By clause for target column with the appropriate sort order in the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

88 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

D

ELETING AN

ORDER BY C

LAUSE

To delete an ORDER BY clause, do the following:

1 Expand the ORDER BY node, and then on the Query Builder tool bar, click Delete.

OR

Expand the ORDER BY node, right-click the target column, and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

REATING A

GROUP BY C

LAUSE

The table below describes the options and functionality on the Group By Columns dialog box.

Option

Selected Columns

Clear All Button

Description

Select target column(s) and click the right arrow. Or click the Select All button. Query Builder moves target column from the Selected Columns list to the Group By Columns list.

NOTE: Query Builder sorts query results based on the order that columns are placed in the

ORDER BY clause.

Click to move target column from the Group By Columns list to the Selected Columns list.

Query Builder displays the SQL language in the Group By Statement window.

Creating a GROUP BY Clause

To create a GROUP BY clause from the SQL Statement Tree which automatically displays in your query, do the following:

1 On the SQL Statement Tree, double-click the GROUP BY node.

OR

On the SQL Statement Tree, right-click the GROUP BY node, and then click New.

Query Builder adds all the selected columns in your table(s) to the GROUP BY node in the

SQL Statement Tree, and to the appropriate location in the SQL Statement Pane.

2 On the GROUP BY node, double-click any column.

OR

On the GROUP BY node, click any column, then on the Query Builder menu, click New.

OR

On the GROUP BY node, right-click any column, then click Properties.

For more information, see

Selecting Columns in the SQL Statement Tree

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 883

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

D

ELETING A

GROUP BY C

LAUSE

To delete a GROUP BY clause, do the following:

1 On the SQL Statement Tree expand the GROUP BY node, and then on the Query Builder tool bar, click Delete.

OR

On the SQL Statement Tree Expand the GROUP BY node, right-click the target column, and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

REATING A

HAVING C

LAUSE

A HAVING clause is a type of WHERE clause. It filters additional information from your tables.

Query Builder lets you create a HAVING clause from the SQL Statement Tree which automatically displays in your query. Query Builder lists every column in all tables in the SQL

Diagram in the Operand lists. Query Builder displays the datatype of a column in the operand boxes.

The table below describes the options and functionality on the Having dialog box.

Option

Operand (Left)

Operator

Operand (Right)

New Button

Description

Lets you click the target column for the first part of your HAVING clause.

Lets you select the target operator.

Lets you click the target column for the second part of your HAVING clause.

Query Builder automatically writes the query language in the Statement option box.

Click to clear your selections but remain in the Having dialog box.

Query Builder adds another AND clause to your query.

NOTE:

Query Builder does not display clause phrases created from the SQL Statement Tree in the SQL Diagram Pane.

To create a HAVING clause, do the following:

1 On the SQL Statement Tree, expand the HAVING node, and then expand the And node. If there is not a join listed on the And node, double-click And. If there is a join listed, use the shortcut option below.

OR

On the SQL Statement Tree, right-click the HAVING node, and then click New.

For more information, see

Selecting Columns in the SQL Statement Tree

.

88 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

D

ELETING A

HAVING C

LAUSE

To delete a HAVING clause, do the following:

1 On the SQL Statement Tree expand the HAVING node, and then on the Query Builder tool bar, click Delete.

OR

On the SQL Statement Tree expand the HAVING node, right-click the target column, and then click Delete.

Query Builder deletes the target clause and removes it from the SQL Statement Pane.

For more information, see

Selecting Columns in the SQL Statement Tree

.

C

HANGING

T

ABLES AND

C

OLUMNS

L

OCATION IN THE

SQL S

TATEMENT

T

REE

Query Builder lets you move tables and columns on the SQL Statement Tree by dragging them to new locations. You can move columns from the AND and OR nodes to an AND or OR node on the WHERE and HAVING clause nodes. Query Builder changes the query in the SQL

Statement Pane to match each move. Query Builder moves tables or columns you are dragging below target table or column.

To move a table or column in the SQL Statement Tree, do the following:

1 Expand target node, then drag the target table or column to a new location.

Query Builder makes the appropriate change in the query in the SQL Statement Pane.

NOTE:

Query Builder lets you select multiple tables or columns.

2 To move a table or column to the bottom of a node, drag it to the target node.

Query Builder displays the target table or column at the bottom of target node.

For more information, see

Selecting Columns in the SQL Statement Tree

.

S

UBQUERIES

Query Builder lets you build subqueries for SELECT and CREATE VIEW statements in the

WHERE or HAVING clause. The table below describes the options available for a subquery in

Query Builder:

Operand

EXISTS

NOT EXISTS

ANY

ALL

SELECT

Location Description

Left operand Specifies data that exists in a column.

Left operand Specifies data that does not exist in a column.

Right operand Specifies data satisfying the operator parameters.

Right operand Specifies data satisfying the operator parameters.

Right operand Specifies data satisfying the operator parameters.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 885

Q U E R Y B U I LD E R > Q UE RY B UI L D E R

The table below describes the options and functionality on the Where or Having dialog boxes.

Option

Operand (Left)

Operator

Operand (Right)

Subquery

Description

Lets you click the target column for the first part of your clause.

Lets you select the target operator.

Lets you click the target column for the second part of your clause.

Query Builder displays the working subquery in the Statement window.

Paste or type the SUBQUERY statement.

To use the WHERE and HAVING dialog boxes to create subqueries, do the following:

1 On the SQL Statement Tree, expand the Where or Having node, and then expand the And node. If there is not a join listed on the And node, double-click And. If there is a join listed, use the shortcut option below.

OR

On the SQL Statement Tree, right-click the Where or Having node, and then click New.

For more information, see

Selecting Columns in the SQL Statement Tree

.

S

YNTAX

C

HECKER

The Syntax Checker scans SQL statements for errors. You can check your syntax at any time while you are fashioning a query, or a Procedure or Function. Query Builder can automatically run a syntax check to validate your query when you are executing or copying a statement. The options

for the Syntax Checker tool are set in the Options Editor. For details,see Query Builder Options .

NOTE:

Query Builder lets you continue with your query even if there are errors detected in the syntax.

Using the Syntax Checker

The table below describes the possible syntax errors the Query Builder Syntax Checker tool displays, in order:

Error

Does the query contain duplicate aliases?

If the query has a HAVING clause, is there a GROUP BY clause?

If there are aggregates, or a

GROUP BY clause, are all columns in one or the other?

Are there joins against nonindexed columns, or columns not participating in a primary key?

Description

Query Builder returns an error message when it detects duplicate aliases.

Query Builder returns an error message when it detects a HAVING clause without a GROUP BY clause.

Query Builder returns an error message when it detects an aggregate, or a

GROUP BY clause without all columns in one or the other.

Query Builder returns a warning when it detects a join against a non-indexed column, or a column not participating in a primary key.

88 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Q U ERY B U ILDER > QUER Y BUILDE R

Error

Are there joins between different datatypes?

Are there cross-products in the query?

Description

Query Builder returns a warning when it detects a join between different datatypes.

Query Builder returns a warning when it detects a cross-product in the query.

S

AVING AND

R

EOPENING

Q

UERIES

You can save and reopen queries in Query Builder. Saving a query saves the SQL Diagram, SQL

Statement, and Query Builder Explorer view. Query Builder automatically checks for changes in your database or instance between the time you save the query and the time you reopen it.

Query Builder prompts you to save any time you try to close Query Builder, or any time you attempt quitting DBArtisan.

Query Builder runs Schema Change detection any time you set a query to execute, refresh the data, or open a saved query.

DBArtisan lets you open multiple saved queries simultaneously.

Saving Queries

To save a query using standard Save and Save As functions, do the following:

1 On the File menu, click Save or Save As.

DBArtisan opens the Save As dialog box.

2 In the File name box, type the name of the query.

NOTE:

By default, the product appends the.qbl extension to Query Builder files. If there is more than one Query Builder session in progress when you save, the file is further appended with an integer, for example.qbl2.

TIP:

DBArtisan lets you save data in text (*.txt) and XML (*.xml) file formats.

3 Click OK.

DBArtisan saves the file and closes the Save As dialo g box.

Reopening Queries

You can open a query using standard Open functions. Query Builder displays the Query Builder diagram, statement and Query Builder Explorer Pane and it checks the instance or database for schema changes.

The Query Builder Schema Change Detection component checks for:

• Renamed or dropped tables referenced in the query. Renamed tables that have been renamed are considered dropped.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 887

IM P O R T D A T A > I M P O R T D A TA

• Renamed or dropped columns referenced in the query. Renamed columns are considered dropped and inserted.

• Columns added or reordered in tables referenced in the query.

If Query Builder detects a change, it opens the Schema Change Detected dialog box. The dialog box displays details of changes to your schema.

Query Builder opens an ISQL Editor with the last saved versions of the SQL statement.

U

SING

D

ATA

E

DITOR WITH

Q

UERY

B

UILDER

SELECT statements. DBArtisan lets you open multiple Data Editor sessions so that you can continue to change your data until you find the best match for your query.

CAUTION:

Data Editor is a real-time editor. Changes in your data using Data Editor are permanent.

Opening the Data Editor from Query Builder

To open the Data Editor from Query Builder, do the following:

1 On the Tools menu, click Query Builder.

DBArtisan opens Query Builder.

2 Select a database or instance. For details, see

Selecting a Database .

3 Select a table. For details, see Selecting Tables and Views .

4 Select a column, or columns. For details, see Selecting Columns

.

5 On the Query Builder menu, click Edit Data.

DBArtisan opens Data Editor.

For more information on using the Data Editor, see

Data Editor

I

MPORT

D

ATA

It is often necessary to import data into database tables from external sources. You may need to bring sample data into a database to establish test case scenarios or import data for use in the real world. Business analysts, for example, often use spreadsheets from outside sources. Putting such data into tables can help them perform detailed queries and make informed decisions based on meaningful data.

NOTE:

When you import a text file, the wizard may give the impression of stalling. Press ESC and you should be able to continue without further incident.

88 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IM P O R T D A T A > I M P O R T D A TA

To Open the Import Data Wizard:

1 On the Tools menu, click Import Data.

The fields you may encounter as you move through the wizard are described in the table that follows:

Data Properties

Required Information

Specify the file to be used in this data load operation

Which table do you want to load data into?

Catalog

Schema

Table

Description

Type or browse to the file you will be importing the data from.

Catalog: The collection of tables for Sybase or MS SQL. This is where you want to import the data to.

Schema: The user.

Table: The particular table where you want to import the data.

Delimeter

Required Information

What character delimited the columns in the data file?

First Row Contains Field Names

Description

Choose between Tab, Semicolon, Comma, Space, or Other. If you choose

Other, you must indicate the specific delimiting character.

By choosing this, if the first row contains column names, these will be displayed as the first row of the file. You can still change column mappings if you want. If you do not select this, generic Field 1, Field 2, etc. will indicate column mappings.

Column Mapping

Required Information Description

NOTE: You must map all mandatory (NOT NULL) column fields to a column heading before you can enable the

Finish button and import the data.

To map columns, click the grey bar at the top of the grid and a drop-down list appears. The names in this drop-down list are columns in the table that’s going to receive the data. These need to sync up to the data that’s being imported. Red, or mandatory columns, turn blue in the column list when they have been assigned.

A maximum of 10 rows are displayed here to make mapping columns easier. All rows will be imported when the job completes.

If there are more columns in the file you are importing than in the receiving table, the extra columns will be ignored and you can create the insert statements.

You cannot complete the import operation if columns are mapped more than once. The import operation will not let you generate invalid columns.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 889

D A TA E D I TO R > D A T A E D I T O R

Excel Column Mapping

Required Information

Sheet

Description

If the file you selected has more than one sheet, identify the worksheet that has the data you want to import.

Start/End Cell Identify the starting and ending cells of data you want to import and click

Refresh. Or, accept the default cells.

First Row Contains Field Names By choosing this, if the first row contains column names, these will be displayed as the first row of the file. You can still change column mappings if you want. If you do not select this, generic Field 1, Field 2, etc. will indicate column mappings.

NOTE: You must map all mandatory (NOT NULL) column fields to a column heading before you can enable the

Finish button and import the data.

To map columns, click the grey bar at the top of the grid and a drop-down list appears. The names in this dropdown list are columns in the table that’s going to receive the data. These need to sync up to the data that’s being imported. Red, or mandatory columns, turn blue in the column list when they have been assigned.

If there are more columns in the file you are importing than in the receiving table, the extra columns will be ignored and you can create the insert statements.

You cannot complete the import operation if columns are mapped more than once. The import operation will not let you generate invalid columns.

D

ATA

E

DITOR

The Edit Data function opens the Data Editor. You can use the Data Editor to edit your tables in real-time. The Data Editor supports all editable datatypes and is an alternative way to add, edit, or delete data from your tables.

NOTE:

You can use Data Editor within Query Builder to edit data in tables while you create

SELECT statements. You can open multiple Data Editor sessions so that you can continue to change your data until you find the best match query. For details, see

Query Builder

.

The Data Editor includes a Data Editor Filter that lets you select the columns in your table that you want to edit. You must select at least one column to use the Data Editor. The Data Editor

Filter is not available for the Query Builder. For more information, see

Data Editor Filter

.

TIP:

You can customize Data Editor options in the Options editor. For detals, see

Data

Editor Options .

For more information, see:

• Data Editor Design

• Using Data Editor

89 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D AT A E D IT OR > DA TA E D IT O R

D

ATA

E

DITOR

D

ESIGN

The Data Editor includes the following components:

• Data Editor Edit Window

• Data Editor ISQL Window

• Data Editor Toolbar

• Notes on XML Types and Unicode Display in the Data Editor

• Data Editor Filter

• Editing Date and Time Functions

• Using Data Editor

D

ATA

E

DITOR

E

DIT

W

INDOW

Data Editor displays all the information in the target table in the Data Editor Edit Window. You can edit data directly in this window.

For more information, see:

Data Editor ISQL Window

Data Editor Toolbar

Data Editor Filter

Editing Date and Time Functions

Using Data Editor

D

ATA

E

DITOR

ISQL W

INDOW

The Data Editor ISQL Window displays the active SQL statement, which uses the data from the target table.

When appropriate, Data Editor displays a History Tab. The History Tab displays all SQL

Statements created in the current session. If there is an error, Data Editor displays an Error Tab.

The Error Tab details any errors in data entry encountered during execution.

For more information, see:

Data Editor Edit Window

Data Editor Toolbar

Data Editor Filter

Editing Date and Time Functions

Using Data Editor

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 891

D A TA E D I TO R > D A T A E D I T O R

D

ATA

E

DITOR

T

OOLBAR

The Data Editor tool bar lets you access commonly used features.

The table below describes the function of each Data Editor tool.

Description

Stop Button

List of options for the target table

Execute SQL button

Insert Record button

Function

Stops loading data to the Data Editor. Data Editor displays rows up to the stopping point.

Displays the editing mode for the target table.

Save Current Row button

Remove Data button

Clear SQL Text button

Undo button

Redo button

First Record button

Last Record button

Filter Data button

Refresh button

Calendar button

Date/Time Format Builder button

Date/Time Format Undo button

Date/Time Format Redo button

Close button

Executes the current SQL statement for the target table.

Inserts new record for the target table. New records display at the end of the table.

For related information, see Default Value Handling

.

Saves data in the current selected row. Data Editor prompts to save when you attempt to leave a row in Live mode. For related information, see

Default Value

Handling .

Removes data in target row. Data Editor displays an optional prompt.

Clears SQL text from the SQL Statement Pane.

Undoes the most recent operation.

Redoes the most recent operation.

Moves to the first record in the target table.

Moves to the final record in the target table.

Filters table using the target cell as the filter parameter.

Reloads data for target table

Sets correct format for target date/time cell. Enables the Calendar window.

For details, see Editing Date and Time Functions .

Undoes the last date/time format display.

Redoes the last date/time format display.

Closes and exits Data Editor.

For more information, see:

Data Editor Edit Window

Data Editor ISQL Window

Data Editor Filter

Editing Date and Time Functions

Using Data Editor

89 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D AT A E D IT OR > DA TA E D IT O R

D

ATA

E

DITOR

F

ILTER

The Data Editor Filter displays the columns of a target table and the corresponding SELECT SQL

Statement. You can select columns from the filter for selective data editing.

For more information, see:

Data Editor Edit Window

Data Editor ISQL Window

Data Editor Filter

Editing Date and Time Functions

Using Data Editor

Extract Data as XML

N

OTES ON

XML T

YPES AND

U

NICODE

D

ISPLAY IN THE

D

ATA

E

DITOR

When working with data in the Data editor, keep the following in mind:

• XML data types are supported for IBM DB2 for Windows, Unix, and Linux, Microsoft SQL

Server, and Oracle. In the Data editor, XML data types are displayed and entered as LOB content.

• Support for display of Unicode characters is provided as follows:

• IBM DB2 for Windows, Unix, and Linux V8 and V9: character, clob, varchar, and

longvarchar types

• SQL Server 2000: for nchar, nvarchar, and ntext types

• SQL Server 2005: nchar, nvarchar, ntext, and nvarchar(max) types.

• Oracle 8i, 9i, and 10g: NCHAR, NVARCHAR2 and NCLOB for non-Unicode UTF8

Character Set Instances and NCHAR, NVARCHAR2, CHAR, VARCHAR2, LONG, NCLOB and CLOB for Unicode UTF8 Character Set Instances

• Sybase 12.5 and 15.2: UNICHAR,UNIVARCHAR and UNITEXT for non-Unicode UTF8

Character Set Instances and UNICHAR, UNIVARCHAR, UNITEXT, NCHAR, NVARCHAR,

CHAR, VARCHAR and TEXT for Unicode UTF8 Character Set Instances

U

SING

D

ATA

E

DITOR

Data Editor lets you edit data in your tables with any editable datatype without leaving the parent application. Data Editor lets you use your new data immediately.

CAUTION:

Data Editor is a real-time editor. Changes in your data using Data Editor are permanent.

The table below describes the functions and options of the Data Editor:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 893

D A TA E D I TO R > D A T A E D I T O R

Option

Live

Batch

Description

Edits data one row at a time. You must execute when you leave the row.

Edits data in multiple rows before executing.

NOTE:

You can also use the Data Editor to edit date and time functions in a table. For details,

see Editing Date and Time Functions .

NOTE:

If you make an incorrect edit in a cell, Data Editor displays the error on the Error Tab of the ISQL Editor. Data Editor does not incorporate this error(s) in data into the table.

Data Editor saves any changes in data prior to the error message.

CAUTION:

Data Editor is a real-time editor. Changes in your data using Data Editor are permanent.

For more information, see:

Data Editor Edit Window

Data Editor ISQL Window

Data Editor Filter

Editing Date and Time Functions

Using Data Editor

Default Value Handling

E

DITING

D

ATE AND

T

IME

F

UNCTIONS

The Data Editor lets you edit date and time functions in a table. Data Editor uses a calendar tool to guarantee accurate input for date and time data. You can also change the display of date and time using the Date/Time Format Builder.

For more information, see:

Data Editor Toolbar

Editing Date and Time Functions

D

ATE

/

TIME

F

ORMAT

B

UILDER

The Date/Time Format Builder lets you customize your date/time display. The Data Editor uses this format to display your dates and times. You control how the Data Editor displays the dates and time by using predefined formats, or by customizing a format to fit your needs.

89 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D AT A E D IT OR > DA TA E D IT O R

The Data Editor uses the default date/time format of your Operating System. If you do not make any global changes in DBArtisan, the Date/Time Format Builder displays dates and times using the default formats of your operating system.If you make changes to dates and times in the Data

Editor, DBArtisan commits the changes in the format used by the database.

NOTE:

The changes you make using the Date/Time Format Builder do not affect the way your database stores dates and times.

E

DITING THE

D

ATE

/

TIME

D

ISPLAY

You can edit the date/time display on a global, table, or column level. The table below describes the different ways you can edit your date/time format display:

Option

Global

Grid

Description

Lets you make global changes to the Data Editor date display from the Data

Editor Tab of the Options Editor

. For details, see Editing date/time globally .

Access

Options Editor

Lets you make changes to the date display of the entire Data Editor grid for that

session only. For details, see Editing grid date/time

.

Data Editor grid

Column Lets you make changes to the date display of a single column in the Data Editor

for that session only. For details, see Editing column date/time

.

Data Editor column

NOTE:

Date/Time formats changed on a table or column level are valid for that session only.

Editing date/time globally

You can use the Options Editor to make global changes to your date/time display in the Data editor. When you change the date/time format, using the Options Editor, the Data Editor displays all dates and times in the global manner. To change the date/time display for a

particular session, see Editing grid date/time or

Editing column date/time .

To edit the date and time globally, do the following:

1 On the File menu, click Options.

DBArtisan opens the Options Editor.

2 On the Options Editor, click the Data Editor Tab.

3 On the Data Editor Tab, click ...

DBArtisan opens the Date/Time Format Builder dialog box.

4 On the Date/Time Format Builder dialog box, click the Date/Time Format list, and then click the target predefined date/time format.

5 To customize the date/time format to your specifications, click Customize.

DBArtisan opens the Date/Time Format Builder dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 895

D A TA E D I TO R > D A T A E D I T O R

6 On the Date/Time Format Builder dialog box, select the appropriate Date/Time Format

Options:

Option

Date/Time Format

Day Format

Separator

Month Format

Year Format

Date Order

Hour Format

Minute

Sec Format

AM/PM

Date/Time Order

Format Display

Sample

Description

Displays the predefined Date/Time format.

Lets you choose the day display.

Lets you choose the display separator between the day, month, and year.

Lets you choose the month display.

Lets you choose the year display.

Lets you choose the date order display.

Lets you choose the hour display.

Lets you choose the minute display.

Lets you choose the second display.

Lets you choose the AM/PM display.

Lets you choose the date/time order display.

Displays the current format.

Displays a sample of the current format.

7 When you have finished selecting the Date/Time format options, click OK.

DBArtisan accepts the date/time format changes and closes the Date/Time Format Builder dialog box.

8 On the Options Editor, select the appropriate Default Date/Time Format options:

Option

Use Calendar Control as default

Description

If selected, DBArtisan uses the Calendar Control window. For details,

see Editing Date and Time Functions .

Two-digit year system setting warning If selected, DBArtisan sends a warning when you use a two-digit year system setting.

9 Click OK.

DBArtisan accepts the Default Date/Time Format changes and closes the Options Editor.

NOTE:

To use a different format for a particular session, change the date/time at the session level.

Editing grid date/time

You can change the date/time display for a particular session when working in the Data Editor.

The Data Editor does not maintain the format changes once you close your session. To make this

display permanent, use the Editing Global Date/Time Format. For details, see Editing date/time globally .

89 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D AT A E D IT OR > DA TA E D IT O R

To edit the grid date and time, do the following:

1 On the Datasource Explorer, select the target table.

2 Right-click the table, and then click Edit Data.

DBArtisan opens the Data Editor.

3 On the Data Editor tool bar, click Date/Time Format Builder.

DBArtisan opens the Date/Time Format Builder.

4 On the Date/Time Format Builder, click the Date/Time Format list, and then click the target predefined date/time format.

5 To customize the date/time format to your specifications, click Customize.

DBArtisan opens the Date/Time Format Builder dialog box.

6 On the Date/Time Format Builder dialog box, select the appropriate Date/Time Format

Options:

Option

Date/Time Format

Day Format

Separator

Month Format

Year Format

Date Order

Hour Format

Minute

Sec Format

AM/PM

Date/Time Order

Format Display

Sample

Description

Displays the predefined Date/Time format.

Lets you choose the day display.

Lets you choose the display separator between the day, month, and year.

Lets you choose the month display.

Lets you choose the year display.

Lets you choose the date order display.

Lets you choose the hour display.

Lets you choose the minute display.

Lets you choose the second display.

Lets you choose the AM/PM display.

Lets you choose the date/time order display.

Displays the current format.

Displays a sample of the current format.

7 When you have finished selecting the Date/Time format options, click OK.

DBArtisan accepts the date/time format changes and closes the Date/Time Format Builder dialog box.

• To undo changes, on the Data Editor tool bar, click Undo Change.

• To redo changes, on the Data Editor tool bar, click Redo Change.

NOTE:

Date/Time formats changed on a table level are valid for that session only.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 897

D A TA E D I TO R > D A T A E D I T O R

Editing column date/time

You can change the date/time display for a particular column when working in the Data Editor.

The Data Editor does not maintain the format changes once you close your session. To change

the format for the entire grid, see Editing Grid Date/Time Format. For details, see Editing grid date/time

.

To make this display permanent, Editing Global Date/Time Format. For details, see Editing date/time globally

.

To edit the column date and time, do the following:

1 On the Datasource Explorer, select the target table.

2 Right-click the table, and click Edit Data.

DBArtisan opens the Data Editor.

3 On the Data Editor, click the column header to select the column.

4 Right-click the column and click Format.

DBArtisan opens the Date/Time Format Builder.

5 On the Date/Time Format Builder dialog box, click the Date/Time Format list, and then click the target predefined date/time format.

6 To customize the date/time format to your specifications, click Customize.

DBArtisan opens the Date/Time Format Builder dialog box.

7 On the Date/Time Format Builder dialog box, select the appropriate Date/Time Format

Options:

Option

Date/Time Format

Day Format

Separator

Month Format

Year Format

Date Order

Hour Format

Minute

Sec Format

AM/PM

Date/Time Order

Format Display

Sample

Description

Displays the predefined Date/Time format.

Lets you choose the day display.

Lets you choose the display separator between the day, month, and year.

Lets you choose the month display.

Lets you choose the year display.

Lets you choose the date order display.

Lets you choose the hour display.

Lets you choose the minute display.

Lets you choose the second display.

Lets you choose the AM/PM display.

Lets you choose the date/time order display.

Displays the current format.

Displays a sample of the current format.

89 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BA RC A D ERO PRODU C TS > E MB ARC ADE RO PRO D U C TS

8 When you have finished selecting the Date/Time format options, click OK.

DBArtisan accepts the date/time format changes and closes the Date/Time Format Builder dialog box.

• To undo changes, on the Data Editor tool bar, click Undo Format.

• To redo changes, on the Data Editor tool bar, click Redo Format.

NOTE:

Date/Time formats changed on a column level are valid for that session only.

D

EFAULT

V

ALUE

H

ANDLING

When adding new records, when the transaction committing a row occurs, if no value has been entered for a column defined as having a default value, the default value is used for that column and validation is not required. The default value is not visible in the Data Editor grid until you commit the record and use the Reload Data button to refresh the grid.

In the case of tables with all columns defined as having default values, for example, you can add multiple records by repeatedly clicking the Insert New Record and Save Current Row buttons.

Page setup

The table below describes the options and functionality on the Page Setup dialog box:

Option

Margins

Titles and Gridlines

Preview

Page Order

Center on Page

Functionality

Lets you select the size of the left, right, top, and bottom margins.

Lets you select options.

Displays how the table will appear when printed.

Lets you specify when to print columns and rows.

Lets you select how table floats on the page.

E

MBARCADERO

P

RODUCTS

The Tools menu lists all installed Embarcadero Technologies products. This lets you toggle to or start another Embarcadero product.

P

ERFORMANCE

C

ENTER

If you have Performance Center installed on a server, DBArtisan lets you view performance metrics across all of your Performance Center monitored datasources.

NOTE:

This feature requires only a Performance Center server definition. No client upgrade is required. For details, see

Perf Center Options

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 899

COD E WOR KBE NCH > CO DE WORK BENCH

Performance Center offers an automated strategy for identifying problems that threaten the availability and performance of critical Oracle®, Sybase and Microsoft SQL Server databases.

Embarcadero Performance Center ensures that relational database management systems enjoy maximum up-time and exhibit performance that exceeds user expectations. It quickly identifies performance problems, and helps prioritize performance-tuning workloads to keep your databases performing at peak efficiency.

TIP:

On the Perf Center Tab of the Options Editor, you can specify your Performance

Center server definition and whether the DBArtisan opens the standard client

(PerfCntr.exe) or the Web Client URL.

For more information, Using the Performance Center Web Client Within DBArtisan

.

U

SING THE

P

ERFORMANCE

C

ENTER

W

EB

C

LIENT

W

ITHIN

DBA

RTISAN

To open the Performance Center web client, do the following:

1 On the Tools toolbar, select Performance Center.

OR

On the Tools menu, select Performance Center.

The first time you launch the Performance Center Web Client from DBArtisan, DBArtisan opens the Select Performance Center Server dialog box.

2 In Computer Name or IP Address specify where the Performance Center Server is installed.

3 In Port Number specify the port for the Apache or IIS server.

4 To verify the settings, click Test.

DBArtisan displays the Performance Center Server Test Results dialog box.

5 Click Close.

DBArtisan returns to the Select Performance Center Server dialog box.

6 To hold these setting for future use, click OK.

DBArtisan opens Performance Center.

C

ODE

W

ORKBENCH

The Code Workbench tool reduces the time needed for the most common day-to-day coding tasks. The Code Workbench lets you:

• Define auto replacement expressions that can be used to quickly insert commonly used blocks of SQL syntax or commands.

90 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C O D E WO R K B EN C H > C OD E WOR K B E N C H

• Import and Export Code Workbench settings for client sharing purposes.

NOTE:

No privileges are required to use the Code Workbench options.

Important Notes

When installing DBArtisan on a machine that already has Rapid SQL 7.3 or DBArtisan 7.3 or later, the Code Workbench settings are not installed by default. This is to protect any modifications that have been made to the current settings. To import the settings that are shipped with the latest release, select Tools, Code Workbench. Select the Import Settings option, navigate to the main DBArtisan installation folder, and select codeworkbench.xml.

CAUTION:

This will overwrite the current settings.

The table below describes the options and functionality on the Code Workbench dialog box.

Tab

Settings

Option

Enable Auto Replace

Replace substrings

Auto Replace Add/Edit/Clone

Delete

Import Settings

Export Settings

Restore Settings

Description

When enabled, you can define simple keystrokes that will be automatically replaced with predefined expressions when some activation keyboard event is performed (space, new line, special character, etc.). This also lets you define correction actions for common misspellings or SQL syntax coding errors.

When selected, this lets you enable automatic replacement for substrings: simple keystrokes will be automatically replaced with predefined expressions when some activation keyboard event is performed (space, new line, special character, etc.). This also lets you define correction actions for common misspellings or SQL syntax coding errors.

Click to open the Edit Auto Replace Expression dialog box. For

details, see Using Code Workbench Auto Replace Shortcuts in the

ISQL Window

.

Click to delete the selected auto replace expression.

Click to import settings from a local or network directory.

Click to export your settings to a local or network directory.

Click to restore the Code Workbench settings to the original settings.

Common Tasks

Creating and Modifying Code Workbench Auto Replace Shortcuts

Using Code Workbench Auto Replace Shortcuts in the ISQL Window

Importing and Exporting Settings in Code Workbench

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 901

COD E WOR KBE NCH > CO DE WORK BENCH

Common Tasks

Creating and Modifying Code Workbench Auto Replace Shortcuts

Using Code Workbench Auto Replace Shortcuts in the ISQL Window

Importing and Exporting Settings in Code Workbench

C

REATING AND

M

ODIFYING

C

ODE

W

ORKBENCH

A

UTO

R

EPLACE

S

HORTCUTS

The Edit Auto Replace Expression dialog box lets you define shortcut expressions for commonly used SQL syntax or commands. You can define what keys or key combination activate the auto replacement of the defined shortcut.

1 Select Tools, Code Workbench.

2 On the Auto Replace Tab, select Add.

3 In Expression type a new expression.

4 In Activation type activation information. For example, CTRL+SPACE.

5 In Replace With type replace with information.

6 Click OK.

The replace expression is now ready for use in the ISQL Window.

For more information, see:

Using Code Workbench Auto Replace Shortcuts in the ISQL Window

Code Workbench

U

SING

C

ODE

W

ORKBENCH

A

UTO

R

EPLACE

S

HORTCUTS IN THE

ISQL

W

INDOW

When Enable Auto Replacement is selected on the Setting Tab of the Code Workbench, you can type a replace expression in the ISQL Window instead of typing a complete command.

1 Select File, New, and then SQL.

2 In the ISQL Window, type a replace expression. For example, type beg.

The application displays begin.

For more information, see

Code Workbench .

90 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C O D E WO R K B EN C H > C OD E WOR K B E N C H

I

MPORTING AND

E

XPORTING

S

ETTINGS IN

C

ODE

W

ORKBENCH

The feature helps standardize your application settings. Exporting settings is useful when you want to give your auto replace expressions to another ISQL Window user. Importing settings is useful when another user wants to give you their auto replace expressions.

Importing Settings

1 Select Tools, Code Workbench.

2 Click Import Settings.

Code Workbench opens the Open dialog box.

3 Locate the .xml file, and then click Open.

Code Workbench imports the settings.

Exporting Settings

1 Select Tools, Code Workbench.

2 Click Export Settings.

Code Workbench opens the Save As dialog box.

3 Specify a location, and file name, and then click Save.

Code Workbench saves your settings as an .xml file. You can send the .xml file to the user you want to import your settings.

For more information, see

Code Workbench .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 903

COD E WOR KBE NCH > CO DE WORK BENCH

90 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R M I S S I O N S M A N A G E M E N T > P E R M I S S I O N S M A N A G E M E N T

P

ERMISSIONS

M

ANAGEMENT

DBArtisan includes permissions management capabilities that include:

• Explicit Permissions

• Cascading Permissions

• Using Roles to Grant Permissions and Privileges

• Using Roles to Revoke Permissions and Privileges

• Grant Privilege(s) To

• Revoke Privilege(s) From

• Deny Privileges From

E

XPLICIT

P

ERMISSIONS

Explicit permissions are permissions specifically granted by one user to another. Granting a permission is an integral part of database security and management. DBArtisan tracks explicit permission changes across your enterprise. Multiple explicit permissions can be consolidated in roles. Different groups and roles can share permissions for an object. DBArtisan lets you grant permissions with the Roles Editor. Embarcadero lets you edit permissions on the Privileges tabs of the object editors.

TIP:

The Admin option is similar to the grantable option for privileges. If the user has the admin option, they can grant that role to other people.

TIP:

In most cases, you will want to make all roles granted, default roles. If you do not make a role default for a user, they will have to enable it with a SQL command. To avoid this complication, assign roles as default unless business rules specify otherwise.

TIP:

The Grantable option gives the user the ability to grant that privilege to other users.

Use the Grantable option SPARINGLY.

For more information, see

Permissions Management

.

C

ASCADING

P

ERMISSIONS

Cascading permissions are the path of privileges granted from one user to another user, group, or role. Using cascading permissions is a way to manage multiple sets of permissions and privileges for groups of users. When you drop a user with a revoke cascade command, all permissions and privileges granted by the dropped user are also revoked. Embarcadero lets you edit and set grant permission parameters with the Permissions Editor.

Once a user with grant permission privileges is dropped with cascade, reinstate permissions for all affected users.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 905

P E R M I S S I O N S M A N AG E M E N T > P E R M I S S I O N S M AN A G E M E N T

For more information, see

Permissions Management

.

U

SING

R

OLES TO

G

RANT

P

ERMISSIONS AND

P

RIVILEGES

Roles are sets of user privileges you associate with access to objects within a database. Roles streamline the process of granting permissions. You can use roles to grant sets of permissions and privileges to users and groups. DBArtisan lets you grant permissions to roles with the Roles

Editor.

For more information, see

Permissions Management

.

U

SING

R

OLES TO

R

EVOKE

P

ERMISSIONS AND

P

RIVILEGES

Roles can be effective in revoking permissions and privileges from users. Rather than individually revoke permissions from users, you can revoke groups of permissions from multiple users simultaneously using roles. DBArtisan lets you revoke permissions with the Roles Editor.

DBArtisan lets you identify existing users and their database permissions, and to detect and manage changes to user permissions by rolling change back or forward. DBArtisan lets you manage database permissions in a cross-platform database environment. and gives you the ability to compare objects/permissions and migrate them to other instances. Using the compare functionality for permissions management, DBArtisan gives you:

• Enhanced permissions management across the enterprise (Oracle, Sybase ASE, Microsoft

SQL Server, and IBM DB2 for Linux, Unix, and Windows).

• Faster detection of changed user rights.

• Ability to detect database accounts (users/logins) that are invalid.

• Rollback of invalid permissions in a single click.

• Archives of users, groups, roles and their permissions.

For more information, see

Permissions Management

.

G

RANT

P

RIVILEGE

(

S

) T

O

The Grant Privilege(s) To dialog box lets you select or clear the check boxes corresponding to the target privileges.

Permissions and privileges allow or limit access to system database administration and database objects. To manage databases, it is important to monitor who can access the enterprise structure and change the underlying schema. It is also important to monitor who can grant and revoke permissions and privileges in the enterprise. DBArtisan lets you manage permissions and privileges in the Grant Privilege(s) To dialog box.

90 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R M I S S I O N S M A N A G E M E N T > P E R M I S S I O N S M A N A G E M E N T

On the Privileges Tab of the editor, you can see whether a privilege was inherited from a role or group, or if it was granted explicitly by a user. DBArtisan also shows if the privilege is grantable

(granted with the GRANT OPTION.) The table below describes the icons:

Icon

Black check mark

Blue check mark

Green check mark

Red check mark

Two black check marks

Two blue check marks

Label

User

Group

Role

Denied

User/Grant

Group/Grant

Two green check marks Role/Grant

Description

The privilege(s) was granted explicitly by a user.

The privilege(s) was inherited from a group.

The privilege(s) was inherited from a role.

MICROSOFT SQL SERVER ONLY: The privilege(s) was denied from a security account in the current database.

The privilege(s) was granted by a user with the GRANTABLE option.

The privilege(s) was granted from a group with the GRANTABLE option.

The privilege(s) was granted from a role with the GRANTABLE option.

NOTE:

The available privileges depend on the target DBMS and object.

The table below describes the options and functionality on the Grant Privilege(s) From Dialog

Box:

Option

Privilege

Grantable

Description

Lets you select or clear the check boxes corresponding to the target privileges.

Select No to prevent cascading the privileges to other users.

The table below describes the object permissions:

Object

Index

Packages

Schema

Tables

Tablespaces

Views

Permission(s)

CONTROL

BIND, CONTROL, EXECUTE

ALTERIN, CREATIN, DROPIN (w/GRANT OPTION)

ALTER, CONTROL, DELETE, INDEX, INSERT, REFERENCES (& on column), SELECT,

UPDATE (& on column) (w/GRANT OPTION)

USE (w/GRANT OPTION)

CONTROL, DELETE, INSERT, SELECT, UPDATE (& on column) (w/GRANT OPTION)

For more information, see

Permissions Management

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 907

P E R M I S S I O N S M A N AG E M E N T > P E R M I S S I O N S M AN A G E M E N T

R

EVOKE

P

RIVILEGE

(

S

) F

ROM

The table below describes the options and functionality on the Revoke Privilege(s) From dialog box:

Option

Privilege

Cascade

Description

Lets you select or clear the check boxes corresponding to the target privileges.

Select No to prevent cascading the revocation privileges to other users.

For more information, see

Permissions Management

.

D

ENY

P

RIVILEGES

F

ROM

NOTE:

Deny Privileges is available for Microsoft SQL Server only.

The Deny Privileges From dialog box lets you deny a privilege from a security account in the current database.

also shows if the privilege is grantable (granted with the GRANT OPTION.) The table below describes the icons:

Icon

Black check mark

Blue check mark

Green check mark

Red check mark

Two black check marks

Two blue check marks

Label

User

Group

Role

Denied

User/Grant

Group/Grant

Two green check marks Role/Grant

Description

The privilege(s) was granted explicitly by a user.

The privilege(s) was inherited from a group.

The privilege(s) was inherited from a role.

MICROSOFT SQL SERVER ONLY: The privilege(s) was denied from a security account in the current database.

The privilege(s) was granted by a user with the GRANTABLE option.

The privilege(s) was granted from a group with the GRANTABLE option.

The privilege(s) was granted from a role with the GRANTABLE option.

NOTE:

The available privileges depend on the target DBMS and object.

The table below describes the options and functionality on the Deny Privilege(s) From dialog box:

Option

Privilege

Cascade

Description

Lets you select or clear the check boxes corresponding to the target privileges.

Select No to prevent cascading the deny privileges to other users.

TIP:

On the editor, the Deny privilege can be Revoked, just as a Grant permission can be revoked.

For more information, see

Permissions Management

.

90 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

A

DD

-

ON TOOLS

Embarcadero Technologies offers add-on tools that enhance the usefulness of DBArtisan. The table below describes these add-on tools:

Add-on Tool

Embarcadero SQL

Debugger

Description

Provides detailed information about using the Embarcadero SQL

Debugger. It Includes a step-by-step walk through to familiarize you with the features of the Embarcadero SQL Debugger.

DBArtisan PL/SQL Profiler

Provides detailed information about using the DBArtisan PL/SQL

Profiler. Includes a step-by-step walk through to familiarize you with the features of the PL/SQL Profiler.

Capacity Analyst

The Capacity Analyst collects critical database storage, object, and performance metrics at scheduled intervals and provides visual analysis and reporting mechanisms that allow for historical trend analysis and forecasting.

Performance Analyst

Space Analyst

Backup Analyst

Performance Analyst is a robust client-side monitoring product that presents a complete picture of a database's performance.

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to help you effectively locate and troubleshoot bottlenecks and performance inefficiencies that result from the challenges of space management.

Backup Analyst increases the efficiency of performing and managing database backups.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 909

A D D -O N T O O L S >

91 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

E

MBARCADERO

SQL D

EBUGGER

The Embarcadero SQL Debugger lets you locate and fix bugs in the following elements:

• Procedures (IBM DB2 for Linux, Unix, and Widows, Microsoft SQL Server, Oracle, Sybase)

• Functions (Oracle)

• Triggers (IBM DB2 for Linux, Unix, and Widows, Microsoft SQL Server, Oracle, Sybase)

NOTE:

The SQL Debugger lets you debug triggers by debugging the procedures that call them.

NOTE:

For Oracle, you cannot debug packages, but you can debug the functions and procedures within packages.

NOTE:

For Oracle, you cannot debug any objects contained in the Exclusion List. For more

information, see Editing the Exclusion List

.

The table below describes the sections of this chapter:

Section

SQL Debugger Modules and DBMS

Support

Description

Describes the specific SQL Debugger modules and DBMS versions supported.

Embarcadero SQL Debugger Features

Setting up the Embarcadero SQL

Debugger

Embarcadero SQL Debugger Interface

Provides an overview of SQL Debugger functionality.

Provides details on requirements and setup tasks for each supported

DBMS.

Describes the Embarcadero SQL Debugger graphical interface that includes an editor window and four debug view windows.

Embarcadero SQL Debugger Functionality

This section describes the functionality on the SQL Debugger.

Using the Embarcadero SQL Debugger

Tutorial Sessions

This section describes how to run a debug session.

Provides walkthrough sessions for new users.

SQL D

EBUGGER

M

ODULES AND

DBMS S

UPPORT

There are four Embarcadero SQL Debugger modules, each corresponding to a supported

DBMS. Modules and DBMS support are as follows:

• Embarcadero SQL Debugger for IBM DB2 for Linux, Unix, and Windows - supports IBM DB2 for Linux, Unix, and Windows version 8 or later

• Embarcadero SQL Debugger for Microsoft - supports Microsoft SQL Server version 7.0 or later

• Embarcadero SQL Debugger for Oracle - supports all Oracle versions supported by

DBArtisan

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 911

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

• Embarcadero SQL Debugger for Sybase - supports Sybase 12 , 12.0 (special version), and

12.5

Each SQL Debugger version is an optional and separate add-on module.

E

MBARCADERO

SQL D

EBUGGER

F

EATURES

The Embarcadero SQL Debugger lets you identify problems within your code. The Embarcadero

SQL Debugger lets you:

• Interactively step through the flow of script execution.

• Examine the value of variables.

• Solve logical problems with your script design.

NOTE:

The Debugger is available on the DBArtisan main menu, the Procedures window, the

DDL Editor and ISQL windows.

The Embarcadero SQL Debugger offers fundamental debugging features and options to fine tune debugging. The table below describes these features:

Debugging Feature

Step Into

Description

Lets you execute each instruction step-by-step and step inside a stored object.

Step Out

Step Over

Lets you stop stepping through the current object and execute the remainder of the script. This option is only active when the pointer indicates a child dependent instruction.

Lets you execute the current instruction without stepping into any child dependents.

Insert or Remove Breakpoint

Lets you specify positions in a program where the debugger stops execution.

To set specific Debugger values on DBArtisan’s Options Editor, see

Embarcadero SQL

Debugger Options .

S

ETTING UP THE

E

MBARCADERO

SQL D

EBUGGER

The following topics describe requirements and tasks for those DBMS that have setup requirements:

Embarcadero SQL Debugger for Linux, Unix, and Windows Setup

The Embarcadero SQL Debugger for Microsoft Setup

Embarcadero SQL Debugger for Oracle Setup

In addition, you should set your debugger preferences at this time. For details, see

Embarcadero SQL Debugger Options .

91 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

E

MBARCADERO

SQL D

EBUGGER FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

S

ETUP

Embarcadero SQL Debugger for IBM DB2 for Linux, Unix, and Windows requires proper configuration of the server and client.

For more information, see:

Prerequisites for Adding and Compiling Stored Procedures

Configuring the IBM DB2 for Linux, Unix, and Windows Server for Procedures

Prerequisites for Debugging Procedures

P

REREQUISITES FOR

A

DDING AND

C

OMPILING

S

TORED

P

ROCEDURES

The Embarcadero SQL Debugger for IBM DB2 for Linux, Unix, and Windows requires the following products and components.

Client

• IBM DB2 for Linux, Unix, and Windows 8 or later

• DB2 Application Development Client

• DB2 Administration Client

• Communications Protocols

• Stored Procedure Builder

• Applications Development Interfaces

• System Bind Files

• DB2 Connect Server Support

• Documentation

• Base DB2 for Windows/Unix Support

• Administration and Configuration Tools

Server

• IBM DB2 for Linux, Unix, and Windows 8 or later

• DB2 Enterprise Edition

• Communications Protocols

• Stored Procedure Builder

• Applications Development Interfaces

• System Bind Files

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 913

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

• DB2 Connect Server Support

• Documentation

• Base DB2 for Windows/Unix Support

• Administration and Configuration Tools

• Microsoft Visual Studio, Visual C++

NOTE:

The server must have a local directory structure and file C:\program files\sqllib\function\routine\sr_cpath.bat. This file is installed with IBM DB2 8 and includes the C compiler options needed to compile the procedure on the server. If it is not found, install the IBM DB2 8 Administration and Configuration Tools option on the server.

C

ONFIGURING THE

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

S

ERVER FOR

P

ROCEDURES

DBArtisan lets you create procedures on the targeted server using DBArtisan.

To create or run any procedure, set up the configuration environment and enable the C compiler options on the server.

To configure your server, do the following:

1 Open a DB2 Command Window, and then type:

DB2set DB2_SQLROUTINE_COMPILER_PATH="C:\program files\sqllib\function\routine\sr_cpath.bat"

DB2 sets the DB2_SQLROUTINE_COMPILER_PATH DB2 registry variable to call the required initialization script for the C compiler on the server.

To enable the C compiler options on your server:

1 Open the file C:\program files\sqllib\function\routine\sr_cpath.bat.

2 Remove the REM (remarks) prefix on the lines that match the version of Visual Studio that is installed on the server. VCV6 = version 6.0 and VCV5 = version 5.0.

NOTE:

Only remove the REM prefix on the lines that apply to your installation of Visual Studio

3 Restart the DB2 services on the server.

P

REREQUISITES FOR

D

EBUGGING

P

ROCEDURES

To enable debugging on the server, do the following:

1 Open a DB2 Command window and type:

Db2set DB2ROUTINE_DEBUG=ON

NOTE:

Availability of this feature depends on your DBArtisan licensing. For more information,

see Licensing .

91 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

T

HE

E

MBARCADERO

SQL D

EBUGGER FOR

M

ICROSOFT

S

ETUP

Embarcadero SQL Debugger for Microsoft requires proper configuration of Server

Requirements and Client Requirements .

Important Note about Microsoft SQL Server 2000 Service Pack 4 (SP4)

When running Windows XP SP2, SQL Server 2000 SP4 is required on both the client and the server. To verify this is the case start MS Query Analyzer and press Help > About. The Version

SQL should be 8.00.2039.

Important Notes about Microsoft SQL Server 2000 Service Pack 3 (SP3)

By default, after you install Microsoft SQL Server 2000 Service Pack 3 (SP3), you cannot use the

DBArtisan's T-SQL Debugger.

You may receive the following error message if you try to use the T-SQL Debugger from

DBArtisan:

“Server: Msg 514, Level 16, State 1, Procedure sp_sdidebug, Line 1 [Microsoft][ODBC SQL

Server Driver][SQL Server]Unable to communicate with debugger on [SQL Server Name]

(Error = 0x80070005). Debugging disabled for connection 53.”

Microsoft has disabled T-SQL Debugger for Application using earlier T-SQL Debugger clients for security reasons. To enable T-SQL Debugger for these Applications, a member of the sysadmins server role, such as sa must explicitly enable debugging by running the following code:

Exec sp_sdidebug 'legacy_on'

NOTE:

You must repeat this procedure whenever you restart the server.

S

ERVER

R

EQUIREMENTS

Embarcadero SQL Debugger for Microsoft requires:

• Windows 2005

• Windows 2000

• Microsoft SQL Server version 7.0 or later

Setting Up the Server

There are three parts to setting up the server:

1 Installing the Microsoft SQL Debugger Interface Subcomponent

2 Configuring the Service

3 Configuring DCOM on the Server

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 915

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Enabling SQL Debugger for Microsoft on SQL Server SP3

SQL Debugging is disabled by default in SQL Server SP3 and greater. Please refer to Microsoft

Support for information regarding enabling the SQL Debugger for Microsoft on SQL Server SP3.

I

NSTALLING THE

M

ICROSOFT

SQL D

EBUGGER

I

NTERFACE

S

UBCOMPONENT

The Microsoft server must have the Development Tools, Debugger Interface subcomponent of

Microsoft SQL Server. To determine if the Debugger Interface subcomponent is installed, locate the following files in the \Program Files\Common Files\Microsoft Shared\SQL Debugging directory:

• SQLDBREG.exe

• SQLDBG.dll

If these files are not in the \Program Files\Common Files\Microsoft Shared\SQL Debugging directory, install them before running the Embarcadero SQL Debugger for Microsoft.

To install the Debugger Interface subcomponent on the server after the initial installation:

1 Start Microsoft Visual Studio, Enterprise Edition Setup.

OR

Start Microsoft SQL Server Setup.

2 Select Custom Install.

Microsoft SQL Server opens the Select Components dialog box.

3 In the Components box, select the Development Tools check box.

4 In the Sub-components box, select the Debugger Interface check box.

5 Click Next.

Microsoft SQL Server proceeds through the Microsoft SQL Server wizard to install the components.

For more information, see Server Requirements .

C

ONFIGURING THE

S

ERVICE

To configure the service, see the instructions for your server operating system:

• Windows 2000

Windows 2000

1 On the Windows taskbar, click the Start button, click Settings, and then click Control Panel.

2 Double-click Administrative Tools, and then click Services.

Windows opens the Services explorer.

91 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

3 In the right pane of the Services explorer, right click MSSQLServer, and then click Properties.

Windows opens the Net Logon Properties dialog box.

4 Click the Logon Tab.

5 Select the This Account option button.

6 In the This Account box, type (or browse to locate) the logon user account (including domain name, if necessary) of the person who will be using the Embarcadero SQL Debugger for

Microsoft.

NOTE:

This person needs admin permissions on the server.

7 In the Password and Confirm Password boxes, type the password.

8 Click Apply.

9 Click the General Tab.

10 Click Start.

Windows starts the server and applies the changes.

Important Note about Microsoft SQL Server 2000 Service Pack 4 (SP4)

When running Windows XP SP2, SQL Server 2000 SP4 is required on both the client and the server. When running Windows XP SP2, SQL Server 2000 SP4 is required on both the client and the server. To verify this is the case start MS Query Analyzer and press Help > About. The Version

SQL should be 8.00.2039.

Important Notes about Microsoft SQL Server 2000 Service Pack 3 (SP3)

By default, after you install Microsoft SQL Server 2000 Service Pack 3 (SP3), you cannot use the

DBArtisan's T-SQL Debugger.

You may receive the following error message if you try to use the T-SQL Debugger from

DBArtisan:

“Server: Msg 514, Level 16, State 1, Procedure sp_sdidebug, Line 1 [Microsoft][ODBC SQL

Server Driver][SQL Server]Unable to communicate with debugger on [SQL Server Name]

(Error = 0x80070005). Debugging disabled for connection 53.”

Microsoft has disabled T-SQL Debugger for Application using earlier T-SQL Debugger clients for security reasons. To enable T-SQL Debugger for these Applications, a member of the sysadmins server role, such as sa must explicitly enable debugging by running the following code:

Exec sp_sdidebug 'legacy_on'

NOTE:

You must repeat this procedure whenever you restart the server.

For more information, see

Configuring the Service .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 917

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

C

ONFIGURING

DCOM

ON THE

S

ERVER

To configure DCOM on the server, do the following:

1 After the server restarts, on the Windows taskbar, click the Start button, and then click Run.

2 In the Open box, type dcomcnfg.exe.

3 Click OK.

Windows opens the Distributed COM Configuration Properties dialog box.

4 Click the Default Security Tab.

5 In the Default Access Permissions box, click Edit Default.

Windows opens the Registry Value Permissions dialog box.

6 Click Add.

Windows opens the Add Users and Groups dialog box.

7 In the Names box, select SYSTEM, and then click Add.

8 Click the Type of Access list, and then click Allow Access.

9 To let any user use the Embarcadero SQL Debugger for Microsoft, grant them remote access on the server. To grant remote access, configure their DCOM permissions on the server. In the Names box, click the target users, and then click Add.

NOTE:

You can add individual users or groups.

10 Click the Type of Access list, and then click Allow Access.

11 Click OK.

12 Restart the server to apply the changes.

For more information, see Server Requirements .

C

LIENT

R

EQUIREMENTS

There are three categories of client requirements for the Embarcadero SQL Debugger for

Microsoft:

• Operating System

• Client Connectivity

• Installing the Microsoft SQL Debugger Interface Subcomponent

O

PERATING

S

YSTEM

The client must be running one of the following operating systems:

• Microsoft Windows 95

91 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

• Microsoft Windows 98

• Microsoft Windows XP

For more information, see Client Requirements .

C

LIENT

C

ONNECTIVITY

When running the Debugger on SQL Server 2005 Clients

Before you proceed, verify that the file ssdebugps.dll is registered on the client machine. This file is REQUIRED for debugging and Microsoft only installs it on the server machine and not as a part of a client-only install.

Next you must configure DCOM by following these steps:

1 At a command prompt, type dcomcnfg, and then press ENTER.

Component Services opens.

2 In Component Services, expand Component Services, expand Computers, and then expand

My Computer.

3 On the toolbar, click the Configure My Computer button.

The My Computer dialog box appears.

4 In the My Computer dialog box, click the COM Security tab.

5 Under Access Permission, click Edit Limits.

The Access Permission dialog box appears.

6 Under Group or user names, click ANONYMOUS LOGON.

7 Under Permissions for ANONYMOUS LOGON, select the Remote Access check box, and then click OK.

Finally, you need to go to the Default Properties tab of the MyComputer dialog.

1 Select None in the Default Authentication Level dropdown menu.

2 Select Impersonate in the Default Impersonation Level dropdown menu.

For more detailed information, you can refer to Microsoft’s Help: :http://support.microsoft.com/ default.aspx?kbid=833977#XSLTH4134121124120121120120

When running Windows XP SP2, SQL Server 2000 SP4 is required on both the client and the server.

For Microsoft SQL the client must have the Client Connectivity component of Microsoft SQL

Server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 919

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

For Microsoft SQL Server

The client must have the Development Tools, Debugger Interface subcomponent of Microsoft

SQL Server. To determine if the Debugger Interface subcomponent is installed, locate the following files in the \Program Files\Common Files\Microsoft Shared\SQL Debugging directory:

• SQLDBREG.exe

• SQLDBG.dll

If these files are not in the \Program Files\Common Files\Microsoft Shared\SQL Debugging directory, install them before running the Embarcadero SQL Debugger for Microsoft.

Installing the Microsoft SQL Debugger Interface on the Client

To install the Debugger Interface subcomponent on the client, do the following:

1 Start the Microsoft SQL Server Setup program.

2 Select Custom Install.

Microsoft SQL Server opens the Select Components dialog box.

3 In the Components box, select the Development Tools check box.

4 In the Sub-Components box, select the Debugger Interface check box.

5 Click Next.

Microsoft SQL Server proceeds through the Microsoft SQL Server Wizard to install the components.

For more information, see Client Requirements .

E

MBARCADERO

SQL D

EBUGGER FOR

O

RACLE

S

ETUP

The only task required in setting up the Embarcadero SQL Debugger for Oracle is

Editing the

Exclusion List .

E

DITING THE

E

XCLUSION

L

IST

Upon installation, DBArtisan sets up an Exclusion List on your computer which includes packages that the application cannot debug. The Exclusion List is located in the DBArtisan directory. You can add or remove packages from this file by editing the Exclusion List.

To Edit the Exclusion List, do the following:

1 Open the Exclusion List, deborcex.etd, in a text editor, such as Microsoft Notepad or

WordPad.

2 To add a package, enter the name of the package at the end of the list. Use the following format: OWNER.OBJECT_NAME.

NOTE:

Press ENTER after each item on the list.

92 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

3 To remove a package from the Exclusion List, delete the package from the list.

NOTE:

Embarcadero SQL Debugger for Oracle does not debug a package function or package procedure listed on the Exclusion List.

4 Save the changes to deborcex.etd.

E

MBARCADERO

SQL D

EBUGGER

O

PTIONS

You can specify debugger options from the Debug Tab of DBArtisan’s Options editor. The

Debug Tab of the Options Editor lets you set the duration of your debug initialization and debug session, enable DBMS output, and refresh dependencies.

Setting Debugger Options

To set debugger options, do the following:

1 On the File menu, click Options.

DBArtisan opens the Options Editor.

2 On the Debug Tab, specify debugger options. The table below describes the options available:

Option Description

Initialization Timeout (seconds) Specifies the number of seconds DBArtisan tries to initialize the debugger. If it cannot initialize the debugger in the specified time, a message displays in the Debug Output window.

Debug Session Timeout (seconds) Specifies, in seconds, the length of your debug session.

Enable DBMS Output

Refresh Dependencies for each run

Toggles the print output. Enable this option if you use dbms_output.put_line calls in your procedures and you want these lines displayed.

Refreshes dependencies for each run. This potentially timeconsuming process is useful if the target procedure has rapidly varying dependencies that can require updating during the debugging process.

Default

60

7200

Selected

Cleared

3 Click Close.

DBArtisan closes the Options Editor.

For more information, see

Embarcadero SQL Debugger Interface

and Embarcadero SQL

Debugger Functionality

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 921

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

E

MBARCADERO

SQL D

EBUGGER

I

NTERFACE

The Embarcadero SQL Debugger includes an editor window and four debug view windows

.

When you open a debug session

,

DBArtisan

extracts the code for the object into a DDL Editor and opens four debug view windows at the bottom of the screen

.

The four debug view windows are optional, dockable windows designed to let you debug your script

.

TIP:

All Embarcadero debuggers display Performance Metrics that let you measure the execution time of each statement in the debug session.

The Embarcadero SQL Debugger includes five windows:

1 DDL Editor Window

2 Watch Window

3 Variables Window

4 Call Stack Window

5 Dependency Tree Window

Working with SQL Debugger Windows

DBArtisan lets you resize, move, dock and float the following windows:

• Watch Window

• Variables Window

• Call Stack Window

• Dependency Tree Window

1 To resize the target window, click its frame and drag it.

DBArtisan resizes the window.

2 To move and dock the target window, click its grab bar and drag it.

DBArtisan moves the window to its new location and docks it with surrounding windows.

3 To float the target window, press Shift, then click its grab bar and drag it.

DBArtisan frames the window in its own floating frame and moves the window to its new location.

DDL E

DITOR

W

INDOW

The DDL Editor displays your code in read-only format. When you start debugging, the

Embarcadero SQL Debugger extracts your code into a DDL Editor. The DDL Editor uses the default DBArtisan syntax coloring.

92 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

For more information, see

Embarcadero SQL Debugger Interface

.

NOTE:

For Oracle, DBArtisan displays LOB datatypes, and REF CURSOR variables, in the

Results Tab.

W

ATCH

W

INDOW

The Watch window displays the watch variables for the database object you are debugging. The

Watch window also lets you specify variables you want to evaluate or modify while debugging your program.

For example, to check what happens when a variable (x) has a value of 100, you can double-click the variable in the DDL Editor, drag it into the Watch Window, and change the value to 100.

When you execute the script, the Debugger uses the value x =100. This window is only visible when the SQL Debugger is active.

NOTE:

Until you step at least once into a script, variables are not defined. Therefore, step at least once before dragging or typing a local variable in the Watch Window.

NOTE:

You can type a fully qualified record variable into the Watch window.

NOTE:

When you exit a debug session and reenter it, the Embarcadero SQL Debugger retains any watch variables or breakpoints you have set.

Opening and Closing the Watch Window

To open and close the Watch Window, do the following:

1 On the Debug Menu, on the Debug Views sub-menu, select or clear Watch.

OR

Press ALT+3.

Setting a Watch Variable

To set a Watch Variable, do the following:

1 In the DDL Editor, double-click the target variable and drag it to the Watch window.

NOTE:

Microsoft SQL Server requires that local variables begin with @. Drag the @ to the

Watch Window.

2 In the Watch window, change the value of the variable.

3 On the DDL Editor, click Debug or Go.

The Embarcadero SQL Debugger executes the script using the new variable.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 923

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Removing a Watch Variable

To remove a Watch variable, do the following:

1 In the Watch window, click the target variable and press DELETE.

For more information, see

Embarcadero SQL Debugger Interface

.

V

ARIABLES

W

INDOW

The Variables window displays the local variables and their current values during script execution.

NOTE:

You cannot edit the variables in the Variables window.

If the DDL Editor displays an external database object, and that object is a dependent of the object you are debugging, then the Variables Window automatically refreshes and displays the variables for that particular object. The Variables Window is only visible when the Debugger is active.

The Embarcadero SQL Debugger also lets you monitor your variables while debugging.

Opening and Closing the Variables Window

To open and close the Variables Window, do the following:

1 On the Debug Menu, on the Debug Views sub-menu, select or clear Variable.

OR

Press ALT+4.

Monitoring Variables

To monitor the values of your variables while debugging, do the following:

1 In the SQL Editor, hold the pointer over the target variable.

DBArtisan opens a ScreenTip displaying the current value of that variable.

For more information, see

Embarcadero SQL Debugger Interface

.

C

ALL

S

TACK

W

INDOW

The Call Stack window displays the stack of currently active calls. The Call Stack Window is only visible when the Debugger is active.

92 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

Opening and Closing the Call Stack Window

To open and close the Call Stack Window, do the following:

1 On the Debug Menu, on the Debug Views sub-menu, select or clear Call Stack.

OR

Press ALT+5.

Using the Call Stack Window

To display a line of code that references the call in the DDL Editor, do the following:

1 In the Call Stack window, double-click the target line.

In the DDL Editor, DBArtisan displays a green arrow on the line of the referenced call.

For more information, see

Embarcadero SQL Debugger Interface

.

D

EPENDENCY

T

REE

W

INDOW

The Dependency Tree window displays any external database objects the script accesses.

DBArtisan displays these database objects in a hierarchical tree, with the child objects as database objects accessed by the parent objects. You can use this window to display the code for a dependent database object in the DDL Editor window. This window is only visible when the

Debugger is active.

Opening and Closing the Dependency Tree Window

To open and close the Dependency Tree Window, do the following:

1 On the Debug Menu, on the Debug Views sub-menu, select or clear Dependencies.

OR

Press ALT+6.

Displaying Dependencies

To display the code for a dependent database object in the DDL Editor window, do the following:

1 In the Dependency Tree window, double-click the target object.

DBArtisan displays the SQL of the target object in the DDL Editor window.

For more information, see

Embarcadero SQL Debugger Interface

.

E

MBARCADERO

SQL D

EBUGGER

F

UNCTIONALITY

The Embarcadero SQL Debugger offers the following functionality:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 925

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

• Input Parameters

• Step Into

• Step Out

• Step Over

• Run To Cursor

• Insert or Remove Breakpoint

• Toggle Breakpoint

Go

Stop

Restart

Break

Close

You must be running a debugging session to use these functions. For details, see Opening a

Debugging Session

.

I

NPUT

P

ARAMETERS

I nput parameters are set when you first create an object. If the object you want to debug requires input parameters, DBArtisan opens a dialog box to prompt you for the input parameters when you open a debugging session.

The Procedure Execution dialog box also lets you:

• Save input parameters as *.prm files to preserve specific input parameter configurations.

• Open *.prm files to save the effort of reentering specific input parameters.

• Reset parameters to their default setting.

92 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

The following table describes the options available in this dialog box:

Dialog box component Description

Owner drop-down list

Procedure drop-down list

Parameter window

Displays the current procedure’s owner

Displays the name of the current procedure.

Specify the required input parameters in this window. If input parameters are not required for the execution of the target procedure, a message appears in this window, stating that the procedure “has no input parameters. Press execute to run it.”

Open button

Save button

Reset button

Execute or Continue button

Click to open an Open dialog box, from which you can open an existing *.prm file. The saved parameters immediately populate the dialog box upon opening.

Click to save the values of your input parameters as a *.prm file. You can reopen a saved

*.prm file from this dialog box at any time.

Click to reset the parameters in the Parameter window to their default values.

Click to execute the procedure once you have entered values for all required parameters in the Parameter window.

NOTE:

You cannot debug a script that requires input parameters until you provide input parameters.

For more information, see

Embarcadero SQL Debugger Functionality

.

S

TEP

I

NTO

Step Into lets you execute the current instruction. If the current instruction makes a call to a stored SQL object, the Embarcadero SQL Debugger steps inside the nested child object.

To use the Step Into facility, do the following:

1 On the Debug menu, click Step Into.

OR

Press F11.

The Embarcadero SQL Debugger moves the arrow to execute the current instruction.

For more information, see

Embarcadero SQL Debugger Functionality

.

S

TEP

O

UT

Step Out lets you execute the remainder of the dependent child object and resumes line-byline, step-debugging in the parent object.

NOTE:

Step Out is only active when the pointer indicates a child dependent instruction.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 927

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

To use the Step Out facility, do the following:

1 On the Debug menu, click Step Out.

OR

Press SHIFT+F11.

The Embarcadero SQL Debugger stops stepping through the current object and executes the remainder of the script.

For more information, see

Embarcadero SQL Debugger Functionality

.

S

TEP

O

VER

Step Over lets you execute the current instruction without stepping into a nested child object if the instruction makes a call to a dependent object.

To use the Step Over, do the following:

1 On the Debug menu, click Step Over.

OR

Press F10.

The Embarcadero SQL Debugger executes the current instruction.

For more information, see

Embarcadero SQL Debugger Functionality

.

R

UN

T

O

C

URSOR

Run to Cursor lets you execute all instructions between the yellow arrow and the cursor.

To use the Run to Cursor facility, do the following:

1 Scroll down from the yellow arrow to the target line.

2 Click the target line.

Embarcadero SQL Debugger places the cursor on the target line.

3 On the Debug menu, click Run to Cursor.

OR

Press CTRL+F10.

The Embarcadero SQL Debugger executes all instructions between the pointer and the cursor.

For more information, see

Embarcadero SQL Debugger Functionality

.

92 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

I

NSERT OR

R

EMOVE

B

REAKPOINT

A breakpoint is a position in a program where a debugger stops execution. When you start debugging, Embarcadero SQL Debugger opens the script in a DDL Editor. A yellow arrow pointer indicates which line the Embarcadero SQL Debugger executes next.

The Embarcadero SQL Debugger executes all lines of code between the yellow arrow and the first breakpoint. If no breakpoints are present, Embarcadero SQL Debugger debugs the entire script.

While debugging you can set one or more breakpoints in the currently executing object or in any object in the program call stack. You can

Toggle Breakpoint

s, temporarily disable or enable breakpoints without having to add or remove breakpoints.

DBArtisan’s Embarcadero SQL Debugger displays each enabled breakpoint as a red dot in the left margin of the DDL Editor Window, and each disabled breakpoint as a red circle.

DBArtisan stores all breakpoints you set so that when you debug the same script on separate occasions, you can reuse the same breakpoints. You can insert a breakpoint on the line where your cursor is located, and you can remove a breakpoint on the line where your cursor is located.

NOTE:

Script execution stops at the first breakpoint.

To insert and remove breakpoints, do the following:

1 In the DDL Editor window, click the target line of SQL.

2 On the Debug menu, click Breakpoint.

OR

Press F9.

The Embarcadero SQL Debugger inserts a new breakpoint or removes an existing breakpoint on the target line of code.

For more information, see

Embarcadero SQL Debugger Functionality

.

T

OGGLE

B

REAKPOINT

After inserting a breakpoint, Toggle Breakpoint lets you enable or disable that breakpoint.

Embarcadero SQL Debugger displays each enabled breakpoint as a red dot in the left margin of the DDL Editor Window, and each disabled breakpoint as a red circle.

You can toggle any breakpoint in the DDL Editor window. When you exit a debugging session and reenter it, the Embarcadero SQL Debugger retains any breakpoints you set.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 929

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

To use the Toggle Breakpoint facility, do the following:

1 In the DDL Editor window, click the line of the target breakpoint.

2 On the Debug menu, click Enable/Disable Breakpoint.

OR

Press CTRL+F9.

The Embarcadero SQL Debugger toggles the breakpoint indicated by the pointer.

For more information, see

Insert or Remove Breakpoint.

G

O

Go lets you execute all instructions stopping only when it encounters a breakpoint or when the program is complete.

To use the Go facility, do the following:

1 On the Debug menu, click Go.

OR

Press F5.

The Embarcadero SQL Debugger executes all instructions.

For more information, see

Embarcadero SQL Debugger Functionality

.

S

TOP

Stop lets you halt the script execution and terminate the session.

To use the Stop facility, do the following:

1 On the Debug menu, click Stop Debugging.

OR

Press SHIFT+F5.

The Embarcadero SQL Debugger stops the script execution and terminates the session.

For more information, see

Embarcadero SQL Debugger Functionality

.

R

ESTART

Restart lets you terminate the current debug session and open a new one. When the new session opens, DBArtisan prompts you for new input parameters.

93 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

To use the Restart facility, do the following:

1 On the Debug menu, click Restart.

OR

Press CTRL+SHIFT+F5.

The Embarcadero SQL Debugger restarts the debug session.

For more information, see

Embarcadero SQL Debugger Functionality

.

B

REAK

Break lets you pause the debug session.

To use the Break facility, do the following:

1 On the Debug menu, click Break.

The Embarcadero SQL Debugger suspends the debug session.

For more information, see

Embarcadero SQL Debugger Functionality

.

C

LOSE

Close lets you close the DDL Editor and the Embarcadero SQL Debugger.

To use the Close facility, do the following:

1 On the DDL Editor toolbar, click Close.

OR

In the upper right corner of the window, click Close.

OR

In the DDL Editor window, right-click, and then click Close.

The Embarcadero SQL Debugger closes the debug session.

For more information, see

Embarcadero SQL Debugger Functionality

U

SING THE

E

MBARCADERO

SQL D

EBUGGER

This section offers a general overview of how to use Embarcadero SQL Debugger’s full range of debugging functionality.

Opening a Debugging Session

Debugging an SQL Script with Embarcadero SQL Debugger

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 931

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

O

PENING A

D

EBUGGING

S

ESSION

When you open a debugging session, DBArtisan opens the Embarcadero SQL Debugger

interface. For details, see Embarcadero SQL Debugger Interface .

If the target script requires input parameters, DBArtisan opens a dialog box prompting you for the necessary input parameters before displaying the target code in the SQL Editor window.

When DBArtisan displays the target script in the SQL Editor window, you can begin debugging.

For details, see Debugging an SQL Script with Embarcadero SQL Debugger

NOTE:

Embarcadero SQL Debugger for IBM DB2 for Linux, Unix, and Windows, mbarcadero

SQL Debugger for Sybase, and Embarcadero SQL Debugger for Microsoft only let you debug the SQL script of procedures or triggers.

To debug an object, do the following:

1 In the Datasource Explorer, click the object node.

DBArtisan displays the objects in the right pane of the application.

• Right-click the target object, and select Open.

DBArtisan opens the Object Editor.

OR

• Right-click the target object and select Extract.

DBArtisan opens the DDL Editor displaying the code of the target object.

2 On the toolbar, click Debug.

OR

In the DDL Editor window, right-click, and then click Debug.

If the script requests input parameters, DBArtisan opens a dialog box prompting for parameter values. If the script does not require input parameters, DBArtisan displays the

script in the DDL Editor window for you to begin debugging. For details, see Debugging an

SQL Script with Embarcadero SQL Debugger .

NOTE:

You cannot use the Embarcadero SQL Debugger until it has fully initialized.

3 In the dialog box, specify the appropriate parameter valuess, and then click OK or Continue.

DBArtisan displays the script in the DDL Editor window.

NOTE:

If the script requires Sybase or Oracle types (tables, records, or Booleans) as input parameters, the Embarcadero SQL Debugger generates an anonymous block.

D

EBUGGING AN

SQL S

CRIPT WITH

E

MBARCADERO

SQL D

EBUGGER

After you open a debugging session and enter any required input parameters, you can begin working with your script in the Embarcadero SQL Debugger.

93 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

Debugging an SQL Script

To debug a SQL Script, do the following:

1 On the Debug menu, click one of the SQL Debugger options ( Step Into

,

Step Over , and so

forth) or click Go.

NOTE:

You can monitor the progress of your debug session in the Variables window.

2 On the Debug menu, click Breakpoint.

OR

Press F9.

NOTE:

When you set a breakpoint, the Call Stack window shows what was called before the breakpoint.

NOTE:

You can use the

Run To Cursor

option to test the lines of code between a breakpoint and your cursor (indicated by the yellow arrow in the DDL Editor).

To check your variables:

1 In the DDL Editor, click a variable in your script and drag it to the Watch window.

2 In the Watch window, change the value of the watch variable, and then click Go to run your script and see the results of the new value.

To check a record in stored objects:

1 Drag the record to the Watch window.

2 In the Watch window, change the value of the record, then click Go to run your script and see the results of the new value.

To check the dependencies:

1 In the Dependency Tree window double-click the target dependent object to extract the code into a new DDL Editor.

2 Step through the script while monitoring the Dependency Tree Window.

3 When you finish debugging the script, click Close or Exit.

DBArtisan closes the T-SQL Debugger DDL Editor.

NOTE:

When you exit a debug session and reenter it, the Embarcadero SQL Debugger for

MSSQL retains any watch variables or breakpoints you have set.

T

UTORIAL

S

ESSIONS

The following topics provide walkthrough sessions geared to new users of the Embarcadero SQL

Debugger:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 933

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Debugging a Sample Script with Embarcadero SQL Debugger for Microsoft

Debugging a Sample Script with Embarcadero SQL Debugger for Oracle

D

EBUGGING A

S

AMPLE

S

CRIPT WITH

E

MBARCADERO

SQL D

EBUGGER FOR

M

ICROSOFT

This Getting Started section demonstrates basic debugging functionality. You will debug two procedures using the Embarcadero SQL Debugger for Microsoft.

The section topics are designed to familiarize you with basic debugging features and functionality:

• Getting Started with Embarcadero SQL Debugger for Microsoft

• Testing a Procedure

• Starting the Debugging Session

• Breakpoints

• Step Into

• Step Out

• Correcting the Script

G

ETTING

S

TARTED WITH

E

MBARCADERO

SQL D

EBUGGER FOR

M

ICROSOFT

This part of Debugging the Sample Script explains how to create the following two procedures to be used for debugging:

• check_modulo

• calculate_sum_with_overflow_bug

NOTE:

The procedure calculate_sum_with_overflow_bug intentionally includes a bug which prevents it from executing successfully. You will use the Embarcadero SQL Debugger for Microsoft to identify this bug.

The Getting Started section includes:

Creating Procedure 1

Creating Procedure 2

Confirming the Creation of the Procedures

93 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

C

REATING

P

ROCEDURE

1

Procedure 1, check_modulo, calculates the modulo of any two user-specified numbers. The user passes the numbers into the procedure as input parameters. The procedure returns the result as an output parameter. If the modulo equals zero, procedure execution returns the output “YES”.

If the modulo is not zero, procedure execution returns the output “NO”. This procedure is nested in the second procedure, calculate_sum_with_overflow_bug.

To create this procedure, open DBArtisan, connect to a MSSQL datasource, open a new SQL editor and, in the SQL editor, type or copy and paste the following code:

CREATE PROCEDURE

username.

check_modulo

@p_dividend_in INT,

@p_divisor_in INT,

@result VARCHAR(3)OUTPUT

AS

IF @p_dividend_in % @p_divisor_in = 0

SELECT @result = 'YES'

ELSE

SELECT @result = 'NO' go

NOTE:

For the purposes of this walk-through, this procedure was created under the user name

Spence. Before executing the DDL above, substitute your user name for the word

“username”.

1 Start DBArtisan.

2 Connect to a Microsoft SQL Server datasource.

3 On the Datasource menu, click the database node, and then click the target database.

NOTE:

For this walk-through, we recommend that you select a non-production database.

4 On the Main toolbar, click New.

OR

Press CTRL+N.

DBArtisan opens an SQL Editor in the current workspace.

5 In the SQL Editor, type the DDL for procedure check_modulo.

NOTE:

Substitute your user name once in the DDL for this procedure.

6 On the SQL Editor toolbar, click Execute.

DBArtisan executes the script and creates Procedure 1, then opens the SQL Editor Results

Tab with the results of the script execution. If you were not able to create the procedure, check the error messages to determine the problem.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 935

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

C

REATING

P

ROCEDURE

2

Procedure 2, calculate_sum_with_overflow_bug, requires two user-specified numbers as input parameters. Upon execution, the procedure calculates the sum of the all numbers divisible by five between the two user-specified numbers. This procedure calls sample procedure 1

(check_modulo) to calculate the modulo of the user-specified numbers.

NOTE:

The procedure calculate_sum_with_overflow_bug intentionally includes a bug which prevents it from executing successfully. You will use the Embarcadero SQL Debugger for Microsoft to identify this bug.

CAUTION:

When you input parameters, enter the smaller number in the @p_num1_in int box.

To create this procedure, open DBArtisan, connect to a MSSQL datasource, open a new SQL editor and, in the SQL editor, type or copy and paste the following code:

CREATE PROCEDURE

username.

calculate_sum_with_overflow_bug

@p_num1_in INT,

@p_num2_in INT,

@result TINYINT OUTPUT

/*INT-Integer (whole number) data from -2^31 (-2,147,483,648)

through 2^31 - 1 (2,147,483,647).

TINYINT-Integer data from 0 through 255.*/

AS

DECLARE @temp INT

DECLARE @temp_1 INT

DECLARE @v_divisor INT

DECLARE @v_condition VARCHAR(3)

SET @temp = @p_num1_in

SET @temp_1 = 0

SET @v_divisor = 5

SET @v_condition = 'NO'

WHILE 1=1

BEGIN

SELECT @temp = @temp + 1 /*Increase temp starting from p_num1*/

IF @temp = @p_num2_in /*Check if we reached p_num2*/

/*If yes, leave the LOOP*/

BREAK

/*Call Procedure 2 to check if number is divisable by 5*/

EXEC

username.

check_modulo @temp,@v_divisor,@result=@v_condition output

IF @v_condition = 'YES'

SELECT @temp_1 = @temp_1 + @temp

END /*WHILE LOOP*/

SELECT @result = @temp_1

RETURN go

NOTE:

For the purposes of this walk-through, this procedure was created under the user name

Spence. Before executing the DDL above, substitute your user name for the word

“username”.

93 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

Creating Procedure 2

1 Start DBArtisan.

2 Connect to a Microsoft SQL Server datasource.

3 On the Datasource menu, click the database node, and then click the target database.

NOTE:

For this walk-through, we recommend that you select a non-production database.

4 On the Main toolbar, click New.

OR

Press CTRL+N.

DBArtisan opens an SQL Editor in the current workspace.

5 In the SQL Editor, type the DDL for procedure calculate_sum_with_overflow_bug.

NOTE:

Substitute your user name twice in the DDL for this procedure.

6 On the SQL Editor toolbar, click Execute.

DBArtisan executes the script and creates Procedure 2, then opens the SQL Editor Results

Tab with the results of the script execution. If you were not able to create the procedure, check the error messages to determine the problem.

C

ONFIRMING THE

C

REATION OF THE

P

ROCEDURES

After you create Procedure 1 and Procedure 2, you can confirm their creation in DBArtisan’s

Datasource Explorer.

Confirming the Creation of the Procedures

To confirm the creation of the procedures, do the following:

1 On the Explorer Tab, click the Explorer list, and then click Organize By Owner.

The Explorer Tab refreshes with the new display configuration.

2 On the Explorer Tab, double-click the Databases node, and then double-click the target database node.

DBArtisan displays the list of object owners.

3 Double-click your user name to display a list of your objects.

4 Double-click Procedures to display a list of procedures and confirm the creation of check_modulo and calculate_sum_with_overflow_bug.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 937

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

T

ESTING A

P

ROCEDURE

After you confirm the creation of the procedures, execute the procedure calculate_sum_with_overflow_bug (which includes a bug) to view its error message. This procedure requires two integer input parameters: @p_num1_in int and @p_num2_in int. For all integers between these two integers, this procedure identifies those divisible by 5, and then returns their sum.

CAUTION:

When inputting parameters, enter the smaller number in the @p_num1_in int box.

Testing a Procedure

To test a procedure, do the following:

1 On the Explorer Tab, right-click calculate_sum_with_overflow_bug, and then click Execute.

DBArtisan opens the Procedure Execution window.

2 In the Value column of the @p_num1_in row, type 1.

3 In the Value column of the @p_num2_in row, type 11.

4 Click Execute.

DBArtisan compiles the procedure and opens a Results Tab, displaying the sum 15. There are two numbers between 1 and 11 that are divisible by 5: 5, and 10. The sum of these two numbers is 15.

5 On the Explorer Tab, right-click calculate_sum_with_overflow_bug, and then click Execute.

DBArtisan again opens the Procedure Execution window.

6 In the Value column of the @p_num1_in row, type 100.

7 In the Value column of the @p_num2_in row, type 121.

8 On the Procedure Execution window toolbar, click Execute.

DBArtisan returns an error stating “Arithmetic overflow occurred”.

Proceed to Starting the Debugging Session .

S

TARTING THE

D

EBUGGING

S

ESSION

After you test the procedure, open the procedure in Embarcadero SQL Debugger for Microsoft and enter input parameters before debugging.

To start the debugging session, do the following:

1 On the Explorer Tab, right-click the procedure, calculate_sum_with_overflow_bug, and then click Debug to start the debug session.

DBArtisan extracts the DDL for the procedure into a DDL Editor and opens the Procedure

Execution dialog box.

93 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

2 In the Value column of the @p_num1_in row, type 100.

3 In the Value column of the @p_num2_in row, type 121.

4 Click Continue.

DBArtisan closes the dialog box and opens the Embarcadero SQL Debugger interface.

The Embarcadero SQL Debugger includes the following five windows:

• DDL Editor Window

• Watch Window

• Variables Window

• Call Stack Window

• Dependency Tree Window

Proceed to Breakpoints .

B

REAKPOINTS

After you start the debugging session, insert a breakpoint into the code of the procedure calculate_sum_with_overflow_bug. Then run to the breakpoint. After you run to the breakpoint,

Embarcadero SQL Debugger displays a yellow arrow on the red breakpoint icon and populates the Variables Window with values for the following variables:

Variable

@temp

@p_num2_in

@p_num1_in

@temp_1

@result

@v_condition

@v_divisor

Value

Current number

Second input parameter

First input parameter

Sum of the numbers, between the input parameters, divisible by 5

Condition of the output parameter

Output parameter

Divisor

1 In the DDL Editor, scroll to and click the following line:

EXEC

username.

check_modulo @temp,@v_divisor,@result=@v_condition output

NOTE:

This line is located near the end of the procedure’s code.

2 On the Debug menu, click Breakpoint.

OR

Press F9.

DBArtisan inserts a breakpoint (indicated by a dot) next to the number of the target line.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 939

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

3 On the Debug menu, click Go.

OR

Press F5.

DBArtisan Embarcadero SQL Debugger for Microsoft displays the value of the variables before the breakpoint in the Variables Window.

Proceed to Step Into .

S

TEP

I

NTO

After setting the breakpoint, step into the dependent procedure, check_modulo.

To use the Step Into facility, do the following:

1 On the Debug menu, click Step Into.

OR

Press F11.

DBArtisan extracts the DDL for the dependent, nested procedure into the DDL Editor.

2 Step Into again.

DBArtisan executes the next part of the code and displays the values for the variables in the

Variables Window.

The Call Stack Window displays calls to the procedures.

Proceed to Step Out .

S

TEP

O

UT

After you Step Into the modulo_check (nested procedure) code, step back out and return to the calculate_sum_with_overflow_bug (outside procedure) code.

To use the Step Out facility, do the following:

1 On the Debug menu, click Step Out.

OR

Press SHIFT+F11.

DBArtisan opens the DDL Editor containing the code for calculate_sum_with_overflow_bug.

94 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

2 On the Debug menu, click Go.

OR

Press F5.

When the value of the variable, @temp is equal to the value of the variable, @p_num2_in, the WHILE LOOP is complete and the Embarcadero SQL Debugger for Microsoft continues to the next executable statement in the code.

3 While monitoring the value of the variables in the Variables Window, continue to click Go to cycle through the WHILE LOOP.

After executing the SELECT and RETURN statements, DBArtisan closes the Debugger and opens a DDL Editor to the Results Tab.

Proceed to Correcting the Script .

C

ORRECTING THE

S

CRIPT

When you finished Stepping Out of the nested code and encounter the error, to fully fix the bug, do the following:

1 Locate the source of the error

2 Scroll to the line in the script displaying the error

3 Analyze the code

4 Correct the error

5 Compile the corrected script

When you first executed the procedure, DBArtisan displayed the error message “Arithmetic overflow error for data type tinyint, value = 450”. According to Microsoft SQL Server Books

Online: “This error occurs when an attempt is made to convert a float or real data type value into a data type that cannot store the result. This error prevents the operation from being completed.”

The data type used in this procedure (TINYINT) stores values from 0 to 255. The sum of the four numbers between 100 and 121 that are divisible by 5 (105, 110, 115, and 120) is 450. But because the TINYINT variable @result can only accept a maximum value of 255, DBArtisan returns the error message and the procedure fails.

To correct the script, do the following:

1 On the Explorer Tab, right-click calculate_sum_with_overflow_bug, and then click Extract.

DBArtisan extracts the DDL for the procedure into a DDL Editor.

2 On the Edit toolbar, click Find.

DBArtisan opens the Find dialog box.

3 In the Find What box, type TINYINT.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 941

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

4 Click Find Next.

DBArtisan selects the first occurrence of TINYINT.

5 Change the data type for @result from TINYINT to INT.

6 On the DDL Editor toolbar, click Execute to execute the modified script.

DBArtisan executes the script and opens the Results Tab.

7 On the Explorer Tab, right-click calculate_sum_with_overflow_bug, and then click Execute.

DBArtisan opens the Procedure Execution dialog box.

8 In the Value column of the @p_num1_in row, type 100.

9 In the Value column of the @p_num2_in row, type 121.

10 Click Execute.

DBArtisan executes the procedure with the new data type and opens the Results Tab, returning the value 450. You successfully corrected the script and debugged the procedure.

For more information, see Getting Started with Embarcadero SQL Debugger for Microsoft .

D

EBUGGING A

S

AMPLE

S

CRIPT WITH

E

MBARCADERO

SQL D

EBUGGER FOR

O

RACLE

The DBArtisan installation includes a sample script intended to walk you through basic debugging functionality. The sample script creates a package that includes functions and procedures that you debug.

NOTE:

To create the sample package, you must have CREATE privileges.

Overview

Debugging a Sample Script is divided into three sections that familiarize you with basic debugging features and functionality:

• Getting Started with Embarcadero SQL Debugger for Oracle guides you through creating the package you use in Debugging Sample Script 1 and Debugging Sample Script 2.

• Debugging Sample Script 1 guides you through debugging functionality and demonstrates the Embarcadero SQL Debugger for Oracle interface features.

• Debugging Sample Script 2 guides you through debugging functionality and error correction.

NOTE:

For the purposes of this walk-though we have created this package under the user name DEMO_SPENCE.

94 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

G

ETTING

S

TARTED WITH

E

MBARCADERO

SQL D

EBUGGER FOR

O

RACLE

The DBArtisan installation includes a sample script that you execute to create a package containing functions and procedures. These functions and procedures demonstrate basic debugging features available in the Embarcadero SQL Debugger for Oracle.

NOTE:

To create the sample package, you must have CREATE privileges.

The DBArtisan installation places the script in the \UsrScrpt subfolder of the main DBArtisan installation directory.

If you create the package included with the DBArtisan installation, you can delete it and its objects from your system when you finish working with them. The objects to delete:

• The package COUNT_TIME_INTERVAL

• The package function WEEKEND_DAYS_( )

• The package function WORKING_DAYS_( )

• The package function YEARS_ELAPSED_BETWEEN_( )

• The procedure YEARS_ELAPSED

• The procedure YEARS_ELAPSED_Y2K

Proceed to

Embarcadero SQL Debugger for Oracle Overview .

E

MBARCADERO

SQL D

EBUGGER FOR

O

RACLE

O

VERVIEW

The Getting Started section guides you through:

• Opening the sample debug script.

• Executing sample debug script.

• Changing the Explorer Tab display.

• Confirming the creation of the package, including its functions and procedures.

Getting Started

1 Start DBArtisan.

2 On the File Menu, click Open.

DBArtisan opens the Open File(s) dialog box.

3 In the Open File(s) dialog box, go to DBA900\UsrScrpt\DEBUGGER_DEMO.sql, and then click Open.

NOTE:

During the installation DBArtisan places DEBUGGER_DEMO.sql in the \UsrScrpt subfolder of the main DBArtisan installation folder.

DBArtisan opens the What type of file dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 943

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

4 On the What type of file dialog box, click The file includes the DDL to create a database object, and then click OK.

DBArtisan opens the target script in an SQL Editor.

5 On the SQL Editor toolbar, click Execute to execute the script and create the package.

DBArtisan executes the target script and opens the SQL Editor Results Tab, displaying the results of the script execution. If you were not able to create the package, check the error messages to determine the problem.

6 On the Explorer Tab list, click Organize by Owner.

DBArtisan displays a list of owners in the Datasource Explorer.

7 On the Explorer, double-click your owner name.

DBArtisan displays a list of your schema objects.

8 Under your owner node, double-click the Packages node.

DBArtisan displays COUNT_TIME_INTERVAL, confirming the package’s creation.

Proceed to Debugging Sample Script 1 .

D

EBUGGING

S

AMPLE

S

CRIPT

1

Sample Script 1 demonstrates Embarcadero SQL Debugger’s basic features and functionality with the function WORKING_DAYS( ), which counts the number of business days between two dates.

Debugging Sample Script 1 is divided into five parts:

• Sample Script 1 - Starting the Debug Session

• Sample Script 1 - Entering Input Parameters

• Sample Script 1 - Viewing Debug Session Results

S

AMPLE

S

CRIPT

1 - S

TARTING THE

D

EBUG

S

ESSION

After you open and execute DEBUGGER_DEMO.sql, you can begin debugging Sample Script 1.

To begin debugging the function WORKING_DAYS( ), start a debug session.

Starting the Debug Session

To start the debug session, do the following:

1 On the Explorer Tab, under the Packages node, double-click the COUNT_TIME_INTERVAL node.

DBArtisan opens the COUNT_TIME_INTERVAL node and displays the following items:

94 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

2 Under the COUNT_TIME_INTERVAL node, double-click Functions.

DBArtisan opens the Functions node and displays the following items:

3 Under the Functions node, right-click WORKING_DAYS ( ), and then click Debug to start the debug session.

DBArtisan opens the Function Execution dialog box with the current date in the boxes.

Proceed to

Sample Script 1 - Entering Input Parameters

.

S

AMPLE

S

CRIPT

1 - E

NTERING

I

NPUT

P

ARAMETERS

After you start a debugging session, you can enter input parameters. You cannot debug a script that requires input parameters until you input those parameters in the Function Execution dialog box.

Input Parameters

To enter input parameters, do the following:

1 Click the P_START_DATE DATE box, and then click the drop-down arrow.

DBArtisan opens a calendar.

2 On the calendar, click the left arrow to set the month to November 1999.

3 Click 1.

DBArtisan displays 11/01/1999 in the Value column of P_START_DATE.

4 Click the P_END_DATE DATE box, and then click the drop-down arrow.

DBArtisan opens a new calendar.

5 On the calendar, click the left arrow to set the month to November 1999.

6 Click 8.

DBArtisan displays 11/08/1999 in the Value column of P_END_DATE.

7 Click OK.

DBArtisan closes the Function Execution dialog box, and then opens the following five

Embarcadero SQL Debugger for Oracle interface windows:

DDL Editor Window

, which displays the SQL code for the function.

• Watch Window

Variables Window.

Call Stack Window

Dependency Tree Window

, which displays the dependent objects.

Proceed to

Sample Script 1- Inserting Breakpoints .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 945

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Sample Script 1- Inserting Breakpoints

After you input parameters in the Input Parameters dialog box, you can begin inserting breakpoints. In this example, you insert the breakpoints in the extracted dependent object code. After you extract this code, locate the target breakpoint lines by searching for the text

DBMS_OUTPUT.

Breakpoints

To insert breakpoints, do the following:

1 In the Dependency Tree window, double-click the COUNT_TIME_INTERVAL package body.

DBArtisan displays the SQL code for the package body in the SQL Editor window.

2 On the Edit toolbar, click Find.

DBArtisan opens the Find dialog box.

3 On the Find dialog box, in the Find What box, type DBMS_OUTPUT.

4 Click Find Next.

In the SQL Editor, DBArtisan highlights the first occurrence of DBMS_OUTPUT, on line 22.

5 On the SQL Editor toolbar, click Breakpoint.

DBArtisan inserts a breakpoint next to the target line number.

6 On the Find dialog box, click Find Next.

DBArtisan highlights the next occurrence of DBMS_OUTPUT.

7 Click Find Next a third time.

DBArtisan highlights the next occurrence of DBMS_OUTPUT, on line 35.

8 On the Find dialog box, click Cancel.

DBArtisan closes the Find dialog box.

9 On the Edit toolbar, click Breakpoint to insert a second breakpoint.

You should now have breakpoints set at lines 22 and 35.

Proceed to

Sample Script 1- Stepping Into .

Sample Script 1- Stepping Into

After you insert breakpoints, you can step into the function code.

94 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

Step Into

To use the Step Into facility, do the following:

1 On the SQL Editor toolbar, click Go.

Embarcadero SQL Debugger for Oracle begins debugging and runs to the first breakpoint, placing the yellow arrow on line 22.

2 On the SQL Editor toolbar, click Step Into.

Embarcadero SQL Debugger for Oracle moves the yellow arrow to the next line of the code.

3 Click Step Into again to enter the LOOP block.

Embarcadero SQL Debugger for Oracle displays the value of the variables in the Variables

window.

4 Click Step Into again to start moving through the LOOP block.

In the Variables window, Embarcadero SQL Debugger for Oracle updates the value of variable v_currdate from 01-NOV-1999 to 02-NOV-1999.

5 Click Step Into two more times.

In the Variables window, Embarcadero SQL Debugger for Oracle updates the value of v_theday from NULL to Tuesday.

NOTE:

If you continued stepping through the LOOP block, the Embarcadero SQL Debugger for Oracle would continue to update v_currdate and v_theday until v_currdate is greater than p_end_date.

6 On the SQL Editor toolbar, click Go.

Embarcadero SQL Debugger runs to the next breakpoint.

7 On the SQL Editor toolbar, click Go once more.

Embarcadero SQL concludes the debug session and displays the Debug Session Results box.

Proceed to

Sample Script 1 - Viewing Debug Session Results .

S

AMPLE

S

CRIPT

1 - V

IEWING

D

EBUG

S

ESSION

R

ESULTS

After Stepping Into and running to the end of the code, Embarcadero SQL Debugger for Oracle displays a Debug Session Results box containing the following information:

• Variable Output

• DBMS_OUTPUT Results

NOTE:

In this example, the Embarcadero SQL Debugger for Oracle displays a Debug Session

Results box because the sample program includes DBMS_OUTPUT.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 947

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Debug Session Results

To debug session results, do the following:

1 Click OK.

DBArtisan closes the Debug Session Results box and terminates your debug session.

Proceed to Debugging Sample Script 2 .

D

EBUGGING

S

AMPLE

S

CRIPT

2

Sample Script 2 demonstrates Embarcadero SQL Debugger for Oracle’s functionality when used on a function containing a bug which prevents it from executing successfully. The buggy function, WEEKEND_DAYS( ), requires input parameters and counts the number of weekend days between two dates. In this section, use Embarcadero SQL Debugger for Oracle to identify the bug, and then correct the script so that it can execute successfully.

Debugging Sample Script 2 is divided into six parts:

• Sample Script 2 - Executing the Function

• Sample Script 2 - Starting the Debug Session

• Sample Script 2 - Entering Input Parameters

• Sample Script 2- Inserting Breakpoints

• Sample Script 2- Stepping Into

• Sample Script 2 - Correcting the Script

S

AMPLE

S

CRIPT

2 - E

XECUTING THE

F

UNCTION

After you open and execute DEBUGGER_DEMO.sql, you can begin debugging Sample Script 2.

To begin debugging the function WEEKEND_DAYS ( ), first execute the function to discover the type of error it returns when it fails to execute.

Executing the Function

To execute the function, do the following:

1 On the Explorer Tab, under the Packages node, double-click the COUNT_TIME_INTERVAL node.

DBArtisan opens the COUNT_TIME_INTERVAL node.

2 Double-click the Functions node.

DBArtisan opens the Functions node.

3 Click WEEKEND_DAYS ( ), then right-click it and click Execute.

DBArtisan opens the Function Execution dialog box.

94 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

4 In the Value column of the P_START_DATE row, type 11/01/1999.

5 In the Value column of the P_END_DATE row, type 11/30/1999.

6 Click Execute.

DBArtisan attempts to execute the function but returns an error indicating that the character string buffer is too small.

Proceed to

Sample Script 2 - Starting the Debug Session .

S

AMPLE

S

CRIPT

2 - S

TARTING THE

D

EBUG

S

ESSION

After you unsuccessfully execute the function WEEKEND_DAYS( ) and determine the nature of its execution error, you can start a debugging session to determine the actual cause of the error.

Starting the Debugging Session

To start the debugging session, do the following:

1 On the Explorer Tab, under the COUNT_TIME_INTERVAL node, under the Functions node, right-click WEEKEND_DAYS ( ), and then click Debug to start the debug session.

DBArtisan opens the Function Execution dialog box.

Proceed to

Sample Script 2 - Entering Input Parameters

.

S

AMPLE

S

CRIPT

2 - E

NTERING

I

NPUT

P

ARAMETERS

After you start the debug session, you can enter input parameters in the Function Execution dialog box.

Entering Input Parameters

To enter input parameters, do the following:

1 At the end of the P_START_DATE row, click the drop-down arrow.

DBArtisan opens the calendar.

2 On the calendar, click Left Arrow to set the month to November 1999.

3 Click 1.

DBArtisan displays 11/01/1999 in the Value column of the P_START_DATE row.

4 At the end of the P_END_DATE row, click the drop-down arrow.

DBArtisan opens a new calendar.

5 On the calendar, click Left Arrow to set the month to November 1999.

6 Click 30.

DBArtisan displays 11/08/1999 in the Value column of the P_END_DATE row.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 949

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

7 Click Continue.

DBArtisan closes the Function Execution dialog box, and then opens the following five

Embarcadero SQL Debugger for Oracle interface windows:

DDL Editor Window

, which displays the SQL code for the function

• Watch Window

• Variables Window

• Call Stack Window

Dependency Tree Window

, which displays the dependent objects.

Proceed to

Sample Script 2- Inserting Breakpoints .

S

AMPLE

S

CRIPT

2- I

NSERTING

B

REAKPOINTS

After you enter input parameters, you can begin inserting breakpoints. In this example, you insert the breakpoints in the extracted dependent object code. After you extract this code, locate the target breakpoint lines by searching for a particular line of code.

Breakpoints

To insert breakpoints, do the following:

1 In the Dependency Tree Window, double-click the COUNT_TIME_INTERVAL package body.

DBArtisan displays the SQL code for the package body in the SQL Editor.

2 On the Edit toolbar, click Find.

DBArtisan opens the Find dialog box.

3 On the Find dialog box, in the Find What box, type Function weekend_days, and then click

Find Next.

Embarcadero SQL Debugger for Oracle highlights the first occurrence of Function weekend_days.

4 On the Find dialog box, click Cancel.

DBArtisan closes the Find dialog box.

5 Click line 60, the first line of executable code:

6 On the SQL Editor toolbar, click Breakpoint.

DBArtisan inserts a breakpoint next to the line number.

95 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

E M BARC ADERO SQ L DE BUGGER > E MB A RC ADE RO SQ L DEB UGGE R

7 Click Go to start debugging and run to the breakpoint.

Embarcadero SQL Debugger for Oracle places the yellow arrow on line 60 and populates the Variables window with the first set of variables in the function code.

Embarcadero SQL Debugger for Oracle also populates the Call Stack window with everything called before the breakpoint.

Proceed to

Sample Script 2- Stepping Into .

S

AMPLE

S

CRIPT

2- S

TEPPING

I

NTO

After you set and run to the breakpoint, you can step into the function to locate the cause of the error. To locate the cause of the error, monitor the Variables window. As you step through the code, the Variables window updates with the value of the variables.

Step Into

1 On the SQL Editor toolbar, click Step Into.

DBArtisan moves the yellow arrow to the next line of the code, line 64.

2 On the SQL Editor toolbar, click Step Into.

Embarcadero SQL Debugger for Oracle’s Variables window updates the value of v_currdate to 02-NOV-1999.

3 On the SQL Editor toolbar, click Step Into.

DBArtisan moves the yellow arrow to the next line of the code, line 66.

4 On the SQL Editor toolbar, click Step Into.

DBArtisan moves the yellow arrow to the next line of the code, line 67, and, in the Variables window, updates the value of v_theday to Tuesday.

5 On the SQL Editor toolbar, click Step Into.

DBArtisan moves the yellow arrow back to line 64 to repeat the loop.

6 On the SQL Editor toolbar, click Step Into.

Embarcadero SQL Debugger for Oracle’s Variables window updates the value of v_currdate to 03-NOV-1999.

7 On the SQL Editor toolbar, click Step Into.

DBArtisan moves the yellow arrow to the next line of the code, line 66.

8 On the SQL Editor toolbar, click Step Into.

The Embarcadero SQL Debugger for Oracle locates the error. The application terminates the debug session, returns an error indicating that the numeric or value character string buffer is too small, extracts the COUNT_TIME_INTERVAL package code into an SQL Editor, and returns an error indicating the line on which the code failed.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 951

E M B A RC A D E RO S QL D E B U G G E R > E M B A RC A D E RO S Q L D E B U G G E R

Proceed to

Sample Script 2 - Correcting the Script

.

S

AMPLE

S

CRIPT

2 - C

ORRECTING THE

S

CRIPT

After you step through the SQL code and locate the error, you can correct the bug in Sample

Script 2. When Embarcadero SQL Debugger for Oracle locates an error, it extracts the target package body into an SQL Editor. To correct this script:

• Scroll to the incorrect line in the script

• Analyze the code

• Correct the error

• Execute the corrected SQL script

• Execute the WEEKEND_DAYS ( ) function

The code in Sample Script 2 fails on line 66, returning an error when the variable v_theday increments from the value Tuesday to the value Wednesday. The cause of this error is found in the declarations section of the function script, where the width of the VARCHAR2 variable v_theday is set to 8. Because “Wednesday” includes nine characters, the value of the variable v_theday fails when it attempts to place a nine-character value in an eight-character variable. To correct this error, increase the width of the variable v_theday to accommodate nine characters.

Correcting the Script

To correct the script, do the following:

1 On the Explorer Tab, under the Packages node, under the COUNT_TIME_INTERVAL. node,

right-click Package Body, and then click Extract.

DBArtisan extracts the package body into an SQL Editor.

2 In the SQL Editor, scroll to line 57, the line defining the variable v_theday.

3 On line 57, change the value of the width from 8 to 9.

4 On the SQL Editor toolbar, click Execute to execute the script.

DBArtisan successfully executes the script.

5 On the Explorer Tab, under the COUNT_TIME_INTERVAL package node, under the

Functions node, click WEEKEND_DAYS ( ).

6 Right-click WEEKEND_DAYS ( ), and then click Execute.

DBArtisan opens the Function Execution dialog box.

7 In the Value column of the P_START_DATE row, type 11/01/1999.

8 In the Value column of the P_END_DATE row, type 11/30/1999.

9 Click Execute.

DBArtisan successfully executes the corrected function.

95 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

DBA

RTISAN

PL/SQL P

ROFILER

The DBArtisan PL/SQL Profiler module lets Oracle 8i developers capture metrics of various PL/

SQL programmable objects as they are executed in the database. Developers can use data collected in profile sessions to improve performance of PL/SQL code execution. DBArtisan PL/

SQL Profiler collects and stores data in database tables that let you identify and isolate performance problems and provide code coverage information. The DBArtisan PL/SQL Profiler lets you:

• Graphically browse PL/SQL profiling data within the Explorer Tab

• View profiling data in the right pane of the application, which is populated as you navigate the Explorer Tab

• Start and stop PL/SQL profiling sessions with a single click

• Graphically analyze time spent in each programmable object (unit)

• Graphically analyze time spent in each source code line of a unit

Requirements:

• Oracle 8.1.5 or later

• Oracle built-in package DBMS_PROFILER

• Oracle tables:

• PLSQL_PROFILER_RUNS

• PLSQL_PROFILER_UNITS

• PLSQL_PROFILER_DATA (user's schema)

The table below describes the sections of this chapter:

Section

Setting up DBArtisan PL/SQL Profiler

DBArtisan PL/SQL Profiler Functionality

Using DBArtisan PL/SQL Profiler

Description

Describes the process of setting up DBArtisan PL/SQL Profiler.

Describes the functionality of DBArtisan PL/SQL Profiler.

Describes how to run a profile session.

NOTE:

The DBArtisan PL/SQL Profiler is an optional add-on module.

S

ETTING UP

DBA

RTISAN

PL/SQL P

ROFILER

The Oracle profiling tables must be on the Oracle server before you can use the DBArtisan PL/

SQL Profiler. The first time you open the PL/SQL Profiler, DBArtisan checks the server for the profiling tables. If the profiling tables are not on the server, DBArtisan automatically starts Oracle

SQL*Plus, which installs profiling tables on the Oracle server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 953

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

For DBArtisan to run Oracle SQL*Plus (which installs the profiling tables) your Oracle server and client must meet the following conditions:

• The Oracle server and the client have the same version of Oracle.

• The client has the Oracle\BIN directory on the path.

• The client has the Oracle file, SQLPLUS.exe in the Oracle\BIN directory.

• The following Oracle files are in the Oracle\RDBMS\ADMIN directory:

• DBMSPBP.sql

• PROFLOAD.sql

• PROFTAB.sql

• PRVTPBP.blp

NOTE:

If the Oracle server and the client machines are running different versions of Oracle, after running SQL*Plus, DBArtisan displays the following error message: Version of package is incompatible.

DBA

RTISAN

PL/SQL P

ROFILER

E

XPLORER

The DBArtisan PL/SQL Profiler displays profiling data in the right pane of the application, which is populated as you navigate the Explorer Tab.

The table below describes the nodes of the DBArtisan PL/SQL Profiler Explorer and the corresponding information in the right pane of the application:

Node Right pane information

PL/SQL Code Profiling Contain all Comment, Run ID and Run Date\time data that is current stored in the

Profiling tables.

Label\Comment level

Run level

Contains all Run ID and Run Date\time data for the specific Label\Comment.

Contains all Unit, Unit Name, Unit Type, Run Date\time data for the specific Run ID.

DBA

RTISAN

PL/SQL P

ROFILER

F

UNCTIONALITY

DBArtisan PL/SQL Profiler offers the following functionality:

• Start

Flush

• Run Summary

• Run Detail

95 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

• Unit Summary

• Clear Profile Table

• Unit Detail

Stop

S

TART

DBArtisan PL/SQL Profiler lets you begin a new profiling session or open a previous profiling session with the Start command.

Starting a New Profile Session

To start a new profile session, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Start.

DBArtisan opens the PL/SQL Profiler - Start dialog box.

2 In the Profile Label box, type the name of the new profile.

NOTE:

Each user can own one or more Profiles.

3 Click OK.

DBArtisan begins profiling.

Starting an Existing Profile Session

1 On the Utilities menu, click PL/SQL Profiler, and then click Start.

DBArtisan opens the PL/SQL Profiler - Start dialog box.

2 Click the Profile Label list, and then click the existing profile.

3 Click OK.

DBArtisan begins profiling.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

F

LUSH

DBArtisan PL/SQL Profiler lets you move the data from the dynamic tables into analysis tables with the flush command.

The table below describes the options and functionality on the PL/SQL Profiler - Flush dialog box:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 955

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

Option

Flush

Flush & Analyze

Cancel Button

Description

Click to delete the data in a running profile.

Click to open the PL/SQL Profiler Run Detail window. For details, see

Run Detail .

Click to abort the flush and continue the profiling session.

NOTE:

You can only Flush a running Profile.

Flushing a Profile

To flush a profile, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Flush.

DBArtisan opens the PL/SQL Profiler - Flush dialog box.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

R

UN

S

UMMARY

The DBArtisan PL/SQL Profiler Run Summary window lets you to view the following information for each of your profiles:

• Run ID

• Run Date

• Total Time

Opening the Run Summary Window

To open the Run Summary Window, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Run Summary.

DBArtisan opens the PL/SQL Profiler - Run Summary window.

2 In the PL/SQL Profiler - Run Summary window, click the Label list, and then click the target profile to populate the table.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

R

UN

D

ETAIL

The DBArtisan PL/SQL Profiler Run Detail window lets you to view the following information for each of your profiles:

• Run Number

95 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

• Run Date

• Run Time

The Run Detail Tab lets you:

• View the information for all runs or you can view profile information based on the unit type or unit owner.

• View results in milliseconds, seconds and minutes.

• View graphical displays of the profiling data that let you can navigate to the specific unit within the summary portion of the window.

• Specify the number of top lines to display in the graphical portion of the interface.

TIP:

Each graph is a working object. You can select data in a graph and the corresponding line of source displays in the lower pane of the interface.

Opening the Run Detail Window

To open the Run Detail Window, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Run Detail.

DBArtisan opens the PL/SQL Profiler - Run Detail window.

2 In the PL/SQL Profiler - Run Detail window:

• Click the Label list box, and then click the target profile.

• Click the Run list, and then click the target run.

• Click the Unit Type list, and then click the target unit type(s).

• Click the Unit Owner list, and then click the target unit owner(s) to populate the table.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

U

NIT

S

UMMARY

The DBArtisan PL/SQL Profiler Unit Summary window lets you to view the following information for each of your profiles:

• Run ID

• Run Date

• Run Time

• Unit Time

• Percentage of Run Time

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 957

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

The DBArtisan PL/SQL Profiler Unit Summary window lets you view results in milliseconds, seconds and minutes. The Unit Summary window also displays graphs of execution statistics for the top N runs and associated units. You can use the graphical displays to navigate to the specific run within summary portion of the window.

Opening the Unit Summary Window

To open the Unit Summary Window, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Unit Summary.

DBArtisan opens the PL/SQL Profiler - Unit Summary window.

2 In the PL/SQL Profiler - Unit Summary window:

• Click the Unit Owner list, and then click the target unit owner.

• Click the Unit Name list, and then click the target unit name to populate the table.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

C

LEAR

P

ROFILE

T

ABLE

DBArtisan PL/SQL Profiler lets you delete data from the user's profile tables with the command

Clear Profile Table.

Clearing a Profile Table

To clear a Profile Table, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Clear Profile Table.

DBArtisan clears the profile table.

2 In the DBArtisan dialog box, if you are sure that you want to clear out the profiler tables, click

Yes.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

U

NIT

D

ETAIL

The DBArtisan PL/SQL Profiler Unit Detail window lets you to view the following information for each of your profiles:

• Average Time

• Source

• PL/SQL Script

95 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

The DBArtisan PL/SQL Profiler Unit Detail window lets you view results in milliseconds, seconds and minutes. The Unit Detail window also provides two calculation options for viewing unit execution time as a percentage of total execution time (total run vs unit run). Additionally, also displays graphs of execution statistics for the top N run. You can use the graphical displays to navigate to the specific line within source code portion of the window.The graphical display portion of the window contains options for viewing advanced statistics.

The Advanced View of the DBArtisan PL/SQL Profiler Unit Detail window lets you view the following information for each of your profiles:

• Hit Lines

• Missed Lines

• Line Number

• Calls

• Total Time

• Percentage of the Total Time

• Average Time

• Minimum Time

• Maximum Time

Opening the Unit Detail Window

To open the Unit Detail Window, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Unit Detail.

DBArtisan opens the PL/SQL Profiler - Unit Detail window.

2 In the PL/SQL Profiler - Unit Detail window, do any of the following:

• Click the Label list, and then click the target profile.

• Click the Run list, and then click the target run.

• Click the Unit list, and then click the target unit to populate the table.

• Right-click, and then click Show Only Hit Lines to populate the table with the Average

Time and Source for hit lines.

• Right-click, and then click Show Only Missed Lines to populate the table with the Average

Time and Source for missed lines.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 959

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

Opening the Unit Detail Window Advanced View

To open the Unit Detail Window Advanced View, do the following:

1 In the Unit Detail window, right-click, and then click Advanced View to populate the table with Advanced View information.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

S

TOP

DBArtisan PL/SQL Profiler Stop command pauses the data gathering operation. Stop & Analyze populates the summary tables so that you can view the Unit Detail and Run Summary windows.

The table below describes the options and functionality on the PL/SQL Profiler - Stop dialog box:

Option

Stop

Stop & Analyze

Cancel

Description

Click to stop the profiling session.

For details, see Run Detail

..

Click to continue the profiling session.

Stopping a Profiling Session

To stop a Profiling Session, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Stop.

DBArtisan opens the PL/SQL Profiler - Stop dialog box.

For more information, see

DBArtisan PL/SQL Profiler Functionality .

U

SING

DBA

RTISAN

PL/SQL P

ROFILER

The steps in this section provide a high level overview of running a profiling session, and cover the following processes:

• Starting the Session.

• Executing the Sample Script.

• Stopping and Analyzing the Session.

NOTE:

The first execution of a PL/SQL unit can take more time to execute because the code is loading into memory; subsequent runs take less time.

96 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

Using the DBArtisan PL/SQL Profiler

1 On the Utilities menu, click PL/SQL Profiler, and then click Start.

DBArtisan opens the PL/SQL Profiler - Start dialog box.

2 In the Profile Label box, type the name of the new profile.

NOTE:

Each user can own one or more Profiles.

3 Click OK.

DBArtisan begins profiling.

4 On the Datasource Explorer, execute on one of the following PL/SQL database objects:

• Procedure

• Function

• Package Procedure

• Package Function

Profiler displays profiling data in the right pane of the application.

5 On the Utilities menu, click PL/SQL Profiler, and then click Stop.

DBArtisan opens the PL/SQL Profiler - Stop dialog box.

The table below describes the options and functionality on the PL/SQL Profiler - Stop dialog box:

Option

Stop

Stop & Analyze

Cancel

Description

Click to stop the profiling session.

Click to open the PL/SQL Profiler Run Detail window. For details, see

Run Detail .

Click the Label list, and then click the target profile.

Click the Run list, and then click the target run.

Click the Unit Type list, and then click the target unit type(s).

Click the Unit Owner list, and then click the target unit owner(s) to populate the table.

Click to continue the profiling session.

6 Use the Utilities menu to open any of the following PL/SQL Profiler windows. For more information, see:

Run Summary

• Unit Summary

• Unit Detail

For more information, see

DBArtisan PL/SQL Profiler Functionality .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 961

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

S

AMPLE

P

ROFILING

S

ESSION

The DBArtisan installation includes two scripts for the sample profiling session:

• PROFILER_BUILD_DEMO.SQL

• PROFILER_DEMO.SQL

The PROFILER_BUILD_DEMO.SQL creates the objects that you profile in the walk through, and the PROFILER_DEMO.SQL is what you profile during the walk through.

NOTE:

To create the objects in the PROFILER_BUILD_DEMO.SQL script, you need CREATE privileges.

The sample script demonstrates the following features of the DBArtisan PL/SQL Profiler:

• Unit Detail

• Run Detail

• Show Only Hit Lines

• Advanced View

During the installation, DBArtisan places the scripts in the \UsrScrpt subfolder of the main

DBArtisan installation folder.

Overview

Sample Profiling Session is divided into six parts:

• Getting Started

• Starting the Session

• Executing the Sample Script

• Stopping the Session

• Re-running & Re-executing the Session

• Stopping & Analyzing

Proceed to

Sample Profiling Session - Getting Started

.

S

AMPLE

P

ROFILING

S

ESSION

- G

ETTING

S

TARTED

In this step of Sample Profiling Session, you create the objects that you profile in the walk through.

Overview

The Getting Started section guides you through:

• Opening PROFILER_BUILD_DEMO.SQL.

96 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

• Changing the Datasource Explorer Display.

• Confirming the Creation of the Package.

Getting Started

1 Start DBArtisan.

2 On the File menu, click Open.

DBArtisan opens the Open Files dialog box.

3 In the Open Files dialog box, navigate to the UsrScrpt subfolder of the main DBArtisan installation folder, press ENTER, and then double-click PROFILER_BUILD_DEMO.SQL to open the script in a SQL Editor window.

DBArtisan opens the PROFILER_BUILD_DEMO.SQL script in an SQL Editor window.

4 On the SQL Editor window, click Execute.

DBArtisan executes the script and create the package.

5 On the Datasource Explorer window list, click Organize by Owner.

6 On the Datasource Explorer window, click the node of your owner name.

DBArtisan displays your schema objects.

7 Double-click the Packages node to display PF_COUNT_TIME_INTERVAL and confirm its creation.

NOTE:

If you were not able to create the package, check the error messages to determine the problem.

Proceed to

Sample Profiling Session - Starting the Session

.

S

AMPLE

P

ROFILING

S

ESSION

- S

TARTING THE

S

ESSION

In this step of Sample Profiling Session, you start the profiling session.

Sample Profiling Session - Starting the Session

To start the session, do the following:

1 On the File Menu, click Open.

DBArtisan opens the Open Files dialog box.

2 In the Open Files dialog box, type the path to the UsrScrpt directory, press ENTER, and then double-click PROFILER_DEMO.SQL.

DBArtisan opens the script in a SQL Editor window.

DBArtisan opens the PROFILER_DEMO.SQL script in an SQL Editor window.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 963

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

3 On the Utilities menu, click PL/SQL Profiler, and then click Start.

DBArtisan opens the PL/SQL Profiler - Start dialog box.

4 In the Profile Label list, enter DemoProfile.

5 Click OK.

DBArtisan begins the profiling session.

NOTE:

If this is the first time you start the PL/SQL Profiler, DBArtisan displays a dialog box.

NOTE:

Click Yes and DBArtisan opens SQL*Plus to create the tables. You need to start the profiling session again (see step 3 above.)

Proceed to

Sample Profiling Session - Executing the Sample Script

.

S

AMPLE

P

ROFILING

S

ESSION

- E

XECUTING THE

S

AMPLE

S

CRIPT

In this step of Sample Profiling Session, you execute the DEMO script.

Sample Profiling Session - Executing the Sample Script

To execute the sample script, do the following:

1 On the SQL Editor window toolbar, click Execute.

DBArtisan executes the script and opens a Results Tab.

Proceed to

Sample Profiling Session - Getting Started

.

S

AMPLE

P

ROFILING

S

ESSION

- S

TOPPING THE

S

ESSION

In this step of Sample Profiling Session, you stop the profiling run.

Sample Profiling Session - Stopping the Session

To stop the session, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Stop.

DBArtisan opens the PL/SQL Profiler - Stop dialog box.

2 Click Stop.

Proceed to

Sample Profiling Session - Re-running & Re-executing the Session

.

S

AMPLE

P

ROFILING

S

ESSION

- R

E

-

RUNNING

& R

E

-

EXECUTING THE

S

ESSION

In this step of Sample Profiling Session, you run the same profile session and execute the DEMO script again.

96 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

D B AR T IS AN P L /S Q L P RO F I L E R > D B AR TI S A N PL / S Q L P RO F IL E R

Sample Profiling Session - Re-running & Re-executing the Session

To re-run and re-execute the session, do the following:

1 In the SQL Editor, click the Query Tab.

2 On the Utilities menu, click PL/SQL Profiler, and then click Start.

DBArtisan opens the PL/SQL Profiler - Start dialog box again.

3 Click the down arrow on the Profile Label list, and then click DemoProfile.

4 Click OK.

DBArtisan begins the profiling session.

5 On the SQL Editor toolbar, click Execute.

DBArtisan executes the script again and opens the Results Tab.

Proceed to

Sample Profiling Session - Stopping & Analyzing .

S

AMPLE

P

ROFILING

S

ESSION

- S

TOPPING

& A

NALYZING

In this step of Sample Profiling Session, you stop profiling and analyze the runs.

Sample Profiling Session - Stopping & Analyzing

To stop and analyze the sample profiling session, do the following:

1 On the Utilities menu, click PL/SQL Profiler, and then click Stop.

DBArtisan opens the PL/SQL Profiler - Stop dialog box again.

2 Click Stop & Analyze.

DBArtisan opens the PL/SQL Profiler - Run Detail window.

3 Click the Run list, and then click Run#x.

NOTE:

DBArtisan assigns a number to each profiling session. These numbers increase incrementally each time you run a profiling session. x= the number that was assigned to your first run.

DBArtisan PL/SQL Profiler populates the grid with information on the procedure, package body and package specification.

NOTE:

For the purposes of this walk though we have created this package under the account

SCOTT.

4 Click the Run list again, and then click the Run#x for your second run.

Notice this time there is no information on the package specification. It was created in the first run.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 965

D B A R T I S A N P L / S Q L P RO F IL E R > D B A R T IS A N P L /S Q L P RO F I L E R

5 Right-click, and then click Detail.

DBArtisan PL/SQL Profiler opens the PL/SQL Profiler - Unit Detail window and populates the grid with the average time to execute each unit and the source code. Notice the time to execute SELECT object_name, in the example is 126 ms.

6 In the PL/SQL Profiler - Unit Detail window, click the Run list, and then click Run#x for your first run.

7 Click the Unit list, and then click user name.PF_COUNT_SYSTEM_OBJECTS.

Notice the time to execute SELECT object_name is considerably greater: in the example it is 24476 ms.

8 Right-click, and then click Show Only Hit Lines.

The DBArtisan PL/SQL Profiler shows only the lines of code that executed.

9 Right-click, and then click Advanced View.

The DBArtisan PL/SQL Profiler opens the Advanced View window.

10 Continue clicking the Run and Unit lists to compare the performance of each run and each session.

This concludes the Sample Profiling Session. You can delete the objects created during the

Sample Profiling Session. They are:

• Check Constraints, PLSQL_PROFILER_UNITS, PLSQL_PROFILER_DATA

• Foreign Keys, PLSQL_PROFILER_UNITS, PLSQL_PROFILER_DATA

• Package, PF_COUNT_TIME_INTERVAL

• Package functions, WEEKEND_DAYS_( ), WORKING_DAYS_( ),

YEARS_ELAPSED_BETWEEN_ ()

• PL/SQL code Profiles, DemoProfile

• Primary Keys, PLSQL_PROFILER_RUNS, PLSQL_PROFILER_UNITS, PLSQL_PROFILER_DATA

• Procedure, PF_COUNT_SYSTEM_OBJECTS

• Sequence, PLSQL_PROFILER_RUNNUMBER

• Tables, PLSQL_PROFILER_RUNS, PLSQL_PROFILER_UNITS, PLSQL_PROFILER_DATA

96 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C

APACITY

A

NALYST

Welcome to the Embarcadero Capacity Analyst. The Capacity Analyst collects critical database storage, object, and performance metrics at scheduled intervals and provides visual analysis and reporting mechanisms that allow for historical trend analysis and forecasting.

Capacity Analyst lets you:

• Create and maintain Capacity Collections that serve as containers for related statistics.

• Collect statistics in Capacity Collections.

• View graphic and report-styled presentations of trend and predictive analysis scenarios.

• Maintain functions regarding the handling of stored statistics.

The table below describes the major sections of Help.

Section

Geting Started with the Capacity

Analyst

Capacity Analyst Tutorial

Description

Provides information about installing, opening, and licensing Capacity Analyst.

Using Capacity Analyst

Helps you get started with Embarcadero Capacity Analyst. Provides the foundation you need to explore the many features and benefits of Capacity

Analyst.

Shows how to use each component of the application. Using Capacity Analyst breaks each process and procedure into simple step-by-step instructions.

G

ETING

S

TARTED WITH THE

C

APACITY

A

NALYST

Welcome to the Embarcadero Capacity Analyst. The Capacity Analyst helps you analyze current usage trends in your key databases and lets you forecast where your databases are heading in the future.

For more information, see:

• What You Should Know Before Installation

• Capacity Analyst Repository Installation

• Uninstalling Capacity Analyst Repository

• Managing Repository Security

• Repository Information

• Licensing Capacity Analyst

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 967

G E T I N G S T A R T E D W I TH T H E C AP A C I TY AN A L Y S T > G E T I N G S TA R TE D W I T H TH E C A PA C I T Y A N AL Y S T

W

HAT

Y

OU

S

HOULD

K

NOW

B

EFORE

I

NSTALLATION

When you install the Analyst, several Embarcadero-generated stored objects are pushed onto the database server:

These objects are as follows:

SQL SERVER

Procedures eas_apply_collection_filter eas_apply_refresh_stats_condition eas_get_collection_metric_info eas_get_metric_query_ex1 eas_get_refresh_stats_condition eas_is_auto_purge_set eas_is_filter_all_set eas_purge_data eas_resolve_datastruct eas_resolve_tables eas_run_datastruct eas_set_auto_purge_status eas_update_schedule_dates

Foreign Keys eas_collection_fk1 eas_collection_object_fk2 eas_group_recfk eas_object_type_fk eas_property_fk2 eas_statistic_fk2

Tables eas_collection eas_database eas_map eas_option eas_schedule eas_apply_collection_schedule eas_create_collection eas_get_metric_query eas_get_purge_condition eas_get_refresh_stats_status eas_is_collection_available eas_list_perf_stats eas_refresh_stats eas_resolve_indexes eas_resolve_waitevents eas_run_perfstats eas_set_collection_status eas_collection_fk2 eas_filter_fk1 eas_map_fk1 eas_option_fk1 eas_schedule_fk eas_statistic_fk3 eas_collection_object eas_filter eas_object eas_option_type eas_statistic eas_apply_purge_condition eas_delete_collection eas_get_metric_query_ex eas_get_purge_status eas_is_admin eas_is_collection_scheduled eas_list_wait_events eas_resolve_collection_objects eas_resolve_perfstats eas_run_collection eas_run_waitevents eas_set_refresh_stats_status eas_collection_object_fk1 eas_filter_fk2 eas_object_fk eas_property_fk1 eas_statistic_fk1 eas_collection_sql eas_group eas_object_type eas_property eas_version

96 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G E T IN G S T A R T E D W IT H T HE C A P A C IT Y A N A L Y S T > G E T IN G S T A R T E D W IT H T H E C AP A C I TY AN A L Y S T

Metadata eas_column_map_insert eas_object_type_insert eas_version_insert eas_database_insert eas_option_insert eas_group_insert eas_option_type_insert

DB2

Foreign Keys eas_col_obj_fk1 eas_collection_fk2 eas_group_recfk eas_object_type_fk eas_property_fk2 eas_statistic_fk2

Index eas_collection_idxs eas_group_idxs eas_option_idxs eas_statistic_idxs

Metadata eas_column_map_insert eas_option_insert

Tables eas_collection_object eas_group eas_option eas_version

ORACLE

Foreign Keys eas_collection_fk1 eas_collection_object_fk2 eas_filter_fk2 eas_col_obj_fk2 eas_filter_fk1 eas_map_fk1 eas_option_fk1 eas_schedule_fk eas_statistic_fk3 eas_collection_object_idxs eas_map_idxs eas_property_idxs eas_group_insert eas_option_type_insert eas_collection_sql eas_map eas_option_type eas_collection_fk2 eas_collection_sql_fk1 eas_map_fk1 eas_collection_fk1 eas_filter_fk2 eas_object_fk eas_property_fk1 eas_statistic_fk1 eas_filter_idxs eas_object_type_idxs eas_schedule_idxs eas_object_type_insert eas_version_insert eas_database eas_object_type eas_schedule eas_collection_object_fk1 eas_filter_fk1 eas_object_fk

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 969

G E T I N G S T A R T E D W I TH T H E C AP A C I TY AN A L Y S T > G E T I N G S TA R TE D W I T H TH E C A PA C I T Y A N AL Y S T eas_option_fk1 eas_schedule_fk

Indexes eas_collection_fk1 eas_filter_fk2 eas_option_fk1 eas_schedule_fk

Metadata eas_column_map_insert eas_option_type_insert

Tables eas_collection eas_database eas_object eas_option_type eas_statistic

SYBASE

Foreign Keys eas_collection_fk1 eas_collection_object_fk2 eas_group_recfk eas_object_type_fk eas_property_fk2 eas_statistic_fk2

Indexes eas_collection_idxs eas_group_idxs eas_object_type_idxs eas_schedule_idxs eas_property_fk1 eas_statistic_fk2 eas_collection_fk2 eas_object_fk eas_property_fk1 eas_statistic_fk1 eas_object_type_insert eas_version_insert eas_collection_object eas_filter eas_object_type eas_property eas_version eas_collection_fk2 eas_filter_fk1 eas_map_fk1 eas_option_fk1 eas_schedule_fk eas_statistic_fk3 eas_collection_object_idxs eas_map_idxs eas_option_idxs eas_statistic_idxs eas_property_fk2 eas_statistic_fk3 eas_filter_fk1 eas_object_uk eas_property_fk2 eas_option_insert eas_collection_sql eas_map eas_option eas_schedule eas_collection_object_fk1 eas_filter_fk2 eas_object_fk eas_property_fk1 eas_statistic_fk1 eas_filter_idxs eas_object_idxs eas_property_idxs

97 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G E T IN G S T A R T E D W IT H T HE C A P A C IT Y A N A L Y S T > G E T IN G S T A R T E D W IT H T H E C AP A C I TY AN A L Y S T

Metadata eas_column_map_insert eas_object_type_insert eas_version_insert

Procedures sp_embt_ca_check_syb_version sp_embt_ca_delete_collection sp_embt_ca_get_purge_cond sp_embt_ca_get_refresh_status sp_embt_ca_is_col_available sp_embt_ca_purge_data sp_embt_ca_set_col_status

Table eas_collection_object eas_group eas_option eas_version eas_database_insert eas_option_insert sp_embt_ca_db_obj_space sp_embt_ca_get_col_metric_info sp_embt_ca_get_purge_status sp_embt_ca_is_admin sp_embt_ca_is_col_scheduled sp_embt_ca_run_collection sp_embt_ca_upd_schedule_dates eas_collection_sql eas_map eas_option_type eas_group_insert eas_option_type_insert sp_embt_ca_dbspace sp_embt_ca_get_metric_query_e x sp_embt_ca_get_refresh_cond sp_embt_ca_is_auto_purge_set sp_embt_ca_is_filter_all_set sp_embt_ca_run_datastruct eas_database eas_object_type eas_schedule

O

PENING THE

C

APACITY

A

NALYST

Capacity Analyst runs as a tab in the main DBArtisan window.

To open the Capacity Analyst:

1 Start DBArtisan and connect to the datasource that you want to run reports or analysis against. For details, see

Datasource Management .

2 From the Analyst menu select Capacity Analyst.

OR

On the Analyst Series toolbar click the Capacity Analyst button.

Capacity Analyst opens, displaying any existing collections.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 971

G E T I N G S T A R T E D W I TH T H E C AP A C I TY AN A L Y S T > G E T I N G S TA R TE D W I T H TH E C A PA C I T Y A N AL Y S T

C

APACITY

A

NALYST

R

EPOSITORY

I

NSTALLATION

The Capacity Analyst Repository Installation Wizard lets you install the repository on each database the Capacity Analyst runs against. The repository holds all the captured metrics that you want to collect. For example, this can be the space used in an Oracle tablespace or the number of physical reads on a Microsoft SQL Server.

The wizard installs a set of objects to manage the captured data, and a security role to manage access to the repository and objects.

The Analyst Repository Installation Wizard lets you:

• Create a new repository.

• Upgrade an existing repository.

• Assign a repository owner.

• Assign object placement in the database.

• View feedback on the repository install actions.

Completing the Analyst Repository Installation Wizard

To install the repository, do the following:

1 On the DBArtisan toolbar, click the Capacity Analyst icon.

DBArtisan opens Capacity Analyst. Capacity Analyst detects that no repository is present and opens the Analyst Repository Installation Wizard.

2 Use the following table as a guide to understanding and setting options in the Wizard,

Panel Option

1 Create a new repository

Upgrade existing repository

Description

Lets you create a new repository under a new schema.

Lets you upgrade the version of a current repository. Updates the stored procedures, and adds any new columns to tables. Also lets you use a an existing repository that was created for a different Analyst.

NOTE: Available only if the wizard detects the presence of an earlier version.

97 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G E T IN G S T A R T E D W IT H T HE C A P A C IT Y A N A L Y S T > G E T IN G S T A R T E D W IT H T H E C AP A C I TY AN A L Y S T

Panel Option

Use current login information

Login Name

2

Description

IBM DB2 ONLY: Select to use the default connectivity information as the login id/ password.

Password

Login As

Lets you type the server administrator ID.

NOTE: An administrator ID is not required after the initial repository setup.

Lets you type the server administrator password.

ORACLE ONLY: Lets you select one of three Oracle login modes:

Default - Establishes connection with no system roles.

SYSDBA - Lets you perform all DBA-related functions, like startup and shutdown.

NOTE: SYSDBA is required for the SYS id when you log into a 9i instance.

SYSOPER - Lets you perform many DBA-related functions, like startup and shutdown.

Using

Database

Login

Owner

Storage for tables (and its available space)

Storage for indexes (and its available space)

Password

Schema

Tablespace for

Repository

Tables

Tablespace for

Repository

Indexes

New

MICROSOFT SQL SERVER: Lets you specify authentication type, either SQL Server

Authentication or Windows Authentication.

MICROSOFT SQL SERVER ONLY: Lets you select a database.

SYBASE ASE ONLY: The following system databases are excluded from the list of potential targets for Repository installation:

'Replication' 'model' 'sybsecurity' 'sybsystemdb' 'sybsystemprocs' 'tempdb' 'dbccdb'

'sybdiag'

MICROSOFT SQL SERVER and SYBASE ASE ONLY: Lets you select an owner.

NOTE: Should have the CREATE PROCEDURE privilege on the storage device that is selected. For Oracle, the storage for tables and storage for indexes are tablespaces. The owner must have privileges for the tablespaces.

ORACLE ONLY: Select a new user to own the repository or click New to open the User

Wizard. For details, see

User Wizard (Oracle)

.

NOTE: Should have the CREATE PROCEDURE privilege on the storage device that is selected. For Oracle, the storage for tables and storage for indexes are tablespaces. The owner must have privileges for the tablespaces.

Lets you separate the storage placement of repository tables and indexes. For Oracle, the storage for tables are tablespaces. Select from the list. Or click New to open the creation wizard.

Lets you separate the storage placement of repository tables and indexes. For Oracle, the storage for indexes are tablespaces. Select from the list. Or click New to open the creation wizard.

Lets you specify a password for the repository owner.

IBM DB2 ONLY: Lets you select a schema. All the tables in the repository will be created for this schema. The default value is EMBTCA.

IBM DB2 ONLY: Lets you select the tablespace on which the repository tables are created.

IBM DB2 ONLY: Lets you select the tablespace on which the repository tables are created.

IBM DB2 ONLY: Click to open the Tablespace WIzard. FOr details, see

Wizard (DB2 LUW) .

Tablespace

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 973

G E T I N G S T A R T E D W I TH T H E C AP A C I TY AN A L Y S T > G E T I N G S TA R TE D W I T H TH E C A PA C I T Y A N AL Y S T

Panel Option

3 Repository

Login

Description

Displays repository login

Execution Log Displays installation log.

Displays any errors if they occur.

Execution

Errors

Finish Click to complete the installation. Capacity Analyst installs the necessary files and displays the installation process. When the installation finishes, it displays a finished message. Click Finish to open the Capacity Analyst Tab.

If the installation fails, Capacity Analyst lets you stop the repository installation. Capacity

Analyst deletes the objects that it created.

3 When ready, click Install.

Capacity Analyst creates the repository. Capacity Analyst prompts you to grant other user accounts the privilege of using Capacity Analyst.

4 Select a basic security role:

• Administrator – Users granted this privilege can create, edit, remove, and view capacity collection information.

• User - Users granted this privilege can only view capacity collection information.

TIP:

You can easily grant or remove users from these roles at repository installation time or afterwards. For details, see

Managing Repository Security

.

U

NINSTALLING

C

APACITY

A

NALYST

R

EPOSITORY

The Capacity Analyst Repository Uninstall Wizard reverses the process completed by the Analyst

Repository Installation Wizard.

Completing the Capacity Analyst Repository Uninstall Wizard

1 In the DBArtisan Datasource Explorer, connect to a datasource that has repository installed.

2 On the Analyst toolbar, click the Capacity Analyst button.

3 On the Capacity Collection Editor toolbar, select Command, Repo Management, and then

Uninstall Analyst Repo.

Capacity Analyst opens the Capacity Analyst Repository Uninstall Wizard.

4 Complete the wizard panels.

5 Click Finish.

97 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G E T IN G S T A R T E D W IT H T HE C A P A C IT Y A N A L Y S T > G E T IN G S T A R T E D W IT H T H E C AP A C I TY AN A L Y S T

M

ANAGING

R

EPOSITORY

S

ECURITY

The Manage Repository Security dialog box lets you manage repository security.

The table below describes the options and functionality on the Manage Repository Security dialog box:

Option

Grant

Revoke

Description

Click to grant privileges to target user.

Click to revoke privileges from target user.

Completing the Manage Repository Security Dialog Box

1 In the DBArtisan Datasource Explorer, connect to a datasource that has repository installed.

2 On the Analyst toolbar, click the Capacity Analyst button.

3 On the Capacity Collection Editor toolbar, select Command, Repo Management, and then

Manage Analyst Repo.

Capacity Analyst opens the Manage Repository Security dialog box. The Manage

Repository Security dialog box lets you manage security for the Capacity Analyst.

4 To grant privileges, select the target user, and then click Grant.

Capacity Analyst opens the Grant Privilege(s) To dialog box. The Grant Privilege(s) To dialog box lets you select or clear the check boxes corresponding to the target privileges.

5 To revoke privileges, select the target user, and then click Revoke.

Capacity Analyst opens the Revoke Privilege(s) From dialog box. The Revoke Privileges (s)

From dialog box lets you select or clear the check boxes corresponding to the target privileges.

6 Click OK.

R

EPOSITORY

I

NFORMATION

The Repository Information dialog box displays a tree view to present the information about the repository. The table below describes the standard nodes all datasource platforms:

Node

Repository Owner

Object Placement

Repository Version

Description

Displays the login name of the repository owner.

Displays the database (for SQL Server and Sybase), tablespace (for Oracle), placement for tables and indexes (filegroup name - SQL Server, segment name - Sybase, tablespace

- Oracle and DB2).

Schema and logic version for the tables/indexes and procedures respectively.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 975

G E T I N G S T A R T E D W I TH T H E C AP A C I TY AN A L Y S T > G E T I N G S TA R TE D W I T H TH E C A PA C I T Y A N AL Y S T

Microsoft SQL Server

The Repository Information dialog box displays the following information for Microsoft SQL

Server:

• Repository owner

• Repository version

• Object placement

• Database

• Filegroup name where tables are stored

• Filegroup name where indexes are stored.

• Dates

• Date Created

Sybase ASE

The Repository Information dialog box displays the following information for Sybase ASE:

• Repository owner

• Repository version

• Object placement

• Database

• Segment name where tables are stored

• Segment name where indexes are stored.

• Dates

• Date Created

Oracle

The Repository Information dialog box displays the following information for Oracle:

• Repository owner

• Repository version

• Object placement

• Tablespace name where indexes and tables are stored

• Dates

• Date Created

• Date Updated

97 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

G E T IN G S T A R T E D W IT H T HE C A P A C IT Y A N A L Y S T > G E T IN G S T A R T E D W IT H T H E C AP A C I TY AN A L Y S T

IBM DB2

The Repository Information dialog box displays the following information for IBM DB2:

• Repository schema

• Repository owner

• Repository version

• Object placement

• Tablespace name where indexes and tables are stored

• Dates

• Date Created

Completing the Repository Information Dialog Box

1 In the DBArtisan Datasource Explorer, connect to a datasource that has repository installed.

2 On the Analyst toolbar, click the Capacity Analyst button.

3 On the Capacity Collection Editor toolbar, select Command, Repo Management, and then

Manage Analyst Repo.

Capacity Analyst opens the Repository Information dialog box.

4 To save repository information as a report, click Save.

Capacity Analyst opens the Save Grid dialog box.

5 In Save In, select the location for the repository file.

6 In File Name, type the file name.

7 In Save as Type, select a file type.

8 Click Save.

Capacity Analyst generates the report and returns to the Repository Information dialog box.

9 Click OK.

Capacity Analyst closes the Repository Information dialog box.

L

ICENSING

C

APACITY

A

NALYST

Availability of this feature depends on your DBArtisan licensing. For more information, see

Licensing .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 977

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

C

APACITY

A

NALYST

T

UTORIAL

Embarcadero Capacity Analyst offers intelligent insight into the past, current, and future innerworkings of a database. By collecting historical database and performance metrics at userdefined intervals, Capacity Analyst provides historical trend analysis along with smart forecasting abilities that let you plan for the future needs of key databases. Capacity Analyst runs inside the

Embarcadero DBArtisan console so you can perform all your database administration and analysis in one place.

Embarcadero Capacity Analyst lets you analyze current trends in your database storage and systems performance and helps you understand when corrective action is necessary. Capacity

Analyst also helps you forecast the future needs of the your database so that your key systems can continue to meet the growing needs of its users.

Proceed to

About this Capacity Analyst Tutorial

A

BOUT THIS

C

APACITY

A

NALYST

T

UTORIAL

This short tutorial helps you get started with Embarcadero Capacity Analyst. After you complete this exercise. you will have the foundation you need to explore the many features and benefits of

Capacity Analyst. You will learn how to set up Capacity Analyst and become familiar with creating and scheduling statistical collections. You will also understand how to analyze database trends and perform future forecasts of your database’s needs.

Proceed to

Summary of the Tasks in this Tutorial

S

UMMARY OF THE

T

ASKS IN THIS

T

UTORIAL

The main categories of Capacity Analyst activities are:

• Creating and editing collections - a collection is basically a specified set of metrics. Capacity

Analyst lets you use a wizard to create collections, specifying DBMS-specific metrics as content. You can edit and clone collections as well.

• Executing collections - based on counters, timers, and statistics packages available from the

DBMS you are working against, collections store calculated totals. Executing a collection updates the totals in the collection. Depending on your needs, you can execute collections in an ad hoc fashion or you can schedule collections to be executed at regular intervals.

• Analysis and reporting - Capacity Analyst provides prepackaged reports and a visual analysis tool.

This tutorial walks you through a sample of these activities. You will create a collection with a small variety of metrics, schedule the collection to be updated each hour, and use the analysis and reporting tools.

Proceed to

Choosing an Appropriate Database for the Tutorial Exercises

97 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

C

HOOSING AN

A

PPROPRIATE

D

ATABASE FOR THE

T

UTORIAL

E

XERCISES

The full power of the analysis and reporting tools can only be realized if you work through the exercises against an active database. For best results, use an active test bed or a production system.

Proceed to

Choosing an Appropriate Database for the Tutorial Exercises

R

ATIONALE FOR A

T

WO

-

PART

T

UTORIAL

While a collection stores historical statistics, totals cannot reflect database activities that occurred before the collection was created. In order to view meaningful analysis and reports, enough time must pass to allow a bare minimum of database activity. With that in mind, this tutorial is presented in two parts:

Session 1: Creating and Scheduling a Collection

Session 2: Using Analysis and Reporting Tools

After completing the exercises in session 1, you should wait minimally four hours before starting the second session. THis should allow sufficient database activity to allow for meaningful analysis.

S

ESSION

1: C

REATING AND

S

CHEDULING A

C

OLLECTION

In Session 1, you will first ensure that you are properly set up to evaluate the Capacity Analyst.

Subsequently, you will run the Capacity Analyst, build a small statistics collection, and ensure that it is updated on an hourly basis.

Proceed to

Getting Started with Capacity Analyst (Optional)

G

ETTING

S

TARTED WITH

C

APACITY

A

NALYST

(O

PTIONAL

)

The following topics prepare you for first use of the Capacity Analyst:

Downloading and Installing DBArtisan

Starting DBArtisan and Connecting to a Datasource

• Installing the Capacity Analyst Repository

When you have performed these tasks, or if you have already performed them, you can proceed to

Creating and Scheduling a Capacity Collection Using Capacity Analyst

.

D

OWNLOADING AND

I

NSTALLING

DBA

RTISAN

You can obtain the latest version of Capacity Analyst by downloading the DBArtisan software from the Embarcadero Web site at http://www.embarcadero.com

. Capacity Analyst runs fullycontained within DBArtisan so you will need the DBArtisan product to use Capacity Analyst.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 979

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

To download and install DBArtisan

1 Locate the download area of the Web site and follow the steps indicated.

2 Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for the duration of the trial period. After that time, a permanent license is needed.

Proceed to

Starting DBArtisan and Connecting to a Datasource

S

TARTING

DBA

RTISAN AND

C

ONNECTING TO A

D

ATASOURCE

After installing DBArtisan, you must set up datasources to establish reusable connections to your database servers. For now, you can establish a single connection to the database/server you will use to evaluate Capacity Analyst. DBArtisan can detect and let you register any datasource in your network.

To connect to a database/server

1 Start DBArtisan. For a default installation, Start > Programs > Embarcadero DBArtisan

version number > DBArtisan (where version number corresponds to the version of DBArtisan that you downloaded).

2 On the Datasource menu, select Discover Datasources.

The Discover Datasources dialog opens. After searching your network it lists all datasources to which you can connect.

3 Select the check box corresponding to the target datasource and click Register.

The datasource is added to the left-hand pane of the datasource explorer, under the relevant DBMS folder. For example:

4 RIght-click the datasource and select Connect from the context menu.

A login dialog opens.

5 Provide valid user name and password credentials and click OK.

98 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

Proceed to Installing the Capacity Analyst Repository

I

NSTALLING THE

C

APACITY

A

NALYST

R

EPOSITORY

Capacity Analyst makes use of a repository to store historical statistics about your database. A repository is required for each database/server that you use with Capacity Analyst.

To install a repository on the datasource you connected to

1 From the Analyst menu, select Capacity Analyst.

OR

On the Analyst Series toolbar, click the Capacity Analyst button.

DBArtisan opens Capacity Analyst. Capacity Analyst detects that no repository is present and opens the Analyst Repository Installation Wizard.

Depending on the type of DBMS type of the datasource you connected to, specific options will differ. In general, the Wizard prompts for login/password credentials, as well as server, database, and storage details.

2 Provide the information that the Wizard prompts you for and when complete, click the Install button and provide additional information when prompted.

Capacity Analyst creates the necessary repository objects.

Proceed to

Creating and Scheduling a Capacity Collection Using Capacity Analyst

C

REATING AND

S

CHEDULING A

C

APACITY

C

OLLECTION

U

SING

C

APACITY

A

NALYST

When you open Capacity Analyst, Capacity Analyst displays a simple Capacity Collection

Manager interface that lets you view existing collections, create new collections, and perform many other management functions.

Proceed to

Creating a New Capacity Collection Using Capacity Analyst

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 981

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

C

REATING A

N

EW

C

APACITY

C

OLLECTION

U

SING

C

APACITY

A

NALYST

To get started collecting information for your database, you first need to create a new collection.

A collection is essentially a set of related metrics or statistics that you want to report on. As you begin to make use of Capacity Analyst, you will develop a strategy for metrics you will store in each collection. For the purposes of this tutorial, you can build an arbitrary set of statistics into a collection.

You create a collection using the Capacity Collection Wizard.

To open the Capacity Collection Wizard

1 On the Capacity Analyst toolbar, click the New Collection Wizard button.

Capacity Analyst opens the Capacity Collection Wizard.

The first panel is devoted to naming your capacity collection and specifying various collection properties like descriptions and optional job completion notifications.

98 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

To complete the Wizard

1 Provide the information in the fields provided and click the Next button to continue.

Capacity Analyst opens the Selection Types panel of the Capacity Collection Wizard. The second panel asks you what type of information you would like to collect for your database.

While this panel prompts you to choose general categories, subsequent panels will let you provide more specific information about the choices you make here.

The specific options differ according to the type of DBMS datasource you are connected to, but in general the categories are:

• Storage structures - Depending on the DBMS you are working with, your analysis and reports can contain space and usage statistics on items such as databases and database devices, logs and backup space, partitions, tablespaces, filegroups, and files.

• DB objects - Your analysis and reports can contain space and usage statistics on tables, indexes, and for some supported DBMS types, other database objects.

• Performance-based statistics - if available for the DBMS you are connected to, this lets you use product-specific performance-based statistic packages.

• Wait events - if available for the DBMS you are connected to, this lets you work with waitbased event information provided by the DBMS.

2 For the purposes of this tutorial, select all options on the panel and then click Next.

The next set of panels let you select specific details. Each panel corresponds to one of the options you chose on the Selection Types panel.

Most panels offer categories that let you drill down by expanding the category to expose specific options. You can then select specific options and move them from the Available list to the Selected list and then click Next to move to the next panel.

3 Complete all panels up until the Statistics tab is displayed.

TIP:

Since table and index statistics are supported for all DBMS, as an aid in subsequent sessions, select a variety of indexes and tables on the DB Objects panel.

The Statistics tab prompts you to update the statistics you chose. In order to use the analysis tools offered by Capacity Analyst, you must execute the collection. This performs calculations and rollups on the metrics in the collection, letting you produce up-to-date reports and charts.

4 Look over the options available on the Statistics panel, enable statistics update and select one or more update options, and then click Next.

The AutoPurge panel is displayed. It offers the option to delete older data, each time that you execute a collection.

5 Enable AutoPurge and click the Finish button.

Proceed to

Scheduling a Collection in Capacity Analyst

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 983

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

S

CHEDULING A

C

OLLECTION IN

C

APACITY

A

NALYST

Immediately after your collection has been saved to the repository, Capacity Analyst prompts you if you would like to schedule the collection to run at specified intervals. It is not necessary that you schedule your collection to actually collect statistics in the repository. You can execute a collection in an ad-hoc manner at any time through the Capacity Collection Manager.

Depending on your requirements however, scheduling a collection may be the preferred route.

For example, if you want to run packaged reports on a scheduled basis, scheduling collection of your collections will ensure up-to-date statistics in your scheduled reports.

For the purposes of this tutorial, you want the statistics in your collection updated every hour.

To schedule updates for your new collection

1 Select Yes when asked if you would like to schedule your new collection

The Microsoft Task Manager scheduler opens.

2 Click Advanced to open the Advanced Schedule Options dialog.

3 Select Repeat task, specify that the tasks is to be repeated every hour, ensure that the task is repeated until a time at least four hours from now, and click OK to close the Advanced

Schedule Options dialog.

4 Click OK to schedule your collection and dismiss the dialog.

TIP:

You can add, edit, or remove any schedule for any collection at a later time by using the management functions supplied in the Capacity Collection Manager interface.

Proceed to

Reviewing Other Collection Management Functions

R

EVIEWING

O

THER

C

OLLECTION

M

ANAGEMENT

F

UNCTIONS

While you have completed all required tasks for Session 1, it is worthwhile looking at some of the options Capacity Analyst offers in creating and updating collections. Later, as you develop a strategy for setting up the collections for your enterprise, you will use additional Capacity

Analyst features in managing your collections. With respect to maintaining your collections you have the following options:

Editing collections After creating a collection, you can modify general settings and the AutoPurge option. Since a collection stores totals and rolled up statistics that can be compromised, you cannot modify your choice of statistics or the objects you generate those statistics against.

Cloning collections Cloning lets you create a collection based on an existing collection and modify the metrics used and options specified in the original.

Deleting collections If you no longer have use for a collection or you are going to replace it, you can delete that collection.

Similarly, when you created your collection, you selected the option to update your statistics on an hourly basis. In some cases, you may require ad hoc reports or analysis. If so, you can update your collection manually.

98 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

To manually update a collection

1 In the Capacity Collection Manager, select a collection.

2 On the Capacity Analyst toolbar, click the Execute button.

Depending on the volume of statistics you specified when creating the collection, this may take a few seconds. When complete the Last Run field will reflect the update.

There are other functions contained inside the Capacity Collection Manager, however those described above are likely the ones you will use the most often when managing your capacity collections. You will gain experience using these features as you learn more about Capacity

Analyst.

Proceed to

Session 2: Using Analysis and Reporting Tools

S

ESSION

2: U

SING

A

NALYSIS AND

R

EPORTING

T

OOLS

After several hourly updates of the statistics in the collection you created in Session 1, you are ready to start using the analysis tools. In Session 2, you will experiment with the Collection

Analysis Viewer and generate one of the Capacity Analyst predefined reports.

Proceed to

Performing Trend Analysis Using Capacity Analyst

P

ERFORMING

T

REND

A

NALYSIS

U

SING

C

APACITY

A

NALYST

The Collection Analysis Viewer presents selected statistics in a graphical format and lets you view historical trends and extrapolate that data into the future.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 985

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

To open the Collection Analysis Viewer, do the following

1 Start DBArtisan again, and connect to the datasource you created earlier. If you need help,

refer to Starting DBArtisan and Connecting to a Datasource

.

2 On the Analyst menu, select Capacity Analyst.

3 Select the Capacity Collection that you recently created.

4 On the Capacity Analyst toolbar, click the Collection Analysis Viewer button.

Proceed to

Choosing the Charted Metrics You Want To View

C

HOOSING THE

C

HARTED

M

ETRICS

Y

OU

W

ANT

T

O

V

IEW

The first time that you open the Collection Analysis Viewer, it prompts you select the metrics you want to work with. You specify the metrics using the displayed Capacity Metric dialog. For example:

98 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

To specify the metrics that are to appear in the analysis

1 From the Aggregation dropdown, select an aggregation type: Average, Maximum, or

Minimum.

2 From the Type dropdown, select the type of metric you want to add, such as a table or index.

NOTE:

Certain Metric types allow you to further qualify using the Owner and Database dropdowns.

3 From the Available Object of Type list, choose a specific object or statistics type.

The Metrics list is updated with the metrics available for the Type and Available Objects of

Type selections you made.

4 Select a metric from the Metrics list and click Add.

Capacity Analyst adds the metric to the Current Metrics list.

5 To add additional metrics, repeats step 1 through step 4 . Keep in mind that the Collection

Analysis VIew will calibrate its chart according to the metric with the largest value. If you are going to add multiple metrics, choose metrics that you expect will have similar ranges.

6 When finished adding metrics for the graphical portion of your analysis, click OK.

Proceed to

Viewing Trends in Capacity Analyst

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 987

C A P AC I T Y A N A LY S T TU T O RIA L > C AP A C I T Y A N AL Y S T TU T O RI A L

V

IEWING

T

RENDS IN

C

APACITY

A

NALYST

When you finish adding metrics to the Collection Analysis Viewer, Capacity Analyst presents the data in graphical and grid form in the Collection Analysis Viewer. Your first step should be to ensure that the displayed timescale reflects the fact that you have been updating metrics for a matter of hours. You do this using the controls in the Capacity Metric Attributes area.

To optimize viewing of the metrics in your collection

1 From the Metric Time Scale dropdown, choose Hours.

2 In the Last box, enter the number of hours since you scheduled your collection for hourly updates.

Having only statistics that cover a matter of hours, your viewing options are currently somewhat restrictive. However, during a later session you may want to experiment with the following viewing options:

• By default, the No Trend Analysis option is selected. This option shows historical data only. If you want statistics extrapolated into the future, you can use the Trend to Date or Trend to

Value options to help you predict potential problems.

• You are currently using the Auto Period. It lets you quickly select an interval from the current day or the last statistics update. The Manual option lets you to have more granular control over the exact dates/times that Capacity Analyst uses to plot the data.

• To display the actual data values, position the pointer over the trend lines in the graph. Pop up values display the exact points on the chart.

• Each metric’s statistic displays in the Analysis viewer’s bottom grid with the high, low, and average value for the time period being shown for each metric.

• After your data has been displayed, you can continue to add or remove metrics from the

Collection Analysis Viewer by using the Add or Remove toolbar buttons, and perform other functions using the various options available on the Collection Analysis viewer.

3 When ready to proceed to the next exercise, on the Capacity Analyst toolbar click the Close the Active Tab button.

Proceed to

Using Capacity Analyst Predefined Reports

98 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

C AP A C I TY AN A L Y S T TU T O RI AL > C A P A C IT Y A N A L Y S T TU TO RIA L

U

SING

C

APACITY

A

NALYST

P

REDEFINED

R

EPORTS

An alternative forecasting method is through use of predefined Analysis reports. Capacity

Analyst provides reports on growth trends of devices, databases, tables, rows, and other objects, as well as reports on fragmentation details and failure prediction. Like the COllection Analysis

View, the reports show historical data and can be configured to extrapolate to a future date.

To generate a report on the fastest growing database objects

1 Ensure that the collection you created is selected.

2 Click the Report button.

The Capacity Analyst opens the Select Report Type dialog box.

3 To create a pre-defined trend analysis report, select Analysis Report and click OK.

The Capacity Analyst opens the Capacity Analyst Report Wizard.

4 Accept the default to create a New Analysis Report.

5 Click Next.

6 From the report drop down list, select ‘N” Fastest Growing Objects. Note that there are many other reports available.

7 Accept the default Auto Entry time period of 1 day.

8 Accept the Day default rollup.

9 Specify the future date you want Capacity Analyst to use for its future ‘stop’ date.

10 Click Next.

11 Specify what databases/objects to include in the report.

12 Click Next.

13 Specify a Report File Name and a Report Title.

14 Click Execute.

Capacity Analyst opens the report in a new tab and stores an HTML-based version of the report in the location you specified in the Report File Name field.

The HTML report can be viewed in any web browser so you can build internal web sites of your forecasts for all interested parties, including project leads, and operation managers.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 989

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

U

SING

C

APACITY

A

NALYST

The general categories of tasks performed using the Capacity Analyst are:

Creating and Editing Collections

- Each collection stores a set of statistics. How you set up your collections will depend on your own reporting and monitoring requirements.

Capacity Analyst lets you choose the statistics in your collections and control options such as automatic purging and archiving of data.

Updating Statistics in Collections for use in Reports and Charts

- In order to produce upto-date reports and charts, the rolled up data in collections must be updated. Capacity

Analyst lets you update your collections manually or chedule regular, automated updates.

Viewing Charts and Reports on Collections

- The charts and reports available from the

Capacity Analyst let you view trends and help you make forecasts regarding growth of your databases. The Collection Analysis Viewer lets you view graphical representation of the metrics in a collection as a function of time. Standard reports provide information on growth trends for devices, databases, tables, rows, and other objects, as well as fragmentation details and failure prediction.

C

REATING AND

E

DITING

C

OLLECTIONS

Typically, how you set up collections will be dictated by your own requirements. If your enterprise has several applications for example, each using multiple databases, you might be interested in viewing graphs and reports on an application-by-application basis, with each collection comprising statistics for several databases. At a lower level, you may be interested in viewing statistics on collections of table or indexes.

Similarly, how you set up collections can also be impacted by Capacity Analyst functionality. For example, a collection option lets you schedule statistics update at specified intervals. If your requirements include reports with different intervals, hourly as opposed to weekly for example, you could set up your collections accordingly. Or since the Collection Analysis Viewer calibrates a graph to the range of the highest valued statistic displayed, you might group statistics with similar expected values.

In short, you should consider all functionality available in Capacity Analyst before deciding on a collection setup. For details see

Content and Options in a Collection

and

Viewing Charts and

Reports on Collections

.

The following topics provide details on creating and editing Capacity Analyst collections:

Creating a New Collection

Editing a Capacity Collection

Cloning a Collection

Deleting a Collection

99 0 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

C

ONTENT AND

O

PTIONS IN A

C

OLLECTION

The reports and analysis you work with using Capacity Analyst include such statistics as space usage and access count details on database objects, databases, files and other storage mechanisms. They can also include performance-based and wait based statistics. The specific content and options available depend on the DBMS that DBArtisan is working with. The following topics provide summaries of available options and content on a product-by-product basis:

• IBM DB2 for Windows, Unix, and Linux Capacity Collection Content and Options

• Microsoft SQL Server Capacity Collection Content and Options

• Oracle Capacity Collection Content and Options

• Sybase Capacity Collection Content and Options

IBM DB2

FOR

W

INDOWS

, U

NIX

,

AND

L

INUX

C

APACITY

C

OLLECTION

C

ONTENT AND

O

PTIONS

When creating or editing a Capacity Analyst collection, you specify the statistics you want in that collection and specify additional notification and update options. The table below summarizes the available statistics and options on the tabs/panels of collection wizards and editors for this

DBMS.

Content/Option Category Editor Tab or Wizard panel Description or specific DBMS feature support

Identification/Notification General

Types of statistics collected

Selection Types

Lets you provide a name and description for the collection and optionally, provide an email address or net send name for notifications.

Lets you select the types of content and options you want to include in the collection. You provide specifics in subsequent panels/tabs.

Database/storage structure space statistics

Specific database object types for which to collect statistics

Storage Structures

DB Objects

Update and rollup options Statistics

A DB2 capacity collection can contain usage statistics on database (partition) space, DMS tablespace space, and SMS tablespace space.

A DB2 capacity collection can contain usage statistics on indexes and tables

Automatic purging of old data

AutoPurge

A DB2 capacity collection offers the option to update statistics with additional specific choices for tables

(distribution and column options), indexes (collection of extended and sample statistics), and access options

(allowing read/write access during collection).

Offers the option to automatically purge data older than a specified age, each time the collection is updated.

For information on how to create and edit collections, see:

Creating a New Collection

Editing a Capacity Collection

Cloning a Collection

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 991

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

M

ICROSOFT

SQL S

ERVER

C

APACITY

C

OLLECTION

C

ONTENT AND

O

PTIONS

When creating or editing a Capacity Analyst collection, you specify the statistics you want in that collection and specify additional notification and update options. The table below summarizes the available statistics and options on the tabs/panels of collection wizards and editors for this

DBMS.

Content/Option Category Editor Tab or Wizard panel Description or specific DBMS feature support

Identification/Notification General

Types of statistics collected

Selection Types

Lets you provide a name and description for the collection and optionally, provide an email address or net send name for notifications.

.Lets you select the types of content and options you want to include in the collection. You provide specifics in subsequent panels/tabs.

Database/storage structure space statistics

Storage Structures

Specific database object types for which to collect statistics

DB Objects

Wait-event-based statistics Wait Events

An SQL Server capacity collection can contain size statistics on database backup space and database log backup space, and usage and size statistics on database space, filegroups, and files.

An SQL Server capacity collection can contain usage and size statistics on indexes and tables.

Performance-based statistics

Update and rollup options

Automatic purging of old data

Performance Statistics

Statistics

AutoPurge

An SQL Server capacity collection can contain statistics on SQL Server Wait Types

Provides statistics in the following performance counter categories: Access Methods, Buffer Manager, Buffer

Partition, Databases, General Statistics, Latches, Locks,

Memory Manager, SQL Statistics

Provides the option to update statistics with additional options to specify a scan range, specify index or columns update, and recompute statistics

Offers the option to automatically purge data older than a specified age, each time the collection is updated.

For information on how to create and edit collections, see:

Creating a New Collection

Editing a Capacity Collection

Cloning a Collection

99 2 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

O

RACLE

C

APACITY

C

OLLECTION

C

ONTENT AND

O

PTIONS

When creating or editing a Capacity Analyst collection, you specify the statistics you want in that collection and specify additional notification and update options. The table below summarizes the available statistics and options on the tabs/panels of collection wizards and editors for this

DBMS.

Content/Option Category Editor Tab or Wizard panel Description or specific DBMS feature support

Identification/Notification General

Types of statistics collected

Selection Types

Lets you provide a name and description for the collection and optionally, provide an email address or net send name for notifications.

Lets you select the types of content and options you want to include in the collection. You provide specifics in subsequent panels/tabs.

Database/storage structure space statistics

Storage Structures

Specific database object types for which to collect statistics

DB Objects

Wait-event-based statistics Wait Events

Performance-based statistics

Global Stats

Update and rollup options Statistics

Automatic purging of old data

AutoPurge

All tablespace, all non-temporary tablespaces, or select specific tablespaces

Lets you include statistics on clusters, indexes, index partitions, rollback segments, tables, and table partitions.

Lets you include statistics based on Oracle Wait Events.

Lets you include Global Database Statistics.

Offers the option to update statistics with additional options to compute or estimate statistics.

Offers the option to automatically purge data older than a specified age, each time the collection is updated.

For information on how to create and edit collections, see:

Creating a New Collection

Editing a Capacity Collection

Cloning a Collection

S

YBASE

C

APACITY

C

OLLECTION

C

ONTENT AND

O

PTIONS

When creating or editing a Capacity Analyst collection, you specify the statistics you want in that collection and specify additional notification and update options. The table below summarizes the available statistics and options on the tabs/panels of collection wizards and editors for this

DBMS.

Content/Option Category Editor Tab or Wizard panel Description or specific DBMS feature support

Identification/Notification General Lets you provide a name and description for the collection and optionally, provide an email address or net send name for notifications.

Types of statistics collected

Selection Types Lets you select the types of content and options you want to include in the collection. You provide specifics in subsequent panels/tabs.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 993

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

Content/Option Category Editor Tab or Wizard panel Description or specific DBMS feature support

Database/storage structure space statistics

Storage Structures Lets you use Global Space Summary statistics for the datasource or space and usage statistics for specific database devices and databases.

Lets you include statistics on indexes and tables.

Specific database object types for which to collect statistics

DB Objects

Wait-event-based statistics Wait Events

Performance-based statistics

Performance Statistics

Update and rollup options Statistics

Automatic purging of old data

AutoPurge

Wait event statistics are only available if MDI performance views have been created.

Lets you include Sybase Performance Statistics in a collection.

Option to update statistics with additional options to update indexes or partitions

Offers the option to automatically purge data older than a specified age, each time the collection is updated.

For information on how to create and edit collections, see:

Creating a New Collection

Editing a Capacity Collection

Cloning a Collection

C

REATING A

N

EW

C

OLLECTION

Capacity Analyst has a WIzard that walks you through specifying the statistics and options in a collection. Before creating a new collection, you should be familiar with the material in

Content and Options in a Collection .

To create a new collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 On the Capacity Analyst toolbar click the New Collection Wizard button.

The Capacity Collection Wizard opens.

3 Provide the information required on each panel of the Wizard. For more information on these options, see the relevant DBMS-specific topic under

Content and Options in a

Collection

.

4 When done click Finish.

Capacity Analyst offers the option to schedule updates for the statistics in this collection.

99 4 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

5 If you decide to schedule statistics updates, use the Windows Task Scheduler to provide update details.

Capacity Analyst adds the new collection to the Capacity Collection list.

See the following tasks for information on tasks you can perform after creating a collection:

Editing a Capacity Collection

Updating Statistics in Collections for use in Reports and Charts

Viewing Charts and Reports on Collections

E

DITING A

C

APACITY

C

OLLECTION

Because a collection stores rolled up statistics, all gathered and calculated over a specific interval, editing statistics in a collection could corrupt the data in a collection. Therefore, you cannot modify the statistics in a collection or the devices, databases or database objects that statistics are gathered against. You can only modify the basic identifiers for the collection and the refresh and autopurge options.

To edit an existing collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select the collection to be edited and then on the Capacity Analyst toolbar click the Open

Collection button.

3 On the General tab, edit the name, description, email address, or net send name.

4 On the Statistics tab, enable or disable update of statistics when you save your changes.

5 On the AutoPurge tab, enable or disable autopurge of older data when you save your changes.

6 Click OK.

C

LONING A

C

OLLECTION

The Capacity Analyst lets you create a new collection from an existing collection. This lets you build a new collection starting from properties defined in the existing collection.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 995

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

To make a copy of an existing collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select the collection to be cloned and then on the Capacity Analyst toolbar click the Clone

Collection button.

Capacity Analyst opens the Capacity Analyst Collection Wizard. With the exception of the collection name, all statistics and options specified for the new collection are identical to those for the existing collection.

3 Minimally, provide a name for the new collection. Complete each panel of the wizard, changing settings as required. For more information on these options, see the relevant

DBMS-specific topic under Content and Options in a Collection

.

4 When done click Finish.

Capacity Analyst offers the option to schedule updates for the statistics in this collection.

5 If you decide to schedule statistics updates, use the Windows Task Scheduler to provide update details.

Capacity Analyst adds the new collection to the Capacity Collection list.

See the following tasks for information on tasks you can perform after cloning a collection:

Editing a Capacity Collection

Updating Statistics in Collections for use in Reports and Charts

Viewing Charts and Reports on Collections

D

ELETING A

C

OLLECTION

If you no longer use the reports or analysis associated with a collection, Capacity Analyst lets you delete the collection.

To delete a collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a collection and then on the Capacity Analyst toolbar click the Delete button.

Capacity Analyst prompts you to verify that you want to delete the collection.

3 Click Yes.

99 6 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

U

PDATING

S

TATISTICS IN

C

OLLECTIONS FOR USE IN

R

EPORTS AND

C

HARTS

Once you have installed and set up Capacity Analyst on a server, raw statistics are gathered and stored in the repository on that server. In order to view up-to-date charts and reports, you must execute a collection. Executing the collection calculates totals and performs all rollups for that collection in preparation for reporting.

There are two methods of updating statistics in a collection:

Manually Updating Collections

, useful prior to running an ad hoc report

Scheduling Updates of Collections to run regularly, useful when reporting is performed on a

regular basis

M

ANUALLY

U

PDATING

C

OLLECTIONS

You can manually execute a statistics collection. This calculates totals and statistical indicators such as averages used for reporting for that collection.

To manually execute a collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a collection and then on the Capacity Analyst toolbar click the Execute button.

When complete, the Last Run field reflects the time that the collection was updated.

After executing a collection, you can run reports or view charts for that collection, that are up-todate as of the time that you executed the collection. For details, see

Viewing Charts and Reports on Collections

.

Related topics

Creating and Editing Collections

S

CHEDULING

U

PDATES OF

C

OLLECTIONS

If you run reports or want to regularly archive statistics for intervals, you can schedule execution of statistics collections. This updates the totals, rollups, and statistical indicators such as averages, on a regular basis. You can schedule collection updates to occur regularly such as daily weekly, or monthly, or tie execution to events such as system startup, logon, or during idle time.

The following topics provide details on the scheduling tasks you can perform against a collection:

• Creating an Update Collection Schedule

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 997

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

• Editing an Update Collection Schedule

• Deleting an Update Collection Schedule

C

REATING AN

U

PDATE

C

OLLECTION

S

CHEDULE

You can create an update collection schedule to have statistics in that collection updated at regular intervals or have updates triggered by events such as system startup or logon.

In setting up your schedule, keep the following points in mind:

• Some statistical collections depend on the underlying dynamics of the database objects being collected. For example, storage structure space metrics, table and index statistics, etc., are oftentimes best collected only once a day. Other statistics, such as wait events and global database metrics can be collected on a much more granular level (every hour, etc.)

• If you routinely stop and start your database at a certain time, you may want to ensure that your collection job is not scheduled to run during its downtime. Also realize that stopping and starting a database resets the counters used for wait events and global database metrics.

• If you use the Microsoft scheduler on your machine, remember to not turn your machine off during the times your collection is scheduled to run or the job will not run.

TIP:

You can add, edit, or remove any schedule for any collection at a later time by using the management functions supplied in the Capacity Collection Manager interface.

To schedule updates for a collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection that currently does not have an associated execution schedule.

3 Click the Schedule button.

Capacity Analyst opens the Job Scheduler.

4 Use the Job Scheduler to specify the frequency of the report or the event that triggers the update, and other details of the schedule.

5 When finished, click OK.

Related topics

• Editing an Update Collection Schedule

Viewing Charts and Reports on Collections

99 8 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

E

DITING AN

U

PDATE

C

OLLECTION

S

CHEDULE

After creating an update schedule for a statistics collection, you can revise the schedule. You may wish to change the frequency of updates or the event which triggers an update, or more specific details of the update schedule.

To modify the update schedule for a collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection that currently has an associated execution schedule.

3 Click the Edit Schedule button.

Capacity Analyst opens the Job Scheduler.

4 Use the Job Scheduler to change the frequency of the report or the event that triggers the update, and other details of the schedule.

5 When finished, click OK.

Related topics

Scheduling Updates of Collections

• For information on modifying the statistics in a collection, see

Editing a Capacity Collection

Viewing Charts and Reports on Collections

D

ELETING AN

U

PDATE

C

OLLECTION

S

CHEDULE

If you no longer want statistics in a collection to be calculated on a regular basis or if you want to create a new, completely reworked schedule, you can delete the existing schedule for a collection.

To unschedule a Capacity Collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection.

3 On the Capacity Analyst toolbar, click the Unschedule button.

Capacity Analyst unschedules the Capacity Collection.

Related topics

Scheduling Updates of Collections

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 999

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

• Creating an Update Collection Schedule

P

URGING

O

LD

D

ATA IN A

C

OLLECTION

Policy or practicality may dictate that the metrics in your analysis and reports not include data older than a specified date. Capacity Analyst lets you manually purge data older than a specified number of months or years.

NOTE:

In addition to manually purging old data, when creating or editing a collection, you can set up the collection to automatically purge data older than a specified date on every

update. For details, see Creating and Editing Collections .

To manually purge collection data older than a specified number of months or years

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection.

3 On the toolbar, click the Purge button.

The Perform Manual Data Purge dialog opens.

4 Use the controls in the Purge data older than area to provide a specific number of months or years.

5 Click Execute and when prompted to confirm, click Yes.

V

IEWING

C

HARTS AND

R

EPORTS ON

C

OLLECTIONS

The preliminary steps in setting up Capacity Analyst are

Creating and Editing Collections

and

Updating Statistics in Collections for use in Reports and Charts . Once your collections are

defined and the statistics updated, Capacity Analysts lets you view forecasting/trends charts and reports on your collections. Key options are:

Using the Collection Analysis Viewer

- lets you view charted representations of collection metrics as a function of time.

Working with Capacity Analyst Reports - lets you work with predefined reports that focus on

growth of databases, storage mechanisms, and specific database objects, as well as failure prediction and fragmentation.

U

SING THE

C

OLLECTION

A

NALYSIS

V

IEWER

The Collection Analysis Viewer lets you perform ad hoc analysis of statistics in a collection. It presents the metrics in two formats: a graphical representation that shows values over time and a tabular format that includes metrics such as average, maximum, and minimum values.

10 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

The Collection Analysis Viewer lets you:

• View historical trends for a metric and extrapolate into the future

• Compare and contrast multiple metrics

• Vary the time scale for fine-grained or coarse-grained views

The first time that you open the Collection Analysis Viewer on a particular collection, you are prompted to select the metrics you want to view for that collection. Subsequently, when using the Collection Analysis Viewer against that collection, you can add metrics to and delete metrics from the collection.

To open the Collection Analysis Viewer on a collection

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection. For more information, see Creating and Editing Collections .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1001

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

3 On the toolbar, click the Collection Analysis Viewer button.

NOTE:

If this is the first time you have opened this particular collection, you are prompted to specify the statistics to display. For help with this step, see Adding Metrics to the

Collection Analysis Viewer for a Collection .

Capacity Analyst opens the Collection Analysis View or the selected collection.

Viewing options available when working with the Collection Analysis Viewer include:

• Using the Delete Metric button to remove a statistic from the displayed metrics for a collection

• Using the zoom buttons on the Collection Analysis Viewer toolbar to zoom in and out on the report

• Using the refresh button on the Collection Analysis Viewer toolbar to update displayed values

• Using the Collection dropdown to open the Collection Analysis Viewer on a different collection

• Using the Metric Time Scale dropdown to choose between displayed time scales of hours, days, months, or years

• Using the trending and value dropdowns to extrapolate metric values out to specified values or specific dates

• Using the Period controls to change the date/time range displayed

• Viewing values for metrics at specific locations on the graph by floating the cursor over specific locations on the curve

A

DDING

M

ETRICS TO THE

C

OLLECTION

A

NALYSIS

V

IEWER FOR A

C

OLLECTION

There are two situations in which you can add metrics viewed using the Collection Analysis

Viewer:

• The first time that you open the Collection Analysis Viewer for a given collection

• When you want to manually add metrics by clicking the Collection Analysis Viewer toolbar’s

Add Metric button:

10 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

In both cases, Capacity Analyst opens a Capacity Metric dialog to let you add metrics.

For each metric you want add to the Capacity Analyst Analysis Viewer

1 From the Aggregation dropdown, select an aggregation type: Average, Maximum, or

Minimum.

2 From the Type dropdown, select the type of metric you want to add.

NOTE:

Certain Metric types allow you to further qualify using the Owner and Database dropdowns.

3 From the Available Object of Type list, choose a specific object or statistics type.

The Metrics list is updated with the metrics available for the Type and Available Objects of

Type selections you made.

4 Select a metric from the Metrics list and click Add.

Capacity Analyst adds the metric to the Current Metrics list.

5 To add additional metrics, repeats step 1 through step 4 .

6 When finished adding metrics for the Capacity Analyst Collection Analysis Viewer, click OK.

Capacity Analyst updates the Collection Analyst Viewer with the new metrics.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1003

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

W

ORKING WITH

C

APACITY

A

NALYST

R

EPORTS

Capacity Analyst provides two report options. For details, see the following topics:

• Running a Capacity Collection Summary Report - lets you view a summary of the metrics and options currently defined for a collection.

• Running an Analysis Report - lets you view one of several predefined reports focusing on growth trends

R

UNNING A

C

APACITY

C

OLLECTION

S

UMMARY

R

EPORT

You can produce a high-level summary of the content and options associated with a collection. It includes:

• Basic identification information such as the name, associated datasource, and owner of the collection

• A listing of the options, refresh and auto-purge for example, chosen for that collection

• A summary of the types of statistics available for use in the collection

• A detailed listing of the objects for which statistics are collected

NOTE:

For a detailed listing of the specific statistics and options available for the DBMS you

are working with, see the DBMS-specific heading under Content and Options in a

Collection

.

To run a Capacity Collection Summary Report

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection. For more information, see Creating and Editing Collections .

3 On the Capacity Analyst toolbar, click the Report button.

Capacity Analyst opens the Select Report Type dialog.

4 Select Capacity Collection Summary Report and click OK.

Capacity Analyst opens the summary report in a new tab.

R

UNNING AN

A

NALYSIS

R

EPORT

Capacity Analyst lets you run a set of predefined reports against a collection. The reports and their availability by DBMS are:

• Database growth trends (Sybase, SQL Server, DB2)

• Tablespace failure prediction (Oracle)

• Tablespace growth trends (DB2, Oracle)

10 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

US IN G C A PA C I T Y A N AL Y S T > U S I N G C AP A C I TY AN A L Y S T

• Device growth trends (Sybase)

• Filegroup growth trends (SQL Server)

• File growth trends (SQL Server)

• Object growth trends (Sybase, SQL Server, DB2, Oracle)

• Object extent trends (Sybase, SQL Server)

• Object extent failure prediction

• Database backup growth trends (SQL Server)

• ‘N’ Fastest growing databases (Sybase, SQL Server, DB2)

• ‘N’ Fastest growing tablespaces (Oracle)

• ‘N’ Fastest growing objects (Sybase, SQL Server, DB2, Oracle)

• Table rows trend (Sybase, SQL Server, DB2, Oracle)

• Table chained/migrated rows trend (Oracle)

• Table forwarded records trend (Sybase, SQL Server)

• Index level trend (Oracle)

• Object fragmentation trends (Sybase, SQL Server, DB2)

• Tablespace fragmentation trend (Oracle)

• Database failure prediction (Sybase, SQL Server)

• DMS tablespace failure trends (Oracle)

To run an analysis report

1 Open the Capacity Analyst. See Opening the Capacity Analyst

.

2 Select a Capacity Collection. For more information, see Creating and Editing Collections .

3 On the Capacity Analyst toolbar, click the Report button.

Capacity Analyst opens the Select Report Type dialog.

4 Select Analysis Report and click OK.

Capacity Analyst opens the Capacity Analyst Report Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1005

U S IN G C A P AC IT Y A N A L YS T > US IN G C A PA C I T Y A N AL Y S T

5 Use the following table as a guide to understanding the settings and options for this wizard

Panel

Panel 1

Panel 2

Panel 3

Panel 4

Tasks and settings

Do you wish to create a new analysis report or ‘playback’ a previously saved report definition?

What report would you like to create?

Enter the time period sample to use for the report

Description

As the last step in generating a report, you are offered the option to save the report definition, for the purpose of running the report again. If you have already saved report definitions, you can use this panel to enable the Previously

Saved Report option and select the existing report definition.

Otherwise, to run an ad hoc report or start a new report definition, you can use the New Analysis Report option.

Lets you select one of the predefined report types listed above.

Auto Entry lets you specify a number of days, months or years while Manual Entry lets you provide specific start and end dates.

Enter the time rollup to use for the report.

Enter the date to use for forward predictions.

Select options for the report.

Lets your report display statistics rolled up by day, month, or year.

Lets you enter a future end date that the Capacity Analyst uses to forecast.

Include objects for report.

Data will be presented in text/grid format.

Save this report definition?

The options offered differ by the type of report you selected and the DBMS that DBArtisan is working with.

Expand or collapse databases or owner lists to display specific object types and use the arrow buttons to move selected objects between the Available and Selected lists.

Lets you specify file name and path where the report will be stored and provide a title for the report.

Lets you save the report definition, specifying the file name and path for the definition.

6 When complete, click Schedule or Execute to run the report.

When complete, the report opens in a new DBArtisan tab.

NOTE:

When viewing the report in DBArtisan, you can use the toolbar’s Refresh button to update values displayed.

A static, HTML version is also saved to with the file name and path you specified in the Report

File Name field.

10 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P

ERFORMANCE

A

NALYST

Performance Analyst is a robust client-side monitoring product that presents a complete picture of a database's performance. Performance Analyst is a quick, lightweight tool that lets you investigate performance bottlenecks.

The table below describes the major sections of Help.

Section

Welcome to Performance

Analyst

Performance Analyst

Application Basics

Using Performance Analyst

Performance Analyst for Oracle

Tutorial

Oracle Performance Analyst

Statistics

Performance Analyst for

Microsoft SQL Server Tutorial

Microsoft SQL Server

Performance Analyst Statistics

Performance Analyst for

Sybase Tutorial

Description

Provides information about installing, opening, and licensing Performance Analyst.

Provides conceptual information about Performance

Analyst’s product design and navigation.

Shows how to use each component of the application.

Using Performance Analyst breaks each process and procedure into simple step-by-step instructions.

Helps you get started with Embarcadero Performance

Analyst. Provides the foundation you need to explore the many features and benefits of Performance Analyst.

Performance Analyst includes expert help for all supported database platforms.

Helps you get started with Embarcadero Performance

Analyst. Provides the foundation you need to explore the many features and benefits of Performance Analyst.

Performance Analyst includes expert help for all supported database platforms.

Sybase ASE Performance

Analyst Statistics

Performance Analyst for IBM

DB2 for Linux, Unix and

Windows Tutorial

IBM DB2 (W/U/L) Performance

Analyst statistics

Helps you get started with Embarcadero Performance

Analyst. Provides the foundation you need to explore the many features and benefits of Performance Analyst.

Performance Analyst includes expert help for all supported database platforms

Helps you get started with Embarcadero Performance

Analyst. Provides the foundation you need to explore the many features and benefits of Performance Analyst.

Performance Analyst includes expert help for all supported database platforms

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1007

P E R F O R M A N C E A N A L Y S T >

10 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WE LC O M E T O P E R F O R M AN C E A N A L Y S T > WE L C O M E T O P E R F O R M A N C E AN A L Y S T

W

ELCOME TO

P

ERFORMANCE

A

NALYST

Performance Analyst is a client-side only visual database monitor that displays current database performance data, including key performance metrics, bottleneck analysis, and userconfigurable thresholds.

Running inside the Embarcadero DBArtisan console, or stand-alone in a Web browser,

Performance Analyst lets you identify performance problems that threaten database availability or response times.

Supported DBMS

Embarcadero Technologies currently offers Performance Analyst for Oracle 8i - 10g. Performance

Analyst does not support Oracle Clients 7.3.4, 8.1.7, and 9.2. Performance Analyst also supports

Microsoft SQL Server and DB2.

For more information, see:

• What You Should Know Before Installation

• Operating System Prerequisites

• Opening the Performance Analyst

• Licensing Performance Analyst

W

HAT

Y

OU

S

HOULD

K

NOW

B

EFORE

I

NSTALLATION

When you install the Analyst, several Embarcadero-generated stored objects are pushed onto the database server:

These objects are as follows:

ORACLE PROCEDURES

Procedures

ALL_TABLESPACES

INSTANCESTARTUP

IO_DD_ARCHIVELOGMODE

IO_DD_DATAFILEIO

ALL_USERS

IO_DD_ACCESSPATTERNDETAIL

IO_DD_CURRENTDISKSORTS

IO_DD_DBWRDETAIL

HOTTESTDBFILES

IO_DD_ACTIVEROLLBACKDETAILS

IO_DD_DAILYARCHIVELOGSUMMARY

IO_DD_ESTPHYSICALIOBYTABLE

IO_DD_JOBQUEUESUMMARY

IO_DD_REDOWASTAGE

IO_DD_RUNNINGJOBSDETAIL

IO_DD_TABLESPACEIO

IO_DD_LGWRDETAIL

IO_DD_REDOWASTAGE2

IO_DD_SESSIONROLLBACKACTIVITY

MEMORY_DD_BUFFERCACHERATIO

MEMORY_DD_BUFFERPOOLHITRAT MEMORY_DD_BUFFERPOOLMEMCO

NF

IO_DD_PROBLEMJOBS

IO_DD_ROLLBACKIO

IO_DD_SESSIONSORTDETAIL

MEMORY_DD_BUFFERCACHEUTIL

MEMORY_DD_BUFFERPOOLOBJASS

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1009

WEL C O M E T O P E R F O R M A N C E AN A L Y S T > WEL C O M E T O P E R F O R M A N C E A N AL Y S T

MEMORY_DD_CACHEDBLOCKSBYTS MEMORY_DD_CACHEDTABLES

MEMORY_DD_LATCHDETAILS MEMORY_DD_LATCHRATIOS

MEMORY_DD_LIBCACHEPERF

MEMORY_DD_PGAWORKAREA

MEMORY_DD_PGADETAIL

MEMORY_DD_PINNEDOBJECTS

MEMORY_DD_SHAREDPOOLUSAGE MEMORY_DD_SHAREDPOOLUTIL

OBJECT_DD_GLOBALOBJSUM OBJECT_DD_HOTCODE

OBJECT_DD_INDEXES

OBJECT_DD_REORGANALYSIS

OBJECT_DD_INVALIDOBJDET

OBJECT_DD_TABLESINSAMETS

OBJECTBUFFERPOOLPLACEMENT

RAC_LOCKS_LATCH

RAC_MEMORY_DATACACHE

RAC_OVERVIEW_CONFLICTS

RAC_LOCKS_CONVERT

RAC_LOCKS_PCM

RAC_MEMORY_KEYRATIO

RAC_OVERVIEW_INSTANCE

RAC_OVERVIEW_WAITS

RAC_PING_INSTANCE

RESPONSETIME_HISTORYSESSION

RESPONSETIME_LASTHOUR

RESPONSETIME_SESBOTTLENECK

RAC_OVERVIEW_WORKLOAD

RAC_PING_OBJECT

RAC_SESSIONS_TOP RAC_SESSIONS_USER

RESPONSETIME_CURRENT_RESTIME RESPONSETIME_CURRENTWORKLO

AD

RESPONSETIME_HISTORY RESPONSETIME_HISTORYFILE

RESPONSETIME_HISTORYSQL

RESPONSETIME_LASTHOURDETAIL

RESPONSETIME_SESSIONTIME

RESPONSETIME_SESBOTTLENECKD

TL

RESPONSETIME_SYSBOTTLENECKHI

S

RESPONSETIME_SYSTEMTIME

RETRIEVEHOMEPAGE

RETRIEVEMEMORYPAGE

RETRIEVEOBJECTRATIOS

RETRIEVEUSERRATIOS

SESSION_DD_CRNTWAITS

SESSION_DD_HISTWAITS

SESSION_DD_OVERVIEW

SESSION_LAST_TEN_WAIT

SPACE_DD_DATAFILEDETAIL

SPACE_DD_SPACEBYOBJECT

SPACE_DD_TABLESPACEGROWTH

SPACE_DD_TOPUSERS

SQLANALYSIS_IO

RESPONSETIME_WAITHISTOGRAM

RETRIEVEHOMERATIOS

RETRIEVEMEMORYRATIOS

RETRIEVESPACEPAGE

SESSION_DD_ALLLOCKS

SESSION_DD_CURRENTSQL

SESSION_DD_OPENCURSORS

SESSION_DD_OVERVIEWSTAT

SESSION_TIME_SUMMARY

SPACE_DD_DATAFILEFRAG

SPACE_DD_SPACEBYUSER

SPACE_DD_TABLESPACEMAP

SPACEANALYSIS

SQLANALYSIS_MEMORY

MEMORY_DD_DATADICTDETAILS

MEMORY_DD_LIBCACHEHITRATIO

MEMORY_DD_PGAOVERVIEW

MEMORY_DD_SHAREDPOOLFRAG

NOT_WAITING_SESSIONS_COUNT

OBJECT_DD_HOTTABLES

OBJECT_DD_INVALIDOBJSUM

OBJECT_DD_USEROBJSUM

RAC_LOCKS_DLM

RAC_MEMORY_ANALYSIS

RAC_MEMORY_LIBRARYCACHE

RAC_OVERVIEW_RATIOS

RAC_PING_DATAFILE

RAC_SESSIONS_BLOCKS

RAC_SESSIONS_USERWAITS

RESPONSETIME_HISTLISTEVENT

RESPONSETIME_HISTORYOBJECT

RESPONSETIME_HISTORYSUMMARY

RESPONSETIME_LISTMETRIC

RESPONSETIME_SESBOTTLENECKHI

ST

RESPONSETIME_SYSTEMBOTTLENE

CK

RESPONSETIME_WAITHISTOLIST

RETRIEVEIOPAGE

RETRIEVEOBJECTPAGE

RETRIEVEUSERPAGE

SESSION_DD_BLKLOCKS

SESSION_DD_CURRENTSQLSTAT

SESSION_DD_OTHERSQL

SESSION_DD_TRANSACTIONS

SPACE_DD_ACCOBJECTGRID

SPACE_DD_EXTENTANALYSIS

SPACE_DD_TABLESPACEFRAG

SPACE_DD_TABLESPACEOBJSUM

SQLANALYSIS_HOME

SQLANALYSIS_OBJECT

10 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WE LC O M E T O P E R F O R M AN C E A N A L Y S T > WE L C O M E T O P E R F O R M A N C E AN A L Y S T

SQLANALYSIS_SPACE

TOP_SYSTEM_BOTTLENECKS_10G

TOPDISKSORTPROCESS

TOPIOPROCESS

TOPLOGFILEWAITS

TOPPARSEPROCESS

TOPSESSIONS_10G

TOPSQL_RECENT_HISTORY

TOPSQL_SUMMARY_DETAILS

USERS_DD_ALL_LOCKS

USERS_DD_BY_TOTAL_WAITS

USERS_DD_HISTWAITS_10G

WAITING_SESSIONS_COUNT

WORSTSCHEMAFORINVALIDOBJECT

S

SQLANALYSIS_USER

TOPCPUPROCESS

TOPFRAGMENTEDDATAFILES

TOPLARGESCANPROCESS

TOPMEMORYHOGS

TOPSESSIONBOTTLENECKS

TOPSPACEHOGS

TOPSQL_SQLTEXT

TOPSYSTEMBOTTLENECKS

USERS_DD_BLK_LOCKS

USERS_DD_CRNTWAITS

USERS_DD_SYSTEMWAITS_10G

WORSTSCHEMAFORCHAINEDROWT

ABLES

TABLEHIGHWATERMARKPROBLEMC

OUNT

TOPDBFILEWAITS

TOPIOHOGS

TOPLATCHMISSES

TOPMEMORYPROCESS

TOPSESSIONS

TOPSQL_DETAILS

TOPSQL_STATS

USERACTIVITYANALYSIS

USERS_DD_BY_TIME_WAITED

USERS_DD_HISTWAITS

VERSION

WORSTSCHEMAFOREXTENTPROBLE

MS

SQL SERVER

Procedures sp_embt_pa_all_database_enumerrorlo g sp_embt_pa_database_analysis sp_embt_pa_all_database_list sp_embt_pa_current_sq sp_embt_pa_database_drill_backups_d etail sp_embt_pa_database_drill_config_serv er sp_embt_pa_database_drill_error_log_v olume sp_embt_pa_database_drill_obj_table_ det sp_embt_pa_database_drill_replication_ thruput sp_embt_pa_database_drill_sqlagent_jo bdet sp_embt_pa_database_errorlog sp_embt_pa_home_active_processes sp_embt_pa_home_bottlenecks sp_embt_pa_instance_startup t sp_embt_pa_database_bottleneck sp_embt_pa_database_drill_backups_d b sp_embt_pa_database_drill_backups_log sp_embt_pa_database_drill_config_deta il sp_embt_pa_database_drill_error_log_con tent sp_embt_pa_database_drill_obj_index_de sp_embt_pa_database_drill_overview sp_embt_pa_database_drill_error_log_d etail sp_embt_pa_database_drill_obj_summ sp_embt_pa_database_drill_sqlagent_alrt det sp_embt_pa_database_drill_sqlagent_jobs um sp_embt_pa_db_requiring_backup sp_embt_pa_database_drill_replication_ agent sp_embt_pa_database_drill_sqlagent_al rtsum sp_embt_pa_database_drill_sqlagent_st atus sp_embt_pa_db_workload_analysis sp_embt_pa_home_activity_metrics sp_embt_pa_home_storage_database_co unt sp_embt_pa_io_access_ratios sp_embt_pa_home_bottleneck_waits sp_embt_pa_home_storage_totals sp_embt_pa_io_activity_metrics

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1011

WEL C O M E T O P E R F O R M A N C E AN A L Y S T > WEL C O M E T O P E R F O R M A N C E A N AL Y S T sp_embt_pa_io_bottlenecks sp_embt_pa_io_drill_system_awe sp_embt_pa_io_drill_system_space sp_embt_pa_io_drill_user_sql sp_embt_pa_io_hottest_files sp_embt_pa_memory_analysis sp_embt_pa_memory_drill_buffer_page

_activity sp_embt_pa_user_ratio_process sp_embt_pa_io_drill_database sp_embt_pa_io_drill_system_io sp_embt_pa_io_drill_user_lock sp_embt_pa_io_drill_user_temp sp_embt_pa_io_ratios sp_embt_pa_memory_drill_bcache sp_embt_pa_memory_drill_log_details sp_embt_pa_io_drill_file sp_embt_pa_io_drill_system_physical sp_embt_pa_io_drill_user_obj sp_embt_pa_io_get_file_stats sp_embt_pa_io_top_processes sp_embt_pa_memory_drill_buffer sp_embt_pa_memory_drill_log_instance s sp_embt_pa_memory_drill_proc_detail sp_embt_pa_memory_drill_proc_summary sp_embt_pa_memory_latch_stats sp_embt_pa_memory_ratio_mem sp_embt_pa_memory_sql_analysis sp_embt_pa_memory_top_latch_waits sp_embt_pa_space_bottlenecks sp_embt_pa_space_drill_filegroups sp_embt_pa_memory_workload_analysi s sp_embt_pa_space_drill_files sp_embt_pa_space_drill_objects_table_ det sp_embt_pa_space_drill_object_summary sp_embt_pa_space_drill_objects_index_ det sp_embt_pa_space_drill_server_by_db sp_embt_pa_space_drill_server_summar y sp_embt_pa_space_drill_vlogs sp_embt_pa_space_used_disk_space sp_embt_pa_top_sql_home sp_embt_pa_top_sql_space sp_embt_pa_space_free_disk_space sp_embt_pa_top_sql_database sp_embt_pa_top_sql_query sp_embt_pa_top_sql_start sp_embt_pa_space_main sp_embt_pa_top_sql_details sp_embt_pa_top_sql_refresh sp_embt_pa_top_sql_stop sp_embt_pa_top_sql_trace sp_embt_pa_user_drill_locks_by_db sp_embt_pa_user_drill_session_waits_b y_time sp_embt_pa_user_drill_system_waits_by

_time sp_embt_pa_user_drill_top_sessions sp_embt_pa_user_bottleneck_activities sp_embt_pa_user_bottleneck_sessions sp_embt_pa_user_drill_locks_by_locktype sp_embt_pa_user_drill_locks_detail sp_embt_pa_user_drill_session_waits_by_t ype sp_embt_pa_user_drill_system_waits_by_t otal_waits sp_embt_pa_user_drill_session_waits_d etail sp_embt_pa_user_drill_system_waits_de tail sp_embt_pa_user_ratio_login l sp_embt_pa_user_drill_top_sessions_detai sp_embt_pa_user_workload sp_embt_pa_version

SYBASE

Procedures sp_embt_pa_actsql_drill sp_embt_pa_db_backup sp_embt_pa_db_drill_cb_idx sp_embt_pa_db_drill_dbs sp_embt_pa_db_drill_obj_idx sp_embt_pa_db_drill_opt sp_embt_pa_db_engines sp_embt_pa_actsql_drill_det sp_embt_pa_db_bnecks sp_embt_pa_db_drill_cb_tbl sp_embt_pa_db_drill_engines sp_embt_pa_db_drill_obj_suspct sp_embt_pa_db_drill_overview sp_embt_pa_db_max_engines= sp_embt_pa_current_sql sp_embt_pa_db_drill_cb_filter sp_embt_pa_db_drill_cnfg sp_embt_pa_db_drill_obj_filter sp_embt_pa_db_drill_obj_tbl sp_embt_pa_db_drill_sus_filter sp_embt_pa_db_metadata

10 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WE LC O M E T O P E R F O R M AN C E A N A L Y S T > WE L C O M E T O P E R F O R M A N C E AN A L Y S T sp_embt_pa_db_obj_space sp_embt_pa_dbspace sp_embt_pa_home_storage_tot sp_embt_pa_io_bottlenecks sp_embt_pa_io_drill_device_sum sp_embt_pa_io_drill_net_eng sp_embt_pa_io_hottest_devices sp_embt_pa_io_trans_log sp_embt_pa_mem_analysis sp_embt_pa_mem_mdcache sp_embt_pa_memory_drill_dc_cfg sp_embt_pa_memory_drill_pc_act sp_embt_pa_monitor sp_embt_pa_space_db_dev_cnt sp_embt_pa_space_drill_dev_det sp_embt_pa_space_drill_tables sp_embt_pa_user_activity sp_embt_pa_user_drill_lcks_tp sp_embt_pa_user_drill_syswait sp_embt_pa_user_drill_ts_procs sp_embt_pa_user_transactions sp_embt_pa_userdet_locks sp_embt_pa_userdet_waits sp_embt_pa_db_srv_bnecks sp_embt_pa_home_act_metrics sp_embt_pa_instance_startup sp_embt_pa_io_drill_dbs sp_embt_pa_io_drill_device_typ sp_embt_pa_io_drill_net_ses sp_embt_pa_io_key_system sp_embt_pa_io_workload sp_embt_pa_mem_bottleneck sp_embt_pa_mem_workload sp_embt_pa_memory_drill_dc_eff sp_embt_pa_memory_drill_pc_det sp_embt_pa_space_bottlenecks sp_embt_pa_space_dev_analysis sp_embt_pa_space_drill_dev_sum sp_embt_pa_space_indexs_filte sp_embt_pa_user_bottlenecks sp_embt_pa_user_drill_locks sp_embt_pa_user_drill_trans sp_embt_pa_user_index_scans sp_embt_pa_user_workload sp_embt_pa_userdet_objects sp_embt_pa_version sp_embt_pa_db_workload sp_embt_pa_home_bottlenecks sp_embt_pa_io_anlysis sp_embt_pa_io_drill_device_rt sp_embt_pa_io_drill_engine sp_embt_pa_io_drill_object sp_embt_pa_io_network sp_embt_pa_mem_activity sp_embt_pa_mem_eff_ratios t sp_embt_pa_memory_drill_dc_ac sp_embt_pa_memory_drill_dc_o bj sp_embt_pa_memory_drill_pc_us e sp_embt_pa_space_db_analysis sp_embt_pa_space_drill_db_sum sp_embt_pa_space_drill_indexes sp_embt_pa_space_tables_filter sp_embt_pa_user_drill_lcks_db sp_embt_pa_user_drill_seswait sp_embt_pa_user_drill_ts sp_embt_pa_user_process sp_embt_pa_userdet_io sp_embt_pa_userdet_sql

O

PERATING

S

YSTEM

P

REREQUISITES

Performance Analyst requires prerequisites for performance monitoring Windows 2000/XP and

UNIX and Linux

. The connectivity requirements for the various servers are minimum requirements. The other requirements are optional.

W

INDOWS

2000/XP P

REREQUISITES

Connectivity

Performance Analyst requires the following minimum conductivity prerequisites:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1013

WEL C O M E T O P E R F O R M A N C E AN A L Y S T > WEL C O M E T O P E R F O R M A N C E A N AL Y S T

• Remote Registry Service should be running on the server if Performance Analyst is connecting to a remote machine. For local machine this does not matter.

• Adequate permissions to connect to the remote computer's registry.

Other Requirements

Performance Analyst requires the following optional prerequisites:

• Diskperf should be running on the server.

NOTE:

You can start diskperf by executing diskperf -y from the command line.

UNIX

AND

L

INUX

P

REREQUISITES

Connectivity

Performance Analyst requires the following minimum conductivity prerequisites:

• Ability to connect to the server and execute commands on the server using one of the following protocols:

• Telnet

• SSH

• Rlogin

• Make sure that the appropriate daemon is running on the server and that the userid used for connecting has the permission to connect using the appropriate protocol.

Commands

The table below describes the commands that the connection Userid needs to have access to, to collect performance stats. The default path for the Userid on UNIX should be setup so you can execute the commands without qualifying them with a path.

Command Type

Common Commands

Linux Commands

AIX Commands

Description

Required on all UNIX and

Linux servers.

User should be able to access data from these files

Required for AIX

Commands/Files ps, wc, cat, grep, vmstat, uname, uptime, who, df, netstat

/proc/meminfo

/proc/cpuinfo

/proc/partitions or iostat lsdev pmcycles usr/sbin/prtconf iostat lsps pagesize

10 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Command Type

Solaris Commands

HP Commands

WE LC O M E T O P E R F O R M AN C E A N A L Y S T > WE L C O M E T O P E R F O R M A N C E AN A L Y S T

Description

Required for Solaris

Required for HP

Commands/Files

/usr/sbin/psrinfo iostat

/usr/sbin/prtconf

/usr/sbin/swap pagesize

/etc/swapinfo sar permission to access the following:

/dev/mem

/dev/kmem

/var/adm/syslog/syslog.log

O

PENING

P

ERFORMANCE

A

NALYST FOR THE

F

IRST

T

IME

For Performance Analyst to work, a platform-specific package needs to be installed by the SYS account. When Performance Analyst first starts, it checks for the presence of this package and if it has not been installed, Performance Analyst prompts you to install it. Once created, any account with access to this package can monitor databases using Performance Analyst. You do not need to install any other objects on a monitored database.

NOTE:

You must have SYS privileges to install the required packages. After the packages are installed, anyone can use them.

To open the Performance Analyst for the first time, connect to a database through DBArtisan and then select Performance Analyst from the Analyst drop-down menu.

Subsequently, you can connect to Performance Analyst by going to

Start>Programs>EmbarcaderoDBArtisan>Performance Analyst.

When you open the Performance Analyst this way, you can only review one datasource at a time, as is the case when you open Performance Analyst remotely.

NOTE:

If you are connecting through your client machine, it will save you time and give you greater flexibility to connect to Performance Analyst through the DBArtisan console. If you connect through the console, you can open multiple Performance Analyst windows for as many datasources as you like and switch between them by clicking the target tab.

You can also open Performance Analyst in stand-alone mode from your Web client. To do this, see:

Opening Performance Analyst in Stand-Alone Mode from Your Web Client

O

PENING

P

ERFORMANCE

A

NALYST IN

S

TAND

-

ALONE

M

ODE FROM YOUR

W

EB

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1015

WEL C O M E T O P E R F O R M A N C E AN A L Y S T > WEL C O M E T O P E R F O R M A N C E A N AL Y S T

C

LIENT

The Embarcadero Performance Analyst Login dialog box lets you open Performance Analyst in stand-alone mode from a Web client. This way you can check the performance of any or all datasources that are registered through DBArtisan when you are working remotely.

To connect to the Performance Analyst when you are not using the DBArtisan console, simply go to

<installation directory>:\PAnalyst\PerfAnalyst.html

When you’ve made the connection, a login dialog box opens.

If you are connecting to the Performance Analyst from your Web client, you can only see one database at a time.

NOTE:

Keep in mind that when you connect to Performance Analyst remotely, the Auto

Connect option you may have selected when you registered the target datasource in

DBArtisan is not functional. You must supply a valid user ID and password to log in to

Performance Analyst successfully.

Login As: is only an option when you are logging into an Oracle database. Sybase, SQL Server and DB2 log in as default. The properties for the login roles are as follows:

• Default - Establishes a connection with no system roles.

• SYSDBA - Lets you perform all DBA-related functions. SYSDBA is required for the SYS id when you log into a 9i or later instance.

• SYSOPER - Lets you perform many DBA-related functions, like startup and shutdown.

L

ICENSING

P

ERFORMANCE

A

NALYST

Availability of this feature depends on your DBArtisan licensing. For more information, see

Licensing .

10 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

PE R F O R M A N C E A N A L Y S T A P P L IC A T I O N B AS IC S > P E R F O R M A N C E AN A L Y S T AP P L IC AT I O N B A S I C S

P

ERFORMANCE

A

NALYST

A

PPLICATION

B

ASICS

Performance Analyst displays a complete picture of a database's performance. Performance

Analyst is a quick, lightweight tool that lets you investigate performance bottlenecks.

For more information, see

Product Design .

P

ERFORMANCE

A

NALYST

P

RODUCT

D

ESIGN

The Performance Analyst product design includes Home Pages.

Home Pages for Oracle

Performance Analyst displays home pages of various performance categories with detailed performance data. The Performance Analyst product design includes the following home pages:

• Home

• Memory

• I/O

• Objects

• OS

• RAC Detail View

• Space

• Users

Home Pages for Microsoft SQL Server

Performance Analyst displays home pages of various performance categories with detailed performance data. The Performance Analyst product design includes the following home pages:

• Home

• Database

• Memory

• I/O

• Space

• Users

• OS

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1017

P E R F O R M A N C E AN A L Y S T AP P L IC AT I O N B A S I C S > P E R F O R M A N C E A N AL Y S T AP P L I C A TI O N B A S I C S

Home Pages for IBM DB2 for Linux, Unix, and Windows

Performance Analyst displays home pages of various performance categories with detailed performance data. The Performance Analyst product design includes the following home pages:

• Home

• Cfg (Database Configuration)

• I/O

• Instance

• Memory

• OS

• Space

• Users

Home Pages for Sybase ASE

Performance Analyst displays home pages of various performance categories with detailed performance data. The Performance Analyst product design includes the following home pages:

• Home

• Databases

• I/O

• Memory

• OS

• Space

• Users

P

ERFORMANCE

A

NALYST

P

RODUCT

N

AVIGATION

Navigating Performance Analyst is easily accomplished through two main mechanisms:

1 The main Performance Analyst toolbar buttons open the major performance analysis views

(the toolbar buttons you see are self-explanatory) within the product as well as frequently used actions like Refresh and Performance Threshold Customizations.

2 If you right-click any area within Performance Analyst, the application displays a shortcut menu that lets you easily move between any of the main Performance Analyst home pages and drill-down views. The shortcut menu also contains context sensitive options like drilling down further into a particular statistic, copying the display to a text file, and more.

For more information, see

Toolbar Icons

.

10 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

PE R F O R M A N C E A N A L Y S T A P P L IC A T I O N B AS IC S > P E R F O R M A N C E AN A L Y S T AP P L IC AT I O N B A S I C S

T

OOLBAR

I

CONS

Performance Analyst has several unique icons that take you directly to some functions and statistical groups that can help you see and sort through groupings of data. The functional icons you see on the Performance Analyst toolbar are as follows:

• Top Sessions - - This takes you directly to the Top Sessions tab of the Users Detail view where you see the Top I/O, Memory, CPU, and Sessions statistics.

• Top SQL - - Opens the Top SQL detail view and lets you move among the Summary,

Criteria, SQL Details, and Recent History tabs.

• Response Time (Oracle 10 g only) - - Oracle 10g collects

response time statistics , which

are displayed when you click the icon.

• Alarms -

- Goes directly to the Alarms log .

• Threshold Maintenance -

- Clicking here opens the Threshold Template Maintenance

dialog box. Thresholds are explained in the Using chapter.

• Refresh - - Click this to update the stats/information on whatever page you are currently scrutinizing.

• Options -

- To open the Performance Analyst options dialog box, where you can change

the values for Oracle, SQL Server, Sybase, or DB2 options, click this cheerful checkerboard.

• Exit - - This closes Performance Analyst for the database you are reviewing. If you have multiple Performance Analysts open, clicking this does not close all Analysts.

• Maximize Window - - This icon appears on each pane of a multi-pane window and lets you expand the pane of choice to fill the screen.

• Minimize Window - - When you have seen enough of an expanded pane, you can bring it back to its original size by clicking this icon.

• Help -

Help.

- Another in this series of intuitive icons, click this to open the context-sensitive

A

LARM

S

OUND

When you register an alarm in Performance Analyst, it creates a periodic alarm sound. To turn off the alarm sound, do the following:

1 Click Start, Programs, Accessories, Entertainment, and then Volume Control.

Windows opens the Volume Control dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1019

P E R F O R M A N C E AN A L Y S T AP P L IC AT I O N B A S I C S > P E R F O R M A N C E A N AL Y S T AP P L I C A TI O N B A S I C S

2 Under Wave, select Mute.

NOTE:

Hiding the Performance Analyst icon in the task bar does not mute the sound.

10 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U S IN G P E R FO R M AN C E A N A L Y ST > US I N G P E R F O R M A N C E AN A L Y S T

U

SING

P

ERFORMANCE

A

NALYST

Performance Analyst allows you to organize performance metrics in the particular way you want to see them. You can drill-down into the many layers of database performance and also be able to locate performance issues in your database in a fast and effective manner. You can set alarm triggers and thresholds for multiple databases across several platforms.

For example, key ratios in Performance Analyst are calculated using delta statistics, which is superior to computing ratios with cumulative values. Delta statistics, which are values derived by using the before and after measures in each statistical refresh done in Performance Analyst, lets you see changes in performance metrics that would otherwise be invisible if cumulative statistics were used. This chapter tells you how to set the refresh intervals that best suit your needs.

So, this Using chapter explains how to reveal the layers of information you want to see. The platform-specific Expert Guides explain what you are seeing as they discuss individual statistics, the associated metrics, and troubleshooting suggestions:

• Oracle Performance Analyst Statistics

• Microsoft SQL Server Performance Analyst Statistics

• IBM DB2 (W/U/L) Performance Analyst statistics

• Sybase ASE Performance Analyst Statistics

P

ERFORMANCE

A

NALYST

T

OOLS

Performance Analyst offers tools that help you configure what you can see when you survey target databases. It’s an easy thing to set up an alarm notification for individual statistic thresholds based on parameters you designate. And, when you work through DBArtisan, you can easily correct problems if you notice something is amiss.

Performance Analyst supports the following functionalities:

Alarm Log

Manage with

DBArtisan

Top Sessions

Change Graph Type Copy

Options

Response Time

(ORACLE 10g ONLY)

Top SQL

Details

Save

Explain SQL

Thresholds

A

LARM

L

OG

The Alarm Log displays every performance violation found in your currently monitored databases. Unlike some products that only show you alarms for a particular database,

Performance Analyst gives you the option to see all alarms for each database you are monitoring in one central log so you can see every problem in a single place. And, of course, you have the ability to determine alarm levels by setting the

Threshold Properties .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1021

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

To open an Alarm Log

• Open the Performance Analyst and then scroll down to Alarms on the drop-down menu.

• Move your mouse over the Performance Analyst toolbar and click the exclamation point

(you’ll see Alarms appear in a tool tip under the hand icon).

O

RGANIZING THE

A

LARM

L

OG

You can arrange the data in the Alarm Log in several ways:

NOTE:

Changes you make to one Alarm Log are not enacted globally. This allows you to customize each log based on your needs database by database if you want.

• Move columns left or right to place them in an order that makes the most sense to you. Do this by dragging-and-dropping a column heading to re-place it in the target location.

• Sort column rows up and down or sideways. Right-click a column heading and select:

• Sort Ascending: For example, you can see the alarms as they move from Critical to

Cleared.

• Sort Descending: For example, you can see the alarms as they move from Cleared to

Critical.

• Sort Multiple Columns: Lets you group multiple columns in ascending or descending order. You cannot mix and match, however. That is, you cannot sort some columns to present data in ascending order and others to present data in descending order.

• Sort Clear: Lets you clear the relationships you created if you sorted multiple columns.

The table below describes the columns of the Alarm Log:

Column

Alarm Type

Datasource

DBMS Type

Date/Time

Category

Statistic

Value

Explanation

Description

Displays alarm types: Cleared, Critical, Fair and Poor.

Datasource where the alarm was identified.

Datasource DBMS type.

Date/time of when the alarm was observed.

Displays metric category: memory, I/O, space, objects, or users.

Metric name.

Value of the statistic that caused the violation.

Displays a text explanation of the problem. These text explanations can be very generic in nature and just plug in certain threshold metrics, etc.

A

LARM

L

OG

A

CTIVITIES

From within the Alarms Window, right-clicking any row gives you more opportunities to get the most out of what you see. The Menu selections are:

10 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

• Applicable Page - Takes you to the row-specific Category page where you can see the problem metric and what’s happening with the surrounding statistics. For example, if you click a critical alarm in the Databases category, you connect immediately to the Databases home page.

• Options - Takes you to the

Alarm Log Options dialog box

where you adjust some general alarm log properties and alarm filters.

• Clear List - When you select this, the alarm log is cleared of all entries.

• Help - Opens the Help discussion for the target element.

• Refresh - Refreshes the display to show you any updates.

• Copy - Places the data in the alarm log at that point in time on the Windows clipboard. From there you can paste it into a Word or Excel document.

• Save As - Lets you name and save the Alarm Log to the location of your choice as a Microsoft

Excel worksheet. You can then manipulate the worksheet as you would any other.

• Print - Enables you to print the alarm log.

A

LARM

L

OG

O

PTIONS

D

IALOG

B

OX

The Alarm Log Options dialog box is command central for how and where you display and

manipulate previously configured alarms. Alarms themselves are configured in the Threshold

Properties

, but this is where you arrange the particulars of the Alarm Log your databases. Keep in mind that changes you make to this dialog box are reflected globally across all platforms.

The table below describes the columns of the Alarm Log Options dialog box:

Option

General Properties

Do not log alarms to the alarm log

Log alarms to the alarm log

Description

When you select this option, alarms will not be saved to an alarm log. Depending on the filters you select, you will still see alarms in the alarm window.

This option lets you save alarms to an alarm log. You can type or browse to choose a directory where you want to save the log and you can also set the maximum alarm log size in KB.

Filters

Show alarms for only current datasource

Show alarms for all currently modified datasources

When you select this option, you see only alarms for the current datasource in the alarm window. So, if you have multiple datasources open and you go from one to another, the alarm window will display only the alarms for the database you are observing at that very moment.

This option lets you see what alarms are occurring across all databases you are connected to at the moment.

Show only active alarms If you select this option, you’ll see only those alarms that are active at that moment in time. These are alarms that you decided to include as part of a threshold template.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1023

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

Option

Show only alarms where the Explanation contains the following text

Show only alarms that are of the following severity

Description

Lets you fine-tune the alarms you see depending on what you are most interested in seeing. For example, if you are particularly interested in seeing Bottleneck alarms, type

Bottlenecks. NOTE: The text search for this function is case-sensitive.

Select to display alarms that are critical, poor, fair, or cleared.

C

HANGING

G

RAPH

T

YPE

When you are looking at a statistic that is displayed in graph form, you can very easily change how that data is displayed. When you choose to switch from one type to another, the changes are limited to the specific graph and its data that you are manipulating. So, for example, the same page can display a bar graph and a pie chart.

The graph types available to you are:

• Line Graph

• Area Graph

• Pie Graph

• Bar Graph

• Horizontal Bar Graph

To change the graph type

• Right-click the target graph, and from the drop-down menu, select Change Graph Type.

C

OPY

The Copy functionality lets you copy data in a tabular grid display into the Windows clipboard.

The data can then be saved and used for later comparisons as you continue to tweak your databases’ performance.

To Copy data, do the following

1 Hover the pointer over the target section or metric, and then right-click and select Copy.

Performance Analyst copies data into the Windows clipboard.

2 Select an existing, or new, Word or Excel document where you want to Paste the data.

3 Save, or Save As, the document to the target location.

10 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

D

ETAILS

The Details functionality lets you drill-down into the target metric data. Generally you are taken to the metric’s category detail page.

To see section or metric details

• Right-click in the target section or metric and select Details from the drop-down menu.

After you are taken to your destination, right-click again to see if another level of detail is available to you.

E

XPLAIN

SQL

Performance Analyst lets you run Explain SQL Plans from the Top SQL window. If you are seeing problem metrics, you can take steps to correct the SQL statements.

Opening the Explain SQL/Explain Plan

1 Click the SQL button on the Performance Analyst toolbar to open the Top SQL details page.

2 Click the SQL Details tab.

You can also right-click anywhere and select Navigate to...>Top SQL>SQL Details from the drop-down menus.

3 Move down the list of SQL text in the grid and the SQL text appears in the Selected SQL

Text window.

4 Press the Explain SQL button to open the Explain Plan.

M

ANAGE WITH

DBA

RTISAN

Manage with DBArtisan opens the DBArtisan editor for the object that has been selected for editing in a grid/tabular display of data.

By moving directly to DBArtisan from Performance Analyst, you have an opportunity to fix database problems as soon as you see them. This option is not available, however, when you open the Performance Analyst from a Web client.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1025

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

P

ERFORMANCE

A

NALYST

O

PTIONS

D

IALOG

B

OX

The Performance Analyst Options dialog box is where you can specify various refresh intervals, threshold polling, and datasource overrides among other settings. You can set or change defaults that are both global and platform-specific.

NOTE:

The settings on the Global and Datasource tabs apply to all datasource platforms. The

SQL Server, Sybase, and DB2 tab settings are platform-specific. Some options on the platform-specific tabs may look as if they are available to you, but in reality they are not. For example, if you are connected to an Oracle datasource, changing the

Monitoring Refresh interval on the Sybase tab is a hollow gesture.

To open the Performance Analyst Options dialog box

• Open the Performance Analyst and then scroll down to Options on the drop-down menu.

• Right-click in the Performance Analyst window for the target datasource and select Options.

• Move your mouse over the Performance Analyst toolbar and click the multicolored square

(you’ll see Options appear in a tool tip under the hand icon).

The table below describes the tabs of the Performance Analyst Options dialog box:

Tab

Global

Settings

Group

Engine

Option/Description

Visual

SQL metric refresh interval - Lets you set the time, in seconds, between collect cycles for the SQL metrics reflected in Performance Analyst. SQL metrics include all nonoperating system metrics.

OS metric refresh interval - Lets you set the time, in seconds, between collect cycles for all operating system-related metrics reflected in Performance Analyst. OS metrics include all metrics shown on the OS page.

Threshold polling - Lets you determine which metrics, if any, you want to test against your pre-set thresholds. The possible settings for the Threshold polling box are:

All Metrics - Polls all metrics

Current Page Only - Polls only those metrics reflected on the currently open page in

Performance Analyst

Off - Turns polling off. If polling is turned off, Performance Analyst does not activate

Alarms.

Threshold polling interval - Lets you set the time, in seconds, between collect cycles for threshold-related metrics. Once collected, the polled metrics are compared to the preset thresholds. If you select Off in the Threshold polling box, Performance Analyst does not poll these metrics, regardless of the interval.

Run queries for all tabs - Lets you determine whether or not you want Performance

Analyst to refresh all tabs according to the SQL metric refresh interval. If Run queries for all tabs is not checked, Performance Analyst runs queries only for the current tab.

Show alarms icon in system tray - Lets you determine whether or not you want

Performance Analyst alarms to appear in the Windows System Tray on the lower righthand side of your screen. If you select Show alarms icon in system tray, Performance

Analyst places an icon in the Windows System Tray each time an alarm is raised.

Number of Historic Values in Graphs - Lets you specify the number of values in the graphs.

10 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

Tab

Datasource

SQL Server

Settings

Group

Operating

System

Overrides

Global

Options

New

Datasource

Defaults

Current

Datasource

Settings

Option/Description

OS type - Lets you select the operating system type for the current datasource. The options are:

MS Windows - Select MS Windows for all supported types of Microsoft Windows

Unix or Linux - Select Unix or Linux if you operating system is any flavor of Unix

Host name - Lets you specify the name of the host for the current datasource, if necessary. Performance Analyst automatically fills in any detectable information, including the Host name box.

Username - Lets you select a local or network username that Performance Analyst can use to connect to the datasource. If you select the Use Datasource Username and

Password check box, the Username box is unavailable.

Password - Lets you select a local or network password that Performance Analyst can use to connect to the datasource. If you select the Use Datasource Username and

Password check box, the Password box is unavailable.

Protocol - Lets you specify a protocol for communicating with datasources on Unixbased operating systems. The options are:

SSH

Telnet

Rlogin

Use Datasource Username and Password - Lets you specify whether or not you want to use the datasource username and password to connect to the datasource as opposed to a network or operating system username and password

Save Username and Password - Lets you save the username and password that appear in the Username and Password boxes.

SQL metric refresh interval - Lets you override the SQL metric refresh interval in the

Global Tab for the current datasource. The SQL metric refresh interval specifies the time, in seconds, between collect cycles for the SQL metrics reflected in Performance

Analyst. SQL metrics include all non-operating system metrics.

OS metric refresh interval - Lets you override the OS metric refresh interval in the

Global Tab for the current datasource. The OS metric refresh interval specifies the time, in seconds, between collect cycles for all operating system-related metrics reflected in

Performance Analyst. OS metrics include all metrics shown on the OS page.

SQL Profiling Enabled - Performance Analyst requires some privileges that go along with SQL Server Profiler in order to return some statistics for SQL Server databases.

Check SQL Profiling Enabled to ensure that Performance Analyst can collect all the necessary metrics.

Start SQL Profiling - Lets you set new datasources to start SQL Profiling when they are monitored by Performance Analyst.

SQL Profiling refresh interval - Lets you set the default time for new datasources, in seconds, between collect cycles for the SQL metrics that require the SQL Server

Profiler.

Start SQL Profiling - Lets you set current datasources to start SQL Profiling when they are monitored by Performance Analyst.

SQL Profiling refresh interval - Lets you set the default time for current datasources, in seconds, between collect cycles for the SQL metrics that require the SQL Server

Profiler.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1027

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

Tab

Sybase

DB2

Settings

Group

Global

Options

New

Datasource

Defaults

Current

Datasource

Defaults

Monitor

Settings

Option/Description

Monitoring Table refresh interval - Lets you specify, in seconds, the amount of time between refreshes for the Monitoring Table. The Monitoring Table is a table installed by Performance Analyst used to store various metric-related information. The default is

15 seconds.

Use noclear option in sp_sysmon - Performance Analyst sessions are started with the

‘sp_sysmon noclear’

option, ensuring that monitor values are stored in a temporary file. If monitoring is being used by another application, those results are not impacted by the Performance Analyst session zeroing out counters.

NOTE: The noclear option is available for Sybase ASE 12.5.3 and higher and 15.0.2 and higher.

These settings are only available with a Performance Analyst session active against a

Sybase datasource. The settings only apply to current sessions.

The Monitoring Table refresh interval and Use noclear option in sp_sysmon settings let you override the selections in the identically-named settings in the Global Options and

New Datasource Defaults groups.

Use custom sample query - You can use this option to build a custom sampling query and check the database response time by reviewing the Sample Query Response Time graph on the Database home page.

Monitor Switches - You are able to set monitor switches ON for the current session.

When check marks are visible, that means they were previously set as defaults. Check or uncheck the boxes as you wish. Monitor settings are available for Buffer Pool.

Statement, Lock, Table, Sort, Unit of Work.

Metrics for all checked elements are gathered in the current session.

SQL Statement Cache - You can collect SQL statements on each refresh, collect SQL statement only when you are on the Top SQL pages, or choose not to collect any SQL statements.

Database System Monitor Heap - The database system monitor heap size shows the current value, in pages, allocated for the database system monitor data. The amount of memory required for monitoring depends on the number of monitoring applications, switch settings, and the level of database activity. If you see frequent heap overflow errors in the output message window when monitoring DB2 through Performance

Analyst, adjust the setting here.

Save settings as default - Gives you the option to set the monitoring settings as a default for the current DB2 database or for the current session only.

R

ESPONSE

T

IME FOR

O

RACLE

10

G

The Response Time functionality lets you analyze response times. You can review historical data and pinpoint who was on a database and what they were doing during a specific period of time.

To see Response Time statistics

• Right-click in the target and select Navigate to...>Response Time Analysis from the dropdown menu.

• Hover your mouse over the Performance Analyst toolbar and click the magnifying glass

(you’ll see Response Time appear in a tool tip under the hand icon).

10 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

S

AVE

A

S

...

The Save As option gives you an opportunity to save data in a tabular format in the location of your choice. What this means is that the current data will be saved to an existing or a new

Microsoft Excel worksheet. You can then manipulate and compare data with all the functionality

Microsoft Excel gives you.

To Save As

• Right-click anywhere on the metric or in the Alarm Log, for example, and choose Save As... from the drop-down menu.

T

HRESHOLDS

Thresholds are the point that must be exceeded to begin producing a user-defined effect or result, or to elicit a response, such as an alarm. Performance Analyst provides default threshold templates for each database platform. The default template is applied unless you choose to apply a customized template. There are two methods to place thresholds on statistics in

Performance Analyst:

• Threshold Templates - Threshold templates are logical containers used to define and deploy thresholds to datasources. You can apply many templates at a single time and you can apply a single threshold template to many datasources. To customize a template, use the

T

hreshold Template Maintenance

dialog box. As you add or edit thresholds for a customized template, you make your changes in the

Threshold Template Properties dialog

box. And finally, when you have customized a threshold template to your satisfaction, you

Select Datasource(s)

where you want the template to be applied.

• Datasource Thresholds - Datasource Thresholds are default or user-defined values that mark performance boundaries. You can apply Datasource Thresholds to specific statistics on a datasource. To make changes to a datasource threshold, use the

Datasource Thresholds

Maintenance

dialog box. From here, the Threshold Templates dialog box gives you the

opportunity to use a previously created template to override the target datasource’s user thresholds.

Whenever you make changes to a threshold, whether through the Threshold Template functions or from the Datasource Thresholds, you are presented with the

Threshold Properties dialog box where you can specify when, and what type of alarm you want to trigger.

Additionally, you can

Copy a template.

T

HRESHOLD

P

ROPERTIES

D

IALOG

B

OX

Thresholds are the point that must be met to begin producing a user-defined effect or result, or to elicit a response, such as an alarm. The Threshold Properties dialog box lets you modify properties for any threshold.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1029

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

To open the Threshold Properties dialog box

• Choose Threshold Maintenance... from the Performance Analyst drop-down menu to open a

Threshold Template Maintenance dialog box, and then click Add or Edit.

• You can also choose Datasource Thresholds... from the Performance Analyst drop-down menu to open the Datasource Thresholds Maintenance dialog box, and then click Add or

Edit.

The table below describes the options and functionality on the Threshold Properties dialog box:

Option

Statistic

Generate Alarm If

Value amount

Severity

Description

Lets you choose the target statistic where you want to add a threshold. NOTE: If you are adding a statistic to a template or datasource threshold, use the drop-down list to find the statistic you want to add. When you select Edit for any statistic showing in the User

Thresholds window, the target statistic is displayed.

Lets you choose or change the target alarm condition. The seven options are: greater than, greater than or equal to, is equal to, is not equal to, is not equal to, less than, and less than or equal to.

Lets you set or change the numerical value for the threshold. You cannot leave the value text box blank when you first add the threshold.

Lets you select the target severity level: Fair, Poor, or Critical.

T

HRESHOLD

T

EMPLATES

D

IALOG

B

OX

Threshold Templates are logical containers used to define and deploy thresholds to datasources. Performance Analyst offers a default template for each platform. You can copy or customize and apply templates to your heart’s content. You cannot, however delete the default template.

To open the Threshold Templates dialog box

• Choose Datasource Thresholds... from the Performance Analyst drop-down menu to open the Datasource Thresholds Maintenance dialog box, and then click Change.

The Threshold Templates dialog box displays the available Threshold Templates. The table below describes the options and functionality of the Threshold Templates dialog box:

Option

Name

Description

Override Datasource’s

User Thresholds

Description

Displays the name(s) of the available platform-specific Threshold Template(s).

Displays the description(s), if any of available Threshold Template(s).

Lets you choose which thresholds to use on the target datasource - the thresholds in the

Threshold Template or the user-defined thresholds on the target datasource. If you select the check box, Performance Analyst will override any Datasource Thresholds on the target datasource with the thresholds in the Thresholds Template.

10 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

T

HRESHOLD

T

EMPLATE

P

ROPERTIES

Threshold Templates are logical containers used to define and deploy thresholds to datasources. The Threshold Template Properties dialog box is where you create a custom template or where you edit an existing one.

To open the Threshold Template Properties dialog box

• Choose Threshold Maintenance... from the Performance Analyst drop-down menu to open a

Threshold Template Maintenance dialog box, and then click Add or Edit.

The table below describes the options and functionality on the Threshold Template Properties dialog box:

Option

Name

Description

Platform

Threshold/Severity/

Condition/Template

Arrow

Add

Edit

Delete

Save

Description

Lets you name the threshold template you are creating. If you are editing a template, target template’s name appears here.

Lets you type or review the target template’s description.

Offers a drop-down list of supported platforms. The selection box displays the target template’s platform, but you can use this list to see thresholds from other platforms.

Displays each threshold contained in each template for a given platform. Here you see the severity and condition of each template as well.

Lets you select thresholds for the Threshold Template. When you click the arrow,

Performance Analyst moves selected thresholds to the Threshold Template you are creating or editing.

Use this function to add statistics to the threshold template you are creating/editing.

When you click this button, Performance Analyst opens the Threshold Properties

dialog box.

Lets you edit the selected Datasource Thresholds appearing in the Current Template

window. When you click this button, Performance Analyst opens the Threshold

Properties

dialog box.

Lets you delete the selected Datasource Thresholds. When you click this button,

Performance Analyst deletes the selected thresholds.

Saves any changes you made in this dialog box to create the new or modified template.

T

HRESHOLD

T

EMPLATE

M

AINTENANCE

D

IALOG

B

OX

Threshold Templates are logical containers used to define and deploy thresholds to datasources. The Threshold Template Maintenance dialog box lets you add or edit templates, as well as configure template maintenance options. For example, you can copy the original

Embarcadero Threshold template and modify it to fit your needs. You can control which statistics are sampled for performance violations, as well as the levels of severity to report. When you are satisfied with your Template, you can save it, and then, in one action, apply it to one or more datasources, thereby immediately enforcing your performance standards.

To open the Threshold Template Maintenance dialog box

• Choose Threshold Maintenance... from the Performance Analyst drop-down menu.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1031

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

• Hover your mouse over the red and green cylinder on the Performance Analyst toolbar and look for the Threshold Maintenance tool-tip.

The table below describes the options and functionality on the Threshold Template

Maintenance dialog box:

Option

Platform

Name

Description

Description

This is a drop-down list of the platforms. The default is the platform of the datasource you connected to most recently, but you can make another selection.

Displays the name(s) of available Threshold Template(s).

Displays the description(s) of available Threshold Template(s). For customized templates, the description is merely a repetition of the template name unless you wrote something when you created or edited the template.

Add

Edit

Lets you create Threshold Templates. When you click this button, Performance Analyst opens the

Threshold Template Properties

dialog box.

Lets you edit the selected Threshold Templates. When you click this button, Performance Analyst

opens the Threshold Template Properties dialog box.

Delete

Copy

Lets you delete the selected Threshold Templates.

Lets you create copies of the selected Threshold Template. When you click this button,

Performance Analyst opens the Copy Template dialog box.

Apply

Select/Unselect

All

Lets you select datasources to apply the selected Threshold Templates. When you click this

button, Performance Analyst opens the Select Datasource(s)

dialog box.

Lets you make global additions to your templates. NOTE: You cannot edit or delete Default templates.

D

ATASOURCE

T

HRESHOLDS

M

AINTENANCE

D

IALOG

B

OX

Datasource Thresholds are default or user-defined values that mark performance boundaries.

You can apply Datasource Thresholds to specific statistics on a datasource. You can also combine Datasource Thresholds to create a template.

Performance Analyst offers the Datasource Thresholds Maintenance dialog box to let you modify Datasource Thresholds. There are two panes in the Datasource Thresholds Maintenance dialog box:

• Applied Threshold Template

• User Thresholds

To open the Datasource Thresholds Maintenance dialog box

• Choose Datasource Thresholds... from the Performance Analyst drop-down menu.

• Right-click in any open Performance Analyst window and choose Datasource Thresholds... from the drop-down list.

10 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

The table below describes the options and functionality in the Applied Threshold Template box of the Datasource Thresholds Maintenance dialog box:

Option

Name

Description

Change

Remove

Threshold/

Severity/

Condition/

Block

Description

Displays the name of the target Threshold Template.

Displays any description of the Threshold Template.

Lets you view and edit all platform-specific Threshold Templates. When you click this button,

Performance Analyst opens the Threshold Templates

dialog box.

Removes all thresholds in the Applied Threshold Template grid.

Displays the statistic on which the threshold is placed, whether it is critical, fair, or poor, and the condition that triggers the alarm.

Override

Prevents that threshold statistic from being triggered in the template. It’s almost as if that threshold never existed in the template. You can, however, reinstate the threshold trigger by highlighting and deleting it from the User Thresholds pane.

Copies the threshold settings from the selected Threshold Template and applies the change to the user-defined Datasource Thresholds. Click this button if the template has the correct Severity and Threshold, but you want to modify the condition for triggering the alarm. When you create a

"User Threshold," you are overriding the threshold specified by applied template or you are including an additional threshold not included in the applied template. This may be useful if you have a group of individuals all monitoring the same primary statistics (and thus using the same template) but want to be able to give individual users the ability to modify/add/block a threshold used by the template, without affecting the original template.

The table below describes the options and functionality in the User Threshold box of the

Datasource Thresholds Maintenance dialog box:

Option

Threshold

Severity

Condition

Add

Edit

Delete

Description

Displays the statistic on which the threshold is placed.

Displays the severity for the threshold.

Displays the condition for the threshold.

Lets you create Datasource Thresholds. When you click this button, Performance Analyst opens the

Threshold Properties dialog box.

Lets you edit the selected Datasource Thresholds. When you click this button, Performance

Analyst opens the Threshold Properties

dialog box. If you Edit a Blocked threshold, it loses its blocked status.

Lets you delete the selected Datasource Thresholds. When you apply this to a blocked threshold, it is removed from the user thresholds.

S

ELECT

D

ATASOURCE

(

S

)

When you have created or edited a threshold template, and you are ready to distribute it, you have the opportunity to apply it to one or more target datasources using the Select Datasources dialog box.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1033

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

To open the Select Datasource(s) dialog box

• Choose Threshold Maintenance... from the Performance Analyst drop-down menu, and then click Apply.

The table below describes the options and functionality on the Select Datasources dialog box:

Option

Datasources

Override Datasource’s

User Thresholds

Description

You can apply the target threshold template to one or more datasources. You can only apply the target threshold template to the platform where it was created.

Lets you choose which thresholds to use on the target datasource - the thresholds in the

Threshold Template or the user-defined thresholds on the target datasource. If you select the check box, Performance Analyst will override any Datasource Thresholds on the target datasource with the thresholds in the Thresholds Template.

C

OPY

T

EMPLATE

The Copy Template dialog box lets you copy an existing Threshold Template, rename it, and save it for later use.

To open the Copy Template dialog box

1 Choose Threshold Maintenance... from the Performance Analyst drop-down menu, to open the Threshold Template Maintenance dialog box.

2 Select the template you want to replicate, and then click Copy.

The table below describes the options and functionality of the Copy Template dialog box:

Option

Name

Description

Functionality

Lets you type the name for the new Threshold Template. The default name is Copy of

Frankenstein, or whatever it is you named your template.

Lets you type the description of the new Threshold Template. The default description is simply a repetition of the template name.

T

OP

S

ESSIONS

The Top Sessions functionality lets you drill-down into the target metric data and quickly pinpoint the heaviest users of I/O and memory. Generally you are taken to the database-specific

Expert Guide when you need an explanation of what you are seeing.

To open Top Sessions

• Hover your mouse over the little head on the Performance Analyst toolbar and look for the

Top Sessions tool-tip.

10 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T TOO L S > P E R F O R M A N C E A N AL Y S T TOO L S

To open the Session Details View

• Double-click any entry in the Top Sessions grid of the Top Sessions view, and the Session

Details view opens.

T

OP

SQL

The Top SQL view displays all SQL running or executed in the current datasource. You can use the lists and boxes to reorder the display according to your specific needs.

To view Top SQL, do the following:

• On the Performance Analyst toolbar, click the SQL button.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1035

P E R F O R M A N C E A N A L Y S T TOO L S > P E R F O R M A N C E A N A L Y S T TOO LS

10 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

P

ERFORMANCE

A

NALYST FOR

O

RACLE

T

UTORIAL

Embarcadero Performance Analyst provides key insight into the complex world of database performance. Running inside the Embarcadero DBArtisan console, or stand-alone in a Web browser, Performance Analyst helps you pinpoint performance problems that threaten a database’s availability or response times. The powerful analysis facilities will satisfy advanced experts, yet novices will find Performance Analyst’s interface easy to use and the expert help a welcome aid to troubleshooting difficult performance issues.

About This Performance Analyst for Oracle Tutorial

This tutorial is intended to help you get started with Embarcadero Performance Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Performance Analyst. You will have learned how to accurately monitor your database using the most popular performance methodologies in use today. You will know how to drill down into the many layers of database performance and also be able to locate performance issues in your database in a fast and effective manner. Finally, you’ll understand how to fix performance problems using the integration that exists between Performance Analyst and Embarcadero DBArtisan.

This tutorial is divided into 8 sections.

Session 1: Getting Started With Performance Analyst for Oracle

Session 2: Using Ratio-based performance analysis in Performance Analyst for Oracle

Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for

Microsoft

Session 4: Using Workload Performance Analysis in Performance Analyst for Oracle

Session 5: Using SQL Performance Analysis in Performance Analyst for Oracle

Session 6: Using Operating System Performance Analysis in Performance Analyst for Sybase

Session 7: Identifying and Getting Help with Performance Problems Using Performance Analyst for Oracle

Session 8: Fixing Performance Problems Using Performance Analyst for Oracle

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

Proceed to

Session 1: Getting Started With Performance Analyst for Oracle

S

ESSION

1: G

ETTING

S

TARTED

W

ITH

P

ERFORMANCE

A

NALYST FOR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1037

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

O

RACLE

Download and Install

You can obtain the latest version of Performance Analyst by downloading the DBArtisan software from the Embarcadero Web site at http://www.embarcadero.com/downloads/ downloaddbartisan.asp

. Performance Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Performance Analyst (although Performance Analyst can also run in standalone fashion within a Microsoft Internet Explorer Web browser).

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Overview for Performance Analyst for Oracle

O

VERVIEW FOR

P

ERFORMANCE

A

NALYST FOR

O

RACLE

The graphic below illustrates all the main elements of the DBArtisan User Interface.

When DBArtisan is connected to an Oracle database, you can open Performance Analyst two ways:

1 On the toolbar, click the Performance Analyst icon.

2 On Utilities menu, select Performance Analyst.

DBArtisan opens Performance Analyst.

Proceed to Session 2: Using Ratio-based performance analysis in Performance Analyst for Oracle

S

ESSION

2: U

SING

R

ATIO

-

BASED PERFORMANCE ANALYSIS IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Ratio-based analysis has been around for many years, and used to be the only technique database administrators used when they were called on to diagnose the cause of a database slowdown. Performance ratios are very good roll-up mechanisms for busy DBAs, making possible the analysis-at-a-glance approach, however ratios must be computed correctly for them to be meaningful. Key ratios in Performance Analyst are calculated using delta statistics, which is superior to computing ratios with cumulative values. Delta statistics, which are values derived by using the before and after measures in each statistical refresh done in Performance Analyst, lets you see changes in performance metrics that would otherwise be invisible if cumulative statistics were used. Performance Analyst makes it easy to see the ratios that are computed with delta statistics vs. cumulative. A triangle symbol denotes a delta-based statistic, while square symbols represent a cumulative-based measure.

10 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

Ratio-based analysis is available for all performance categories (memory, etc.) where ratios can assist in determining the performance level of a database. For example, if you would like to see memory-specific ratios, on the Performance Analyst toolbar click Memory. Performance Analyst displays the Memory home page that showcases all important memory-related ratios.

Proceed to

Obtaining Detail Information for a Ratio Using Performance Analyst for Oracle

O

BTAINING

D

ETAIL

I

NFORMATION FOR A

R

ATIO

U

SING

P

ERFORMANCE

A

NALYST

FOR

O

RACLE

A ratio gives you a global picture for a particular performance measure. However, you often need more information regarding a statistical measure so you can make an informed decision.

Performance Analyst has easy-to-use drill down features that make obtaining detailed information for various ratios a breeze.

For example, to view more information for the Buffer Cache Hit Ratio statistic, do the following:

1 On either the Main Home page or the Memory Home page, locate the Buffer Cache Hit

Ratio statistic.

2 Position the pointer over the statistic.

The pointer changes to a hand symbol.

3 Double-click the left mouse button.

Performance Analyst opens the Buffer Cache Tab of the memory drill down view.

4 Or right-click the statistic, select Details or Navigate to… > Memory > Buffer Cache.

Performance Analyst opens the Buffer Cache Tab of the memory drill down view.

Proceed to Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for Oracle

S

ESSION

3: U

SING

B

OTTLENECK

/

WAIT

-

BASED

P

ERFORMANCE

A

NALYSIS

IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

When an Oracle database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things, or it can be an indicator that a database bottleneck exists. Bottleneck analysis is a valid method of measuring performance because it helps you track where a database and user sessions have been spending their time. If latch contention or heavy table-scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause.

NOTE:

For Performance Analyst to show wait times for Oracle wait events, the database configuration parameter TIMED_STATISTICS must be set to TRUE.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1039

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

Performance Analyst uses two broad areas of metrics to form its bottleneck analysis. The first is the Oracle wait event interface, which displays where the database and user sessions have been bottlenecked. But, when using bottleneck analysis you can not rely only on the information contained in the wait event views that Oracle provides. For example, an object may attempt to extend into another extent of space in a tablespace and yet, be denied if no such free space exists. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. For this reason, Performance Analyst also shows non-wait event based bottlenecks that represent a very real threat to a database’s availability and performance.

Performance Analyst prominently displays bottleneck analysis on every performance home page. The Main home page, displays a summary of all key bottlenecks threatening the database.

You can also see specific bottlenecks for memory, I/O, space, objects, and users by navigating to each home page and viewing the Bottleneck Analysis section for that home page. For example, to see bottlenecks that specifically relate to I/O, do the following

1 On the toolbar, click the I/O button.

2 Locate the Bottleneck Analysis section at the lower-left portion of the screen

The I/O bottleneck analysis section displays the top database and log-related Oracle wait events (ranking them by wait time and not actual wait count), along with the most active database files.

Proceed to

Obtaining Detail on System Bottlenecks Using Performance Analyst for Oracle

O

BTAINING

D

ETAIL ON

S

YSTEM

B

OTTLENECKS

U

SING

P

ERFORMANCE

A

NALYST FOR

O

RACLE

You can easily obtain more information regarding global bottlenecks that are plaguing a database by drilling down into a particular bottleneck metric. For example, if you would like to see more data regarding the current top system bottlenecks, do the following:

1 Open the Main home page.

2 Double-click the Top System Bottlenecks area.

Performance Analyst opens the System Waits view.

3 Or right-click anywhere in Performance Analyst, point to Users, and then click System Waits.

Performance Analyst opens the System Waits view.

The System Waits view displays critical details regarding all the wait events that Oracle has recorded. You can easily see what events that occurred the most often as well as the events that have accumulated the most wait time.

Proceed to

Viewing Detail for Session Bottlenecks in Performance Analyst for Oracle

V

IEWING

D

ETAIL FOR

S

ESSION

B

OTTLENECKS IN

P

ERFORMANCE

A

NALYST FOR

10 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

O

RACLE

Not only can you obtain detail information for system bottlenecks, but you can also use

Performance Analyst to get drill down information regarding session-level bottlenecks. There are several layers to session-level details you can view.

To see more information regarding session-level waits, do the following:

1 Open the Main home page.

2 Double-click the Top Session Bottlenecks area.

Performance Analyst opens the Session Waits drill down view.

3 Or right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Performance Analyst opens the Session Waits drill down view.

When you are in the Session Waits drill down view, to drill further into a session’s details, do the following:

1 In the Historical Waits or Current Waits grid, select a session that appears to be experiencing critical waits.

2 Double-click the session or right-click, and then select Details.

Performance Analyst opens a drill down view that shows key statistics for the selected session, including its current work activities, wait events, and SQL statements.

Proceed to

Session 4: Using Workload Performance Analysis in Performance Analyst for Oracle

S

ESSION

4: U

SING

W

ORKLOAD

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Key ratios give you a global perspective on database activity. Bottleneck analysis gives you insight into things that are holding up user activity and throughput. But another technique is necessary if a database professional is to really get a handle on what’s occurring inside a badly performing database.

Workload analysis involves the investigation of two critical areas of a database’s performance:

• Session resource consumption and activity

• SQL execution

Without looking at these two key performance categories, you can miss a lot of what could be responsible for perceived performance problems. When performance on a database takes a sudden nosedive, it is not uncommon to find one or two sessions that are causing the bulk of the workload. Finding these processes can be easily accomplished by viewing session metadata coupled with resource consumption and statistical execution statistics.

Proceed to

Pinpointing Top Resource Consumers in Performance Analyst for Oracle

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1041

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

P

INPOINTING

T

OP

R

ESOURCE

C

ONSUMERS IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Performance Analyst identifies top resource consumers in a couple of different ways. On the main home page, Performance Analyst highlights the top resource sessions across physical and logical I/O, memory usage, and CPU consumption.

The percentage used across all statistical categories are displayed so you can immediately pinpoint a session that is using all or most of a particular resource. The top resource sessions are also displayed on the memory, I/O, and other home pages as well with a listing for the top sessions for that category. For example, the top memory users appear on the memory home page.

Proceed to

Getting Workload Details Using Performance Analyst for Oracle

G

ETTING

W

ORKLOAD

D

ETAILS

U

SING

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Performance Analyst offers several details on top resource sessions in addition to the summaries provided on each home page. A detailed and flexible top sessions view lets you view a summary of all the major resource sessions on the database as well as every critical detail regarding each session connected to the database.

Further drill downs are available that highlights specific details regarding each session’s activities and submitted SQL. To see detailed information regarding a session identified in one of

Performance Analyst’s Workload Analysis sections, do the following:

1 In a Workload Analysis display, position the pointer over one of the processes.

2 Double-click the process or right-click, and then select Details.

If you want like to see all key workload analysis metadata for sessions, do the following:

1 On the toolbar, click the Top Sessions button.

2 Or right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Proceed to

Session 5: Using SQL Performance Analysis in Performance Analyst for Oracle

S

ESSION

5: U

SING

SQL P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

SQL-based performance analysis is really a subset of Workload Analysis. Understanding current and historical SQL execution patterns lets you to have the second set of data points necessary to properly perform workload analysis. You may find that optimizing SQL code produces some of the best performance-enhancing boosts available for a database.

Proceed to

Uncovering Resource-intensive SQL in Performance Analyst for Oracle

10 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

U

NCOVERING

R

ESOURCE

-

INTENSIVE

SQL

IN

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Performance Analyst offers plenty of insight into SQL performance and execution patterns. Each one of the home pages depicts the most costly SQL statements as determined by a variety of different metrics for that performance category (most physical, logical I/O, etc.) For example,

Performance Analyst might show that a single SQL statement is responsible for almost 60 percent of all the physical I/O on the database.

Proceed to

Getting Details on Top SQL with Performance Analyst for Oracle

G

ETTING

D

ETAILS ON

T

OP

SQL

WITH

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Getting details on identified SQL statements is easy in Performance Analyst. For example, if you would like to see further information on a SQL statement identified on the Performance Analyst

Home page, do the following:

1 In the SQL Analysis section, position the pointer over Hash Values.

2 Double-click or right-click, and then select Details.

Performance Analyst opens the Top SQL summary page that shows a breakdown of all top

SQL statements along with their execution statistics

If you would like to see the full SQL text of a SQL statement, do the following

1 In the Top SQL Details section, double-click a statement.

Performance Analyst opens the SQL Details Tab of the Top SQL view to display the entire

SQL statement and the execution metrics. While on this pane, you can also perform an

EXPLAIN of the SQL statement and examine its access path information.

NOTE:

To automatically tune a problem SQL statement if you have Embarcadero SQL Tuner installed on your workstation, do the following:

2 On the SQL Details Tab, select a problem statement, and then click the Tune SQL button.

SQL Tuner opens and you can begin a tuning session.

Proceed to

Session 6: Using Operating System Performance Analysis in Performance Analyst for

Sybase

S

ESSION

6: U

SING

O

PERATING

S

YSTEM

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

S

YBASE

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O or Memory), a slow CPU, insufficient I/O devices, and insufficient memory. Performance Analyst allows you to examine the relevant operating system metrics for Windows Platforms (NT /2000/XP/2003) as they relate to

Oracle.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1043

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

To view the operating system metrics of the machine hosting the Sybase server you are monitoring, do the following:

1 Click the OS Performance Analyst toolbar button.

OR

2 Navigate to the OS Home Page by going to OS, and then Home.

NOTE:

The first time you invoke the OS feature you will be prompted for an operating system login. Please specify the correct operating system, host name, username and password, and protocol.

The Operating System home page has been designed in a similar fashion as the datasource home page. On this page you can see the pertinent operating system metrics displayed in five quadrants broken down into the following categories:

• Resource Usage

• Memory Analysis

• Disk Analysis

• Workload Analysis

• Bottleneck Analysis

Proceed to

Getting Details on Top SQL with Performance Analyst for Oracle

O

BTAINING

D

ETAILS ON THE

O

PERATING

S

YSTEM

U

SING

P

ERFORMANCE

A

NALYST

FOR

O

RACLE

You can easily obtain more information regarding operating system problems that are degrading database performance by drilling down into a particular analysis quadrant. For example if you'd like to see more information regarding the processes running on the host machine, do the following:

1 Navigate to the Performance Analyst Operating System home page.

2 Double-click the Top Memory Process in the Workload Analysis quadrant.

Performance Analyst opens the Processes detail view.

OR

3 Right-click anywhere in Performance Analyst and select the Navigate to, OS, and then

Processes.

The Processes detail tab shows all the processes on the host machine. From this view you can easily determine which processes are showing high marks in I/O or CPU, for example, by simply double clicking on the column headers and sorting the processes in ascending or descending order.

Proceed to

Session 7: Identifying and Getting Help with Performance Problems Using

Performance Analyst for Oracle

10 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

S

ESSION

7: I

DENTIFYING AND

G

ETTING

H

ELP WITH

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST FOR

O

RACLE

You do not need to be an advanced expert in performance tuning to spot trouble in a database if you use Performance Analyst. There are a number of mechanisms in the tool that help you quickly locate areas of concern within a database.

Proceed to

Using the Alarm Log

U

SING THE

A

LARM

L

OG

Performance Analyst has a central and flexible alarm log that lists every performance violation found in all monitored databases. Unlike some products that only show you alarms for a particular database, Performance Analyst lists all alarms for each database you are monitoring in one central log so you can see every problem in one place. To view the Performance Analyst

Alarm log, do the following:

1 On the toolbar, click the Alarms button.

Once in the Alarm log, you can perform a number of actions including:

• Selecting an alarm and viewing the application page that shows details regarding the metric in violation.

• Filtering the types of alarms shown through the Options dialog.

• Clearing all current alarms.

• Copying or saving the Alarm log into a different format.

To select any of these options, do the following:

1 Position the pointer over any area of the Alarm Log.

2 In the shortcut menu, select an option.

Proceed to

Recognizing Performance Violations

R

ECOGNIZING

P

ERFORMANCE

V

IOLATIONS

Performance Analyst makes it easy to visually pinpoint performance violations in a database. Any statistic that does not conform to your predefined performance standards is colorized in any view that it appears so you can easily see potential troubleshoots.

The colors used to highlight a particular performance violation depend on the severity of the problem. Performance Analyst uses several layers of performance standards/threshold violations with each layer being represented by a different color. You can control everything regarding threshold violations, including how thresholds are determined, their color representation in

Performance Analyst’s display, and more by using the Threshold Template feature of

Performance Analyst.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1045

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

How can Performance Analyst inform you of performance violations in your database if you minimize the product to your desktop and are working on other things? Even if Performance

Analyst isn’t right in front of you, it can still let you know that a problem has been found in your database through the sister alarm icon. When Performance Analyst detects a problem in one of your databases, one of the things the product does is enable an alarm icon in your workstation’s systray area that communicates the presence of alarms in your database. So even if the

Performance Analyst interface isn’t in sight, the product can let you know that something in your database requires attention.

Proceed to

Creating Threshold Templates

C

REATING

T

HRESHOLD

T

EMPLATES

How does Performance Analyst know what to signal as a problem in a database? It uses predefined performance standards that you define and enforce. All of this is accomplished by using Performance Analyst’s Threshold templates. A template is a set of performance metrics and their thresholds that can be reused to enforce performance standards across any number of databases. Embarcadero provides a default performance template that contains nearly all of the most-watched performance statistics so you can begin monitoring with confidence right out of the box. However, you can create your own Threshold templates so you only are alerted to performance violations that are important to you and your particular environment.

To view or create Threshold templates, do the following:

1 On the toolbar, click the Thresholds button.

Performance Analyst opens the Threshold maintenance dialog box.

The Threshold Template Properties dialog box lets you select the options to add or edit templates, as well as other maintenance options. For example, you can copy the original

Embarcadero Threshold template and modify it to fit your own needs. You can control what statistics are sampled for performance violations as well as the levels of severity you would like reported. Once you are satisfied with your template, you can save it and then apply it to one or more datasources in one action to immediately begin enforcing your performance standards.

Proceed to

Getting Help with Performance Problems

G

ETTING

H

ELP WITH

P

ERFORMANCE

P

ROBLEMS

As databases become more complex, so do the problems that plague them. Knowing what to do for a particular performance problem can be hard in some cases, but Performance Analyst helps by providing a complete set of expert help that you can use as a guide when performance problems occur. To obtain expert help for any statistic shown in Performance Analyst, do the following:

1 Position the pointer over a statistic that you need help.

2 Right-click and select Help.

10 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N AL Y S T F O R O R A C L E TU T O RI A L > P E R F O R M AN C E A N A L Y S T F O R O R AC L E TU TO RIA L

The Expert Help gives you a general description of the statistic, the range of values that are considered optimal, and some suggestions on how to fix a problem situation. Expert help can also be invoked for any of the Ratio, Bottleneck, SQL, or Workload Analysis sections shown on every home page by clicking on the help icon for that section, which is located at the top right corner of the section.

Proceed to

Session 8: Fixing Performance Problems Using Performance Analyst for Oracle

S

ESSION

8: F

IXING

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST FOR

O

RACLE

Finding performance problems is one thing, but fixing them is another. Many performance monitors point out a particular problem in a database, but then offer no way to actually correct the situation. Such is not the case with Performance Analyst. Because of its tight integration with

DBArtisan, certain problems found in Performance Analyst can be visually corrected by

DBArtisan.

If an Oracle tablespace is about to run out of free space, Performance Analyst can issue an alarm that a space shortage exists. Once the space problem has been identified, do the following:

1 On the Space home page toolbar, click the Space button.

2 In the Space Analyst grid, right-click a tablespace, and then select Manage with DBArtisan.

DBArtisan opens an editor where you can perform corrective actions, such as enabling

Autoextend for the tablespace, resizing the tablespace’s existing datafile(s), or adding a new datafile for the tablespace.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1047

P E R F O R M A N C E AN A L Y S T F O R O R A C L E TU T O RI AL > P E R F O R MA N C E A N A L YS T F O R O R AC L E TUT O RIA L

10 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

O

RACLE

P

ERFORMANCE

A

NALYST

S

TATISTICS

This section includes expert help for all Oracle categories and statistics in Performance Analyst views. For detailed information on using the application, see

Using Performance Analyst . This

guide includes the following sections:

Home

Objects

Response Time Analysis View (Oracle 10G

Only)

Users

I/O

OS

Session Details

Top SQL

Memory

RAC Detail View

Space

H

OME

The Home view lets you review availability and overall performance of all monitored databases from a single window. The Home page includes the following sections:

Bottleneck Analysis Pane

Storage Analysis Pane

Key Ratio Analysis Pane

Workload Analysis Pane

SQL Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database: Ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as roll-up mechanisms for at-a-glance performance analysis. Succinctly presented performance ratios can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to which rules to follow, there are some standards to adhere to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios a you examine come from the v$sysstat performance view. The performance view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and impacts how a particular ratio is interpreted.

However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

While there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual

‘personality’ with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1049

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

The following ratios are used on the Performance Analyst Home page to succinctly communicate the general overall performance levels of the monitored database:

Buffer Cache Hit Ratio

Memory Sort Ratio

Rollback Contention Ratio

Free Shared Pool Percent

Library Cache Hit Ratio

Parse/Execute Ratio

Latch Miss Ratio

Dictionary Cache Hit Ratio

Buffer Busy Waits

Parallel Query Busy Ratio

B

UFFER

C

ACHE

H

IT

R

ATIO

Data read from memory will produce end-user response times many times faster than when that same data is read from disk. Keeping physical I/O's to an absolute minimum is one of the purposes of the Oracle buffer/data cache.

The buffer cache hit ratio is a terrific indicator of how often user requests for data are satisfied through memory vs. being physically read from disk. A number of key counters in Oracle are used to arrive at this statistic. The table below lists them:

Counter

DB BLOCK GETS

CONSISTENT GETS

PHYSICAL READS

DIRECT READS

Description

Data read from memory for DML operations.

Data read from rollback segments in memory.

Data read physically from disk.

Data read physically from disk that bypasses the buffer cache. Direct reads are filtered out of overall physical reads so an accurate cache hit ratio can be determined.

Dividing the data read from memory by data read from disk yields the cache hit ratio.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

To help ensure excellent performance, you want to keep your cache hit ratio in the neighborhood of

90% or higher. However, you should be aware that every database has its own ‘personality’ and may exhibit excellent performance with below average readings for the cache hit ratio. You should also be aware that excessive logical I/O activity can produce a very high cache hit ratio while actually degrading overall database performance.

Consistently viewed low readings (60% or less) may require tuning attention on the part of the DBA.

Note: For Oracle8i or earlier, the adjustment of the db_block_buffers tuning parameter is required.

For Oracle9i and later, the db_cache_size parameter is the parameter that needs attention.

For any increases in db_block_buffers to take effect on Oracle8i or earlier, the database must be cycled. The db_cache_size parameter in Oracle9i and later, however, is dynamic and may be altered without stopping and starting the database instance.

10 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If a problem is found in Oracle8i or earlier, then:

Edit the Init.ora file for the database.

Increase the amount of db_block_buffers to a higher value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

If a problem is found in Oracle9i or later, then:

Increase the size of the db_cache_size parameter through use of the ALTER SYSTEM SET db_cache_size command value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle will reuse them each time the database is stopped and re-started.

L

IBRARY

C

ACHE

H

IT

R

ATIO

Oracle's shared pool is made up of two main memory areas - the Library Cache and the Data

Dictionary Cache, and offers a number of tuning possibilities.

The library cache holds commonly used SQL statements - basically database code objects. A method for improving performance in Oracle is to encourage the reuse of SQL statements so expensive parse operations may be avoided. The library cache assists this tuning effort.

The library cache hit ratio offers a key indicator in determining the performance of the shared pool. It shows how often SQL code is being reused by other database users vs. the number of times a SQL statement is broken down, parsed, and then loaded (or reloaded) into the shared pool.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

A high library cache hit ratio is a desirable thing. You should strive for a hit ratio between 95-100%, with 99% being a good performance benchmark for code reuse. Note that when a database is first started, the library cache hit ratio will not be at an optimal level because all code being used will be relatively new, and as such, must be parsed and placed into the shared pool. If, however, after a solid hour or two of steady database time, the library cache hit ratio has not increased to desirable levels, you should look into the possibility of increasing the shared_pool_size parameter.

Other red flags that can indicate a too small shared pool include:

A wait count for the event 'latch free' of ten or greater

The library cache wait count of two or greater.

These indicators can be tracked with Performance Analyst’s Bottleneck and Wait detail views.

A way of improving the library cache hit ratio is by encouraging code reuse through the implementation of bind variables. Discouraging hard coded literals in application code and instead making use of variables bound at run time aids in the reuse of SQL code that is maintained in Oracle's shared pool. Note that bind variables can have an affect on the cost-based optimizer though.

A second way is to pin frequently used code objects in memory so they will always be there when needed. This can be accomplished through the use of the system supplied DBMS_SHARED_POOL package. You can use Performance Analyst to view objects in the shared pool that are always present and/or have increasing reload numbers to help identify objects that are good candidates for pinning.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1051

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction If a problem is found in Oracle8i or earlier, then:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

If a problem is found in Oracle9i or later, then:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle will reuse them each time the database is stopped and re-started.

If you determine that SQL literals are causing SQL to not be reused, you can (in Oracle 8.1.6 and later):

Change the cursor_sharing parameter to FORCE by using the ALTER SYSTEM SET cursor_sharing=FORCE command.

Monitor database to see if parse activity is reduced and library cache reloads shrink.

If using an SPFILE, save the new configuration values so Oracle will reuse them each time the database is stopped and re-started. If using an Init.ora file, add the cursor_sharing=FORCE parameter to the file.

D

ICTIONARY

C

ACHE

H

IT

R

ATIO

Oracle's shared pool offers an number of tuning possibilities and is made up of two main memory areas:

1 Library Cache

2 Data Dictionary Cache

The dictionary cache hit ratio offers another key indicator in determining the performance of the shared pool. It shows how often object definitions are found in memory vs. having to read them in from disk. Because Oracle references the data dictionary many times when an SQL statement is processed, it is imperative that as much of this vital reference information be kept in RAM as possible.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

Just as with the library cache, a high data dictionary cache hit ratio is desirable. Strive for a hit ratio between 90-100%, with 95% being a good performance benchmark.

NOTE: When a database is first started, the data dictionary cache hit ratio is not at an optimal level because all references to object definitions are relatively new, and as such, must be placed into the shared pool. Look for hit ratios in the eighty's for new database startups. If, however, after a solid hour or two of steady database time, the data dictionary cache hit ratio has not increased to desirable levels, increase the shared_pool_size parameter.

Databases supporting applications that involve large number of objects (such as an Oracle Financials installation) should have larger than normal shared pools to support the required object definitions.

Although each parameter is not individually tunable (it was in Oracle6), you can see which area of the dictionary cache could be pulling the overall hit ratio down.

10 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If a problem is found in Oracle8i or earlier, do the following:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

If a problem is found in Oracle9i or later, do the following:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

M

EMORY

S

ORT

R

ATIO

Oracle's SGA is not the only memory structure used by Oracle for database work. One of the other memory areas used by Oracle8i and earlier for normal activity is an area set aside for sort actions. When a sort operation occurs, Oracle attempts to perform the sort in a memory space that exists at the operating system level. If the sort is too large to be contained within this space, it continues the sort on disk - specifically, in the user's assigned TEMPORARY TABLESPACE.

Oracle records the overall number of sorts that are satisfied in memory as well as those that end up being finalized on disk. Using these numbers, you can calculate the percentage of memory sorts vs. disk sorts and get a feel for how fast your sort activity is being resolved. Obviously, memory sorts completes many times faster than sorts forced to use physical I/O to accomplish the task at hand.

Oracle9i or later has the option of running automatic PGA memory management. Oracle has introduced an Oracle parameter called pga_aggregate_target. When this parameter is set and you are using dedicated Oracle connections, Oracle ignores all of the PGA parameters in the

Oracle file, including sort_area_size, hash_area_size and sort_area_retained_size. Oracle recommends that the value of pga_aggregate_target be set to the amount of remaining memory (less a 10% overhead for other server tasks) on a server after the instance has been started.

Location

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

Oracle Performance Analyst Statistics >

Users > Home > Key User Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1053

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics If the memory sort ratio falls below 90%, and you are on Oracle8i or earlier, increase the parameters devoted to memory sorts - sort_area_size and sort_area_retained_size.

For Oracle9i or later, investigate the use of pga_aggregate_target. Once the pga_aggregate_target has been set, Oracle automatically manages PGA memory allocation, based on the individual needs of each Oracle connection. Oracle9i or later allows the pga_aggregate_target parameter to be modified at the instance level with the alter system command, thereby lets you dynamically adjust the total RAM region available to Oracle9i.

Oracle9i also introduced a new parameter called workarea_size_policy. When this parameter is set to automatic, all Oracle connections benefits from the shared PGA memory. When workarea_size_policy is set to manual, connections allocates memory according to the values for the sort_area_size parameter. Under the automatic mode, Oracle tries to maximize the number of work areas that are using optimal memory and uses one-pass memory for the others.

Correction If you find a problem, do the following:

Edit the Init.ora or SPFILE file for the database.

Increase the amount of sort_area_size to a higher value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value. EVERY user receives this amount for sorting.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

In addition to increasing the amount of memory devoted to sorting, find inefficient SQL that cause needless sorts. For example, UNION ALL does not cause a sort whereas UNION does in an SQL query

(to eliminate duplicate rows). DISTINCT is frequently misapplied to SQL statements and causes unnecessary sort actions.

There are times you simply cannot stop sort activity. This being the case, try to keep it in memory whenever possible. However, large data warehousing systems oftentimes simply exhaust RAM sort allotments, so if disk sorts must occur, try to ensure three things:

Your user's TEMPORARY TABLESPACE assignment is not the SYSTEM tablespace, which is the default assignment.

NOTE: For Oracle9i or later, you can specify a default tablespace other than SYSTEM for every user

account that is created.

The TEMPORARY TABLESPACE assigned to your users is placed on a fast disk.

The TEMPORARY TABLESPACE has the tablespace parameter TEMPORARY assigned to it, which allows sort activity to be performed in a more efficient manner.

P

ARSE

/E

XECUTE

R

ATIO

Each time a new SQL statement is submitted to Oracle, the kernel must ‘parse’ the statement, which involves syntax checks, security checks, and object validations. The Parse/Execute Ratio shows the percentage of SQL executed that did not incur a hard parse.

NOTE:

This statistic is available on the Home page, Memory home page, and the Users home page.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

Oracle Performance Analyst Statistics >

Users > Key User Analysis Pane

Seeing low values might indicate that users are firing SQL with many hard-coded literals instead of using bind variables within an application. High values (90% and greater) generally indicate Oracle is saving precious CPU by avoiding heavy parse tasks.

10 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction The best way to reduce unnecessary parse activity is to encourage SQL statement reuse. This can be done by promoting SQL execution through the use of stored procedures or applications where bind variables can be used. Oftentimes, literals in otherwise identical SQL statements can cause unneeded parse work for Oracle. The use of bind variables can counter that problem.

If you determine that SQL literals are causing SQL to not be reused, do the following (in Oracle 8.1.6 and later):

Change the cursor_sharing parameter to FORCE by using the ALTER SYSTEM SET cursor_sharing=FORCE command.

Monitor database to see if parse activity is reduced and library cache reloads shrink.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started. If using an Init.ora file, add the cursor_sharing=FORCE parameter to the file.

B

UFFER

B

USY

W

AITS

Buffer busy waits occur when a process needs to access a data block in the buffer cache, but cannot because it is being used by another process. A wait event generally happens because a buffer is being read into the buffer cache by another process or the buffer is in the buffer cache, but cannot be switched to a compatible mode immediately.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

Buffer busy waits normally center around contention for rollback segments, too small an INITRANS setting for tables, or insufficient free lists for tables.

Correction On Oracle8i or earlier, the remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

For Oracle9i or later, you can use the automatic segment management feature in Oracle9i locallymanaged tablespaces to help make free list problems a thing of the past. Using an UNDO tablespace in 9i or later can help remedy any rollback contention problem.

You can also obtain which objects have actually experienced buffer busy waits in Oracle9i or later by querying the sys.v_$segment_statistics. This view is not populated unless the configuration parameter statistics_level is set to TYPICAL or ALL.

R

OLLBACK

C

ONTENTION

R

ATIO

Rollback segments are used by Oracle to hold data needed to rollback any changes made through inserts, updates, or deletes to various Oracle objects. They also allow Oracle to have read consistency for long running queries, are used for recovery purposes, and play a role during exports of database information. In a heavy transaction processing environment, rollback segments are accessed continuously and therefore are subject to contention problems. The

Rollback Contention Ratio helps identify contention occurring on the system relating to rollbacks.

Location

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Objects > Home > Key Ratio Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1055

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics Overall, if the rollback contention ratio approaches 1% or more, create more rollback segments. Also consider creating a specialized, larger, rollback segment to be used by long running transactions.

Doing so alleviates dynamic rollback extensions and cuts down heavily on ORA-01555 Snapshot Too

Old errors.

Correction Begin by creating new rollback segments and altering them to be online for use. Then monitor the overall contention ratio to see if it begins to drop.

If you are using Oracle9i or later, consider using an UNDO tablespace and allowing Oracle to automatically control rollback segment management.

L

ATCH

M

ISS

R

ATIO

Protecting the many memory structures in Oracle's SGA are latches. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism - so either you get it or you do not and are forced to continually retry.

The latch miss ratio defines the number of times a process obtained a willing-to-wait latch vs. missing the attempt.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

If the latch miss ratio exceeds 1%, you should take action to resolve the amount of latch contention.

Correction

Examine the details regarding the latch contention. Increasing the shared_pool_size can assist in latch problems also. The table below describes latches:

Latch Description

Cache buffer chain latch Protects paths to database block buffers in the buffer cache. High I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers or db_cache_size parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

Library cache latches Protects cached SQL statements in the library cache area of the Oracle shared pool.

Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and later.

10 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

ARALLEL

Q

UERY

B

USY

R

ATIO

Oracle's parallel query feature, when used properly, allows for terrific increases in performance for many SQL and utility operations. Parallel operations can be introduced through SQL hints, specified in an object's DDL, or used in command line arguments for utility programs (like

SQL*Loader). To effectively service parallel query requests, ensure that enough query servers exist in the database instance. The Parallel Query Busy Ratio is an indicator of how busy all the servers are on the database in question.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

If the Parallel Query Busy Ratio approaches 80-90%, add more query servers to the database, or examining parallel requests to ensure they are being used in an efficient and necessary manner.

Correction To fix, do the following:

Edit the Init.ora file or SPFILE for the database.

Increase the amount of parallel_max_servers to a higher value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

You can also investigate the use of the parallel_automatic_tuning parameter in Oracle 8.1 and later.

F

REE

S

HARED

P

OOL

P

ERCENT

Oracle's shared pool need not use all of the memory given to it through the shared_pool_size parameter. If the database does not have many object and code definitions to reference, then the shared pool can contain an abundance of free memory that is not being used.

Location

Metrics

Oracle Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Oracle Performance Analyst Statistics >

Memory > Key Ratio Analysis pane

Under-allocating the shared pool size can have a serious impact on your database's performance, but over-allocating the shared pool can have run time ramifications as well. If you have a good chunk of memory allocated to the Oracle shared pool that is never used, it might be more of a performance enhancement to reduce the shared pool amount and instead give the memory to the buffer/data cache, or even back to the operating system itself. In terms of knowing when to reduce the shared pool, a good benchmark is continually seeing 2-3MB of free memory.

On the other hand, if after an hour or so of beginning database operation, you see that virtually no free memory is left in the shared pool, or you are seeing ORA-4031 errors (that indicate definitions cannot find enough contiguous free space in the shared pool), increase the pool by 10% or more.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1057

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction If you continuously see little or no free memory in the shared pool, do the following:

For Oracle8i or earlier:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

For Oracle9i or later:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

You can also use the ALTER SYSTEM FLUSHED SHARED_POOL command to remove all objects from the shared pool and start with a clean slate.

B

OTTLENECK

A

NALYSIS

P

ANE

When an Oracle database is unning, every connected process is either busy doing work or waiting to perform work. A process that is waiting can mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs used this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps you track where a database has been spending its time. If latch contention or heavy table scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, you can determine which sessions and objects are causing the problem.

For wait event analysis to be properly carried out, it is imperative that the timed_statistics initialization parameter be set to TRUE. By default this parameter is set to FALSE, which disallows the collection of wait times for each wait event defined to the Oracle engine. For one to really understand the impact of wait events on database performance, you need to discover what the database is or has been waiting on, and the durations of the waits. Having both allows a complete picture to be formed regarding the magnitude of wait-initiated performance degradations. Almost all Oracle experts now agree that allowing the collection of timing statistics adds little if anything to database overhead, so setting timed_statistics to TRUE should not be a worry. The Performance Analyst Home page identifies the top system and session waits that can decrease performance.

When using bottleneck analysis, you cannot rely only on the information contained in the wait event views that Oracle provides. For example, an object can attempt to extend into another extent of space in a tablespace and yet be denied if no such free space exists. Such a failure is not reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that you cannot depend on only a few ratios to properly carry out ratio-based

10 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance

Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Home page displays space-related bottlenecks as well as other sources of contention/bottlenecks that can decrease the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Top System Bottlenecks

Problem Objects

Free List Waits

Top Session Bottlenecks

Current Object Blocks

Storage Analysis Pane

Problem Tablespaces

Enqueue Waits

T

OP

S

YSTEM

B

OTTLENECKS

When viewing wait statistics, there are many levels of detail that you can view. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system. Viewing these numbers can help you determine which wait events caused the most commotion in a database so far. The Top System Bottlenecks section identifies the top waits that have occurred on the Oracle database based on the number of waits per event.

For Oracle 10g only you see a graph that provides a historical look at the last hour and allows you to see what wait classes experienced the most wait activity in terms of time waited. To get detail into which wait events have accumulated the most time, you can drill down into the

System Waits view.

Location

Oracle Performance Analyst Statistics > Home >

Bottleneck Analysis Pane

Correction Appendix A in the Oracle Reference manual contains a listing and description of every current wait event defined in Oracle. DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics. For example, a ‘db file scattered read’ event is typically indicative of table scan operations. If you see many of these events, then you can begin to see if large table scans are occurring in the database. Like the ‘db file scattered read’ event, each wait event has its own meaning and individual end-resolution diagnosis.

After looking at system-level wait activity, you can discover which current connections are responsible for waits at the system level. Performance Analyst reports on historical and current wait events at the session level, making this investigation easy to accomplish

T

OP

S

ESSION

B

OTTLENECKS

When viewing wait statistics, there are many levels of detail that you can view. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system. The second level is a historical look at waits from a session level. The third is which sessions are currently experiencing waits. The Top Session Bottlenecks section identifies the top sessions that are currently waiting, based on their wait time in seconds.

Location

Oracle Performance Analyst Statistics > Home >

Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1059

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction Oracle documentation contains a listing and description of every current wait event defined in Oracle.

DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics.

The most common wait viewed at the session level is an ‘enqueue’ wait, which typically identifies lock contention. If enqueue waits are observed, then you can check the “Current Object Blocks” count on the Performance Analyst Home page, as well as the

Users

which displays locks and blocking locks detail.

As with an enqueue event, each wait event has its own meaning and individual end-resolution diagnosis.

P

ROBLEM

T

ABLESPACES

The Problem Tablespaces metric is a count of all tablespaces in the database whose free space percentage amount has fallen below a user-defined limit.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Bottleneck Analysis Pane

A rule of thumb for dynamic tablespaces (those with growing objects) is to keep a minimum of 10-15% free space available for object growth.

Correction There are two ways to prevent a tablespace from running out of available free space:

Turn AUTOEXTEND on for the underlying tablespace's datafiles. This allows them to automatically grow when free space in the datafile has been exhausted.

Using the ALTER TABLESPACE … ADD DATAFILE… command, you can manually add a new datafile to a tablespace that is about to run out of available free space.

P

ROBLEM

O

BJECTS

The Problem Objects statistic is a count of all objects in the database that are in danger of reaching their maximum extent limit or cannot allocate their next extent of free space because of a lack of overall or contiguous free space in their parent tablespace.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Bottleneck Analysis Pane

Modify any object approaching their maximum extent limit or unable to allocate a new extent of space so they can continue to grow in size.

Correction Depending on the situation, there are a number of things you can do to prevent object extent problems:

Turn AUTOEXTEND on for the underlying parent tablespace's datafiles. This allows a tablespace to automatically grow when free space in the datafile has been exhausted, and allows an object to extend even when little or no current free space is available.

Using the ALTER TABLESPACE … ADD DATAFILE… command, you can manually add a new datafile to a tablespace that is about to run out of available free space.

You can alter an object that is at or near their maximum extent limit so that the object has unlimited extents.

With Oracle 8.1.5 and later, you can use locally-managed tablespaces to ensure that no object ever reaches its maximum extent limit, because all objects are allowed unlimited extents.

An object can be reorganized into another tablespace or reorganized in general to reduce the number of extents the object currently takes up.

10 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

URRENT

O

BJECT

B

LOCKS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Although Oracle supports unlimited row-level locking, blocking lock situations do crop up. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

NOTE:

This statistic is also called Sessions Blocked on the Users and Session Blocks on the

Objects Home

page.

Location

Oracle Performance Analyst Statistics > Home >

Bottleneck Analysis Pane

Metrics Investigate any indicator above zero immediately before the situation has a chance to mushroom.

Correction Once discovered, a blocking lock situation can normally be quickly remedied. You can issue a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Other user processes then nearly almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the

blocking lock situation in the first place is where it gets tricky. You can look at the Users detail and view

all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. Most DBAs who have had to face

Oracle Forms applications have suffered through the dreaded SELECT … FOR UPDATE statements that place unnecessary restrictive locks on nearly every read operation, and know all too well that good coding practice is important. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

E

NQUEUE

W

AITS

An enqueue is an advanced locking device that allows multiple database processes to share certain resources. Enqueue waits typically occur when sessions wait to be granted a requested lock. Sometimes these locks are internal Oracle locks while other times they could be locks for rows of data. Enqueues are issued implicitly by Oracle.

Location

Oracle Performance Analyst Statistics > Home >

Top Session Bottlenecks

Oracle Performance Analyst Statistics >

Objects >

Bottleneck Analysis Pane

Metrics Investigate any enqueue waits that read consistently above one or more (delta statistics).

Correction Removing contention for enqueues is almost always an application design issue. If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. Examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations.

Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1061

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

F

REE

L

IST

W

AITS

Free lists are lists of Oracle data blocks that contain free space for an Oracle object. Every table has at least one free list. Free lists are used to locate free blocks of space when a request is made of a table for the insertion of a row. Free list contention can reduce the performance of applications when many processes are involved in the insertion of data to the same table.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Top Session Bottlenecks

Oracle Performance Analyst Statistics >

Objects >

Bottleneck Analysis Pane

If consistent numbers for free list waits continues to appear, add additional free lists to the most dynamic database objects through the use of the STORAGE parameter. Another indicator of insufficient free lists are consistent, non-zero numbers for the buffer busy wait event.

Correction If free list waits are observed, add more free lists to tables and indexes with high insert rates. For

Oracle9i or later, objects can be created inside of locally-managed tablespaces that use the automatic segment management feature, which entirely does away with free lists.

S

TORAGE

A

NALYSIS

P

ANE

While DBAs focus on memory settings and tuning SQL, storage problems can play a major role in wrecking an otherwise well-running database.

Storage problems generally take one of two forms:

1 Hit-the-wall, which can bring things to a complete standstill.

2 Performance vampire, which slowly drains the performance of a database over time.

Storage problems have the capability to bring the curtain down on a database very quickly, as in the case of an archive log destination running out of free space. But storage problems can also silently work behind the scenes to slowly but surely rob a database of its performance. For example, you can access a hub table in a busy database when an application is first given life, but over time, if it develops a heavy migrated row problem, it can cause things to run very differently.

The Storage Analysis section of the Performance Analyst Home page reports on the total used and free space of all tablespaces in the database as well as whether the database is running in

Archive Log mode. For more detailed information on database space, use the Performance

Analyst Space

.

T

OTAL

U

SED

S

PACE

/T

OTAL

F

REE

S

PACE

These statistics represent the total used and free space available in all tablespaces/datafiles in the database. Although good to know, a more detailed listing by tablespace is needed to determine where any actual space shortages exist in the database.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Storage Analysis Pane

If any one tablespace begins to approach 90% used (and the objects contained within it are dynamic and growing as opposed to static), take action to prevent any future space allocation errors.

10 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction Here are a some things you can do to prevent a tablespace from running out of available free space:

Turn AUTOEXTEND on for the underlying tablespace's datafiles. This allows them to automatically grow when free space in the datafile has been exhausted.

Using the ALTER TABLESPACE … ADD DATAFILE… command, you can manually add a new datafile to a tablespace that is about to run out of available free space.

A

RCHIVE

L

OG

Oracle can be placed into archivelog mode, which tells the database to make copies of the online redo log files for point-in-time recovery purposes. The Archive Log statistic displays whether the database is running in archivelog mode or not. This information is displayed in the

Storage Analysis section of the Performance Analyst Home page. For more information, see

Storage Analysis Pane

.

Location

Oracle Performance Analyst Statistics > Home >

Storage Analysis Pane

SQL A

NALYSIS

P

ANE

Much of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times. SQL statements that use much memory can also cause a problem in a database.

Before you can identify problem SQL in your database, you have to ask the question, “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional's satisfaction. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall Response

(Elapsed) Time

CPU Time

Physical I/O

Logical I/O

Description

The amount of time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server. This statistic is available in Oracle9i or later.

The amount of CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user's request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements' logical I/O as well. the number of memory reads the query took to satisfy the user's request. The goal of tuning I/

O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1063

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Criteria

Repetition

Description

The number of times the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute can still cause a headache on your system if it is executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over again.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above. Fortunately, Oracle records all the above measures (some only in 9i), which makes tracking the SQL that has been submitted against an Oracle database much easier.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you want answered:

1 What HAS been the worst SQL that has historically run in my database?

2 What IS the worst SQL that is running right now in my database?

When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It can be that the query is in an inefficient PL/SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can go further into Performance Analyst's Top SQL view and, if you have Embarcadero SQL Tuner installed, you can port the SQL over to SQL Tuner to better optimize the statement.

W

ORKLOAD

A

NALYSIS

P

ANE

When your database experiences performance slowdowns, you should answer the following:

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Home page provides insight into the leading resource hogs of a database as well as a count of total active and inactive processes. You can view detailed information into what each leading session is currently involved with.

The Workload Analysis section of the Home page includes:

Top Processes Active User Processes Inactive User Processes

10 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The buffer cache hit ratio is an indicator of how often user requests for data are satisfied through memory vs. being physically read from disk. Data read from memory produces user response times many times faster than when that same data is read from disk. Keeping physical I/Os to an absolute minimum is one of the Oracle buffer cache's purposes in life.

The table below describes the key counters Performance Analyst uses to calculate the buffer cache hit ratio:

Key Counter

DB BLOCK GETS

CONSISTENT GETS

PHYSICAL READS

Direct Reads

Description

Data read from memory for DML operations.

Data read from rollback segments in memory.

Data read physically from disk.

Data read physically from disk that bypasses the buffer cache. Direct reads are filtered out of overall physical reads so an accurate cache hit ratio can be determined.

Dividing the data read from memory by data read from disk yields the cache hit ratio.

Metrics

To help ensure excellent performance, you want to keep your cache hit ratio in the neighborhood of 90% or higher. However, every database has its own ‘personality’ and can exhibit excellent performance with below average readings for the cache hit ratio. Excessive logical I/O activity can produce a very high cache hit ratio while actually degrading overall database performance.

Investigate consistent low readings of 60% or less.

NOTE:

For Oracle8i or earlier, the adjustment of the db_block_buffers tuning parameter is required. For Oracle9i and later, the db_cache_size parameter is the parameter that needs attention. Any increases in db_block_buffers to take effect on Oracle8i or earlier, the database must be cycled. The db_cache_size parameter in Oracle9i or later, however, is dynamic and can be altered without stopping and starting the database instance.

Correction

If a problem is found in Oracle8i or earlier, do the following:

• Edit the Init.ora file for the database.

• Increase the amount of db_block_buffers to a higher value. Take caution to not overallocate; ensure enough free memory exists on server before increasing value.

• Cycle the Oracle server when possible to allow the new value to take effect.

• Monitor the new value to see if performance improves.

If a problem is found in Oracle9i or later, do the following:

• Increase the size of the db_cache_size parameter through use of the ALTER SYSTEM SET db_cache_size command value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1065

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

• Monitor the new value to see if performance improves.

• If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

T

OP

P

ROCESSES

When the database population as a whole experiences a system slowdown, it is not uncommon to find one or two users who are responsible for bringing the system to its knees. In the best of worlds, users have an evenly divided amount of memory usage, disk I/O, CPU utilization, and parse activity. Unfortunately, this is not usually the case. Users submit large batch jobs during peak OLTP activity, or when sessions that are firing off untuned queries on a critical system.

If you are seeing a slowdown in your database, and cannot seem to find a root cause, one thing to examine is the resource consumption of the leading sessions on a system. A handful of users can overwhelm the I/O capabilities of Oracle (through untuned queries or runaway batch jobs) or hammer the CPU or memory structures of the database and server.

Performance Analyst makes it easy to pinpoint the top sessions by showing the leading processes at the physical I/O, logical I/O, memory, and CPU usage levels.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Workload Analysis Pane

If any one session uses more than 50% of a total resource (CPU, memory, etc.) go into the session to find out what they are currently executing.

A

CTIVE

U

SER

P

ROCESSES

The Active User Processes statistic is the total number of active and open threads reported in the database. Active Sessions displays the number of processes actively performing work.

For more information, see

Inactive User Processes

.

Location

Oracle Performance Analyst Statistics > Home >

Workload Analysis Pane

I

NACTIVE

U

SER

P

ROCESSES

This metric is the total number of threads logged on to the database that are idle at the current time.

Location

Metrics

Oracle Performance Analyst Statistics > Home >

Workload Analysis Pane

A large number of inactive users could indicate user sessions that have mistakenly been left logged on. Because each user thread consumes a portion of memory on the Oracle server, sever any sessions not needing a connection to reduce resource usage.

Correction Double-click this statistic to open the

Top Sessions Tab of the Users Detail page. On this tab you can

check sessions that have many seconds idle and/or that have been logged on for very long periods of time as indicated by the logon time column. After verifying that the session is no longer necessary, you can KILL the session.

For more information, see

Active User Processes .

10 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

M

EMORY

In addition to a Home

page, the Memory category of Oracle Performance Analyst includes the following tabbed pages:

Buffer Cache Tab

Latch Activity Tab

PGA Tab

Buffer Pools Tab

Library Cache Tab

Dictionary Cache Tab

Shared Pool Tab

H

OME

The Memory home page includes the following sections:

Bottleneck Analysis pane

SQL Analysis Pane

Key Ratio Analysis pane

Workload Analysis Pane

SGA Analysis Pane

K

EY

R

ATIO

A

NALYSIS PANE

Object-related database activity can be examined using both ratio-based and wait/bottleneckbased analysis. Ratio-based analysis involves examining a number of key database ratios and statistical readings that can be used to indicate how active certain object types are. Performance ratios serve as roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis.

When using ratio-based analysis, there are some standards to adhere to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that you examines come from the v$sysstat performance view. The performance view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and impacts how a particular ratio is interpreted. However, if delta statistics are used

(taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual ‘personality’ with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead you to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following memory ratios are used on the Performance Analyst Memory home page to succinctly communicate the general overall memory performance levels of the monitored database. They duplicate statistics shown on the Home page. For detailed descriptions of those

statistics, see Key Ratio Analysis Pane

.

Buffer Cache Hit Ratio

Memory Sort Ratio

Library Cache Hit Ratio

Free Shared Pool Percent

Dictionary Cache Hit Ratio

Parse/Execute Ratio

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1067

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

B

OTTLENECK

A

NALYSIS PANE

When an Oracle database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. You can use Bottleneck

Analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Memory bottlenecks can definitely cause performance degradation in an otherwise well-running database. Typically, these bottlenecks center around Oracle’s buffer/data cache, library cache, and occasionally log buffer memory regions. To help you identify such problems, the following statistics are presented on the Memory home page:

Free Buffer Wait Average

Redo Log Space Wait Time

Object Reloads

Top Latch Misses

Redo Log Space Waits

The following statistic, available on this pane, duplicates a statistic available on the Key Ratio

Analysis Pane

of the

Home

page:

Buffer Busy Waits

F

REE

B

UFFER

W

AIT

A

VERAGE

There are times when a user must wait to obtain a clean buffer in the buffer/data cache. The free buffer wait average provides a metric that communicates the average number of tree buffer waits..

Location

Metrics

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

Seeing consistent non-zero numbers for the free buffer wait average might indicate an undersized data/buffer cache.

Correction If the Object Reloads statistic, along with other shared pool metrics, indicates an undersized shared pool, you can do the following depending on the version of Oracle you are running:

If a problem is found in Oracle8i or earlier:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

If a problem is found in Oracle9i or later:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

If you suspect that there are hot code objects that would benefit from being pinned into the shared pool, then you can go into shared pool details using Performance Analyst’s monitors. You can easily spot the general code object types or specific objects that should be pinned in the pool from these monitors. Once identified, you can use the dbms_shared_pool package to pin the hot code objects into RAM.

10 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

O

BJECT

R

ELOADS

When a SQL statement or code object (stored procedure, trigger, etc.) is executed for the first time, Oracle loads the code definition into the shared pool. If the statement or code object is executed again, Oracle can reuse the object definition in memory, and thereby shorten execution time.

If a code object is aged out of the shared pool, and then re-requested, Oracle must load the object back into the pool. Such activity can lead to reduced response times. The Object Reloads statistic provides you with a count of how many objects have been reloaded back into the shared pool.

Location

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

Metrics Seeing consistent non-zero numbers for object reloads could indicate a too small shared pool or that help identify that there are hot code objects that should be pinned in the shared pool so they cannot be removed.

Correction If the Object Reloads statistic, along with other shared pool metrics, indicates an undersized shared pool, you can do the following depending on the version of Oracle you are running:

If a problem is found in Oracle8i or earlier:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

If a problem is found in Oracle9i or later:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value. Take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

If you suspect that there are hot code objects that would benefit from being pinned into the shared pool, then you can go into shared pool details using Performance Analyst’s monitors. You can easily spot the general code object types or specific objects that should be pinned in the pool from these monitors. Once identified, you can use the dbms_shared_pool package to pin the hot code objects into RAM.

R

EDO

L

OG

S

PACE

W

AITS

The Oracle database is able to manage recovery by recording all changes made to a database through the use of redo log files. Oracle writes modifications made to a database to these files that have the capability to be archived off to another medium for disaster recovery. The background process that performs these operations is Oracle's Log Writer (LGWR). There is a buffer area in Oracle's System Global Area (SGA) that is used to reduce redo log file I/O, whose size, or lack thereof, can affect performance in a busy system. Sometimes a user process must wait for space in this redo log buffer. Oracle uses the log buffer area to cache redo entries prior to writing them to disk, and if the buffer is not large enough for the redo entry load, waits can occur..

Location

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1069

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics The two main numbers to watch are the redo log space requests and the redo log wait time. If either statistic strays too far from zero, increase the log_buffer parameter and add more memory to the redo log buffer.

Correction To fix, do the following:

Edit the Init.ora file or SPFILE for the database.

Increase the amount of log_buffer to a higher value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

On some Oracle platforms, when adjusting the log_buffer parameter, make sure you make the amount a multiple of the block size. Otherwise, on database startup, Oracle returns an error stating that you have entered an invalid amount for the redo log buffer.

NOTE: Oracle increases the log_buffer parameter if you make it smaller than its default size for a given platform.

R

EDO

L

OG

S

PACE

W

AIT

T

IME

The Oracle database is able to manage recovery by recording all changes made to a database through the use of redo log files. Oracle writes modifications made to a database to these files that have the capability to be archived off to another medium for disaster recovery. The background process that performs these operations is Oracle's Log Writer (LGWR). There is a buffer area in Oracle's System Global Area (SGA) that is used to reduce redo log file I/O, whose size, or lack thereof, can affect performance in a busy system. Sometimes a user process must wait for space in this redo log buffer. Oracle uses the log buffer area to cache redo entries prior to writing them to disk, and if the buffer is not large enough for the redo entry load, waits can occur.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

The two main numbers to watch are the redo log space requests and the redo log wait time. If either statistic strays too far from zero, increase the log_buffer parameter and add more memory to the redo log buffer.

Correction To fix, do the following:

Edit the Init.ora file or SPFILE for the database.

Increase the amount of log_buffer to a higher value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

On some Oracle platforms, when adjusting the log_buffer parameter, make sure you make the amount a multiple of the block size. Otherwise, on database startup, Oracle returns an error stating that you have entered an invalid amount for the redo log buffer.

NOTE: Oracle increases the log_buffer parameter if you make it smaller than its default size for a given platform.

10 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OP

L

ATCH

M

ISSES

Latches protect the many memory structures in Oracle's SGA. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. More restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism.

The Top Latch Misses chart indicates the top latch waits as ranked by total misses.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory > Home

> Bottleneck Analysis pane

Seeing increasing numbers for the same latch miss can require further accessing session latch details, which can be accomplished inside Performance Analyst.

Correction The remedy for latch misses depends on the latch itself. Buffer chain latches, for example, are indicative of high I/O rates in databases. Increasing the buffer/data cache can help as might adding more buffer LRU chain latches by increasing the db_block_lru_latches parameter.

Library cache latch misses are oftentimes produced by non-reused SQL in the shared pool. Increasing the shared_pool_size can help, but a better remedy might be changing SQL to use bind variables or setting the cursor_sharing parameter to FORCE (Oracle 8.1.6 and later).

SQL A

NALYSIS

P

ANE

Much of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times. SQL statements that use much memory can also cause a problem in a database. The SQL Analysis for memory shows what SQL statements have consumed the largest percentages of shareable, persistent, and runtime memory

Before you can identify problem SQL in your database, you have to ask the question, “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional's satisfaction. The table lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall Response

(Elapsed) Time

CPU Time

Physical I/O

Logical I/O

Description

The time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server. This statistic is available in Oracle9i or later.

The CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user's request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements' logical I/O as well.

The number of memory reads the query took to satisfy the user's request. The goal of tuning

I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1071

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Criteria

Repetition

Description

The number of times the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute can be a headache on your system if it has executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over again.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above. Fortunately, Oracle records all the above measures (some only in 9i), which makes tracking the SQL that has been submitted against an Oracle database much easier.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you want answered:

1 What HAS been the worst SQL that has historically been run in my database?

2 What IS the worst SQL that is running right now in my database?

When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It could be that the query is in an inefficient PL/SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. You can view Performance

Analyst's Top SQL view and, if you have Embarcadero SQL Tuner installed, you can port the SQL over to SQL Tuner to better optimize the statement.

SGA A

NALYSIS

P

ANE

Most DBAs know all about the Oracle System Global Area (SGA). The SGA is Oracle's memory structural area devoted to facilitating the transfer of data and information between clients and the Oracle database. The table below describes Oracle memory structures:

Memory Structure

Default buffer cache

Keep buffer cache

Description

Maintains data blocks when they are read from the database. If you do not specifically place objects in another data cache, then any data requested by clients from the database is placed into this cache. The memory area is controlled by the db_block_buffers parameter in Oracle8i and earlier and db_cache_size in Oracle9i or later.

For Oracle 8 or later, you can assign various objects to a special cache that retains those object’s requested blocks in RAM for as long as the database remains up. The keep cache's main is for often-referenced lookup tables that should be kept in memory at all times for fast access. The buffer_pool_keep parameter controls the size of this cache in

Oracle8, while the db_keep_cache_size parameter handles the cache in Oracle9i or later.

The keep pool is a sub-pool of the default buffer cache.

10 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Memory Structure

Recycle buffer cache

Specific block size caches

Shared pool

Large pool

Java pool

Redo log buffer

Description

The opposite of the keep cache. When large table scans occur, the data that fills a memory cache will likely not be needed again and should be quickly discarded from

RAM so that they do not occupy memory space and prevent needed blocks from assuming their place. Objects containing such data can be assigned to the recycle pool to ensure that such a thing does indeed occur. The buffer_pool_recycle parameter controls the size of this cache in Oracle8 and earlier, while the db_recycle_cache_size parameter handles the cache in Oracle9i or later.

For Oracle 8 or later, you can create tablespaces whose blocksize differs from the overall database blocksize. When data is read into the SGA from these tablespaces, their data has to be placed into memory regions that can accommodate their special block size.

Oracle9i or later has memory settings for 2K, 4K, 8K, 16K, and 32K caches. The configuration parameter names are in the pattern of db_nk_cache_size.

Holds object structure as well as code definitions, and other metadata. Setting the proper amount of memory in the shared pool assists a great deal in improving overall performance with respect to code execution and object references. The shared_pool_size parameter controls the memory region.

For Oracle 8 or later, you can configure an optional, specialized memory region called the large pool that holds items for shared server operations, backup and restore tasks, and other miscellaneous things. The large_pool_size parameter controls the memory region. The large pool is also used for sorting when the multi-threaded server (MTS) is implemented.

Handles the memory for Java methods, class definitions, etc. The java_pool_size parameter controls the amount of memory for this area.

Buffers modifications that are made to the database before they are physically written to the redo log files. The log_buffer configuration parameter controls the memory area.

Oracle also maintains a fixed area in the SGA that contains a number of atomic variables, pointers, and other miscellaneous structures that reference areas of the SGA.

W

ORKLOAD

A

NALYSIS

P

ANE

It is not uncommon for one or two users to cause the majority of runtime problems that plague a database. The problem could be a runaway process, an untuned batch procedure, or other userinitiated operation. Oftentimes, user connections can get out of hand with memory consumption, and extreme cases have caused headaches at both the database and operating system level (ORA-4030 errors).

If your server does not have an overabundance of memory, periodically check to see who your heavy memory users are along with the total percentage of memory each takes up. If you see one or two users who have more than 25-50% of the total memory usage, investigate the sessions further to see the activities they are performing.

B

UFFER

C

ACHE

T

AB

The Buffer Cache tab includes the following sections:

Buffer Cache Hit Ratio

Cached Tables

Buffer Cache Utilization

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

Cached Blocks by Tablespace

1073

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

C

ACHED

B

LOCKS BY

T

ABLESPACE

Oracle’s buffer/data cache contains blocks read in from disk at the user’s request. The Cached

Blocks by Tablespace section displays the amount of data held currently in the cache by tablespace.

Location

Oracle Performance Analyst Statistics >

Memory >

Buffer Cache Tab

C

ACHED

T

ABLES

One of the ways you can help data from a table stay in the buffer/data cache as long as possible is to enable the table’s CACHE property. CACHE specifies that blocks retrieved for a table be placed at the most recently used end of the LRU list in the buffer cache when a full table scan is performed. This is particularly useful for small lookup tables.

The Cached Tables section displays the data for all tables that have their CACHE property enabled. The table below lists the information available in this section:

Column

Owner

Table Name

Table Size

Description

The owner of the table.

The name of the table.

The size of the table in bytes.

Location

Oracle Performance Analyst Statistics >

Memory >

Buffer Cache Tab

Metrics CACHE is best suited for small lookup tables. Therefore, if you see a large table that has been cached, you may want to reevaluate whether it is smart to cache the contents of that table in Oracle’s buffer/ data cache.

Correction If you wish to disable the CACHE property of a table, you can alter the table and set the property to false.

B

UFFER

C

ACHE

U

TILIZATION

The Buffer Cache Utilization section shows the state and use of the buffers currently in the buffer cache along with a count of how many there are for each state. Typically, the statuses of the buffers are: being read, free, read and modified, and read and not modified.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Buffer Cache Tab

This grouping of statistics is quite helpful in determining if you have an overabundance of block buffers allocated. Consistently seeing large number of free buffers will clue you in to the fact that you can reduce the amount of block buffers in the cache and give memory back to the operating system.

If, however, you see no free buffers within the first hour of bringing your Oracle database up, then you may consider adding more buffers to the cache.

10 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If a problem is found, then:

Edit the Init.ora file or spfile for the database.

Increase the amount of db_block_buffers (Oracle 8i and earlier) or db_cache_size (Oracle9i and later) to a higher value if free buffers are not found (take caution to not over-allocate; ensure enough free memory exists on server before increasing value). Reduce the number of an overabundance of FREE buffers are present.

Cycle the Oracle server (for Oracle8i and earlier) when possible to allow the new value to take effect.

Monitor new value to see if more numbers of free buffers show up for the FREE status.

D

ICTIONARY

C

ACHE

T

AB

Oracle's data dictionary is a component of the shared pool that contains system elements necessary for the parsing of SQL statements, security resolution, object definitions, and more.

The overall data dictionary cache hit ratio provides a key indicator in determining the performance of the shared pool, and shows how often object definitions are found in memory vs. having to read them in from disk. Because Oracle references the data dictionary many times when an SQL statement is processed, it is imperative that as much as possible of this vital reference information be kept in RAM.

The Dictionary Cache tab shows the individual elements of the data dictionary along with their associated hit ratios. In versions 6.x of Oracle, these individual elements could be tuned, but in versions 7.x and later, the only main method for tuning them involves the adjustment of the entire shared pool setting. Although not tunable from an individual parameter level, each displayed element gives insight into which area of the data dictionary is either adding to or detracting from overall performance.

The table below describes the information available on this tab:

Column

Parameter

Usage

Gets

Get Misses

Hit Ratio

Scans

Scan Misses

Description

The name of the individual data dictionary element.

The number of cache entries that contain valid data.

The number of requests for this element.

The number of requests resulting in a cache miss.

The ratio of cache hits versus misses of total requests. The maximum is

100%.

The number of scan requests.

The number of times that a scan failed to find the needed data in the cache.

The number of times the list was scanned completely.

Scan

Completes

Modifications

Flushes

The number of insert, update, and delete actions.

The number of disk flushes.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1075

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics

An overall high data dictionary cache hit ratio is desirable, as are high hit ratios in each individual parameter. You should strive for a hit ratio between 90-100%, with 95% being a good performance benchmark.

NOTE:

When a database is first started, the data dictionary cache hit ratio is not at an optimal level because all references to object definitions are relatively new, and as such, must be placed into the shared pool. Look for hit ratios between 80-90% for new database startups. If, however, after an hour or two of steady database time, the data dictionary cache hit ratio and individual hit ratios, have not increased to desirable levels, you should look into the possibility of increasing the shared_pool_size parameter.

NOTE:

Databases supporting applications that involve large number of objects (such as an

Oracle Financials installation) should have larger than normal shared pools to support the required object definitions.

B

UFFER

P

OOLS

T

AB

The Buffer Pools tab includes the following sections:

Buffer Pool Hit Ratio

Buffer Pool Memory Configuration

Buffer Pool Object Assignments

B

UFFER

P

OOL

H

IT

R

ATIO

Because data objects can be referenced with different usage patterns, Oracle8 and later offers the option to intelligently place objects into one of three buffer caches. The table below describes the types of buffer caches:

Cache

KEEP

RECYCLE

DEFAULT

Description

Designed to minimize misses in the buffer cache. Small objects that are frequently referenced are candidates for the KEEP buffer pool.

Designed to avoid having large numbers of infrequently accessed blocks of data crowd out objects that need to be referenced in RAM, the RECYCLE pool is good for large objects that are scanned from beginning to end without the need for keeping all their data in RAM.

The traditional cache for all other data objects.

NOTE:

Unless you specify the KEEP or RECYCLE buffer cache, Oracle automatically places objects into the DEFAULT buffer cache.

10 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The Buffer Pool Hit Ratio section the hit ratios for each of the Oracle8 and later buffer caches so you can easily see how often the objects placed into the various caches are being referenced in memory. Examining how often data is satisfied from memory vs. disk will help you determine if the caches are large enough and if they are being used in an optimal manner. The table below describes the information available in this section:

Column

Buffer pool name

Buffer pool hit ratio

Description

The name of the Oracle buffer pool.

The overall hit ratio for the particular cache.

NOTE:

The DEFAULT buffer cache will only be shown for those installations not using the specialized caches available in Oracle8 and later.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Buffer Pools Tab

The KEEP buffer pool should maintain a hit ratio as close to 100% as possible. However, the buffer pool hit ratio is not near 100% until the database has been up and running in a typical state for a short time.

A poor hit ratio for the RECYCLE buffer pool may not be a bad thing since there is little chance of reusing a block stored in the buffer pool before it is aged out.

NOTE: If you place objects into the KEEP buffer pool, you should periodically reexamine their object sizes to ensure that they are not growing to a physical state that will jeopardize the performance of the KEEP pool.

B

UFFER

P

OOL

O

BJECT

A

SSIGNMENTS

Because data objects can be referenced with different types of usage patterns, Oracle8 and later offers the option to intelligently place objects into one of three buffer caches. The table below describes these three buffer caches:

Cache

KEEP

RECYCLE

DEFAULT

Description

Designed to minimize misses in the buffer cache. Small objects that are frequently referenced are candidates for the KEEP buffer pool.

Designed to avoid having large numbers of infrequently accessed blocks of data crowd out objects that need to be referenced in RAM, the RECYCLE pool is good for large objects that are scanned from beginning to end without the need for keeping all their data in RAM.

The traditional cache for all other data objects.

Objects not specified to go into either the KEEP or RECYCLE caches will automatically be placed into the DEFAULT buffer cache.

The Buffer Pool Object Assignments section provides a summary with respect to which types of objects have been assigned to the various buffer caches. The table below describes the information available in this section:

Column

Object Type

Buffer Pool

Description

The type of object (table, index, etc.).

The buffer cache name (KEEP, etc.).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1077

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Column Description

Total Objects Assigned The number of objects that have been assigned to the particular cache.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Buffer Pools Tab

When looking at overall database I/O activity, you should keep an eye out for objects that may lend themselves to being placed into a particular buffer cache. Consider using a KEEP cache for relatively small, frequently accessed tables that require fast response times. Large tables with random I/O activity and are scanned from beginning to end a lot are good candidates for a RECYCLE cache.

B

UFFER

P

OOL

M

EMORY

C

ONFIGURATION

Because data objects can be referenced with different types of usage patterns, Oracle8 and later offers the option to intelligently place objects into one of three buffer caches. The table below describes these three buffer caches:

Cache

KEEP

RECYCLE

DEFAULT

Description

Designed to minimize misses in the buffer cache. Small objects that are frequently referenced are candidates for the KEEP buffer pool.

Designed to avoid having large numbers of infrequently accessed blocks of data crowd out objects that need to be referenced in RAM, the RECYCLE pool is good for large objects that are scanned from beginning to end without the need for keeping all their data in RAM.

The traditional cache for all other data objects.

Objects not specified to go into either the KEEP or RECYCLE caches will automatically be placed into the DEFAULT buffer cache.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Buffer Pools Tab

When looking at overall database I/O activity, you should keep an eye out for objects that may lend themselves to being placed into a particular buffer cache. Consider using a KEEP cache for relatively small, frequently accessed tables that require fast response times. Large tables with random I/O activity and are scanned from beginning to end a lot are good candidates for a RECYCLE cache.

Correction Objects can be placed into different buffer pools at object creation time (using the

STORAGE...BUFFER_POOL option) or existing objects can be set into a different pool with the ALTER command. Note that tables, partitions, and indexes may be placed into the different caches.

If you just want to use the DEFAULT buffer pool and not enable any special caches, you can still encourage Oracle to keep certain objects in the buffer cache as long as possible using the CACHE parameter. For example, issuing the command ALTER TABLE … CACHE specifies that the blocks retrieved for this table be placed at the most recently used end of the LRU list in the DEFAULT buffer cache when a full table scan is performed. The CACHE hint may also be used in SQL statements to cache a table, but used in this form, the blocks will only be cached until the next time the database is shut down. Once the database comes back up, the CACHE hint would have to be issued in a SQL statement again to cache the needed blocks of data.

10 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

L

ATCH

A

CTIVITY

T

AB

The Latch Activity tab includes the following sections:

Immediate Latch Hit Ratio

Latch Sleep Ratio

Latch Detail

Latch Hit Ratio

L

ATCH

H

IT

R

ATIO

Protecting the many memory structures in Oracle's SGA are latches. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you do not and are forced to continually retry. The latch hit ratio defines the number of times a process obtained a willing-to-wait.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Latch Activity Tab

If the latch hit ratio falls below 99%, then action should be taken to resolve the amount of latch contention occurring.

Correction

The details regarding the latch contention should be examined. Increasing the shared_pool_size can assist in latch problems also. There are a few specialized cases of latch contention that can be rectified pretty easily. The table below describes them:

Contention Description

Cache buffer chain latch This latch is responsible for protecting paths to database block buffers in the buffer cache. Very high I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers/db_cache_size parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

Library cache latches Protects cached SQL statements in the library cache area of the Oracle shared pool.

Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and later.

I

MMEDIATE

L

ATCH

H

IT

R

ATIO

Protecting the many memory structures in Oracle's SGA are latches. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you do not and are forced to continually retry. The latch immediate miss ratio defines the number of times a process obtained a not-willing-to-wait latch.

Location

Oracle Performance Analyst Statistics >

Memory >

Latch Activity Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1079

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics If the value falls below 99%, then action should be taken to resolve the amount of latch contention occurring.

Correction

The details regarding the latch contention should be examined. Increasing the shared_pool_size can assist in latch problems also. There are a few specialized cases of latch contention that can be rectified pretty easily. The table below describes them:

Contention Description

Cache buffer chain latch This latch is responsible for protecting paths to database block buffers in the buffer cache. Very high I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers/db_cache_size parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

Library cache latches Protects cached SQL statements in the library cache area of the Oracle shared pool.

Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and later.

L

ATCH

S

LEEP

R

ATIO

Protecting the many memory structures in Oracle's SGA are latches. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you do not and are forced to continually retry.

A sleep indicates that a latch could not be obtained for a process, and that the attempt will be retried. A low ratio indicates many processes that had to sleep multiple times before obtaining a requested latch.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Latch Activity Tab

Sleeps should be kept as low as possible. If the overall sleep ratio falls below 99%, then action should be taken to resolve the amount of latch contention that is occurring.

Correction

The details regarding the latch contention should be examined. Increasing the shared_pool_size can assist in latch problems also. There are a few specialized cases of latch contention that can be rectified pretty easily. The table below describes them:

Contention Description

Cache buffer chain latch This latch is responsible for protecting paths to database block buffers in the buffer cache. Very high I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers/db_cache_size parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

10 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Contention

Library cache latches

Description

Protects cached SQL statements in the library cache area of the Oracle shared pool.

Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and later.

L

ATCH

D

ETAIL

Protecting the many memory structures in Oracle's SGA are latches. They ensure that one and only one process at a time can run or modify any memory structure at the same instant. Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you do not and are forced to continually retry.

The Latch Detail section presents a detailed view of latch activity. The table below lists the information available:

Column

Latch Name

Gets

Misses

Description

The name of the latch.

The number of times the latch was requested by a process.

The number of failed attempts to acquire the latch on the first attempt.

Immediate Gets The number of nowait requests for a latch.

Immediate Misses The number of failed nowait attempts to acquire the latch on the first attempt.

Sleeps The number of requests that paused while waiting for a latch.

Location

Oracle Performance Analyst Statistics >

Memory >

Latch Activity Tab

Metrics

Common indicators of latch contention are a latch miss ratio (which records willing-to-wait mode latch requests) and latch immediate miss ratio (which records no-wait mode latch requests).

These statistics reflect the overall health of how often latch requests were made and satisfied without waiting. If either of these exceed 1%, then latch contention may be causing system slowdowns.

There are a few latch contention situations that you can recognize and get to the bottom of quickly. The table below describes them:

Contention Situation Description

Cache buffer chain latch This latch is responsible for protecting paths to database block buffers in the buffer cache. Very high I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1081

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Contention Situation

Library cache latches

Description

This latch protects cached SQL statements in the library cache area of the Oracle shared pool. Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and later.

L

IBRARY

C

ACHE

T

AB

The Library Cache tab includes the following sections:

Library Cache Hit Ratio

Library Cache Performance

Pinned Objects

L

IBRARY

C

ACHE

P

ERFORMANCE

The library cache holds commonly used SQL statements - basically database code objects. A method for improving performance in Oracle is to encourage the reuse of SQL statements so expensive parse operations may be avoided. The library cache assists this tuning effort.

The Library Performance sectioned tab provides insight into how efficiently the library cache is operating. The table below describes the information available in this section:

Column

Namespace

Gets

Get Hit Ratio

Pins

Pin Hit Ratio

Reloads

Invalidations

Description

The region of the library cache.

The number of times a lock was requested for objects in the particular namespace.

The percentage of times (with 100% being the maximum) that the object was found in the cache.

The number of times a pin was requested for objects of this namespace.

The percentage of times (with 100% being the maximum) that pin requests were successful.

The number of times a piece of the object had to be brought back in from disk to the cache, most likely because it was flushed from the shared pool.

The number of times objects in this namespace were marked invalid because a dependent object was modified.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

Library Cache Tab

NOTE: An overall high library cache hit ratio is a desirable thing. You should strive for a hit ratio between 95-100%, with 99% being a good performance benchmark for code reuse. When a database is first started, the library cache hit ratio, along with the individual region hit ratios, will not be at an optimal level because all code being used will be relatively new, and as such, must be parsed and placed into the shared pool. If, however, after a solid hour or two of steady database time, the library cache hit ratio has not increased to desirable levels, you should look into the possibility of increasing the shared_pool_size parameter.

To keep important code objects from being aged out of the library cache, you can use the

DBMS_SHARED_POOL package to pin frequently used code objects in memory so they will always be there when needed.

10 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

INNED

O

BJECTS

To keep important code objects from being aged out of the library cache, you can use the

DBMS_SHARED_POOL package to pin frequently used code objects in memory so they will always be there when needed. The Pinned Objects section displays all objects in the library cache that have pinned. The table below lists the information available in this section:

Column

Owner

Name

Description

The user account that owns the object.

The name of the object.

Type The type of the object: INDEX, TABLE, CLUSTER, VIEW, SET, SYNONYM, SEQUENCE,

PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, TRIGGER, CLASS, OBJECT, USER,

DBLINK.

Shareable Memory The amount of memory consumed by the object in the shared pool.

Loads

Executions

Locks

Pins

Pinned?

The number of times the object has been loaded into the cache. Note that this count also increases when an object has been invalidated.

The number of times the object has been executed by a session thread.

The number of users actively locking the object.

The number of user actively pinning the object.

Indicates (YES or NO) if this object has been pinned in memory with the

DBMS_SHARED_POOL package.

S

HARED

P

OOL

T

AB

The main components of the shared pool memory are the library and dictionary caches. Many of the caches in the shared pool increase or decrease in size automatically as necessary. The Shared

Pool tab of the Memory Detail view presents the following sections:

Shared Space Pool Utilization - a graphical representation of the amount of used and free memory.

Shared Pool Fragmentation - displays the following statistics:

• Bucket: A work area defined by its optimal memory requirement.

• Free Space: The amount of free space in the bucket.

• Free Chunks: The number of free chunks that are available to be allocated from the shared pool.

• Average Size: The average size of a chunk.

• Largest: The size of the largest chunk.

Shared Pool Usage - The Shared Pool Usage section shows the following statistics:

• Shared Pool Component Name

• Amount Used (bytes)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1083

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

• Percent Used

PGA T

AB

The PGA tab displays statistical measures and techniques that let you manage a session's

Program Global Area.

NOTE:

This information is available for Oracle9i and later.

The PGA tab includes the following sections:

PGA Overview

PGA Workarea Summary

For more information, see

Memory

.

PGA Session Detail

PGA O

VERVIEW

Oracle's Program Global Area (PGA) is a private memory region containing data and control information for every connected process. Examples of PGA information are the runtime area of a cursor and memory sort space. If shared servers are used, then part of the runtime area can be located in the SGA.

Intensive queries cause a big portion of the PGA to be dedicated to work areas supporting memory intensive operators, such as the following:

• Sort-based operators (for example, ORDER BY, GROUP BY, ROLLUP, window functions)

• Hash-join

• Bitmap merge

• Bitmap create

• Write buffers used by bulk load operations

A sort operator uses a sort area to perform the in-memory sort of a set of rows. Similarly, a hashjoin operator uses a hash area to build a hash table.

NOTE:

This information is available for Oracle9i and later.

Location

Oracle Performance Analyst Statistics >

Memory >

PGA Tab

10 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics The size of a PGA area can be controlled and tuned. Larger work areas can significantly improve performance of session work, with the trade off being higher memory consumption. The size of a session's PGA should be big enough so that it can accommodate the input data and auxiliary memory structures allocated by its requested SQL actions. This is known as the optimal size of a PGA work area. When the size of a PGA work area is smaller than optimal, the response time increases, because an extra pass is performed over part of the input data. This is known as the one-pass size of the PGA work area. Under the one-pass threshold, when the size of a work area is smaller than its input data size, multiple passes over the input data are needed. This could drastically increase the response time of the session. This is known as the multi-pass size of the work area.

The goal is to have most work areas running with an optimal size (more than 90% or more for OLTP systems), while a smaller amount are running with a one-pass size (less than 10%). Multi-pass execution should be completely avoided.

Prior to Oracle9i, the PGA was controlled using the SORT_AREA_SIZE, HASH_AREA_SIZE,

BITMAP_MERGE_AREA_SIZE and CREATE_BITMAP_AREA_SIZE parameters. Setting these parameters is difficult, because the maximum PGA size is ideally selected based on data input size and total number of work areas active in the system. These two factors vary from one work area to another and from one point in time to another.

Correction

With Oracle9i, you can simplify and improve the way PGA memory is allocated, by enabling automatic PGA memory management. In this mode, Oracle dynamically adjusts the size of the portion of the PGA memory dedicated to work areas, based on an overall PGA memory target explicitly set by the DBA. To enable automatic PGA memory management, you have to set the initialization parameter PGA_AGGREGATE_TARGET.

The table below describes two metrics you should to watch:

Metric

Over allocation count

Cache hit percentage

ORACLE 9.2 AND LATER

Description

Over-allocating PGA memory can happen if the value of PGA_AGGREGATE_TARGET is too small to accommodate the PGA other component in the previous equation plus the minimum memory required to execute the work area workload. When this happens,

Oracle cannot honor the initialization parameter PGA_AGGREGATE_TARGET, and extra

PGA memory needs to be allocated. If over-allocation occurs, you should increase the value of PGA_AGGREGATE_TARGET.

This metric is computed by Oracle to reflect the performance of the PGA memory component. A value of 100% means that all work areas executed by the system since instance start-up have used an optimal amount of PGA memory. When a work area cannot run optimally, one or more extra passes is performed over the input data. This reduces the cache hit percentage in proportion to the size of the input data and the number of extra passes performed.

PGA W

ORKAREA

S

UMMARY

Oracle's Program Global Area (PGA) is a private memory region containing data and control information for every connected process. Examples of PGA information are the runtime area of a cursor and memory sort space. If shared servers are used, then part of the runtime area can be located in the SGA.

Intensive queries cause a big portion of the PGA to be dedicated to work areas supporting memory intensive operators, such as the following:

• Sort-based operators (for example, ORDER BY, GROUP BY, ROLLUP, window functions)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1085

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

• Hash-join

• Bitmap merge

• Bitmap create

• Write buffers used by bulk load operations

A sort operator uses a sort area to perform the in-memory sort of a set of rows. Similarly, a hashjoin operator uses a hash area to build a hash table.

NOTE:

This information is available for Oracle9i and later.

Location

Metrics

Oracle Performance Analyst Statistics >

Memory >

PGA Tab

The size of a PGA area can be controlled and tuned. Larger work areas can significantly improve performance of session work, with the trade off being higher memory consumption. The size of a session's PGA should be big enough so that it can accommodate the input data and auxiliary memory structures allocated by its requested SQL actions. This is known as the optimal size of a PGA work area. When the size of a PGA work area is smaller than optimal, the response time increases, because an extra pass is performed over part of the input data. This is known as the one-pass size of the PGA work area. Under the one-pass threshold, when the size of a work area is smaller than its input data size, multiple passes over the input data are needed. This could drastically increase the response time of the session. This is known as the multi-pass size of the work area.

The goal is to have most work areas running with an optimal size (more than 90% or more for OLTP systems), while a smaller amount are running with a one-pass size (less than 10%). Multi-pass execution should be completely avoided.

Prior to Oracle9i, the PGA was controlled using the SORT_AREA_SIZE, HASH_AREA_SIZE,

BITMAP_MERGE_AREA_SIZE and CREATE_BITMAP_AREA_SIZE parameters. Setting these parameters is difficult, because the maximum PGA size is ideally selected based on data input size and total number of work areas active in the system. These two factors vary a lot from one work area to another and from one point in time to another.

Correction With Oracle9i, you can simplify and improve the way PGA memory is allocated, by enabling automatic

PGA memory management. In this mode, Oracle dynamically adjusts the size of the portion of the

PGA memory dedicated to work areas, based on an overall PGA memory target explicitly set by the

DBA. To enable automatic PGA memory management, you have to set the initialization parameter

PGA_AGGREGATE_TARGET.

If multi-pass percentages are consistently non-zero, you should increase the size of

PGA_AGGREGATE_TARGET.

PGA S

ESSION

D

ETAIL

Oracle's Program Global Area (PGA) is a private memory region containing data and control information for every connected process. Examples of PGA information are the runtime area of a cursor and memory sort space. If shared servers are used, then part of the runtime area can be located in the SGA.

Intensive queries cause a big portion of the PGA to be dedicated to work areas supporting memory intensive operators, such as the following:

• Sort-based operators (for example, ORDER BY, GROUP BY, ROLLUP, window functions)

• Hash-join

• Bitmap merge

10 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• Bitmap create

• Write buffers used by bulk load operations

A sort operator uses a sort area to perform the in-memory sort of a set of rows. Similarly, a hashjoin operator uses a hash area to build a hash table.

The PGA Session Detail section displays PGA usage for all connected sessions. The table below describes the information in this section:

Data

SID

Username

O/S ID

Logon Time

Machine Name

PGA Alloc Memory

PGA Used Memory

PGA Max Memory

Description

The unique identified given the session by Oracle.

The user account a session is using.

The operating system ID of the process.

The time the session logged into Oracle.

The name of the machine running the process.

The amount of allocated PGA memory for the process.

The amount of freeable or usable memory for the process.

The maximum amount of PGA memory used by the process.

NOTE:

This information is available for Oracle9i and later.

Location

Oracle Performance Analyst Statistics >

Memory >

PGA Tab

I/O

In addition to a Home

page, the I/O category of Oracle Performance Analyst includes the following tabbed pages:

Access Pattern Detail Tab

DBWR/LGWR Tab

Table I/O Tab

Datafile I/O Tab

Rollback I/O Tab

Job Queue Activity Tab

Sort Activity Tab

H

OME

The I/O Home page includes the following sections:

Key Systems Analysis Pane

SQL Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

I/O Access Patterns - I/O

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1087

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

K

EY

S

YSTEMS

A

NALYSIS

P

ANE

When complaints begin to surface about your database's performance, oftentimes the root cause can be traced to one or more issues with I/O. The thing to keep in mind when you begin to monitor the I/O of your database is that you are actually reviewing the success of your physical design model.

All the physical storage characteristics and placements, the table and index designs, and the speed with which it all works are on display when I/O is monitored. Because a database's main index of performance is measured by how fast I/O needs are satisfied, it is your responsibility to quickly interrogate Oracle to determine if a reported database slowdown is I/O related.

Physical I/O

Physical I/O consists of Oracle going to disk to gather or write data. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database. You can also use other processes like the checkpoint and archive processes (CKPT and ARCH). Embarcadero

Performance Analyst shows three key indicators of physical I/O. The table below describes these indicators:

Indicator

Physical Reads

Physical Writes

Redo Writes

Description

Physical Reads is the total number of physical reads performed on all datafiles since the last refresh.

Physical Writes is the total number of times the DBWR process has performed writes to various database datafiles since the last refresh

Oracle's redo logs are hotbeds of I/O activity in databases that store heavily modified data. Redo log files are used to perform database recovery in the event of a system crash. Redo logs are written to in a cyclical fashion - each log file is filled up before Oracle moves on to the next file. The redo writes statistic reflects the total number of redo writes by the LGWR process since the last refresh

Metrics

The table below describes metrics for Physical I/O statistics:

Statistic

Physical Reads

Physical Writes

Metrics

Large numbers of physical reads could reflect a too small data/buffer cache. The

Buffer

Cache Hit Ratio

is a better indicator of overall logical vs. physical I/O.

Wait events related to I/O activity are good indicators of physical I/O problems. These events include db file parallel write and db file single write.

Correction

Doing the following can negate large numbers of continuous physical reads:

• Increasing the size of the data/buffer cache.

• Pinning often-referenced objects in memory by using the KEEP buffer pool (Oracle 8 and higher.)

10 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• Placing heavily scanned objects in larger blocksize tablespaces (16-32KB). For Oracle9i or later.

• Tune SQL statements for better efficiency.

Logical I/O

Logical I/O refers to data access performed in memory. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database. You can also use other processes like the checkpoint and archive processes (CKPT and ARCH). Embarcadero

Performance Analyst shows three key indicators of logical I/O. The table below describes these indicators:

Indicator

Logical Reads

Logical Changes

Consistent Reads

Description

Logical Reads is the total number of db block gets and consistent gets (data read from memory) since the last refresh.

Logical Changes is the total number of changes that were made to all blocks in the SGA that were part of an update or delete operation. These changes generate redo log entries and are permanent if the transaction is committed. The number of logical changes is an approximate indication of total database work.

Consistent Reads is the total number of times a consistent read was requested for a database block. Such a read is performed from Oracle’s rollback segments.

Metrics

Regarding raw logical I/O counts, no hard-core metrics exist. However, because physical I/O takes longer to complete than logical (memory) I/O, you should minimize physical read operations when possible. The

Buffer Cache Hit Ratio

is a better indicator of overall logical vs. physical I/O.

Correction

While logical I/O is still up to 1,400 times faster than physical disk access, it would be wise to investigate the top logical I/O process using Performance Analyst and see what SQL it is executing. If one process on the system is consuming between 25-50% of the overall amount, their SQL might require tuning.

B

OTTLENECK

A

NALYSIS

P

ANE

When an Oracle database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting can mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. You can use Bottleneck

Analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1089

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Bottleneck analysis is a valid method of measuring performance because it helps you track where a database has been spending its time. If heavy table scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause.

Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, you can discover a fair amount of detail about which sessions and objects are causing the problem.

For wait event analysis to be properly carried out, it is imperative that the timed_statistics initialization parameter be set to TRUE. By default this parameter is set to FALSE, which disallows the collection of wait times for each wait event defined to the Oracle engine. For one to really understand the impact of wait events on database performance, you need to not only discover what the database is or has been waiting on, but the durations of the waits. Having both allows a complete picture to be formed regarding the magnitude of wait-initiated performance degradations. Almost all Oracle experts now agree that allowing the collection of timing statistics adds little if anything to database overhead, so setting timed_statistics to TRUE should not be a worry. The Performance Analyst I/O home page identifies the top database and log file waits that can cause decreased performance.

The Bottleneck Analysis section includes:

Hottest Database Files

Top Database File Waits Top Log File Waits

H

OTTEST

D

ATABASE

F

ILES

The Hottest Database Files section lists the most active database files as indicated by physical I/

O activity.

Location

Oracle Performance Analyst Statistics >

I/O > Home

> Bottleneck Analysis Pane

Metrics Understanding the storage-level hot spots of a database is beneficial for a couple of reasons. First, you can get a feel for overworked physical disks by viewing I/O statistics at the tablespace and datafile levels. If a particular disk or set of disks is under too much strain, you can relocate the tablespaces to other less-used devices or create new tablespaces on different disks and move hot objects to them (assuming, of course, you have extra disks available). Second, if you have used standard DBA practice and placed indexes in their own tablespace, you can view the I/O statistics for that tablespace and see if the indexes are actually being used.

Correction Here are some areas to consider when viewing Hottest Database Files:

Seeing much activity in the SYSTEM tablespace and datafiles can indicate recursive calls (space management, etc.). The use of locally-managed tablespaces (Oracle8i and later) can help with space management as it relates to data dictionary references.

Temporary tablespaces (devoted to sort activity) showing higher volumes of physical I/O could indicate a problem with excessive disk sorts.

You might want to quickly review all the physical I/O for each drive/file system and get a feel for the overworked disks on your server. If you have under utilized disk drives (with their own controllers), consider relocating some tablespaces that exhibit high I/O characteristics to those drives.

10 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OP

D

ATABASE

F

ILE

W

AITS

When viewing wait statistics, there are many levels of detail. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system.

The Top Database File Waits section filters all system wait events to present waits that are associated with database file activity. It ranks the top events by the count of total waits.

Location

Oracle Performance Analyst Statistics >

I/O > Home

> Bottleneck Analysis Pane

Correction Oracle documentation contains a listing and description of every current wait event defined in Oracle.

DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics.

The most common database file wait is a db file scattered read, which indicates table scan activity.

Small table scans are normally not a problem as Oracle can access data from small tables by quickly caching and scanning them. Scans of large tables can be confirmed by examining the I/O access pattern metrics on the Performance Analyst I/O home page. Information is also available on which sessions are causing the large table scans.

Finally, one thing to watch is not only the actual waits, but also the wait time in seconds. If no wait time is observed with each wait type, then performance is likely not endangered by the event.

T

OP

L

OG

F

ILE

W

AITS

When viewing wait statistics, there are many levels of detail. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system.

This section filters all system wait events to present waits that are associated with log file activity.

It ranks the top events by the count of total waits.

Location

Oracle Performance Analyst Statistics >

I/O > Home

> Bottleneck Analysis Pane

Correction Oracle documentation contains a listing and description of every current wait event defined in Oracle.

DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics.

The most common database file wait is a log file parallel write, which indicates how quickly Oracle can flush the log buffer. Excessive wait times associated with this event count indicate a bottleneck at the log buffer level.

Finally, one thing to watch is not only the actual waits, but also the wait time in seconds. If no wait time is observed with each wait type, then performance is likely not endangered by the event.

SQL A

NALYSIS

P

ANE

Much of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times. SQL statements that use much memory can also cause a problem in a database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1091

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Before you can identify problem SQL in your database, you have to ask the question, “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional's satisfaction.

The SQL Analysis for I/O shows what SQL statements have consumed the largest percentages of physical and logical I/O, sort activity, and rows processed. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall Response

(Elapsed) Time

CPU Time

Physical I/O

Logical I/O

Repetition

Description

The amount of time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server. This statistic is available in Oracle9i or later.

The amount of CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user's request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements' logical I/O as well.

This is a measure of how many memory reads the query took to satisfy the user's request. The goal of tuning I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

This is a measure of how often the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute may still be causing a headache on your system if it has executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over again.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above. Fortunately, Oracle records all the above measures (some only in 9i), which makes tracking the SQL that has been submitted against an Oracle database much easier.

Metrics When you begin to look for inefficient SQL in a database, there are two primary questions you want answered:

What HAS been the worst SQL that has historically been run in my database?

What IS the worst SQL that is running right now in my database?

When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It could be that the query is in an inefficient PL/SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can go further into Performance Analyst's Top SQL view and, if you have Embarcadero SQL Tuner installed, you can port the SQL over to SQL Tuner to better optimize the statement.

10 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

I/O A

CCESS

P

ATTERNS

- I/O

There are many different routes that Oracle can take to access various objects contained in a database. The I/O Access Patterns section summarizes the methods Oracle is using to satisfy end-user requests for data.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O > Home

> SQL Analysis Pane

Long table scans are typically an activity to avoid as they have the capability to cause needless physical and logical I/O as well as flood the buffer cache with seldom referenced blocks of data. You can discover which sessions have been causing the most large table scans.

The table fetch continued row statistic is indicative of chained/migrated row I/O. Such activity is not desired because chained/migrated row access can cause twice the I/O needed to access a table.

Oracle must pick do two or more I/Os to read a chained/migrated row in a table. You can discover which sessions have been accessing tables with chained/migrated rows.

W

ORKLOAD

A

NALYSIS

P

ANE

It is not uncommon for one or two users to cause the majority of runtime problems that plague a database. The problem could be a runaway process, an untuned batch procedure, or other userinitiated operation. The Top I/O Hogs table shows the top sessions that have caused the most physical I/O on the system (both reads and writes).

Metrics If you see one or two users who have caused more than 25-50% of the total memory usage, go further into the sessions to see the activities they are performing.

I/O T

ABLESPACE

T

AB

Physical I/O consists of Oracle going to disk to gather or write data. Logical I/O refers to data access performed in memory. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database. Other processes like the checkpoint and archive processes (CKPT and ARCH) may also be used.

The Tablespace I/O tab displays details concerning the physical I/O activity at the tablespace level. The table below lists the information available on this tab:

Column

Tablespace Name

Physical Reads

Description

The name of the tablespace.

The cumulative number of physical reads.

Physical Writes The cumulative number of physical writes.

Physical Block Reads The cumulative number of physical block reads.

Physical Block Writes The cumulative number of physical block writes.

Physical Read Time The time spent reading from the tablespace (in hundredths of seconds).

Physical Write Time The time spent writing to the tablespace (in hundredths of seconds).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1093

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics Generally, you want to see much more logical I/O activity than physical I/O, at least with respect to reads, although this in and of itself is a guarantee of good I/O performance. Seeing logical and physical reads keeping pace with one another is a sure sign that the Oracle SGA's buffer cache is sized too small or that needless, large table scans are occurring, which cause blocks of data to be continually read in and flushed out of the buffer cache.

Other telltale signs of trouble brewing are large amounts of activity visible in user's TEMP tablespaces. The normal interpretation of such a thing is that a large number of disk sorts are taking place (perhaps because the Init.ora/spfile parameter SORT_AREA_SIZE may be set too small).

D

ATAFILE

I/O T

AB

Physical I/O consists of Oracle going to disk to gather or write data. Logical I/O refers to data access performed in memory. The database writer (DBWR) and log writer (LGWR) processes typically perform all the I/O work in the database against the physical datafile used to hold information The checkpoint and archive processes (CKPT and ARCH), also perform I/O work in the database.

The Datafile I/O tab displays details concerning the physical I/O activity at the datafile level. The table below lists the information available on this tab:

Column

DataFile Name

Tablespace Name

Physical Reads

Physical Writes

Block Reads

Block Writes

Read Time

Write Time

Description

The name of the datafile.

The name of the tablespace.

The cumulative number of physical reads.

The cumulative number of physical writes.

The cumulative number of physical block reads.

The cumulative number of physical block writes.

The time spent reading from the tablespace (in hundredths of seconds).

The time spent writing to the tablespace (in hundredths of seconds).

Metrics Generally, you will want to see much more logical I/O activity than physical I/O, at least with respect to reads, although this in and of itself is a guarantee of good I/O performance. Seeing logical and physical reads keeping pace with one another is a sure sign that the Oracle SGA's buffer cache is sized too small or that needless, large table scans are occurring, which cause blocks of data to be continually read in and flushed out of the buffer cache.

Other telltale signs of trouble brewing are large amounts of activity visible in user's TEMP tablespaces. The normal interpretation of such a thing is that a large number of disk sorts are taking place (perhaps because the Init.ora/spfile parameter SORT_AREA_SIZE may be set too small).

This view also allows you to see the ‘hot’ files in terms of physical I/O activity. Seeing too much activity on one drive/file system may indicate a need for better file striping.

10 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

R

OLLBACK

I/O T

AB

The Rollback I/O tab includes the following sections:

Active Rollback Details

Rollback I/O

For more information, see

Home .

Session Rollback Activity

R

OLLBACK

I/O

To undo changes made to the Oracle database from within a transaction, Oracle writes data to individual rollback segments. Oracle also uses these segments to maintain read consistency for multiple users of data that is being modified. Because Oracle reads from and writes data to rollback segments, they can become very hot areas for I/O.

The Rollback I/O section presents everything necessary to view and troubleshoot rollback problems.The table below lists the information available in this section:

Column

Name

Size

Shrinks

Extents

Gets

Waits

Writes

Active Trans

Status

High Water Mark

Description

The name of the rollback segment.

The size of the rollback segment in KBs.

The number of times the rollback segment has decreased in size.

The number of times he rollback segment has increased in size.

The number of header gets (the segment has been used).

The number of header waits.

The number of bytes written to the rollback segment.

Indicates whether the rollback segment is active (non zero) or not (zero value).

Indicates the status of the rollback segment, with the two main results being OFFLINE (a segment is offline and unavailable for transactions) and ONLINE (a rollback segment is online and available for transactional use).

The largest size that the rollback segment has ever grown to.

Location

Oracle Performance Analyst Statistics >

I/O >

Rollback I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1095

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics To properly tune rollback I/O, you must first make sure that you have enough segments to accommodate the workload of the database. Constantly seeing a count of active rollback segments equal to or near the number of rollbacks defined for the database is an indicator that you should create more. An overall rollback contention ratio of 1% or greater is an indicator of too few rollbacks.

Seeing wait counts greater than zero for each rollback segment is further evidence that you should create more rollback segments. Oracle9i provides the UNDO tablespace to automatically generate and eliminate the ‘correct’ number of rollback segments for a system given a certain workload.

After ensuring that enough rollback segments exist in the database, you should then turn your attention to the question of sizing. Dynamic rollback extension can take a toll on performance when rollback segments are consistently enlarged to accommodate heavy transaction loads. Seeing rollback segments undergoing numerous extends and shrinks (as Oracle returns a segment back to its

OPTIMAL setting), as well as rollback segments having current or high-water mark sizes greater than their OPTIMAL setting usually is a good indicator that they should be permanently enlarged. Again,

Oracle9i’s automatic undo management can assist in this process.

A

CTIVE

R

OLLBACK

D

ETAILS

Rollback or undo segments are used to guarantee transactional integrity. When a transaction has not been committed or rolled back, a rollback segment will be in use with live transactional data.

The Active Rollback Details section displays information concerning active rollback segments.

The table below lists the information available in this section:

Column

SID

Username

Rollback

Start Time

Blocks Used

Description

The system ID of the session using the rollback segment.

The account/schema name of the session.

The rollback segment name containing the session’s transaction.

The time the transaction was initiated.

The number of rollback blocks used by the transaction.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

Rollback I/O Tab

Seeing transactions with dated start times may indicate transactions that are the source of lock contention.

S

ESSION

R

OLLBACK

A

CTIVITY

For all connected sessions, Oracle maintains statistics regarding each session’s counts of rollbacks and commits. The Session Rollback Activity section displays a transactional summary/ history that helps identify sessions with excessive rollback activity. The table below lists the information available in this section:

Column

SID

Username

Machine Name

Description

The system ID of the session.

The account/schema name of the session.

The machine name where the session logged on.

10 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Logon Time

User Rollbacks

Transactions Rolled Back

User Commits

Description

The time the session logged into Oracle.

The number of times the user manually issued the ROLLBACK statement or an error occurred during the user’s transaction.

The number of transactions successfully rolled back.

The number of times a user transaction was committed.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

Rollback I/O Tab

Seeing high numbers of transactions rolled back might indicate an application error or other transactional problem.

DBWR/LGWR T

AB

The DBWR/LGWR tab includes the following sections:

Daily Archive Log Summary (Last 7

Days)

Redo Wastage

Database Writer Detail

Table I/O Tab

Log Writer Detail

D

ATABASE

W

RITER

D

ETAIL

The database writer process (DBWR) handles the flow of information from Oracle's physical datafiles to and from the various memory structures in the system global area (SGA). On platforms that support it, you can configure and use multiple DBWR processes. The log writer

(LGWR) process manages the information contained in Oracle's online redo log files and redo log buffer area. The table below lists the information available in this section:

Column

Statistic

Amount

Description

The specific metric for the database writer.

The value for the statistic.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

DBWR/LGWR Tab

Of all the statistics presented for the DBWR process, the summed dirty queue length statistic deserves attention. Non-zero values typically indicate buffers left in the write queue after a write request and may indicate that the DBWR process is falling behind.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1097

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

L

OG

W

RITER

D

ETAIL

The database writer process (DBWR) handles the flow of information from Oracle's physical datafiles to and from the various memory structures in the system global area (SGA). On platforms that support it, you can configure and use multiple DBWR processes. The log writer

(LGWR) process manages the information contained in Oracle's online redo log files and redo log buffer area. The table below lists the information available in this section:

Column

Statistic

Amount

Description

The specific metric for the log writer.

The value for the statistic.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

DBWR/LGWR Tab

For the LGWR process, non-zero values seen for the redo log space requests and redo log space wait time statistics could be a cause for concern. Redo log space requests reflect the number of times a user process waited for space in the redo log buffer, while the redo log space wait time presents the total time waited in milliseconds. Both could indicate the presence of contention in the redo log buffer. Possible remedies include increasing the log_buffer size in the SGA.

D

AILY

A

RCHIVE

L

OG

S

UMMARY

(L

AST

7 D

AYS

)

To allow for point-in-time recovery, Oracle writes copies of redo log information to disk. When a database is running in archive log mode, a DBA can (with proper backup techniques in place) recovery nicely from a database error and roll forward to almost any point in time needed, as long as the proper archive logs are in place.

The I/O needed to write these archive logs is handled by Oracle's ARCH process. The Daily

Archive Log Summary shows the number of archive logs written each day for the past seven days.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

DBWR/LGWR Tab

Heavy redo log activity can lead to many archive files being written out to disk. Batch jobs have the potential to move very fast - sometimes so fast that the online redo logs wrap back around before they have a chance to be archived. Messages of this nature will oftentimes show up in the Oracle alert log. If this is the case, you many want to think about increasing the size of the online redo log files, or increase the number of redo logs in general.

Seeing archive files written more than one per hour or half-hour may indicate a too small redo size (or above average data modification load).

If archive log protection is a concern (in other words, you do not want to lose an archive file that may be needed for recovery) and you are using Oracle8, you can now take advantage of the feature to write archive files to more than one destination on disk. It also allows multiple ARCH processes to now be invoked. Investigate the use of the Init.ora parameters log_archive_dest_n and log_archive_max_processes.

Always remember one thing with respect to archive files and running Oracle in archive log mode: running out of archive file space on the server is a sure fire way to halt all activity in a database. Make sure you have plenty of free space available on your archive drives. Also, implement a purge procedure for older archives in conjunction with a good backup routine.

10 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

R

EDO

W

ASTAGE

Oracle's redo logs are hotbeds of I/O activity in databases that store heavily modified data.

Redo log files are used to perform database recovery in the event of a system crash. Redo logs are written to in a cyclical fashion - each log file is filled up before Oracle moves on to the next file. The Redo Wastage section shows how many bytes were wasted by redo log buffers being written before they were full.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

DBWR/LGWR Tab

Viewing a high percentage of wasted bytes to overall redo bytes can help you identify if redo wastage is a problem on your system.

Correction Sometimes heavy redo wastage occurs when the log_checkpoint_interval parameter is set too high. If you think this is the case for your system, then

Edit the Init.ora file for the database.

Change the amount of log_checkpoint_interval to a lower value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

T

ABLE

I/O T

AB

I/O activity at the table level has historically been difficult to get with Oracle. Oracle9i and later contain better dictionary elements to help get a clearer picture of table I/O, but earlier versions of Oracle allow an estimation only. The table below lists the information available in the

Estimated Physical I/O by table on this tab:

Column

Owner Name

Table Name

Estimated Disk

Reads

Description

The owner of the table

The name of the table or table partition.

The estimated number of physical and physical direct reads for the table.

Metrics Viewing high numbers of disk reads for a table could indicate excessive table scan activity. Such a table may benefit from better indexing or from being placed into a larger blocksize tablespace

(Oracle9i and later).

S

ORT

A

CTIVITY

T

AB

The Sort Activity tab includes the following sections:

Current Disk Sorts

Session Sort Detail

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1099

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

S

ESSION

S

ORT

D

ETAIL

Excessive sort activity can degrade a user's or overall database performance. When a sort operation occurs, Oracle attempts to perform the sort in a memory space, assigned by the DBA, which exists at the operating system level. If the sort is too large to be contained within this space, it will continue the sort on disk - specifically, in the user's assigned temporary tablespace.

The Session Sort Detail section displays historical sort statistics for every logged on session. The table below lists the information available in this section:

Column

SID

Username

Machine Name

Logon Time

Disk Sorts

Memory Sorts

Row Sorted

Disk/Memory Sort Ratio

Description

The unique identified given the session by Oracle.

The user account a session is using.

The machine name where the session logged on.

The time the session logged into Oracle.

The cumulative number of disk sorts for the session.

The cumulative number of memory sorts for the session.

The cumulative number of rows sorted by the session.

The percentage of times the session had to perform a disk sort.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

Sort Activity Tab

Techniques to include in your overall performance strategy are those that relate to minimizing the amount of sort activity overall and specifically sort activity that takes place on disk. A good place to start is by understanding things that cause sorts in the first place. A list of sort-related commands and

SQL-related options include CREATE INDEX, ALTER INDEX … REBUILD, DISTINCT, ORDER BY,

GROUP BY, UNION, INTERSECT, MINUS, IN, and NOT IN, as well as certain unindexed joins and certain correlated subqueries

All of these SQL commands have the potential to create a sort. As a DBA, you probably will not know which queries will have their sorts performed entirely in memory and which ones will be forced to go to disk.

There are times you simply cannot stop disk sort activity (such as in data warehousing environments).

That being the case, you should ensure the following are true in your database:

Your users' TEMPORARY TABLESPACE assignment is not the SYSTEM tablespace, which is the default assignment.

The TEMPORARY TABLESPACE assigned to your users is placed on a fast disk.

The TEMPORARY TABLESPACE has the tablespace parameter TEMPORARY assigned to it, which allows sort activity to be performed in a more efficient manner.

If your overall memory sort ratio falls below 90%, you may want to increase the parameters devoted to memory sorts - sort_area_size and sort_area_retained_size. Keep in mind that Individual users might have the ability to alter their own sessions and increase their sort_area_size assignments! As a DBA, you may want to restrict users that have the ALTER SESSION privilege.

In addition to increasing the amount of memory devoted to sorting, you should also hunt down inefficient SQL that cause needless sorts. For example, UNION ALL does not cause a sort whereas

UNION does in an SQL query (to eliminate duplicate rows). DISTINCT oftentimes is coded inappropriately (especially by folks transferring from Microsoft Access, which used to use DISTINCT for nearly every SELECT query).

11 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

URRENT

D

ISK

S

ORTS

Excessive sort activity – especially disk sorts - can degrade a user's or overall database performance. When a sort operation occurs, Oracle attempts to perform the sort in a memory space, assigned by the DBA, which exists at the operating system level. If the sort is too large to be contained within this space, it will continue the sort on disk - specifically, in the user's assigned TEMPORARY TABLESPACE.

The Current Disk Sorts section displays sort statistics for every session currently performing a disk sort. The table below lists the information available in this section:

Column

SQL Text

SID

Username

Machine Name

Tablespace

Extents

Blocks

Description

The SQL statement causing the disk sort.

The unique identified given the session by Oracle.

The user account a session is using.

The machine name where the session logged on.

The tablespace containing the sort segments used by the sort.

The number of extents being used for the sort.

The number of blocks being used for the sort.

Location

Metrics

Oracle Performance Analyst Statistics >

I/O >

Sort Activity Tab

Techniques to include in your overall performance strategy are those that relate to minimizing the amount of sort activity overall and specifically sort activity that takes place on disk. A good place to start is by understanding things that cause sorts in the first place. A list of sort-related commands and

SQL-related options include CREATE INDEX, ALTER INDEX … REBUILD, DISTINCT, ORDER BY,

GROUP BY, UNION, INTERSECT, MINUS, IN, and NOT IN, as well as certain unindexed joins and certain correlated subqueries

All of these SQL commands have the potential to create a sort. As a DBA, you probably will not know which queries will have their sorts performed entirely in memory and which ones will be forced to go to disk.

There are times you simply cannot stop disk sort activity (such as in data warehousing environments).

That being the case, you should ensure the following are true in your database:

Your users' TEMPORARY TABLESPACE assignment is not the SYSTEM tablespace, which is the default assignment.

The TEMPORARY TABLESPACE assigned to your users is placed on a fast disk.

The TEMPORARY TABLESPACE has the tablespace parameter TEMPORARY assigned to it, which allows sort activity to be performed in a more efficient manner.

If your overall memory sort ratio falls below 90%, you may want to increase the parameters devoted to memory sorts - sort_area_size and sort_area_retained_size. Keep in mind that Individual users might have the ability to alter their own sessions and increase their sort_area_size assignments! As a DBA, you may want to restrict users that have the ALTER SESSION privilege.

In addition to increasing the amount of memory devoted to sorting, you should also hunt down inefficient SQL that cause needless sorts. For example, UNION ALL does not cause a sort whereas

UNION does in an SQL query (to eliminate duplicate rows). DISTINCT oftentimes is coded inappropriately (especially by folks transferring from Microsoft Access, which used to use DISTINCT for nearly every SELECT query).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1101

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

J

OB

Q

UEUE

A

CTIVITY

T

AB

The Job Queue Activity tab includes the following sections:

Job Queue Summary Problem Jobs Running Jobs Detail

J

OB

Q

UEUE

S

UMMARY

Oracle provides a way for Oracle developers to submit and run jobs through the job queue feature of the Oracle database. The table below lists the information available on this section:

Column

Total Jobs

Broken

Failures

Running

Description

The number of jobs defined to the database.

The number of jobs broken (disabled).

The number of job failures.

The number of jobs currently running.

P

ROBLEM

J

OBS

Oracle provides a way for Oracle developers to submit and run jobs through the job queue feature of the Oracle database. Sometimes a job may fail or become disabled (broken). The table below lists the information available in this section:

Column

Job ID

Description

The job number for the job.

Login User The user account used to run the job.

Last Date Successfully Run The date/time of when the job last successfully ran.

Broken

Failures

Indicates if the job is disabled or not.

The number of failures the job has experienced.

Location

Oracle Performance Analyst Statistics >

I/O >

Job Queue Activity Tab

R

UNNING

J

OBS

D

ETAIL

Oracle provides a way for Oracle developers to submit and run jobs through the job queue feature of the Oracle database. The Running Jobs Detail section provides information about currently running jobs. The table below lists the information available in this section:

Column

SID

Job ID

Start Date/Time

Description

The unique identified given the session by Oracle.

The job number for the job.

Indicates when the job started.

11 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Submitted by

Run As

Parse As

Next Run Date/Time

Job Contents

Description

Indicates the session that submitted the job.

Indicates which account is used to run the job.

Indicates which account is used to parse the job.

Indicates when the job will next run.

Indicates the actual command used by the job.

Location

Oracle Performance Analyst Statistics >

I/O >

Job Queue Activity Tab

A

CCESS

P

ATTERN

D

ETAIL

T

AB

When a session submits a set of SQL or a transaction, there are many different combinations of methods the Oracle kernel will use to satisfy the query or transaction. The Access Pattern Detail tab displays all currently connected sessions, their demographic information, and a count of the various different methods that Oracle uses to handle incoming requests. The table below lists the information available on this tab:

Column

SID

Username

Machine Name

Description

The unique identified given the session by Oracle.

The user account a session is using.

The machine name where the session logged on.

Logon Time

Large Table Scans

Small Table Scans

Table Scan ROWID

Ranges

Table Scan Cache

Partitions

The time the session logged into Oracle.

The cumulative count of ‘large’ table scans with ‘large’ normally being defined as any table over five blocks.

The cumulative count of ‘small’ table scans with ‘small’ normally being defined as any table under five blocks.

The cumulative count of table scans where the table in question has the CACHE property enabled.

The cumulative count for partitions that have the CACHE property enabled.

Table Scan Direct Reads The cumulative count of table scans performed with Oracle bypassing the buffer cache

(data read only once - straight from disk and not from both disk and cache).

Chained Row Accesses The cumulative count of the number of times a chained/migrated row was accessed.

Index by ROWID The cumulative count of the number of rows fetched from a table by ROWID (normally index access).

Index Scans

Index Scan ROWID

Ranges

The cumulative count of fast full index scans.

The cumulative count of fast full index scans with ROWID endpoints specified.

Index Scan Direct Read The cumulative count of fast full index scans using direct read (data read only once - straight from disk and not from both disk and cache).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1103

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

S

PACE

In addition to a Home

page, the Space category of Oracle Performance Analyst includes the following tabbed pages:

Extent Analysis Tab

Tablespace Detail Tab

Object Space Tab

Tablespace Growth Tab

Fragmentation Tab

User Space Tab

H

OME

The Space Home page includes the following sections:

Bottleneck Analysis Pane

SQL Analysis Pane

Redo Logs

User Space Analysis Pane

Space Analysis Pane

S

PACE

A

NALYSIS

P

ANE

The Oracle tablespace is the logical container for the physical storage needs of a database. The

Space Analysis section displays details for all the tablespaces for a particular database, including their total, used, free space, and percent free, as well as if each can automatically extend to support incoming space requests.

Metrics

If any tablespace's free space percent amount goes below 10%, and at least one tablespace’s datafiles does not have AUTOEXTEND enabled (or the datafile has reached its extend limit), you should take action to ensure that the tablespace does not run out of available free space.

11 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction

There are two things you can do to ensure that a tablespace does not run out of available free space:

1 First, you should look into the use of Oracle's AUTOEXTEND feature. AUTOEXTEND lets you give an Oracle tablespace the ability to auto-grow when it has exhausted the free space contained within. You can let a tablespace grow in an unlimited fashion or put constraints on it to stop at a certain point. You can also dictate how much more free space the tablespace gets each time it needs more space than is available. However, AUTOEXTEND enabled for a tablespace does not mean that you cannot run out of space. Remember you still have the physical server limitations to contend with. Make sure you (or your sysadmin) keep a careful eye on the server drives that house your Oracle database files for available free space.

2 If the free space on a server drive nears its limit, disable AUTOEXTEND for the datafile(s) that are on the target drive, and use the ALTER TABLESPACE … ADD DATAFILE command to place a new datafile for the tablespace on another drive that has more free space to offer.

TIP:

AUTOEXTEND is not a replacement for proactive space planning. When extra space is needed by the database, and AUTOEXTEND is activated by Oracle, performance slows as Oracle allocates more space for the tablespace. Avoiding AUTOEXTEND aids performance, albeit in a small way.

B

OTTLENECK

A

NALYSIS

P

ANE

When using bottleneck analysis to troubleshoot a database, you cannot rely only on the information contained in the wait event views that Oracle provides. For example, an object may attempt to extend into another extent of space in a tablespace and yet be denied if no such free space exists. Such a failure is not reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that you cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Space home page displays space-related bottlenecks that can decrease overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Space home page to succinctly communicate the general overall space situation of the monitored database:

Autoextend Datafiles at Extend Limit Objects at Maximum Extents

Offline Tablespaces Top Fragmented Datafiles

Objects with No Room to Expand

A

UTOEXTEND

D

ATAFILES AT

E

XTEND

L

IMIT

You can specify that one or more tablespace datafiles can automatically grow by enabling the datafile’s AUTOEXTEND property. you can also specify that the datafile not be permitted to grow beyond a certain limit, and once that limit is reached, the datafile and/or the tablespace may be permanently out of space.

Location

Oracle Performance Analyst Statistics >

Space > Home

> Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1105

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics You should not see any positive indicator that any datafile has reached its extend limit. While it might be okay from the standpoint that a datafile cannot simply grow anymore (if the tablespace has other datafiles that can grow or that no more space is added to the tablespace), disable AUTOEXTEND on the datafile.

Correction If a datafile has reached its extend limit, you can take a number of actions:

Eliminate the extend limit for the datafile either by increasing the limit size or allowing to grow in an unlimited fashion.

If the datafile is on a disk or file system that has no free space left, you can add another datafile to the tablespace to allow for space expansion and alter the problem datafile to have AUTOEXTEND disabled.

If the datafile is on a disk or file system that has no free space left, the datafile can be physically relocated to another drive or file system with more free space.

O

BJECTS AT

M

AXIMUM

E

XTENTS

When an object in Oracle (table, index, table partition, etc.) needs to expand, Oracle automatically allocates another extent of space to accommodate the incoming data. However, a table or index can reach its maximum extent limit, which is the maximum number of extents for an object.

Location

Metrics

Oracle Performance Analyst Statistics >

Space > Home

> Bottleneck Analysis Pane

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Unless an object is static in nature, and is not expected to grow in size, no object should ever get to its maximum extent limit.

Correction If a maximum extent limit is reached for an object, you can take a number of actions:

The object can be reorganized into a locally-managed tablespace where no maximum extent limit is applied to any object.

The object can be altered to have unlimited extents.

The object can be reorganized into one or a few extents.

The good news concerning locally-managed tablespaces is that unlimited extents are the rule, so if you choose to use these storage structures in your database, you will not have to worry about an object ever reaching a maximum extent limit. Some DBAs have expressed concerns over whether an object having hundreds or thousands of extents experiences performance problems when full table scans or similar operations are performed against them. While most

Oracle experts agree that such I/O degradation might have been experienced in earlier Oracle versions, most feel that such is not the case any longer, especially when locally-managed tablespaces are used.

O

BJECTS WITH

N

O

R

OOM TO

E

XPAND

When an object in Oracle (table, index, table partition, etc.) needs to expand, Oracle automatically allocates another extent of space to accommodate the incoming data. However, an object may be prohibited from expanding for a number of reasons:

• The tablespace does not have enough free space to accommodate the extent request, and cannot automatically extend.

11 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• The tablespace has enough total free space, but the space is not contiguous in nature (and the tablespace cannot automatically extend) and therefore the object cannot extend.

Location

Metrics

Oracle Performance Analyst Statistics >

Space > Home

> Bottleneck Analysis Pane

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Unless an object is static in nature, and is not expected to grow in size, no object should ever be prohibited from acquiring its next extent of space.

Correction If an object cannot extend, you can take a number of actions including:

One or more of the tablespace’s datafiles can have its AUTOEXTEND property enabled, which lets the object to grow even though there is no space currently available in the tablespace.

The object can be reorganized into a locally-managed tablespace all extents are uniform in nature.

The object can be altered to have a reduced next extent size.

O

FFLINE

T

ABLESPACES

A tablespace ONLINE status indicates that the tablespace is in normal read/write mode.

Tablespaces marked read only displays a status of READ ONLY, while tablespaces engaged in backup mode indicates such in their status. An OFFLINE tablespace during normal processing hours is a cause for concern.

Location

Metrics

Oracle Performance Analyst Statistics >

Space > Home

> Bottleneck Analysis Pane

No tablespace should have a status of OFFLINE during normal business hours, unless you are performing maintenance on it.

Correction If a tablespace has a status of OFFLINE, you can make it ONLINE using the ALTER TABLESPACE command.

T

OP

F

RAGMENTED

D

ATAFILES

This section shows the tablespaces datafiles suffering from the highest levels of free space fragmentation in the database. Tablespaces are made up of object segments and space extents.

Extents are either allocated to object segments or are free. When a tablespace is initially populated, all objects are neatly packed together in the front of the tablespace and all remaining free space is in one free chunk at the end. As objects grow (or extend) they are given new extents of space in the tablespace/datafile. If they are dropped, pockets of free space begin to appear throughout the tablespace. These pockets of space take one of two forms. The table below describes these forms:

Free Space

Honeycombs

Bubbles

Description

Pockets of free space that are adjacent to one another.

Pockets of free space that are trapped between object extents in the tablespace.

Location

Metrics

Oracle Performance Analyst Statistics >

Space > Home

> Bottleneck Analysis Pane

If you see a datafile that has many chunks of free space, determine if the tablespace is experiencing honeycomb or bubble fragmentation. You can handle honeycomb fragmentation quite easily, whereas bubble fragmentation is more difficult to solve.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1107

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction

You can eliminate honeycomb fragmentation with the ALTER TABLESPACE…COALESCE command. Issuing this command combines all pockets of adjacent free space into one extent.

Each database maintenance plan should include a job that coalesces all the free honeycombs in a tablespace into one free chunk. Although Oracle is supposed to perform this operation automatically through the SMON process, it requires you to have the PCTINCREASE parameter of the tablespace set to a nonzero value. Having PCTINCREASE set to a value greater than zero encourages tablespace fragmentation through disparately sized extents. Plus, using SMON in this way is not efficient or entirely reliable.

You can temporarily solve bubble fragmentation by performing a total tablespace reorganization. A better long-term solution for Oracle databases 8.1.5 or later is to convert tablespaces over to locally managed tablespaces. With locally managed tablespaces you either specify the initial extent size and let Oracle automatically size all other extents, or specify a uniform extent size for everything. Problems caused by fragmentation then become a thing of the past.

To help stave off fragmentation problems:

• Set PCTINCREASE to zero for all tablespaces and objects to promote same-sized extents.

• Specify equal-sized allotments for your INITIAL and NEXT object storage parameters.

• Group objects with like growth and storage needs together in their own tablespaces.

• Considering converting any dictionary-managed tablespace to locally-managed.

You should also avoid fragmentation in the SYSTEM tablespaces. The best ways to do this include:

• Ensure no user has a DEFAULT or TEMPORARY tablespace assignment of SYSTEM.

• Ensure no user has a quota set for SYSTEM.

• Ensure no user has been granted the UNLIMITED TABLESPACE privilege.

SQL A

NALYSIS

P

ANE

Much of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

The SQL Analysis section of the Space home page shows a count of all SQL statements that have executed INSERT, UPDATE, DELETE, and TRUNCATE commands. Seeing these statistics should help you determine how much space-related SQL activity is occurring on your system.

Metrics The statistics for this section can be used in many different ways. For example, large numbers of inserts could indicate a growing database and that you should keep a watchful eye on free space.

Heavy update numbers could mean trouble for objects containing many indexes (indexes typically undergo splits and fragmentation when large volumes of updates are thrown their way). Many deletes might signal potential table high water mark problems.

11 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

R

EDO

L

OGS

Oracle's redo logs are hotbeds of I/O activity in databases that store heavily modified data.

Redo log files are used to perform database recovery in the event of a system crash. Redo logs are written to in a cyclical fashion - each log file is filled up before Oracle moves on to the next file. The redo bytes statistic reflects the total amount of redo generated in bytes since the last refresh. The redo wastage bytes indicate how many bytes were wasted by redo log buffers being written before they were full.

Location

Metrics

Oracle Performance Analyst Statistics >

Space > Home

> SQL Analysis Pane

Viewing a high percentage of wasted bytes to overall redo bytes can help you identify if redo wastage is a problem on your system.

Correction Sometimes heavy redo wastage occurs when the log_checkpoint_interval parameter is set too high.

To fix this:

Edit the Init.ora file for the database.

Change the amount of log_checkpoint_interval to a lower value.

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

For Oracle9i and later, you can dynamically alter the log_checkpoint_interval parameter without stopping/starting the database.

U

SER

S

PACE

A

NALYSIS

P

ANE

The Top Space Hogs section details the schema in the database that own the most space. In databases where object owners can be many, it is oftentimes a good idea to take a quick look at which schema are leading the way in terms of space usage. This is not restricted to production environments only, but can be extended to dynamic development systems as well, especially if there are many developers in a database that have their own sets of objects. Developers sometimes have a bad habit of creating objects (or copies of objects) that they leave in a database even though they are not being used.

Correction If a user owns many objects, or copies of objects, you can reclaim space in your database by contacting the user to see if those objects can be dropped.

T

ABLESPACE

D

ETAIL

T

AB

The Tablespace Detail tab includes the following sections:

Datafile Detail Tablespace Object Summary

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1109

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

T

ABLESPACE

O

BJECT

S

UMMARY

Tablespaces are the logical containers for database objects inside Oracle. The Tablespace

Object Summary section provides an overview of how much space is consumed in each tablespace by object type. The table below lists the information available in this section:

Column

Tablespace Name

Status

Autoextend

Total Space (MB)

Table (MB)

Index (MB)

Rollback (MB)

Cluster (MB)

LOB (MB)

Description

The name of the tablespace.

Indicates the status of the tablespace.

Indicates whether one or more of the tablespace’s datafiles has the ability to automatically grow.

The total allocated space for the tablespace.

The amount of used table and table partition space, in MB.

The amount of used index and index partition space, in MB.

The amount of used rollback and undo segment space, in MB.

The amount of used cluster space, in MB.

The amount of used large object space, in MB.

Location

Oracle Performance Analyst Statistics >

Space >

Tablespace Detail Tab

D

ATAFILE

D

ETAIL

Tablespaces are the logical containers for database objects inside Oracle, and datafiles are the actual physical files that make up a tablespace. The Datafile Detail section provides an overview of the size of each datafile and other demographic information. The table below lists the information available in this section:

Column

File Name

Status

Autoextend

Tablespace Name

Size (MB)

Max Size (MB)

Description

The name of the datafile.

Indicates the status of the tablespace.

Indicates whether the datafile has the ability to automatically grow.

The name of the tablespace.

The total allocated space for the datafile.

The maximum size the datafile can automatically grow to.

Location

Oracle Performance Analyst Statistics >

Space >

Tablespace Detail Tab

11 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

O

BJECT

S

PACE

T

AB

The Object Space tab displays a summary of space and extent information for all or selected objects in the database. The table below lists the information available on this tab:

Column

Owner

Object Name

Object Type

Space (KB)

Extents

Max Extents

Initial Extent (KB)

Next Extent (KB)

Tablespace

Description

The owner of the object.

The name of the object.

The type of object (table, index, etc.).

The size of the object in KB.

The number of extents used by the object.

The maximum number of extents allowed for the object.

The initial extent size for the object.

The next extent size for the object.

The tablespace where the object resides.

Metrics

One thing to keep an eye on are objects that are close to their maximum extent limit. Such objects can be altered to have more or unlimited extents if need be. The use of locally-managed tablespace eliminates the threat of an object ever encountering a maximum extent limit. For more information, see the

Home page under Space .

T

ABLESPACE

G

ROWTH

T

AB

Growing tablespaces do not have to spell problems for a DBA. Of course, up front planning is the key to sizing tablespaces correctly. Unfortunately, DBAs may not have all the information they need at tablespace creation time (or they may have the wrong information), so a tablespace can approach the end of its free space from time to time. The DBA can allow a tablespace to grow automatically (AUTOEXTEND) to prevent an out-of-space condition. Enabling

AUTOEXTEND for a tablespace is quite reassuring for a DBA, but it introduces a new concept for the tablespace: monitoring data file growth. You should monitor your tablespaces that have

AUTOEXTEND set so you can get an idea of the growth that is occurring in your database.

Monitoring them lets you perform some mini-capacity planning and helps you get a jump-start on server upgrades.

The Tablespace Growth tab displays growth statistics for the database currently being monitored. The table below lists the information available on this tab:

Column

Tablespace Name

Datafile Name

Autoextend

Created Size

Description

The name of the tablespace.

Thee name of the tablespace’s datafile.

Indicates whether the tablespace has one or more datafiles that have the AUTOEXTEND feature set (allowing the datafile to automatically grow).

The starting size for the physical datafile.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1111

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Column

Current Size

Growth

Description

The current size of the physical datafile.

The percentage of growth experienced for the datafile (if any).

Metrics

Using AUTOEXTEND can be very important for tablespaces devoted to disk sorting. Large data warehouses often must endure large disk sort operations. Having AUTOEXTEND enabled for tablespaces used for temporary segments (sort activity) helps large sort queries to complete when they might otherwise fail due to running out of sort space.

Just having AUTOEXTEND enabled for a tablespace does not mean you cannot run out of space. Remember, you still have to contend with the physical server limitations. Make sure you

(or your sysadmin) keep a careful eye on the server drives that house your Oracle database files for available free space. If the free space on a server drive nears its limit, disable AUTOEXTEND for the datafile(s) that are on that drive, and use the traditional ALTER TABLESPACE…ADD

DATAFILE command to place a new datafile for the tablespace on another drive that has more free space to offer.

F

RAGMENTATION

T

AB

Tablespaces are made up of object segments and space extents. Extents are either allocated to object segments or are free. When a tablespace is initially populated, all objects are neatly packed together in the front of the tablespace and all remaining free space are in one free chunk at the end. Unfortunately, this is not how things continue to be in a tablespace. As objects grow

(or extend) they are given new extents of space in the tablespace. If you drop objects, pockets of free space begins to appear throughout the tablespace. These pockets of space are either honeycombs or bubbles. Honeycombs are not so difficult to deal with, but bubbles are another story.

The Fragmentation tab displays two different views of tablespace fragmentation. The first grid displays fragmentation at the tablespace level and the second grid displays fragmentation at the datafile level. The table below describes the information available in the Tablespace

Fragmentation grid:

Column

Tablespace Name

Free Space (MB)

Free Chunks

Largest Chunk (MB)

Description

The tablespace name.

The total amount of free space in MB for the tablespace.

The total number of free chunks in the tablespace.

The largest free chunk (in MB) for the tablespace.

The table below describes the information available in the Datafile Fragmentation grid on the

Fragmentation tab:

Column

Datafile

Description

The name of the datafile.

11 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Autoextend

Tablespace

Free Chunks

Largest Chunk

Description

Indicates whether the datafile can automatically grow in size.

The tablespace name.

The number of free chunks in the datafile.

The largest free chunk (in MB) for the datafile.

Metrics

To spot and correct fragmentation in your tablespaces, you should periodically monitor the fragmentation levels of your tablespaces at a global level. Doing so helps you quickly spot tablespaces that are experiencing fragmentation issues. Seeing a tablespace with only one chunk of free space is a sign that a tablespace is not having fragmentation problems. Seeing a tablespace with a couple of free chunks may not be a big deal either, because the tablespace could be made up of more than one datafile. Each datafile has its own chunk or chunks of free space.

If you see a tablespace that has many chunks of free space, the next thing to do is drill down into it and find out if the tablespace is experiencing honeycomb or bubble fragmentation.

Honeycomb fragmentation occurs when pockets of free space exist that are adjacent to one another. Bubbles are pockets of free space that are trapped between object segment extents.

You can eliminate honeycomb fragmentation with the ALTER TABLESPACE...COALESCE command. This command combines all pockets of adjacent free space into one extent. It is important to do this because when an object is newly introduced to a tablespace (or an existing object needs to extend), and a contiguous chunk of free space does not exist to accommodate an object's INITIAL or NEXT size allocation, Oracle must manually coalesce all available honeycombs to try and form a large enough free chunk. This is a performance hit. If possible, you should try to minimize performance hits.

Bubble fragmentation is a more serious matter and is normally only corrected through tablespace or database reorganization. The standard technique is to perform an export of all objects in the tablespace, drop the tablespace, and then import all the objects back into the tablespace. However, this technique may just treat the symptom and not the cause of bubble fragmentation. The real issue is to address the reuse of space extents within a tablespace so that bubble fragmentation does not occur in the first place.

Oracle8 and later offers the concept of locally-managed tablespaces, which can all but eliminate tablespace fragmentation. It totally does away with the storage parameters of MINEXTENTS,

MAXEXENTS, PCTINCREASE, and NEXT. With locally managed tablespaces you either specify the initial extent size and let Oracle automatically size all other extents, or specify a uniform extent size for everything. Problems caused by fragmentation then become a thing of the past.

Correction

What can you do manually to help stave off fragmentation problems? A few suggestions include:

• Set PCTINCREASE to zero for all tablespaces and objects to promote same-sized extents.

• Specify equal-sized allotments for your INITIAL and NEXT object storage parameters.

• Group objects with like growth and storage needs together in their own tablespaces.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1113

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Of all your tablespaces, you want to avoid fragmentation problems in your SYSTEM tablespace the most as this is the major hotbed tablespace for Oracle activities. The easiest way to avoid this is to not allow any user (even the default DBA ID's SYS and SYSTEM) to have access to it.

There are three ways to do this:

1 Ensure no user has a DEFAULT or TEMPORARY tablespace assignment of SYSTEM.

2 Ensure no user has a quota set for SYSTEM.

3 Ensure no user has been granted the UNLIMITED TABLESPACE privilege.

E

XTENT

A

NALYSIS

T

AB

Object fragmentation results when objects consume multiple extents of space in a tablespace rather than a single block of space. Although performance problems with respect to object fragmentation are not as severe as they were in previous versions of Oracle, some DBAs believe that response-time penalties can still be chalked up to this situation. When multiple extents exist for an object, the amount of time it takes Oracle to scan it can be longer than if the object was made up of only one extent. This typically holds true when extents are scattered on different parts of the physical server disk. In addition, a performance hit is taken each time an object must extend into another extent of space.

The Extent Analysis tab displays objects whose extent count has exceeded a user-suggested numerical limit. The table below lists the information available on this tab if any objects are found:

Column

Owner

Object Name

Object Type

Next Extent

Total Extents

Max Extents

Largest Free Chunk (KB)

Tablespace Name

Description

The user account that owns the object.

The name of the object.

The type of object (TABLE, INDEX, etc.).

The next extent amount of space the object will consume.

The number of extents the object is currently consuming.

The MAXEXTENTS limit imposed on the object by the DBA.

The size of the largest chunk.

The name of the tablespace.

Metrics

When is object fragmentation a problem for an object? Opinions on this vary widely. As a general rule of thumb, if an object is exhibiting response time degradations, and no other factor can be attributed to the slowdown, examine the object to see how badly fragmented it is. If extent numbers are seen exceeding 100 or more, than you might want to think about reorganizing the object or using locally managed tablespaces. This rule of thumb does not apply to objects assigned to locally-managed tablespaces as extent fragmentation is expected and not a performance issue.

11 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction

The best preventative for this problem is specifying the correct allocation of space for the object in the first place, but what can you do if you have objects with high numbers of extents? For tables and indexes you have three options:

1 Use Oracle's export/import utility to export, drop, and import the fragmented objects back into the database with the export parameter COMPRESS=Y. This will bring the objects back into the database with one large extent. Make sure that large enough chunks of available free space exist to accept the object back in, or you may experience space allocation errors.

2 With Oracle8, you can use the ALTER TABLE … MOVE command to reorganize a table back into one extent in a very safe and efficient manner.

3 Use ALTER INDEX … REBUILD to reorganize indexes that have moved into multiple extents.

Another thing to keep an eye on is the next extent size of an object vs. the largest free chunk of space in the tablespace. Seeing objects with larger next extents than free space may signal a problem unless the tablespace can automatically extend to accommodate the object’s next extent.

U

SER

S

PACE

T

AB

The User Space tab includes the following sections:

Top Space User Accounts

User Space Detail

T

OP

S

PACE

U

SER

A

CCOUNTS

It is vital that a DBA know how the various accounts assigned to a database consume space. This is true in either production or development databases, because even in development databases, space can become an issue that causes major headaches. If development accounts are creating and cloning many objects without removing them, the result can be a lot of wasted space.

The Top Space User Accounts statistic shows how much total allocated space the top twenty accounts possess in the database.

Location

Metrics

Oracle Performance Analyst Statistics >

Space >

User Space Tab

Seeing owner account with larger than expected data volumes could warrant further investigation. In addition, seeing accounts that have objects in more tablespaces than they have quota's for should also cause you to examine their account more closely to ensure the correct space privileges are in place.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1115

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

U

SER

S

PACE

D

ETAIL

The User Space Detail section allows you to drill-down and see the specifics of the Top Space

User accounts.

Location

Oracle Performance Analyst Statistics >

Space >

User Space Tab

O

BJECTS

In addition to a Home

page, the Objects category of Oracle Performance Analyst includes the following tabbed pages:

Invalid Objects Tab

Objects Summary Tab

Hot Objects Tab

Tables/Indexes in Same Tablespace

Tab

H

OME

The Objects Home page includes the following sections:

Bottleneck Analysis Pane

Key Ratio Analysis Pane

Object/Buffer Pool Placement Pane

User Object Analysis Pane

SQL Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Object-related database activity can be examined using both ratio-based and wait/bottleneckbased analysis. Ratio-based analysis involves examining a number of key database ratios and statistical readings that can be used to indicate how active certain object types are. Performance ratios serve as roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis.

When using ratio-based analysis, there are some standards to adhere to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that you examine come from the v$sysstat performance view. The performance view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and impacts how a particular ratio is interpreted. However, if delta statistics are used

(taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual ‘personality’ with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead you to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

11 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The following ratios are used on the Performance Analyst Objects home page to succinctly communicate the general session-based performance levels of the monitored database:

Active Rollback Ratio Chained Row Fetch Ratio

The following satistic, available on this pane, duplicates a statistic available on the Key Ratio

Analysis Pane

of the

Home

page:

Rollback Contention Ratio

A

CTIVE

R

OLLBACK

R

ATIO

To undo changes made to the Oracle database from within a transaction, Oracle writes data to individual rollback segments. You can also use these to maintain read consistency for multiple users of modified data. Because Rollback Segments read and write data, they can become very hot areas for I/O. This statistic is a ratio that displays the percentage of rollback segments currently involved in work.

Seeing consistent ratios of 80% or higher could indicate the need for more rollback segments on the database.

Location

Oracle Performance Analyst Statistics >

Objects > Home > Key Ratio Analysis Pane

Correction If you are using Oracle8i or earlier, begin by creating new rollback segments and altering them to be online for use. Then monitor the overall active rollback ratio to see if it begins to drop.

For Oracle9i or later, consider the use of UNDO management, which is where Oracle itself automatically manages rollback segments in special UNDO tablespaces.

C

HAINED

R

OW

F

ETCH

R

ATIO

In normal circumstances, a row of data should fit completely inside one Oracle block.

Sometimes, however, this is not the case and the table suddenly contains chained or migrated rows (rows that span more than one data block).

Chaining occurs when a row is initially too large to fit inside one block. Two or more blocks are used by Oracle to hold the row. Migration deals with rows that have grown so much that they can no longer be contained within their original block. When this occurs, Oracle relocates the row out of its original block into another block, but leaves a pointer behind to indicate the relocation.

Both chaining and migration force Oracle to perform more than one I/O to retrieve data that could normally be obtained with a single I/O operation, with the end result being degraded performance.

The chain row fetch ratio statistic represents the percentage of rows fetched that were of either the chained or migrated row type.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects > Home > Key Ratio Analysis Pane

If the amount of chained rows in your tables exceeds 25-30%, you should take steps to eliminate the problem. Further, if the amount of chained rows accessed in your system vs. total rows accessed approaches 20-30%, you can start the process of eliminating the chained and migrated rows.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1117

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction

You can locate tables that contain chained rows. Once found, there are a couple of ways to reorganize tables to remove the chaining/migration problem. However, the best way to deal with chained and migrated rows is to prevent them from occurring. The table below describes two methods:

Method

Use a large block size

Description

Because chaining and migrations occur when the Oracle block is too small to hold the rows in question, make sure you are using a large enough block size for each database you create. An

8KB block size or higher is normally recommended to help stave off chained and migrated rows. If you are using Oracle9i or later, you can create special tablespaces that have larger block sizes (16-32KB) than the overall database block size and place any table that is a candidate for chained/migrated rows into them.

Use proper values of

PCTFREE for tables

The necessary amount of percent free in a table helps prevent row migrations from occurring.

If you have a database that houses rows with the potential to grow substantially over their initially inserted size, provide a liberal amount of PCTFREE for each of your tables.

B

OTTLENECK

A

NALYSIS

P

ANE

When using bottleneck analysis to troubleshoot a database, you cannot rely only on the information contained in the wait event views that Oracle provides. For example, an object attempts to extend into another extent of space in a tablespace and yet be denied if no such free space exists. Such a failure is not reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that you cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Objects home page displays object-related bottlenecks decreases the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Objects home page to communicate the general overall conditions of objects in the monitored database:

Chained Tables

Locked Objects

Session Blocks

Table High Water Mark Problems

Invalid/ Objects

Tables/Indexes in Same Tablespace

The following statistics, available on this pane, duplicate statistics available on the

Top Session

Bottlenecks

of the

Home page:

Enqueue Waits

Objects with No Room to Expand

Free List Waits

Objects at Maximum Extents

C

HAINED

T

ABLES

A row of data should fit completely inside one Oracle block. Sometimes, a table suddenly contains chained or migrated rows, which are rows that span more than one data block.

11 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Chaining occurs when a row is initially too large to fit inside one block. Two or more blocks are used by Oracle to hold the row. Migration deals with rows that have grown so much that they can no longer be contained within their original block. Oracle relocates the row out of its original block into another block, but leaves a pointer behind to indicate the relocation.

Both chaining and migration force Oracle to perform more than one I/O to retrieve data that could normally be obtained with a single I/O operation, with the end result being degraded performance.

The Chained Tables statistic identifies the number of tables in the database that contain chained or migrated rows.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Seeing many chained/migrated tables could indicate a database whose block size is undersized.

However, even one chained/migrated row table can be a problem if that table is an often-referenced or scanned table.

Correction

You can locate the actual tables that contain chained/migrated rows. Once found, there are a couple of ways to reorganize tables to remove the chaining/migration problem. However, the best way to deal with chained and migrated rows is to prevent them from occurring. The table below describes two methods:

Method

Use a large block size

Use proper values of

PCTFREE for tables

Description

Because chaining and migrations occur when the Oracle block is too small to hold the rows in question, make sure you are using a large enough block size for each database you create. An

8KB block size or higher is normally recommended to help stave off chained and migrated rows. If you are using Oracle9i or later, you can create special tablespaces that have larger block sizes (16-32KB) than the overall database block size and place any table that is a candidate for chained/migrated rows into them.

The necessary amount of percent free in a table helps prevent row migrations from occurring.

If you have a database that houses rows with the potential to grow substantially over their initially inserted size, provide a liberal amount of PCTFREE for each of your tables.

For more information, see

Bottleneck Analysis Pane .

S

ESSION

B

LOCKS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Although Oracle supports unlimited row-level locking, blocking lock situations do crop up. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

NOTE:

This statistic is also called Current Object Blocks

on the Home

page, and Sessions

Blocked

on the Users Home page.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Investigate any indicator above zero immediately before the situation has a chance to mushroom.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1119

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction Once discovered, a blocking lock situation can normally be quickly remedied. You can issue a KILL against the offending process, which eliminates the user's hold on the objects they were accessing.

Other user processes then almost always complete in an instant. Discovering the blocked lock situation is eased by using tools like Performance Analyst, but preventing the blocking lock situation

in the first place is more difficult. You can look at the Users

detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. Most DBAs who have had to face

Oracle Forms applications have suffered through the dreaded SELECT … FOR UPDATE statements that place unnecessary restrictive locks on nearly every read operation, and know all too well that good coding practice is important. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

I

NVALID

/ O

BJECTS

Objects like procedures, packages, functions, triggers, and views can become invalidated for a variety of reasons. The main cause is generally a dependent object that has been altered or removed from the system. However, other objects, like indexes, can become invalid also due to scenarios like SQL*Loader problems. If an object that has become invalid is still referenced

(through an application or SQL query tool), a variety of problems can result. Sometimes Oracle reports a clear error stating the problem, while other times seemingly odd behavior is exhibited by the database.

Location

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Metrics There is no reason to have invalid objects in a production database. If your production databases have invalid objects that are no longer needed, promptly remove them from each system. Any needed objects that are indicating an invalid status should quickly be fixed before access problems develop.

It is very normal for development databases to have invalid objects because developers create, modify, and compile objects all the time. The only invalid object that really should not be present in either a development or production database is an invalid index.

Correction If code objects have become invalidated, you can issue an ALTER … COMPILE command to see if they compile properly and become valid once again. If they do not, then check the USER_ERRORS view for any resulting error messages. Indexes can be validated once more by using the ALTER INDEX

… REBUILD command.

L

OCKED

O

BJECTS

Locked Objects is a count of all objects on the system that currently have some form of lock against them.

NOTE:

Drilling down into the count of locked objects displays detail on each object that is locked, along with the user process holding the lock and the type of lock held.

Location

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

11 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

ABLE

H

IGH

W

ATER

M

ARK

P

ROBLEMS

One form of object fragmentation revolves around what is called a table's high water mark.

Tables that are the victim of much insert-delete activity can develop performance problems due to wasted space being present. A table's high-water mark equals the last block in the table that was used to hold data. The problem in Oracle is that this high-water mark is not reset by DELETE activity, so it is possible for a table to have absolutely no data in it but contain a high-water mark that is many blocks high. When such a table is scanned, Oracle will read up to the high-water mark even if no rows exist in the table at all. This can make for some unnecessarily large scan

times. For a real world example, see Bottleneck Analysis Pane

.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Seeing non-zero numbers for this metric could indicate that table scans are taking longer than they should.

Correction Performance Analyst does not currently provide diagnostics that identify the actual tables that contain artificially inflated high water marks. Embarcadero Space Analyst provides all the levels of detail regarding table high water marks plus a reorganization wizard that can reset the high water mark and thereby improve performance of table scans against tables suffering from this problem.

T

ABLES

/I

NDEXES IN

S

AME

T

ABLESPACE

One common Oracle practice is to physically separate tables and their child indexes onto distinct physical drives or file systems. Doing so reduces the potential for I/O contention when each object is accessed. The Tables/Indexes in Same Tablespace statistic displays a count of all tables whose index(es) reside in the same tablespace as they do.

Location

Oracle Performance Analyst Statistics >

Objects > Home

> Bottleneck Analysis Pane

Metrics For development databases where performance is not an issue, seeing high counts of this metric is not an issue. Even on production systems, high counts of this metric may not be a problem, or cannot be avoided, if the server is configured with one large RAID5 disk configuration, each distinct drive or file system does not have its own controller, or there simply are not enough disks on the server to perform adequate object striping.

Correction If the server is configured to allow for intelligent object striping, and you see a large count of tables and indexes that are housed in the same tablespace, you can:

Create a separate tablespace for indexes on a drive different than that used for tables, and perform an ALTER INDEX … REBUILD operation on all indexes to move them to the new tablespace. Certain versions of Oracle even allow the rebuild operation to occur online (using the ONLINE keyword of the

REBUILD command).

Use the export/import utility to move indexes to a new tablespace.

Use the ALTER TABLE … MOVE command to move tables to a new tablespace in Oracle8i and later.

Index-organized tables can be moved online.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1121

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

SQL A

NALYSIS

P

ANE

Certain objects in an Oracle database are accessed more than others. These objects can become a source of contention given certain conditions. The SQL Analysis section of the

Objects home page identifies the most accessed tables on the database.

Metrics DML activity against tables can cause contention for space management objects like free lists.

Oracle9i or later provides automatic segment management, which can remove problems with free lists and the like.

O

BJECT

/B

UFFER

P

OOL

P

LACEMENT

P

ANE

Because data objects can be referenced with different types of usage patterns, Oracle8 offers the option to intelligently place objects into one of three buffer caches. The table below describes the buffer caches:

Buffer Cache

KEEP

RECYCLE

DEFAULT

Description

Designed to minimize misses in the buffer cache. Small objects that are frequently referenced are candidates for the KEEP buffer pool.

Designed to avoid having large numbers of infrequently accessed blocks of data crowd out objects that need to be referenced in RAM, the RECYCLE pool is good for large objects that are scanned from beginning to end without the need for keeping all their data in RAM.

The traditional cache for all other data objects.

NOTE:

Unless you specify the KEEP or RECYCLE buffer cache, Oracle automatically places objects into the DEFAULT buffer cache.

The Object/Buffer Pool Placement section identifies how many objects are currently assigned to the various caches.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects > Home

> SQL Analysis Pane

When looking at overall database I/O activity, you should keep an eye out for objects that you can place into a particular buffer cache. Consider using a KEEP cache for relatively small, frequently accessed tables that require fast response times. Large tables with random I/O activity and are scanned from beginning to end are good candidates for a RECYCLE cache.

Correction Objects can be placed into different buffer pools at object creation time (using the STORAGE...

BUFFER_POOL option in Oracle8 or later) or existing objects can be set into a different pool with the

ALTER command.

NOTE: Tables, partitions, and indexes can be placed into the different caches.

If you just want to use the DEFAULT buffer pool and not enable any special caches, you can still encourage Oracle to keep certain objects in the cache as long as possible using the CACHE parameter. For example, issuing the command ALTER TABLE…CACHE specifies that the blocks retrieved for a table be placed at the most recently used end of the LRU list in the DEFAULT buffer cache when a full table scan is performed. You can also use the CACHE hint in SQL statements to cache a table, but used in this form, the blocks are only cached until the next time the database is shut down.

11 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

U

SER

O

BJECT

A

NALYSIS

P

ANE

All objects are created inside of user accounts called schema. The User Object Analysis section of the Performance Analyst Objects home page shows schema that are ranked the worst in the several categories. The table below lists the categories:

Worst Schema for

Chained Row Tables

Invalid Objects

Extent Problems

Description

The schema containing the most tables with chained rows is identified.

The schema containing the most invalid objects is identified.

The schema containing the most objects with maximum extent limit or extent space deficit problems is identified.

Correction To determine the degree and severity of each type of problem, go into detailed views that present specific information for each type of object problem.

H

OT

O

BJECTS

T

AB

The Hot Objects tab includes the following sections:

• Hot Code

• Hot Tables

H

OT

T

ABLES

Certain objects in an Oracle database are accessed more than others. These objects can become a source of contention given certain conditions. The Hot Tables section identifies tables that are being frequently accessed through various SQL statements. The table below describes the information available in this section:

Column

Table Owner

Table Name

Issued Command

Executions

Disk Reads

Buffer Gets

Rows Processed

Description

The owner of the table.

The name of the table.

The SQL statement command issued against the table.

The number of SQL executions the object has experienced.

The number of estimated disk reads from the object.

The number of estimated logical I/Os from the object.

The number of estimated rows processed from the object.

Location

Oracle Performance Analyst Statistics >

Objects >

Hot Objects Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1123

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics DML activity against tables can cause contention for space management objects like free lists.

Oracle9i and later provides automatic segment management, which can remove problems with free lists and the like.

H

OT

C

ODE

Certain objects in an Oracle database are accessed more than others. Data objects can become a source of contention given certain conditions, while code objects rarely cause contention issues. The Hot Code section identifies code objects (procedure, functions, etc.) that are being frequently accessed through various SQL statements. The table below describes the information available in this section:

Column

Object Owner

Object Name

Object Type

Executions

Loads

Locks

Pins

Description

The owner of the object.

The name of the objects.

The type of object (package, etc.).

The number of estimated executions for the object.

The number of times the object was loaded into the shared pool.

The number of locks the object has experienced.

The number of times the object was pinned in the shared pool.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects >

Hot Objects Tab

Often referenced code objects should be pinned in the shared pool using the Oracle

DBMS_SHARED_POOL package. This can also be done through DBArtisan’s pinned code utility.

Objects with many executions and loads should be considered candidates for pinning.

I

NVALID

O

BJECTS

T

AB

The Invalid Objects tab includes the following sections:

Invalid Objects Detail

Invalid Objects Summary

I

NVALID

O

BJECTS

S

UMMARY

Objects like procedures, packages, functions, triggers, and views can become invalidated for a variety of reasons, with the main cause being a dependent object that has been altered or removed from the system. However, other objects, like indexes, can become invalid also due to scenarios like SQL*Loader problems. If an object that has become invalid is still referenced

(through an application or SQL query tool), a variety of problems can result. Sometimes Oracle will report a clear error stating the problem, while other times seemingly quirky behavior will be exhibited by the database. In any event, as a DBA you should be on the lookout for objects in your database that have suddenly become invalid.

11 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The Invalid Objects Summary section displays a count of the various objects in the database that are invalid.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects >

Invalid Objects Tab

There is no reason to have invalid objects in a production database. If your production databases have invalid/unusable objects that are no longer needed, you should promptly remove them from each system. Any needed objects that are indicating an invalid status should quickly be fixed before access problems develop.

Correcting invalid objects like procedures and views often involves performing an ALTER…COMPILE operation. If the object status does not return to VALID, then further examination is warranted.

It is very normal for development databases to have invalid objects because developers will no doubt be creating, modifying, and compiling objects all the time. The only invalid object that really should not be present in either a development or production database is an invalid index.

I

NVALID

O

BJECTS

D

ETAIL

Objects like procedures, packages, functions, triggers, and views can become invalidated for a variety of reasons, with the main cause being a dependent object that has been altered or removed from the system. However, other objects, like indexes, can become invalid also due to scenarios like SQL*Loader problems. If an object that has become invalid is still referenced

(through an application or SQL query tool), a variety of problems can result. Sometimes Oracle will report a clear error stating the problem, while other times seemingly quirky behavior will be exhibited by the database. In any event, as a DBA you should be on the lookout for objects in your database that have suddenly become invalid.

The Invalid Objects Detail section displays information concerning invalid objects. The table below describes the information available in this section:

Column

User Account

Object Name

Object Type

Created On

Last DDL Date

Description

The user account that owns the objects.

The name of the invalid object.

The type of object (procedure, view, etc.).

The timestamp of when the objects was created.

The last structural modification date for the object.

Location

Metrics

Oracle Performance Analyst Statistics >

Objects >

Invalid Objects Tab

There is no reason to have invalid objects in a production database. If your production databases have invalid objects that are no longer needed, you should promptly remove them from each system.

Any needed objects that are indicating an invalid status should quickly be fixed before access problems develop.

Correcting invalid objects like procedures and views often involves performing an ALTER…COMPILE operation. If the object status does not return to VALID, then further examination is warranted.

It is very normal for development databases to have invalid objects because developers will no doubt be creating, modifying, and compiling objects all the time. The only invalid object that really should not be present in either a development or production database is an invalid index.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1125

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

O

BJECTS

S

UMMARY

T

AB

The Objects Summary tab includes the following sections:

Section

Global Summary

User Summary

Description

This section displays a count of all user objects in the database (minus SYS and SYSTEM objects).

This section displays a count across user accounts of all the major object types in the database. NOTE SYS and SYSTEM accounts are not included.

T

ABLES

/I

NDEXES IN

S

AME

T

ABLESPACE

T

AB

To help avoid physical I/O contention, it is wise to separate a table and its indexes onto separate physical drives. This is normally accomplished by putting tables into one tablespace (whose datafiles exist on one drive) and their indexes into a different tablespace (whose datafiles exist on another drive).

The Tables/Indexes in Same Tablespace tab identifies indexes whose tables reside in the same tablespace as they do. The table below describes the information available in this section:

Column

Table Owner

Table Name

Index Name

Tablespace Name

Description

The owner of the table.

The name of the table.

The name of the index that resides in the same tablespace as the table.

The name of the tablespace.

Metrics If tables and indexes are found in the same tablespace, then either the table or index should be moved to a different tablespace if the server is set up in such a way that different drives and controllers are available that make the relocation worthwhile.

Indexes are traditionally easier to move than tables. They can be relocated through many reorganization tools (like Embarcadero Space Analyst) or through the manual use of the ALTER INDEX

… REBUILD command.

OS

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O, or Memory), a slow CPU, insufficient or slow I/O devices, and insufficient memory. The OS Statistics page of Performance

Analyst lets you examine operating system metrics for the following platforms:

• AIX

11 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• HP-UX

NOTE:

To view processor info and swap disk info on an HP-UX box, you need to login as ROOT in the OS login.

• Linux

• Solaris

• Unix

• Windows XP and 2000

NOTE:

The statistics available on the OS page depend on the operating system platform.

TIP:

If you magnify a graph to change back to the original size or minimize the size, close the OS Page and then reopen it again. Performance Analyst displays the graph in its original form and size.

In addition to a Home

page, the OS category of Oracle Performance Analyst includes the following tabbed pages:

CPU Tab

Network Tab

I/O Tab

Processes Tab

Memory Tab

Location

H

OME

The OS Home page includes the following sections:

Bottleneck Analysis Pane

Memory Analysis Pane

Disk Analysis Pane

Workload Analysis Pane

Key Resource Usage Pane

K

EY

R

ESOURCE

U

SAGE

P

ANE

The following ratios are used on the Performance Analyst OS home page to communicate the general overall performance levels of the operating system:

Disk Time

Paged Memory Used

(Windows)

Load Average

Swap Memory Used (AIX, HP-UX,

Linux, Solaris, Unix)

Processor Time

TIP:

To open the CPU tab, right-click Processor Time. To open the I/O tab, right-click Disk

Time. To open the Memory tab, right-click Paged Memory Used.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1127

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

D

ISK

T

IME

The Disk Time statistic is the percentage of elapsed time that the selected disk drive/device was busy servicing read or write requests.

Location

Oracle Performance Analyst Statistics >

OS >

Home > Key Resource Usage Pane

Metrics You should avoid consistently seeing values for this statistic greater then 90%.

Correction Add more disk drives and partition the files among all of the drives.

L

OAD

A

VERAGE

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home > Key Resource Usage Pane

High load averages usually mean that the system is being used heavily and response time is correspondingly slow.

P

ROCESSOR

T

IME

The Processor Time statistic indicates the percentage of time the processor is working. This counter is a primary indicator of processor activity.

Location

Oracle Performance Analyst Statistics >

OS >

Home > Key Resource Usage Pane

Metrics If your computer seems to be running sluggishly, this statistic could be displaying a high percentage.

Correction Upgrade to a processor with a larger L2 cache, a faster processor, or install an additional processor.

P

AGED

M

EMORY

U

SED

The Paged Memory Used statistic is the ratio of Commit Memory Bytes to the Commit Limit.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk. The commit limit is determined by the size of the paging file. As the paging file increases, so does the commit limit.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home > Key Resource Usage Pane

This value displays the current percentage value only and not an average. If the percentage of paged memory used is above 90%, you may be running out of memory.

Correction Increase the size of page file.

S

WAP

M

EMORY

U

SED

The Swap Memory Used statistic is the percentage of swap space currently in use.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home > Key Resource Usage Pane

If the percentage of swap memory used is above 90%, you may be running out of memory.

11 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction Increase the size of your swap files.

B

OTTLENECK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Average Disk Queue Length Interrupts/Sec

Processor Queue Length

Available Physical Memory

Processor Queue Length

Network Output Queue Length/

Network Queue Length

Processor Speed

TIP:

To open the I/O tab, right-click any Details menu item. To open the CPU tab, right-click the Item Processor Queues Length Details menu item. To open the Network tab, rightclick Network Output Queues Length.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VERAGE

D

ISK

Q

UEUE

L

ENGTH

The Average Disk Queue Length statistic is the average number of both read and write requests that were queued for the selected disk during the sample interval.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

This metric is useful in identifying I/O related bottlenecks. If the disk queue lengths for certain disks are consistently much higher than others, you may need to redistribute the load among available disks. If the disk queues lengths for all disks are consistently large, and you see a high amount of I/O activity, your disks may be inefficient.

Correction Some things you can do if you have problems with this statistic include:

Redistribute the data on the disk with the large average disk queue to other disks.

Upgrade to faster disk(s).

I

NTERRUPTS

/S

EC

Interrupts/Sec is the average rate, in incidents per second, at which the processor received and serviced hardware interrupts. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards, and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended. The system clock typically interrupts the processor every 10 milliseconds, creating a background of interrupt activity. This statistic shows the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

Oracle Performance Analyst Statistics >

OS >

CPU Tab

A high value indicates possible excessive hardware interrupts; justification is dependent on device activity.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1129

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

N

ETWORK

O

UTPUT

Q

UEUE

L

ENGTH

/N

ETWORK

Q

UEUE

L

ENGTH

The Network Output Queue Length statistic is the number of threads in the processor queue.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

P

AGE

F

AULTS

/S

EC

The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Metrics This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction If the number of page faults remains consistently high, you can check with your Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

P

ROCESSOR

Q

UEUE

L

ENGTH

The Processor Queue Length statistic is the number of threads in the processor queue.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

Oracle Performance Analyst Statistics >

OS >

CPU Tab

Metrics Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

11 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

ROCESSOR

S

PEED

The Processor Speed statistic displays the speed of the active processor in MHz. The speed is approximate.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

P

ROCESSOR

The Processor Statistic displays the type of processor currently in use, for example, GenuineIntel.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Bottleneck Analysis Pane

M

EMORY

A

NALYSIS

P

ANE

The following metrics are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Available Paged Memory

(Windows)

Available Physical Memory

Available Swap Memory (AIX, HP-

UX, Linux, Solaris, Unix)

Total Paged Memory/Total Swap

Memory

Total Physical Memory

TIP:

To open the Memory tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VAILABLE

P

AGED

M

EMORY

The Available Paged Memory statistic shows the amount of virtual memory available for the processes.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Memory Analysis Pane

If the available virtual memory is less than 10% of the total virtual memory, your system may run out of memory.

Correction Increase the size of page file.

A

VAILABLE

P

HYSICAL

M

EMORY

The Available Physical Memory statistic represents the amount of RAM available to all processes.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Memory Analysis Pane

This counter displays the last observed value only and not an average. Use this value with the Total physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1131

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction Some things you can do if you have problems with this statistic include:

Check the running processes to see if there are any memory leaks.

Stop any services that are not required.

Install additional RAM.

A

VAILABLE

S

WAP

M

EMORY

The Available Swap Memory statistic represents the amount of virtual memory available for the processes.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Memory Analysis Pane

If the available Available Swap Memory is less than 10% of the total Swap Memory, your system may run out of memory.

Correction Increase the size of swap files.

T

OTAL

P

AGED

M

EMORY

/T

OTAL

S

WAP

M

EMORY

The Total Paged Memory statistic shows the maximum amount of virtual memory available to all processes.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Memory Analysis Pane

It is recommended that this be 1½ - 3 times the amount of RAM on the system.

T

OTAL

P

HYSICAL

M

EMORY

The Total Physical Memory statistic shows the amount of physical memory installed on your computer.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Memory Analysis Pane

This is an informational metric and displays the total amount installed on the machine. Use this value with the available physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

D

ISK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Free Disk Space Total Disk Space Used Disk Space

TIP:

To open the Space tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

11 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

F

REE

D

ISK

S

PACE

The Free Disk Space statistic shows the unallocated space, in megabytes on all logical disk drives.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Disk Analysis Pane

Correction There are many ways to ensure a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

U

SED

D

ISK

S

PACE

The Used Disk Space statistic shows the amount of allocated space, in megabytes on all logical disk drives.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Disk Analysis Pane

Correction There are many ways to ensure a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

T

OTAL

D

ISK

S

PACE

Total Disk Space displays the total allocated and unallocated space, in megabytes on all logical disk drives.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1133

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

W

ORKLOAD

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Number of Logins

Top I/O Process

Number of Processes

Top Memory Process

Top CPU Process

TIP:

To open the Processes tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

N

UMBER OF

L

OGINS

This statistic displays the total number of logins on the server.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Workload Analysis Pane

N

UMBER OF

P

ROCESSES

This statistic displays the total number of processes on the server.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Workload Analysis Pane

T

OP

M

EMORY

P

ROCESS

Top Memory Process shows the current process that is consuming the most amount of memory.

The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Workload Analysis Pane

If you are running out of memory on the system, this is a quick way to identify the top memory user. If the displayed process is using a significant portion of the total memory, it could be causing the memory issues.

T

OP

CPU P

ROCESS

Top CPU Process shows the current process that is consuming the most amount of CPU. The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Home

> Workload Analysis Pane

If the amount of CPU time used by this process is close to 100% and the CPU usage is very high, this process may be the bottleneck on the server.

11 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction Investigate the process further to see if it is in an inconsistent state. Also, look at minimum requirements for CPU speed for the process. You may need to upgrade your CPU.

T

OP

I/O P

ROCESS

The Top I/O Process statistic shows the current process that is consuming the most amount of

CPU. The information displayed is dependent on the platform of the operating system.

Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major

Page Faults, and the amount of I/O expressed in KB/sec.

Location

Oracle Performance Analyst Statistics >

OS >

Home

> Workload Analysis Pane

CPU T

AB

The CPU tab of the OS Detail includes the following sections:

Context Switches/Sec

Load Averages

CPU Events

CPU Utilization

The following statistics available on this tab, are duplicates of statistics available on the

Bottleneck Analysis Pane

of the OS

Home

page:

Interrupts/Sec

Processor Queue Length

NOTE:

The sections available on this tab depend on the platform of operating system.

CPU U

TILIZATION

The CPU Utilization section includes the following information:

% Privileged Time % User Time

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1135

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

% P

RIVILEGED

T

IME

The % Privileged Time statistic is the percentage of elapsed time that the process threads spent executing code in privileged mode.

NOTE:

For Windows systems, when a Windows system service is called, the service will often run in privileged mode to gain access to system-private data. Such data is protected from access by threads executing in user mode. Calls to the system can be explicit or implicit, such as page faults or interrupts. These kernel commands, are considered privileged to keep the low-level commands executing and prevent a system freeze.

Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. Some work done by Windows on behalf of the application might appear in other subsystem processes in addition to the privileged time in the process.

Location

Oracle Performance Analyst Statistics >

OS >

CPU Tab

Metrics The ideal range should be 0-40% (less than 40% indicates excessive system activity).

Correction If your CPU consistently runs at less than 40% you may need to upgrade your system to include a faster processor(s).

% U

SER

T

IME

The % User Time statistic is the percentage of elapsed time the processor spends in the user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory. The operating system switches application threads to privileged mode to access operating system services. This counter displays the average busy time as a percentage of the sample time.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

CPU Tab

If the Privileged Time is high in conjunction with Physical Disk Reads, consider upgrading the disk I/O subsystem.

CPU E

VENTS

The CPU Events section includes the following information:

Context Switches/Sec Load Averages System Calls/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

11 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

ONTEXT

S

WITCHES

/S

EC

The Context Switches/Sec section shows the combined rate at which all processors on the computer are switched from one thread to another. Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

CPU Tab

The ideal range should be between 0-10,000. GA number greater then 10,000 may indicate too many threads contending for resources.

S

YSTEM

C

ALLS

/S

EC

System calls are functions which require the services of the operating system. Usually they involve access to some data that users must not be permitted to corrupt or even change.

Location

Oracle Performance Analyst Statistics >

OS >

CPU Tab

Correction Try to find a good ratio between the amount of time the operating system runs (fulfilling system calls and doing process scheduling), and the amount of time the application runs. Your goal should be running 60% to 75% of the time in application mode, and 25% to 40% of the time in operating system mode. If you find that the system is spending 50% of its time in each mode, then you should investigate to determine what is wrong.

L

OAD

A

VERAGES

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

CPU Tab

High load averages usually mean that the system is being used heavily and the response time is correspondingly slow.

P

ROCESSES

T

AB

The Processes tab of the OS Detail page succinctly communicates the general overall performance levels of processes. The columns available in this table depend on the platform of operating system. The table below describes the information available in the table on this tab:

Column

Process

User

ID

CPU

Description

The name of the process.

The user of the process.

The ID Process is the unique identifier of this process. ID Process numbers are reused, so they only identify a process for the lifetime of that process.

The CPU is the percentage of elapsed time that all of process threads used the processor to execution instructions.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1137

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Column

User Mode

Memory WINDOWS

ONLY

Memory (MB)

Memory

Active Memory

Description

The User Mode is the percentage of elapsed time that the process threads spent executing code in user mode.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the percentage of the memory used of the total memory.

I/O Data

Active Memory is the amount of committed virtual memory, in bytes for this process. Active memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive. This counter displays the last observed value only; it is not an average.

The rate at which the process is reading and writing bytes in I/O operations. This counter counts all I/O activity generated by the process to include file, network and device I/Os.

Elapsed Time

Thread Count

Handle Count

Priority

The total elapsed time, in seconds, that this process has been running.

The number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread.

The total number of handles currently open by this process. This number is equal to the sum of the handles currently open by each thread in this process.

The current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process' base priority.

Creating Proc ID

Page Faults/Sec

Page File

Private

The Creating Process ID value is the Process ID of the process that created the process. The creating process may have terminated, so this value may no longer identify a running process.

Page Faults/Sec is the rate at which page faults by the threads executing in this process are occurring. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This may not cause the page to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with whom the page is shared.

Page File is the current number of kilobytes that this process has used in the paging file(s).

Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and the lack of space in paging files can prevent other processes from allocating memory.

Private is the current size, in kilobytes, of memory that this process has allocated that cannot be shared with other processes.

I/O T

AB

The sections available on this tab depend on the platform of operating system. The I/O tab includes the following sections:

Bytes per I/O Operation

Disk I/O Time

Average Disk Queue/Total Disk

Queue

Disk Transfers/Sec

I/O Details Transfer Rate

11 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

I/O D

ETAILS

The table below describes the information available in this section:

Column

Disk

Reading (KB/s)

Writing (KB/s)

Disk Read Time

Disk Write Time

Disk Time

Avg. Read Queue

Avg. Write Queue

Disk Reads/Sec

Disk Writes/Sec

Description

The disk number assignment.

The amount of bytes read from the device.

The amount of bytes written to the device.

Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.

Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Disk Time is the percentage of elapsed time that the selected disk was busy servicing requests.

Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.

Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.

Disk Reads/Sec is the rate of read operations on the disk.

Disk Writes/Sec is the rate of write operations on the disk.

NOTE:

The columns available in this table depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

T

RANSFER

R

ATE

The Transfer Rate section succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Description

The average number of bytes transferred from the disk during read operations.

Writing The average number of bytes transferred to the disk during write operations.

Transferred The amount of time required to transfer the data between the device's cache and the actual device media.

Metrics

It is measured in number of KBs per second.

It is measured in number of KBs per second.

N/A

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1139

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

B

YTES PER

I/O O

PERATION

The Bytes per I/O Operation section of the OS Detail succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Writing

Description

The average number of bytes transferred from the disk during read operations.

The average number of bytes transferred to the disk during write operations.

Metrics

It is measured in number of bytes per second.

It is measured in number of bytes per second.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

A

VERAGE

D

ISK

Q

UEUE

/T

OTAL

D

ISK

Q

UEUE

The Average Disk Queue section of the OS Detail page succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Average Read Queue

Average Write Queue

Average Queue

Description

Average Read Queue Length is the average number of read requests that were queued for a particular disk.

Average Write Queue is the average number of write requests that were queued for a particular disk.

Average time in ms. to service I/O requests which for disks includes seek, rotational latency and data transfer time).

Information

Sustained loads on any of the disk queue lengths could represent problems within your system.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Windows System

Administrator for assistance in troubleshooting these problems.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Unix System

Administrator for assistance in troubleshooting these problems.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

Correction Contact your Windows System Administrator for assistance in troubleshooting these problems.

11 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

D

ISK

I/O T

IME

The Disk I/O Time section of the OS Detail page succinctly communicates the general overall performance levels of the disk’s I/O. The table below describes the statistics in this section:

Statistic

% Disk Read Time

% Disk Write Time

% Disk Time

Description

% Disk Read Time is the percentage of time during the sample interval that the disk is busy servicing read requests.

% Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Metrics

Use this in conjunction with the % Disk Write

Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Use this in conjunction with the % Disk Read

Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

% Disk Time is the percentage of time during the sample interval that the disk is busy servicing requests.

Use this statistic to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

D

ISK

T

RANSFERS

/S

EC

The Disk Transfers/Sec section of the OS Detail page succinctly communicates the general overall performance levels of the disk transfers. The table below describes the statistics in this section

Statistic

Reads/Sec

Writes/Sec

Transfers/Sec

Description

The the rate of read operations on the disk.

The rate of write operations on the disk.

The rate of transfer operations per second.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

I/O Tab

M

EMORY

T

AB

The Memory tab of the OS Detail page includes the following sections:

Buffer Size

Page Replacements

Cache Efficiency

Paging Activity

Cache Size

Page Replacements

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1141

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

The following statistic, available on this tab, duplicates astatistic available on the

Bottleneck

Analysis Pane

of the

OS

Home page:

Page Faults/Sec

NOTE:

The sections available on this tab depend on the platform of operating system.

B

UFFER

S

IZE

The Buffer Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

C

ACHE

E

FFICIENCY

The Cache Efficiency section of the Memory tab succinctly communicates the general overall performance levels of the server's memory. The following statistics are available in this section:

Copy Read Hits %

Pin Read Hits %

Data Map Hits %

MDL Read Hits %

C

OPY

R

EAD

H

ITS

%

The Copy Read Hits % statistic is the percentage of cache copy read requests that hit the cache and does not require a disk read to provide access to the page in the cache.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

When the page is pinned in the memory, the page's physical address in the file system cache will not be altered. A copy read is a file read operation where a page in the cache is copied to the application's buffer. Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate

D

ATA

M

AP

H

ITS

%

The Data Map Hits % statistic is the percentage of data maps in the file system cache that could be resolved without having to retrieve a page from the disk.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

11 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

MDL R

EAD

H

ITS

%

The MDL Read Hits % statistic is the percentage of Memory Descriptor List Read requests to the file system cache that hit the cache and does not require disk access to provide memory access to the pages in the cache.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

P

IN

R

EAD

H

ITS

%

The Pin Read Hits % statistic is the percentage of pin read requests that hit the file system cache and does not require a disk read in order to provide access to the page in the file system cache.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

C

ACHE

S

IZE

The Cache Size statistic represents the amount of cache used by the kernel in kilobytes.

M

EMORY

A

VAILABLE

The Memory Available section of the OS Detail page succinctly communicates the general overall performance levels of the server's memory. The statistics available in this section depend on the platform of operating system. The table below describes these statistics:

Statistic Description

Physical

Memory

Physical

The Physical Memory statistic is the amount of committed virtual memory, in megabytes. Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk.

The Physical statistic is the total physical memory available.

Paged Memory The Paged Memory statistic is the amount of committed virtual memory, in bytes.

Used Memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive.

N/A

Metrics

This counter displays the last observed value only and not an average.

Troubleshooting

N/A

N/A

This counter displays the last observed value only; it is not an average.

N/A

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1143

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Statistic Description

Swap Memory The Swap Memory statistic is the free, unreserved swap space.

Metrics

N/A

Troubleshooting

Increase the size of your swap file or add additional files if you consistently see a shortage of free, unreserved swap space.

N/A Swap

Total Physical

Total Swap

The Swap statistic is the total swap memory being used.

N/A

N/A The Total Physical statistic is the total physical memory available.

The Total Swap statistic is the total swap memory available.

N/A

N/A

N/A

Swap-ins

Swap-outs

The number of memory pages paged in from swapspace.

The number of memory pages paged in from swapspace.

N/A

N/A

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes.

Increase the size of your swap file or add additional files.

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes.

Increase the size of your swap file or add additional files.

N/A Buffers The Buffers statistic represents the amount of buffers used by the kernel in kilobytes.

N/A

Page Faults/Sec The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

If the number of page faults remains consistently high, you can check with your

Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

11 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

AGING

A

CTIVITY

The Paging Activity section includes the following statistics:

Blocks Input/Sec

Paged Out

Blocks Output/Sec

Pages Input/Sec

Paged In

Pages Output/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

B

LOCKS

I

NPUT

/S

EC

The Blocks Input/sec statistic is the number of blocks sent to a block device per second.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of

your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

B

LOCKS

O

UTPUT

/S

EC

The Blocks Output/sec statistic is the number of blocks received from a block device per second).

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of

your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

P

AGED

I

N

The number of disk block paged into core from disk which occurs when the server is experiencing a shortage of RAM. Any nonzero value indicates excessive swap activity. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk.

This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Correction High values indicate the possible need to increase the amount of RAM on the system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1145

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

P

AGED

O

UT

The number of disk block paged out of core from disk. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk. This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

P

AGES

I

NPUT

/S

EC

The Pages Input/Sec statistic is the number of pages read from disk to resolve hard page faults.

Hard page faults occur when a process requires code or data that is not in its working set or elsewhere in physical memory, and must be retrieved from disk.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

This value was designed as a primary indicator of the kinds of faults that cause system-wide delays. It includes pages retrieved to satisfy faults in the file system cache (usually requested by applications) and in non-cached mapped memory files. This counter counts numbers of pages, and can be compared to other counts of pages, such as Memory: Page Faults/sec, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of

your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

P

AGES

O

UTPUT

/S

EC

The Pages Output/Sec statistic is the number of pages written to disk to free up space in physical memory. Pages are written back to disk only if they are changed in physical memory. A high rate of pages output might indicate a memory shortage.

Location

Metrics

Oracle Performance Analyst Statistics >

OS >

Memory Tab

Windows NT writes more pages back to disk to free up space when low in physical memory. This counter counts numbers of pages, and can be compared to other counts of pages, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of

your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

11 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

AGE

R

EPLACEMENTS

The following statistics are available in this section:

Memory Freed (Pages/sec) Clock Algorithm Scans (Pages/sec)

M

EMORY

F

REED

(P

AGES

/

SEC

)

Freed or destroyed (Kb/s).

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

C

LOCK

A

LGORITHM

S

CANS

(P

AGES

/

SEC

)

The VMM uses a technique known as the clock algorithm to select pages to be replaced. This technique takes advantage of a referenced bit for each page as an indication of what pages have been recently used (referenced). When the page-stealer routine is called, it cycles through the PFT, examining each page's referenced bit.

Location

Oracle Performance Analyst Statistics >

OS >

Memory Tab

S

PACE

T

AB

The Space tab of the OS Detail page includes the following sections:

• Device Summary

• Device Detail

D

ISK

S

PACE

F

REE

The Disk Space Free metric displays the amount of free disk space in megabytes.

Location

Oracle Performance Analyst Statistics >

OS >

Space Tab

D

ISK

S

PACE

D

ETAIL

The Disk Space Detail section of the Space tab succinctly communicates the general overall performance levels of the server’s disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1147

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Statistic

Used Space

Free Space

Capacity

Mounted On

Description

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

Location

Oracle Performance Analyst Statistics >

OS >

Space Tab

D

EVICE

S

UMMARY

The Device Summary section of the Space tab displays a bar chart for all devices. The Device

Summary section succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Used

Free

Description

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/device.

Location

Oracle Performance Analyst Statistics >

OS >

Space Tab

11 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

D

EVICE

D

ETAIL

The Device Detail section of the Space tab succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Oracle Performance Analyst Statistics >

OS >

Space Tab

N

ETWORK

T

AB

The Network tab of the OS Detail page succinctly communicates the general overall performance levels of the server's networking. The Network tab of the OS Detail page includes the following sections:

Network Details

Packet Errors

Transmission Queue Length

Packet Collisions

Transmission Rate

Packet Discards

Transmission Rate (Bytes)

NOTE:

The sections available on this tab depend on the platform of operating system.

N

ETWORK

D

ETAILS

The statistics available in this section depend on the platform of operating system. The table below describes the information available in this section:

Column

Network Interface

INET Address/

Address

Pkts Sent/Sec

Pkts Received/Sec

Description

The name of network interface.

The IP address assigned to the network interface.

The number of packets sent per second.

The number of packets received per second.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1149

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Column

Sent (KB/Sec)

Received (KB/Sec)

Out Pkts Discarded

In Pkts Discarded

Out Pkt Errors

In Pkt Errors

Queue Length

Collisions

Packets Discarded

Description

The number of bytes sent per second.

The number of bytes received per second.

The number of outbound packets discarded.

The number of inbound packets discarded.

The number of outbound packet errors.

The number of inbound packet errors.

The queue length.

The number of collisions.

The number of packets discarded.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

T

RANSMISSION

R

ATE

The Transmission Rate section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Packets Received/Sec Packets Sent/Sec

P

ACKETS

S

ENT

/S

EC

The Packets Sent/Sec statistic is the number of packets sent over each network adapter per second.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

P

ACKETS

R

ECEIVED

/S

EC

The Packets Received/Sec statistic is the number of packets received over each network adapter per second.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

T

RANSMISSION

R

ATE

(B

YTES

)

The Transmission Rate (Bytes) section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Received (KB/Sec) Sent (KB/Sec)

11 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

S

ENT

(KB/S

EC

)

The Sent (KB/Sec) statistic is the rate at which bytes are sent over each network adapter including framing characters.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

R

ECEIVED

(KB/S

EC

)

The Received (KB/Sec) statistic is the rate at which bytes are received over each network adapter, including framing characters.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

T

RANSMISSION

Q

UEUE

L

ENGTH

The number of pending outgoing packets on either the software transmit queue or the hardware transmit queue

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

P

ACKET

C

OLLISIONS

A collision occurs when two devices on the network sense that the network is idle and end up trying to send data at the same time. Some collisions are normal on a repeated network, but excess collisions can cause serious performance problems.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

Correction Contact your network administrator if there is high rate of persistent Packet Collisions.

P

ACKET

D

ISCARDS

The Packet Discards section of the Network tab succinctly communicates the packet discard rate. The following statistics are available in this section:

Inbound Packets Discarded

Outbound Packets Discarded

Packet Discards

O

UTBOUND

P

ACKETS

D

ISCARDED

The Outbound Packets Discarded statistic is the number of outbound packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1151

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

I

NBOUND

P

ACKETS

D

ISCARDED

Received Packets Discarded is the number of received packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

Correction

A possible reason for discarding such a packet could be to free up buffer space.

P

ACKET

D

ISCARDS

The Packet Discards statistic represents the number of network packets discarded.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

Correction Contact your network administrator if there is high rate of persistent packet discards.

P

ACKET

E

RRORS

The Packet Errors section of the Network tab succinctly communicates the packet error rate. The following statistics are available in this section:

Inbound Packet Errors Outbound Packet Errorss

O

UTBOUND

P

ACKET

E

RRORS

The Outbound Packet Errors statistic is the outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

I

NBOUND

P

ACKET

E

RRORS

The Packets Received Errors statistic is the received packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Oracle Performance Analyst Statistics >

OS >

Network Tab

T

OP

SQL

One or two bad queries can cause a lot of trouble for the remaining sessions in a database, and so can one or two bad queries. It is important to find them before they get into a production system, but sometimes a few sneak through.

11 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

By applying custom filters and performance-related thresholds, the Top SQL view locates inefficient SQL. By applying filters to certain I/O and statistical counters, you hope to isolate queries that far exceed their nearest competitors in the same area (like disk reads). When you find them, you should reduce the number of sorts a query performs. Or, for a query that returns only a few records, you should try to minimize the number of rows a query processes.

When you begin to look for inefficient SQL in a database, there are two primary questions you need to answer:

1 What has been the worst SQL that’s historically been run in my database?

2 What is the worst SQL that’s running right now in my database?

When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient Transact SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

The Top SQL view displays requested SQLOracle datasources. The following tabs are available on the Top SQL page:

Summary

Recent History (Oracle 10g only)

Criteria SQL Details

S

UMMARY

The Summary tab of the Top SQL page includes the following sections:

Top SQL Statements

Top SQL Details

T

OP

SQL S

TATEMENTS

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional’s satisfaction. The table below describes some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall Response

(Elapsed) Time

Description

This is how much time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server. This statistic is available in

Oracle9i and later.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1153

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Criteria

CPU Time

Physical I/O

Logical I/O

Repetition

Description

This is how much CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

Often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well.

This number of memory reads the query took to satisfy the user’s request. The goal of tuning I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

This is a measure of how often the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute may still be causing a headache on your system if it is executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over.

T

OP

SQL D

ETAILS

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional’s satisfaction.

The Top SQL Details section displays the top SQL statements across various performance categories. The table below describes the information available in this section:

Information

Top For

Usage

Hash value

SQL text

User name

Disk reads

Buffer gets

Parse calls

Sorts

Executions

Rows processed

First load time

Sharable memory

Description

Indicates the performance category for the SQL statement.

Displays the percent usage for this SQL statement in this performance category.

A unique identifier for the SQL statement assigned by Oracle.

A snippet of the actual SQL statement.

The username of the account that originally parsed the SQL.

The number of disk reads for the statement.

The number of logical reads for the statement.

The number of parse calls for the statement.

The number of sorts caused by the statement.

The number of times that statement has been executed.

The number of rows processed by the statement.

The date/time of when the statement was first loaded into the shared pool.

The amount of sharable memory used by the statement.

11 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Information

Persistent memory

Runtime memory

Address

Description

The amount of persistent memory used by the statement.

The amount of runtime memory used by the statement.

The address of the SQL statement.

Location

Oracle Performance Analyst Statistics >

Top SQL >

Summary

C

RITERIA

The Top SQL view displays all SQL running or executed in the current datasource. You can use the lists and boxes to reorder the display according to your specific needs. The Criteria tab of the Top SQL page includes the following sections that you can mix and match to give you the information you want to find.

• Demographic Criteria

• Statistical Criteria

• Sort Criteria

SQL D

ETAILS

The SQL Details tab displays the following sections:

Top SQL Results

Selected SQL Text

T

OP

SQL R

ESULTS

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional’s satisfaction. The Top SQL results grid displays the top SQL statements across various performance categories. The table below describes the information available in this section

Information

SQL Text

User name

Description

A snippet of the full SQL statement. Clicking the statement will cause the full statement to be presented in the Selected SQL Text grid.

The username of the account that originally parsed the SQL.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1155

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Information Description

Disk reads per execution The average number of disk reads caused by the statement each time it is executed.

The average number of logical reads caused by the statement each time it is executed.

Buffer gets per execution

Buffer gets

Disk reads

Parse calls

Sorts

Executions

Rows processed

Hit Ratio

First load time

Sharable memory

Persistent memory

Runtime memory

Elapsed Time per Exec

CPU Time per Exe

CPU Time

Elapsed Time

Hash value

Address

The number of logical reads for the statement.

The number of disk reads for the statement.

The number of parse calls for the statement.

The number of sorts caused by the statement.

The number of times that statement has been executed.

The number of rows processed by the statement.

The cache hit ratio for the statement.

The date/time of when the statement was first loaded into the shared pool.

The amount of sharable memory used by the statement.

The amount of persistent memory used by the statement.

The amount of runtime memory used by the statement.

For Oracle9i and later, this is the average elapsed response time for the statement.

For Oracle9i and later, this is the average CPU time for the statement.

For Oracle9i and later, this is the total CPU time for the statement.

For Oracle9i and later, this is the total elapsed time for the statement over all executions.

A unique identifier for the SQL statement assigned by Oracle.

The address of the SQL statement.

Location

Oracle Performance Analyst Statistics >

Top SQL >

SQL Details

S

ELECTED

SQL T

EXT

The Selected SQL Text window allows you to select any of the Top SQL result rows and get the complete SQL text. From here you can open an Explain Plan or Tune the SQL.

Location

Oracle Performance Analyst Statistics >

Top SQL >

SQL Details

R

ECENT

H

ISTORY

(O

RACLE

10

G ONLY

)

The Recent History tab of the Top SQL view displays:

SQL Activity (last 24 hours) SQL Details

11 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

SQL A

CTIVITY

(

LAST

24

HOURS

)

The SQL Activity graph shows you the resource usage of SQL statements over the last 24-hour period. You can see cumulative CPU, elapsed time, and wait time for all SQL statements that were executed during the last 24 hours.

You can also select a specific time period in the graph by drawing a box around part of the graph with your mouse. The graph will change to match your selection.

Location

Oracle Performance Analyst Statistics >

Top SQL >

Recent History (Oracle 10g only)

SQL D

ETAILS

The SQL Details section of the Recent History view displays the SQL statements that correspond to the time period shown in the SQL Activity graph. The following columns are displayed:

SQL ID: The unique identifier for the SQL statement

CPU Time: The total number of CPU seconds used by the statement during the specified time period

CPU %: The percentage of CPU used by the statement during the specified time period

Elapsed Time: The total elapsed time for the statement (in seconds) during the specified time period

Elapsed %: The percentage of elapsed time for the statement during the specified time period

Wait Time: The total wait time for the statement (in seconds) during the specified time period

Wait %: The percentage of wait time for the statement during the specified time period

SQL Time: The total SQL execution time for the statement (in seconds) during the specified time period

PL/SQL Time: The total PL/SQL execution for the statement (in seconds) during the specified time period

Java Time: The total java execution time for the statement (in seconds) during the specified time period

Executions: The total number of executions for the statement (in seconds) during the specified time period

Disk Reads: The total number of disk reads for the statement (in seconds) during the specified time period

Buffer Gets: The total number of buffer gets for the statement (in seconds) during the specified time period

Sorts: The total number of sorts for the statement (in seconds) during the specified time period

Parse Calls: The total number of parse calls for the statement (in seconds) during the specified time period

Location

Oracle Performance Analyst Statistics >

Top SQL >

Recent History (Oracle 10g only)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1157

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics Potential SQL tuning targets will be those statements that have unusually large amounts of CPU time, elapsed time, wait time, or number of executions.

U

SERS

In addition to a Home

page, the Users category of Oracle Performance Analyst includes the following tabbed pages:

Locks/Blocking Locks Tab

Top Sessions Tab

Session Waits Tab

System Waits Tab

H

OME

The Users home page includes the following sections:

Bottleneck Analysis Pane

Transaction Analysis Pane

Key User Analysis Pane

Workload Analysis Pane

Bottleneck Analysis Pane

K

EY

U

SER

A

NALYSIS

P

ANE

User database activity can be examined using both ratio-based and wait/bottleneck-based analysis. Ratio-based analysis involves examining a number of key database ratios and statistical readings that can be used to indicate how efficiently users are accessing the database.

Performance ratios serve as roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis.

When using ratio-based analysis, there are some standards to adhere to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that you examine come from the v$sysstat performance view. The performance view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and impacts how a particular ratio is interpreted. However, if delta statistics are used

(taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual ‘personality’ with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead you to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

11 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The following ratios are used on the Performance Analyst Users home page to succinctly communicate the general session-based performance levels of the monitored database:

Active Sessions

Open Cursors

CPU/Parse Ratio

Inactive Sessions

The following statistics, available on this pane are duplicates of statistics available on the Key

Ratio Analysis Pane of the Home

page:

Memory Sort Ratio

Parse/Execute Ratio

A

CTIVE

S

ESSIONS

The Active Sessions statistic is the total number of active and open threads currently reported in the database as well as the number of processes actively performing work.

NOTE:

For related information, see

Active User Processes .

For more information, see

Inactive Sessions

.

Location

Oracle Performance Analyst Statistics >

Users > Home > Key User Analysis Pane

CPU/P

ARSE

R

ATIO

CPU resources are obviously required to accomplish parse activities. The CPU/Parse Ratio determines the percentage of CPU spent on user-initiated parse tasks.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home > Key User Analysis Pane

Low numbers (0-5%) are desired with the CPU/parse ratio. Larger values can indicate a problem with excessive parse activity.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1159

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction If you suspect an excessive parsing problem on your database, you can look into increasing the shared pool size (in hopes that SQL statements are not aged out and therefore reused) or investigate the usage of bind variable in SQL statements.

If an undersized shared pool is suspected on Oracle8i or earlier:

Edit the Init.ora file for the database.

Increase the amount of shared_pool_size to a higher value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor the new value to see if performance improves.

If an undersized shared pool is suspected on Oracle9i or later:

Increase the size of the shared_pool_size parameter through use of the ALTER SYSTEM SET shared_pool_size command value (take caution to not over-allocate; ensure enough free memory exists on server before increasing value).

Monitor the new value to see if performance improves.

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started.

If you determine that SQL literals are causing SQL to not be reused, you can (in Oracle 8.1.6 and later):

Change the cursor_sharing parameter to FORCE by using the ALTER SYSTEM SET cursor_sharing=FORCE command.

Monitor database to see if parse activity is reduced and library cache reloads shrink

If using an SPFILE, save the new configuration values so Oracle reuses them each time the database is stopped and re-started. If using an Init.ora file, add the cursor_sharing=FORCE parameter to the file.

I

NACTIVE

S

ESSIONS

The Inactive Sessions statistic is the total number of threads logged on to the database that are currently idle.

NOTE:

For related information, see

Inactive User Processes

.

Location

Oracle Performance Analyst Statistics >

Users > Home > Key User Analysis Pane

Metrics A large number of inactive users could indicate user sessions that have mistakenly been left logged on. Because each user thread consumes a portion of memory on the Oracle server, to reduce resource usage, you should sever any session that does not need a connection.

Correction Double-click this statistic to open the

Top Sessions Tab of the Users Detail page. On this tab you can

check sessions that have many seconds idle and/or that have been logged on for very long periods of time as indicated by the logon time column. After verifying that the session is no longer necessary, you can KILL the session. For more information, see

Active Sessions

.

O

PEN

C

URSORS

Open Cursors is the total number of all SQL open cursors that exist on the system. In some cases, Oracle cached cursors that have been open by PL/SQL procedures can be kept open for certain lengths of time, even though the actual activity has ceased.

Location

Oracle Performance Analyst Statistics >

Users > Home > Key User Analysis Pane

Oracle Performance Analyst Statistics >

Session Details >

Current Work Tab

11 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics You should monitor sessions to make sure that they do not approach the Open Cursor limit (specified in the Init.ora file). The parameter, open_cursors, limits how many open cursors (context areas) a session can have open at one time.

Correction If the total number of open cursors approaches the open_cursors limit on Oracle8i or earlier, then:

Ensure that user processes are efficiently using cursors before editing the Init.ora file.

Edit the Init.ora file for the database.

Increase the amount of open_cursors to a higher value.

Cycle the Oracle server when possible to allow the new value to take effect.

If the total number of open cursors approaches the open_cursors limit on Oracle9i or later then:

Change the open_cursors parameter to FORCE by using the ALTER SYSTEM SET open_cursors=< new value > command.

B

OTTLENECK

A

NALYSIS

P

ANE

User database activity can be examined using both ratio-based and wait/bottleneck-based analysis. When connected to an Oracle database, every process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. You can use the Bottleneck

Analysis section to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps you track where a database has been spending its time. If user latch contention or heavy table scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, you can oftentimes discover a fair amount of detail about which sessions and objects are causing the problem.

For wait event analysis to be properly carried out, it is imperative that the timed_statistics initialization parameter be set to TRUE. By default this parameter is set to FALSE, which disallows the collection of wait times for each wait event defined to the Oracle engine. For one to really understand the impact of wait events on database performance, you need to not only discover what the database is or has been waiting on, but the durations of the waits. Having both allows a complete picture to be formed regarding the magnitude of wait-initiated performance degradations. Almost all Oracle experts now agree that allowing the collection of timing statistics adds little if anything to database overhead, so setting timed_statistics to TRUE should not be a worry. The Performance Analyst Users home page identifies the current top session waits as well as the top session-related bottlenecks that have seen the most waits on the system.

When using bottleneck analysis, you cannot rely only on the information contained in the wait event views that Oracle provides. Other user-related bottlenecks include current disk sort activity. Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system.

The following bottleneck indicators are used on the Performance Analyst Users home page to succinctly communicate the general overall performance level of the monitored database:

Sessions Blocked Sessions in Disk Sorts

Sessions with Enqueue Waits

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1161

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Sessions Waiting Top Bottleneck Events

Top Session Bottlenecks

S

ESSIONS

B

LOCKED

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Although Oracle supports unlimited row-level locking, blocking lock situations do crop up. User processes holding exclusive locks and not releasing them via a proper COMMIT generally cause most blocks.

NOTE:

This statistic is also called Current Object Blocks

on the Home

page and Session Blocks

on the Objects

Bottleneck Analysis Pane

.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

You should immediately investigate any indicator above zero for a blocking lock statistic before the situation has a chance to grow out of control.

Correction Once discovered, a blocking lock situation can normally be quickly remedied. You can issue a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Other user processes then nearly almost always complete in an instant. Embarcadero

Performance Analyst makes it easier to discover the blocked lock situation, but the trick is to prevent the blocking lock situation in the first place. You can look at the

Users detail and view all current

blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. Most DBAs who have had to face

Oracle Forms applications have suffered through the dreaded SELECT … FOR UPDATE statements that place unnecessary restrictive locks on nearly every read operation, and know all too well that good coding practice is important. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

S

ESSIONS IN

D

ISK

S

ORTS

Oracle's SGA is not the only memory structure used by Oracle for database work. One of the other memory areas used by Oracle8i and earlier for normal activity is an area set aside for sort actions. When a sort operation occurs, Oracle attempts to perform the sort in a memory space that exists at the operating system level. If the sort is too large to be contained within this space, it continues the sort on disk - specifically, in the user's assigned TEMPORARY TABLESPACE.

Oracle records the overall number of sorts that are satisfied in memory as well as those that end up being finalized on disk. Using these numbers, you can calculate the percentage of memory sorts vs. disk sorts and get a feel for how fast your sort activity is being resolved. Obviously, memory sorts completes many times faster than sorts forced to use physical I/O to accomplish the task at hand.

Oracle9i or later now has the option of running automatic PGA memory management. Oracle has introduced a new Oracle parameter called pga_aggregate_target. When this parameter is set and you are using dedicated Oracle connections, Oracle ignores all of the PGA parameters in the Oracle file, including sort_area_size, hash_area_size and sort_area_retained_size. Oracle recommends that the value of pga_aggregate_target be set to the amount of remaining memory (less a 10% overhead for other server tasks) on a server after the instance has been started.

11 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The sessions in disk sorts statistic displays a count of all sessions currently performing a disk sort.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

Consistently seeing non-zero numbers for this statistic (as well as low values observed for the memory sort ratio) can indicate excessive disk sort activity. If you are on Oracle8i or earlier, increase the parameters devoted to memory sorts - sort_area_size and sort_area_retained_size.

If you are using Oracle9i or later, investigate the use of pga_aggregate_target.

Once the pga_aggregate_target has been set, Oracle automatically manages PGA memory allocation, based upon the individual needs of each Oracle connection.

Oracle9i or later allows the pga_aggregate_target parameter to be modified at the instance level with the alter system command, thereby lets you dynamically adjust the total RAM region available to Oracle9i.

Oracle9i also introduces a new parameter called workarea_size_policy. When this parameter is set to automatic, all Oracle connections benefit from the shared PGA memory. When workarea_size_policy is set to manual, connections allocate memory according to the values for the sort_area_size parameter. Under the automatic mode, Oracle tries to maximize the number of work areas that are using optimal memory and uses one-pass memory for the others.

Correction If you find a problem, do the following:

Edit the Init.ora or SPFILE file for the database.

Increase the amount of sort_area_size to a higher value (take care not to not over-allocate; ensure enough free memory exists on server before increasing value). Realize that EVERY user receives this amount for sorting).

Cycle the Oracle server when possible to allow the new value to take effect.

Monitor new value to see if performance improves.

In addition to increasing the amount of memory devoted to sorting, you should also locate inefficient

SQL that causes needless sorts. For example, in an SQL query (to eliminate duplicate rows) UNION

ALL does not cause a sort whereas UNION does. People frequently code DISTINCT inappropriately

(especially people transferring from Microsoft Access, which uses DISTINCT for most SELECT queries).

There are times you simply cannot stop sort activity. When this happens, you should try to keep it in memory whenever possible. However, large data warehousing systems frequently exhaust RAM sort allotments, so if disk sorts must occur, ensure three things:

Your user's TEMPORARY TABLESPACE assignment is not the SYSTEM tablespace, which is the default assignment. In Oracle9i or later, you can specify a default tablespace other than SYSTEM for every user account that is created.

The TEMPORARY TABLESPACE assigned to your users is placed on a fast disk.

The TEMPORARY TABLESPACE has the tablespace parameter TEMPORARY assigned to it, which allows sort activity to be performed in a more efficient manner.

S

ESSIONS WITH

E

NQUEUE

W

AITS

An enqueue is an advanced locking device that allows multiple database processes to share certain resources. Enqueue waits typically occur when sessions wait to be granted a requested lock. Sometimes these locks are internal Oracle locks while other times they could be locks for rows of data. Note that enqueues are issued implicitly by Oracle.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

Any enqueue waits that read consistently above 1 or more (delta statistics) should be investigated.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1163

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction Removing contention for enqueues is almost always an application design issue. If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations.

Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

S

ESSIONS

W

AITING

User connections that are waiting on a system generally occur for two reasons:

1 A process waits because a requested resource is not available.

2 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not usually a concern. However the two wait causes mentioned above are the ones worth your time and investigation. The sessions waiting statistic is a count of all sessions that are currently waiting for one reason or another.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

To determine the actual wait causes currently experienced by user connections, you should drill down from the global count of users waiting, into the actual system and user wait details of a database.

Correction If you find a problem, drill down into wait details to determine whether the waits are resource-related.

T

OP

B

OTTLENECK

E

VENTS

When viewing wait statistics, there are many levels of detail. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system.

The second level is the session view, which shows details on which events connected sessions have experienced. Viewing these numbers can help you determine which session-related wait events have caused the most commotion in a database thus far. The Top Bottleneck Events section identifies the top waits that have occurred on the Oracle database based on the amount of time waited per event.

Location

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

Correction

Appendix A in the Oracle Reference manual contains a listing and description of every current wait event defined in Oracle. DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics. For example, a ‘db file scattered read’ event is typically indicative of table scan operations. If many of these events are observed, you should begin to see if large table scans are occurring in the database. Like the ‘db file scattered read’ event, each wait event has its own meaning and individual end-resolution diagSQL

Analysis - Users

11 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Much of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times. SQL statements that use much memory can also cause a problem in a database.

Before you can identify problem SQL in your database, you have to ask the question, “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional's satisfaction. The SQL Analysis for Users shows what SQL statements have consumed the largest percentages of executions, parse calls, CPU time, and elapsed time. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall

Response

(Elapsed) Time

CPU Time

Physical I/O

Logical I/O

Repetition

Description

The amount of time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server. This statistic is available in Oracle9i or later.

The amount of CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user's request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements' logical I/O as well.

The number of memory reads the query took to satisfy the user's request. The goal of tuning I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

The number of times the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute may still be causing a headache on your system if it has executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over again.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above.

Fortunately, Oracle records all the above measures (some only in 9i), which makes tracking the

SQL that has been submitted against an Oracle database much easier.

Location

Metrics

Oracle Performance Analyst Statistics >

Users > Home

> Bottleneck Analysis Pane

When you begin to look for inefficient SQL in a database, there are two primary questions you want answered:

What HAS been the worst SQL that has historically run in my database?

What IS the worst SQL that is running right now in my database?

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1165

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient PL/SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can go further into Performance Analyst's Top SQL view and, if you have Embarcadero SQL Tuner installed, you can port the SQL over to SQL Tuner to better optimize the statement.

T

RANSACTION

A

NALYSIS

P

ANE

On a transaction-oriented system, user transactions perform COMMITs to make permanent any data additions, changes, or deletions to the database. Or they ROLLBACK any modifications to undo any work that has encountered an error or other transaction-halting situation. The transaction analysis breakdown shows current commits and rollbacks and the percentage that each activity accounts for on the database.

Metrics Large volumes of rollbacks can indicate a transaction breakdown on the system, that may need investigation at the application level.

W

ORKLOAD

A

NALYSIS

P

ANE

When the database population as a whole experiences a system slowdown, it is not uncommon to find one or two users who are responsible for bringing the system to its knees. In the best of worlds, users have a pretty evenly divided amount of memory usage, disk I/O, CPU utilization, and parse activity. However, users submit large batch jobs during peak OLTP activity, or when sessions that are fire off untuned queries on a critical system.

If you are seeing a slowdown in your database, and cannot seem to find a root cause, examine the resource consumption of the leading sessions on a system. A handful of users can overwhelm the I/O capabilities of Oracle (through untuned queries or runaway batch jobs) or hammer the CPU or memory structures of the database and server.

Performance Analyst makes it easy to pinpoint the top sessions by showing the leading processes at the physical I/O, logical I/O, memory, disk sort, table scan, and CPU usage levels.

Metrics If any one session uses more than 50% of a total resource (CPU, memory, etc.) go into the session to find out what they are currently executing.

T

OP

S

ESSIONS

T

AB

The Top Sessions tab includes the following sections:

Top CPU Process

Top Sessions

Top I/O Process Top Memory Process

11 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OP

I/O P

ROCESS

This section identifies the Oracle process that currently has caused the most I/O usage on the database.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Top Sessions Tab

To obtain more details on the top I/O process, locate the SID in the Top Sessions grid and drill down to obtain more granular information.

T

OP

M

EMORY

P

ROCESS

The Top Memory Process section identifies the Oracle process that currently is using the highest percentage of memory in the database.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Top Sessions Tab

To obtain more details on the top memory process, locate the SID in the Top Sessions grid and drill down to obtain more granular information.

T

OP

CPU P

ROCESS

The Top CPU Process section identifies the Oracle process that currently has the highest percentage of CPU usage in the database.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Top Sessions Tab

To obtain more details on the top CPU process, locate the SID in the Top Sessions grid and drill down to obtain more granular information.

T

OP

S

ESSIONS

When a system experiences heavy activity, sometimes you will find that all the user connections are contributing somewhat equally to the overall load. More often than not, however, one or two user connections are causing most of the activity. It may be that a large batch load or other typical process is running that is perfectly okay for your system. Or it may be a runaway process or other rogue connection that needs to be tracked down and possibly eliminated.

The Top Sessions section displays information regarding all key metrics for all current sessions on a database. The table below describes the information available in this section:

Column

SID

User Name

O/S ID

Machine Name

Logon Time

Tot Physical I/O

Tot Logical I/O

Description

The system ID of the process.

The username of the process.

The operating system ID of the process.

The workstation where the process originated.

The date/time the process logged on to Oracle.

A summation of all physical reads and physical writes for the process (includes direct).

A summation of all logical I/O (buffer gets, consistent gets, etc.) for the process.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1167

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Column

Hit Ratio

Total Memory Usage

Parses

Total CPU

Parse CPU

Recursive CPU

Other CPU

Disk Sorts

Memory Sorts

Rows Sorted

Commits

Rollbacks

Executions

Physical Reads

DB Block Gets

Consistent Gets

Consistent Changes

Last Wait

Wait Class

Wait time

P1text

P2text

P2 r

P2Raw

P3text

P3

P3Raw

Description

Shows how often object definitions are found in memory vs. having to read them in from disk.

The total amount of memory used.

The total number of parses the process has caused.

The total CPU usage for the process.

The amount of process CPU caused by parse activity.

The amount of process CPU caused by recursive calls.

Total CPU usage minus parse and recursive activity. This can be a negative number if the

Oracle kernel is not properly reporting total CPU usage.

The total number of disk sorts caused by the process.

The total number of memory sorts caused by the process.

The total number of rows sorted by the process.

The total number of commits executed by the process.

The total number of rollbacks executed by the process.

The total number of executions.

The total number of physical reads produced by the process.

The total number of block gets produced by the process.

The total number of consistent gets produced by the process.

The total number of consistent changes produced by the process.

Event Defines the last wait event experienced by the session

The wait class of the last wait event

The sessions last wait time

Text that describes the first wait parameter

Text that describes the second wait parameter

The second wait parameter

The data for the second parameter

Text that describes the third wait parameter

The third wait parameter

The data for the third parameter

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Top Sessions Tab

To obtain more details on any process, drill down to obtain more granular information.

11 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

S

YSTEM

W

AITS

T

AB

The System Waits tab includes the following sections:

System Waits

Wait Percent by Time Waited

Wait Percent by Total Waits

S

YSTEM

W

AITS

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The system

Waits section presents all the various system waits that have occurred on the system since startup. The table below lists the information available in this section:

Column

Event

Class

Total Waits

Percent of Total

Time Waited (Secs)

Percent Time Waited

Total Timeouts

Description

The name of the wait event.

Wait classes contain a collection of related wait events (like User I/O, System I/O, etc.)

The total number of waits for the event.

The percentage of all waits that this event makes up.

The total amount of time waited for the event, in seconds.

The percentage of time that this event makes up.

The total number of timeouts for the event.

Percent Total Timeouts The percentage of timeouts that this event makes up.

Average Waits (Secs) The average amount of time waited for the event, in seconds.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

System Waits Tab

Which waits should be a cause for concern and which waits can be ignored (for the most part)?

Common wait events that can generally be ignored include SQL*Net more data from client, SQL*Net message from client, client message, rdbms ipc message, pipe get, pmon timer, smon timer, and Null event.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1169

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction

The table below describes wait events that deserve attention:

Wait Event

Enqueue waits

Buffer busy waits db file scattered read waits

Latch free waits

Description

If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations. Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

Buffer busy waits normally center around contention for rollback segments, too small an

INITRANS setting for tables, or insufficient free lists for tables. The remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

An interesting wait event is the db file scattered read event. This event is indicative of table scans occurring on the system. Large numbers of them may indicate heavy scan activity and the need to revisit your indexing/physical design.

Latch free waits indicate contention for latches.

The SQL*Net message to client can help a DBA diagnose wait activity outside the database.

The key statistics for waits is not the number of waits for each event, but rather the wait time and average wait time. These indicate if the event is truly causing a significant bottleneck in the database. To view the wait times for sessions and overall system wait events, you must set the timed_statistics parameter to TRUE for your Oracle databases. You can either set this parameter in your Init.ora file or alter the system dynamically with the ALTER SYSTEM SET

TIMED_STATISTICS=TRUE command.

W

AIT

P

ERCENT BY

T

OTAL

W

AITS

Waits on a system generally occur for three reasons:

• A process waits because it has no work to do.

• A process waits because a requested resource is not available.

• A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The Wait

Percent by Total Waits section displays the percentage of waits for all top non-idle wait events.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

System Waits Tab

Which waits should be a cause for concern and which waits can be ignored (for the most part)?

Common wait events that can generally be ignored include SQL*Net more data from client, SQL*Net message from client, client message, rdbms ipc message, pipe get, pmon timer, smon timer, and Null event.

11 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction

The table below describes wait events that deserve attention:

Wait Event

Enqueue waits

Buffer busy waits db file scattered read waits

Latch free waits

Description

If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations. Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

Buffer busy waits normally center around contention for rollback segments, too small an

INITRANS setting for tables, or insufficient free lists for tables. The remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

An interesting wait event is the db file scattered read event. This event is indicative of table scans occurring on the system. Large numbers of them may indicate heavy scan activity and the need to revisit your indexing/physical design.

Latch free waits indicate contention for latches.

The SQL*Net message to client can help a DBA diagnose wait activity outside the database.

W

AIT

P

ERCENT BY

T

IME

W

AITED

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The Wait

Percent by Time Waited section displays the percentage of waits for all top non-idle wait events.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

System Waits Tab

The key statistics for waits is not the number of waits for each event, but rather the wait time and average wait time. These indicate if the event is truly causing a significant bottleneck in the database.

Which waits should be a cause for concern and which waits can be ignored (for the most part)?

Common wait events that can generally be ignored include SQL*Net more data from client, SQL*Net message from client, client message, rdbms ipc message, pipe get, pmon timer, smon timer, and Null event.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1171

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Correction

The table below describes wait events that deserve attention:

Wait Event

Enqueue waits

Buffer busy waits db file scattered read waits

Latch free waits

Description

If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations. Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

Buffer busy waits normally center around contention for rollback segments, too small an

INITRANS setting for tables, or insufficient free lists for tables. The remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

An interesting wait event is the db file scattered read event. This event is indicative of table scans occurring on the system. Large numbers of them may indicate heavy scan activity and the need to revisit your indexing/physical design.

Latch free waits indicate contention for latches.

The SQL*Net message to client can help a DBA diagnose wait activity outside the database.

To view the wait times for sessions and overall system wait events, you must set the timed_statistics parameter to TRUE for your Oracle databases. You can either set this parameter in your Init.ora file or alter the system dynamically with the ALTER SYSTEM SET

TIMED_STATISTICS=TRUE command.

S

ESSION

W

AITS

T

AB

The Session Waits tab includes the following sections:

Current Waits

Historical Waits

H

ISTORICAL

W

AITS

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

11 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The Historical

Waits section presents all the various waits that have occurred for all currently connected oracle sessions. The table below lists the information available in this section:

Column

Event

Wait Class

Total Waits

Percent of Total Waits

Time Waited (Secs)

Average Wait (Secs)

Max Wait (Secs)

Total Timeouts

Description

The name of the wait event.

Wait classes contain a collection of related wait events (like User I/O, System I/O, etc.)

The number of waits for the event.

The percentage of all waits that this event makes up.

The total amount of time waited for the event, in seconds.

The average amount of time waited for the event, in seconds.

The maximum amount of time waited for the event, in seconds.

The number of timeouts for the event.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Session Waits Tab

Oracle Performance Analyst Statistics >

Session Details >

Waits Tab

Which waits should be a cause for concern and which waits can be ignored (for the most part)?

Common wait events that can generally be ignored include SQL*Net more data from client, SQL*Net message from client, client message, rdbms ipc message, pipe get, pmon timer, smon timer, and Null event.

Correction

The table below describes wait events that deserve attention:

Wait Event

Enqueue waits

Buffer busy waits db file scattered read waits

Latch free waits

Description

If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations. Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

Buffer busy waits normally center around contention for rollback segments, too small an

INITRANS setting for tables, or insufficient free lists for tables. The remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

An interesting wait event is the db file scattered read event. This event is indicative of table scans occurring on the system. Large numbers of them may indicate heavy scan activity and the need to revisit your indexing/physical design.

Latch free waits indicate contention for latches.

The SQL*Net message to client can help a DBA diagnose wait activity outside the database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1173

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

The key statistics for waits is not the number of waits for each event, but rather the wait time and average wait time. These indicate if the event is truly causing a significant bottleneck in the database. To view the wait times for sessions and overall system wait events, you must set the timed_statistics parameter to TRUE for your Oracle databases. You can either set this parameter in your Init.ora file or alter the system dynamically with the ALTER SYSTEM SET

TIMED_STATISTICS=TRUE command.

C

URRENT

W

AITS

Waits on a system generally occur for three reasons:

• A process waits because it has no work to do.

• A process waits because a requested resource is not available.

• A process waits for Oracle to perform a prerequisite task for its given operation.

Session contention is merely a subset of contention that is viewable at the global database level.

Oftentimes, it takes analysis at the session level to pinpoint the exact source of contention that is occurring globally. So you need to become accustomed to viewing contention statistics and waits at the user process level.

When monitoring waits with respect to user sessions, there are two areas of interest:

1 What HAS the user session been waiting on?

2 What IS the user session waiting on?

Oracle records both sets of wait statistics for you. In reviewing previous waits for a session, you can see which types of things have caused the session to be bottlenecked. The Current Waits section displays information to help you troubleshoot session contention. The table below lists the information available in this section:

Column

Event

Wait (Secs)

Last Wait Time

State

P1 - P3

P1TEXT - P3TEXT

P1RAW - P3RAW

Description

The name of the wait event.

The number of seconds in the current wait.

A non-zero value is the session's last wait time. A zero value means the session is currently waiting. A -2 value indicates the platform cannot support a fast timing mechanism or TIMED_STATISTICS is not set for the system.

Indicates the possible values. They includes the following:

WAITING - the session is waiting.

WAITED UNKNOWN TIME - duration of last wait is not known.

WAITED SHORT TIME - last wait was less than 1/100th of a second.

WAITED KNOWN TIME - the wait is equal to the time of the last wait.

Any additional wait parameters.

Any descriptions of additional parameter.

Any additional wait parameters.

11 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Session Waits Tab

Oracle Performance Analyst Statistics >

Session Details >

Waits Tab

Which waits should be a cause for concern and which waits can be ignored (for the most part)?

Common wait events that can generally be ignored include SQL*Net more data from client, SQL*Net message from client, client message, rdbms ipc message, pipe get, pmon timer, smon timer, and Null event.

Correction

The table below describes wait events that deserve attention:

Wait Event

Enqueue waits

Buffer busy waits db file scattered read waits

Latch free waits

Description

If many enqueue waits are seen, this normally indicates either contention for certain rows in the database, or the result of database-initiated lock escalation. You should examine the use of indexes to make sure all referencing foreign keys are indexes and that SQL is tuned to not tarry over rows in the database during modification operations. Enqueue waits can also be the result of space management tasks (such as objects extending) and disk sorts (mainly in tablespaces that do not make use of the TEMPORARY tablespace parameter).

Buffer busy waits normally center around contention for rollback segments, too small an

INITRANS setting for tables, or insufficient free lists for tables. The remedy for each situation would be increasing the number of rollback segments, or altering tables to have larger settings for INITRANS to allow for more transactions per data block, and more free lists.

An interesting wait event is the db file scattered read event. This event is indicative of table scans occurring on the system. Large numbers of them may indicate heavy scan activity and the need to revisit your indexing/physical design.

Latch free waits indicate contention for latches.

The SQL*Net message to client can help a DBA diagnose wait activity outside the database.

The key statistics for waits is not the number of waits for each event, but rather the wait time and average wait time. These indicate if the event is truly causing a significant bottleneck in the database. To view the wait times for sessions and overall system wait events, you must set the timed_statistics parameter to TRUE for your Oracle databases. You can either set this parameter in your Init.ora file or alter the system dynamically with the ALTER SYSTEM SET

TIMED_STATISTICS=TRUE command.

L

OCKS

/B

LOCKING

L

OCKS

T

AB

The Locks/Blocking Locks tab includes the following sections:

All Locks Blocking Locks

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1175

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

A

LL

L

OCKS

To modify database information or structures, a user session must obtain a lock on the object to perform its task. Ibesides user locks, Oracle itself will issue lock requests to carry out its internal duties. The All Locks section displays information about all locks currently on a system. The table below lists the information available in this section:

Column

Machine

Serial #

Request

Table

Mode

Blocking?

Description

The workstation of the Oracle process.

The serial number of the session holding the lock.

The lock requests that Oracle issues to carry out its internal duties.

The table name of the locked table.

The lock mode (EXCLUSIVE, SHARE, etc.).

Indicates if the lock is a blocking lock.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Locks/Blocking Locks Tab

Oracle Performance Analyst Statistics >

Session Details >

Locks Tab

Locks that are held for unusually long periods of time may be candidates for further investigation. The application logic may be inefficient or perhaps the program is not issuing frequent enough COMMITs.

B

LOCKING

L

OCKS

Without a doubt, blocking lock situations can give the appearance of a frozen database almost more than anything else (except, perhaps, for a stuck archiver process). A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Although Oracle supports unlimited row-level locking, blocking lock situations do crop up - sometimes frequently.

The Blocking Locks section contains information relating to user accounts that are currently blocked and the sessions that are blocking them. The table below describes the information available in this section:

Column

Blocked User

Blocking User

Waiting SID

Holding SID

Type

Mode

Request

Description

The user account of the session waiting for the lock.

The user account of the session holding the offending lock.

The session identifier of the session waiting for the lock.

The session identifier of the session holding the offending lock.

The type of lock (TRANSACTION, DML, etc.).

The lock mode (EXCLUSIVE, SHARE, etc.).

The type of lock being requested by the session.

Row

ID 1

The rowid of the row being held.

Lock identifier #1 (depends on type).

ID 2 Lock identifier #2 (depends on type).

Time Waited (Secs) The amount of time, in seconds, the blocked user has been waiting.

11 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Locked Object

Description

The name of the object being locked.

Location

Metrics

Oracle Performance Analyst Statistics >

Users >

Locks/Blocking Locks Tab

Oracle Performance Analyst Statistics >

Session Details >

Locks Tab

Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Other user processes then nearly almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is where it gets tricky.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. Most DBAs who have had to face

Oracle Forms applications have suffered through the dreaded SELECT … FOR UPDATE statements that place unnecessary restrictive locks on nearly every read operation, and know all too well that good coding practice is important. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

Data warehouses (whose data is mostly read) can benefit from tablespaces set in READ ONLY mode.

READ ONLY signals to the other database that exclusive locks need not be used for the data contained within the tablespace. This is especially helpful in Oracle Parallel Server environments and drastically reduces ping activity.

RAC D

ETAIL

V

IEW

The Performance Analyst for Oracle has been upgraded to support for the monitoring of Oracle

Real Application Clustering (RAC) environments (Oracle 9i and higher).

Oracle RAC allows a single physical Oracle database to be accessed by simultaneous instances of Oracle running across several CPUs. All statistics you see are listed by instance ID.

The RAC Detail view is divided into the following tabs:

Overview Tab

Locks

Memory

Sessions

Ping Activity

O

VERVIEW

The Overview tab is of the RAC Detail view divided into the following sections:

Key Ratio Analysis Pane

Workload Analysis Pane

Instance Analysis Pane

Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1177

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database: ratio-based or wait/bottleneck-based analysis. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy

DBAs to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and can’t spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the v$sysstat performance view. This view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the

NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and impact how a particular ratio that a DBA may be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual “personality”with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following ratios are used on the Performance Analyst RAC Overview page to succinctly communicate the general overall performance levels of the monitored database:

• Cross Instance Cache Flush ratio

• Ping Ratio

• Local Buffer Access Percent

• Local Read Percent

• Global Buffer Busy Wait Percent

I

NSTANCE

A

NALYSIS

P

ANE

As a DBA managing an Oracle RAC, you will oftentimes want a quick performance snapshot of the efficiency and activity across all your Oracle RAC nodes. The Instance Analysis section provides a fast picture of which nodes of your Oracle RAC appear overworked and those that are underutilized.

The following statistics are provided:

ID: The Oracle RAC instance ID

11 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

·Name: The instance name

Sessions: The total number of sessions logged onto a RAC node

Physical I/O: A summation of all physical reads and physical writes for the RAC node

Logical I/O: A summation of all logical I/O (buffer gets, consistent gets, etc.) for the RAC node

Hit Ratio: An indicator of how often user requests for data are satisfied.

Memory Usage: The session's total memory usage against all session memory usage on the database.

Parses: The total number of parses experienced by the RAC node

Total CPU: The total CPU usage for the RAC node

Parse CPU: The amount of process CPU for the RAC node

Recursive CPU: The amount of process CPU caused by recursive calls on the RAC node

Other CPU: Total CPU usage minus parse and recursive activity. This can be a negative number if the Oracle kernel is not properly reporting total CPU usage

Disk Sorts: The total number of disk sorts for the RAC node

Memory Sorts: The total number of memory sorts for the RAC node

Rows Sorts: The total number of rows sorted on the RAC node

Commits: The total number of commits executed for the RAC node

Rollbacks: The total number of rollbacks executed for the RAC node

Executions: The total number of calls made on the RAC node

Physical Reads: The total number of physical reads produced on the RAC node

DB Block Gets: The total number of block gets produced on the RAC node

Consistent Gets: The total number of consistent gets produced on the RAC node

Consistent Changes: The total number of consistent changes produced on the RAC node

B

OTTLENECK

A

NALYSIS

P

ANE

When an Oracle database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting can mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs used this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1179

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If latch contention or heavy table scan activity has been dragging a database’s performance down, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about what sessions and objects are causing the problem.

For wait event analysis to be properly carried out, it is imperative that the timed_statistics initialization parameter be set to TRUE. By default this parameter is set to FALSE, which disallows the collection of wait times for each wait event defined to the Oracle engine. For one to really understand the impact of wait events on database performance, the DBA not only needs to discover what the database is or has been waiting on, but the durations of the waits.

Having both measures in hand allows a complete picture to be formed regarding the magnitude of wait-initiated performance degradations. Almost all Oracle experts now agree that allowing the collection of timing statistics adds little if anything to database overhead, so setting

timed_statistics to TRUE should not be a worry. The Performance Analyst home page identifies the top system and session waits that are currently a cause of lessened performance.

When using bottleneck analysis, you cannot rely only on information contained in the wait event views that Oracle provides. For example, an object may attempt to extend into another extent of space in a tablespace and yet be denied if no such free space exists. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that you cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance

Analyst helps identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system.

For an Oracle RAC, Performance Analyst highlights the top RAC-related waits as well as conflicts that may be slowing down response times. Here you see statistics for Top Rac-Related Waits and

Conflicts. Within each section, you find:

Top Rac-Related Waits

When viewing wait statistics, there are several levels of detail that a DBA can drill down into. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system. Viewing these numbers can help a DBA determine what wait events have caused the most commotion in a database thus far. The Top RAC-related bottlenecks section display identifies the top waits that have occurred on the node that Performance Analyst is currently connected to.

Appendix A in the Oracle Reference manual contains a listing and description of every current wait event defined in Oracle. DBAs unfamiliar with what each event represents should keep this listing close by as they examine wait-based event metrics. For example, a “db file scattered read” event is typically indicative of table scan operations. If many of these events are observed, then the DBA should begin to see if large table scans are occurring in the database. Like the “db file scattered read” event, each wait event has its own meaning and individual end-resolution diagnosis.

11 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

After looking at system-level wait activity, a DBA can drill down further to discover what current connections may be responsible for any reported waits that are being observed at the system level. Performance Analyst reports on historical and current wait events at the session level, making this investigation easy to accomplish.

Conflicts

There are a number of conflicts that can occur over an Oracle RAC that can reduce response times. The Conflicts section highlights some of the more common conflicts and provides a count of how many times each has occurred.

The conflicts listed include:

Library Cache: How many library cache invalidations have occurred on the node that

Performance Analyst is connected to.

Data Dictionary Cache: How many data dictionary cache invalidations have occurred on the node that Performance Analyst is connected to.

Forced Writes (Oracle 9.2 and above): Number of times a block was written to cache because an instance had used the block, but another instance had requested the lock on the block in a conflicting mode.

Pings: How many cross instance writes occurred

Cache Timeouts: The number of global cache convert timeouts that have occurred.

W

ORKLOAD

A

NALYSIS

P

ANE

When your phone starts ringing with complaints of performance slowdowns, one of the first things you should get a handle on is:

• Who is currently connected to the database

• What resources are they using

• What are they currently executing

The Workload Activity Analysis section of the Performance Analyst home page provides insight into the leading resource hogs across all instances of an Oracle RAC. Drill down’s are available so you can easily get detailed information into what each leading session is currently involved with.

If you are seeing a slowdown in your database, and can't seem to find a root cause, one thing to examine is the resource consumption of the leading sessions on a system. Often you will find one or a handful of users making life miserable for everyone else. They accomplish this by overwhelming the I/O capabilities of Oracle (through untuned queries or runaway batch jobs) or hammering the CPU or memory structures of the database and server.

The Workload Analysis section presents:

• Top Physical I/O Process

• Top Logical I/O Process

• Top Memory Process

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1181

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

• Top CPU Process

For each of these, you see the SID, Instance ID, Username, %Used.

If any one session appears to be using more than 50% of a total resource (CPU, memory, etc.), then you should drill down into the session to find out what it is currently executing.

M

EMORY

The Memory tab of the RAC Detail view is divided into the following sections:

Key Ratio Analysis Pane

Data Dictionary Cache Analysis Pane

Memory Analysis Pane Library Cache Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database: Ratio-based or wait/bottleneck-based analysis. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy

DBAs to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and can’t spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there aremany opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA examines come from the

v$sysstat

performance view. This view maintains a count of all the occurrences (in the VALUE column) of a particular database incident (in the NAME column) since the database was brought up. For databases that are kept up for long periods of time, these values can grow quite large and will impact how a particular ratio that a DBA may be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each database’s individual “personality” with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following ratios are used in the Memory Key Ratio Analysis section to succinctly communicate the general overall performance levels of the monitored database:

• Buffer Cache Hit Ratio: How often requested information is found in memory versus on disk.

11 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• Library Cache Hit Ratio: Shows how often SQL code is being reused by other database users versus the number of times a SQL statement is broken down, parsed, and then loaded (or reloaded) into the shared pool.

• Latch Miss Ratio: Defines the number of times a process obtained a willing-to-wait latch versus missing the attempt.

M

EMORY

A

NALYSIS

P

ANE

The Memory Analysis section displays the memory configurations for each node currently up in the RAC. The following information is shown:

Name: The name of the instance.

DB Buffers (MB): The default memory cache that maintains data blocks when they are read from the database. If the DBA doesn't specifically place objects in another data cache (which will be covered next), then any data requested by clients from the database will be placed into this cache. This memory area is controlled by the db_block_buffers parameter in Oracle8i and below and db_cache_size in Oracle9i and above.

Log Buffer Size (MB): This area buffers modifications that are made to the database before they are physically written to the redo log files. The log_buffer configuration parameter controls this memory area.

Shared Pool Size (MB): This familiar area holds object structure as well as code definitions, and other metadata. Setting the proper amount of memory in the shared pool assists a great deal in improving overall performance with respect to code execution.

DB Caches (MB): Beginning in Oracle9i, a DBA can create tablespaces whose blocksize differs from the overall database blocksize. When data is read into the SGA from these tablespaces, their data has to be placed into memory regions that can accommodate their special block size.

Oracle9i and above has memory settings for 2K, 4K, 8K, 16K, and 32K caches. The configuration parameter names are in the pattern of db_nk_cache_size. For each RAC node, you see the following statistics:

• Buffer Cache Hit Ratio

• Library Cache Hit Ratio

• Latch Miss Ratio

L

IBRARY

C

ACHE

A

NALYSIS

P

ANE

The Library Cache Analysis section provides a drill down view into invalidations that have occurred across the cluster. The following information is shown:

ID: The instance ID.

Name: The instance name.

Namespace: The area of the library cache.

DLM Lock Requests: The number of get requests for instance locks.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1183

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

DLM Pin Requests: The number of pin requests for instance locks.

DLM Pin Releases: The number of release requests for pin instance locks.

DLM Invalidation Requests: The number of get requests for invalidation instance locks.

DLM Invalidations: The number of invalidation pings received from other RAC instances.

D

ATA

D

ICTIONARY

C

ACHE

A

NALYSIS

P

ANE

The Data Dictionary Cache Analysis section provides a drill-down view into invalidations and conflicts that have occurred across the cluster. The following information is shown:

ID: The instance ID.

Name: The instance name.

Parameter: The specific object area of the dictionary cache.

DLM Requests: The number of lock manager requests.

DLM Conflicts: The number of lock manager conflicts encountered.

DLM Releases: The number of lock manager releases.

P

ING

A

CTIVITY

Pinging is the process where one Oracle Instance requests another to write a set of blocks from its SGA to disk so it can obtain it in exclusive mode. To move a data block from one instance's

SGA to another is a slow process. The Ping Activity tab of the RAC Detail view displays several levels of specificity, starting from general to specific. The Ping Activity tab is divided into the following sections:

Ping by Instance - shows how often pinging has occurred across all the monitored instances.

Ping by Datafile - shows the number of blocks pinged from the shared set of RAC datafiles.

Ping by Object - provides a drill down view into the amount of specific ping activity across the shared objects and datafiles of a RAC:

• Owner

• Object Name

• Partition Name

• Block Number

• Segment Type

• Kind

• Forced Reads

• Forced Writes

11 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• Datafile

L

OCKS

The Locks tab of the RAC Detail view is divided into the following sections:

Lock Convert Summary - The Lock Convert Summary view provides efficiency statistics regarding the speed at which the RAC acquires and converts locks across the instances. You see the average get and convert times for each RAC node.

DLM Lock Activity - The DLM (Distributed Lock Manager) Lock Activity view provides detailed information on the number of lock conversions that have occurred across the RAC.

PCM Lock Summary - The PCM (Parallel Cache Management) Lock Summary provides a summary count of PCM locks that are releasing, acquiring, or are invalid.

Latch Detail - Protecting the memory structures in Oracle's SGA are latches. Latches ensure that one and only one process at a time can run or modify any memory structure at the same instant.

Much more restrictive than locks (which at least allow for some collective user interaction), latches have no queuing mechanism so either you get it or you don't and are forced to continually retry.

The latch detail tab of the contention detail view presents a detailed view of latch activity.

Information presented includes:

• Instance Name: The name of the instance

• Name: The name of the latch

• Gets: The total number of times the latch was requested by a process

• Misses: The total number of failed attempts to acquire the latch on the first attempt

• Immediate Gets: The total number of no-wait requests for a latch

• Immediate Misses: The total number of failed no-wait attempts to acquire the latch on the first attempt

• Immediate Sleeps: The total number of requests that "paused" while waiting for a latch

Common indicators of latch contention are a latch miss ratio (which records willing-to-wait mode latch requests) and a latch immediate miss ratio (which records no-wait mode latch requests).

These statistics reflect the overall health of how often latch requests were made and satisfied without waiting.

Here are a few latch contention situations that you should recognize and get to the bottom of quickly:

• Cache buffer chain latch: This latch is responsible for protecting paths to database block buffers in the buffer cache. Very high I/O loads tend to cause contention for this latch. You can alleviate contention somewhat by adding more buffers to the cache (through the db_block_buffers parameter) or by adding more LRU latch chain latches with the db_block_lru_latches parameter.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1185

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

• Library cache latches: Protects cached SQL statements in the library cache area of the Oracle shared pool. Contention for this latch is the usual result of literals being used for SQL statements instead of bind variables.

Other routine latch contention problems used to include the redo allocation and redo copy latches, but these have pretty much been made obsolete in Oracle 8.1.5 and higher.

S

ESSIONS

The Sessions tab of the RAC Detail view is divided into the following sections:

User Session by Instance - The User Session by Instance section provides a graphical count of the number of connected sessions for each node in the RAC.

Blocks by Instance - The Blocks by Instance section provides a graphical count of the number of blocked sessions for each node in the RAC.

User Waits by Instance - The User Waits by Instance section provides a graphical count of the number of historical session waits (non-idle) for each node in the RAC.

Top Sessions - When a system experiences heavy activity, sometimes you’ll find that all the user connections are contributing somewhat equally to the overall load. Often, however, one or two user connections are causing most of the activity. It may be that a large batch load or other typical process is running that is perfectly OK for your system. Or it may be a runaway process or other rogue connection that needs to be tracked down and possibly eliminated.

The top sessions control displays information regarding all key metrics for all current sessions on a database. Information presented includes:

• SID: The system ID of the process

• Instance: The instance the session is connected to

• Username: The username of the process

• O/S ID: The operating system ID of the process

• Machine Name: The workstation where the process originated

• Logon Time: The date/time the process logged on to Oracle

• Tot Physical I/O: A summation of all physical reads and physical writes for the process

(includes direct)

• Tot Physical I/O: A summation of all logical I/O (buffer gets, consistent gets, etc.) for the process

• Parses: The total number of parses the process has caused

• Total CPU: The total CPU usage for the process

• Parse CPU: The amount of process CPU caused by parse activity

• Recursive CPU: The amount of process CPU caused by recursive calls

11 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

• Other CPU: Total CPU usage minus parse and recursive activity. This can be a negative number if the Oracle kernel is not properly reporting total CPU usage

• Disk sorts: The total number of disk sorts caused by the process

• Memory sorts: The total number of memory sorts caused by the process

• Rows sorted: The total number of rows sorted by the process

• Commits: The total number of commits executed by the process

• Rollbacks: The total number of rollbacks executed by the process

• Physical reads: The total number of physical reads produced by the process

• DB block gets: The total number of block gets produced by the process

• Consistent gets: The total number of consistent gets produced by the process

• Consistent changes: The total number of consistent changes produced by the process

R

ESPONSE

T

IME

A

NALYSIS

V

IEW

(O

RACLE

10G O

NLY

)

The Response Time Analysis View displays statistics that are a part of the Oracle 10g wait enhancements. By analyzing response times, you can review historical data and pinpoint who was on a database and what they were doing during a specific period of time. This allows you to drill deep into the root causes, if any of response time problems, up to 24 hours after the fact.

The main Response Time Analysis View displays the following tabbed pages:

Response Time

Session Bottlenecks

Active Time

Wait Histogram

System Bottlenecks

Historical Session Analysis

R

ESPONSE

T

IME

The Response Time tab of the Response Time Analysis View displays the following statistics:

Current Workload

Last Hour Detail

Current Response Times Last Hour

C

URRENT

W

ORKLOAD

The Current Workload section provides a breakdown of active and idle time for the Oracle database engine in terms of percentage used.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) > Response

Time

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1187

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metrics Seeing consistently high percentages for the Database CPU Time (greater than 75-90%) should indicate a possibly overworked server.

Correction If you see high numbers for the Database CPU Time, then begin looking into these statistics:

SQL Statements with high elapsed times and CPU times (use the Top SQL view to find these).

Sessions with high wait times (especially in the User I/O wait class).

C

URRENT

R

ESPONSE

T

IMES

The Current Response Times section provides a quick view into the current average response time that a transaction experiences on the system along with the current average SQL service time. Both statistics are expressed in seconds.

Location

Metrics

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) > Response

Time

Defining ‘good’ and ‘bad’ metrics for these two measurements can only be accomplished by viewing these statistics over time and determining what ‘normal’ is for your system. You can get help by checking the Last Hour section, which details the minimum, maximum, and average values for these statistics as well as other key metrics that provide insight into how well your database is running.

L

AST

H

OUR

The Last Hour section provides a window into various key performance metrics. Each metric's minimum, maximum, and average value is displayed.

Location

Metrics

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) > Response

Time

Key metrics to keep an eye on include:CPU usage per Txn, Database CPU Time Ratio, Response Time

Per Txn, and SQL Service Response Time.

Correction If you see high numbers for the Database CPU Time, then begin looking into these statistics:

SQL Statements with high elapsed times and CPU times (use the Top SQL view to find these).

Sessions with high wait times (especially in the User I/O wait class).

L

AST

H

OUR

D

ETAIL

The Last Hour Detail section provides a graphical look back over the last hour of a selected performance metric. Oracle10g and higher automatically maintains a running history of selected metrics so you can observe trends and patterns in performance.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) > Response

Time

11 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

A

CTIVE

T

IME

The Active Time tab of the Response Time Analysis detail view displays the following statistics:

System Time Summary

System Time Detail

Session Time Detail

S

YSTEM

T

IME

S

UMMARY

The System Time Summary section allows you to see where, in broad terms, the database engine has been spending the largest percentages of its time.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Active

Time

Metrics

The metrics shown here include (note, this table is largely from Oracle 10g documentation):

Metric

DB Time

DB CPU background cpu time sequence load elapsed time parse time elapsed

Description

You see the amount of elapsed time (in microseconds) spent performing Database userlevel calls. Instance background processes such as PMON are not included.

Amount of CPU time (in microseconds) spent on database user-level calls. Instance background processes such as PMON are not included.

Amount of CPU time (in microseconds) taken up by database background processes.

Amount of elapsed time spent getting the next sequence number from the data dictionary. If a sequence is cached, then this is the amount of time spent replenishing the cache when it runs out. No time is charged when a sequence number is found in the cache. For non-cached sequences, some time is charged for every nextval call.

Amount of elapsed time spent parsing SQL statements. Both soft and hard parse times are included.

hard parse elapsed time Amount of elapsed time spent hard parsing SQL statements.

sql execute elapsed time Amount of elapsed time SQL statements are executing. NOTE: For select statements this also includes the amount of time spent performing fetches of query results.

connection management call elapsed time

Amount of elapsed time spent performing session connect and disconnect calls.

failed parse elapsed time Amount of time spent performing SQL parses that ultimately fail with some parse error.

hard parse (sharing criteria) elapsed time hard parse (bind mismatch) elapsed time

PL/SQL execution elapsed time

PL/SQL compilation elapsed time

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from not being able to share an existing cursor in the SQL cache.

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from bind type or bind size mismatch with an existing cursor in the SQL cache.

Amount of elapsed time spent running the PL/SQL interpreter. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing the Java VM.

Amount of elapsed time spent running the PL/SQL compiler.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1189

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metric inbound PL/SQL rpc elapsed time

Java execution elapsed time

Description

Time inbound PL/SQL remote procedure calls have spent executing. It includes all time spent recursively executing SQL and JAVA, and therefore is not easily related to "PL/SQL execution elapsed time".

Amount of elapsed time spent running the Java VM. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing PL/

SQL.

S

YSTEM

T

IME

D

ETAIL

The System Time Detail section allows you to see where the database engine has been spending its time. Both raw time and percentage of total metrics are included.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Active

Time

Metric

The metrics shown here include (note, this table is largely from Oracle 10g documentation):

Metric

DB Time

Description

Amount of elapsed time (in microseconds) spent performing Database user-level calls.

This does not include the time spent on instance background processes such as PMON.

DB CPU Amount of CPU time (in microseconds) spent on database user-level calls. This does not include the CPU time spent on instance background processes such as PMON.

background cpu time sequence load elapsed time

Amount of CPU time (in microseconds) consumed by database background processes.

Amount of elapsed time spent getting the next sequence number from the data dictionary. If a sequence is cached, then this is the amount of time spent replenishing the cache when it runs out. No time is charged when a sequence number is found in the cache. For non-cached sequences, some time will be charged for every nextval call.

parse time elapsed Amount of elapsed time spent parsing SQL statements. It includes both soft and hard parse time.

hard parse elapsed time Amount of elapsed time spent hard parsing SQL statements.

sql execute elapsed time Amount of elapsed time SQL statements are executing. Note that for select statements this also includes the amount of time spent performing fetches of query results.

connection management call elapsed time

Amount of elapsed time spent performing session connect and disconnect calls.

failed parse elapsed time Amount of time spent performing SQL parses which ultimately fail with some parse error.

hard parse (sharing criteria) elapsed time

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from not being able to share an existing cursor in the SQL cache.

hard parse (bind mismatch) elapsed time

PL/SQL execution elapsed time

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from bind type or bind size mismatch with an existing cursor in the SQL cache.

Amount of elapsed time spent running the PL/SQL interpreter. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing the Java VM.

PL/SQL compilation elapsed time

Amount of elapsed time spent running the PL/SQL compiler.

11 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metric inbound PL/SQL rpc elapsed time

Java execution elapsed time

Description

Time inbound PL/SQL remote procedure calls have spent executing. It includes all time spent recursively executing SQL and JAVA, and therefore is not easily related to "PL/SQL execution elapsed time".

Amount of elapsed time spent running the Java VM. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing PL/

SQL.

S

ESSION

T

IME

D

ETAIL

This section allows you to see where sessions that are currently logged on are spending their time.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Active

Time

Metrics

The metrics shown here include (note, this table is largely from Oracle 10g documentation):

Metric

DB Time

Description

Amount of elapsed time (in microseconds) spent performing Database user-level calls.

This does not include the time spent on instance background processes such as PMON.

DB CPU Amount of CPU time (in microseconds) spent on database user-level calls. This does not include the CPU time spent on instance background processes such as PMON.

background cpu time sequence load elapsed time

Amount of CPU time (in microseconds) consumed by database background processes.

Amount of elapsed time spent getting the next sequence number from the data dictionary. If a sequence is cached, then this is the amount of time spent replenishing the cache when it runs out. No time is charged when a sequence number is found in the cache. For non-cached sequences, some time will be charged for every nextval call.

parse time elapsed Amount of elapsed time spent parsing SQL statements. It includes both soft and hard parse time.

hard parse elapsed time Amount of elapsed time spent hard parsing SQL statements.

sql execute elapsed time Amount of elapsed time SQL statements are executing. Note that for select statements this also includes the amount of time spent performing fetches of query results.

connection management call elapsed time

Amount of elapsed time spent performing session connect and disconnect calls.

failed parse elapsed time Amount of time spent performing SQL parses which ultimately fail with some parse error.

hard parse (sharing criteria) elapsed time

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from not being able to share an existing cursor in the SQL cache.

hard parse (bind mismatch) elapsed time

PL/SQL execution elapsed time

Amount of elapsed time spent performing SQL hard parses when the hard parse resulted from bind type or bind size mismatch with an existing cursor in the SQL cache.

Amount of elapsed time spent running the PL/SQL interpreter. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing the Java VM.

PL/SQL compilation elapsed time

Amount of elapsed time spent running the PL/SQL compiler.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1191

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

Metric inbound PL/SQL rpc elapsed time

Java execution elapsed time

Description

Time inbound PL/SQL remote procedure calls have spent executing. It includes all time spent recursively executing SQL and JAVA, and therefore is not easily related to "PL/SQL execution elapsed time".

Amount of elapsed time spent running the Java VM. This does not include time spent recursively executing/parsing SQL statements or time spent recursively executing PL/

SQL.

S

YSTEM

B

OTTLENECKS

The System Bottlenecks tab of the Response Time Analyst detail view displays the following information:

Bottleneck Summary Bottleneck Detail

Bottleneck History (One Hour)

B

OTTLENECK

S

UMMARY

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The

Bottleneck Summary section presents the broad categories of waits (called classes) so you can see if, for example, User I/O is causing high wait times. The percentage of each wait class is shown in the pie chart.

Location

Metrics

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

System

Bottlenecks

Details can be viewed for the wait classes by drilling down into the System Waits view.

B

OTTLENECK

D

ETAIL

Waits on a system generally occur for one of three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

11 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention. The

Bottleneck Detail section presents the broad categories of waits (called classes) so you can see if, for example, User I/O is causing high wait times. The wait class, total waits, percentage of total waits, wait time (in seconds) and percentage of wait time is shown. Note that all these metrics are cumulative since the instance was started.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

System

Bottlenecks

Metrics

Details can be viewed for the wait classes by drilling down into the System Waits view.

B

OTTLENECK

H

ISTORY

(O

NE

H

OUR

)

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention.

The Bottleneck History section allows you to view wait counts, wait time, or a count of user sessions waiting over the past hour for all the specific wait classes (User I/O, System I/O, etc.)

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

System

Bottlenecks

S

ESSION

B

OTTLENECKS

The Session Bottlenecks tab of the Response Time Analysis detail view displays the following information:

Session Bottleneck Summary

Session Bottleneck Detail Session Wait History (One Hour)

S

ESSION

B

OTTLENECK

S

UMMARY

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1193

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention.

The Session Bottleneck Summary section shows where currently logged on sessions have been spending the largest percentages of their time (over broad wait classes).

Location

Metrics

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Session

Bottlenecks

To view the actual wait events that comprise the highest percentages of time viewed in each wait class, drill down into the Session Waits view.

S

ESSION

B

OTTLENECK

D

ETAIL

Waits on a system generally occur for three reasons:

1 A process waits because it has no work to do.

2 A process waits because a requested resource is not available.

3 A process waits for Oracle to perform a prerequisite task for its given operation.

Idle waits (processes waiting because they have no work) are not normally a problem, however the other two wait causes are the ones worth your time and investigation. From a global database level, there are many different types of waits and sources of contention.

The Session Bottleneck Detail section shows where currently logged on sessions have been spending the largest percentages of their time (over broad wait classes). Each session is shown along with its SID, user name, wait class, total waits, time waited (in seconds), and percent of total time.

Location

Metrics

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Session

Bottlenecks

To view the actual wait events that comprise the highest wait times/percentages of time viewed in each wait class, drill down into the Session Waits view.

S

ESSION

W

AIT

H

ISTORY

(O

NE

H

OUR

)

The Session Wait History allows you to look back over the last hour to see when sessions where waiting, how many waits occurred, and the amount of wait time associated during a specific period of time. Analyzing such data over time will give you an idea of how often waits are occurring and their overall impact on system performance.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Session

Bottlenecks

11 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

W

AIT

H

ISTOGRAM

The Wait Histogram view allows you to view a histogram of wait times and wait counts for a variety of wait events. Using the wait histogram view, you can see, for example, that a db file scattered read event had 20 waits that took an average of 1 second and 10 waits that took an average of 2 seconds, and so on. This allows you to get a better idea of the actual impact of various wait events than viewing broad percentages or averages.

H

ISTORICAL

S

ESSION

A

NALYSIS

The Historical Session Analysis tab of the Response Time Analysis detail view shows data for:

• Historical Session Analysis

• Historical Session Analysis Detail - All Waits

H

ISTORICAL

S

ESSION

A

NALYSIS

Oracle10g and above allow you to review various historical performance metrics for your database. The Historical Analysis graph allows you to input a time period and review wait times to see when your server experienced high volumes of wait activity. You can choose to look at global wait classes or specific waits events for wait classes.

You can also select a specific time period in the graph by drawing a box around part of the graph with your mouse. The graph will change to match your selection.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Historical

Session Analysis

H

ISTORICAL

S

ESSION

A

NALYSIS

D

ETAIL

- A

LL

W

AITS

Oracle10g and above allows you to review various historical performance metrics for your database. The Historical Analysis Detail section allows you to review specific details regarding times when your database server experienced unacceptable wait times. You can review historical response time data for sessions, SQL statements, files, and objects.

This section allows you, for example, to see what wait events long running SQL statements experienced and what objects caused excessive wait times.

Location

Oracle Performance Analyst Statistics >

Response Time Analysis View (Oracle 10G Only) >

Historical

Session Analysis

S

ESSION

D

ETAILS

The following tabbed pages are available on the Session Details page:

Current Work Tab

Locks Tab

Overview Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1195

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

SQL Tab

Waits Tab

O

VERVIEW

T

AB

Several sections are available on the Overview tab of the Session Details page. The table below describes the sections:

Section Description

Memory Usage The Memory Usage section defines the session's total memory usage against all session memory usage on the database.

I/O Activity The I/O section defines the session's total I/O consumption against all I/O activity on the database. NOTE Bugs in some versions of the Oracle data dictionary cause negative numbers to display if the database has experienced large amounts of I/O activity.

CPU Activity The CPU Activity section defines the session's total CPU consumption against all CPU usage on the database. NOTE Bugs in some versions of the Oracle data dictionary cause the total CPU usage for a session to not be calculated correctly.

Statistical Detail The Statistical Detail section details every performance metric available for the session. NOTE

Each measure continue to increment as long as the session stays connected to Oracle.

C

URRENT

W

ORK

T

AB

The Current Work tab of the Session Details page includes the following sections:

• Open Transactions

The following statistic, available on this tab, duplicates a statistic available on the Key User

Analysis Pane

• Open Cursors

O

PEN

T

RANSACTIONS

This Open Transactions section displays details regarding any open transaction that the session currently has. The table below describes the information available in this section:

Column

SQL Text

Start Time

Logical I/O

Physical I/O

Gets

Changes

Description

The SQL that contains the transaction.

The time the statement was issued.

The amount of memory I/O the transaction has used.

The amount of disk I/O the transaction has used.

A subset of logical I/O.

Any data modifications made by the transaction.

11 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

O R A C L E P E R F O R M A N C E AN A L Y S T S T A T IST I C S > O R A C L E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Location

Oracle Performance Analyst Statistics >

Session Details >

Current Work Tab

Metrics

Seeing a long running, persistent transaction might indicate a session caught in a loop or other coding snafu. Watching a transaction sit idle could clue you into a lock contention problem that exists.

W

AITS

T

AB

The Waits tab of the Session Details page includes the following sections:

Time Summary (Oracle 10g only) Last Ten Waits (Oracle 10g only)

The following statistics, available on this tab, are duplicates of statistics available on the

System

Waits Tab

of the Users

page:

Historical Waits

Current Waits

T

IME

S

UMMARY

(O

RACLE

10

G ONLY

)

The Time Summary section shows you where the session has been spending its time. Using the

Time Summary section, you can easily determine if a session has been bottlenecked by SQL calls, PL/SQL work, or other activities.

Location

Oracle Performance Analyst Statistics >

Session Details >

Waits Tab

L

AST

T

EN

W

AITS

(O

RACLE

10

G ONLY

)

The Last Ten Waits section shows you, in order, the last 10 wait events experienced by the session, along with other important metrics like the wait time, and so forth.

Location

Oracle Performance Analyst Statistics >

Session Details >

Waits Tab

L

OCKS

T

AB

The following statistics, available on this tab, are duplicates of statistics availale on the Locks/

Blocking Locks Tab

of the Users

page:

All Locks Blocking Locks

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1197

OR AC L E P E R FO R M A N C E A N A L YS T ST A T IS T IC S > ORA C L E P E R FOR M A N C E A N AL Y S T ST A T IS TI C S

SQL T

AB

The SQL tab of the Session Details page includes the following sections:

Current SQL Current SQL Statistics Other SQL

C

URRENT

SQL

The Current SQL section displays the most current SQL issued by the session.

NOTE:

You can run an EXPLAIN PLAN on the SQL or (if you have Embarcadero SQL Tuner installed) tune the SQL for better performance.

Location

Oracle Performance Analyst Statistics >

Session Details >

SQL Tab

C

URRENT

SQL S

TATISTICS

The Current SQL Statistics section displays the performance execution metrics for the current

SQL statement in graphical format. Physical and logical I/O is displayed along with rows processed and number of executions.

Location

Oracle Performance Analyst Statistics >

Session Details >

SQL Tab

O

THER

SQL

The Other SQL section displays other SQL that has been parsed by the Oracle username. The table below describes the information available in this section:

Column

SQL Text

Disk Reads

Buffer Gets

Rows Processed

Executions

Sorts

Description

A snippet of the SQL code issued.

The number of total disk reads for the statement.

The number of total buffer gets for the statement.

The number of total rows processed for the statement.

The number of times the statement has been executed.

The number of sorts for the statement.

NOTE:

Bugs in some versions of Oracle will cause negative numbers to display for various execution metrics.

11 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

SQL S

ERVER

T

UTORIAL

Embarcadero Performance Analyst provides key insight into the complex world of database performance. Running inside the Embarcadero DBArtisan console, or standalone in a Web browser, Performance Analyst helps you pinpoint performance problems that threaten a database’s availability or response times. The powerful analysis facilities will satisfy advanced experts, yet novices will find Performance Analyst’s interface easy to use and the expert help a welcome aid to troubleshooting difficult performance issues.

Proceed to

About This Performance Analyst for Microsoft Tutorial

A

BOUT

T

HIS

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

T

UTORIAL

This tutorial is intended to help you get started with Embarcadero Performance Analyst.

After completing this tutorial, you will have the foundation you need to explore the many features and benefits of Performance Analyst. You will have learned how to accurately monitor your database using the most popular performance methodologies in use today. You will know how to drill down into the many layers of database performance and also be able to locate performance issues in your database in a fast and effective manner. Finally, you’ll understand how to fix performance problems using the integration that exists between Performance Analyst and Embarcadero DBArtisan.

This tutorial is divided into 8 sections.

Session 1: Getting Started with Performance Analyst for Microsoft

Session 2: Using Ratio-based Performance Analysis in Performance Analyst for Microsoft

Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for

Microsoft

Session 4: Using Workload Performance Analysis in Performance Analyst for Microsoft

Session 5: Using SQL Performance Analysis in Performance Analyst for Microsoft

Session 6: Using Operating System Performance Analysis in Performance Analyst for Microsoft

Session 7: Identifying and Getting Help With Performance Problems Using Performance Analyst for Microsoft

Session 8: Fixing Identified Problems Using Performance Analyst for Microsoft

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief guide.

For more information, see Additional Evaluation Resources .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1199

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

S

ESSION

1: G

ETTING

S

TARTED WITH

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Download and Install

You can obtain the latest version of Performance Analyst by downloading the DBArtisan software from the Embarcadero Web site at http://www.embarcadero.com/downloads/ downloaddbartisan.asp

. Performance Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Performance Analyst (although Performance Analyst can also run in standalone fashion within a Microsoft Internet Explorer Web browser).

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Overview of Performance Analyst for Microsoft

O

VERVIEW OF

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

When DBArtisan is connected to a Microsoft SQL Server database, you can open Performance

Analyst two ways:

1 On Utilities menu, select Performance Analyst.

For Performance Analyst to work, several procedures need to be installed by the SA account.

When Performance Analyst is first invoked, it will check for the presence of this package and if it has not been installed, the product will prompt you to install it. Once created, any account with access to these procedures may monitor databases using Performance Analyst. No other objects need to be installed on a monitored database.

Proceed to

Performance Analyst for Microsoft Product Navigation

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

P

RODUCT

N

AVIGATION

Navigating through Performance Analyst is easily accomplished through two main mechanisms:

1 The main Performance Analyst toolbar contains buttons that invoke the major performance analysis views within the product as well as frequently used actions like Refresh and

Performance Threshold Customizations.

2 Positioning the mouse pointer on any area within Performance Analyst and clicking the right mouse button will bring up a navigation menu that allows you to easily move between any of the main Performance Analyst home pages and drill down views. The right mouse menu also contains context sensitive options like drilling down further into a particular statistic, copying the display to a text file, and more.

Proceed to

Session 2: Using Ratio-based Performance Analysis in Performance Analyst for

Microsoft

12 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

S

ESSION

2: U

SING

R

ATIO

-

BASED

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Ratio-based analysis has been around for many years, and used to be the only technique database administrators used when they were called on to diagnose the cause of a database slowdown. Performance ratios are very good roll-up mechanisms for busy DBAs, making possible the analysis-at-a-glance approach, however ratios must be computed correctly for them to be meaningful. Key ratios in Performance Analyst are calculated using delta statistics, which is superior to computing ratios with cumulative values. Delta statistics, which are values derived by using the before and after measures in each statistical refresh done in Performance Analyst, lets you see changes in performance metrics that would otherwise be invisible if cumulative statistics were used. Performance Analyst makes it easy to see the ratios that are computed with delta statistics vs. cumulative. A triangle symbol denotes a delta-based statistic, while square symbols represent a cumulative-based measure.

Ratio-based analysis is available for all performance categories (memory, etc.) where ratios can assist in determining the performance level of a database. For example, if you would like to see memory-specific ratios, on the Performance Analyst toolbar click Memory. Performance Analyst displays the Memory home page that showcases all important memory-related ratios.

Proceed to

Obtaining Detail Information for a Ratio using Performance Analyst for Microsoft

O

BTAINING

D

ETAIL

I

NFORMATION FOR A

R

ATIO USING

P

ERFORMANCE

A

NALYST

FOR

M

ICROSOFT

A ratio gives you a global picture for a particular performance measure. However, you often need more information regarding a statistical measure so you can make an informed decision.

Performance Analyst has easy-to-use drill down features that make obtaining detailed information for various ratios a breeze.

For example, to view more information for the Buffer Cache Hit Ratio statistic, do the following:

1 On either the Main Home page or the Memory Home page, locate the Buffer Cache Hit

Ratio statistic.

2 Position the pointer over the statistic.

The pointer changes to a hand symbol.

3 Double-click the left mouse button.

Performance Analyst opens the Buffer Cache Tab of the memory drill down view.

OR

4 Right-click the statistic, select Details.

OR

5 Select Navigate to, Memory, Buffer Cache.

Performance Analyst opens the Buffer Cache Tab of the memory drill down view.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1201

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

Proceed to Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for Microsoft

S

ESSION

3: U

SING

B

OTTLENECK

/

WAIT

-

BASED

P

ERFORMANCE

A

NALYSIS

IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

When a Microsoft SQL Server database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things, or it can be an indicator that a database bottleneck exists. Bottleneck analysis is a valid method of measuring performance because it helps you track where a database and user sessions have been spending their time. If latch contention or heavy tablescan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause.

Performance Analyst uses two broad areas of metrics to form its bottleneck analysis. The first is the Microsoft SQL Server wait event interface, which displays where the database and user sessions have been bottlenecked. But, when using bottleneck analysis you can not rely only on the information contained in the wait event views that Microsoft SQL Server provides. For example, an object may attempt to extend into another extent of space in a tablespace and yet, be denied if no such free space exists. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. For this reason, Performance Analyst also shows non-wait event based bottlenecks that represent a very real threat to a database’s availability and performance.

Performance Analyst prominently displays bottleneck analysis on every performance home page. The Main home page, displays a summary of all key bottlenecks threatening the database.

You can also see specific bottlenecks for memory, I/O, space, objects, and users by navigating to each home page and viewing the Bottleneck Analysis section for that home page. For example, to see bottlenecks that specifically relate to I/O, do the following

1 On the toolbar, click the I/O button.

2 Locate the Bottleneck Analysis section at the lower-left portion of the screen.

The I/O bottleneck analysis section displays the Top I/O Wait Events by wait count and wait time, along with the Hottest Database and Log Files.

Proceed to

Obtaining Detail on System Bottlenecks Using Performance Analyst for Microsoft

O

BTAINING

D

ETAIL ON

S

YSTEM

B

OTTLENECKS

U

SING

P

ERFORMANCE

A

NALYST FOR

12 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

M

ICROSOFT

You can easily obtain more information regarding global bottlenecks that are plaguing a database by drilling down into a particular bottleneck metric. For example, if you would like to see more data regarding the current top system bottlenecks, do the following:

1 Open the Main home page.

2 Double-click the Top System Bottlenecks area.

Performance Analyst opens the System Waits view.

3 Or right-click anywhere in Performance Analyst, point to Users, and then click System Waits.

Performance Analyst opens the System Waits view.

The System Waits view displays critical details regarding all the wait events that Microsoft SQL

Server has recorded. You can easily see what events that occurred the most often as well as the events that have accumulated the most wait time.

TIP:

If you would like to see an expanded view of the System waits grid shown on the top of the System Waits view, click the Expand button located at the top right corner of the section. All section views in Performance Analyst can be maximized/minimized using this control.

Proceed to

Viewing Detail for Session Bottlenecks Using Performance Analyst for Microsoft

V

IEWING

D

ETAIL FOR

S

ESSION

B

OTTLENECKS

U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Not only can you obtain detail information for system bottlenecks, but you can also use

Performance Analyst to get drill down information regarding session-level bottlenecks. There are several layers to session-level details you can view.

To see more information regarding session-level waits, do the following:

1 Open the Main home page.

2 Double-click the Top Session Bottlenecks area.

OR

3 Right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Performance Analyst opens the Session Waits drill down view.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1203

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

When you are in the Session Waits drill down view, to drill further into a session’s details, do the following:

1 In the Historical Waits or Current Waits grid, select a session that appears to be experiencing critical waits.

2 Double-click the session or right-click, and then select Details.

Performance Analyst opens a drill down view that shows key statistics for the selected session, including its current work activities, wait events, and SQL statements.

Proceed to

Session 4: Using Workload Performance Analysis in Performance Analyst for

Microsoft

S

ESSION

4: U

SING

W

ORKLOAD

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Key ratios give you a global perspective on database activity. Bottleneck analysis gives you insight into things that are holding up user activity and throughput. But another technique is necessary if a database professional is to really get a handle on what’s occurring inside a badly performing database.

Workload analysis involves the investigation of two critical areas of a database’s performance:

• Session resource consumption and activity

• SQL execution

Without looking at these two key performance categories, you can miss a lot of what could be responsible for perceived performance problems. When performance on a database takes a sudden nosedive, it is not uncommon to find one or two sessions that are causing the bulk of the workload. Finding these processes can be easily accomplished by viewing session metadata coupled with resource consumption and statistical execution statistics.

Proceed to

Pinpointing Top Resource Consumers Using Performance Analyst for Microsoft

P

INPOINTING

T

OP

R

ESOURCE

C

ONSUMERS

U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Performance Analyst identifies top resource consumers in a couple of different ways. On the main home page, Performance Analyst highlights the top resource sessions across I/O, memory usage, and CPU consumption. The percentage used across all statistical categories are displayed so a DBA can immediately pinpoint a session that is using all or most of a particular resource. The top resource sessions are also displayed on the memory, I/O, and other home pages as well with a listing for the top sessions for that category (for example, the top memory users appear on the memory home page, etc.)

Proceed to

Getting Workload Details Using Performance Analyst for Microsoft

12 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

G

ETTING

W

ORKLOAD

D

ETAILS

U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Performance Analyst offers several details on top resource sessions in addition to the summaries provided on each home page. A detailed and flexible top sessions view lets you view a summary of all the major resource sessions on the database as well as every critical detail regarding each session connected to the database.

Further drill downs are available that highlights specific details regarding each session’s activities and submitted SQL. To see detailed information regarding a session identified in one of

Performance Analyst’s Workload Analysis sections, do the following:

1 In a Workload Analysis display, position the pointer over one of the processes.

2 Double-click the process or right-click, and then select Details.

If you want like to see all key workload analysis metadata for sessions, do the following:

1 On the toolbar, click the Top Sessions button.

OR

2 Right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Proceed to

Session 5: Using SQL Performance Analysis in Performance Analyst for Microsoft

S

ESSION

5: U

SING

SQL P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

SQL-based performance analysis is really a subset of Workload Analysis. Understanding current and historical SQL execution patterns lets you to have the second set of data points necessary to properly perform workload analysis. You may find that optimizing SQL code produces some of the best performance-enhancing boosts available for a database.

Proceed to

Uncovering Resource-intensive SQL Using Performance Analyst for Microsoft

U

NCOVERING

R

ESOURCE

-

INTENSIVE

SQL U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Performance Analyst offers plenty of insight into SQL performance and execution patterns. Each one of the home pages depicts the most costly SQL statements as determined by a variety of different metrics for that performance category (most physical, logical I/O, etc.) For example,

Performance Analyst might show that a single SQL statement is responsible for almost 60 percent of all the CPU consumption on the database.

Proceed to

Getting Details on Top SQL with Performance Analyst for Microsoft

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1205

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

G

ETTING

D

ETAILS ON

T

OP

SQL

WITH

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Getting details on identified SQL statements is easy in Performance Analyst. For example, if you would like to see further information on a SQL statement identified on the Performance Analyst

Home page, do the following:

1 In the SQL Analysis section, position the pointer over Hash Values.

2 Double-click or right-click, and then select Details.

Performance Analyst opens the Top SQL summary page that shows a breakdown of all top

SQL statements along with their execution statistics.

If you would like to see the full SQL text of a SQL statement, do the following

1 In the Top SQL Details section, double-click a statement.

Performance Analyst opens the SQL Details Tab of the Top SQL view to display the entire

SQL statement and the execution metrics. While on this pane, you can also perform an

EXPLAIN of the SQL statement and examine its access path information.

To automatically tune a problem SQL statement if you have Embarcadero SQL Tuner installed on your workstation, do the following:

1 On the SQL Details Tab, select a problem statement, and then click the Tune SQL button.

SQL Tuner opens and you can begin a tuning session.

Proceed to

Session 6: Using Operating System Performance Analysis in Performance Analyst for

Microsoft

S

ESSION

6: U

SING

O

PERATING

S

YSTEM

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O or Memory), a slow CPU, insufficient I/O devices, and insufficient memory. Performance Analyst allows the DBA to examine the relevant operating system metrics for Windows Platforms (NT /2000/XP/2003) as they relate to SQL Server.

To view the operating system metrics of the machine hosting the SQL Server you are monitoring, do the following:

1 Click the OS Performance Analyst toolbar button.

OR

2 Navigate to the OS Home Page by going to OS, and then Home.

NOTE:

The first time you invoke the OS feature you will be prompted for an operating system login. Please specify the correct operating system, host name, username & password and protocol.

12 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

The Operating System home page has been designed in a similar fashion as the datasource home page. On this page you can see the pertinent operating system metrics displayed in five quadrants broken down into the following categories:

• Resource Usage

• Memory Analysis

• Disk Analysis

• Workload Analysis

• Bottleneck Analysis

Proceed to

Obtaining Details on the Operating System Using Performance Analyst for Microsoft

O

BTAINING

D

ETAILS ON THE

O

PERATING

S

YSTEM

U

SING

P

ERFORMANCE

A

NALYST

FOR

M

ICROSOFT

You can easily obtain more information regarding operating system problems that are degrading database performance by drilling down into a particular analysis quadrant. For example if you'd like to see more information regarding the processes running on the host machine, do the following:

1 Navigate to the Performance Analyst Operating System home page.

2 Double-click the Top Memory Processes in the Workload Analysis quadrant.

Performance Analyst opens the Processes Drilldown view.

OR

3 Right-click anywhere in Performance Analyst and select the Navigate to, OS, and then

Processes.

The Processes detail tab shows all the processes on the host machine. From this view you can easily determine which processes are showing high marks in I/O or CPU, for example, by simply double clicking on the column headers and sorting the processes in ascending or descending order.

Proceed to

Session 7: Identifying and Getting Help With Performance Problems Using

Performance Analyst for Microsoft

S

ESSION

7: I

DENTIFYING AND

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

You do not have to be an advanced expert in performance tuning to spot trouble in a database if you use Performance Analyst. There are a number of mechanisms in the tool that help you quickly locate areas of concern within a database.

Proceed to

Using the Alarm Log in Performance Analyst for Microsoft

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1207

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

U

SING THE

A

LARM

L

OG IN

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Performance Analyst has a central and flexible alarm log that lists every performance violation found in all monitored databases. Unlike some products that only show you alarms for a particular database, Performance Analyst lists all alarms for each database you are monitoring in one central log so you can see every problem in one place. To view the Performance Analyst

Alarm log, do the following:

1 On the toolbar, click the Alarms button.

Once in the Alarm log, you can perform a number of actions including:

• Selecting an alarm and viewing the application page that shows details regarding the metric in violation.

• Filtering the types of alarms shown through the Options dialog.

• Clearing all current alarms.

• Copying or saving the Alarm log into a different format.

To select any of these options, do the following:

1 Position the pointer over any area of the Alarm Log.

2 Right-click and In the shortcut menu, select an option.

Proceed to

Recognizing Performance Violations Using Performance Analyst for Microsoft

R

ECOGNIZING

P

ERFORMANCE

V

IOLATIONS

U

SING

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

Performance Analyst makes it easy to visually pinpoint performance violations in a database. Any statistic that does not conform to your predefined performance standards is colorized in any view that it appears so you can easily see potential troublespots.

The colors used to highlight a particular performance violation depend on the severity of the problem. Performance Analyst uses several layers of performance standards/threshold violations with each layer being represented by a different color. You can control everything regarding threshold violations, including how thresholds are determined, their color representation in

Performance Analyst’s display, and more by using the Threshold Template feature of

Performance Analyst.

How can Performance Analyst inform you of performance violations in your database if you minimize the product to your desktop and are working on other things? Even if Performance

Analyst is not right in front of you, it can still let you know that a problem has been found in your database through the systray alarm icon. When Performance Analyst detects a problem in one of your databases, one of the things the product does is enable an alarm icon in your workstation’s systray area that communicates the presence of alarms in your database. So even if the

Performance Analyst interface is not in sight, the product can let you know that something in your database requires attention.

Proceed to

Creating Threshold Templates for Performance Analyst for Microsoft

12 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F O R M A N C E A N A LY S T F O R M IC RO SO FT S QL S ER VE R TU T ORI AL > P E R F O R M A N C E A N AL Y S T F O R

C

REATING

T

HRESHOLD

T

EMPLATES FOR

P

ERFORMANCE

A

NALYST FOR

M

ICROSOFT

How does Performance Analyst know what to signal as a problem in a database? It uses predefined performance standards that you define and enforce. All of this is accomplished by using Performance Analyst’s Threshold templates. A template is a set of performance metrics and their thresholds that can be reused to enforce performance standards across any number of databases. Embarcadero provides a default performance template that contains nearly all of the most-watched performance statistics so you can begin monitoring with confidence right out of the box. However, you can create your own Threshold templates so you only are alerted to performance violations that are important to you and your particular environment.

To view or create Threshold templates, do the following:

1 On the toolbar, click the Thresholds button.

Performance Analyst opens the Threshold Template Properties dialog box.

The Threshold Template Properties dialog box lets you select the options to add or edit templates, as well as other maintenance options. For example, you can copy the original

Embarcadero Threshold template and modify it to fit your own needs. You can control what statistics are sampled for performance violations as well as the levels of severity you would like reported. Once you are satisfied with your template, you can save it and then apply it to one or more datasources in one action to immediately begin enforcing your performance standards.

Proceed to

Getting Help With Performance Problems Using Performance Analyst for Microsoft

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST

FOR

M

ICROSOFT

As databases become more complex, so do the problems that plague them. Knowing what to do for a particular performance problem can be hard in some cases, but Performance Analyst helps by providing a complete set of expert help that you can use as a guide when performance problems occur. To obtain expert help for any statistic shown in Performance Analyst, do the following:

1 Position the pointer over a statistic that you need help.

2 Right-click and select Help.

The Expert Help gives you a general description of the statistic, the range of values that are considered optimal, and some suggestions on how to fix a problem situation. Expert help can also be invoked for any of the Ratio, Bottleneck, SQL, or Workload Analysis sections shown on every home page by clicking on the help icon for that section, which is located at the top right corner of the section.

Proceed to

Session 8: Fixing Identified Problems Using Performance Analyst for Microsoft

S

ESSION

8: F

IXING

I

DENTIFIED

P

ROBLEMS

U

SING

P

ERFORMANCE

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1209

PERF OR MANCE ANALYST FOR MI CROS OF T SQ L SE RV E R TUT O RIA L > P E R F O R M A N C E A N A L Y S T F OR

A

NALYST FOR

M

ICROSOFT

Finding performance problems is one thing, but fixing them is another. Many performance monitors point out a particular problem in a database, but then offer no way to actually correct the situation. Such is not the case with Performance Analyst. Because of its tight integration with

DBArtisan, certain problems found in Performance Analyst can be visually corrected by

DBArtisan.

A Space Problem Correction Example

If an Microsoft SQL Server tablespace is about to run out of free space, Performance Analyst can issue an alarm that a space shortage exists. Once the space problem has been identified, do the following:

1 On the Space home page toolbar, click the Space button.

2 In the Space Analyst grid, right-click a tablespace, and then select Manage with DBArtisan.

DBArtisan opens an editor where you can perform corrective actions, such as enabling

Autoextend for the tablespace, resizing the tablespace’s existing datafile(s), or adding a new datafile for the tablespace.

12 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

M

ICROSOFT

SQL S

ERVER

P

ERFORMANCE

A

NALYST

S

TATISTICS

This section includes expert help for all Microsoft SQL Server statistics in the Embarcadero

Performance Analyst views and pages:

Home

Space

OS

Memory

Users

Top SQL

I/O

Database

H

OME

The Embarcadero Performance Analyst Home page lets you review availability and overall performance of all monitored databases from a single window. Statistics on the Home view are organized into the following categories:

Key Ratio Analysis Pane

Storage Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

SQL Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBA's to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the master.sysperfinfo performance table. This table maintains a count of various statistics for the server and particular databases since the server was brought up. For servers that are kept up for long periods of time, these values can grow quite large and will impact how a particular ratio that a DBA might be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1211

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following ratios are used on the Performance Analyst Home page to succinctly communicate the general overall performance levels of the monitored database. The statistics

available in this pane, are duplicates of statistics available on the Key Ratio Analysis Pane of the

Home page:

B

UFFER

C

ACHE

H

IT

R

ATIO

Data read from memory will produce end-user response times many times faster than when that same data is read from disk. Keeping physical I/Os to an absolute minimum is one of the purposes of the SQL Server buffer/data cache.

The buffer cache hit ratio is a terrific indicator of how often user requests for data are satisfied through memory vs. being physically read from disk.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Buffer Cache Tab

Metrics To help ensure excellent performance, you want to keep your cache hit ratio in the neighborhood of

90% or higher. However, you should be aware that every server has its own 'personality' and might exhibit excellent performance with below average readings for the cache hit ratio. You should also be aware that excessive logical I/O activity can produce a very high cache hit ratio while actually degrading overall database performance.

Consistently viewed low readings (60% or lower) might require tuning attention on the part of the

DBA.

Correction Ensure SQL Server is configured to use as much physical memory as possible by checking the Max

Server memory configuration option. Also, consider increasing your SQL Server Min. Memory parameter to allocate more memory to SQL Server. (Note that to obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

Often a user process is taking a large amount of memory due to an inordinate amount of I/O.

P

ROCEDURE

P

LAN

H

IT

R

ATIO

The SQL Server procedure cache is used to hold the execution plans for all Transact-SQL statements currently executing in the server. When a user executes a Transact-SQL statement,

SQL Server looks in the procedure cache for a query plan to use.

This statistic is the percentage of query plan requests generated by stored procedures that are found in the procedure cache area. The percentage of times that a statement's plan and definition can be referenced in memory, the better the procedure execution time.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

12 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Metrics A high procedure cache hit rate is a desirable thing. You should strive for a hit ratio between 95-100%, with 95% being a good performance benchmark for code reference. Note that when a database is first started, the procedure cache hit rate will not be at an optimal level because all code being used will be relatively new, and as such, must be read in from disk and placed into the cache. If, however, after a solid hour or two of steady database time, the procedure cache hit rate has not increased to desirable levels, you should look into the possibility of increasing the amount of memory allocated to the cache.

Correction First, ensure SQL Server is configured to use as much physical memory as possible by checking the

Max Server Memory configuration option. Also, consider increasing your SQL Server Min Memory parameter to allocate more memory to SQL Server. (Note that to obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

A

D

H

OC

SQL H

IT

R

ATIO

When an ad hoc SQL statement is issued, the query plan is then stored in the SQL Server procedure cache area. If the identical ad hoc statement is launched in the future, SQL Server uses the query plan already stored in the procedure cache if it is still there. The Ad Hoc SQL Hit

Ratio statistic defines the percentage of times that a query plan for an ad hoc SQL statement is found in the procedure cache.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

A high ad hoc hit rate is desirable, but is harder to maintain at a high level than something like a procedure cache hit rate. Therefore, an 80% or greater ad hoc cache hit rate is a good performance benchmark for code reference. Note that when a database is first started, the ad hoc cache hit rate will not be at an optimal level because all code being used will be relatively new, and as such, must be read in from disk and placed into the cache. If, however, after a solid hour or two of steady database time, the ad hoc cache hit rate has not increased to desirable levels, you should look into the possibility of increasing the amount of memory allocated to the cache.

Correction First, ensure SQL Server is configured to use as much physical memory as possible by checking the

Max Server Memory configuration option. Also, consider increasing your SQL Server Min Memory parameter to allocate more memory to SQL Server. (To obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

L

OG

C

ACHE

H

IT

R

ATIO

The Log Cache Hit Ratio represents the percentage of log cache reads satisfied from the log cache.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Log Cache Tab

Correction A low percentage on this statistic is not necessarily a bad sign, as it is possible that the information needed from the log will not be readily available in memory.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1213

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

CPU B

USY

The CPU Busy statistic represents the percentage of time that the CPU has spent working since the last refresh.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Metrics Seeing consistently high numbers might signal an overworked server.

Correction If you consistently see high numbers for CPU busy, then drill down into session activity to see what processes are consuming the most CPU and look at their activity.

I/O B

USY

The I/O Busy statistic represents the percentage of time that SQL Server has spent performing input and output operations since the last refresh.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home >

Bottleneck Analysis Pane

S

ERVER

I

DLE

The Server Idle statistic represents the percentage of time that SQL Server has spent idle since the last refresh.

Location

Microsoft SQL Server Performance Analyst Statistics > Home > Key Ratio Analysis Pane

B

OTTLENECK

A

NALYSIS

P

ANE

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If lock contention or heavy table scan activity has been dragging down database performance, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about which sessions and objects are causing the problem. The Performance Analyst

Home page identifies the top system and session waits that might be currently a cause of lessened performance.

When using bottleneck analysis, you cannot rely only on the information contained in the wait events that SQL Server provides. For example, a database might be suspect or offline. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that a DBA cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their

12 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R overall bottleneck analysis framework to obtain an accurate performance risk assessment.

Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst

Home page displays space-related bottlenecks as well as other sources of contention/ bottlenecks that might be dragging down the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Current Object Blocks

Errors in Current Log

Suspect Databases

DB’s Low on Space

Logs Low on Space

Table Lock Escalations

Deadlocks

Offline Databases

Top System Bottlenecks

T

OP

S

YSTEM

B

OTTLENECKS

The Top System Bottlenecks display identifies the top waits that have occurred on SQL Server based on the wait time.

Location

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

C

URRENT

O

BJECT

B

LOCKS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

Unless a process times out via an application timeout mechanism, or the process has specified a timeout period via the SET LOCK_TIMEOUT command, a process waiting for a lock will wait indefinitely.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

You should immediately investigate any indicator above zero, before the situation has a chance to mushroom.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1215

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Then other user processes, almost always, complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is where it gets tricky. The DBA can drill down into

Users

detail and see all current blocking locks, learning exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process will wait for a lock before timing out.

D

EADLOCKS

This metric shows the number of deadlocks per second detected by SQL Server. Deadlocks occur when processes cannot proceed because they are waiting on a set of resources held by each other or held by other processes.

Location

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Metrics Consistently seeing deadlock counts greater than zero will indicate that some user processes are experiencing delays in completing their work. When SQL Server identifies a deadlock, it resolves the situation by choosing the process that can break the deadlock. This process is termed the deadlock victim. SQL Server rolls back the deadlock victim's transaction, and then notifies the process’ application by returning an error message. It also cancels the process’ request and allows the transactions of the remaining processes to continue. SQL Server always attempts to choose the least expensive thread running the transaction as the deadlock victim.

Correction Because SQL Server automatically resolves deadlock situations, you should proactively work to prevent them in the first place. The culprit of most blocking lock and deadlock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

You can change default deadlock behavior by using the SET DEADLOCK_PRIORITY command, which reprioritizes a process’ position in a deadlock situation.

T

ABLE

L

OCK

E

SCALATIONS

The Table Lock Escalations statistic represents the number of times locks on a table were escalated.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics

>

Users > Home

> The following key statistics are used on the Performance Analyst Users home page to succinctly communicate the general sessionbased activity levels of the monitored database:

Many table lock escalations could indicate contention problems. If increasing numbers of table lock escalations are viewed at the same time as blocking or deadlock problems, then the application design might be at fault.

12 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

S

USPECT

D

ATABASES

The Suspect Databases statistic represents the number of databases SQL Server has marked as suspect. Databases are marked suspect by SQL Server if they fail during automatic recovery, which is performed at server startup. If serious damage is experienced by a database during regular uptime, SQL server will also mark a database suspect.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

You should not have any suspect databases found on any production server. You should immediately investigate any non-zero numbers for this statistic.

Correction The steps to handling a suspect database will vary from one installation to another. However, there are some general guidelines you can use to troubleshoot a suspect database.

Begin by examining the SQL Server error log for clues as to what caused the database to be marked as suspect.

It is not unusual for a server to run out of physical disk space on drives used by SQL Server. When this happens, recovery for databases can sometimes fail with the end result being SQL Server marking a database as suspect. To remedy this situation, you should free up space on the identified drives or add files to the newly marked suspect database. For SQL Server 2000, this can be accomplished by utilizing the two procedures - sp_add_data_file_recover_suspect_db

and sp_add_log_file_recover_suspect_db

stored. For version 7.0 of SQL Server, you must use the sp_resetstatus

stored procedure to reset the suspect status flag for the database in question, use the alter database

command to add new datafiles to the database, and then stop/start the SQL

Server.

Many times, suspect databases are caused by SQL Server not being able to access a database or log file. This happens if a particular physical hard drive has become unavailable, but also can occur if another operating system process has obtained exclusive access to a file. If this scenario proves to be true, once you have ensured that the file(s) are available once again to the operating system, you can use the sp_resetstatus

stored procedure to reset the suspect status flag for the database and then stop/start the SQL Server.

If none of these solutions are possible, you will likely have to restore your database using the last full and transaction log backups.

O

FFLINE

D

ATABASES

The Offline Databases statistic represents the number of databases SQL Server has offline, meaning that no database modifications can occur.

Location

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

Metrics You should not have any offline databases found on any production server. You should immediately investigate any non-zero numbers for this statistic.

Correction Should an offline database be found by Performance Analyst, you can easily place it back online by utilizing either the sp_dboption stored procedure or the alter database command.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1217

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

E

RRORS IN

C

URRENT

L

OG

SQL Server records various system events in its system or error log. The majority of messages placed into the log are informational in nature, however since some contain critical messages, you should immediately review them. Performance Analyst indicates the number of actual error messages in the most recent error log so you know if there are potential events that require your attention.

Location

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Correction

Drill down into the Error Log Tab within Performance Analyst to view the actual error messages.

DB’

S

L

OW ON

S

PACE

A SQL server contains many databases, some of which are devoted to system-level activities (the master

and tempd b databases, for example) and others that hold user data. The Databases Low on Space statistic indicates databases that have fallen below a recommended percentage of free space.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

This might or might not be a problem. Some databases are not dynamic in nature (meaning they are not expected to grow in size) and are sized so very little free space is present. However, growing databases are another situation and might require DBA intervention if their free space amounts run low.

Correction If the percent used amount of a database is approaching problematic levels, there are three ways a

DBA can rectify the situation:

The DBA can resize the current file(s) used by the database via an ALTER DATABASE … MODIFY FILE command

The DBA can add a new file to the database via the ALTER DATABASE … ADD FILE command.

The DBA can modify the file(s) used by the database to automatically grow by using the ALTER

DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

You should also ensure that enough physical space exists on the server to accommodate additional database space.

L

OGS

L

OW ON

S

PACE

Each database in SQL Server has a transaction log, which is a serial record of all modifications that have occurred in a database as well as the transactions that caused each change. The Logs

Low on Space statistic indicates transaction logs that have fallen below a recommended percentage of free space.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

If any log’s used space exceeds the Performance Analyst recommended thresholds, then the DBA should take action to ensure that the log does not run out of available free space.

12 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction There are several things a DBA can do to ensure that a database’s log does not run out of available free space:

First, most transactional-oriented databases should have their logs assigned to a separate physical drive than the database. This prevents competition for space between the log and the database itself, allows the log to be monitored for space more effectively, and improves performance.

If the database is not critical in nature, you can set the truncate log on checkpoint option trunc log on chkpt, which will eliminate any non-active space in the log when a database checkpoint occurs.

Critical databases needing higher levels of recovery should have schedules established that regular perform transaction log dumps. Doing so ensures better recovery scenarios as well as a reduced risk of the transaction log running out of space.

If a critical transaction log becomes full, it might be impossible to use standard procedures to dump transactions and reclaim space. The dump operation will likely have to incorporate the no log or truncate only options.

If a transaction log continuously approaches dangerously low levels of free space, then the DBA should allow the underlying file(s) of the log to automatically grow to meet the demand. This can be accomplished by using the ALTER DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

The DBA should also be on the lookout for large load or data modification operations that do not make use of prudently timed commit points. A single, large transaction has the ability to overwhelm any transaction log since only non-active space in the transaction log is removed from log dumps or truncation operations.

SQL A

NALYSIS

P

ANE

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured server down in terms of enduser response times.

Before you can identify problem SQL in your database, you have to ask the question - “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Reads

Writes

CPU

Elapsed

Time

Description

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire

I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well.

These can be caused by DML activity (INSERTs, etc.), but writes can also be indicative of heavy disk sort activity.

This is how much CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

This is how much time the query took to parse, execute, and fetch the data needed to satisfy the query.

It should not include the network time needed to make the round trip from the requesting client workstation to the database server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1219

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above.

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you should answer:

• What has been the worst SQL that has historically been run in my database?

• What is the worst SQL that is running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It might be that the query is in an inefficient Transaction SQL loop, or other problematic programming construct.

Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can drill down further into the Top SQL view and begin working with the query through EXPLAIN plan analysis and other techniques inside Embarcadero’s DBArtisan.

S

TORAGE

A

NALYSIS

P

ANE

While DBAs focus on memory settings and tuning SQL, they frequently forget how dangerous and insidious storage problems can be. This is not a good mindset because storage headaches can play a major role in wrecking an otherwise well-running database.

Storage problems generally take one of two forms:

• The ‘hit-the-wall’ variety that can bring things to a complete standstill.

• The ‘performance vampire’ kind that slowly drains the performance of a database over time.

Storage problems can bring the curtain down on a database very quickly, as in the case of a transaction log running out of free space. But storage problems can also silently work behind the scenes to slowly, but surely rob a database of its performance. For example, a hub table in a busy database might be accessed very quickly when an application is first given life, but over time, if it develops a heavy forwarded row problem, it can cause things to run very differently.

12 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

The Storage Analysis section of the Performance Analyst Home page displays the

Total Used/

Total Free Space of all tablespaces in the database. It also provides a count of the number of

databases, files, and file groups that exist on the server. For more detailed information on

database space, you can use the Performance Analyst Space

details.

T

OTAL

U

SED

/T

OTAL

F

REE

S

PACE

These statistics represent the total used and free space available in all databases on the server.

Although good to know, a more detailed listing by database is needed to determine where any actual space shortages exist on the server. This information can be viewed in the Performance

Analyst Space

.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Storage Analysis Pane

If any one database or transaction log begins to approach the Performance Analyst recommended thresholds (and the objects contained within it are dynamic and growing as opposed to static), then the DBA should take action to prevent any future space allocation errors.

Correction Here are a few things a DBA can do to prevent free space shortages:

For Databases:

The DBA can resize the current file(s) used by the database via an ALTER DATABASE … MODIFY FILE command.

The DBA can add a new file to the database via the ALTER DATABASE … ADD FILE command.

The DBA can modify the file(s) used by the database to automatically grow by using the ALTER

DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

For Transaction Logs:

First, most transactional-oriented databases should have their logs assigned to a separate physical drive than the database. This prevents competition for space between the log and the database itself, allows the log to be monitored for space more effectively, and improves performance.

If the database is not critical in nature, you can set the truncate log on checkpoint option (trunc log on chkpt), which will eliminate any non-active space in the log when a database checkpoint occurs.

Critical databases needing higher levels of recovery should have schedules established that regular perform transaction log dumps. Doing so ensures better recovery scenarios as well as a reduced risk of the transaction log running out of space.

If a critical transaction log becomes full, it might be impossible to use standard procedures to dump transactions and reclaim space. The dump operation will likely have to incorporate the no log or truncate only options.

If a transaction log continuously approaches dangerously low levels of free space, then the DBA should allow the underlying file(s) of the log to automatically grow to meet the demand. This can be accomplished by using the ALTER DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

You should also be on the lookout for large load or data modification operations that do not make use of prudently timed commit points. A single, large transaction has the ability to overwhelm any transaction log since only non-active space in the transaction log is removed from log dumps or truncation operations.

W

ORKLOAD

A

NALYSIS

P

ANE

When experiencing performance slowdowns, some of the first questions you should answer are:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1221

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Home page provides insight into the leading resource hogs of a server, as well as a count of total active and inactive processes. The

Users page lets you easily get detailed information into what each leading session is currently

doing.

Workload Analysis statistics include:

• Active User Processes

• Inactive User Processes

Metrics

If any one session appears to be using more than 50% of a total resource (CPU, memory, etc.), then you should drill down into the session to find out what they are currently executing.

A

CTIVE

U

SER

P

ROCESSES

The Active User Processes statistic represents the total number of active and open threads reported on the server. This number displays the number of processes actively performing work.

Location

Microsoft SQL Server Performance Analyst Statistics > Home

> Workload Analysis Pane

I

NACTIVE

U

SER

P

ROCESSES

This metric represents the total number of threads logged on to the server that are idle at the current time.

NOTE:

This statistic is also available on the

Home page under Users .

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics > Home

> Workload Analysis Pane

A large number of inactive users could indicate user sessions that have mistakenly been left logged on. Since each user thread consumes a portion of memory on the server, to reduce resource usage, you should sever any sessions not needing a connection.

Correction

Drill down into the Session Waits Tab and check sessions that have many seconds idle and/or that

have been logged on for very long periods of time, as indicated by the logon time column. After verifying that a session is no longer necessary, you can KILL it.

12 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

M

EMORY

In addition to a Home

page, the Memory category of SQL Server Performance Analyst includes the following tabbed pages:

Buffer Cache Tab

Log Cache Tab

Procedure Cache Tab

H

OME

The Home page of the Memory category includes the following sections and statistics:

Key Ratio Analysis Pane

Memory Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

SQL Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBA's to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the master.sysperfinfo performance table. This table maintains a count of various statistics for the server and particular databases since the server was brought up. For servers that are kept up for long periods of time, these values can grow quite large and will impact how a particular ratio that a DBA might be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following memory ratios are used on the Performance Analyst Home page to succinctly communicate the general overall memory performance levels of the monitored database:

Cache Used Procedure Cache Used

Used Cache %

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1223

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Used Procedure Cache %

The following statistics, available in this pane, are duplicates of statistics available on the Key

Ratio Analysis Pane of the Home

page:

Buffer Cache Hit Ratio

Log Cache Hit Ratio

Procedure Plan Hit Ratio

Ad Hoc SQL Hit Ratio

C

ACHE

U

SED

The total MB of space that SQL Server is using in the buffer cache. Each instance of SQL Server has its own buffer cache where it stores recently used data pages to reduce physical I/O. The goal is to make the buffer cache large enough to maximize the ratio of logical reads to physical reads, but not so large that excessive memory swapping starts generating physical I/O to the pagefile. (Instances of SQL Server 2000 do this automatically under the default configuration settings.)

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

A percentage consistently remaining close to 100% indicates a deficient amount of memory available to SQL Server.

Correction First, ensure SQL Server is configured to use as much physical memory as possible by checking the

Max Server Memory configuration option. Also, consider increasing your SQL Server Min Memory parameter to allocate more memory to SQL Server. (Note that to obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

P

ROCEDURE

C

ACHE

U

SED

The total MB of space that SQL Server is using in its SQL/procedure cache. Microsoft has begun to transition from the term “procedure cache” to “SQL cache” to define this area of memory.

The reason being that in SQL Server's past, this area was devoted exclusively to holding query plans for stored procedures only.

The SQL Cache (procedure cache) is the part of the SQL Server memory pool that is used to store execution plans for Transact-SQL batches, stored procedures, and triggers. Execution plans record the steps that SQL Server must take to produce the results specified by the

Transact-SQL statements contained in the batches, stored procedures, or triggers.

Location

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

12 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

U

SED

C

ACHE

%

The Used Buffer Cache Percent statistic represents the total percentage of memory that is in use in the SQL Server buffer cache. Each instance of SQL Server has its own buffer cache where it stores recently used data pages to reduce physical I/O. The goal is to make the buffer cache large enough to maximize the ratio of logical reads to physical reads, but not so large that excessive memory swapping starts generating physical I/O to the pagefile. (Instances of SQL

Server 2000 do this automatically under the default configuration settings.)

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

A percentage used consistently remaining close to 100% indicates a deficient amount of memory available to SQL Server.

Correction First, ensure SQL Server is configured to use as much physical memory as possible by checking the

Max Server Memory configuration option. Also, consider increasing your SQL Server Min Memory parameter to allocate more memory to SQL Server. (Note that to obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

U

SED

P

ROCEDURE

C

ACHE

%

The total percentage of memory that SQL Server is using in its SQL/procedure cache. Microsoft has begun to transition from the term “procedure cache” to “SQL cache” to define this area of memory. The reason being that in SQL Server's past, this area was devoted exclusively to holding query plans for stored procedures only.

The SQL Cache is the part of the SQL Server memory pool that is used to store execution plans for Transact-SQL batches, stored procedures, and triggers. Execution plans record the steps that

SQL Server must take to produce the results specified by the Transact-SQL statements contained in the batches, stored procedures, or triggers.

Location

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home > Key Ratio Analysis Pane

B

OTTLENECK

A

NALYSIS

P

ANE

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If lock contention or heavy table scan activity has been dragging down database performance, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about which sessions and objects are causing the problem.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1225

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Memory bottlenecks can cause performance degradation in an otherwise well-running database.

Typically, these bottlenecks center around the SQL Server latches, which are lightweight locks used to protect certain resources in memory. To help you identify such problems, the following statistics are presented on the Performance Analyst Memory home page:

Latch Waits/Sec Total Latch Wait Time Top Latch Waits

L

ATCH

W

AITS

/S

EC

This metric represents the number of latches per second that could not be satisfied immediately by SQL Server. Latches are lightweight, mini-locks that are used to protect actions and resources used inside transactions.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home >

Bottleneck Analysis Pane

Unless accompanied by long wait times, latch waits should not pose too much of a performance problem in normal SQL Server installations.

If you have a high number of latch waits per second, then it is likely that SQL Server is also sporting a low buffer cache hit ratio and is being forced to perform extra physical I/O.

T

OTAL

L

ATCH

W

AIT

T

IME

Latches are lightweight, mini-locks that are used to protect actions and resources used inside transactions. The total latch wait time statistic represents the sum total of all latch wait time that has occurred on the system.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home >

Bottleneck Analysis Pane

Unless accompanied by long wait times, latch waits should not pose too much of a performance problem in normal SQL Server installations. If you have a high number of latch waits per second, then it is likely that SQL Server is also sporting a low buffer cache hit ratio and is being forced to perform extra physical I/O.

T

OP

L

ATCH

W

AITS

The Top Latch Waits graph depicts the top latch waits by wait time.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory > Home >

Bottleneck Analysis Pane

Latch waits rarely impact performance, however seeing latch waits with high wait time might indicate an area that needs further investigation.

Correction Wait events can be hard to interpret. If you see a particular event that has caused a lot of wait time, you can review the information in this Microsoft Knowledge Base Article to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

12 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

SQL A

NALYSIS

P

ANE

When SQL Server executes a set of SQL (ad hoc, procedure, trigger, etc.), it places the code into its procedure cache. The SQL Analysis section of the Performance Analyst Memory page provides a summary of the total memory pages currently in use by the various SQL types

(procedure, ad hoc, etc.)

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

M

EMORY

A

NALYSIS

P

ANE

SQL Server uses various memory regions to accomplish various tasks (like retain frequently used data, procedures, etc.) and improve overall performance. At start up, SQL Server is allocated memory that will fall between the range of two configurable parameters: Min Memory and Max

Memory. These statistics show you the amount of SQL Server memory allocated at present. In a normal SQL Server system, this number fluctuates as SQL Server uses more memory and releases unused memory back to the operating system. SQL Server also works in conjunction with the Windows Memory Manager, deallocating space when it detects that the operating system is unable to satisfy memory requests of other operating system processes. Depending on the version of SQL Server you are using, expect to deal with different memory regions. The table below describes some of the SQL Server memory regions:

Memory Scan

Buffer Cache

Procedure Cache

Connection Memory

Granted Workspace

Memory

Lock Memory

Optimizer Memory

SQL Cache Memory

Description

The buffer cache is a memory pool of buffer pages into which SQL Server reads data pages for quick access.

Beginning with SQL Server version 7.0, you can place other SQL-related code objects in memory for reuse. Once SQL Server parses through and places a set of SQL of program code in memory, response time can be increased for subsequent calls to the same set of

SQL or SQL code objects.

The total amount of dynamic memory the server is using for maintaining connections.

The total amount of memory granted to executing processes such as sort, hash, bulk copy operations, and so forth.

The total amount of dynamic memory the server is using for locks.

The total amount of dynamic memory the server is using for query optimization.

The total amount of memory used to retrieve stored SQL caches.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1227

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

W

ORKLOAD

A

NALYSIS

P

ANE

It is not uncommon for one or two users to cause the majority of runtime problems that plague a server. The problem could be a runaway process, an untuned batch procedure, or other userinitiated operation.

If your database server does not have an overabundance of memory, then you should periodically check to see who your heavy memory users are along with the total percentage of memory each takes up. If you see one or two users who have more than 25-50% of the total memory usage, then you should further investigate the sessions to see what activities they are performing.

B

UFFER

C

ACHE

T

AB

The Buffer Cache Hit Ratio tab includes the following sections:

Page Activity

Page Life Expectancy

Total vs. Target Memory Database Pages

The following statistic, available on this page, duplicates a statistic on the Key Ratio Analysis

Pane

of the

Home page:

Buffer Cache Hit Ratio

P

AGE

A

CTIVITY

SQL Server uses various memory regions to accomplish various tasks (like retain frequently used data, procedures, etc.) and improve overall performance. At start up, SQL Server is allocated memory that falls between the range of two configurable parameters: Min Memory and Max

Memory. The Page Activity chart shows you the amount of SQL Server memory allocated at present. In a normal SQL Server system, this number fluctuates as SQL Server uses more memory and releases unused memory back to the operating system. SQL Server also works in conjunction with the Windows Memory Manager, deallocating space when it detects that the operating system is unable to satisfy memory requests of other operating system processes.

Depending on the version of SQL Server you are using, there are several memory regions you should expect to deal with. The table below describes the SQL Server memory regions:

Memory Scan

Default Buffer Cache

Procedure/SQL Cache

Connection Memory

Lock Memory

Optimizer Memory

Description

The buffer cache is a memory pool of buffer pages into which SQL Server reads data pages for quick access.

Beginning with SQL Server version 7.0, you can place other SQL-related code objects in memory for reuse. Once SQL Server parses through and places a set of SQL of program code in memory, response time can be increased for subsequent calls to the same set of

SQL or SQL code objects.

The total amount of dynamic memory the server is using for maintaining connections.

The total amount of dynamic memory the server is using for locks.

The total amount of dynamic memory the server is using for query optimization.

12 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

The Active and Free Page chart in Performance Analyst displays a count of active memory pages

(those being used by SQL Server) and free pages (pages not being used).

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Buffer Cache Tab

Seeing consistent high volumes of free pages might indicate that SQL Server is using more memory than necessary.

T

OTAL VS

. T

ARGET

M

EMORY

Total memory is the amount of memory that’s currently in use by SQL server. Target memory is the amount of memory that could be used. SQL server dynamically adjusts its memory allocations depending either on workload up to the maximum memory configuration set by the

DBA or the amount it thinks it should give other (non-SQL) server operations.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Buffer Cache Tab

When total memory approaches or reaches the maximum amount of target (defined) memory, then

SQL server is experiencing memory pressure. You can try adding more RAM to the machine or adjusting memory ceiling limits imposed at the SQL server configuration level.

D

ATABASE

P

AGES

The database pages metric gives the amount of pages in memory devoted to database content compared to all other content.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Buffer Cache Tab

If you see that a large percentage of memory is devoted to database pages, the server is database page centric and not procedure plan centric. This can indicate that too many table scans are taking place, which might be flooding the buffer cache with infrequently used pages. You can determine if this is the case by looking at the page life expectancy metric. Page life expectancy readings of 300 seconds or less can indicate excessive table scan activity.

P

AGE

L

IFE

E

XPECTANCY

The page life expectancy metric indicates how long SQL server believes a page will stay in the buffer cache. Pages served from memory result in much shorter response times than pages read from disk into the cache. It’s best if frequently used data is pinned in the buffer cache.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Buffer Cache Tab

Readings of 300 seconds or less frequently mean that too many table scans are occurring and flooding the buffer cache with pages that are used rarely. Check the I/O access patterns on the I/O home page or the User I/O drill-down to confirm if this is the case.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1229

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

P

ROCEDURE

C

ACHE

T

AB

The Procedure Cache tab includes the following sections:

Procedure Cache Hit Ratio

Procedure/SQL Cache Detail

Procedure/SQL Cache Summary

P

ROCEDURE

C

ACHE

H

IT

R

ATIO

The SQL Server procedure cache holds the execution plans for all Transact-SQL statements currently executing in the server. When a user executes a Transact-SQL statement, SQL Server looks in the procedure cache for a query plan to use.

The Procedure Cache Hit Ratio statistic is the percentage of query plan requests generated by stored procedures that are found in the procedure cache area. The greater the percentage of times that a statement's plan and definition can be referenced in memory, the better the procedure execution time.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Procedure Cache Tab

A high procedure cache hit rate is a desirable thing. You should strive for a hit ratio between 95-100%, with 95% being a good performance benchmark for code reference. Note that when a database first starts, the procedure cache hit rate will not be at an optimal level because all code being used will be relatively new, and as such, must be read in from disk and placed into the cache. If, however, after a solid hour or two of steady database time, the procedure cache hit rate does not increase to desirable levels, you should look into the possibility of increasing the amount of memory allocated to the cache.

Correction First, ensure SQL Server is configured to use as much physical memory as possible by checking the max server memory configuration option. Also, consider increasing your SQL Server min memory parameter to allocate more memory to SQL Server. (Note that to obtain optimal values for these parameters, an option is to install more physical RAM to your server.) Check for any large objects that are pinned in memory that could possibly be removed.

P

ROCEDURE

/SQL C

ACHE

S

UMMARY

The SQL Server procedure/SQL cache holds often-referenced code object definitions and adhoc SQL. The Procedure/SQL Cache Summary lists each type of code object, the amount of memory each code type (trigger, ad-hoc SQL, etc.) consumes, and a total count of each type of code object.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Procedure Cache Tab

Seeing a lot of memory devoted to ad-hoc SQL plans might indicate an environment where sessions are submitting a lot of SQL requests. Many SQL Server DBAs like to control code submissions through stored procedures.

12 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

P

ROCEDURE

/SQL C

ACHE

D

ETAIL

Beginning with SQL Server version 7.0, other SQL-related code objects might be placed in memory for reuse. Once SQL Server parses through and places a set of SQL of program code in memory, response time can be increased for subsequent calls to the same set of SQL or SQL code object. The Procedure/SQL Cache Details section displays the top 1000 objects in the procedure/SQL cache. The table below describes the information available in the Procedure/

SQL Cache Details section on the Procedure Cache tab of the Memory Detail:

Information

Object Type

Cache Type

Object ID

Object Name

Database ID

Database

User ID

User

Use Count

SQL Bytes

Size (KB)

SQL

Description

The type of object (ad hoc SQL, etc.)

The category of SQL code inside the cache (executable plan, etc.)

The numeric ID of the object.

The name of the object (if applicable).

The numeric ID of the database.

The database where the code originated.

The numeric ID of the user.

The owner of the object or code.

The number of uses for the object.

The amount of SQL bytes used by the code object.

The size used by the object in kilobytes.

The actual SQL statement or code being executed.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Procedure Cache Tab

Seeing many objects of the ad hoc SQL type might indicate an environment where sessions are submitting a lot of SQL requests. Many SQL Server DBAs like to control code submissions through stored procedures.

L

OG

C

ACHE

T

AB

The Log Cache tab includes the following sections:

Database Log Cache Ratios Log Cache Details

The following statistic, available on this page, duplicates a statistic on the Key Ratio Analysis

Pane

of the

Home page:

Log Cache Hit Ratio

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1231

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ATABASE

L

OG

C

ACHE

R

ATIOS

The Log Cache Hit Ratio statistic represents the percentage of log cache reads satisfied from the log cache. The database log cache ratios display breaks down log cache hit ratios by database.

Note that some databases with inactive logs will not display a log cache hit ratio.

Location

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Log Cache Tab

Correction A low percentage on this statistic is not necessarily a bad sign, as it is possible that the information needed from the log will not be readily available in memory.

L

OG

C

ACHE

D

ETAILS

Before ever writing transactions to disk, the log manager of SQL Server formats everything in memory. This area of memory is known as the log cache. The log writer of SQL Server moves through the log caches when transactions are committed (as well as other events) and flushes each cache out to disk. SQL Server also reads from the cache when log records are needed. The table below describes the information available in the Log Cache Details section on the Log

Cache tab of the Memory Detail:

Information

Database

Log Cache Reads

Log Flushes

Log Flush Waits

Log Flush Wait Time

Log Growths

Log Shrinks

Description

The name of the SQL Server database.

The number of reads from the log cache.

The number of times data was flushed from the log to disk.

The number of times the log had to wait before flushing data to disk.

The amount of time the log waited before flushing data to disk in milliseconds.

The number of times the log had to physically grow in size to meet the need for more space.

The number of times the log contracted in physical size.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Memory

> Log Cache Tab

Seeing high amounts of wait time for log flushes could indicate a bottleneck at the disk level. A log that shows high number of growths likely indicates an undersized log. While automatic growth can alleviate out-of-space conditions, many growth operations can slow down overall operations. It is better to have a properly sized transaction log that allows SQL Server to continually enlarge it in size when needed.

Correction Consider relocating logs showing high amounts of wait time to faster disks. For logs showing high numbers of growths, permanently enlarge the log(s) via an ALTER DATABASE command that will resize the log files.

12 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

I/O

In addition to a Home

page, the I/O category of SQL Server Performance Analyst includes the following tabbed pages:

Database I/O Tab

User I/O Tab

File Tab

System I/O Tab

H

OME

The Home page of the I/O category includes statistics in the following categories:

Bottleneck Analysis Pane

SQL Analysis Pane

I/O Access Patterns

Workload Analysis Pane

Key System Analysis Pane

K

EY

S

YSTEM

A

NALYSIS

P

ANE

When complaints begin to surface about your database's performance, oftentimes the root cause can be traced to one or more issues with I/O. The thing to keep in mind when you begin to monitor the I/O of your database is that you are actually reviewing the success of your physical design model.

All the physical storage characteristics and placements, the table and index designs, and the speed that it all works are on display when I/O is monitored. Because a database's main index of performance is measured by how fast I/O needs are satisfied, it is your responsibility to quickly interrogate SQL Server to determine if a reported database slowdown is I/O related.

The following key I/O values are reported in this section:

Checkpoint Pages

Log Flushes

Page Reads

Lazy Writes

Workload Analysis Pane

Read Ahead Pages

Log Cache Reads

Page Writes

P

AGE

R

EADS

This metric represents that number of physical database page reads that are issued per second by SQL Server.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

Page reads are to be expected, especially after initial server start up. This is because SQL Server must first satisfy requests for data and meta-data by reading information in from physical disk. Numerous page reads can also be expected if the physical server does not contain an adequate amount of memory to hold repetitively requested blocks of information.

No hard-and-fast rules exist for how many page reads per second is too much. You can crossreference this statistic with the physical server disk statistics to see if physical page reads and accompanying physical disk I/O is approaching the server’s premium capacity levels. And because logical I/O is always many times faster than physical I/O, you should also evaluate the buffer cache hit ratio to determine overall memory vs. physical read efficiency.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1233

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction If you find that the server is becoming overworked from a physical I/O standpoint, there are several courses of action you can take:

Examine index usage to ensure that unnecessary table scans are not occurring.

Check the physical database design to see if table objects have been over-normalized.

Ensure that SQL Server is configured to use sufficient amounts of memory. Examine the min server memory (MB)

and max server memory (MB)

parameters to see if SQL Server is constrained on either end of the memory spectrum.

Check for large pinned table objects that could be using excessive amounts of space in the buffer cache.

Last, but not least, investigate the possibility of adding more RAM to the physical server.

P

AGE

W

RITES

The Page Writes statistic represents the number of physical database page writes issued by SQL

Server. Page Writes take place during operations such as checkpoints, lazywriter writes, index creations, and BCP routines.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

Page Writes can give you an idea of overall physical write activity, however there are a number of statistics that pertain specifically to certain write activities like checkpoints, etc., that you can examine to determine the amount of physical writes caused by distinct SQL Server processes. With respect to performance, response times experienced by SQL Server users are normally not impacted by write operations unless the writes are synchronous in nature. These are typically BCPs, database recovery operations, and index creations.

R

EAD

A

HEAD

P

AGES

The Read Ahead Pages statistic represents the number of physical database page read in anticipation of use by SQL Server. If SQL Server senses that database pages are being read in a sequential manner, it will institute a pre-fetch mechanism that moves pages into the buffer cache before they are actually needed by a process.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

If data is accessed sequentially (for example, through the use of a clustered index), the read ahead mechanism of SQL Server can increase performance by needed database pages already in the buffer cache before they are actually requested. However, because the read ahead mechanism is typically triggered by full table or index range scans, if the read ahead pages are actually required to satisfy a user’s query, then performance might actually suffer. In these cases, the judicious use of indexes is a better route to take.

L

OG

F

LUSHES

The Log Flushes statistic represents the total number of log pages for all databases written to disk by the log writer process. A log flush occurs when SQL Server writes all changes from the database’s log cache out to the database’s log files on disk.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

12 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Metrics Increasing numbers observed for log flushes should not cause concern unless the I/O subsystem of the server appears overwhelmed. In addition, to minimize I/O contention between a database and its accompanying log, it is wise to place database files and log files on separate disks.

Correction If you have placed a very active database on the same physical file as its log, you can look into moving the log to a separate physical device by adding new log files to a new drive and subsequently removing the old log files when they are not being used.

L

OG

C

ACHE

R

EADS

The Log Cache Reads statistic represents the reads performed per second through the log manager cache. Before ever writing transactions to disk, the log manager of SQL Server formats them in memory. This area of memory is known as the log cache and only contains log records for SQL Server 2000 and later. The log writer of SQL Server moves through the log caches when transactions are committed (as well as other events) and flushes each cache out to disk.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

C

HECKPOINT

P

AGES

The Checkpoint Pages statistic represents the number of pages flushed to disk per second by a checkpoint or other operation that require all dirty (modified) pages to be flushed.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

Checkpoint operations are used by SQL Server to minimize the amount of work the server must perform when databases are recovered during system startup. Checkpoints periodically write out modified pages that are found in the buffer cache to disk. After, SQL Server records the operation in the log to signify that the operation succeeded.

Checkpoints can be explicitly performed by a database owner issuing the checkpoint command. SQL

Server also performs checkpoints automatically for databases that have the trunc log on chkpt option set.

Large SQL Servers have the potential to generate lots of checkpoint write operations. Although SQL

Server will do what it can to minimize checkpoint activity, you can also set the recovery interval server parameter to influence how often checkpoints should run.

Correction If you believe excessive checkpoint activity is occurring, you can take the following steps:

Set the recovery interval server parameter to a larger value with sp_configure.

Restart SQL Server so the change will take affect or use the RECONFIGURE option to make the change immediately.

L

AZY

W

RITES

The lazy writer is a SQL Server system process that flushes out batches of dirty and aged buffers

(buffers that contain changes that must be written back to disk before the buffer can be reused for a different page) and make them available to user processes. The Lazy Writes statistic represents the number of buffers written by the buffer manager's lazy writer process.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home > Key System Analysis Pane

High values might indicate a thrashing situation with data scanned into the buffer cache (but referenced seldom) and then immediately moved back out.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1235

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

B

OTTLENECK

A

NALYSIS

P

ANE

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance: it helps you track where a database has been spending its time. The Performance Analyst I/O home page identifies the top I/O related waits that might be currently causing performance issues. Also included are the current hottest database/log files and a summary of I/O activity.

Bottleneck Analysis includes the following information:

I/O Errors

Top I/O Waits

Hottest Database/Log Files

Total I/O

The following statistic, available on this pane, duplicates a statistic on the Key Ratio Analysis

Pane

of the

Home page:

I/O Busy

I/O E

RRORS

I/O Error Rate reflects total number of I/O errors (errors during read and write operations) encountered by the server since the last refresh inside Performance Analyst Center. I/O Error

Rate is a percentage based on Total I/O (the sum the physical reads and writes).

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics

You should observe few, if any errors.

>

I/O > Home >

Bottleneck Analysis Pane

Correction If you notice any errors, you should check the SQL Server error log for details.

H

OTTEST

D

ATABASE

/L

OG

F

ILES

The Hottest Database/Log Files display presents the most active database files as indicated by physical I/O activity (reads and writes).

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home >

Bottleneck Analysis Pane

Understanding the storage-level hot spots of a database is beneficial for a couple of reasons.

First, you can get a feel for overworked physical disks by viewing I/O statistics at the tablespace and datafile levels. If a particular disk or set of disks is under too much strain, you attempt to relocate the databases to other less-used devices or create new file groups on different disks and move hot objects to them (assuming, of course, you have extra disks available).

Second, if you have used standard DBA practice and placed indexes in their own file group, you can view the I/O statistics for that file group and see if the indexes are actually being used.

12 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Some areas to consider when viewing the hottest database files display are:

Seeing a lot of activity in the master database and datafiles might indicate a lot of recursive calls.

The tempdb database (devoted to sort activity) shows higher volumes of physical I/O which could indicate a problem with excessive disk sorts.

You might want to quickly review all the physical I/O for each drive/file system and get a idea of the overworked disks on your server. If you have under-utilized disk drives (with their own controllers), you should consider relocating some databases or filegroups that exhibit high I/O characteristics to those drives.

To minimize contention at the physical disk level, and improve performance overall, it is generally recommended that a SQL Server database have its database and log files physically separated onto different drives.

T

OTAL

I/O

The Total I/O statistic represents the total number of physical reads and writes.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home >

Bottleneck Analysis Pane

T

OP

I/O W

AITS

The Top I/O Waits statistics rank the top I/O related waits by wait time.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home >

Bottleneck Analysis Pane

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

SQL A

NALYSIS

P

ANE

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured server down in terms of enduser response times.

Before you can identify problem SQL in your database, you have to ask the question - “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Reads (Physical)

Description

This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1237

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Criteria

Writes

Description

These can be caused by DML activity (INSERTs, etc.), but writes can also be indicative of heavy disk sort activity.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above.

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you should answer:

• What has been the worst SQL that has historically been run in my database?

• What is the worst SQL that is running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It might be that the query is in an inefficient Transaction SQL loop, or other problematic programming construct.

Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can drill down further into the Performance Analyst Top SQL view and begin working with the query through EXPLAIN plan analysis and other techniques inside Embarcadero’s DBArtisan.

I/O A

CCESS

P

ATTERNS

There are many different routes that SQL Server can take to access various objects contained in a database. The I/O Access Patterns display summarizes the methods SQL Server is using to satisfy end-user requests for data.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O > Home >

SQL Analysis Pane

12 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Metrics

Depending on the version of SQL Server you are using, expect to deal with different access styles. The table below describes some of the SQL Server access styles:

Access Style

Full Scans

Description

Full Scans are the total number of full table or index scans. Full scans occur if a table is inadequately indexed or if SQL Server needs to access all rows in a table or index to satisfy a query. Other operations that can cause full scans include UPDATE STATISTICS calls. Avoid unnecessary scans on large tables is something to avoid, and can be a signal to you as a DBA to investigate the use of more indexes and to review SQL access through EXPLAIN plans. Small table scans are efficient because SQL Server can often cache the entire table in a single I/O operation.

Large numbers of index scans are normally desirable too, since it typically indicates the fastest possible resolution to data access requests.

Range Scans

Probe Scans

Range Scans are the total number of qualified range scans through indexes. Large numbers of index scans are normally desirable, since it typically indicates the fastest possible resolution to data access requests is being taken.

Probe scans are used in SQL Server to directly find rows in an index or base table. Large numbers of probe scans are normally desirable, since they typically indicate the fastest possible resolution to data access requests is being taken.

Index Searches Index searches are normally used to start range scans, for single index record fetches and also might be used to reposition an index.

Forward Record

Fetches

The Forwarded Record Fetches statistic represents the total number of records fetched by reading forwarded record pointers. SQL Server will move rows in a table under certain conditions. One situation might arise when you update a row in a table that has a variable-length column to a larger size that will no longer fit on its original page. Another situation would be if SQL Server moves a row when the clustered index column changes. When SQL Server creates a forwarding pointer, it remains in place unless one of two things happens. The first is when a row shrinks enough to move back to its original location. The second is when the entire database shrinks.

When a database file shrinks, SQL Server will reassign the row identifiers, which are used as the row locators, so the shrink process never generates forwarded rows. Forwarded records can reduce performance at times because additional I/O is involved to first obtain the record pointer to the relocated row, and then the row itself is read.

Correction

Actions to take after observing the ways SQL Server is accessing data depend on the actual situation you witness. If consistent numbers are present for Forward Record Fetches, you might want to examine your databases to see which tables have forwarded records. You can easily do this by utilizing the Embarcadero Space Analyst to view forwarded record data for tables.

If you do not have Space Analyst, then to see the total count of forwarded records in a table, you can enable trace flag 2509, and then execute the DBCC CHECKTABLE command. The output should display the number of forwarded records in that table. Tables with many forwarded records could be candidates for table reorganization.

Here are some methods you can use to avoid unnecessary full scans:

• Try not to use SQL statements that include the NOT IN, NOT LIKE, <>, IS NULL operators since they typically suppress the use of indexes.

• When referencing concatenated indexes with queries, be sure the leading column in the index is used. If it is not, the index will not be used at all.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1239

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

• Avoid using functions in WHERE predicates.

W

ORKLOAD

A

NALYSIS

P

ANE

It is not uncommon for one or two users to cause the majority of runtime problems plaguing a database. The problem could be a runaway process, an untuned batch procedure, or other userinitiated operation. The Top I/O Hogs display showcases the top sessions that have caused the most physical I/O on the system (both reads and writes).

Metrics

If you see one or two users who have caused more than 25-50% of total I/O, then you should drill down further into the sessions to see what activities they are performing.

S

YSTEM

I/O T

AB

The System I/O tab of the I/O Detail includes the following sections:

AWE I/O

Space I/O

I/O Activity

Physical I/O

P

HYSICAL

I/O

SQL Server performs many system-related I/O functions to keep data moving into and out of the server. The System I/O tab of the I/O Detail displays statistics that track various system-related I/

O operations. The Physical I/O section details I/O tasks that involve physical disk activity. The table below describes the information available in the Physical I/O section:

Information

Page Reads

Page Writes

Checkpoint Pages

Description

The number of physical database page reads that are issued per second by SQL Server. It is collective in nature, meaning that it represents the total page reads per second across all databases that exist on the target SQL Server.

The number of physical database page writes issued by SQL Server. Page Writes take place during operations such as checkpoints, lazy writer writes, index creations, and BCP routines.

The number of pages flushed to disk per second by a checkpoint or other operation that require all dirty (modified) pages to be flushed.

Lazy Writes The number of buffers written by the buffer manager's lazy writer. The lazy writer is a system process that flushes out batches of dirty and aged buffers and makes them available to SQL

Server processes. The lazy writer eliminates the need to perform frequent checkpoints in order to create available buffers.

Read Ahead Pages The number of physical database pages read in anticipation of use by SQL Server. If SQL

Server senses that database pages are being read in a sequential manner, it institutes a prefetch mechanism that moves pages into the buffer cache before they are actually needed by a process.

Page Lookups The number of requests to find a page in the buffer pool.

12 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> System I/O Tab

Page reads are to be expected, especially after initial server start up. SQL Server must first satisfy requests for data and metadata by reading information in from physical disk. Numerous page reads can also be expected if the physical server does not contain an adequate amount of memory to hold repetitively requested blocks of information.

No hard and fast rules exist for how many page reads per second is too much. You can cross reference this statistic with the physical server disk statistics to see if physical page reads and accompanying physical disk I/O is approaching the server's premium capacity levels. And because logical I/O is always many times faster than physical I/O, you should also evaluate the buffer cache hit ratio to determine overall memory vs. physical read efficiency.

Page Writes can give you an idea of overall physical write activity. There are a number of statistics, however, that pertain specifically to certain write activities like checkpoints, that can be examined to determine the amount of physical writes caused by distinct SQL Server processes. With respect to performance, response times experienced by SQL Server users are normally not impacted by write operations unless the writes are synchronous in nature. These are typically BCPs, database recovery operations, and index creations.

With respect to read ahead pages, If data is accessed sequentially (for example, through the use of a clustered index), the read ahead mechanism of SQL Server can increase performance by needed database pages already in the buffer cache before they are actually requested. However, because the read ahead mechanism is typically triggered by full table or index range scans, if the read ahead pages are actually required to satisfy a user's query, performance can actually suffer. In these cases, the judicious use of indexes is a better route to take.

Checkpoint operations are used by SQL Server to minimize the amount of work the server must perform when databases are recovered during system startup. Checkpoints periodically write out modified pages that are found in the buffer cache to disk. Afterward, SQL Server records the operation in the log to signify that the operation succeeded. A database owner issuing the checkpoint command can explicitly perform checkpoints. SQL Server also performs checkpoints automatically for databases that have the trunc log on chkpt option set. Large SQL Servers have the potential to generate lots of checkpoint write operations. Although SQL Server minimizes checkpoint activity, you can also set the recovery interval server parameter to influence how often checkpoints can run.

Correction If you find that the server is becoming overworked from a physical I/O standpoint, here are a few things you can do:

Examine index usage to ensure that unnecessary table scans are not occurring.

Check the physical database design to see if table objects have been over-normalized.

Ensure that SQL Server is configured to use sufficient amounts of memory. Examine the min server memory (MB) and max server memory (MB) parameters to see if SQL Server is constrained on either end of the memory spectrum.

Check for large pinned table objects that could be using excessive amounts of space in the buffer cache.

Last, but not least, investigate the possibility of adding more RAM to the physical server.

If you believe excessive checkpoint activity is occurring, you can take the following steps:

Set the recovery interval server parameter to a larger value with sp_configure.

Restart SQL Server or use the RECONFIGURE option to make the change immediately.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1241

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

S

PACE

I/O

SQL Server performs many system-related I/O functions to keep data moving into and out of the server. The Space I/O section of the I/O Detail details space-related I/O operations. The table below describes the information available in the Space I/O section:

Information

Extents Allocated

Description

The number of space extents that SQL Server allocated. Rapidly increasing numbers for these statistics indicates that SQL Server is receiving large volumes of incoming data and is allocating space to make room.

Extent Deallocations This indicates that SQL Server is reclaiming space from database objects due to shrinking database volumes.

Freespace Page Fetches The number of pages by free space scans used to satisfy requests to insert record fragments.

Freespace Scans The number of scans performed by SQL Server to locate free space for an incoming record.

Mixed Page Allocations The number of pages allocated from mixed extents. These are used for storing the first eight pages that are allocated to an index or table.

Page Deallocations This indicates that SQL Server is reclaiming space from database objects due to shrinking database volumes.

Page Splits When data is inserted or updated in a table, SQL Server might reorganize the storage of the data in the table's index pages. When an index page becomes full, but a DML operation demands room on that page, SQL Server moves about half the rows to a new page to accommodate the request. This reorganization is known as a page split.

Performance for DML actions can be impaired from page split operations. In addition, more index pages can make for longer index scan times.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> System I/O Tab

Increasing numbers for extent and page allocation, and freespace operations likely indicates aggressive volumes of data being inserted or modified in SQL Server. Page splits cause additional overhead in the form of CPU usage and I/O. Observing large numbers of page splits can signal a resource bottleneck in your server.

Correction To avoid page splits, you can look into tuning the FILLFACTOR property of an index, which controls the percentage of the index page that is filled during creation. The default, 100, tells SQL Server to completely fill each page, whereas lower numbers tell SQL Server to leave room for additional index rows or updates to existing rows.

I/O A

CTIVITY

SQL Server performs many system-related I/O functions to keep data moving into and out of the server. The I/O Activity section of the I/O Detail details maintenance-related I/O operations. The table below describes the information available in the I/O Activity section

Information

DBCC Logical Scans

Bulk Copy Rows

Bulk Copy Throughput

Transactions

Description

The number of logical read scan bytes per second caused by DBCC operations.

The number of rows copied either into or out of the database via the BCP utility.

The amount of data (in KB) copied via BCP operations.

The number of transactions that have occurred within the database.

12 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Information

Log Flushes

Backup/Restore T-Put

Location

Description

The number of log flushes for the server.

Defines the read/write throughput for backup and restore operations.

Microsoft SQL Server Performance Analyst Statistics >

I/O

> System I/O Tab

AWE I/O

SQL Server performs many system-related I/O functions to keep data moving into and out of the server. The AWE I/O section of the I/O Detail details I/O relating to Address Windowing

Extensions (the SQL Server mechanism for supporting very large amounts of RAM). The table below describes the information available in the AWE I/O section:

Information

Lookup Maps

Stolen Maps

Unmap Cells

Unmap Pages

Write Maps

Description

The number of times that a database page was requested by the server, found in the buffer pool, and mapped. When it is mapped, it is made a part of the server's virtual address space.

The number of times that a buffer was taken from the free list and mapped.

The number of calls to unmap buffers. When a buffer is unmapped, it is excluded from the virtual server address space. One or more buffers might be unmapped on each call.

The number of SQL Server buffers that are unmapped.

The number of times that it is necessary to map in a dirty buffer so it can be written to disk.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O

> System I/O Tab

U

SER

I/O T

AB

The User I/O tab of the I/O Detail includes the following sections:

Lock Activity

User Object Activity

SQL Activity

Temporary Object Activity

U

SER

O

BJECT

A

CTIVITY

The User Object Activity section of the I/O Detail displays statistics that track various userrelated I/O operations. The I/O function along with its counter value is presented. The User

Object Activity section details performance statistics that reflect how SQL Server is performing object access operations. The table below describes the information available in the User Object

Activity section:

Information

Forwarded Records

Description

The number of records per second fetched through forwarded record pointers. At times forwarded records can reduce performance because additional I/O is involved to first obtain the record pointer to the relocated row, and then the row itself is read.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1243

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Information

Full Scans

Index Searches

Probe Scans

Range Scans

Skipped Ghosted

Records

Description

Full scans of moderately sized indexes or tables are generally okay. SQL Server can scan and cache a small table much faster than using its index to navigate to any requested data. Full, unrestricted, large table scans, however, are typically not good and degrade overall system performance and response time.

The total number of index searches per second. Index searches are normally used to start range scans, for single index record fetches and can be used to reposition an index.

The total number of probe scans per second. Probe scans are used in SQL Server to directly find rows in an index or base table.

The total number of qualified range scans through indexes per second.

The number of ghosted records per second skipped during scans.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> User I/O Tab

Full scans occur if a table is inadequately indexed or if SQL Server truly needs to access all rows in a table or index to satisfy a query. UPDATE STATISTICS calls can also cause full scans. Unnecessary scans on large tables is something to avoid, and can be a signal to you as a DBA to investigate the use of more indexes and to review SQL access through EXPLAIN plans. Small table scans are actually a good thing because SQL Server can often cache the entire table in a single I/O operation. Large numbers of index scans are normally desirable too, because this typically indicates the fastest possible resolution to data access requests.

When SQL Server creates a forwarding pointer, it remains in place unless one of two things happens.

The first is when a row shrinks enough to move back to its original location. The second is when the entire database shrinks. When a database file shrinks, SQL Server reassigns the row identifiers, which are used as the row locators, so the shrink process never generates forwarded rows. Forwarded records can reduce performance at times because additional I/O is involved to first obtain the record pointer to the relocated row, and then the row itself is read.

Large numbers of index searches and probe scans are normally desirable because they typically indicate the fastest possible resolution to data access requests is being taken.

Correction Here are some methods you can use to avoid unnecessary large table scans:

Try not to use SQL statements that include the NOT IN, NOT LIKE, <>, IS NULL operators because they typically suppress the use of indexes.

When referencing concatenated indexes with queries, be sure the leading column in the index is used. If it is not, the index will not be used at all.

Avoid using functions in WHERE predicates.

If consistent numbers are present for Forward Record Fetches, examine your databases to see which tables have forwarded records. This can easily be done with the Embarcadero Space Analyst component. If you do not have Space Analyst, then to see the total count of forwarded records in a table, enable trace flag 2509, and then execute the DBCC CHECKTABLE command. The output should display the number of forwarded records in that table. Tables with many forwarded records could be candidates for table reorganization.

12 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

SQL A

CTIVITY

The SQL Activity section of the User I/O tab of the I/O Detail displays statistics that track various user-related I/O operations. The I/O function along with its counter value is presented. The SQL

Activity section details performance statistics that reflect SQL I/O-related operations. The table below describes the information available in the SQL Activity section:

Information

Auto-Param Attempts

Batch Requests

Failed Auto-Params

Safe Auto-Params

Scan Point

Revalidations

SQL Compilations

SQL Re-Compilations

Unsafe Auto-Params

Description

Auto-parameterization occurs when an instance of SQL Server attempts to reuse a cached plan for a previously executed query that is similar to, but not the same as, the current query. The Auto-param Attempts statistic shows the number of auto-parameterization attempts per second and includes failed, safe, and unsafe auto-parameterizations.

A batch is a collection of one or more SQL statements sent in one unit by the client. Each batch is compiled into a single execution plan. If the batch contains multiple SQL statements, all of the optimized steps needed to perform all the statements are built into a single execution plan. The Batch Requests statistic shows the number of batch requests per second that are processed by the SQL Server instance.

Auto-parameterization occurs when an instance of SQL Server attempts to reuse a cached plan for a previously executed query that is similar to, but not the same as, the current query. The Failed Auto-params statistic shows the number of failed auto-parameterization attempts per second.

Auto-parameterization occurs when an instance of SQL Server attempts to reuse a cached plan for a previously executed query that is similar to, but not the same as, the current query. The Safe auto-params statistic shows the number of auto-parameterization attempts per second and includes only safe auto-parameterizations (ones where the cached plan can be shared).

The number of times per second that the scan point had to be revalidated to continue the scan.

The number of SQL compilations performed, indicating the number of times the compile code path is entered. This also includes compiles due to recompiles. When SQL Server user activity levels become stable, this value reaches a steady state.

The total number of recompiles triggered per second in a SQL Server instance.

Recompiles occur when SQL Server determines that the currently defined execution plan for an executing stored procedure might no longer be the best possible plan. SQL Server pauses the query execution and recompiles the stored procedure.

Auto-parameterization occurs when an instance of SQL Server attempts to reuse a cached plan for a previously executed query that is similar to, but not the same as, the current query. The Unsafe auto-params statistic shows the number of auto-parameterization attempts per second and includes only safe auto-parameterizations (ones where the cached plan cannot be shared).

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O

> User I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1245

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Metrics SQL Server's ability to match new SQL statements with existing, unused execution plans is increased when parameters or parameter markers are used in Transact-SQL statements. If an SQL statement is executed without parameters, SQL Server parameterizes the statement internally to increase the possibility of matching it against an existing execution plan. A high number for auto-param attempts shows that SQL Server is efficiently reusing existing cached plans. A small number for failed autoparam attempts shows that SQL Server is efficiently reusing existing cached plans.

Because compilation is a significant part of a query's turnaround time, you should strive to have as many compilations stored in the cache as possible. If this number does not stabilize in direct proportion to user activity stabilizing, you should investigate your SQL Cache to see if it has adequate memory assigned to it. Recompiles slow down the process that is executing the procedure and increases the load on the CPU. By extension, the more recompiles that are occurring on your system, the more overall load increases resulting in poor performance. In general, you want to keep the number of recompiles low. The most common reasons SQL Server would issue a recompile are:

Running sp_recompile against any table referenced in the stored procedure.

Significant data changes in a referenced table.

Schema changes to referenced objects.

The use of the WITH RECOMPILE clause in the CREATE PROCEDURE or EXECUTE statement.

A plan no longer available in the system cache.

Correction For failed auto-param attempts, you can increase the ability of the relational engine to match complex

SQL statements to existing, unused execution plans, by explicitly specify the parameters using either sp_executesql or parameter markers in your T-SQL code.

For high numbers of SQL re-compilations, try to practice coding standards that eliminate the most frequent causes detailed above. Also, try to:

Use temporary tables only in the stored procedure that created them.

Minimize creating temporary tables in control block structures.

Use the KEEP PLAN option on references to static temporary tables.

Issue the CREATE TABLE statement before any other references to the created table.

Minimize the use of temporary tables.

L

OCK

A

CTIVITY

The Lock Activity section of the User I/O tab of the I/O Detail displays statistics that track various user-related I/O operations. The I/O function along with its counter value is presented. The Lock

Activity section details performance statistics that reflect how SQL Server is handling lock operations. The table below describes the information available in the Lock Activity section:

Information

Table Lock Escalations

Locks

Blocked Users

Deadlocks

Description

The number of times locks on a table were escalated.

The total number of locks acquired on the server.

The users currently being blocked by other processes.

The number of deadlocks detected by SQL Server. Page Deadlocks occur when processes cannot proceed because they are waiting on a set of resources held by each other or held by other processes.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O

> User I/O Tab

12 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Metrics Many table lock escalations could indicate contention problems. If increasing numbers of table lock escalations are viewed at the same time as blocking or deadlock problems, the application design could be at fault.

Consistently seeing positive numbers for the blocked statistic should also clue you into the fact that a bottleneck exists for some processes. You can easily drill down and discover the exact process(es) holding locks that are blocking out other user activity. Another situation to look for with respect to locking, is when the total number of acquired locks reaches the maximum lock limit currently set on

SQL Server.

Consistently seeing page deadlock counts greater than zero indicates that some user processes are experiencing delays completing their work. When SQL Server identifies a page deadlock, it resolves the situation by choosing the process that can break the deadlock. This process is termed the deadlock victim. SQL Server rolls back the deadlock victim's transaction, and then notifies the process' application by returning an error message. It also cancels the process' request and allows the transactions of the remaining processes to continue. SQL Server always attempts to choose the least expensive thread running the transaction as the deadlock victim.

Correction Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the stranglehold on the objects the user was accessing. Other user processes then almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Embarcadero Performance Analyst, but preventing the blocking lock situation in the first place is tricky. The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do. By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process waits for a lock before timing out.

Because SQL Server automatically resolves deadlock situations, you should work proactively to prevent them in the first place. You can change default deadlock behavior by using the SET

DEADLOCK_PRIORITY command, which reprioritizes a process' position in a deadlock situation.

T

EMPORARY

O

BJECT

A

CTIVITY

The Temporary Object Activity section of the User I/O tab of the Users Detail displays statistics that track various user-related I/O operations. The I/O function along with its counter value is presented. The Temporary Object Activity section details performance statistics that reflect how

SQL Server is handling the creation of temporary objects, such as temporary tables used in stored procedures. The table below describes the information available in the Temporary Object

Activity section:

Information Description

Workfiles Created The number of workfiles created by SQL Server.

Worktables Created The total number of work tables created. Worktables are used many times by SQL Server to perform a logical operation specified in an end-user SQL statement. GROUP BY, ORDER BY, or UNION queries can cause worktables to be created as can specific CREATE statements used in Transact SQL processing. Worktables are built in the tempdb database and are dropped automatically at the end of the statement or procedure run.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> User I/O Tab

With respect to worktables, keep in mind that the tempdb database should be large enough to hold large worktables.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1247

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ATABASE

I/O T

AB

The Database I/O tab of the I/O Detail includes the following sections:

Database Bytes Read/Write

Summary

Location

Database Read/Write Summary

D

ATABASE

R

EAD

/W

RITE

S

UMMARY

The Reads statistic represents that number of physical database page reads that are issued per second by SQL Server. The Writes statistic represents the number of physical database page writes issued by SQL Server. Writes take place during operations such as checkpoints, lazywriter writes, index creations, and BCP routines. Both statistics are collective in nature, meaning that they represents the total page reads and writes across all databases that exist on the target SQL

Server.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> Database I/O Tab

Page reads are to be expected, especially after initial server start up. This is because SQL Server must first satisfy requests for data and metadata by reading information in from physical disk. Numerous page reads can also be expected if the physical server does not contain an adequate amount of memory to hold repetitively requested blocks of information. No hard-and-fast rules exist for how many page reads per second is too much. You can cross reference this statistic with the physical server disk statistics to see if physical page reads and accompanying physical disk I/O is approaching the server's premium capacity levels. And because logical I/O is always many times faster than physical I/

O, you should also evaluate the buffer cache hit ratio to determine overall memory vs. physical read efficiency.

Page Writes can give you an idea of overall physical write activity. There are a number of statistics, however, that pertain specifically to certain write activities like checkpoints, that can be examined to determine the amount of physical writes caused by distinct SQL Server processes.

Regarding performance, response times experienced by users are normally not impacted by write operations unless the writes are synchronous. These are typically BCPs, database recovery operations, and index creations.

D

ATABASE

B

YTES

R

EAD

/W

RITE

S

UMMARY

The Database Bytes Read/Write Summary statistics represent the number of bytes read and written by SQL Server.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O

> Database I/O Tab

D

ATABASE

I/O D

ETAIL

The Database I/O section of the Database I/O tab of the I/O Detail summarizes I/O activity for each database, letting you quickly spot the “hot” databases on your server. The table below describes the information available in the Database I/O Detail section for SQL Server 2000 and later:

Information

Database

Description

The name of the database.

12 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Information

Reads

Writes

Bytes Read

Bytes Written

I/O Stall

Description

The number of reads issued against the database.

The number of writes issued against the database.

The total number of bytes read for the database.

The total number of bytes written for the database.

The total amount of time that processes have waited for I/O operations to complete, in milliseconds.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> Database I/O Tab

Consider moving databases with lots of I/O activity and wait time onto separate drives/devices.

F

ILE

T

AB

The File tab of I/O Detail includes the following sections:

File Bytes Read/Write Summary File I/O Detail

File Read/Write Summary

F

ILE

R

EAD

/W

RITE

S

UMMARY

The Reads statistic represents that number of physical database page reads that are issued per second by SQL Server. The Writes statistic represents the number of physical database page writes issued by SQL Server. Writes take place during operations such as checkpoints, lazywriter writes, index creations, and BCP routines. Both statistics are collective in nature, meaning that they represents the total reads and writes across all databases that exist on the target SQL

Server.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> File Tab

Page reads are to be expected, especially after initial server start up. This is because SQL Server must first satisfy requests for data and metadata by reading information in from physical disk. Numerous page reads can also be expected if the physical server does not contain an adequate amount of memory to hold repetitively requested blocks of information. No hard and fast rules exist for how many page reads per second is too much. You can cross reference this statistic with the physical server disk statistics to see if physical page reads and accompanying physical disk I/O is approaching the server's premium capacity levels. And because logical I/O is always many times faster than physical I/

O, you should also evaluate the buffer cache hit ratio to determine overall memory vs. physical read efficiency.

Page Writes can give you an idea of overall physical write activity. There are a number of statistics, however, that pertain specifically to certain write activities like checkpoints, that can be examined to determine the amount of physical writes caused by distinct SQL Server processes.

Regarding performance, response times experienced by users are normally not impacted by write operations unless the writes are synchronous in nature. These are typically BCPs, database recovery operations, and index creations.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1249

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

F

ILE

B

YTES

R

EAD

/W

RITE

S

UMMARY

The File Bytes Read/Written statistics communicate the number of bytes read and written by

SQL Server.

Location

Microsoft SQL Server Performance Analyst Statistics >

I/O

> File Tab

F

ILE

I/O D

ETAIL

The File I/O Detail section of the File tab of the I/O Detail summarizes I/O activity for each database file, letting you quickly spot the “hot” databases and files on your server. The table below describes the information available in the File I/O Detail section for SQL Server 2000 and later:

Information

Database

File ID

Logical Name

File Name

Timestamp

Reads

Writes

Bytes Read

Bytes Written

I/O Stall

Description

The database name.

The file identifier for the target file.

The name given the file by the DBA.

The physical file name of the file.

The internal time stamp of when the data was obtained.

The number of reads issued against the database file.

The number of writes issued against the database file.

The total number of bytes read for the database file.

The total number of bytes written for the database file.

The total amount of time that processes have waited for I/O operations to complete, in milliseconds.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

I/O

> File Tab

Consider moving databases and/or files with lots of I/O activity and wait time onto separate drives/ devices.

S

PACE

In addition to a

Home page, the Space category of SQL Server Performance Analyst includes the

following tabbed pages:

File Groups Tab

Virtual Log Files Tab

Files Tab

Server Space Tab

Objects Tab

12 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

H

OME

The Home page of the Space category includes statistics in the following categories:

Bottleneck Analysis Pane

SQL Analysis Pane

Disk Analysis Pane

Space Analysis Pane

S

PACE

A

NALYSIS

P

ANE

A SQL server contains many databases, some of which are devoted to system-level activities (the master

and tempd b databases, for example) and others that hold user data. The Key Space

Analysis section of the Space home page displays details about the space situation for each database in a SQL server, including their total, used, and free space. The percent used amount for each database is also shown. In addition, each database’s transaction log space is analyzed and presented.

Metrics

If a database or transaction log’s free space goes below the Performance Analyst recommended threshold, (and either the database or transaction log does not have its automatic growth property enabled or the files have reached their growth limit) then the DBA should take action to ensure that the database or transaction log does not run out of available free space.

Correction

If the percent used amount of a database is approaching problematic levels, there are three ways a DBA can rectify the situation:

1 The DBA can resize the current file(s) used by the database via an ALTER DATABASE …

MODIFY FILE command.

2 The DBA can add a new file to the database via the ALTER DATABASE … ADD FILE command.

3 The DBA can modify the file(s) used by the database to automatically grow by using the

ALTER DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting of each file is set appropriately.

Of course, the DBA should also ensure that enough physical space exists on the server to accommodate additional database space. There are several things a DBA can do to ensure that a database’s log does not run out of available free space:

1 First, most transactional-oriented databases should have their logs assigned to separate physical drives other than the database. Reasons for doing this include:

• It prevents competition for space between the log and the database itself.

• It allows the log to be monitored for space more effectively.

• It improves performance.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1251

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

2 If the database is not critical in nature, you can set the truncate log on checkpoint option

(trunc log on chkpt), which eliminates any non-active space in the log when a database checkpoint occurs.

3 Critical databases needing higher levels of recovery should have schedules established that regular perform transaction log dumps. Doing so ensures better recovery scenarios as well as a reduced risk of the transaction log running out of space.

4 If a critical transaction log becomes full, it might be impossible to use standard procedures to dump transactions and reclaim space. The dump operation will likely have to incorporate the no log or truncate only options.

5 If a transaction log continuously approaches dangerously low levels of free space, then the

DBA should allow the underlying file(s) of the log to automatically grow to meet the demand. This can be accomplished by using the ALTER DATABASE … MODIFY FILE …

FILEGROWTH command. You should also ensure that the MAXSIZE setting of each file is set appropriately.

The DBA should also be on the lookout for large load or data modification operations that do not make use of prudently timed commit points. A single, large transaction has the ability to overwhelm any transaction log since only non-active space in the transaction log is removed from log dumps or truncation operations.

B

OTTLENECK

A

NALYSIS

P

ANE

When using bottleneck analysis to troubleshoot a database, a DBA cannot rely only on the information contained in the wait event views that SQL Server provides. For example, a database might attempt to allocate another segment of space and yet be denied if no such free space exists on the server or if the underlying file has reached its growth limit. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that a DBA cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance

Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Space home page displays space-related bottlenecks that might be threatening the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Space home page to succinctly communicate the general overall space situation of the monitored database:

Databases Without Auto-Grow

Databases on Same Disk as Log

Databases With Auto-Shrink

Logs Without Auto-Grow

Database Files Near Max Size

Log Files Near Max Size

The following statistics, available on this pane, duplicate statistics available on the

Bottleneck

Analysis Pane

of the

Home

page:

DB’s Low on Space Logs Low on Space

12 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

D

ATABASE

F

ILES

N

EAR

M

AX

S

IZE

A DBA can specify that one or more files of a SQL Server database can automatically grow by enabling the file’s auto-growth property. A DBA can also specify that the file not be permitted to grow beyond a certain limit, and once that limit is reached, the file and/or the database might be permanently out of space. The Database Files Near Max Size statistic provides a count of how many database files are near their maximum file size.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

A DBA should not see any positive indicator that any file has reached its growth limit. While it might be okay from the standpoint that a file cannot simply grow anymore (if the database has other files that can grow or that no more space will be added to the database), the DBA should disable the autogrowth property of the file.

Correction If a file has reached its growth limit, a DBA can take a number of actions, including:

Eliminate the growth limit for the file either by increasing the limit size or allowing to grow in an unlimited fashion.

If the file is on a disk or file system that has no free space left, the DBA can add another file to the database to allow for space expansion and alter the problem file to have auto-growth property disabled.

D

ATABASES ON

S

AME

D

ISK AS

L

OG

To minimize I/O contention, a database should have its database files located on different physical disks than its log files. The Databases on Same Disk as Log statistic provides a count of how many databases have files that are on the same physical disk as their transaction log.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

For critical production systems, all databases should have their database and log files on different physical disks.

Correction If a DBA has database and log files on the same physical disk, they can create new database filegroups on different disks, relocate objects to the new filegroups, and then delete the old files/ filegroups.

D

ATABASES

W

ITHOUT

A

UTO

-G

ROW

In Microsoft SQL Server, a DBA has the ability to tell SQL Server to automatically grow a database in size when more space is required. This feature can save a critical transaction or other database request from failing due to a lack of free space in the database. It is recommended that critical databases have this feature enabled. The Databases Without Auto-Grow statistic provides a count of databases that do not have their automatic growth property enabled.

Location

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

Metrics Static databases (those not expected to grow in size) will likely not need their auto-growth property enabled. Growing, dynamic databases should almost always be allowed to automatically grow when needed.

Correction If any critical, dynamic database is found to not have its auto-growth feature enabled, then the DBA can modify the file(s) used by the database to automatically grow by using the ALTER DATABASE …

MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting of each file is set appropriately.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1253

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ATABASES

W

ITH

A

UTO

-S

HRINK

A database can be set up to automatically shrink in size if SQL Server finds the database with an abundance of unused free space. Setting a database up so that this occurs can help reduce wasted storage on a database server. The Databases With Auto-Shrink statistic provides a count of databases that are allowed to automatically shrink in size.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

Dynamic databases that have the potential to balloon in size and then have large amounts of that same data removed should be considered candidates for auto-shrink.

Correction If a DBA wants to configure a database to automatically shrink, they can issue a command similar to the following:

EXEC sp_dboption 'mydatabase','autoshrink',true

L

OGS

W

ITHOUT

A

UTO

-G

ROW

In Microsoft SQL Server, a DBA has the ability to tell SQL Server to automatically grow a database or transaction log in size when more space is required. This feature can save a critical transaction or other database request from failing due to a lack of free space in the database or transaction log. It is recommended that critical databases and their transaction logs have this feature enabled.

The Logs Without Auto-Grow statistic provides a count of transaction logs that do not have their automatic growth property enabled.

Location

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

Metrics Static databases (those not expected to grow in size) will likely not need their transaction log’s autogrowth property enabled. Growing, dynamic databases should almost always have their transaction log be set to automatically grow when needed.

Correction If any critical, dynamic database is found to not have their transaction log auto-growth feature enabled, then the DBA can modify the file(s) used by the database’s transaction log to automatically grow by using the ALTER DATABASE … MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

L

OG

F

ILES

N

EAR

M

AX

S

IZE

A DBA can specify that one or more transaction log files of a SQL Server database can automatically grow by enabling the file’s auto-growth property. A DBA can also specify that the file not be permitted to grow beyond a certain limit, and once that limit is reached, the file and/ or the transaction log might be permanently out of space. The Log Files Near Max Size statistic provides a count of how many transaction log files are near their maximum file size.

You should not see any positive indicator that any file has reached its growth limit. While it might be okay from the standpoint that a file cannot simply grow anymore (if the database transaction log has other files that can grow or that no more transactions are expected to occur within the database), the DBA should disable the auto-growth property of the file.

Location

Microsoft SQL Server Performance Analyst Statistics >

Space

> Home >

Bottleneck Analysis Pane

12 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction If a file has reached its growth limit, a DBA can take a number of actions:

Eliminate the growth limit for the file either by increasing the limit size or allowing to grow in an unlimited fashion.

If the file is on a disk or file system that has no free space left, the DBA can add another file to the database’s transaction log to allow for space expansion and alter the problem file to have autogrowth property disabled.

SQL A

NALYSIS

P

ANE

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end-user response times.

The SQL Analysis section of the Space home page shows a count of all SQL statements that have executed INSERT, UPDATE, DELETE, and TRUNCATE commands. Seeing these statistics should help you determine how much space-related SQL activity is occurring on your system.

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

Metrics

The statistics in this section can be used in many different ways. For example, large numbers of inserts could indicate a growing database and that a DBA should keep a watchful eye on free space. Heavy update numbers could mean trouble for objects containing many indexes (indexes typically undergo splits and fragmentation when large volumes of updates are thrown their way).

Many deletes might signal potential wasted space problems.

D

ISK

A

NALYSIS

P

ANE

The Disk Analysis section of the Performance Analyst Space home page provides a summary of the total database and log space used per server disk drive, as well as a summary of free disk space for each server drive.

Metrics

If any database or transaction log file has been set up to automatically grow, the DBA should ensure there is enough server disk space to accommodate any new, additional requests for space.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1255

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction

If you see any drive that has reached zero free space (or is close), you might want to add new files, on other disks with abundant free space, to any databases or transaction logs so that no out-of-space errors result.

F

ILE

G

ROUPS

T

AB

SQL Server manages physical storage space through files and file groups. The file groups tab displays detailed information regarding storage usage in each of the SQL Server file groups. The table below describes the information available in the File Groups Summary section of the File

Groups tab:

Information

Database Name

File Group ID

File Group

Can Grow

File Count

Size (MB)

Table Res

Index Res

Free (MB)

Free Percent

Description

The name of the database.

The numeric ID of the file group.

The name of the file group.

This indicates if one of more of the files making up the file group is allowed to grow automatically.

The number of files that make up the file group.

The total physical size of the file group.

The amount of reserved space consumed by tables.

The amount of reserved space consumed by indexes.

The amount of free space for the file group.

The percentage of free space for the file group.

Metrics

Unless server space is tight, it is normally wise practice to allow your files to automatically grow to meet demand for more incoming data. You should also physically separate your database and log files onto separate physical drives.

Correction

To let your files automatically grow until out of space, set the file's growth option in

Embarcadero’s DBArtisan or Embarcadero’s Rapid SQL, or by using the ALTER DATABASE...

MODIFY FILE command.

12 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

F

ILES

T

AB

SQL Server manages physical storage space through files and file groups. The Files tab displays detailed information regarding storage usage in each of the SQL Server files. The table below describes the information available in the Files Summary section of the Files tab:

Information

Database Name

Logical Name

File Group

File Name

Size (MB)

Can Grow

Growth Amount

Max File Size

Description

The name of the database.

The nickname given to the file by the DBA.

The name of the file group.

The name and location of the file.

The total physical size of the file.

This indicates if the file can automatically grow in size.

This indicates how much the file will grow in size.

This indicates the maximum file size that the file can grow.

Metrics

Unless server space is tight, it is normally wise practice to allow your files to automatically grow to meet demand for more incoming data. It is also smart to physically separate your database and log files onto separate physical drives.

Correction

To let your files automatically grow until out of space, set the file's growth option in

Embarcadero’s DBArtisan or Embarcadero’s Rapid SQL, or by using the ALTER DATABASE...

MODIFY FILE command.

V

IRTUAL

L

OG

F

ILES

T

AB

The Virtual Log Files tab of the Space Detail displays an internal structure of sorts for a each database's log. The presented information is helpful when trying to shrink a database's log because you can see how much of the log is active and exactly where the active portion resides.

The table below describes the information available on the Virtual Log Files tab of the Space

Detail:

Information

Database Name

File Name

Status

Size

Description

The name of database.

The name of the log file.

This indicates if this portion of the log is active or inactive (not being used).

The size of this portion of the log in MBs.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1257

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

O

BJECTS

T

AB

The Objects tab of the Space/Databases Detail includes the following sections:

Database Object Detail Database Object Summary

D

ATABASE

O

BJECT

S

UMMARY

Tables and indexes consume the storage in all databases. The Database Object Summary grid displays summary information regarding table and index storage for all databases. The table below describes the information available in the Database Object Summary section of the

Objects tab of the Space Detail:

Information

Database Name

Table Count

Index Count

Table Reserved (MB)

Index Reserved (MB)

Description

The name of the database.

The count of all tables in the database.

The count of all indexes in the database.

The amount of space (in MB) reserved by tables.

The amount of space (in MB) reserved by indexes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Space

> Objects Tab

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Objects Tab

Negative numbers viewed for index space information can be caused by inaccuracies contained in the

SQL Server data dictionary. Frequently, running a DBCC UPDATEUSAGE command against the database resolves the problem. However, there are bugs in SQL Server that sometimes caused erroneous numbers to the reported for the reserved space amounts used by tables and indexes.

D

ATABASE

O

BJECT

D

ETAIL

Tables and indexes consume the storage in all databases. The Database Object Detail grid displays object space details for the database selected in the Database Object Summary grid.

The table below describes the information available in the Database Object Detail section of the

Objects tab of the Space Detail:

Information

Object Owner

Object Name

Clustered

File Group

Reserved (KB)

Used (KB)

Free (KB)

Percent Used

Description

The owner of the object.

The name of the object.

Indicates if the index is clustered.

The file group where the object resides.

The amount of space reserved by the object in kilobytes.

The amount of space used by the object in kilobytes.

The amount of free space used by the object in kilobytes.

The percentage of space used by the object.

12 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Space

> Objects Tab

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Objects Tab

Negative numbers viewed for index space information can be caused by inaccuracies contained in the

SQL Server data dictionary. Frequently, running a DBCC UPDATEUSAGE command against the database resolves the problem. However, there are bugs in SQL Server that sometimes caused erroneous numbers to the reported for the reserved space amounts used by tables and indexes.

S

ERVER

S

PACE

T

AB

The Server Space tab of the Space Detail displays the amounts of space used by SQL Server per physical drive and by database per physical drive. The first section displays summary information and the second section contains space information per database.

The table below describes the information available in the Disk Summary By Space section on the Server Space tab of the Space Detail:

Column

SQL Data (MB)

SQL Log (MB)

Free

Description

The amount of reserved database space on the drive.

The amount of reserved log space on the drive.

The total amount of free space that remains on the drive.

The table below describes the information available in the Disk Summary By Database section on the Server Space tab of the Space Detail:

Column

Disk Drive

Database

SQL Data (MB)

SQL Log (MB)

Description

The physical drive letter.

The database name.

The amount of reserved database space on the drive.

The amount of reserved log space on the drive.

Metrics

If you allow your database and/or log files to automatically grow, and you see little or no free space left on their physical drives, an option is to add new files to the database or log on different drives to avoid any out of space errors. It is also smart to physically separate your database and log files onto separate physical drives.

Correction

If you need to add new files to your databases or logs, you can do so easily by using the ALTER

DATABASE… ADD FILE and ALTER DATABASE… ADD LOG FILE commands.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1259

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

U

SERS

In addition to a

Home page, the Users category of SQL Server Performance Analyst includes the

following tabbed pages:

Locks Tab

Top Sessions Tab

Session Waits Tab

System Waits Tab

H

OME

The Home page of the Users Performance Analyst statistics includes the following categories:

Bottleneck Analysis Pane

SQL Analysis Pane

Key User Analysis Pane

Workload Analysis Pane

Login Analysis

K

EY

U

SER

A

NALYSIS

P

ANE

User database activity can be examined using key performance statistics and wait/bottleneckbased analysis.

The following key statistics are used on the Performance Analyst Users home page to succinctly communicate the general session-based activity levels of the monitored database:

Active Processes

Active Transactions

Inactive Processes

System Processes

Transaction/Sec

T-SQL Batches

The Active Processes statistic represents the total number of active and open threads reported on the server. This number displays the number of processes actively performing work.

The active transactions statistic represents a count of the number of in-process transactions for SQL Server.

This metric represents the total number of threads logged on to the server that are idle at the current time.

The System Processes statistic represents the total number of threads logged on to the server that are SQL Server internal processes.

The transaction/sec statistic refers to the number of database transactions processed per second by SQL Server.

The T-SQL batches statistic refers to the number of transact SQL batches processed by

SQL Server.

B

OTTLENECK

A

NALYSIS

P

ANE

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

12 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If lock contention or heavy table scan activity has been dragging down database performance, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about which sessions and objects are causing the problem. The Performance Analyst

Home page identifies the top system and session waits that might be currently a cause of lessened performance.

When using bottleneck analysis, you cannot rely only on the information contained in the wait events that SQL Server provides. For example, a database might be suspect or offline. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that a DBA cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment.

Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst

Home page displays space-related bottlenecks as well as other sources of contention/ bottlenecks that might be dragging down the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Users home page to succinctly communicate the general overall performance level of the monitored database:

Current Blocked Processes

Lock Waits

SQL Re-Compilations

Failed Auto-Param Attempts

Lock Wait Time

Top Bottlenecked User Processes

Lock Timeouts

Scan Point Revalidations

The following statistic, available on this pane, dupicates a statistic appearing on the Bottleneck

Analysis Pane

of the

Home

page:

Table Lock Escalations

C

URRENT

B

LOCKED

P

ROCESSES

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

Unless a process times out via an application timeout mechanism, or the process has specified a timeout period via the SET LOCK_TIMEOUT command, a process waiting for a lock will wait indefinitely.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

You should immediately investigate any indicator above zero, before the situation has a chance to mushroom.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1261

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Other user processes then almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is where it gets tricky. The DBA can drill down into user detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process will wait for a lock before timing out.

F

AILED

A

UTO

-P

ARAM

A

TTEMPTS

Auto-parameterization occurs when an instance of SQL Server attempts to reuse a cached plan for a previously executed query that is similar to, but not the same as, the current query. The

Failed Auto-Param Attempts statistic shows the number of failed auto-parameterization attempts per second.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

Metrics SQL Server's ability to match new SQL statements with existing, unused execution plans increases when parameters or parameter markers are used in Transact-SQL statements. If an SQL statement is executed without parameters, SQL Server parameterizes the statement internally to increase the possibility of matching it against an existing execution plan. A small number for this statistic shows that SQL Server is efficiently reusing existing cached plans.

Correction You can increase the ability of the relational engine to match complex SQL statements to existing, unused execution plans, by explicitly specify the parameters using either sp_executesql or parameter markers in your T-SQL code. Doing so helps lower this number.

L

OCK

T

IMEOUTS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

Unless a process times out via an application timeout mechanism, or the process has specified a timeout period via the SET LOCK_TIMEOUT command, a process waiting for a lock will wait indefinitely. The lock timeouts represent the number of locks that have timed out due to the issuing of the aforementioned command.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

Any indicator above zero might indicate the presence of lock contention on the server.

12 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Once discovered, a blocking lock situation can be quickly remedied - the DBA issues a KILL against the offending process, eliminating the user's stranglehold on the objects they were accessing. Other user processes then almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is more difficult. You can drill down into user detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process will wait for a lock before timing out.

L

OCK

W

AITS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

Unless a process times out via a timeout mechanism, or the process has specified a timeout period via the SET LOCK_TIMEOUT command, a process waiting for a lock will wait indefinitely.

The Lock Waits statistic represents the number of lock requests that required a process to wait.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

Metrics Any indicator above zero might indicate the presence of lock contention on the server.

Correction Once discovered, a blocking lock situation can be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing.

Other user processes then almost always complete in an instant. Discovering the blocked lock situation is made easier by tools like Performance Analyst, but preventing the blocking lock situation in the first place is more difficult. The DBA can drill down into user detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process will wait for a lock before timing out.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1263

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

L

OCK

W

AIT

T

IME

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

Unless a process times out via an application timeout mechanism, or the process has specified a timeout period via the

SET LOCK_TIMEOUT

command, a process waiting for a lock will wait indefinitely. The lock wait time statistic represents the wait time (in milliseconds) that processes have had to wait to obtain a lock request.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

Any indicator above zero might indicate the presence of lock contention on the server.

Correction Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects they were accessing. Other user processes then nearly almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is where it gets tricky. The DBA can drill down into user detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process will wait for a lock before timing out.

S

CAN

P

OINT

R

EVALIDATIONS

The Scan Point Revalidations statistic represents the number of times per second that the scan point had to be revalidated to continue the scan.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

SQL R

E

-C

OMPILATIONS

The SQL re-compilations statistic represents the total number of recompiles triggered per second in a SQL Server instance. Recompiles occur when SQL Server determines that the currently defined execution plan for an executing stored procedure might no longer be the best possible plan. SQL Server pauses the query execution and recompiles the stored procedure.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

Recompiles slow down the process that is executing the procedure and increase the load on the CPU.

By extension, the more recompiles that are occurring on your system, the more overall load increases, resulting in poor performance. In general, you want to keep the number of recompiles low. The most common reasons SQL Server would issue a recompile are: Running sp_recompile against any table referenced in the stored procedure, significant data changes in a referenced table, schema changes to referenced objects, the use of the WITH RECOMPILE clause in the CREATE PROCEDURE or

EXECUTE statement, and a plan no longer available in the system cache.

12 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Try to practice coding standards that eliminate the most frequent causes detailed above. Also, try to:

Use temporary tables only in the stored procedure that created them.

Minimize creating temporary tables in control block structures.

Use the KEEP PLAN option on references to static temporary tables.

Issue the CREATE TABLE statement before any other references to the created table.

Minimize the use of temporary tables.

T

OP

B

OTTLENECKED

U

SER

P

ROCESSES

When viewing wait statistics, there are several levels of detail that a DBA can drill down into. The first level is the system view, which provides a global, cumulative snapshot of all the waits that have occurred on a system. The second level is the session view, which shows details on what events connected sessions are experiencing. Viewing these numbers can help a DBA determine which session-related wait events have caused the most commotion in a database thus far. The

Top Bottlenecked User Processes display identifies the processes with the most current wait time along with the event causing their current wait.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

SQL A

NALYSIS

P

ANE

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured server down in terms of enduser response times.

Before you can identify problem SQL in your database, you have to ask the question - “What is bad SQL?” What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The table below lists some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria Description

Reads (Physical) This is often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well.

Writes

CPU Time

These can be caused by DML activity (INSERTs, etc.), but writes can also be indicative of heavy disk sort activity.

This is how much CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

Elapsed Time This is how much time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1265

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above.

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you should answer:

• What has been the worst SQL that has historically been run in my database?

• What is the worst SQL that is running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It might be that the query is in an inefficient Transaction SQL loop, or other problematic programming construct.

Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

There is the possibility that the SQL statement just is not tuned well. To determine that, you can drill down further into the Performance Analyst Top SQL view and begin working with the query through EXPLAIN plan analysis and other techniques inside Embarcadero’s DBArtisan.

L

OGIN

A

NALYSIS

The Login Analysis section displays the number of successful login and logout operations.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home >

SQL Analysis Pane

W

ORKLOAD

A

NALYSIS

P

ANE

When the database population as a whole experiences a system slowdown, it is not uncommon to find one or two users who are responsible for bringing the system to its knees. In the best of worlds, users will have a pretty evenly divided amount of memory usage, disk I/O, CPU utilization, and parse activity. Unfortunately, this usually is not the case, and many times you will find users submitting large batch jobs during peak OLTP activity, or sessions that are firing off untuned queries on a critical system.

12 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

If you are seeing a slowdown in your database, and cannot seem to find a root cause, one thing to examine is the resource consumption of the leading sessions on a system. Oftentimes you will find one or a handful of users making things miserable for everyone else. They accomplish this by overwhelming the I/O capabilities of SQL Server (through untuned queries or runaway batch jobs) or hammering the CPU or memory structures of the database and server.

Performance Analyst makes it easy to pinpoint the top sessions by showing the leading processes at the physical I/O, memory, CPU, and transaction submission usage levels.

Metrics

If any one session appears to be using more than 50% of a total resource (CPU, memory, etc.), then you should drill down into the session to find out what they are currently executing.

T

OP

S

ESSIONS

T

AB

The Top Sessions tab of the Users Detail includes the following processes:

Top CPU Process

Top Sessions

Top I/O Process Top Memory Process

T

OP

I/O P

ROCESS

The Top I/O Process statistic identifies the SQL Server process that currently has caused the most I/O usage on the database.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

T

OP

M

EMORY

P

ROCESS

The Top Memory Process statistic identifies the SQL Server process that currently is using the highest percentage of memory in the database.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

T

OP

CPU P

ROCESS

The Top CPU Process statistic identifies the SQL Server process that currently has the highest percentage of CPU usage in the database.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1267

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

T

OP

S

ESSIONS

When a system experiences heavy activity, sometimes you will find that all the user connections are contributing somewhat equally to the overall load. More often than not, however, one or two user connections are causing most of the activity. It might be that a large batch load or other typical process is running that is perfectly okay for your system. Or it might be a runaway process or other rogue connection that needs to be tracked down and possibly eliminated.

Top Sessions displays information regarding all key statistics for all current sessions on a SQL

Server. The table below describes the information available in the Top Sessions section on the

Top Sessions tab of the Users Detail:

Memory

CPU

Physical I/O

Blocked

Host

Open

Transaction

Command

Login Time

Last Batch

Information

SPID

Login

Description

The unique identifier for the process.

The login name for the process.

Windows User The operating system name of the process.

Database The name of the database the process is working in.

Status

Program

The current status of the process.

This identifies the program being run by the process.

The number of pages in the procedure/SQL cache allocated to the process.

The cumulative CPU time for the process.

The cumulative total of all physical reads and writes for the process.

This indicates if the process is blocked by another process.

This identifies the workstation of the process.

This indicates if the process has an open transaction.

Host Process

Net Address

The command being currently issued by the process.

This identifies when the process logged into SQL Server.

This indicates the date/time the process executed a remote stored procedure or issued an EXEC command.

The process identifier on the SQL Server machine.

The network address of the process.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

C

URRENT

SQL

This view shows a snippet of the SQL associated with the user in question.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users > Home > Bottleneck Analysis Pane

12 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

S

YSTEM

W

AITS

T

AB

The System Waits tab of the Users Detail includes the following sections:

System Waits

Wait Percent by Time Waited Wait Percent by Total Waits

S

YSTEM

W

AITS

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The System Waits section identifies the waits that have occurred on SQL Server. The System Waits section identifies the waits that have occurred on SQL Server. The table below describes the information available in the System Waits section on the System Waits tab of the Users Detail:

Information

Wait Type

Requests

Percent of Total

Time Waited

Percent Time Waited

Signal Wait Time

Percent Signal Wait

Time

Description

The actual wait event name.

The number of waits.

The percentage of the occurrences of this wait to all wait requests.

The number of seconds SQL Server spent waiting for this wait.

The percentage of time SQL Server spent waiting on this wait.

The signal wait time for the wait.

The percentage of signal wait time SQL Server spent waiting on this wait.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users

> System Waits Tab

Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

Correction

The table below describes some possible solutions to some of the most common wait events:

Wait Event

CURSOR

CMEMTHREAD

CXPACKET

EXCHANGE

Description

This indicates SQL is waiting to sync up with asynchronous cursors and can point to the excessive use of cursors.

This indicates waits for memory to be freed up for use.

This relates to SQL Server parallelism. Oftentimes the cost of SQL Server using parallelism for a query is high, with the end result being these types of waits. If high, you can adjust SQL

Server and turn parallelism off for the server or for just low cost queries.

Related to CXPACKET. See information above.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1269

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Wait Event

IO_COMPLETION

LOGMGR

OLEDB

PAGEIOLATCH

PAGELATCH

PAGESUPP

PSS_CHILD

TEMPOBJ

WAITFOR

WRITELOG

XACTLOCKINFO

Description

This means certain I/O related actions are being delayed. Bulk insert operations, growth of database or log files, high physical I/O SQL, page splitting, and server paging are potential causes. You can check Performance Analyst's SQL Analysis section to ferret out heavy I/O SQL and the Database and File I/O Detail pages (SQL Server 2000 and later) to examine disk and database hot spots with respect to I/O. The I/O Stall column is especially useful in determining which files are experiencing the most delays.

This refers to waits for the Log Writer to start writing a transaction. High waits here might warrant transfer transaction logs to faster devices or breaking up long running DML transactions.

This indicates waits for an OLE DB operation to act on its requests. Slow connection speeds or very high transaction rates can cause these.

Related to IO_COMPLETION. See information above.

Related to IO_COMPLETION. See information above.

Related to CXPACKET. See information above.

This is SQL waiting for a child thread within an asynchronous cursor and can point to the excessive use of cursors.

This wait occurs when temp tables and the like are dropped.

Waits caused by the WAITFOR T-SQL command. Not a cause for concern.

Related to LOGMGR. Refers to waits for writes to disk of transactions. See information above.

Involves the release of escalation of locks during bulk operations.

W

AIT

P

ERCENT BY

T

OTAL

W

AITS

When SQL Server is running, every connected process is either busy doing work or waiting for work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Wait Percent by Total Waits section graphically depicts the top waits as a percentage of all waits.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> System Waits Tab

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

W

AIT

P

ERCENT BY

T

IME

W

AITED

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Wait Percent by Time

Waited section graphically depicts the top waits by their percentage of time waited to total time waited. 5

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> System Waits Tab

12 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q24445

S

ESSION

W

AITS

T

AB

The Session Waits tab of the Users Detail includes the following sections:

Session Wait Percent by Time

Waited

Session Wait Percent by Wait Type

Session Waits

S

ESSION

W

AITS

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Session Waits section shows processes that are currently waiting on SQL Server. The table below describes the information available in the Session Waits section on the Session Waits tab of the Users Detail:

Information

SPID

Login Name

Windows User

Status

Host

Program

Description

The unique identifier for the process.

The login name for the process.

The operating system name of the process.

The current status of the process.

This identifies the workstation of the process.

This identifies the program being run by the process.

Last Wait Type

Wait Time

The actual wait event name.

The number of seconds the process spent waiting for this wait.

Percent Total Wait Time The percentage of wait time for this process vs. total processes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Users

> Session Waits Tab

Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

Correction he table below describes some possible solutions to some of the most common wait events:

T

Wait Event

CURSOR

Description

This indicates SQL is waiting to sync up with asynchronous cursors and can point to the excessive use of cursors.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1271

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Wait Event

CMEMTHREAD

CXPACKET

EXCHANGE

IO_COMPLETION

LOGMGR

OLEDB

PAGEIOLATCH

PAGELATCH

PAGESUPP

PSS_CHILD

TEMPOBJ

WAITFOR

WRITELOG

XACTLOCKINFO

Description

This indicates waits for memory to be freed up for use.

This relates to SQL Server parallelism. Oftentimes the cost of SQL Server using parallelism for a query is high, with the end result being these types of waits. If high, you can adjust SQL

Server and turn parallelism off for the server or for just low cost queries.

Related to CXPACKET. See information above.

This means certain I/O related actions are being delayed. Bulk insert operations, growth of database or log files, high physical I/O SQL, page splitting, and server paging are potential causes. You can check Performance Analyst's SQL Analysis section to ferret out heavy I/O SQL and the Database and File I/O Detail pages (SQL Server 2000 and later) to examine disk and database hot spots with respect to I/O. The I/O Stall column is especially useful in determining which files are experiencing the most delays.

This refers to waits for the Log Writer to start writing a transaction. High waits here might warrant transfer transaction logs to faster devices or breaking up long running DML transactions.

This indicates waits for an OLE DB operation to act on its requests. Slow connection speeds or very high transaction rates can cause these.

Related to IO_COMPLETION. See information above.

Related to IO_COMPLETION. See information above.

Related to CXPACKET. See information above.

This is SQL waiting for a child thread within an asynchronous cursor and can point to the excessive use of cursors.

This wait occurs when temp tables and the like are dropped.

Waits caused by the WAITFOR T-SQL command. Not a cause for concern.

Related to LOGMGR. Refers to waits for writes to disk of transactions. See information above.

Involves the release of escalation of locks during bulk operations.

S

ESSION

W

AIT

P

ERCENT BY

W

AIT

T

YPE

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Session Wait Percent by

Wait Type section graphically depicts the top waits by wait type.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> Session Waits Tab

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this link (Microsoft Knowledge Base Article - 244455) to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

12 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

S

ESSION

W

AIT

P

ERCENT BY

T

IME

W

AITED

When SQL Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Session Wait Percent by

Time Waited section graphically depicts the top session waits by their percentage of time waited to total time waited.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> Session Waits Tab

Correction Wait events can be hard to interpret at times. If you see a particular event that has caused a lot of wait time, you can review the information in this Microsoft Knowledge Base Article to help understand the cause and potential remedy: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q244455

L

OCKS

T

AB

The Locks tab of the Users Detail includes the following sections:

Locks

Locks by Lock Type Locks by Database

L

OCKS

To modify database information or structures, a user session must obtain a lock on the object to perform its task. In addition to user locks, SQL Server itself issues lock requests to carry out its internal duties. The Locks section gives information the locks currently on the system and also indicates if any blocking situations are occurring. The table below describes the information available in the Locks section:

Information

SPID

Login

Windows User

Database

Table Name

Index ID

Lock Type

Lock Mode

Lock Status

Lock Owner Type

User Program

Blocking SPID

Description

The process id of the process holding the lock.

The login name of the process.

The operating system name of the process.

The database in which the process is running.

The name of the table involved in a lock. This will be NULL for nontable locks or table locks that take place in the tempdb database.

The index ID involved in the lock.

The type of the lock (database, table, row id, etc.)

The lock's mode (shared, exclusive, etc.)

The lock's status (waiting or granted).

Whether the lock came from a regular session or a transaction.

The executable the process is using against the server.

If zero, the process is not being blocked. If non-zero, this column represents the process ID of the process blocking the requested lock.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1273

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Information

Wait Time

SPID Status

SPID Command

NT Domain

Location

Metrics

Description

The current amount of wait time for the process, in milliseconds.

Indicates if the process is actively performing work, is idle, blocked by another process, etc.

The command the process is currently issuing.

The name of Windows 2000/NT domain.

Microsoft SQL Server Performance Analyst Statistics >

Users

> Locks Tab

Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the stranglehold on the objects the user was accessing. Other user processes then almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Embarcadero Performance Analyst, but preventing the blocking lock situation in the first place is tricky.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in SQL Server. You can change this behavior by using the SET LOCK_TIMEOUT command, which limits the number of seconds that a process waits for a lock before timing out.

L

OCKS BY

L

OCK

T

YPE

To modify database information or structures, a user session must obtain a lock on the object to perform its task. In addition to user locks, SQL Server itself issues lock requests to carry out its internal duties. The Locks by Lock Type section of the Users Detail provides a graphical percentage breakdown of the different locks types being issued across all databases.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> Locks Tab

L

OCKS BY

D

ATABASE

The Locks by Database section of the Lock tab provides a graphical representation of the percentage breakdown of locks by database.

Location

Microsoft SQL Server Performance Analyst Statistics >

Users

> Locks Tab

D

ATABASE

In addition to a Home

page, the Database category of SQL Server Performance Analyst includes the following tabbed pages:

Backups Tab

Overview Tab

Configuration Tab

Replication Tab

Error Log Tab

SQL Agent Tab

12 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Objects Tab

H

OME

The Home page of the Database Performance Analyst page includes the following categories:

Bottleneck Analysis Pane

Workload Analysis Pane

Database Analysis Pane

SQL Analysis Pane

D

ATABASE

A

NALYSIS

P

ANE

SQL Server is broken up into many different databases, all of which have their own levels of activity. The Database Analysis section displays a summary of activities that have occurred within each database. The table below describes the information available in the Database Analysis section:

Information

Database Name

DBCC Logical Scans

Transactions

Active Transactions

Bulk Copy Rows

Bulk Copy Throughput

Log Cache Reads

Log Flushes

Log Growths

Log Shrinks

Description

The name of the database.

The number of DBCC scans that have occurred within the database.

The number of transactions that have occurred within the database.

The number of transactions currently running in the database.

The number of rows inserted per second into the database via BCP operations.

The amount of data bulk (KB) copied into the database per second.

The number of reads per second that have gone through the log manager cache.

The number of transaction log flushes per second. A log flush occurs when SQL Server writes all changes from the database’s log cache out to the database’s log files on disk.

The number of times the transaction log has grown in size.

The number of times the transaction log has reduced itself in size.

B

OTTLENECK

A

NALYSIS

P

ANE

When using bottleneck analysis to troubleshoot a database, a DBA cannot rely only on the information contained in the wait event views that SQL Server provides. For example, a critical database might be offline or be marked suspect. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that a DBA cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate performance risk assessment. Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Database home page displays database-related bottlenecks that might be dragging down the overall performance of your system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1275

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

The following bottleneck indicators are used on the Performance Analyst Database home page to communicate the general overall conditions of databases on the monitored server:

Databases Requiring Backup

Extents Allocated

Databases Without Auto-Create

Stats

Freespace Scans

Databases Without Auto-Update

Stats

Page Splits

The following statistics, available on this page, duplicate statistics available on the Bottleneck

Analysis Pane

of the

Home

page:

Suspect Databases Offline Databases

D

ATABASES

R

EQUIRING

B

ACKUP

This metric represents the number of databases in SQL Server that have not been backed up for more than seven days. This statistic excludes the pubs, tempdb, Northwind, msdb, and model databases.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

To ensure proper protection for most databases, it is recommended that even the most static databases be backed up at least once a week. You should frequently backup critical, dynamic databases and include transaction log backups to enable point-in-time recovery ability.

Correction Any critical databases found with obsolete or no backups should immediately be backed up.

Moreover, to ensure proper data protection for each database, you should institute a planned backup schedule. The timing and repetition of the backups depend on the critical recovery needs of each database.

D

ATABASES

W

ITHOUT

A

UTO

-C

REATE

S

TATS

The Databases Without Auto-Create Stats statistic represents the total number of databases defined on SQL Server that do not have the AUTO_CREATE_STATISTICS option enabled.

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

Metrics When the AUTO_CREATE_STATISTICS option is enabled, statistics are automatically created on columns used in a SQL query predicate. Keeping object statistics fresh in the SQL Server data dictionary improves query performance because the optimizer can better determine how to evaluate a query and return the requested data. If the statistics are not used, SQL Server should automatically delete them.

Correction If possible, a DBA should keep their databases in AUTO_CREATE_STATISTICS mode. If a database is found without this option set, you can easily change it by using the command:

EXEC sp_dboption '<database name>','auto create statistics',true

12 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

D

ATABASES

W

ITHOUT

A

UTO

-U

PDATE

S

TATS

The Databases Without Auto-Update Statistics statistic represents the total number of databases defined on SQL Server that do not have the AUTO_UPDATE_STATISTICS option enabled.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

When the AUTO_UPDATE_STATISTICS option is enabled, SQL Server automatically updates existing statistics when the statistics become out-of-date because data in the tables has changed enough to affect the optimizer's decision-making process.

Correction If possible, a DBA should keep databases in AUTO_UPDATE_STATISTICS mode. If a database is found without this option set, you can easily change its auto-update statistics to true by using the command:

EXEC sp_dboption '(database name)',

E

XTENTS

A

LLOCATED

SQL Server groups eight 8KB pages together to form an extent of space (64KB). Space is allocated to database objects (tables, indexes) in the form of extents. The Extents Allocated statistic provides a count of the number of extents allocated to tables and indexes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

None. However, be aware that excessive counts of allocated extents might signal a large load job occurring in the database.

F

REESPACE

S

CANS

The Freespace Scans statistic provides a count of the number of scans SQL Server initiated to search for free space that will accommodate requests to insert new data rows.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

None. However, be aware that excessive counts of freespace scans might signal INSERT problems being performed on large tables.

P

AGE

S

PLITS

When data is added or modified for a table that has indexes, the indexes must be updated as well. As index pages fill up, free space needed to keep index keys in their proper order can oftentimes run very low. If an index update needs to be made to a page, and no free space exists on that page, SQL Server will perform a page split where it moves approximately half the rows on a page to a new page. The Page Splits statistic provides a count of how many page splits are occurring in SQL Server.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

Page splits cause additional overhead in the form of CPU usage and I/O. Observing large numbers of page splits can signal a resource bottleneck in your server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1277

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction To avoid page splits, you can look into tuning the FILLFACTOR property of an index, which controls the percentage of the index page that is filled during creation. The default, 100, tells SQL Server to completely fill each page, whereas lower numbers tell SQL Server to leave room for additional index rows or updates to existing rows.

SQL A

NALYSIS

P

ANE

Certain databases on a SQL Server will experience more SQL activity than others. The SQL

Analysis section displays a count of all statement executions for each database.

The SQL Analysis section provides you with a quick overview of the percentage of Reads, Writes,

CPU, and Elapsed Time the most expensive SQL statements tracked by Performance Analyst have used. Depending on the page you are on, you might just see information regarding physical I/O activity or DML statements. For example, you might see that a SQL statement has caused 60% of all physical reads on the system, or that a procedure is responsible for 90% of all the CPU usage. To get information regarding the actual SQL text or stored procedure calls, drill down into the Top SQL details views.

NOTE:

SQL Profiling is turned on by default in Performance Analyst so you can automatically collect SQL traffic. If you do not want to collect SQL execution information, use the options inside of Performance Analyst to disable SQL profiling.

E

RROR

L

OG

A

NALYSIS PANE

SQL Server records various system events in its system or error log. The majority of messages placed into the log are informational in nature, however since some contain critical messages, you should immediately review them. This section indicates the number of actual error messages in the most recent error log so you know if there are potential events that require your attention.

NOTE:

Similar information is also available on the

Bottleneck Analysis Pane of the

Home page.

Metrics

You should investigate any positive values for errors.

Correction

If non-zero values are found for this statistic, you should drill down into the current error log and examine the detail found that accompanies each error issued by SQL Server.

W

ORKLOAD

A

NALYSIS

P

ANE

SQL Server is broken up into many different databases, all of which have their own levels of activity. The Workload Analysis section displays a summary of resource consumption across all databases. The table below describes the information available in the Workload Analysis section:

Information

Database Name

Description

The name of the database.

12 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Information

Connections

Blocked Users

Total Memory

Total I/O

Total CPU

Total Wait Time

Description

The number of processes that are connected to the database.

The number of processes in the database experiencing blocks from lock activity.

The total number of memory pages in use by processes for each database.

The total amount of physical I/O being experienced by each database.

The total amount of cumulative CPU for all processes connected to the database.

The total wait time (in milliseconds) that all processes connected to the database have experienced.

DBCC Running Count

BCP Running

This indicates if any DBCC operations are currently running against the database.

This indicates if any BCP operations are currently running against the database.

Backup Restore Running This indicates if any backup or restore operations are currently running against the database.

O

VERVIEW

T

AB

The Overview tab of the Database Detail includes the following sections:

Database Object Analysis

Database User Analysis

Database Size Analysis

Database Summary

D

ATABASE

S

IZE

A

NALYSIS

The Database Size Analysis chart displays each database in terms of its total percentage of size to the total size of all databases on the SQL Server.

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

D

ATABASE

O

BJECT

A

NALYSIS

The Database Object Analysis chart displays each database in terms of its total percentage of object to the total objects for all databases on the SQL Server.

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

D

ATABASE

U

SER

A

NALYSIS

The Database User Analysis chart displays each database in terms of its total percentage of user accounts to the total user accounts of all databases on the SQL Server.

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1279

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ATABASE

S

UMMARY

The Database Summary Analysis section displays summarized metadata for all defined databases on SQL Server. The table below describes the information available in the Database

Summary section:

Information

Database

Created

Status

Description

The name of the database.

The date/time when the database was created.

The status of the database (online, offline, suspect, etc.)

Database Size (MB) The total size of the database in MB.

Log Size (MB) The total size of the log in MB.

Tables

Indexes

The number of all tables in the database.

The number of all indexes in the database.

Users

Last Backup

Autoshrink

DB Autogrow

Log Autogrow

Autocreate Stats

Autoupdate Stats

The number of all defined user accounts in the database.

The date/time of the last full backup for the database.

This indicates if the database will release space automatically back to the operating system when it does not need it.

This indicates if one or more of the database’s underlying files can automatically grow in size if needed.

This indicates if one or more of the log’s underlying files can automatically grow in size if needed.

This indicates if object statistics are automatically created for objects in the database.

This indicates if object statistics are automatically updated for objects in the database.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Home > Bottleneck Analysis Pane

The following are things to take note of:

Any critical database that shows a last full backup date that is older than the database’s required backup needs.

Any database that shows a status of offline or suspect.

Any growing database that does not have its database or log files set to automatically grow in size.

Any dynamic database that does not have its object statistics set to automatically update.

12 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Depending on the situation, you should take the following actions:

For databases that require a full backup, perform a full backup of the database when appropriate.

For suspect databases, the steps to handling will vary from one installation to another. However, here are some general guidelines you can use to troubleshoot a suspect database:

Begin by examining the SQL Server error log for clues as to what caused the database to be marked as suspect.

It is not unusual for a server to run out of physical disk space on drives used by SQL Server. When this happens, recovery for databases can sometimes fail with the end result being SQL Server marking a database as suspect. To remedy this situation, you should free up space on the identified drives or add files to the newly marked suspect database. For SQL Server 2000, this can be accomplished by utilizing the following stored procedures: sp_add_data_file_recover_suspect_db

and sp_add_log_file_recover_suspect_db

. For SQL Server version 7.0, you will need to use the sp_resetstatus

stored procedure to reset the suspect status flag for the database in question, use the alter database

command to add new datafiles to the database, and then stop/start SQL Server.

Many times, suspect databases are caused by SQL Server not being able to access a database or log file. This happens if a particular physical hard drive has become unavailable, but also can occur if another operating system process has obtained exclusive access to a file. If this scenario proves to be true, once you have ensured that the file(s) are available once again to the operating system, you can use the sp_resetstatus

stored procedure to reset the suspect status flag for the database and then stop/start SQL Server.

Should an offline database be found by Performance Analyst, you can easily place it back online by utilizing either the sp_dboption

stored procedure or the alter database

command. If any critical, dynamic database or log is found to not have their auto-growth feature enabled, then the DBA can modify the file(s) used by the database to automatically grow by using the ALTER DATABASE …

MODIFY FILE … FILEGROWTH command. You should also ensure that the MAXSIZE setting for each file is set appropriately.

If possible, a DBA should keep their databases in AUTO_CREATE_STATISTICS and

AUTO_UPDATE_STATISTICS mode. If a database is found without this option set, you can easily change it by using the following commands:

EXEC sp_dboption '<database name>','auto create statistics',true

EXEC sp_dboption '<database name>','auto update statistics',true

E

RROR

L

OG

T

AB

The Error Log tab of the Database Detail includes the following sections:

SQL Server Error Log

Error Log Content Analysis Error Log Volume Analysis

SQL S

ERVER

E

RROR

L

OG

SQL Server logs events pertinent to its operations to the SQL Server error log and the operating system application log. Errors encountered by SQL Server are clearly visible in the log, however large logs can be difficult to navigate. The SQL Server Error Log section displays all events for a selected log or just errors.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Error Log Tab

You should investigate any positive values reported for errors.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1281

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

E

RROR

L

OG

V

OLUME

A

NALYSIS

SQL Server logs events pertinent to its operations to the SQL Server error log and the operating system application log. Errors encountered by SQL Server as well as informational message are recorded in the log. The Error Log Volume Analysis section displays a graph that shows the volume amount of messages/errors over the last five days.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Error Log Tab

Seeing a disproportionate percentage of messages for one day might indicate that something has, or is occurring that needs investigation.

E

RROR

L

OG

C

ONTENT

A

NALYSIS

SQL Server logs events pertinent to its operations to the error log and the operating system application log. Errors encountered by SQL Server as well as informational message are recorded in the log. The Error Log Content Analysis section displays a graph that shows percentage of informational messages to errors in the current log.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Error Log Tab

You should investigate any indicated errors.

O

BJECTS

T

AB

The following statistics, available on this tab, are duplicates of statistics available on the Objects

Tab

of the Space

page:

Database Object Summary Database Object Detail

SQL A

GENT

T

AB

The SQL Agent tab of the Database Detail includes the following sections:

Job/Alert Detail

SQL Server Alert Summary SQL Server Job Summary

J

OB

/A

LERT

D

ETAIL

SQL Server provides the ability to submit and run jobs as well as be notified about certain SQL

Server-related events. The Job/Alert Detail section displays information regarding the status of the server’s SQL Agent as well as details for all jobs and alerts that are defined to the system.

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

SQL Agent Tab

12 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

SQL S

ERVER

J

OB

S

UMMARY

The SQL Server Job Summary section graphically displays the outcome of all jobs for the last two days, as well as current activity.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

SQL Agent Tab

You should investigate any counts noted for failed jobs.

SQL S

ERVER

A

LERT

S

UMMARY

The SQL Server alert summary section graphically displays the number of times that performance and event alerts have fired.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

SQL Agent Tab

You should investigate any counts noted for any event.

B

ACKUPS

T

AB

The Backups tab of the Database Detail includes the following:

Backup Detail

Database Backup Summary Log Backup Summary

B

ACKUP

D

ETAIL

The Backup section displays the most recent 25 backups for a selected database. The table below describes the information available on the Backups tab of the Database Detail:

Information

Database

Backup Start

Backup Finish

Backup Type

Backup Size (KB)

Expiration Date

Description

The name of the database.

The time stamp when the backup began.

The time stamp when the backup finished.

The type of backup (FULL, INCREMENTAL, etc.)

The size of the backup, in kilobytes.

The expiration date for the backup, if any.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Backups Tab

Although the needs of an application determine the frequency and type of backup, it is generally recommended that most dynamic databases have a solid plan in place for full and differential backups. For databases requiring point-in-time recovery, a backup plan should also include log backups.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1283

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ATABASE

B

ACKUP

S

UMMARY

The Database Backup Summary section graphically displays the backup successes and failures for database backups over the last week.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Backups Tab

You should investigate any backup failures.

L

OG

B

ACKUP

S

UMMARY

The Log Backup Summary section graphically displays the backup successes and failures for database log backups over the last week.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Backups Tab

You should investigate any backup failures.

C

ONFIGURATION

T

AB

The Configuration tab of the Database Detail displays metadata regarding the hardware characteristics of the SQL Server as well as the SQL Server configuration parameters. The table below describes the information available on the Configuration tab:

Information

Parameter

Value

Run

Minimum

Maximum

Dynamic

Description

The parameter name.

The value set for the parameter.

The value currently running for the parameter.

The minimum value allowed for the parameter.

The maximum value allowed for the parameter.

Whether the parameter is dynamic (can be changed without requiring

SQL Server to be stopped/started) or not.

R

EPLICATION

T

AB

The Replication tab of the Database Detail provides basic information regarding replication activities that are occurring on the monitored SQL Server.

Replication Agent Details

The Replication Agent Details section shows information regarding replication. The table below describes the information available on the Replication tab:

Information

Agent

Publication

Description

The agent performing the replication work.

The object being published to a subscribing database.

12 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Information

Publisher

Publisher Database

Status

Subscriber

Subscriber Database

Type

Start Time

Duration

Last Action

Location

Description

The SQL Server providing the source material.

The database of the SQL Server providing the source material.

The current status of the replication agent's task.

The SQL Server requesting the source material.

The database of the SQL Server requesting the source material.

The type of replication activity (push, pull, etc.)

The start time for the replication task.

The duration of the replication task.

The output message for the replication task.

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Replication Tab

R

EPLICATION

T

HROUGHPUT

D

ETAILS

The Replication Throughput Details section of the Replication tab displays:

• Replication Type

• Measure

• Instance Name

• Value

Location

Microsoft SQL Server Performance Analyst Statistics >

Database

>

Replication Tab

OS

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O, or Memory), a slow CPU, insufficient or slow I/O devices, and insufficient memory. The OS Statistics page of Performance

Analyst lets you examine operating system metrics for the following platforms:

• AIX

• HP-UX

NOTE:

To view processor info and swap disk info on an HP-UX box, you need to login as ROOT in the OS login.

• Linux

• Solaris

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1285

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

• Unix

• Windows XP and 2000

NOTE:

The statistics available on the OS page depend on the operating system platform.

TIP:

If you magnify a graph to change back to the original size or minimize the size, close the OS Page and then reopen it again. Performance Analyst displays the graph in its original form and size.

In addition to a Home

page, the OS category of SQL Server Performance Analyst includes the following tabbed pages:

CPU Tab

Network Tab

I/O Tab

Processes Tab

Memory Tab

Space Tab

H

OME

The OS home page includes the following sections:

Key Resource Usage Pane

Memory Analysis Pane

Disk Analysis Pane

Workload Analysis Pane

Bottleneck Analysis Pane

K

EY

R

ESOURCE

U

SAGE

P

ANE

The following ratios are used on the Performance Analyst OS home page to communicate the general overall performance levels of the operating system:

Disk Time

Swap Memory Used (Windows)

Swap Memory Used

Swap Memory Used (AIX, HP-UX,

Linux, Solaris, Unix)

Processor Time

TIP:

To open the CPU tab, right-click Processor Time. To open the I/O tab, right-click Disk

Time. To open the Memory tab, right-click Paged Memory Used.

D

ISK

T

IME

The Disk Time statistic is the percentage of elapsed time that the selected disk drive/device was busy servicing read or write requests.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home > Key Resource Usage Pane

You should avoid consistently seeing values for this statistic greater then 90%.

Correction Add more disk drives and partition the files among all of the drives.

12 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

L

OAD

A

VERAGE

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home > Key Resource Usage Pane

High load averages usually mean that the system is being used heavily and response time is correspondingly slow.

P

ROCESSOR

T

IME

The Processor Time statistic indicates the percentage of time the processor is working. This counter is a primary indicator of processor activity.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home > Key Resource Usage Pane

Metrics If your computer seems to be running sluggishly, this statistic could be displaying a high percentage.

Correction Upgrade to a processor with a larger L2 cache, a faster processor, or install an additional processor.

P

AGED

M

EMORY

U

SED

The Paged Memory Used statistic is the ratio of Commit Memory Bytes to the Commit Limit.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk. The commit limit is determined by the size of the paging file. As the paging file increases, so does the commit limit.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home > Key Resource Usage Pane

This value displays the current percentage value only and not an average. If the percentage of paged memory used is above 90%, you may be running out of memory.

Correction Increase the size of page file.

S

WAP

M

EMORY

U

SED

The Swap Memory Used statistic is the percentage of swap space currently in use.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home > Key Resource Usage Pane

Metrics If the percentage of swap memory used is above 90%, you may be running out of memory.

Correction Increase the size of your swap files.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1287

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

B

OTTLENECK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Average Disk Queue Length Interrupts/Sec

Page Faults/Sec

Processor

Processor Queue Length

Network Output Queue Length/

Network Queue Length

Processor Speed

TIP:

To open the I/O tab, right-click any Details menu item. To open the CPU tab, right-click the Item Processor Queues Length Details menu item. To open the Network tab, rightclick Network Output Queues Length.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VERAGE

D

ISK

Q

UEUE

L

ENGTH

The Average Disk Queue Length statistic is the average number of both read and write requests that were queued for the selected disk during the sample interval.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

This metric is useful in identifying I/O related bottlenecks. If the disk queue lengths for certain disks are consistently much higher than others, you may need to redistribute the load among available disks. If the disk queues lengths for all disks are consistently large, and you see a high amount of I/O activity, your disks may be inefficient.

Correction Some things you can do if you have problems with this statistic include:

Redistribute the data on the disk with the large average disk queue to other disks.

Upgrade to faster disk(s).

I

NTERRUPTS

/S

EC

Interrupts/Sec is the average rate, in incidents per second, at which the processor received and serviced hardware interrupts. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards, and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended. The system clock typically interrupts the processor every 10 milliseconds, creating a background of interrupt activity. This statistic shows the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab > CPU Utilization

A high value indicates possible excessive hardware interrupts; justification is dependent on device activity.

12 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

N

ETWORK

O

UTPUT

Q

UEUE

L

ENGTH

/N

ETWORK

Q

UEUE

L

ENGTH

The Network Output Queue Length statistic is the number of threads in the processor queue.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

P

AGE

F

AULTS

/S

EC

The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Tab

Metrics This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction If the number of page faults remains consistently high, you can check with your Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

P

ROCESSOR

Q

UEUE

L

ENGTH

The Processor Queue Length statistic is the number of threads in the processor queue.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

CPU Tab

Metrics Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

P

ROCESSOR

S

PEED

The Processor Speed statistic displays the speed of the active processor in MHz. The speed is approximate.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1289

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

P

ROCESSOR

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

The Processor Statistic displays the type of processor currently in use, for example, GenuineIntel.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Bottleneck Analysis Pane

M

EMORY

A

NALYSIS

P

ANE

The following metrics are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Available Paged Memory

(Windows)

Available Physical Memory

Available Swap Memory

(AIX, HP-

UX, Linux, Solaris, Unix)

Total Paged Memory/Total Swap

Memory

Total Physical Memory

TIP:

To open the Memory tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VAILABLE

P

AGED

M

EMORY

The Available Paged Memory statistic shows the amount of virtual memory available for the processes.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Analysis Pane

If the available virtual memory is less than 10% of the total virtual memory, your system may run out of memory.

Correction Increase the size of page file.

A

VAILABLE

P

HYSICAL

M

EMORY

The Available Physical Memory statistic represents the amount of RAM available to all processes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Analysis Pane

This counter displays the last observed value only and not an average. Use this value with the Total physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

Correction Some things you can do if you have problems with this statistic include:

Check the running processes to see if there are any memory leaks.

Stop any services that are not required.

Install additional RAM.

12 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

A

VAILABLE

S

WAP

M

EMORY

The Available Swap Memory statistic represents the amount of virtual memory available for the processes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Analysis Pane

If the available Available Swap Memory is less than 10% of total Swap Memory, your system may run out of memory.

Correction Increase the size of swap files.

T

OTAL

P

AGED

M

EMORY

/T

OTAL

S

WAP

M

EMORY

The Total Paged Memory statistic shows the maximum amount of virtual memory available to all processes.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Analysis Pane

It is recommended that this be 1½ - 3 times the amount of RAM on the system.

T

OTAL

P

HYSICAL

M

EMORY

The Total Physical Memory statistic shows the amount of physical memory installed on your computer.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Memory Analysis Pane

This is an informational metric and displays the total amount installed on the machine. Use this value with the available physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

D

ISK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Free Disk Space

Total Disk Space Used Disk Space

TIP:

To open the Space tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

F

REE

D

ISK

S

PACE

The Free Disk Space statistic shows the unallocated space, in megabytes on all logical disk drives.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1291

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Correction There are many things you can do to ensure that a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

T

OTAL

D

ISK

S

PACE

Total Disk Space displays the total allocated and unallocated space, in megabytes on all logical disk drives.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

U

SED

D

ISK

S

PACE

The Used Disk Space statistic shows the amount of allocated space, in megabytes on all logical disk drives.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

W

ORKLOAD

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Number of Logins

Top I/O Process

Number of Processes

Location

Top CPU Process

TIP:

To open the Processes tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

12 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

N

UMBER OF

L

OGINS

This statistic displays the total number of logins on the server.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

N

UMBER OF

P

ROCESSES

This statistic displays the total number of processes on the server.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

T

OP

M

EMORY

P

ROCESS

Top Memory Process shows the current process that is consuming the most amount of memory.

The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

If you are running out of memory on the system, this is a quick way to identify the top memory user. If the displayed process is using a significant portion of the total memory, it could be causing the memory issues.

T

OP

CPU P

ROCESS

Top CPU Process shows the current process that is consuming the most amount of CPU. The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

If the amount of CPU time used by this process is close to 100% and the CPU usage is very high, this process may be the bottleneck on the server.

Correction Investigate the process further to see if it is in an inconsistent state. Also, look at minimum requirements for CPU speed for the process. You may need to upgrade your CPU.

T

OP

I/O P

ROCESS

The Top I/O Process statistic shows the current process that is consuming the most amount of

CPU. The information displayed is dependent on the platform of the operating system.

Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major

Page Faults, and the amount of I/O expressed in KB/sec.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Home >

Disk Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1293

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

CPU T

AB

The CPU tab of the OS Detail includes the following sections:

CPU Events

CPU Utilization

Load Averages

The following statistics, available on this tab, duplicate statistics available on the Bottleneck

Analysis Pane

of the

OS

Home page:

Interrupts/Sec

Processor Queue Length

NOTE:

The sections available on this tab depend on the platform of operating system.

CPU U

TILIZATION

The CPU Utilization section includes the following information:

% Privileged Time % User Time

% P

RIVILEGED

T

IME

This metric is the percentage of elapsed time that the process threads spent executing code in privileged mode.

NOTE:

For Windows systems, when a Windows system service is called, the service will often run in privileged mode to gain access to system-private data. Such data is protected from access by threads executing in user mode. Calls to the system can be explicit or implicit, such as page faults or interrupts. These kernel commands, are considered privileged to keep the low-level commands executing and prevent a system freeze.

Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. Some work done by Windows on behalf of the application might appear in other subsystem processes in addition to the privileged time in the process.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab

The ideal range should be 0-40% (less than 40% indicates excessive system activity).

Correction If your CPU consistently runs at less than 40% you may need to upgrade your system to include a faster processor(s).

% U

SER

T

IME

The % User Time statistic is the percentage of elapsed time the processor spends in the user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory. The operating system switches application threads to privileged mode to access operating system services. This counter displays the average busy time as a percentage of the sample time.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab

12 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Metrics If the Privileged Time is high in conjunction with Physical Disk Reads, consider upgrading the disk I/O subsystem.

CPU E

VENTS

The CPU Events section includes the following information:

Context Switches/Sec Load Averages System Calls/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

Context Switches/Sec

The Context Switches/Sec section shows the combined rate at which all processors on the computer are switched from one thread to another. Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab

The ideal range should be between 0-10,000. GA number greater then 10,000 may indicate too many threads contending for resources.

System Calls/Sec

System calls are functions which require the services of the operating system. Usually they involve access to some data that users must not be permitted to corrupt or even change.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab

Correction Try to find a good ratio between the amount of time the operating system runs (fulfilling system calls and doing process scheduling), and the amount of time the application runs. Your goal should be running 60% to 75% of the time in application mode, and 25% to 40% of the time in operating system mode. If you find that the system is spending 50% of its time in each mode, then you should investigate to determine what is wrong.

Load Averages

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> CPU Tab

High load averages usually mean that the system is being used heavily and the response time is correspondingly slow.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1295

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

P

ROCESSES

T

AB

The Processes tab of the OS Detail page succinctly communicates the general overall performance levels of processes. The columns available in this table depend on the platform of operating system. The table below describes the information available in the table on this tab:

Column

Process

User

ID

CPU

User Mode

Memory WINDOWS

ONLY

Memory (MB)

Memory

Active Memory

I/O Data

Description

The name of the process.

The user of the process.

The ID Process is the unique identifier of this process. ID Process numbers are reused, so they only identify a process for the lifetime of that process.

The CPU is the percentage of elapsed time that all of process threads used the processor to execution instructions.

The User Mode is the percentage of elapsed time that the process threads spent executing code in user mode.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the percentage of the memory used of the total memory.

Active Memory is the amount of committed virtual memory, in bytes for this process. Active memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive. This counter displays the last observed value only; it is not an average.

The rate at which the process is reading and writing bytes in I/O operations. This counter counts all I/O activity generated by the process to include file, network and device I/Os.

Elapsed Time

Thread Count

Handle Count

Priority

The total elapsed time, in seconds, that this process has been running.

The number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread.

The total number of handles currently open by this process. This number is equal to the sum of the handles currently open by each thread in this process.

The current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process' base priority.

Creating Proc ID

Page Faults/Sec

Page File

The Creating Process ID value is the Process ID of the process that created the process. The creating process may have terminated, so this value may no longer identify a running process.

Page Faults/Sec is the rate at which page faults by the threads executing in this process are occurring. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This may not cause the page to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with whom the page is shared.

Page File is the current number of kilobytes that this process has used in the paging file(s).

Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and the lack of space in paging files can prevent other processes from allocating memory.

12 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Column

Private

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Description

Private is the current size, in kilobytes, of memory that this process has allocated that cannot be shared with other processes.

I/O T

AB

The I/O tab includes the following sections:

LocBytes per I/O Operation

Average Disk Queue/Total Disk

Queue

Disk Transfers/Sec

I/O Details

Disk I/O Time

Transfer Rate

NOTE:

The sections available on this tab depend on the platform of operating system.

I/O D

ETAILS

The table below describes the information available in this section:

Column

Disk

Reading (KB/s)

Writing (KB/s)

Disk Read Time

Disk Write Time

Disk Time

Avg. Read Queue

Avg. Write Queue

Disk Reads/Sec

Disk Writes/Sec

Description

The disk number assignment.

The amount of bytes read from the device.

The amount of bytes written to the device.

Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.

Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Disk Time is the percentage of elapsed time that the selected disk was busy servicing requests.

Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.

Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.

Disk Reads/Sec is the rate of read operations on the disk.

Disk Writes/Sec is the rate of write operations on the disk.

NOTE:

The columns available in this table depend on the platform of operating system.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1297

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

T

RANSFER

R

ATE

The Transfer Rate section succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Writing

Transferred

Description

The average number of bytes transferred from the disk during read operations.

The average number of bytes transferred to the disk during write operations.

The amount of time required to transfer the data between the device's cache and the actual device media.

Metrics

It is measured in number of KBs per second.

It is measured in number of KBs per second.

N/A

NOTE:

The statistics available in this section depend on the platform of operating system.

LocBytes per I/O Operation

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

The Bytes per I/O Operation section of the OS Detail succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Writing

Description

The average number of bytes transferred from the disk during read operations.

The average number of bytes transferred to the disk during write operations.

Metrics

It is measured in number of bytes per second.

It is measured in number of bytes per second.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

12 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

A

VERAGE

D

ISK

Q

UEUE

/T

OTAL

D

ISK

Q

UEUE

The Average Disk Queue section of the OS Detail page succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Average Read

Queue

Average Write

Queue

Average Queue

Description

Average Read Queue Length is the average number of read requests that were queued for a particular disk.

Information

Sustained loads on any of the disk queue lengths could represent problems within your system.

Average Write Queue is the average number of write requests that were queued for a particular disk.

Average time in ms. to service I/O requests which for disks includes seek, rotational latency and data transfer time).

Sustained loads on any of the disk queue lengths could represent problems within your system.

Contact your Windows System Administrator for assistance in Correction these problems.

Sustained loads on any of the disk queue lengths could represent problems within your system.

Contact your Unix System Administrator for assistance in Correction these problems.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

Correction Contact your Windows System Administrator for assistance in Correction these problems.

D

ISK

I/O T

IME

The Disk I/O Time section of the OS Detail page succinctly communicates the general overall performance levels of the disk’s I/O. The table below describes the statistics in this section:

NOTE:

The statistics available in this section depend on the platform of operating system.

Statistic

% Disk Read Time

% Disk Write Time

% Disk Time

Description

% Disk Read Time is the percentage of time during the sample interval that the disk is busy servicing read requests.

% Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Metrics

Use this in conjunction with the % Disk Write Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Use this in conjunction with the % Disk Read Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

% Disk Time is the percentage of time during the sample interval that the disk is busy servicing requests.

Use this statistic to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1299

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

D

ISK

T

RANSFERS

/S

EC

The Disk Transfers/Sec section of the OS Detail page succinctly communicates the general overall performance levels of the disk transfers. The table below describes the statistics in this section

Statistic

Reads/Sec

Writes/Sec

Transfers/Sec

Description

The the rate of read operations on the disk.

The rate of write operations on the disk.

The rate of transfer operations per second.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> I/O Tab

M

EMORY

T

AB

The Memory tab of the OS Detail page includes the following sections:

Buffer Size

Memory Available

Cache Size

Paging Activity

Cache Efficiency

Page Replacements

The following statistic, available on this pane, duplicates a statistic appearing on the Bottleneck

Analysis Pane

pf the

OS

Home page:

• Page Faults/Sec

NOTE:

The sections available on this tab depend on the platform of operating system.

P

AGING

A

CTIVITY

The Paging Activity section includes the following statistics:

Blocks Input/Sec

Paged Out

Blocks Output/Sec

Pages Input/Sec

Paged In

Pages Output/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Blocks Input/Sec

The Blocks Input/sec statistic is the number of blocks sent to a block device per second.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

13 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck:

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

Blocks Output/Sec

The Blocks Output/sec statistic is the number of blocks received from a block device per second).

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of

your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

Paged In

The number of disk block paged into core from disk which occurs when the server is experiencing a shortage of RAM. Any nonzero value indicates excessive swap activity. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk.

This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Correction High values indicate the possible need to increase the amount of RAM on the system.

Paged Out

The number of disk block paged out of core from disk. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk. This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1301

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Pages Input/Sec

The Pages Input/Sec statistic is the number of pages read from disk to resolve hard page faults.

Hard page faults occur when a process requires code or data that is not in its working set or elsewhere in physical memory, and must be retrieved from disk.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

This value was designed as a primary indicator of the kinds of faults that cause system-wide delays. It includes pages retrieved to satisfy faults in the file system cache (usually requested by applications) and in non-cached mapped memory files. This counter counts numbers of pages, and can be compared to other counts of pages, such as Memory: Page Faults/sec, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

Pages Output/Sec

The Pages Output/Sec statistic is the number of pages written to disk to free up space in physical memory. Pages are written back to disk only if they are changed in physical memory. A high rate of pages output might indicate a memory shortage.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Windows NT writes more pages back to disk to free up space when low in physical memory. This counter counts numbers of pages, and can be compared to other counts of pages, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

M

EMORY

A

VAILABLE

The Memory Available section of the OS Detail page succinctly communicates the general overall performance levels of the server's memory. The statistics available in this section depend on the platform of operating system. The table below describes these statistics:

Statistic

Physical

Memory

Description

The Physical Memory statistic is the amount of committed virtual memory, in megabytes.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk.

Metrics

This counter displays the last observed value only and not an average.

Correction

N/A

13 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Statistic

Physical

Description

The Physical statistic is the total physical memory available.

Paged Memory The Paged Memory statistic is the amount of committed virtual memory, in bytes. Used Memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive.

Swap Memory The Swap Memory statistic is the free, unreserved swap space.

Metrics

N/A

This counter displays the last observed value only; it is not an average.

N/A

Correction

N/A

N/A

Swap N/A

Increase the size of your swap file or add additional files if you consistently see a shortage of free, unreserved swap space.

N/A

Total Physical

Total Swap

Swap-ins

The Swap statistic is the total swap memory being used.

The Total Physical statistic is the total physical memory available.

The Total Swap statistic is the total swap memory available.

The number of memory pages paged in from swapspace.

N/A

N/A

N/A

N/A

N/A

Swap-outs

Buffers

The number of memory pages paged in from swapspace.

The Buffers statistic represents the amount of buffers used by the kernel in kilobytes.

N/A

N/A

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes. Increase the size of your swap file or add additional files.

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes. Increase the size of your swap file or add additional files.

N/A

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1303

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

Statistic Description

Page Faults/Sec The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second.

A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Metrics

This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction

If the number of page faults remains consistently high, you can check with your Windows

System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults.

However, hard faults, that require disk access, can cause delays.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

B

UFFER

S

IZE

The Buffer Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

C

ACHE

S

IZE

The Cache Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

P

AGE

R

EPLACEMENTS

The following statistics are available in this section:

Memory Freed (Pages/sec)

Location

Memory Freed (Pages/sec)

Freed or destroyed (Kb/s).

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

13 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Clock Algorithm Scans (Pages/sec)

The VMM uses a technique known as the clock algorithm to select pages to be replaced. This technique takes advantage of a referenced bit for each page as an indication of what pages have been recently used (referenced). When the page-stealer routine is called, it cycles through the PFT, examining each page's referenced bit.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

C

ACHE

E

FFICIENCY

The Cache Efficiency section of the Memory tab succinctly communicates the general overall performance levels of the server's memory. The following statistics are available in this section:

Copy Read Hits %

Pin Read Hits %

Data Map Hits %

MDL Read Hits %

Copy Read Hits %

The Copy Read Hits % statistic is the percentage of cache copy read requests that hit the cache and does not require a disk read to provide access to the page in the cache.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

When the page is pinned in the memory, the page's physical address in the file system cache will not be altered. A copy read is a file read operation where a page in the cache is copied to the application's buffer. Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate

Data Map Hits %

The Data Map Hits % statistic is the percentage of data maps in the file system cache that could be resolved without having to retrieve a page from the disk.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1305

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

MDL Read Hits %

The MDL Read Hits % statistic is the percentage of Memory Descriptor List Read requests to the file system cache that hit the cache and does not require disk access to provide memory access to the pages in the cache.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

Pin Read Hits %

The Pin Read Hits % statistic is the percentage of pin read requests that hit the file system cache and does not require a disk read in order to provide access to the page in the file system cache.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

S

PACE

T

AB

The Space tab of the OS Detail page includes the following sections:

Disk Space Free

Device Detail

Disk Space Detail

Device Summary

D

ISK

S

PACE

F

REE

The Disk Space Free metric displays the amount of free disk space in megabytes.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

D

ISK

S

PACE

D

ETAIL

The Disk Space Detail section of the Space tab succinctly communicates the general overall performance levels of the server’s disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Description

The drive letter of the disk.

The name of the file system.

13 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Statistic

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Location

Description

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

D

EVICE

S

UMMARY

The Device Summary section of the Space tab displays a bar chart for all devices. The Device

Summary section succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Used

Free

Description

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/device.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

D

EVICE

D

ETAIL

The Device Detail section of the Space tab succinctly communicates the general overall performance levels of the server's disks and space allotment. The statistics available in this section depend on the platform of operating system. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Memory Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1307

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

N

ETWORK

T

AB

The Network tab of the OS Detail page succinctly communicates the general overall performance levels of the server's networking. The Network tab of the OS Detail page includes the following sections:

Network Details

LPacket Errors

Transmission Queue Length

Packet Collisions

Transmission Rate

Packet Discards

Transmission Rate (Bytes)

NOTE:

The sections available on this tab depend on the platform of operating system.

N

ETWORK

D

ETAILS

The statistics available in this section depend on the platform of operating system. The table below describes the information available in this section:

Column

Network Interface

INET Address/

Address

Pkts Sent/Sec

Pkts Received/Sec

Sent (KB/Sec)

Received (KB/Sec)

Out Pkts Discarded

In Pkts Discarded

Out Pkt Errors

In Pkt Errors

Queue Length

Collisions

Packets Discarded

Description

The name of network interface.

The IP address assigned to the network interface.

The number of packets sent per second.

The number of packets received per second.

The number of bytes sent per second.

The number of bytes received per second.

The number of outbound packets discarded.

The number of inbound packets discarded.

The number of outbound packet errors.

The number of inbound packet errors.

The queue length.

The number of collisions.

The number of packets discarded.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

T

RANSMISSION

R

ATE

The Transmission Rate section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

• Location

• Packets Sent/Sec

13 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

Packets Sent/Sec

The Packets Sent/Sec statistic is the number of packets sent over each network adapter per second.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Packets Received/Sec

The Packets Received/Sec statistic is the number of packets received over each network adapter per second.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

T

RANSMISSION

R

ATE

(B

YTES

)

The Transmission Rate (Bytes) section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Received (KB/Sec) Sent (KB/Sec)

Sent (KB/Sec)

The Sent (KB/Sec) statistic is the rate at which bytes are sent over each network adapter including framing characters.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Received (KB/Sec)

The Received (KB/Sec) statistic is the rate at which bytes are received over each network adapter, including framing characters.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

T

RANSMISSION

Q

UEUE

L

ENGTH

The number of pending outgoing packets on either the software transmit queue or the hardware transmit queue

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1309

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

P

ACKET

C

OLLISIONS

A collision occurs when two devices on the network sense that the network is idle and end up trying to send data at the same time. Some collisions are normal on a repeated network, but excess collisions can cause serious performance problems.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Correction

Contact your network administrator if there is high rate of persistent Packet Collisions.

P

ACKET

D

ISCARDS

The Packet Discards section of the Network tab succinctly communicates the packet discard rate. The following statistics are available in this section:

Inbound Packets Discarded Outbound Packets Discarded Packet Discards

Outbound Packets Discarded

The Outbound Packets Discarded statistic is the number of outbound packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

Inbound Packets Discarded

Received Packets Discarded is the number of received packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

Packet Discards

The Packet Discards statistic represents the number of network packets discarded.

13 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

LP

ACKET

E

RRORS ocation

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Correction Contact your network administrator if there is high rate of persistent packet discards.

The Packet Errors section of the Network tab succinctly communicates the packet error rate. The following statistics are available in this section:

Inbound Packet Errors Outbound Packet Errors

Outbound Packet Errors

The Outbound Packet Errors statistic is the outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

Inbound Packet Errors

The Packets Received Errors statistic is the received packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Microsoft SQL Server Performance Analyst Statistics >

OS

> Network Tab

T

OP

SQL

One or two bad queries can cause a lot of trouble for the remaining sessions in a database, and so can one or two bad queries. It is important to find them before they get into a production system, but sometimes a few sneak through.

By applying custom filters and performance-related thresholds, the Top SQL view locates inefficient SQL. By applying filters to certain I/O and statistical counters, you hope to isolate queries that far exceed their nearest competitors in the same area (like disk reads). When you find them, you should reduce the number of sorts a query performs. Or, for a query that returns only a few records, you should try to minimize the number of rows a query processes.

Top SQL displays requested SQL for SQL Server datasources. The following tabs are available on the Top SQL page:

Summary Tab

Criteria Tab

SQL Details Tab

S

UMMARY

T

AB

The Summary tab of the Top SQL page includes the following sections:

Top SQL Statements - SQL Server

Top SQL Details

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1311

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

T

OP

SQL S

TATEMENTS

- SQL S

ERVER

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every Oracle professional’s satisfaction. The table below describes some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:

Criteria

Overall Response

(Elapsed) Time

CPU Time

Physical I/O

Logical I/O

Repetition

Description

This is how much time the query took to parse, execute, and fetch the data needed to satisfy the query. It should not include the network time needed to make the round trip from the requesting client workstation to the database server.

This is how much CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

Often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request. While you certainly want to control disk I/O where possible, it is important that you not focus solely on physical I/O as the single benchmark of inefficient SQL. Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well.

This is a measure of how many memory reads the query took to satisfy the user’s request.

The goal of tuning I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

This is a measure of how often the query has been executed. A problem in this area is not as easy to spot as the others unless you know your application well. A query that takes a fraction of a second to execute may still be causing a headache on your system if it is executed erroneously over and over.

There are other criteria that you can examine like sort activity or access plan statistics (that show items like Cartesian joins and the like), but more often than not, these measures are reflected in the criteria listed above.

Fortunately, Microsoft records some of these statistics and Performance Analyst computes the rest, which makes tracking the SQL that has been submitted against a SQL Server much easier.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Top SQL > Summary Tab

When you begin to look for inefficient SQL in a database, there are two primary questions you need to answer:

What has been the worst SQL that’s historically been run in my database?

What is the worst SQL that’s running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient Transact SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

13 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

MI C RO SOF T S QL S ER VE R P E RFO R M AN C E A N A L YS T S TA T IS T IC S > M IC RO S O F T S Q L S E R VE R

T

OP

SQL D

ETAILS

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The Top SQL Details Section displays the top SQL statements across various performance categories. The table below describes the information available in this section:

Information

Top For

Usage

SQL text

Total Reads

Total Writes

Executions

Avg CPU Time

Avg Elapsed Time

Description

Indicates the performance category for the SQL statement.

This displays the percent usage for this SQL statement in this performance category.

A snippet of the actual SQL statement or code object (procedure, etc.)

The total physical reads caused by the statement since monitoring began.

The total physical writes caused by the statement since monitoring began.

The total number of times the statement or code object has been executed since monitoring began.

The average CPU time used by the statement each time it is executed.

The average elapsed response time experienced each time the statement is executed.

Location

Metrics

Microsoft SQL Server Performance Analyst Statistics >

Top SQL > Summary Tab

When you begin to look for inefficient SQL in a database, there are two primary questions you need to answer:

What has been the worst SQL that’s historically been run in my database?

What is the worst SQL that’s running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient Transact SQL loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

C

RITERIA

T

AB

The Top SQL view displays all SQL running or executed in the current datasource. You can use the lists and boxes to reorder the display according to your specific needs. The Criteria tab of the Top SQL page includes the following sections that you can mix and match to give you the information you want to find.

• Demographic Criteria

• Statistical Criteria

• Sort Criteria

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1313

MICRO SO FT S QL SER V ER PE RF OR MANCE ANALYST S T ATI STI CS > MIC RO SO FT SQL SE RVER

SQL D

ETAILS

T

AB

The SQL Details tab of the Top SQL page includes the following sections:

Top SQL Results

Location

T

OP

SQL R

ESULTS

Overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements or stored procedures can drag an otherwise well-configured database down in terms of end user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when hunting for problem SQL in critical systems?

Understand that even the seasoned experts disagree on what constitutes efficient and inefficient

SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The Top SQL results grid displays the top SQL statements across various performance categories. The table below describes the information available in this section:

Information

SQL Text

Database

Avg Reads

Total Reads

Avg Writes

Description

A snippet of the full SQL statement. Clicking the statement will cause the full statement to be presented in the Selected SQL Text grid.

The database where the statement or code object’s execution originated.

The average physical reads caused by the statement each time it is executed.

The total physical reads caused by the statement since monitoring began.

The average physical writes caused by the statement each time it is executed.

Total Writes

Executions

The total physical writes caused by the statement since monitoring began.

The total number of times the statement or code object has been executed since monitoring began.

The average elapsed response time experienced each time the statement is executed.

Avg Elapsed

Time

Elapsed Time The total elapsed response time over all executions.

Avg CPU Time The average CPU time used by the statement each time it is executed.

Total CPU Time The total CPU time over all executions.

First Start Time The date/time when the statement was first executed.

Location

Microsoft SQL Server Performance Analyst Statistics >

Top SQL >

SQL Details Tab

S

ELECTED

SQLT

EXT

The Selected SQL Text window allows you to select any of the Top SQL result rows and get the complete SQL text. From here you can open an Explain Plan or Tune the SQL.

Location

Microsoft SQL Server Performance Analyst Statistics >

Top SQL > Summary Tab

13 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E RF OR MA NC E AN ALY ST FO R S Y BA SE TU TO RI AL > P E R F O R M AN C E A N A L Y S T F O R S Y B A S E TU TO RIA L

P

ERFORMANCE

A

NALYST FOR

S

YBASE

T

UTORIAL

Embarcadero Performance Analyst provides key insight into the complex world of database performance. Running inside the Embarcadero DBArtisan console, or standalone in a Web browser, Performance Analyst helps you pinpoint performance problems that threaten a database’s availability or response times. The powerful analysis facilities will satisfy advanced experts, yet novices will find Performance Analyst’s interface easy to use and the expert help a welcome aid to troubleshooting difficult performance issues.

About This Performance Analyst for Sybase Tutorial

This tutorial is intended to help you get started with Embarcadero Performance Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Performance Analyst. You will have learned how to accurately monitor your database using the most popular performance methodologies in use today. You will know how to drill down into the many layers of database performance and also be able to locate performance issues in your database in a fast and effective manner. Finally, you’ll understand how to fix performance problems using the integration that exists between Performance Analyst and Embarcadero DBArtisan.

This tutorial is divided into 7 sections.

Session 1: Getting Started With Performance Analyst for Sybase

Session 2: Using Ratio-based Performance Analysis in Performance Analyst for Sybase

Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for Sybase

Session 4: Using Workload Performance Analysis in Performance Analyst for Sybase

Session 5: Using Operating System Performance Analysis in Performance Analyst for Sybase

Session 6: Identifying and Getting Help With Performance Problems Using Performance Analyst for Sybase

Session 7: Fixing Identified Problems

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief guide.

For more information, see Additional Evaluation Resources .

S

ESSION

1: G

ETTING

S

TARTED

W

ITH

P

ERFORMANCE

A

NALYST FOR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1315

P E R F O R M A N C E AN A L Y S T F O R S YB AS E TU T O RI A L > P E R FO R MA N C E A N A L YS T F OR SY B A SE TU TO RIA L

S

YBASE

Download and Install

You can obtain the latest version of Performance Analyst by downloading the DBArtisan software from the Embarcadero Web site at http://www.embarcadero.com/downloads/ downloaddbartisan.asp

. Performance Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Performance Analyst (although Performance Analyst can also run in standalone fashion within a Microsoft Internet Explorer Web browser).

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Overview of Performance Analyst for Sybase

O

VERVIEW OF

P

ERFORMANCE

A

NALYST FOR

S

YBASE

When DBArtisan is connected to a Sybase database, you can open Performance Analyst two ways:

1 On the Analyst toolbar click the Performance Analyst icon.

OR

2 On Utilities menu, select Performance Analyst.

For Performance Analyst to work, several procedures need to be installed by the SA account.

When Performance Analyst is first invoked, it will check for the presence of this package and if it has not been installed, the product will prompt you to install it. Once created, any account with access to these procedures can monitor databases using Performance Analyst. No other objects need to be installed on a monitored database.

Proceed to

Performance Analyst for Sybase Product Navigation

P

ERFORMANCE

A

NALYST FOR

S

YBASE

P

RODUCT

N

AVIGATION

Navigating through Performance Analyst is easily accomplished through two main mechanisms:

1 The main Performance Analyst toolbar contains buttons that invoke the major performance analysis views within the product as well as frequently used actions like Refresh and

Performance Threshold Customizations.

2 Positioning the mouse pointer on any area within Performance Analyst and clicking the right mouse button will bring up a navigation menu that allows you to easily move between any of the main Performance Analyst home pages and drill down views. The right mouse menu also contains context sensitive options like drilling down further into a particular statistic, copying the display to a text file, and more.

13 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E RF OR MA NC E AN ALY ST FO R S Y BA SE TU TO RI AL > P E R F O R M AN C E A N A L Y S T F O R S Y B A S E TU TO RIA L

Proceed to

Session 2: Using Ratio-based Performance Analysis in Performance Analyst for

Sybase

S

ESSION

2: U

SING

R

ATIO

-

BASED

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

S

YBASE

Ratio-based analysis has been around for many years, and used to be the only technique database administrators used when they were called on to diagnose the cause of a database slowdown. Performance ratios are very good roll-up mechanisms for busy DBAs, making possible the analysis-at-a-glance approach, however ratios must be computed correctly for them to be meaningful. Key ratios in Performance Analyst are calculated using delta statistics, which is superior to computing ratios with cumulative values. Delta statistics, which are values derived by using the before and after measures in each statistical refresh done in Performance Analyst, lets you see changes in performance metrics that would otherwise be invisible if cumulative statistics were used. Performance Analyst makes it easy to see the ratios that are computed with delta statistics vs. cumulative. A triangle symbol denotes a delta-based statistic, while square symbols represent a cumulative-based measure.

Ratio-based analysis is available for all performance categories (memory, etc.) where ratios can assist in determining the performance level of a database. For example, if you would like to see memory-specific ratios, on the Performance Analyst toolbar click Memory. Performance Analyst displays the Memory home page that showcases all important memory-related ratios.

Proceed to

Obtaining Detail Information for a Ratio Using Performance Analyst for Sybase

O

BTAINING

D

ETAIL

I

NFORMATION FOR A

R

ATIO

U

SING

P

ERFORMANCE

A

NALYST

FOR

S

YBASE

A ratio gives you a global picture for a particular performance measure. However, you often need more information regarding a statistical measure so you can make an informed decision.

Performance Analyst has easy-to-use drill down features that make obtaining detailed information for various ratios a breeze.

For example, to view more information for the Data Cache Hit Ratio statistic, do the following:

1 On either the Main Home page or the Memory Home page, locate the Data Cache Hit Ratio statistic.

2 Position the pointer over the statistic.

The pointer changes to a hand symbol.

3 Double-click the left mouse button.

Performance Analyst opens the Data Cache Tab of the memory drill down view.

OR

4 Right-click the statistic, select Details.

OR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1317

P E R F O R M A N C E AN A L Y S T F O R S YB AS E TU T O RI A L > P E R FO R MA N C E A N A L YS T F OR SY B A SE TU TO RIA L

5 Select Navigate to, Memory, Data Cache.

Performance Analyst opens the Data Cache Tab of the memory drill-down view.

Proceed to Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for Sybase

S

ESSION

3: U

SING

B

OTTLENECK

/

WAIT

-

BASED

P

ERFORMANCE

A

NALYSIS

IN

P

ERFORMANCE

A

NALYST FOR

S

YBASE

When a Sybase database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things, or it can be an indicator that a database bottleneck exists. Bottleneck analysis is a valid method of measuring performance because it helps you track where a database and user sessions have been spending their time. If latch contention or heavy table-scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause.

Performance Analyst uses three broad areas of metrics to form its bottleneck analysis. The first are contentions and conflicts as reported in Sybase's monitoring sp_sysmon procedure, as well as overall lock statistics. The second is the Sybase wait event interface (available only in Sybase

12.5.03 and higher), which displays where the database and user sessions have been bottlenecked. A third area of bottleneck information has to do with space related bottlenecks like databases and transaction logs that are running low on available free space.

Performance Analyst prominently displays bottleneck analysis on every performance home page. The Main home page, displays a summary of all key bottlenecks threatening the database.

You can also see specific bottlenecks for memory, I/O, space, objects, and users by navigating to each home page and viewing the Bottleneck Analysis section for that home page. For example, to see bottlenecks that specifically relate to I/O, do the following

1 On the toolbar, click the I/O button.

2 Locate the Bottleneck Analysis section at the lower-left portion of the screen.

The I/O bottleneck analysis section shows the I/O related headaches, along with the most active devices.

Proceed to

Obtaining Detail on System Bottlenecks Using Performance Analyst for Sybase

O

BTAINING

D

ETAIL ON

S

YSTEM

B

OTTLENECKS

U

SING

P

ERFORMANCE

A

NALYST FOR

S

YBASE

You can easily obtain more information regarding global bottlenecks that are plaguing a database by drilling down into a particular bottleneck metric. For example, if you would like to see more data regarding the current top system bottlenecks, do the following:

1 Right-click anywhere in Performance Analyst, point to Users, and then click System Waits.

Performance Analyst opens the System Waits view.

13 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E RF OR MA NC E AN ALY ST FO R S Y BA SE TU TO RI AL > P E R F O R M AN C E A N A L Y S T F O R S Y B A S E TU TO RIA L

The System Waits view (available in Sybase 12.5.03 and higher with the MDA monitoring views installed) displays critical details regarding all the wait events that Sybase has recorded. You can easily see what events that occurred the most often as well as the events that have accumulated the most wait time.

TIP:

If you would like to see an expanded view of the System waits grid shown on the top of the System Waits view, click the Expand button located at the top right corner of the section. All section views in Performance Analyst can be maximized/minimized using this control.

Proceed to

Viewing Detail for Session Bottlenecks Using Performance Analyst for Sybase

V

IEWING

D

ETAIL FOR

S

ESSION

B

OTTLENECKS

U

SING

P

ERFORMANCE

A

NALYST FOR

S

YBASE

Not only can you obtain detail information for system bottlenecks, but you can also use

Performance Analyst to get drill down information regarding session-level bottlenecks. There are several layers to session-level details you can view.

To see more information regarding session-level waits, do the following:

1 Right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Performance Analyst opens the Session Waits drill-down view.

When you are in the Session Waits drill down view, to drill further into a session’s details, do the following:

1 In the Historical Waits or Current Waits grid, select a session that appears to be experiencing critical waits.

2 Double-click the session or right-click, and then select Details.

Performance Analyst opens a drill-down view that shows key statistics for the selected session, including its current work activities, wait events, and SQL statements.

Proceed to

Session 4: Using Workload Performance Analysis in Performance Analyst for Sybase

S

ESSION

4: U

SING

W

ORKLOAD

P

ERFORMANCE

A

NALYSIS IN

P

ERFORMANCE

A

NALYST FOR

S

YBASE

Key ratios give you a global perspective on database activity. Bottleneck analysis gives you insight into things that are holding up user activity and throughput. But another technique is necessary if a database professional is to really get a handle on what’s occurring inside a badly performing database.

Workload analysis involves the investigation of two critical areas of a database’s performance:

• Session resource consumption and activity

• SQL execution (if available)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1319

P E R F O R M A N C E AN A L Y S T F O R S YB AS E TU T O RI A L > P E R FO R MA N C E A N A L YS T F OR SY B A SE TU TO RIA L

Without looking at these two key performance categories, you can miss a lot of what could be responsible for perceived performance problems. When performance on a database takes a sudden nosedive, it is not uncommon to find one or two sessions that are causing the bulk of the workload. Finding these processes can be easily accomplished by viewing session metadata coupled with resource consumption and statistical execution statistics.

Proceed to

Pinpointing Top Resource Consumers

P

INPOINTING

T

OP

R

ESOURCE

C

ONSUMERS

Performance Analyst identifies top resource consumers in a couple of different ways. On the main home page, Performance Analyst highlights the top resource sessions across I/O, memory usage, and CPU consumption. The percentage used across all statistical categories are displayed so a DBA can immediately pinpoint a session that is using all or most of a particular resource. The top resource sessions are also displayed on the memory, I/O, and other home pages as well with a listing for the top sessions for that category (for example, the top memory users appear on the memory home page, etc.)

Proceed to

Getting Workload Details

G

ETTING

W

ORKLOAD

D

ETAILS

Performance Analyst offers several details on top resource sessions in addition to the summaries provided on each home page. A detailed and flexible top sessions view lets you view a summary of all the major resource sessions on the database as well as every critical detail regarding each session connected to the database.

Further drill downs are available that highlight specific details regarding each session’s activities and submitted SQL. To see detailed information regarding a session identified in one of

Performance Analyst’s Workload Analysis sections, do the following:

1 In a Workload Analysis display, position the pointer over one of the processes.

2 Double-click the process or right-click, and then select Details.

If you want like to see all key workload analysis metadata for sessions, do the following:

1 On the toolbar, click the Top Sessions button.

OR

2 Right-click anywhere in Performance Analyst, point to Users, and then click Session Waits.

Proceed to

Session 5: Using Operating System Performance Analysis in Performance Analyst for

Sybase

S

ESSION

5: U

SING

O

PERATING

S

YSTEM

P

ERFORMANCE

A

NALYSIS IN

13 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E RF OR MA NC E AN ALY ST FO R S Y BA SE TU TO RI AL > P E R F O R M AN C E A N A L Y S T F O R S Y B A S E TU TO RIA L

P

ERFORMANCE

A

NALYST FOR

S

YBASE

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O or Memory), a slow CPU, insufficient I/O devices, and insufficient memory. Performance Analyst allows you to examine the relevant operating system metrics for Windows Platforms (NT /2000/XP/2003) as they relate to

Sybase.

To view the operating system metrics of the machine hosting the Sybase server you are monitoring, do the following:

1 Click the OS Performance Analyst toolbar button.

OR

2 Navigate to the OS Home Page by going to OS, and then Home.

NOTE:

The first time you invoke the OS feature you will be prompted for an operating system login. Please specify the correct operating system, host name, username and password, and protocol.

The Operating System home page has been designed in a similar fashion as the datasource home page. On this page you can see the pertinent operating system metrics displayed in five quadrants broken down into the following categories:

• Resource Usage

• Memory Analysis

• Disk Analysis

• Workload Analysis

• Bottleneck Analysis

Proceed to

Obtaining Details on the Operating System Using Performance Analyst for Sybase

O

BTAINING

D

ETAILS ON THE

O

PERATING

S

YSTEM

U

SING

P

ERFORMANCE

A

NALYST

FOR

S

YBASE

You can easily obtain more information regarding operating system problems that are degrading database performance by drilling down into a particular analysis quadrant. For example if you'd like to see more information regarding the processes running on the host machine, do the following:

1 Navigate to the Performance Analyst Operating System home page.

2 Double-click the Top Memory Process in the Workload Analysis quadrant.

Performance Analyst opens the Processes detail view.

OR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1321

P E R F O R M A N C E AN A L Y S T F O R S YB AS E TU T O RI A L > P E R FO R MA N C E A N A L YS T F OR SY B A SE TU TO RIA L

3 Right-click anywhere in Performance Analyst and select the Navigate to, OS, and then

Processes.

The Processes detail tab shows all the processes on the host machine. From this view you can easily determine which processes are showing high marks in I/O or CPU, for example, by simply double clicking on the column headers and sorting the processes in ascending or descending order.

Proceed to

Session 6: Identifying and Getting Help With Performance Problems Using

Performance Analyst for Sybase

S

ESSION

6: I

DENTIFYING AND

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST FOR

S

YBASE

You do not have to be an advanced expert in performance tuning to spot trouble in a database if you use Performance Analyst. There are a number of mechanisms in the tool that help you quickly locate areas of concern within a database.

Proceed to

Using the Alarm Log in Performance Analyst for Sybase

U

SING THE

A

LARM

L

OG IN

P

ERFORMANCE

A

NALYST FOR

S

YBASE

Performance Analyst has a central and flexible alarm log that lists every performance violation found in all monitored databases. Unlike some products that only show you alarms for a particular database, Performance Analyst lists all alarms for each database you are monitoring in one central log so you can see every problem in one place. To view the Performance Analyst

Alarm log, do the following:

1 On the toolbar, click the Alarms button.

Once in the Alarm log, you can perform a number of actions including:

• Selecting an alarm and viewing the application page that shows details regarding the metric in violation.

• Filtering the types of alarms shown through the Options dialog.

• Clearing all current alarms.

• Copying or saving the Alarm log into a different format.

To select any of these options, do the following:

1 Position the pointer over any area of the Alarm Log.

2 Right-click and in the shortcut menu, select an option.

Proceed to

Recognizing Performance Violations

13 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E RF OR MA NC E AN ALY ST FO R S Y BA SE TU TO RI AL > P E R F O R M AN C E A N A L Y S T F O R S Y B A S E TU TO RIA L

R

ECOGNIZING

P

ERFORMANCE

V

IOLATIONS

Performance Analyst makes it easy to visually pinpoint performance violations in a database. Any statistic that does not conform to your predefined performance standards is colorized in any view that it appears so you can easily see potential troublespots.

The colors used to highlight a particular performance violation depend on the severity of the problem. Performance Analyst uses several layers of performance standards/threshold violations with each layer being represented by a different color. You can control everything regarding threshold violations, including how thresholds are determined, their color representation in

Performance Analyst’s display, and more by using the Threshold Template feature of

Performance Analyst.

How can Performance Analyst inform you of performance violations in your database if you minimize the product to your desktop and are working on other things? Even if Performance

Analyst is not right in front of you, it can still let you know that a problem has been found in your database through the systray alarm icon. When Performance Analyst detects a problem in one of your databases, one of the things the product does is enable an alarm icon in your workstation’s systray area that communicates the presence of alarms in your database. So even if the

Performance Analyst interface is not in sight, the product can let you know that something in your database requires attention.

Proceed to

Creating Threshold Templates

C

REATING

T

HRESHOLD

T

EMPLATES

How does Performance Analyst know what to signal as a problem in a database? It uses predefined performance standards that you define and enforce. All of this is accomplished by using Performance Analyst’s Threshold templates. A template is a set of performance metrics and their thresholds that can be reused to enforce performance standards across any number of databases. Embarcadero provides a default performance template that contains nearly all of the most-watched performance statistics so you can begin monitoring with confidence right out of the box. However, you can create your own Threshold templates so you only are alerted to performance violations that are important to you and your particular environment.

To view or create Threshold templates, do the following:

1 On the toolbar, click the Thresholds button.

Performance Analyst opens the Threshold Template Properties dialog box.

The Threshold Template Properties dialog box lets you select the options to add or edit templates, as well as other maintenance options. For example, you can copy the original

Embarcadero Threshold template and modify it to fit your own needs. You can control what statistics are sampled for performance violations as well as the levels of severity you would like reported. Once you are satisfied with your template, you can save it and then apply it to one or more datasources in one action to immediately begin enforcing your performance standards.

Proceed to

Getting Help With Performance Problems

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1323

P E R F O R M A N C E AN A L Y S T F O R S YB AS E TU T O RI A L > P E R FO R MA N C E A N A L YS T F OR SY B A SE TU TO RIA L

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

As databases become more complex, so do the problems that plague them. Knowing what to do for a particular performance problem can be hard in some cases, but Performance Analyst helps by providing a complete set of expert help that you can use as a guide when performance problems occur. To obtain expert help for any statistic shown in Performance Analyst, do the following:

1 Position the pointer over a statistic that you need help.

2 Right-click and select Help.

The Expert Help gives you a general description of the statistic, the range of values that are considered optimal, and some suggestions on how to fix a problem situation. Expert help can also be invoked for any of the Ratio, Bottleneck, SQL, or Workload Analysis sections shown on every home page by clicking on the help icon for that section, which is located at the top right corner of the section.

Proceed to

Session 7: Fixing Identified Problems

S

ESSION

7: F

IXING

I

DENTIFIED

P

ROBLEMS

Finding performance problems is one thing, but fixing them is another. Many performance monitors point out a particular problem in a database, but then offer no way to actually correct the situation. Such is not the case with Performance Analyst. Because of its tight integration with

DBArtisan, certain problems found in Performance Analyst can be visually corrected by

DBArtisan.

A Space Problem Correction Example

If a Sybase Server tablespace is about to run out of free space, Performance Analyst can issue an alarm that a space shortage exists. Once the space problem has been identified, do the following:

1 On the Space home page toolbar, click the Space button.

2 In the Space Analyst grid, right-click a tablespace, and then select Manage with DBArtisan.

DBArtisan opens an editor where you can perform corrective actions, such as enabling

Autoextend for the tablespace, resizing the tablespace’s existing datafile(s), or adding a new datafile for the tablespace.

13 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

S

YBASE

ASE P

ERFORMANCE

A

NALYST

S

TATISTICS

This section includes expert help for all Sybase ASE categories and statistics in the Embarcadero

Performance Analyst views and pages. This help is divided into the following sections:

Home

Space

OS

Memory

Databases

Top SQL Statistics

I/O

Users

NOTE:

Sybase 12.5.0.3 users should make sure their MDA tables are properly configured so they can see all available statistics. Please refer to the instructions for

Enabling MDA

Tables

.

E

NABLING

MDA T

ABLES

In ASE 12.5.0.3, a new feature called "MDA tables" was introduced. These proxy tables are mapped to RPCs which provide access to low-level monitoring information about the server.

For more information see: http://www.sybase.com/detail?id=1010039 “The MDA tables – New

Monitoring Capabilities in ASE 12.5.0.3”

DBArtisan’s Performance Analyst for Sybase requires these tables be installed to enable several statistics, for example the Top SQL view.

Please follow the instructions below to install and configure these tables.

1 Ensure the ‘enable cis” configuration parameter is set to 1.

sp_configure 'enable cis' go

2 Add the ‘loopback’ server name alias.

if not exists (select 1 from master..sysservers where srvname = "loopback")

BEGIN

exec sp_addserver "loopback", null, <enter your server name>

END

3 Install the MDA tables.

The script can be found in the following location:

$SYBASE/$SYBASE_ASE/scripts/installmontables.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1325

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

4 Assign the ‘mon_role’ to logins allowed MDA access.

NOTE:

The ‘sa’ login requires this grant as well.

use master go grant role mon_role to sa go

5 Enable the following configuration parameters.

exec sp_configure "enable monitoring", 1 exec sp_configure "sql text pipe active", 1 exec sp_configure "sql text pipe max messages", 2000 exec sp_configure "plan text pipe active", 1 exec sp_configure "plan text pipe max messages", 2000 exec sp_configure "statement pipe active", 1 exec sp_configure "statement pipe max messages", 2000 exec sp_configure "errorlog pipe active", 1 exec sp_configure "errorlog pipe max messages", 2000 exec sp_configure "deadlock pipe active", 1 exec sp_configure "deadlock pipe max messages", 2000 exec sp_configure "wait event timing", 1 exec sp_configure "process wait events", 1 exec sp_configure "object lockwait timing", 1 exec sp_configure "SQL batch capture", 1 exec sp_configure "statement statistics active", 1 exec sp_configure "per object statistics active", 1 exec sp_configure "max SQL text monitored", 2000

13 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

H

OME

The Embarcadero Performance Analyst Home view lets you review availability and overall performance of all monitored databases from a single window. Statistics on the Home view are organized into the following categories:

Bottleneck Analysis Pane

Storage Analysis Pane

Key Ratio Analysis Pane

Workload Analysis Pane

I/O Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the master.sysperfinfo performance table. This table maintains a count of various statistics for the server and particular databases since the server was brought up. For servers that are kept up for long periods of time, these values can grow quite large and will impact how a particular ratio that a DBA might be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following ratios are used on the Performance Analyst Home page to succinctly communicate the general overall performance levels of the monitored database:

Data Cache Hit Ratio

Clean Buffer Grab Rate

Server Idle

Procedure Plan Hit Ratio

CPU Busy

Large I/O Hit Rate

I/O Busy

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1327

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

ATA

C

ACHE

H

IT

R

ATIO

Data read from memory produces user response times many times faster than when that same data is read from disk. The Sybase data cache assists with keeping physical I/Os to an absolute minimum.

The data cache hit ratio is an excellent indicator of how often user requests for data are satisfied through memory as opposed to being physically read from disk. The table below describes the three key counters in Sybase used to arrive at this statistic:

Counter

LOGICAL READS

PAGES PER I/O

PHYSICAL READS

Description

Data read from memory for user requests.

The number of pages retrieved in a single I/O operation.

Data read physically from disk.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Data Cache Tab

To help ensure excellent performance, keep your cache hit rate in the neighborhood of 90% or greater. Lower amounts can be okay for user ad hoc databases where sporadic, large table scan operations occur. However, anything below this general threshold for normal databases can require tuning attention, and the adjustment of the Sybase memory tuning parameters.

If you are using named caches, you can drill down into the cache hit rates for each named cache. This helps you understand which objects/operations are depressing the overall cache hit rate for the server.

Correction If a problem is found in Sybase servers, versions 11-12, you can increase the amount of the total memory configuration parameter or reduce the percentage of memory allocated to the procedure cache (by default, the data cache assumes any free memory left over after Sybase has met its kernel and procedure cache needs). Take care when reducing the procedure cache, as this could reduce performance in the server as it relates to reading procedures in from disk.

For Sybase 12.5, the total memory configuration parameter can again be increased to provide more memory for the data cache (and any named caches), but in 12.5, if you want to reduce the size of the procedure cache, note that it is now configured in terms of literal size instead of a percentage of the overall configured memory.

Once the data cache has been adjusted, monitor Sybase to see if the cache hit rate improves. If it does not, another increase may be necessary and examination of unnecessary large table scan operations. Also, keep a careful eye on the actual machine’s memory limits and swap activity.

Increased swap activity can be indicative of too little memory left for the server machine.

13 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

ROCEDURE

P

LAN

H

IT

R

ATIO

The Sybase procedure cache is used to hold the definitions and query plans of stored procedures and triggers. It is used for short-term memory needs like statistics and query plans for parallel queries. When a user executes a stored procedure, Sybase looks in the procedure cache for a query plan to use. If a query plan is available, Sybase places it on the most recently used (MRU) end of the memory chain and the procedure begins to execute. If no execution plan is in memory, or if all copies of the plan are currently being used, the query tree for the procedure is read in again from the data dictionary, optimized, put on the MRU end of the chain, and executed. Note that other operations, like CREATE INDEX, can also use the procedure cache even when no procedure is referenced.

The more often that a procedure’s plan and definition can be referenced in memory, the better the procedure execution time.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Procedure Cache Tab

A high procedure cache hit rate is a desirable thing. You should strive for a hit ratio between 95-100%, with 95% being a good performance benchmark for procedure code reference. Note that when a database is first started, the procedure cache hit rate is not at an optimal level because all code being used is relatively new, and as such, must be read in from disk and placed into the cache. If, however, after a solid hour or two of steady database time, the procedure cache hit rate has not increased to desirable levels, you should look into the possibility of increasing the amount of memory allocated to the cache.

You can drill down into the procedure cache to view the procedures currently in memory along with how much memory they are consuming.

If there is not enough memory to load a requested procedure, or the maximum number of compiled objects is already in use, Sybase returns an error (normally a 701).

Correction If a problem is found in Sybase servers, versions 11-12, you can increase the amount of the total memory configuration parameter or increase the percentage of memory allocated to the procedure cache (by default, the data cache assumes any free memory left over after Sybase has met its kernel and procedure cache needs). You should be careful when increasing the procedure cache alone, as this could increase query response times due to more physical I/O being performed.

For Sybase 12.5, the total memory configuration parameter can again be increased to provide more memory for the Sybase server, but in 12.5, if you want to increase the size of the procedure cache, note that it is now configured in terms of literal size instead of a percentage of the overall configured memory.

Once the procedure cache has been adjusted, monitor Sybase to see if the cache hit rate improves. If it does not, another increase may be necessary. Also, keep a careful eye on the actual machine’s memory limits and swap activity. Increased swap activity can be indicative of too little memory left for the server machine.

L

ARGE

I/O H

IT

R

ATE

Large I/O can be enabled by splitting the default or any named cache into pools. By default,

Sybase performs I/O operations based on a 2-KB page size. For queries where pages are stored and accessed in a sequential manner, it is possible to read many more data pages in a single I/O operation. Large I/O can greatly reduce disk access time when the right situations exist.

Operations that routinely perform large table scans, access image or text data, do bulk copies, scan the leaf level of nonclustered indexes, or initiate DBCC tasks can benefit from large I/O.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1329

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

If large I/O has been configured and is being used, you should observe a high percentage of hits

(the number of times large I/O could be performed vs. the number of times large I/O requests were denied by the server). If large I/O is not configured, no large I/O activity should be present.

Location

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Metrics As you might expect, if large I/O is in use, a high hit rate is desirable. You should strive for a hit ratio between 90-100%, with 90% being a good performance benchmark.

Correction If large I/O is configured, but you see a low hit rate, you should configure more caches for large I/O use.

C

LEAN

B

UFFER

G

RAB

R

ATE

As information is requested from users, buffers are moved into and out of the Sybase data cache. Pages are also modified in the cache (termed dirty buffers) and need to be written out to disk. If Sybase has to wait for a dirty buffer to be written out to disk before a requested buffer is placed into the cache, performance can suffer.

The clean buffer grab rate represents the percentage of time clean buffers were found and referenced in the cache as opposed to Sybase finding dirty buffers.

Location

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Ideally, the clean buffer grab rate should stay at or near 100%. Metrics

Correction A poor clean buffer grab rate for either the default or named caches could indicate that the cache size is too small. You can look into adjusting the total memory configuration parameter higher. Monitor the actual machine’s memory limits and swap activity. Increased swap activity can be indicative of too little memory left for the server machine.

CPU B

USY

The CPU Busy statistic represents the percent of the sample interval during which the Adaptive

Server was busy.

Location

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> Databases

>

Home > Server Analysis Pane

Correction If you find that your CPU Busy value is consistently above 70%, consider adding additional hardware.

I/O B

USY

This metric represents the number of clock ticks in the sample interval during which the user task performed I/O operations.

Location

Sybase ASE Performance Analyst Statistics

> Home > Key Ratio Analysis Pane

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Databases

>

Home > Server Analysis Pane

13 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics High numbers indicate an I/O-intensive process. If idle time is also high, the application could be I/O bound.

Correction To improve throughput:

Assign a higher priority to the application.

Bind the application to a lightly loaded engine or engine group.

Partition the application’s data onto multiple devices.

S

ERVER

I

DLE

This metric represents the number of clock ticks in the sample interval during which the user task was idle.

Metrics

If you see high numbers for idle time and I/O Busy, the application could be I/O-bound.

Correction

To improve throughput:

• Assign a higher priority to the application.

• Bind the application to a lightly loaded engine or engine group.

• Partition the application’s data onto multiple devices.

B

OTTLENECK

A

NALYSIS

P

ANE

When Sybase Adaptive Server is running, every connected process is either busy doing work or waiting to work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If lock contention or heavy table scan activity has been dragging down database performance, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about which sessions and objects are causing the problem. The Performance Analyst

Home page identifies the top system and session waits that might be currently a cause of lessened performance.

When using bottleneck analysis, a DBA cannot rely only on the information contained in the wait events that Sybase Adaptive Server provides. For example, a database might be suspect or offline. Such a failure will not be reflected in any wait event, but still represents a very real bottleneck to the database. In the same way that a DBA cannot depend on only a few ratios to properly carry out ratio-based performance analysis, an administrator must include other statistical metrics in their overall bottleneck analysis framework to obtain an accurate

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1331

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S performance risk assessment. Performance Analyst works to identify bottlenecks in your database that fall outside of pure wait events so you can get a total picture of all stoppages in your system. The Performance Analyst Home page displays space-related bottlenecks as well as other sources of contention/bottlenecks that might be dragging down the overall performance of your system.

The following bottleneck indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Device I/O Contention

Suspect Databases

Tempdb Percent Full

Blocked Connections

Modify Conflicts

Databases Low on Space

Task Context Switches

Deadlocks

Logs Low on Space

Group Commit Sleeps

D

EADLOCKS

A deadlock occurs when two processes have a lock on a separate page or object and each wants to acquire a lock on the other process’ page or object. Each waits for the other to release the necessary lock. Sybase constantly checks for deadlocks and, when found, chooses the transaction that has accumulated the least amount of CPU time and terminates the transaction.

The server then rolls back that transaction and issues a notification of the event. The other process gets to move forward.

A deadlock occurs when two processes have a lock on a separate page or object and each wants to acquire a lock on the other process' page or object. Each waits for the other to release the necessary lock. Sybase constantly checks for deadlocks and, when found, chooses the transaction that has accumulated the least amount of CPU time and terminates it (the transaction). The server then rolls back that transaction and issues a notification of the event. The other process gets to move forward.

The deadlock statistic displays the number of current deadlocks in a Sybase server.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

A nonzero number should alert you to the fact that application conflicts are likely being experienced by your user community.

Correction Well-designed applications can minimize deadlocks by always acquiring locks in the same order. You should always do updates to multiple tables in the same order.

Once Sybase discovers a deadlock, it takes action and remedies the situation. Embarcadero

Performance Analyst makes it easier to discover how prevalent deadlock activity is on a system; preventing deadlocks from occurring in the first place is more difficult.

Those responsible for writing systems can minimize deadlocks by ensuring that applications acquire locks in the same order. Likewise, you should always do updates and other DML that act on multiple tables in the same order.

You can also shrink the amount of time that Sybase waits to check for deadlocks by modifying the deadlock checking period configuration parameter.

13 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

S

USPECT

D

ATABASES

It can be hard to recover quickly from a suspect database. There are times when the cache of the database is suspect and not the actual database itself. If you stop and start the Sybase server, you can verify if the cache is the culprit. If the database itself is damaged, there could be a true recovery situation.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Databases

>

Home > Bottleneck Analysis Pane

Correction The suspect database can be dropped using the DBCC DBREPAIR DROPDB command. You then need to re-create the database and perform a recovery operation using the most recent database dump.

D

EVICE

I/O C

ONTENTION

Device I/O Contention reflects the number of times a task or process was put to sleep while waiting for a semaphore for a particular database device.

When a task or process involves physical I/O, Sybase first fills out the block I/O structure and links it to a per engine I/O queue. If two or more Sybase engines request an I/O structure from the same device at the exact same time, the server puts one of them to sleep where it waits for the semaphore it needs.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

Correction If consistent high numbers are viewed for Device I/O Contention, you can try redistributing the tables across devices (that are located on separate hard disks) or by adding devices (again, that are located on separate hard disks) and moving tables and indexes to them.

M

ODIFY

C

ONFLICTS

For some database operations, Sybase uses a specialized protection mechanism to get exclusive access to a page without using actual restrictive page locks. Examples include accessing certain system tables and dirty reads on data pages. These actions need exclusive access to the page in question, even though they do not actually modify it. Modify conflicts record how many times these actions conflicted with other processes that need true database locks.

T

EMPDB

P

ERCENT

F

ULL

The Tempdb Percent Full statistic shows the percentage of the Tempdb that is full.

Metrics

Tempdb is probably the most important resource in Adaptive Server shared by all applications and processes. It is a server-wide resource used for internal processing tasks like work tables, sorts, reformatting, and index builds.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1333

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Correction

Problems can be identified by a consistently high percentage registering or receiving a message indicating that your transactions are being suspended until space is made available in the log. In the short term, try using the “dump tran” DBCC command. If you suspect your application requires a very large tempdb, it should be placed on small fast disks. These disks should have no other data on them.

NOTE:

On some systems, tempdb performs much faster using an operating system file rather than raw devices. This is because an operating system file uses buffering, which is faster than direct writes to a raw device.

T

ASK

C

ONTEXT

S

WITCHES

Task Context Switches summarizes task-switch activity for all engines on SMP servers. You can use this statistic to observe the effect of reconfigurations.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Databases

>

Home > Bottleneck Analysis Pane

You might reconfigure a cache or add memory if tasks appear to block on cache search misses and to be switched out often. Then, check the data to see if tasks tend to be switched out more or less often.

G

ROUP

C

OMMIT

S

LEEPS

For databases needing high throughput, a large log I/O size is very important to prevent disk queuing problems on the transaction log. Group commit sleeps reflect the number of times a task performed a transactional commit operation and was put to sleep by the server until data in the log was written to disk.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

You should examine group commit sleeps in conjunction with the number of committed transactions

(found on the Users performance category view).

Correction A high count for group commit sleeps is not necessarily a problem if the server's transaction rate is low. If there are a significant number of transactions that result in group commit sleeps, and the log I/

O size is greater than 2 KB, a smaller log I/O size can help to reduce commit time by causing more frequent page flushes.

Other factors that can affect group commit sleeps are the size of the server run queue and the speed of the hard disk where the log is located.

B

LOCKED

C

ONNECTIONS

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches on large systems. Although Sybase supports flexible locking mechanisms, blocking lock situations do crop up. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency.

13 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The blocked statistic displays the number of current processes blocked by other processes.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

While the lock contention rate is a better measure of the overall lock contention situation, if you consistently see positive numbers for the blocked statistic there may be a bottleneck for some processes. You can easily drill down and discover the exact process(es) holding locks that are blocking out other user activity.

Correction Once you discover a blocking lock situation, you can normally remedy it by issuing a KILL against the offending process. This eliminates the user's stranglehold on the objects the user was accessing, and usually results in other user processes completing in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is tricky.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

By default, all processes wait indefinitely for locks in Sybase. You can change this behavior by modifying the lock wait period configuration parameter, which limits the number of seconds that a process waits for a lock before timing out.

D

ATABASES

L

OW ON

S

PACE

The Databases Low on Space statistic indicates if any databases in the server are approaching low levels of available free space. Although good to know, you need a more detailed listing by database to determine where any actual space shortages exist in the server.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics If any one database begins to approach 90% used space, and is continuing to dynamically grow, you should take action to prevent any future space allocation errors.

Correction If a database is approaching its limit on space, you can either extend the database onto a new device, or if space exists on the device where the database currently resides, you can allocate more space for the database on the current device.

L

OGS

L

OW ON

S

PACE

This statistic indicates if any log for a database in the Sybase server is approaching low levels of available free space. Although good to know, a more detailed listing by database is needed to determine where any actual space shortages exist in the server.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

If a database log’s used space begins to approach 90%, you should take action to prevent any future space allocation errors. If the transaction log runs out of space, no transactions can take place in the database until you free up space in the log.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1335

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Correction If a database log consistently approaches its limit on used space, there are a few actions a DBA can take to prevent a database from freezing.

A backup (dump) of the log can be taken:

If log backups are not required for disaster recovery, the truncate log on checkpoint option can be set for the database. Setting this option deletes any space devoted to transactions in the log that have already completed when a database checkpoint occurs.

You can extend the log onto a new device. Or, if space exists on the device on which the database log currently resides, you can allocate more space for the log on the current device.

I/O A

NALYSIS

P

ANE

I/O statistics gives you a succinct overview of the datasource’s overall performance. The ratios on the Home page are:

Server Reads

I/O Errors

Server Writes Transaction Log Writes

S

ERVER

R

EADS

Total Server Reads reflect the total number of physical reads performed by the database server since the last refresh.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> I/O Analysis Pane

Large numbers of physical reads could reflect a too small data or procedure cache. You should examine the data and procedure cache hit rates to determine the overall effectiveness of logical vs. physical I/O.

S

ERVER

W

RITES

This value reflects the total number of physical writes performed by the database server since the last refresh.

Location

Sybase ASE Performance Analyst Statistics

> Home

> I/O Analysis Pane

T

RANSACTION

L

OG

W

RITES

Transaction Log Writes refers to the number of times Sybase wrote a transaction log page to disk since the last refresh. When the current log page becomes full, Sybase writes it out to disk.

Sybase also writes transaction log pages to disk after a transaction commits.

Location

Sybase ASE Performance Analyst Statistics

> Home

> I/O Analysis Pane

13 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

I/O E

RRORS

The I/O Errors value reflects total number of I/O errors (errors during read and write operations) encountered by the database server since the last refresh.

Location

Sybase ASE Performance Analyst Statistics

> Home

> I/O Analysis Pane

S

TORAGE

A

NALYSIS

P

ANE

While DBAs focus on memory settings and tuning SQL, they frequently forget how dangerous and insidious storage problems can be. This is not a good mindset because storage headaches can play a major role in wrecking an otherwise well-running database.

Storage problems generally take one of two forms:

• The ‘hit-the-wall’ variety that can bring things to a complete standstill.

• The ‘performance vampire’ kind that slowly drains the performance of a database over time.

Storage problems have the capability to bring the curtain down on a database very quickly, as in the case of a transaction log running out of free space. But storage problems can also silently work behind the scenes to slowly, but surely rob a database of its performance. For example, a hub table in a busy database might be accessed very quickly when an application is first given life, but over time, if it develops a heavy forwarded row problem, it can cause things to run very differently.

The Storage Analysis section of the Performance Analyst Home page displays the Total Used and Free Space of all tablespaces in the database. It also provides a count of the number of databases, files, and file groups that exist on the server. For more detailed information on database space, you can use the Performance Analyst Space home page or the Space Detail.

The following ratios succinctly communicate the general overall performance levels of the datasource:

· Total Used

Number of Devices

Total Free

Number of Databases

T

OTAL

U

SED

The Total Used statistic shows the total amount of space currently in use by the Sybase Server.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Storage Analysis Pane

T

OTAL

F

REE

The Total Free statistic shows the total amount of free space available to the Sybase Server

Location

Sybase ASE Performance Analyst Statistics

> Home

> Storage Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1337

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Correction

A low percentage of free space indicates that additional space should be allocated to your database(s)/devices.

N

UMBER OF

D

ATABASES

This value indicates the total number of database currently defined on the Sybase server.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Storage Analysis Pane

N

UMBER OF

D

EVICES

This value indicates the total number of devices currently defined on the Sybase server.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Storage Analysis Pane

W

ORKLOAD

A

NALYSIS

P

ANE

When your phone starts ringing with complaints of performance slowdowns, some of the first questions you should answer are:

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Home page provides insight into the leading resource hogs of a server, as well as a count of total active and inactive processes.

Workload Analysis statistics include:

Top I/O Process

Active Processes

Top Memory Process

Inactive Processes

Top CPU Process

T

OP

I/O P

ROCESS

The Top I/O Process statistic identifies the current SPID with the highest percentage of I/O activity.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Workload Analysis Pane

If any one session uses more than 50% of a total resource (CPU, memory, etc.) drill-down into the session to investigate what work is currently executing.

13 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OP

M

EMORY

P

ROCESS

The Top Memory Process statistic identifies the current SPID with the highest percentage of memory consumption.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Workload Analysis Pane

If any one session uses more than 50% of a total resource (CPU, memory, etc.) drill-down into the session to investigate what work is currently executing.

T

OP

CPU P

ROCESS

The Top CPU Process statistic identifies the current SPID with the highest percentage of CPU consumption.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Workload Analysis Pane

If any one session uses more than 50% of a total resource (CPU, memory, etc.) drill-down into the session to investigate what work is currently executing.

A

CTIVE

P

ROCESSES

The Active Processes statistic is the total number of active and open threads reported on the

Server. Active Processes displays the number of processes actively performing work.

Location

Sybase ASE Performance Analyst Statistics

> Home

> Workload Analysis Pane

I

NACTIVE

P

ROCESSES

The Inactive Sessions statistic represents the total number of threads logged onto the server that are currently idle.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Home

> Workload Analysis Pane

A large number of inactive processes could indicate user sessions that have mistakenly been left logged on. Since each user thread consumes a portion of memory on the server, to reduce resource usage, you should sever any sessions that do not need a connection.

Correction Drill down into the Session Waits page and check sessions that have many seconds idle and/or that have been logged on for very long periods of time, as indicated by the logon time column. After verifying that a session is no longer necessary, you can KILL it.

M

EMORY

In addition to a Home

page, the Memory category of Sybase Performance Analyst includes the following tabbed pages:

Data Cache Tab

Procedure Cache Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1339

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

H

OME

The Memory performance category view displays the following vital Sybase memory statistics:

Key Ratio Analysis Pane

Memory Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

Metadata Cache Ratio Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBA's to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the master.sysperfinfo performance table. This table maintains a count of various statistics for the server and particular databases since the server was brought up. For servers that are kept up for long periods of time, these values can grow quite large and will impact how a particular ratio that a DBA might be looking at is interpreted. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the various ratios can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following memory ratios are used on the Performance Analyst Home page to succinctly communicate the general overall memory performance levels of the monitored database:

Dirty Read Restarts

Procedure Reads from Disk

Dirty Read Requests Procedure Requests

The following statistics, available on this pane, are duplicates of statistics appearing on the

Key

Ratio Analysis Pane of the Home

page:

Data Cache Hit Ratio

Clean Buffer Grab Rate

Procedure Plan Hit Ratio Large I/O Hit Rate

13 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

D

IRTY

R

EAD

R

ESTARTS

Sybase allows dirty reads, which are reads of uncommitted data. To accomplish a dirty read,

Sybase uses a special lightweight protection mechanism to gain access to an object without using actual page locks. A dirty read restart occurs when a dirty read is active on an object page, and another process makes changes to the page that cause the page to be deallocated in memory. The scan for the dirty read must be restarted. The amount shown for dirty read restarts are the number of restarts that occurred since the last Embarcadero Performance Analyst refresh.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Values observed much above zero should serve as a signal that application modifications can be in order. Most applications should do everything possible to avoid restarts because of the large overhead they incur.

Correction If the numbers observed for dirty read restarts are significant, you can want to look into modifying applications that use dirty reads to accomplish data acquisition.

D

IRTY

R

EAD

R

EQUESTS

Sybase allows dirty reads, which are reads of uncommitted data. To accomplish a dirty read,

Sybase uses a special lightweight protection mechanism to gain access to an object without using actual page locks. This statistic displays the number of dirty reads that occurred since the last refresh in Embarcadero Performance Analyst.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

Dirty read page requests can incur significant overhead if they are observed with many dirty read restarts.

P

ROCEDURE

R

EQUESTS

The Procedure Requests statistic reports the number of times that stored procedures were executed since Embarcadero Performance Analyst was last refreshed. Such a request could use either an unused copy of the procedure’s query plan in memory or if no such copy exists, the procedure must be read in from disk.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

P

ROCEDURE

R

EADS FROM

D

ISK

The Procedure Reads from Disk statistic reports the number of times since Embarcadero

Performance Analyst was last refreshed that stored procedures were read from disk rather than copied in the procedure cache.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home > Key Ratio Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1341

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Metrics You should examine this number in conjunction with the overall procedure cache hit rate. Observing large numbers in this statistic indicates a lower than ideal procedure cache hit rate. Note that when a database is first started, this statistic is likely larger than desired because all code being used is relatively new and as such, must be read in from disk and placed into the cache. If, however, after a solid hour or two of steady database time, the procedure cache hit rate has not increased to desirable levels and this statistic continues to sport high numbers, you should look into the possibility of increasing the amount of memory allocated to the cache.

Correction If a problem is found in Sybase servers, versions 11-12, you can increase the amount of the total memory configuration parameter and/or increase the percentage of memory allocated to the procedure cache (by default, the data cache assumes any free memory left over after Sybase has met its kernel and procedure cache needs). Take care when increasing the procedure cache alone, as this could increase query response times due to more physical I/O being performed.

For Sybase 12.5, the total memory configuration parameter can again be increased to provide more memory for the Sybase server, but in 12.5, if you want to increase the size of the procedure cache, note that it is now configured in terms of literal size instead of a percentage of the overall configured memory.

Once the procedure cache has been adjusted, monitor Sybase to see if the cache hit rate improves. If it does not, another increase may be necessary. Also, keep a careful eye on the actual machine’s memory limits and swap activity. Increased swap activity can be indicative of too little memory left for the server machine.

B

OTTLENECK

A

NALYSIS

P

ANE

When Sybase Adaptive Server is running, every connected process is either busy doing work or waiting to work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. And this is where wait-based or bottleneck analysis comes into play. DBAs use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Bottleneck analysis is a valid method of measuring performance because it helps a DBA track where a database has been spending its time. If lock contention or heavy table scan activity has been dragging down database performance, a DBA can use bottleneck analysis to confirm the actual root cause. Once one or more wait events or other bottlenecks have been pinpointed as possible performance vampires, the DBA can drill down and oftentimes discover a fair amount of detail about which sessions and objects are causing the problem.

Memory bottlenecks can definitely cause performance degradation in an otherwise well-running database. Typically, these bottlenecks center around the server latches, which are lightweight locks used to protect certain resources in memory. To help you identify such problems, the following statistics are presented on the Performance Analyst Memory home page:

Log Semaphore Contention

Large I/Os Denied

Latch Contention

Buffers Grabbed Dirty

Waits on Execution Plans

Procedure Removals

L

OG

S

EMAPHORE

C

ONTENTION

The Log Semaphore Contention statistic measures the total number of times tasks requested a log semaphore. This includes those granted immediately and those for which the task had to wait.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

13 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics In high throughput environments with a large number of concurrent users committing transactions, you should expect a certain amount of contention for the log semaphore.

L

ATCH

C

ONTENTION

The Latch Contention statistic reports the number of times a task was switched out because it needed to wait for a latch. If your user tables use only allpages-locking, this latch contention is taking place either on a data-only-locked system table or on allocation pages. If your applications use data-only-locking, the contention reported here includes all waits for latches, including those on index pages and OAM pages as well as allocation pages.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

In SMP environments where inserts and expanding updates are extremely high, so that page allocations take place very frequently, contention for the allocation page latch can reduce performance. Normally, Adaptive Server allocates new pages for an object on an allocation unit that is already in use by the object and known to have free space. For each object, Adaptive Server tracks this allocation page number as a hint for any tasks that need to allocate a page for that object. When more than one task at a time needs to allocate a page on the same allocation unit, the second and subsequent tasks block on the latch on the allocation page.

Correction You can specify a "greedy allocation" scheme, so that Adaptive Server keeps a list of eight allocation hints for page allocations for a table.

The effect of dbcc tune(des_greedyalloc) are not persistent, so you need to reissue the commands after a reboot.

You should use this command only if all of the following are true:

You have multiple engines. It is rarely useful with fewer than four engines.

A large number of pages are being allocated for the object. You can use sp_spaceused or optdiag to track the number of pages.

The latch contention counter shows contention.

W

AITS ON

E

XECUTION

P

LANS

The Waits on Execution Plans value represents the number of times that a process attempting to use sp_showplan had to wait to acquire read access to the query plan.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

Query plans may be unavailable if you run sp_showplan before the compiled plan is completed or after the query plan finished executing. In these cases, Sybase tries to access the plan three times and then returns a message to the user.

L

ARGE

I/O

S

D

ENIED

The Large I/Os Denied statistic represents the number of times that large I/O could not be performed.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1343

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Metrics Adaptive Server cannot perform large I/O for the following reasons:

If any page in a buffer already resides in another pool.

When there are no buffers available in the requested pool.

On the first extent of an allocation unit, since it contains the allocation page, which is always read into the 2K pool.

Correction If a high percentage of large I/Os were denied, it indicates that using larger pools might not be as effective as it could be. If a cache contains a large I/O pool, and queries perform both 2K and 16K I/O on the same objects, there will always be some percentage of large I/Os that cannot be performed because pages are in the 2K pool.

If more than half of the large I/Os were denied, and you are using 16K I/O, try moving all of the space from the 16K pool to the 8K pool. Re-run the test to see if total I/O is reduced. Note that when a 16K

I/O is denied, Adaptive Server does not check for 8K or 4K pools, but uses the 2K pool.

B

UFFERS

G

RABBED

D

IRTY

The Buffers Grabbed Dirty statistic represents the number of times Sybase found dirty buffers since the last refresh in Embarcadero Performance Analyst.

As users request information, buffers are moved into and out of the Sybase data cache. Pages are also modified in the cache (termed dirty buffers) and need to be written out to disk. If Sybase has to wait for a dirty buffer to be written out to disk before a requested buffer is placed into the cache, performance can suffer.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

Metrics Ideally, the dirty buffer grab statistic should stay close to zero.

Correction Seeing high numbers for this statistic could indicate that the cache size is too small. You should look into carefully adjusting the total memory configuration parameter to be higher. However, keep a careful eye on the actual machine's memory limits and swap activity. Increased swap activity can indicate too little memory left for the server machine.

P

ROCEDURE

R

EMOVALS

The Procedure Removals statistic reports the number of times that stored procedures were aged out of the procedure cache since Embarcadero Performance Analyst was last refreshed.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Bottleneck Analysis Pane

High numbers, along with a lower than desired procedure cache hit rate, could indicate a procedure cache that is too small.

13 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If a problem is found in Sybase servers, versions 11-12, you can increase the amount of the total memory configuration parameter and/or increase the percentage of memory allocated to the procedure cache (by default, the data cache assumes any free memory left over after Sybase has met its kernel and procedure cache needs). Take care when increasing the procedure cache only, as this could increase query response times due to more physical I/O being performed.

For Sybase 12.5, the total memory configuration parameter can again be increased to provide more memory for the Sybase server, but in 12.5, if you wish to increase the size of the procedure cache, note that it is now configured in terms of literal size instead of a percentage of the overall configured memory.

Once the procedure cache has been adjusted, monitor Sybase to see if the cache hit rate improves. If it does not, another increase may be necessary. Also, keep a careful eye on the actual machine's memory limits and swap activity. Increased swap activity can indicate too little memory left for the server machine.

M

ETADATA

C

ACHE

R

ATIO

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Memory Home Page to succinctly communicate the general overall performance levels of the memory structures:

Open Objects

Object Spinlock Contention

Open Indexes

Index Spinlock Contention

Open Databases

Hash Spinlock Contention

O

PEN

O

BJECTS

The Open Objects statistic represents the use of the Adaptive Server metadata cache for open objects. The statistic includes number of active objects, free objects, and the maximum number of objects used.

Location

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

Metrics When Adaptive Server accesses an object, it needs to read information about it in the corresponding system table: sysobjects. The metadata cache for objects lets Adaptive Server access the information that describes it in the sysobjects row directly in its in-memory structure. This improves performance because Adaptive Server bypasses expensive calls that require disk access. It also reduces synchronization and spinlock contention when Adaptive Server has to retrieve object information at runtime.

Managing individual metadata caches for databases, indexes, or objects is beneficial for a database that contains a large number of indexes and objects, and where there is high concurrency among users.

Correction You can use this information to set the configuration parameter’s number of open objects.

O

PEN

I

NDEXES

The Open Indexes statistic represents the use of the Adaptive Server metadata cache for open indexes. The statistic includes the number of active indexes, free indexes, and the maximum number of indexes.

Location

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1345

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Metrics When Adaptive Server accesses an index, it has to access information about it in the respective system table: sysindexes. The metadata cache for indexes lets Adaptive Server access the information that describes it in the sysindexes row directly in its in-memory structure. This improves performance because it allows the Adaptive Server to bypass expensive calls that require disk access. It also reduces synchronization and spinlock contention when Adaptive Server has to retrieve index information at runtime.

Managing individual metadata caches for databases, indexes, or objects is beneficial for a database that contains a large number of indexes and objects, and where there is high concurrency among users.

Correction You can use this information to set the configuration parameter’s number of open indexes.

O

PEN

D

ATABASES

The Open Databases statistic shows the use of the Adaptive Server metadata cache for open databases. This statistic charts the number of active databases, free databases, and the maximum number of databases used.

When Adaptive Server opens a database, it has to access information about it in the respective system table: sysdatabases. The metadata cache for databases lets Adaptive Server access the information that describes it in the sysdatabases row directly in its in-memory structure. This improves performance because it allows the Adaptive Server to bypass expensive calls that require disk access. It also reduces synchronization and spinlock contention when Adaptive

Server has to retrieve database information at runtime.

Location

Metrics

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

Managing individual metadata caches for databases, indexes, or objects is beneficial for a database that contains a large number of indexes and objects, and where there is high concurrency among users.

Correction You can use this information to set the configuration parameter’s number of open databases.

O

BJECT

S

PINLOCK

C

ONTENTION

The Object Spinlock Contention statistic represents spinlock contention on the object descriptor caches.

Location

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

Correction You can use this information to tune the configuration parameter’s open object spinlock and open index spinlock ratios. If the reported contention is more than 3%, decrease the value of the corresponding parameter to lower the number of objects or indexes that are protected by a single spinlock.

I

NDEX

S

PINLOCK

C

ONTENTION

The Index Spinlock Contention value represents spinlock contention on the index descriptor caches.

Location

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

13 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction You can use this information to tune the configuration parameter’s open object spinlock and open index spinlock ratios. If the reported contention is more than 3%, decrease the value of the corresponding parameter to lower the number of objects or indexes that are protected by a single spinlock.

H

ASH

S

PINLOCK

C

ONTENTION

This metric represents the contention for the spinlock on the index metadata cache hash table.

Location

Sybase ASE Performance Analyst Statistics >

Memory

>

Home >

Metadata Cache Ratio Analysis Pane

Correction You can use this information to tune the open index hash spinlock ratio configuration parameter. If the reported contention is greater than 3%, decrease the value of the parameter.

M

EMORY

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Memory Home Page to succinctly communicate the general overall performance levels of the memory structures:

Buffer Cache

Open Database Memory

Procedure Cache

Open Object Memory

Connection Memory

Open Index Memory

B

UFFER

C

ACHE

The Buffer Cache statistic displays the amount of memory currently allocated to the Buffer

Cache.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

P

ROCEDURE

C

ACHE

The Procedure Cache value displays the amount of memory currently allocated to the procedure cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

The memory allocated for the procedure cache holds the optimized query plans (and occasionally trees) for all batches, including any triggers.

C

ONNECTION

M

EMORY

The Connection Memory value indicates the amount of memory currently allocated to user connections.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

Each connection requires approximately 60 KB.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1347

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

O

PEN

D

ATABASE

M

EMORY

The Open Database Memory value represents the current amount of memory allocated in the number of open databases parameter.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

O

PEN

O

BJECT

M

EMORY

This value represents the current amount of memory allocated in the number of open objects parameter.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

O

PEN

I

NDEX

M

EMORY

This value represents the current amount of memory allocated in the number of open indexes parameter.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Memory Analysis Pane

W

ORKLOAD

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Memory Home Page to succinctly communicate the general overall performance levels of the memory structures:

• Top Memory Hogs

T

OP

M

EMORY

H

OGS

This metric identifies the process that currently is using the highest percentage of memory in the database.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Home >

Workload Analysis Pane

It is not uncommon for one or two users to cause the majority of runtime problems that plague a server. The problem could be a runaway process, an untuned batch procedure, or other user-initiated operation.

If your database server does not have an overabundance of memory, then you should periodically check to see who your heavy memory users are along with the total percentage of memory each takes up. If you see one or two users who have more than 25-50% of the total memory usage, then you should further investigate the sessions to see what activities they are performing.

D

ATA

C

ACHE

T

AB

The Data Cache tab of the Memory Detail View includes the following sections:

Cache Configurations

Cache I/O Activity

Cache Efficiency

Cached Objects

13 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The following statistic, available on this tab, duplicates a statistic available on the Key Ratio

Analysis Pane

of the

Home

page:

Data Cache Hit Ratio

C

ACHE

C

ONFIGURATIONS

The Cache Configuration view represents the default and named data caches and the memory configuration in MB.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Data Cache Tab

C

ACHE

E

FFICIENCY

The Cache Efficiency section summarizes behavior for the default data cache and all named data caches combined. The table below describes the information available on the Cache Efficiency detail view:

Column

Cache Name

Hit Rate

Percent Used

Spinlocks

LRU Buffers

MRU Buffers

Large I/Os

Dirty Reads

Description

The name of the specified cache

The percentage of cache hits compared to the total number of cache searches.

The percentage of searches using this cache as a percentage of searches across all caches.

The number of spinlocks.

The number of buffers that were retrieved and replaced in the Least Recently Used section of the pool.

The number of buffers that were retrieved and replaced in the Most Recently Used section of the pool.

The size (bytes) of the I/O buffer for the pool.

The number of dirty reads.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Data Cache Tab

Interpreting cache hit data requires an understanding of how the application uses each cache. In caches that are created to hold specific objects such as indexes or look up tables, cache hit ratios can reach 100%. In caches used for random point queries on huge tables, cache hit ratios can be quite low but still represent effective cache use.

This data can also help you determine if adding more memory would improve performance. For example, if "Cache Hits" is high, adding memory probably would not help much.

Correction You can compare the "percent used" value for each cache to determine if there are caches that are over- or under-utilized. If you decide that a cache is not well utilized, you can:

Change the cache bindings to balance utilization.

Resize the cache to correspond more appropriately to its utilization.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1349

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

C

ACHED

O

BJECTS

The Cached Objects section shows the objects that are currently cached. The table below describes the information available on the Cached Objects detail view:

Column

Cache Name

Database Name

Object Owner

Object Name

Object Type

Cached (KB)

Processes Accessing

Description

The name of the specified cache.

The name of the database where the object resides.

The owner of the object.

The name of the object.

The type of the object.

The amount, in Kilobytes, of the cached object.

The number of processes accessing the specified object.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Data Cache Tab

C

ACHE

I/O A

CTIVITY

The Cache I/O Activity view shows how many searches were directed to each cache. The table below describes the information available on the Cache I/O Activity view:

Column Description

Cache Name The name of the specified cache.

Physical Reads The number of physical reads associated with the specified cache.

Pages Touched The number of pages touched by the cache.

Pages Read The number of pages read by the cache.

Buffers to MRU The number of buffers that were retrieved and replaced in the Most Recently Used section of the pool.

Buffers to LRU The number of buffers that were retrieved and replaced in the Least Recently Used section of the pool.

I/O Buffer Size The size (bytes) of the I/O buffer for the pool.

Allocated (KB) The number of KB that have been allocated for the pool.

Stalls The number of times a process had to wait for a free procedure cache buffer when installing a stored procedure into cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Memory

> Data Cache Tab

You can compare the values in this view for each cache to determine if there are caches that are over- or under-utilized.

13 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If you determine that a cache is not used as well as you would like, you can:

Change which objects are bound to each cache to balance use.

Resize the cache to correspond more appropriately to its use.

P

ROCEDURE

C

ACHE

T

AB

The Procedure Cache tab of the Memory Detail View includes the following sections:

Procedure Cache Activity Procedure Cache Detail

Current Procedure Usage

The following statistic, available on this tab, duplicates astatistic available on the

Key Ratio

Analysis Pane

of the

Home

page:

Procedure Plan Hit Ratio

P

ROCEDURE

C

ACHE

A

CTIVITY

The Procedure Cache Activity view summarizes the key metrics concerning the Procedure Cache.

The table below describes the information available on the Procedure Cache Activity view:

Column

Requests

Loads

Writes

Stalls

Description

The number of stored procedures requested from the cache.

The number of stored procedures loaded into cache.

The number of times a stored procedure was normalized and the tree was written back to sysprocedures. This happens when a stored procedure (or trigger) is created during the interval between polls. A degradation in performance can occur if an application program generates stored procedures.

The number of times a process had to wait for a free procedure cache buffer when installing a stored procedure into cache.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Procedure Cache Tab

P

ROCEDURE

C

ACHE

D

ETAIL

The Procedure Cache Detail view summarizes the key metrics concerning the Procedure Cache.

The table below describes the information available on the Procedure Cache Detail view:

Column

Object Name

Object Owner

Object Type

Database

Description

The name of the object.

The object’s owner.

The type of object.

The name of the database where the object resides.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1351

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Column

Compile Date

Memory Used (KB)

Description

The last month/day/year object data was compiled.

The amount of memory used by the object in kilobytes.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Procedure Cache Tab

C

URRENT

P

ROCEDURE

U

SAGE

The Current Procedure Usage view displays the number of procedures currently in use. The table below describes the information available in the Current Procedure Usage view:

Column

SPID

User Name

Database

Object Owner

Object Name

Object Type

Memory Used (KB)

Program Name

Description

The process name.

The name of the user attached to the process.

The database attached to the process.

The object’s owner.

The object’s name.

The object’s type.

The amount of memory the procedure used in kilobytes.

The name of the program where the procedure is used.

Location

Sybase ASE Performance Analyst Statistics

> Memory

> Procedure Cache Tab

I/O

In addition to a Home

page, the I/O category of Sybase Performance Analyst includes the following tabbed pages:

Databases tab

Network tab

Devices tab

Objects tab

Engines Tab

H

OME

The I/O performance category page displays the following vital Sybase I/O statistics:

Bottleneck Analysis Pane

Key System Analysis Pane

Network Analysis Pane

13 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Transaction Log Analysis Pane

Workload Analysis Pane

K

EY

S

YSTEM

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase I/O Home Page to succinctly communicate the general overall performance levels of I/O:

Physical Reads

Procedure Requests from Disk

Large I/Os Performed

APF Reads

Data Cache Searches

Physical Writes

Checkpoints

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

P

HYSICAL

R

EADS

Physical Reads represents the total number of physical reads performed by the database server since the last refresh.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

Large numbers of physical reads could reflect a too small data or procedure cache. You should examine the data and procedure cache hit rates to determine the overall effectiveness of logical vs. physical I/O.

APF R

EADS

This metric represents the number of pages that were read by asynchronous prefetch since the last refresh.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

Asynchronous prefetch tries to find a page it needs to read in the data cache using a quick scan without holding the cache spinlock. If that does not succeed, it then performs a thorough scan holding the spinlock.

P

HYSICAL

W

RITES

This value reflects total number of physical writes performed by the database server since the last refresh.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

P

ROCEDURE

R

EQUESTS FROM

D

ISK

The Procedure Requests from Disk value represents the number of times that stored procedures were read from disk rather than found and copied in the procedure cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

If you see a relatively high number, it could indicate that the procedure cache is too small.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1353

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Correction You should increase the size of the memory allocated to the procedure cache memory structure.

D

ATA

C

ACHE

S

EARCHES

The Data Cache Searches value represents the number of times that a needed page was found in any cache.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

Correction If you see a high number of cache misses, you should investigate statistics for each cache.

C

HECKPOINTS

The Checkpoints value represents the combined number of normal and free checkpoints that occurred during the sample interval.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

Checkpoints write dirty pages (pages that have been modified in memory, but not written to disk) to the database device. Adaptive Server's automatic (normal) checkpoint mechanism works to maintain a minimum recovery interval. By tracking the number of log records in the transaction log since the last checkpoint was performed, it estimates whether the time required to recover the transactions exceeds the recovery interval. If so, the checkpoint process scans all data caches and writes out all changed data pages.

When Adaptive Server has no user tasks to process, a housekeeper task begins writing dirty buffers to disk. These writes are done during the server's idle cycles, so they are known as "free writes." They result in improved CPU use and a decreased need for buffer washing during transaction processing.

If the housekeeper process finishes writing all dirty pages in all caches to disk, it checks the number of rows in the transaction log since the last checkpoint. If there are more than 100 log records, it issues a checkpoint. This is called a "free checkpoint" because it requires very little overhead. In addition, it reduces future overhead for normal checkpoints.

L

ARGE

I/O

S

P

ERFORMED

The Large I/Os Performed statistic measures the number of times that a requested large I/O was performed.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Key System Analysis Pane

Adaptive Server cannot perform large I/O for the following situations:

If any page in a buffer already resides in another pool.

When there are no buffers available in the requested pool.

On the first extent of an allocation unit, since it contains the allocation page, which is always read into the 2K pool.

Correction If a high percentage of large I/Os were denied, it indicates that the use of the larger pools might not be as effective as it could be. If a cache contains a large I/O pool, and queries perform both 2K and

16K I/O on the same objects, there will always be some percentage of large I/Os that cannot be performed because pages are in the 2K pool.

If more than half of the large I/Os were denied, and you are using 16K I/O, try moving all of the space from the 16K pool to the 8K pool. Re-run the test to see if total I/O is reduced. Note that when a 16K

I/O is denied, Adaptive Server does not check for 8K or 4K pools, but uses the 2K pool.

13 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

B

OTTLENECK

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase I/O Home Page to succinctly communicate the general overall performance levels of I/O:

Delayed Disk IOs

Disk I/O Structure Contention

Hottest Devices

Outstanding Disk I/Os

Total I/O

Disk I/O Structure Contention

I/O Errors

The following statistic, available on this pane, duplicates a statistic available on the Key Ratio

Analysis Pane

of the

Home

page:

I/O Busy

The following statistics, available on this pane, are duplicates of statistics available on the

Bottleneck Analysis Pane

of the Home

page:

Device I/O Contention

Group Commit Sleeps

D

ELAYED

D

ISK

IO

S

The Delayed Disk IOs value is the number of I/Os delayed when the limit on disk I/O structures is reached.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

When Adaptive Server exceeds the number of available disk I/O control blocks, I/O is delayed because Adaptive Server requires that tasks get a disk I/O control block before initiating an I/O request.

Correction If you see a nonzero value for delayed disk I/Os, try to add to the number of available disk I/O control blocks by increasing the configuration parameter.

O

UTSTANDING

D

ISK

I/O

S

The Outstanding Disk I/Os statistic reflects the maximum number of I/Os pending for Sybase since the last refresh.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

If you see nonzero numbers for both outstanding and delayed disk I/Os, there could be a problem in many areas.

D

ISK

I/O S

TRUCTURE

C

ONTENTION

When a Sybase server begins to experience I/O delays, the result can be a very dissatisfied user community. When such problems begin to occur, you should investigate Sybase or operating system limits. It could be that I/O operations are being blocked by one or both.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1355

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

The Disk I/O Structures statistic represents the number of I/O delays caused by Sybase reaching the limit on disk I/O structures. When Sybase exceeds the number of available disk I/O control blocks, I/O is deferred because Sybase requires that any task get a disk I/O control block before beginning an I/O request.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

Consistent numbers above zero should be a cause for concern.

Correction If you continue to see nonzero numbers for this statistic, you can try increasing the number of available disk I/O control blocks by increasing the configuration parameter disk I/O structures.

T

OTAL

I/O

The Total I/O statistic represents the total number of physical reads and writes.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

I/O E

RRORS

I/O error rate reflects total number of I/O errors (errors during read and write operations) encountered by the server since the last refresh inside Performance Analyst. The I/O errors rate is a percentage based on Total I/O (the sum of the physical reads and writes).

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

Metrics You should observe few, if any errors.

Correction If you notice any errors, you should check the Sybase error log for details.

I/O B

USY

This metric represents the number of clock ticks in the sample interval during which the user task performed I/O operations.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

High numbers indicate an I/O-intensive process. If idle time is also high, the application could be I/O bound.

Correction The application might achieve better throughput if you assign it a higher priority, bind it to a lightly loaded engine or engine group, or partition the application's data onto multiple devices.

H

OTTEST

D

EVICES

The Hottest Devices view identifies the configured devices engaged in the most I/O activity. In

Sybase, when a task or process needs to perform physical I/O, the server fills out the actual block

I/O structure and links it to a per-engine I/O queue. If two Sybase engines request the same I/O structure from the exact same device at the identical time, one of them is put to sleep by the server and it waits for the semaphore it needs.

Device I/O Contention reflects the number of times a task or process was put to sleep while waiting for a semaphore for a particular database device.

13 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The table below describes the information available on the Hottest Devices view:

Column

Device Name

APF Reads

Physical Reads

Physical Writes

Total I/O

Description

The name of the device.

The number of asynchronous pre-fetch buffers read.

The total number of physical reads performed by the database server since the last refresh

The total number of physical writes performed by the database server since the last refresh

The combined total of read and write operations.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Bottleneck Analysis Pane

Correction If you consistently see high numbers for Device I/O Contention, you can try redistributing the tables across devices (that are located on separate hard disks) or by adding devices (again, that are located on separate hard disks) and moving tables and indexes to them.

N

ETWORK

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase I/O page to succinctly communicate the general overall performance levels of I/O:

Packets Sent

Network Errors

Packets Received Network Delays

P

ACKETS

S

ENT

Packets Sent displays the number of times Sybase sent a packet to a client application.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Network Analysis Pane

P

ACKETS

R

ECEIVED

Total Packets Received reflects the number of times Sybase received a packet from a client application.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Network Analysis Pane

N

ETWORK

D

ELAYS

The Sybase server normally sends and receives network packets at a regular rate. If the network begins to be saturated, Sybase can experience delays in network I/O. The Network Delays statistic reflects the number of times network I/O activity was delayed.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Network Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1357

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Metrics If you see a network contention rate greater than 1%, it could indicate a challenged network structure.

Correction Beyond ensuring that the existing network is sufficient for handling the current load (database and non-database), other items to look at from a Sybase-specific standpoint include validating that only the necessary amount of data is being sent and returned to requesting users. You can also examine the default packet size and see if it is too small for the average packet size being sent/received by the

Sybase server.

N

ETWORK

E

RRORS

The Network Errors statistic reflects the number of times that network errors were detected by

Sybase while reading and writing packets.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Network Analysis Pane

Metrics If you consistently see a value much above zero, it could indicate the network structure is challenged.

Correction Beyond ensuring that the existing network is sufficient for handling the current load (database and non-database), other items to look at from a Sybase-specific standpoint include validating that only the necessary amount of data is being sent and returned to requesting users. You can also examine the default packet size and see if it is too small for the average packet size being sent/received by the

Sybase server.

T

RANSACTION

L

OG

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase I/O page to succinctly communicate the general overall performance levels of I/O:

Log Allocations

ULC Flushes

Log Writes

Average Number of Writes per Log

Page

L

OG

W

RITES

Transaction Log Writes refers to the number of times Sybase wrote a transaction log page to disk since the last refresh. When the current log page becomes full, Sybase writes it out to disk.

Sybase also writes transaction log pages to disk after a transaction commits.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Transaction Log Analysis Pane

L

OG

A

LLOCATIONS

Transaction Log Allocations refers to the number of times since the last refresh that additional pages were allocated to the transaction log. This statistic gives you a feel for the rate of transaction log growth.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Transaction Log Analysis Pane

13 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

ULC F

LUSHES

ULC Flushes is the total number of times that ULCs (user log caches) were flushed to a transaction log during the sample interval.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Transaction Log Analysis Pane

A

VERAGE

N

UMBER OF

W

RITES PER

L

OG

P

AGE

The Average Number of Writes is the average number of times each log page was written to disk.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Transaction Log Analysis Pane

In high throughput applications, this number should be as low as possible. If the transaction log uses

2K I/O, the lowest possible value is 1; with 4K log I/O, the lowest possible value is .5, since one log I/O can write 2 log pages.

In low throughput applications, the number will be significantly higher. In very low throughput environments, it may be as high as one write per completed transaction.

W

ORKLOAD

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase I/O page to succinctly communicate the general overall performance levels of I/O:

• Top I/O Hogs

T

OP

I/O H

OGS

The Top I/O Process statistic identifies the processes that has currently caused the most I/O usage on the database. The table below describes the information available from the Top I/O

Hogs view of the I/O page:

Column

SPID

Login

Physical I/O

% Used

Description

The process ID.

The login name the session is using.

The physical amount of I/O the process is using.

Percent of total I/O on the server this process is consuming.

Location

Sybase ASE Performance Analyst Statistics

> I/O > Home >

Workload Analysis Pane

Correction If any one session uses more than 50% of a total resource (CPU, memory, etc.) you should drill down into that particular session and investigate the cause.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1359

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

ATABASES TAB

The database I/O statistic displays the major I/O statistics as they relate to each associated database. The table below describes the information available from the I/O Databases detail tab:

Column

Database Name

Logical Reads

Physical Reads

APF Reads

Pages Read

Physical Writes

Pages Written

Rows Inserted

Rows Updated

Rows Deleted

Lock Requests

Lock Waits

Description

The name of the database.

The number of logical reads associated with the database.

The number of physical reads associated with the database.

The number of asynchronous pre-fetch buffer reads associated with the database.

The number of pages read associated with the database.

The number of physical writes associated with the database.

The number of pages written to the associated database.

The number of rows inserted in the associated database.

The number of rows updated in the associated database.

The number of rows deleted from the associated database.

The number of requests for a lock on database objects.

The number of times a task waited for a lock on a database object.

Correction

The major guidelines for improving I/O performance in Adaptive Server are as follows:

• Spread data across disks to avoid I/O contention.

• Isolate server-wide I/O from database I/O.

• Separate data storage and log storage for frequently updated databases.

• Keep random disk I/O away from sequential disk I/O.

• Mirror devices on separate physical disks.

• Partition tables to match the number of physical devices in a segment.

O

BJECTS TAB

The following views are used on the Performance Analyst for Sybase I/O Drilldown Objects to succinctly communicate the general overall performance levels of I/O:

Index Scans Open Object I/O

13 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

I

NDEX

S

CANS

The following views are used on the Index Scans view of I/O Drilldown Objects to succinctly communicate the general overall performance levels of I/O:

Ascending Scans

Descending Scans

DOL Ascending Scans DOL Descending Scans

A

SCENDING

S

CANS

The Ascending Scans value represents the number of forward scans on allpages-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Objects tab

DOL A

SCENDING

S

CANS

The DOL value represents the number of forward scans on data-only-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Objects tab

DOL D

ESCENDING

S

CANS

The DOL Descending Scans value represents the number of backward scans on allpages-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Objects tab

D

ESCENDING

S

CANS

The Descending Scans value represents the number of backward scans on data-only-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Objects tab

O

PEN

O

BJECT

I/O

The Open Object I/O view displays a grid that shows a list of each object on the selected database that is either open, or has been open, and related I/O activity.

The table below describes the information available on the Open Object I/O grid:

Column

Database Name

Object Name

Index ID

Logical Reads

Physical Reads

Description

The name of the database.

The name of the object.

The ID number of the associated index.

Total number of buffers read.

Total number of buffers read from disk

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1361

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Column

APF Reads

Pages Read

Physical Writes

Pages Written

Rows Inserted

Rows Updated

Rows Deleted

Used Count

Lock Requests

Lock Waits

Description

The number of asynchronous pre-fetch buffer reads associated with the database.

The number of pages read associated with the database.

The number of physical writes associated with the database.

The number of pages written to the associated database.

The number of rows inserted in the associated database.

The number of rows updated in the associated database.

The number of rows deleted from the associated database.

The number of rows used.

The number of requests for a lock on database objects.

The number of times a task waited for a lock on a database object.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Objects tab

Objects are only removed from the list if the configured number of "open objects" is exceeded. Then they are aged out to make room for newly opened objects.

N

ETWORK TAB

The Network tab of the I/O Detail view presents the following statistics:

Network I/O Summary Network I/O by Engine

Network I/O by Session

N

ETWORK

I/O S

UMMARY

Here you see a summary of data that includes the following statistics:

Packets Sent: Total Packets Sent reflects the number of times Sybase sent a packet to a client application.

Packets Received: Total Packets Received reflects the number of times Sybase received a packet from a client application.

Bytes Sent: Total Bytes Sent reflects the number of bytes sent to Sybase since the last refresh.

Bytes Received: Total Bytes Received reflects the number of bytes received by Sybase since the last refresh.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Network tab

N

ETWORK

I/O

BY

E

NGINE

The statistics, presented in tabular format, include:

13 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Engine: The name of the engine under scrutiny.

Packets Sent: The number of packets sent by the engine.

Packets Received: The number of packets received by the engine.

Bytes Sent: The number of bytes sent by the engine.

Bytes Received: The number of bytes received by the engine.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Network tab

N

ETWORK

I/O

BY

S

ESSION

This view shows the amount of network I/O committed by registered sessions on the Sybase

Server.

Presented in tabular format, you see:

Login: The log in name used by the session.

SPID: The process ID.

KPID: The kernel process ID.

Packets Sent: The number of packets sent by the session.

Packets Received: The number of packets received by the session.

Bytes Sent: The number of bytes sent by the session.

Bytes Received: The number of bytes received by the session.

Network Packet Size: Network packet size used by the current session.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Network tab

This metric can be used to see if a user or batch job is generating more (or less) network traffic than expected.

The process' network traffic, measured in conjunction with overall server network traffic, could help distinguish between process level or network-wide loads being the source of contention.

D

EVICES TAB

The following statistics are used on the Performance Analyst for Sybase I/O Drilldown Devices to succinctly communicate the general overall performance levels of I/O:

Device I/O Summary Device I/O Type

Real Time Device I/O

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1363

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

EVICE

I/O S

UMMARY

Devices are accessed repeatedly in a dynamic Sybase environment to satisfy user requests for data, to handle write activity that records transactions in a database's transaction log, and to manage other I/O operations. Viewing the I/O activity for each device is a good way to see what the "hot" devices are in a Sybase server with respect to I/O usage. The same information can be used to spot heavy database usage in systems where the device-to-database mappings are oneto-one.

The table below describes the information available in the Device I/O Summary view:

Column

Device

APF Reads

Physical Reads

Physical Writes

Total I/O

Description

The device’s name.

The number of asynchronous pre-fetch buffer reads associated with the database.

The number of physical reads associated with the database.

The number of physical writes associated with the database.

The combined total of read and write operations.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Devices tab

If devices have one-to-one relationships with user databases, you can quickly tell which databases are experiencing the most demand on a server. If the device-to-physical drive/file system is a one-to-one relationship, you can also spot which physical drives on a server are getting the heaviest workouts. For servers that have many drives, it is normally desirable to spread devices across different physical drives and controllers so contention does not occur at the disk level. In addition, separating databases and their corresponding logs is normally recommended so that each is located on a distinct physical drive. If possible, write-intensive devices, like log devices, are best suited for non-

RAID5 scenarios.

Correction If device hit rates are low, you can add more devices or redistribute objects among different devices.

Typically, segments can be used to redistribute objects among different devices or physical hard disks.

Common techniques include placing tables and indexes on different segments and partitioning large tables.

D

EVICE

I/O T

YPE

The Device I/O Type view shows the type of I/O registering against each configured device.

Devices are accessed repeatedly in a dynamic Sybase environment to satisfy user requests for data, to handle write activity that records transactions in a database's transaction log, and to manage other I/O operations. Viewing the I/O activity for each device is a good way to see what the "hot" devices are in a Sybase server with respect to I/O usage. The same information can be used to spot heavy database usage in systems where the device-to-database mappings are oneto-one.

The table below describes the information available from the Device I/O Type detail view:

Column

Device

I/O Type

Description

The name of the device.

The type of I/O.

13 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

I/O Time (sec)

Total I/O

Description

The amount of time, in seconds, spent performing I/O operations.

The combined total of read and write operations.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Devices tab

If devices have one-to-one relationships with user databases, you can quickly tell which databases are experiencing the most demand on a server. If the device-to-physical drive/file system is a one-to-one relationship, you can also spot which physical drives on a server are getting the heaviest workouts. For servers that have many drives, it is normally desirable to spread devices across different physical drives and controllers so contention does not occur at the disk level. In addition, separating databases and their corresponding logs is normally recommended so that each is located on a distinct physical drive. If possible, write-intensive devices, like log devices, are best suited for non-

RAID5 scenarios.

Correction If device hit rates are low, you can add more devices or redistribute objects among different devices.

Typically, segments can be used to redistribute objects among different devices or physical hard disks.

Common techniques include placing tables and indexes on different segments and partitioning large tables.

If device loads appear skewed (one device has much more activity than others), you should focus attention on that device. Again, redistributing objects can lessen the device's workload.

R

EAL

T

IME

D

EVICE

I/O

Devices are accessed repeatedly in a dynamic Sybase environment to satisfy user requests for data, to handle write activity that records transactions in a database's transaction log, and to manage other I/O operations. Viewing the current, real-time I/O activity for each device is a good way to see what the "hot" devices are in a Sybase server with respect to I/O usage. The same information can be used to spot heavy database usage in systems where the device-todatabase mappings are one-to-one.

The table below describes the information available on the Real Time Device I/O detail view:

Column

Device

Physical Name

APF Reads

Physical Reads

Physical Writes

I/O Time (Secs)

Semaphore Requests

Semaphore Waits

Description

The logical name of the device.

The physical name of the device.

The number of asynchronous pre-fetch buffer reads associated with the database.

Number of buffers read from disk.

Number of buffers written to disk.

The amount of time, in seconds, spent performing I/O operations.

The number of device semaphore requests immediately granted on the device.

The number of tasks forced to wait for synchronization of an I/O request.

Location

Sybase ASE Performance Analyst Statistics

> I/O

> Devices tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1365

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Metrics The amount of Reads, APF Reads, and Writes can help you spot overworked devices. You should also keep your eye on the semaphore waits and I/O time for each device to help you determine devices that are experiencing I/O related delays.

Correction If device hit rates are low, you can add more devices or redistribute objects among different devices.

Typically, segments can be used to redistribute objects among different devices or physical hard disks.

Common techniques include placing tables and indexes on different segments and partitioning large tables.

If device loads appear skewed (one device has much more activity than others), you should focus attention on that device. Again, redistributing objects can lessen the device's workload.

E

NGINES

T

AB

In symmetric multiprocessing (SMP) environments, a DBA can configure the Sybase server to use more than one "engine," which represents a certain amount of CPU power. By default, Sybase configures one engine for use. If you have a server machine with multiple CPUs, you can enable more engines to take advantage of the machine's additional processing ability.

The Engines tab of the I/O Detail view displays information with respect to how each engine is handling I/O. The table below describes the information available on the Engines tab of the I/O

Detail view:

Column

Engine

Completed I/Os

Outstanding I/Os

Description

The name of the configured engine.

The number of I/Os completed during the sample interval.

The number of I/Os left outstanding during the sample interval.

TIP:

To configure the grid to show/hide row numbers, use the Options Editor.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Devices tab

If the number of outstanding I/Os remains high or increases during periods of heavy activity, there may not be enough engines configured for the system.

Correction If the server machine has multiple CPUs, you can configure more engines for Sybase to use by following this process:

Use the sp_configure procedure to change the current engine configuration. For example, to change the number of engines from one to two, you would run: 'sp_configure "max online engines",2'

Stop and restart the Sybase server.

I

NDEX

S

CANS

T

AB

Indexes are accessed frequently in dynamic Sybase server environments. The type of index access often determines the response time an end user experiences. Single row index accesses are the quickest, and complete index scans are the most time consuming (for large indexes at least).

13 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The Index Scans tab of the I/O Detail view presents information with respect to index scans. The table below describes the information available on the Index Scans tab of the I/O Detail view:

Column

Scan Type

Count

Description

The type of index scan.

The number of scans per type for the sample interval.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> I/O

> Devices tab

There are two basic scan types - ascending and descending. For ascending scans, Sybase moves up the index page chain from beginning to end. Sybase follows the page chain in reverse order for descending scans. Descending scans are normally the result of requests made for data by descending column order.

Within ascending and descending scans, a data-only lock, or DOL, styled access can also occur.

S

PACE

In addition to a Home

page, the Space category of Sybase Performance Analyst includes the following tabbed pages:

Databases tab

Devices tab

H

OME

The Space performance category view displays the following vital Sybase space statistics:

Space Analysis Pane

Device Analysis Pane

Transaction Log Analysis Bottleneck Analysis Pane

S

PACE

A

NALYSIS

P

ANE

A Sybase Server is broken up into many different databases, each of which has its own level of activity. The Space Analysis section displays a summary of activities that have occurred within each database. It also displays the total number of databases defined on the Sybase server.

The table below describes the database information available on the Space Analysis view:

Column

Database Name

Total Space (MB)

Free Space (MB)

Used Space (MB)

Description

The name of the Sybase database.

The total amount of space allocated to the database expressed in MB.

The amount of space currently free expressed in MB.

The amount of space currently in use, expressed in MB.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1367

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Column

Percent Free

Log Total Space (MB)

Log Free Space (MB)

Log Used Space (MB)

Log Percent Free

Log Percent Used

Description

The available free space on the database, expressed as a percentage.

T

RANSACTION

L

OG

A

NALYSIS

The following statistics are used on the Performance Analyst for Sybase Space page to succinctly communicate the general overall performance levels of space related metrics:

• Transaction Log Analysis

T

RANSACTION

L

OG

A

NALYSIS

The Transaction Log Analysis view indicates if any transaction log for a database in the Sybase server is approaching low levels of available free space. The table below describes the information available on the Transaction Log Analysis grid:

Axis

Percent Space Used

Databases

Description

The amount of space currently used in the log, expressed as a percentage.

The name of the Sybase database.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home > Space Analysis Pane

If the transaction log runs out of space, no transactions can take place in the database until you free space in the log.

Correction If a database log consistently approaches its limit on used space, there are a few actions a DBA can take to prevent a database from freezing.

A backup (dump) of the log can be taken:

If log backups are not required for disaster recovery, the truncate log on checkpoint option can be set for the database. Setting this option deletes any space devoted to transactions in the log that have already completed when a database checkpoint occurs.

You can extend the log onto a new device. Or, if space exists on the device on which the database log currently resides, you can allocate more space for the log on the current device.

B

OTTLENECK

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Space page to succinctly communicate the general overall performance levels of space related metrics:

• Devices low on space

13 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The following statistics, available on this pane, are duplicates of statistics available on the

Bottleneck Analysis Pane of he

Home page:

Databases Low on Space

Logs Low on Space

D

EVICES LOW ON SPACE

This metric indicates if any device in the Sybase server is approaching low levels of available free space.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

The environment of the particular Sybase server, as well as your work style dictate the metrics you should use to evaluating a device that is running into trouble with space. Many DBAs create devices that parallel a single, corresponding database in size, and therefore, such devices show 100% utilization. Other DBAs create large devices that are not completely utilized.

Correction If a device has become too full, a DBA can begin the process of manually relocating databases from it onto other devices. The process of moving logs is easier and can be accomplished via singular commands (sp_logdevice).

D

EVICE

A

NALYSIS

P

ANE

The Device Analysis view presents space related details about a selected device located on the

Sybase server. The table below describes the information available on the Device Analysis view:

Column

Devices

Device Name

Physical Name

Total Space (MB)

Used Space (MB)

Free Space (MB)

Percent Free (MB)

Percent Used (MB)

Description

Total number of devices configured on the server.

The name of the device.

The name used by the operating system to identify the device.

Total space allocated on this device in MB.

Total space, in MB, currently in use on the device.

Amount of space that has not been allocated on this device.

The available free space on the database, expressed as a percentage.

The amount of space used on the database, expressed as a percentage.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

The environment of the particular Sybase server as well as your work style dictate the metrics you should use to evaluate a device that is running into trouble with space. Many DBAs create devices that parallel a single, corresponding database in size, and therefore, such devices show 100% utilization.

Other DBAs create large devices that are not completely utilized.

Correction If a device has become too full, a DBA can begin the process of manually relocating databases from it onto other devices. The process of moving logs is easier and can be accomplished via singular commands (sp_logdevice).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1369

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

ATABASES TAB

The following views are used on the Performance Analyst for Sybase Space drill-down page to succinctly communicate the general overall performance levels of space related metrics:

Database Object Summary

Database Object Detail

D

ATABASE

O

BJECT

S

UMMARY

A Sybase server contains many databases, some of which are devoted to system-level activities

(the master and tempdb databases, for example) and others that hold user data. The database overview displays details about the space situation for each database in a Sybase server, including the total, used, and free space. The percentage used amount for each database is also shown.

The table below describes the information available on the Database Object Summary detail view:

Column

Database Name

Total DB Space (KB)

Free DB Space (KB)

Used DB Space (KB)

Percent DB Free

User Table Count

Table Reserved (KB)

Table Data (KB)

Table Unused (KB)

User Index Count

Index Reserved (KB)

Index Data (KB)

Index Unused (KB)

Total Log Space (KB)

Free Log Space (KB)

Used Log Space (KB)

Percent Log Free (KB)

Description

The name of the database.

Total amount of space allocated to the database.

Total amount of space allocated but free on the database.

Total amount of space currently used by the database.

The amount of free space expressed as a percentage.

The number of user tables in the database.

The amount of total space reserved (used and free) for tables.

The amount of total space used by tables.

The amount of total unused space reserved for tables.

The number of user indexes.

The amount of index space that is reserved.

The amount of data stored in indexes.

The amount of index space that is unused.

The total amount of log space.

The amount of log space that is allocated but unused.

The amount of log space that is currently in use.

The amount of free log space expressed as a percent.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space

> Databases tab

If a database's used space percent amount goes above 90%, and the database is dynamic in nature

(meaning that users are constantly adding and modifying data), then you should take action to ensure that the database does not run out of available free space.

13 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction If the percent used amount of a database is approaching problematic levels, there are two ways you can rectify the situation:

If the database device that the database currently resides on contains additional free space, you can

ALTER the database to consume more available space on that device.

If the database device that the database currently resides on does not contain additional free space, you can do one of the following:

Create a new device and issue an ALTER for the database to use that device for space in addition to those currently used.

Choose another existing device that has free space and ALTER the database to use that device in addition to those currently in use.

D

ATABASE

O

BJECT

D

ETAIL

Tables and indexes comprise every Sybase database. The Database Object Detail view presents space-related information about tables and indexes. You can choose to view object details by table or index. Or, view objects matching a pattern you specify in the text box.

The table below describes the information available in the Database Object Detail view:

Column

Owner

Table Name

Index Name

Index Type

Key Count

Fill Factor

Reserved (KB)

Index Size (KB)

Unused (KB)

Segment Name

Extent Estimate

Description

The owner of the table or index.

The name of the table.

The name of the index.

The type of index.

The number of keys.

The percentage value of the how full each index page can be.

The amount of space reserved for the object, in KB.

The size of the index, in KB.

The amount of unused space (free space) that the object contains in KB.

The name of the segment.

An estimation as to the number of extents for the object.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Databases tab

D

EVICES TAB

The following statistics are used on the Performance Analyst for Sybase Space Drill-down

Devices to succinctly communicate the general overall performance levels of space related metrics:

Device Summary Device Fragment Detail

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1371

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

EVICE

S

UMMARY

The Device Summary view presents space related details about a selected device located on the

Sybase server. The table below describes the information available in the Device Summary detail view:

Column

Device Name

Physical Name

Total Space (MB)

Used Space (MB)

Free Space (MB)

Percent Free

Percent Used

Description

The logical name of the device.

The physical name of the device.

Amount of space configured when the device was created.

Amount of space available to any database (via the create or alter database commands).

The amount of free space left in the device.

The amount of free space for the device expressed as a percentage of total space.

The amount of used space for the device expressed as a percentage of total space.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space

> Devices tab

If a device's used space percent amount goes above 90%, you should take action to ensure that the device does not run out of available free space.

Correction If the percent used amount of a device is approaching problem levels, there are two ways you can rectify the situation:

Create a new device and issue an ALTER for the database(s) to use that device for space in addition to those currently used.

Choose another existing device that has free space and ALTER the database(s) to use that device in addition to those currently in use.

D

EVICE

F

RAGMENT

D

ETAIL

Space from a device is allocated among one or more databases on a Sybase server. The Device

Fragment Detail section presents all databases and their space fragments that reside on a particular device.

The table below describes the information available on the Device Fragment Detail view:

Column

Database Name

Type

Size (MB)

Description

The name of the database.

The type of database fragment (data only, log only, data and log).

The size of the fragment in MB.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Devices tab

13 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

D

ATABASES

In addition to a Home

page, the Databases category of Sybase Performance Analyst includes the following tabbed pages:

Overview Tab

Engines Tab

Objects Tab

Configuration Tab

H

OME

The Database performance category view displays the following vital Sybase database statistics:

Server Analysis Pane

Engine Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

Backup Analysis Pane

S

ERVER

A

NALYSIS

P

ANE

The following statistic is used on the Performance Analyst for Sybase Databases Page to succinctly communicate the general overall performance levels of database specific metrics:

• Sample Query Response Time

The following statistics, available on this pane, are duplicates of statistics available on the Key

Ratio Analysis Pane of the Home

page:

CPU Busy I/O Busy

S

AMPLE

Q

UERY

R

ESPONSE

T

IME

Performance Analyst allows you to define a query that is periodically run and timed by the product. The sample query helps you gauge the response time effectiveness of the Sybase server.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Server Analysis Pane

Because you control the complexity of the sample query, you must determine what is a “valid” response time for the query. Once you have determined that, you can create an alarm in Performance

Analyst that will alert you whenever the sample query falls outside of its acceptable baseline.

B

OTTLENECK

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Databases page to succinctly communicate the general overall performance levels of database specific metrics:

Databases with Suspect Pages

Index Maintenance from Insert/

Updates

Engine Configuration Limit

Operating System Limit

Index Maintenance from Deletes

Page Splits

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1373

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Server Configuration Limit

The following statistics, available on this pane, are duplicates of statistics available on the

Bottleneck Analysis Pane

of the Home

page:

Suspect Databases

D

ATABASES WITH

S

USPECT

P

AGES

Suspect objects normally indicate an internal problem in a server. They can also indicate that physical damage has occurred to part of a database.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Suspect objects have no place in a production database. If you identify any suspect objects, you should take immediate action.

Correction If the suspect object is an index, you could try dropping and recreating it, or use the DBCC REINDEX command. Other damaged objects can complete rebuilding the database. A suspect database can be a difficult thing to recover from quickly. There are times when the cache of the database is suspect and not the database itself. Stopping and starting the Sybase server can verify if this is the case. If the database itself is actually damaged, there could be a true recovery situation. The suspect database can be dropped using the DBCC DBREPAIR DROPDB command. You would then need to recreate the database and perform a recovery operation using the most recent database dump.

E

NGINE

C

ONFIGURATION

L

IMIT

An engine can exceed its limit for outstanding asynchronous disk I/O requests based on the maximum number of asynchronous I/Os per engine parameter.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

You can change this limit with the maximum asynchronous I/Os per engine configuration parameter.

I

NDEX

M

AINTENANCE FROM

D

ELETES

Indexes can considerably speed data access operations. The trade-off, however, is that indexes require maintenance whenever indexed columns are added to, modified, or removed in the parent table. The index maintenance from insert/updates metric provides a count of how many index maintenance operations have occurred from insert or update operations.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics Some index maintenance activity is to be expected (unless you are operating in a read-only environment), but excessive index maintenance can quickly become a bottleneck in heavy OLTP environments.

Correction If you observe a lot of index maintenance activity, you should begin a periodic review of your indexing schemes to ensure that all indexes currently maintained on the system are used and necessary. If you are using Sybase 12.5.03 or later (and have installed the monitoring tables), you can use Performance

Analysts object I/O drill-down view to diagnose which tables and indexes are the targets of heavy maintenance activity.

13 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

I

NDEX

M

AINTENANCE FROM

I

NSERT

/U

PDATES

Indexes can considerably speed data access operations. The trade-off, however, is that indexes require maintenance whenever indexed columns are added to, modified, or removed in the parent table. The index maintenance from insert/updates metric provides a count of how many index maintenance operations have occurred from insert or update operations.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics Some index maintenance activity is to be expected (unless you are operating in a read-only environment), however excessive index maintenance can quickly become a bottleneck in heavy OLTP environments.

Correction If you observe a lot of index maintenance activity, you should begin a periodic review of your indexing schemes to ensure that all indexes currently maintained on the system are used and necessary. If you are using Sybase 12.5.03 or higher (and have installed the monitoring tables), you can use

Performance Analysts object I/O drill down view to diagnose which tables and indexes are the targets of heavy maintenance activity.

O

PERATING

S

YSTEM

L

IMIT

When a Sybase server begins to experience I/O delays, the result can be a very dissatisfied user community. When such problems occur, you should investigate the Sybase or operating system limits. It could be that I/O operations are being blocked by one or both.

The Operating System Limit statistic shows nonzero numbers if Sybase detects that the limit for asynchronous I/Os has been exceeded.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

You should be concerned if you consistently see numbers above zero.

Correction In most UNIX operating systems, there is a kernel parameter that limits the number of asynchronous I/

Os that can occur at one time. If you continue to see nonzero numbers for this statistic, you should look into raising this limit.

P

AGE

S

PLITS

When data is inserted or updated in a table, Sybase may reorganize the data storage in the table's index pages. When an index page becomes full, but a DML operation demands room on that page, Sybase moves half the rows to a new page to accommodate the request. This reorganization is known as a page split.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Performance for DML actions can be impaired from page split operations. In addition, more index pages can make for longer index scan times.

S

ERVER

C

ONFIGURATION

L

IMIT

When a Sybase server begins to experience I/O delays, the result can be a very dissatisfied user community. When such problems begin to occur, you should investigate the Sybase or operating system limits. It could be that I/O operations are being blocked by one or both limits.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1375

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

The Server Configuration Limit statistic shows nonzero numbers if Sybase has exceeded its limit for the number of asynchronous disk I/O requests that can be outstanding for the server at one time.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics You should be concerned if you consistently see numbers above zero.

Correction If you continue to see nonzero numbers for this statistic, you can raise this limit using sp_configure with the max async I/Os per server parameter.

B

ACKUP

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Databases page to succinctly communicate the general overall performance levels of database specific metrics:

Backup Server Status Last Transaction Log Dump

B

ACKUP

S

ERVER

S

TATUS

The Backup Server Status value indicates whether or not the Backup Server is up and running.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Backup Analysis Pane

L

AST

T

RANSACTION

L

OG

D

UMP

The Last Transaction Log Dump value represents the last time the transaction was dump for the associated database.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Backup Analysis Pane

E

NGINE

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase Databases page to succinctly communicate the general overall performance levels of database specific metrics:

Engine Busy %

Maximum Engines

E

NGINE

B

USY

%

The Engine Busy % value represents the percentage of time the Adaptive Server Kernel is busy executing tasks on each Adaptive Server engine (rather than time spent idle).

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space > Home >

Engine Analysis Pane

When Adaptive Server has no tasks to process, it enters a loop that regularly checks for network and completed disk I/Os, and tasks in the run queue. Operating system commands to check CPU activity may show high usage for an Adaptive Server engine because they are measuring the looping activity, while Engine Busy % does not include time spent looping it is considered idle time.

13 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction This category can help you decide whether there are too many or too few Adaptive Server engines.

Adaptive Server's high scalability is due to tunable mechanisms that avoid resource contention. If values are consistently very high (more than 90%), it is likely that response time and throughput could benefit from an additional engine.

M

AXIMUM

E

NGINES

The Maximum Engines value represents the maximum number of engines currently connected.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Engine Analysis Pane

W

ORKLOAD

A

NALYSIS

P

ANE

The following statistic is used on the Performance Analyst for Sybase Databases page to succinctly communicate the general overall performance levels of database specific metrics:

• Workload Analysis

W

ORKLOAD

A

NALYSIS

The Sybase Server is broken up into many different databases, each of which has its own levels of activity. The Workload Analysis section displays a summary of resource consumption across all databases.

The table below describes the information available in the Workload Analysis section:

Column

DB Name

Connections

Blocked Users

Total Memory

Total I/O

Total CPU

Description

The name of the database.

The number of connections to the database.

The number of users currently blocked on the associated database.

The total amount of memory currently being used by the database.

The total amount of I/O currently being registered by the database.

The total amount of cumulative CPU for all processes connected to the database.

Location

Sybase ASE Performance Analyst Statistics

> Space > Home >

Engine Analysis Pane

O

VERVIEW

T

AB

The following statistics are used on the Performance Analyst for Sybase Databases Detail

Overview Page to succinctly communicate the general overall performance levels of database specific metrics:

Database Size Analysis Database Object Analysis Database User Analysis

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1377

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Database Summary

D

ATABASE

S

IZE

A

NALYSIS

The Database Size Analysis chart displays each database in terms of its total percentage of size to the total size of all databases on the Sybase Server.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Overview Tab

D

ATABASE

O

BJECT

A

NALYSIS

The Database Object Analysis chart displays each database in terms of its terms of its total percentage of objects to the total objects for all databases on the Sybase Server.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Overview Tab

D

ATABASE

U

SER

A

NALYSIS

The Database User Analysis chart displays each database in terms of its total percentage of user accounts to the total user accounts of all databases on the Sybase Server.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Overview Tab

D

ATABASE

S

UMMARY

This section displays summarized metadata for all defined databases on the Sybase Server.

NOTE:

Right-click any column heading to sort the column(s) in ascending or descending order.

The information available in the Database Summary table is described below:

Column

Database

Created

Description

The name of the database.

Gives the month/day/year and hour/minutes/second on which the database was first generated.

Owner Lets you see who owns the database.

Database Size (MB) Displays the size of the database in megabytes.

Log Size (MB)

Tables

Displays the log size in megabytes.

Gives the number of tables in the database.

Indexes

Users

Last Trans Log

Backup

Suspect

Displays the number of indexes in the table.

Lets you see the number of database users.

Let you see the last month/day/year and hour/minutes/second on which the transaction logs were most recently backed-up.

Lets you see in YES or NO format whether the database is suspect.

13 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Suspect Pages

Description

Lets you see in YES or NO format whether there are any suspect pages in the database.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space

> Overview Tab

The following items merit attention:

Any critical database that shows a last transaction log backup date that is older than the database's required backup needs.

Any database that shows a status of offline or suspect.

O

BJECTS

T

AB he following statistics are used on the Performance Analyst for Sybase Databases Detail Objects

Page to succinctly communicate the general overall performance levels of database specific metrics:

Database Object Detail

Suspect Objects Cache Bindings

D

ATABASE

O

BJECT

D

ETAIL

This view gives you detailed information for each database. Select the database you want to scrutinize and choose between reviewing tables or indexes. You can also enter a preference to see objects matching at pattern you specify in the text box. The table below describes the information available in the Database Object Detail table:

Column

Owner

Table/Index Name

Segment Name

Locking Scheme

Last Statistic Date

Row Count

Reserved (KB)

Avg Row Size

Tree Depth

Leaf Count

Leaf Row Size

Description

Displays the name of the table or index owner, depending on the view you selected.

Displays the name of the table or index, depending on the view you selected.

Lets you see associated table/index segment.

TABLE ONLY: Lets you see the type of locking scheme the table uses.

TABLE ONLY: Lets you see the most recent date and time table statistics were gathered.

TABLE ONLY: Lets you see the number of rows in the target table.

Lets you see the amount of space reserved for the target object in kilobytes.

TABLE ONLY: Lets you see the average row size for the target table.

INDEX ONLY: Lets you see the number of layers, or depth, of the index.

INDEX ONLY: Lets you see the number of leaf-level pages in the index.

INDEX ONLY: Lets you see the row size for each index leaf.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Objects Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1379

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

S

USPECT

O

BJECTS

Suspect objects normally indicate an internal problem in a server or that physical damage has occurred to part of a database. The table below describes the information available in the

Suspect Objects grid:

Column

Owner

Table Name

Index Name

Description

Displays the name of the table owner.

The affected table’s name.

The affected index’s name.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space

> Objects Tab

Suspect objects have no place in a production database. If any suspect objects are identified, you should immediately take action.

Correction If the suspect object is an index, you could try dropping and re-creating it, or use the DBCC REINDEX command. Other damaged objects can complete rebuilding the database. A suspect database can be a difficult thing to recover from quickly. There are times when the cache of the database is suspect and not the database itself. Stopping and starting the Sybase server can verify if this is the case. If the database itself is actually damaged, there could be a true recovery situation. The suspect database can be dropped using the DBCC DBREPAIR DROPDB command. You would then need to re-create the database and perform a recovery operation using the most recent database dump.

C

ACHE

B

INDINGS

The Sybase cache areas are devoted to facilitating the transfer of data and information between clients and the Sybase database. Tables and/or indexes can be assigned to various caches in hopes of speeding up access to table or index information. The Cache Bindings Detail section provides information about the current cache bindings of tables and/or indexes. The table below describes the information available in the Cache Bindings chart:

Column

Owner

Table Name

Index Name

Cache Binding

Description

The object owner’s name.

The table’s name.

The index’s name.

The name of the cache associated with the table or index.Databa

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Space

> Objects Tab

The objects best suited for being bound to a cache include frequently accessed objects that are oftentimes small in nature. Large tables that are scanned are normally not suitable for being bound to a cache and are best left to being indexed properly.

13 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

ONFIGURATION

T

AB

The following statistics are used on the Performance Analyst for Sybase Databases Detail

Configuration Page to succinctly communicate the general overall performance levels of database specific metrics:

Database Configuration Server Configuration

D

ATABASE

C

ONFIGURATION

The Database Configuration view allows you to see all the settings currently configured parameters and their settings on the associated database. Select a database from the dropdown list to see the parameter/setting information.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Configuration Tab

S

ERVER

C

ONFIGURATION

The Server Configuration view allows you to see all the settings of currently configured parameters on the Sybase Server. Select a database from the drop-down list to see the following information in the Server Configuration grid:

Column

Parameter

Configured Value

Run Value

Minimum

Maximum

Dynamic

Description

Lets you see the name of the configured parameter.

Displays the configured value of the parameter.

Displays the run value.

Displays the minimum configuration value.

Displays the maximum configuration value.

Indicates whether or not the parameter is dynamic or not.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Configuration Tab

E

NGINES

T

AB

The following statistic is used on the Performance Analyst for Sybase Databases Detail Engines

Page to succinctly communicate the general overall performance levels of database specific metrics:

• Database I/O

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1381

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

ATABASE

I/O

The Database I/O view on the Engines tab of the Databases Detail view allows you to see statistics about database objects. The table below describes the information available to you about Database I/O:

Column

Name

Start Date/Time

Stop Date/Time

OSPID

KPID

Status

Context Switches

Current Connections

CPU Time

CPU Time (System)

CPU Time (User)

Description

The name of the engine.

The date and time when the Sybase engine started.

The date and time when the Sybase engine stopped

The operating system process ID.

The kernel process ID.

The engine’s current status and whether it is connected or not.

The current number of context switches registering on the associated engine.

The current number of connections registering on the associated engine.

The current amount of CPU time consumed by the associated engine.

The current amount of system CPU time.

The current amount of user CPU time.

Location

Sybase ASE Performance Analyst Statistics

> Space

> Configuration Tab

U

SERS

In addition to a Home

page, the Users category of Sybase Performance Analyst includes the following tabbed pages:

Top Sessions tab

System Waits tab

Locks tab

Session Waits tab

Transactions tab

H

OME

The Users performance category view displays the following vital Sybase user statistics:

Key User Analysis pane

Transaction Analysis - Users

Bottleneck Analysis Pane

Workload Analysis Pane

Index Scan Analysis Pane

13 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

K

EY

U

SER

A

NALYSIS PANE

The following statistics are used on the Performance Analyst for Sybase User page to succinctly communicate the general overall performance levels of user specific metrics:

Active User Processes

Parallel Queries

Extended Procedure Requests

Procedure Requests

Inactive User Processes

System Processes

A

CTIVE

U

SER

P

ROCESSES

The Active User Processes statistic is the total number of active and open threads reported on the Server. Active Sessions displays the number of processes actively performing work.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

E

XTENDED

P

ROCEDURE

R

EQUESTS

The Extended Procedure Requests value represents the number of times extended procedures were executed in the sample interval.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

I

NACTIVE

U

SER

P

ROCESSES

The Inactive Sessions statistic represents the total number of threads logged onto the server that are idle at the current time.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

A large number of inactive users could indicate user sessions that have mistakenly been left logged on. Since each user thread consumes a portion of memory on the server, to reduce resource usage, you should sever any sessions not needing a connection.

Correction Drill down into the Session Waits page and check sessions that have many seconds idle or that have been logged on for very long periods of time, as indicated by the logon time column. After verifying that a session is no longer necessary, you can KILL it.

P

ARALLEL

Q

UERIES

The Parallel Queries value represents the total number of queries eligible to be run in parallel.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

Metrics

The optimizer determines the best plan, and decides whether a query should be run serially or in parallel and how many worker processes should be used for parallel queries.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1383

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

P

ROCEDURE

R

EQUESTS

The Procedure Requests value represents the number of times stored procedures were executed in the sample interval.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

S

YSTEM

P

ROCESSES

The System processes value represents the total number of threads logged onto the server that are Sybase internal processes.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Key User Analysis pane

B

OTTLENECK

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase User Home Page to succinctly communicate the general overall performance levels of user specific metrics:

Average Hash Chain Length

Deadlock %

Total Priority Changes

Average Lock Contention %

Lock Promotions

Current Locks

Lock Timeouts

The following statistics, available on this pane, are duplicates of statistics available on the

Bottleneck Analysis Pane

of the Home

page:

Deadlocks

Blocked Connections

A

VERAGE

H

ASH

C

HAIN

L

ENGTH

This value represents the average number of locks per hash bucket during the sample interval.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

Correction If the average number of locks per hash chain is more than four, consider increasing the size of the hash table. Large inserts with bulk copy are an exception to this guideline. Lock hash chain lengths may be longer during large bulk copies.

A

VERAGE

L

OCK

C

ONTENTION

%

The Average Lock Contention % represents the average number of times there was lock contention as a percentage of the total number of lock requests.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

Correction If the lock contention average is high, investigate the locks to see if the application is causing a lock contention or deadlock-related problem.

13 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

URRENT

L

OCKS

There are varieties of operations in Sybase that require the use of locks. The Current Locks statistic represents the number of total locks currently active in Sybase.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

Metrics You should watch to see if the if the number approaches the Sybase limit for available locks.

Correction If the number of current locks in a Sybase server approaches the Sybase limit for available locks, you can look into increasing the Number of Locks configuration parameter.

D

EADLOCK

%

A deadlock occurs when two processes have a lock on a separate page or object and each wants to acquire a lock on the other process' page or object. Each waits for the other to release the necessary lock. Sybase constantly checks for deadlocks and, when found, chooses the transaction that has accumulated the least amount of CPU time and terminates the transaction.

The server then rolls back that transaction and issues a notification of the event. The other process gets to move forward.

The deadlock % rate displays the percentage of times deadlocks occurred vs. the percentage of locks requested and immediately granted.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

Immediately investigate a percentage much above zero to prevent the situation from mushrooming.

You can easily drill down and discover the exact process(es) holding locks and deadlocks that are blocking out other user activity.

Correction Well-designed applications can minimize deadlocks by always acquiring locks in the same order. You should always do updates to multiple tables in the same order.

Once Sybase discovers a deadlock, it takes action and remedies the situation. Embarcadero

Performance Analyst makes it easier to discover how prevalent deadlock activity is on a system; preventing deadlocks from occurring in the first place is more difficult.

Those responsible for writing systems can minimize deadlocks by ensuring that applications acquire locks in the same order. Likewise, you should always do updates and other DML that act on multiple tables in the same order.

You can also shrink the amount of time that Sybase waits to check for deadlocks by modifying the deadlock checking period configuration parameter.

L

OCK

P

ROMOTIONS

The Lock Promotions value represents the average number of lock promotion types combined per second and per transaction.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

Lock promotions occur when the following escalations take place:

"Sh-Page to Sh-Table" - Shared page to shared table.

"Ex-Row to Ex-Table" - Exclusive row to exclusive table.

"Sh-R to Sh-Table - Shared row to shared table.

"Sh-Next-Key to Sh-Table" - Shared next-key to shared table.

"Ex-Page to Ex-Table" - Exclusive page to exclusive table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1385

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Correction If lock contention is high and lock promotion is frequent, you should consider changing the lock promotion thresholds for the tables involved. You can configure the lock promotion threshold either server-wide or for individual tables.

L

OCK

T

IMEOUTS

The Lock Timeouts value represents the total number of locks timing out during the sample period.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

You can specify the time that a task waits for a lock:

At the server level, with the lock wait period configuration parameter

For a session or in a stored procedure, with the set lock wait command

For a lock table command

Correction Except for lock table, a task that attempts to acquire a lock and fails to acquire it within the time period returns an error message and the transaction is rolled back. Using lock timeouts can be useful for removing tasks that acquire some locks, and then wait for long periods of time blocking other users. However, since transactions are rolled back, and users may simply resubmit their queries, timing out a transaction means that the work needs to be repeated.

T

OTAL

P

RIORITY

C

HANGES

Total Priority Changes represent the total number of priority changes during the sample period.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Bottleneck Analysis Pane

It is normal to see some priority switching due to system-related activity. Such priority switching occurs, for example, when:

A task sleeps while waiting on a lock - Adaptive Server temporarily raises the task's priority.

The housekeeper task sleeps - Adaptive Server raises the priority to medium while the housekeeper sleeps, and changes it back to low when it wakes up.

A task executes a stored procedure - the task assumes the priority of the stored procedure and resumes its previous priority level after executing the procedure.

Correction If you are using logical process management and there are a high number of priority changes compared to steady state values, it may indicate that an application, or a user task related to that application, is changing priorities frequently. Check priority change data for individual applications.

You should verify that applications and logins are behaving expected.

If you determine that a high-priority change rate is not due to an application or to related tasks, then it is likely due to system activity.

I

NDEX

S

CAN

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase User page to succinctly communicate the general overall performance levels of user specific metrics:

Ascending

DOL Descending

Descending

Total Index Scans

DOL Ascending

13 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

A

SCENDING

The Ascending value represents the number of forward scans on allpages-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

D

ESCENDING

The Descending statistic represents the number of backward scans on allpages-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

DOL A

SCENDING

The DOL Ascending value represents the number of forward scans on data-only-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

DOL D

ESCENDING

The DOL Descending value represents the number of backward scans on data-only-locked tables.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

T

OTAL

I

NDEX

S

CANS

The Total Index Scans statistic represents the total number of index scans (forward and backward).

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

T

RANSACTION

A

NALYSIS

- U

SERS

The following statistics are used on the Performance Analyst for Sybase User page to succinctly communicate the general overall performance levels of user-specific metrics:

Active Transactions

Committed Transactions

A

CTIVE

T

RANSACTIONS

The Active Transaction statistic represents a count of the number on in-process transactions for

SQL Server.

Location

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1387

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

C

OMMITTED

T

RANSACTIONS

Committed Transactions gives the number of transactions committed since the last refresh inside Performance Analyst. This includes transactions that meet explicit, implicit, and ANSI definitions for committed transactions. Note that multi-database transactions are counted.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Index Scan Analysis Pane

Multi-database transactions generally incur more overhead than single database transactions (for example, a transaction that modifies two databases is counted as two transactions). They usually involve more log activity and two-phase commits between the different databases, as well as cause more ULC flushes. You can improve performance by reducing the number of multi-database transactions.

W

ORKLOAD

A

NALYSIS

P

ANE

The following statistics are used on the Performance Analyst for Sybase User page to succinctly communicate the general overall performance levels of user specific metrics:

• Workload Analysis

W

ORKLOAD

A

NALYSIS

When your phone starts ringing with complaints of performance slowdowns, some of the first questions you should answer are:

• What users are currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst page provides insight into the leading resource hogs of a server. The table below describes the information available in the

Workload Analysis section of the Users page:

Column

Activity

SPID

Login

% Used

Description

Statistics are presented for the Top CPU Process, Top I/O Process, or Top Memory Process.

The process ID.

The logon name the session is using.

The percentage of CPU, I/O, or Memory consumed by the process.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users > Home >

Workload Analysis Pane

If any one session appears to be using more than 50% of a total resource (CPU, memory, etc.), then you should drill down into the session to find out what they are currently executing.

13 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OP

S

ESSIONS TAB

The following statistics are used on the Performance Analyst for Sybase Users Drill-down Top

Sessions to succinctly communicate the general overall performance levels of user specific metrics:

Top I/O Processes

Top Sessions

Top Memory Processes Top CPU Processes

T

OP

I/O P

ROCESSES

The Top I/O Processes statistic identifies the current Sybase process with the highest % of I/O activity.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Top Sessions tab

Correction If any one session uses more than 50% of a total resource (CPU, memory, etc.), you should drill down into that particular session and investigate the cause.

T

OP

M

EMORY

P

ROCESSES

The Top Memory Process statistic identifies the Sybase process that currently is using the highest percentage of memory in the database.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Top Sessions tab

T

OP

CPU P

ROCESSES

The Top CPU Process statistic identifies the Sybase process that currently has the highest percentage of CPU usage in the database.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Top Sessions tab

T

OP

S

ESSIONS

When a system experiences heavy activity, sometimes you will find that all the user connections are contributing somewhat equally to the overall load. More often than not, however, one or two user connections are causing most of the activity. It might be that a large batch load or other typical process is running that is perfectly okay for your system. Or it might be a runaway process or other rogue connection that needs to be tracked down and possibly eliminated.

The table below describes the information available on the Top Sessions detail view:

Column

SPID

User

FID

Description

The process ID.

The name of the session user.

The process ID of the worker process' parent.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1389

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Column

Status

Database

Host

Program

Mem Usage

CPU Time

Physical Reads

Logical Reads

Physical Writes

Description

The current status of the session.

The database the session is attached to.

The client machine name the session is using.

This identifies the program being run by the session.

The amount of memory being used by the session.

The cumulative CPU time for the process.

The number of physical reads produced by the session.

The number of logical reads produced by the session.

The number of physical writes generated by the session.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Top Sessions tab

L

OCKS TAB

The following statistics are used on the Performance Analyst for Sybase User Drill-down Locks tab to succinctly communicate the general overall performance levels of user specific metrics:

Locks

Locks by Lock Type Locks by Database

L

OCKS

To modify database information or structures, a user session must obtain a lock on the object to perform its task. In addition to user locks, Sybase itself issues lock requests to carry out its internal duties. The Locks section gives information about the locks currently on the system and also indicates if any blocking situations are occurring. You can elect to show only blocking locks in the Lock detail view.

The table below describes the information available on the Locks detail view:

Column

SPID

User

Database

Lock Type

Object Name

Status

Lock Page

Lock Class

Host

Description

The process ID.

The name of the current user

The name of the database where the process is running.

The type of lock (database, table, row id, etc.).

The name of the object involved in the lock.

The lock's status (waiting or granted).

The number of pages, if any, that are experiencing locks.

Lets you see the lock class.

The client machine name the session is using.

13 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Program

Command

CPU Time

I/O

Mem Usage

FID

Transaction

Description

The executable the process is using against the server.

The command currently being issued by the process.

The amount of time the process took to parse, execute, and fetch the data needed to satisfy the process’ execution.

The amount of I/O activity for the target process.

The amount of memory being used by the target process.

The process ID of the worker process' parent.

The current transactions generated by processes on the Sybase Server

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users

> Locks tab

Sybase ASE Performance Analyst Statistics

> Users

> Locks/Waits

A single blocking user has the potential to stop work for nearly all other processes on a small system, and can cause major headaches even on large systems. Blocks are most often caused by user processes holding exclusive locks and not releasing them via a proper COMMIT frequency. Unless a process times out via an application timeout mechanism, or the process has specified a timeout period, a process waiting for a lock will wait indefinitely.

Correction Once discovered, a blocking lock situation can normally be quickly remedied - the DBA issues a KILL against the offending process, which eliminates the user's stranglehold on the objects the user was accessing. Other user processes then nearly almost always complete in an instant. Discovering the blocked lock situation is made easier by using tools like Performance Analyst, but preventing the blocking lock situation in the first place is where it gets tricky. The DBA can drill down into user detail and view all current blocking locks to see exactly which sessions are holding the currently restrictive locks.

The culprit of blocking lock scenarios is usually the application design, or the SQL being used within the application itself. Properly coding an application to reference database objects in an efficient order, and then using the right SQL to get the job done, is an art. The key to avoiding lock contention is to process user transactions in the quickest and most efficient manner possible - something not always easy to do.

L

OCKS BY

D

ATABASE

The Locks by Database view represents the total locks occurring on the Sybase Server stratified by which database they are occurring on.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Locks tab

L

OCKS BY

L

OCK

T

YPE

To modify database information or structures, a user session must obtain a lock on the object to perform its task. In addition to user locks, Sybase itself issues lock requests to carry out its internal duties. The Locks by Lock Type section provides a breakdown of the different locks types being issued across all databases.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Locks tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1391

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

T

RANSACTIONS TAB

The Transactions view displays current transactions generated by processes on the Sybase

Server.

The table below describes the information available on the Transactions detail view:

Column

SPID

User

Status

Start Time

Type

State

Command

Connection

CPU Time

Mem Usage

Physical I/O

Description

The process ID.

The name of the user generating the session.

The current status of the session.

The time the session started.

The type of session.

The current state of the session, for example, whether or not it is active.

The command currently being issued by the session.

The amount of memory allocated to the session’s connections

The amount of time the process took to parse, execute, and fetch the data needed to satisfy the process’ execution.

The amount of memory being used by the session.

The amount of physical I/O for the session.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Transactions tab

Metrics Transaction activity is a good measurement of general performance by a user. If the total or committed numbers do not increase over a period of time, either the process is inactive or it may be hung or blocked.

Correction Look at CPU and I/O statistics to see if any activity for the process is being noted there.

S

YSTEM

W

AITS TAB

The following statistics are used on the Performance Analyst for Sybase User Drill-down System

Waits tab to succinctly communicate the general overall performance levels of user specific metrics:

System Waits

Wait Percent by Total Waits (By Wait

Class)

Wait Percent by Time Waited (By Wait Class)

S

YSTEM

W

AITS

When the Sybase Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The System Waits section identifies the waits that have occurred on the Sybase Server.

13 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

The table below describes the information available on the System Waits detail view. You can elect to display the internal system and scheduler events.

Column

Wait Event

Wait Class

Wait Count

Percent Waits

Wait Time

Percent Wait Time

Description

The name of the wait event.

The type of wait, often called a wait category or class.

The number of waits that have occurred.

The percent of waits as compared to the total number of waits.

The amount of time waited in seconds.

The percent of wait time as compared to the total wait time.

Location

Sybase ASE Performance Analyst Statistics

> Users

> System Waits tab

W

AIT

P

ERCENT BY

T

OTAL

W

AITS

(B

Y

W

AIT

C

LASS

)

When the Sybase Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Wait Percent by Total

Waits section graphically depicts the top waits by their percentage to all waits.

Location

Sybase ASE Performance Analyst Statistics

> Users

> System Waits tab

W

AIT

P

ERCENT BY

T

IME

W

AITED

(B

Y

W

AIT

C

LASS

)

When the Sybase Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Wait Percent by Time

Waited section graphically depicts the top waits by their percentage of time waited to total time waited.

Location

Sybase ASE Performance Analyst Statistics

> Users

> System Waits tab

S

ESSION

W

AITS TAB

The following statistics are used on the Performance Analyst for Sybase User Drill-down Locks tab to succinctly communicate the general overall performance levels of user specific metrics:

Session Waits Wait Percent by Total Waits (By Wait

Class)

Wait Percent by Time Waited (By Wait Class)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1393

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

S

ESSION

W

AITS

Session waits is merely a subset of contention that is viewable at the global database level.

Often it takes analysis at the session level to pinpoint the exact source of the wait that is occurring globally. Therefore, you need to become accustomed to viewing contention statistics and waits at the user process level.

When monitoring waits with respect to user sessions, there are two areas of interest:

• What HAS the user session been waiting on?

• What IS the user session waiting on?

The table below describes the information available on the Session Waits detail view. You can elect to include background process in the detail display.

Column

SPID

User

FID

Status

Database

Hostname

Program Name

Wait Event

Wait Class

Waits

Process Waits

Wait Time (s)

Percent Waits

Description

The unique identifier for the process.

The name of the process’ user.

The process ID of the worker process' parent.

The current status of the process.

The name of the database where the process is running.

The client machine name where the session is running.

The name of the program being run by the process.

The name of the wait event.

The type of wait, often called a wait category or class.

The number of waits that have occurred.

The percent of waits as compared to the total number of waits.

The number of seconds the process spent waiting for this wait.

The percent of wait time as compared to the total wait time.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

To determine the actual wait causes currently experienced by user connections, you should drill down from the global count of users waiting, into the actual system and user wait details.

Correction If you find a problem, drill down into wait details to determine whether the waits are resource-related.

W

AIT

P

ERCENT BY

T

OTAL

W

AITS

(B

Y

W

AIT

C

LASS

)

The Wait Percent by Total Waits section graphically depicts the waits that have experienced the highest percentage of occurrences on the system.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

13 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

W

AIT

P

ERCENT BY

T

IME

W

AITED

(B

Y

W

AIT

C

LASS

)

When the Sybase Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting might mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Session Wait Percent by

Time Waited section graphically depicts the top session waits by their percentage of time waited to total time waited.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

S

ESSION

D

ETAILS

The Sessions Detail view includes the following tabbed pages:

SQL tab

Locks/Waits

I/O tab Object Access tab

SQL

TAB

The SQL tab of the Sessions Detail view offers the following information:

Current SQL Current Procedures

C

URRENT

SQL

This view shows a snippet of the SQL associated with the user in question.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

C

URRENT

P

ROCEDURES

Here, in tabular format, you find the following information about the user’s current procedures:

Owner

Object Name

Object Type

Database: The name of the database on which the procedure resides.

Compile Date: The last date on which the object was compiled.

Memory (KB): The number of pages in the procedure cache that is currently allocated to the process. A negative number indicates that pages are being released (freed) from the process.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1395

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

I/O

TAB

The I/O tab of the Session Detail view displays the following statistical information about the current user’s activities in a graphical display:

Physical Reads

Logical Reads

Pages Read

Pages Written

Physical Writes

Table Accesses (scans): The number of table accesses (scans) by the user.

Index Accesses: The number of index accesses by the user.

Tempdb Objects: The number of times the Tempdb was accessed by the user.

O

BJECT

A

CCESS TAB

The Object Access tab of the Session Detail view displays information about the current objects being accessed. Here you’ll see, in tabular format:

Database: The name of the database

Owner ID: The ID number assigned to the process accessing the object.

Object Name

Object Type: The type of object being accessed.

Index ID

Physical Reads: The number of physical disk reads issued against the object.

Physical APF Reads: Number of physical Asynchronous Pre-Fetch buffers read.

Logical Reads: The number logical reads issued against the object.

L

OCKS

/W

AITS

The Lock/Waits tab of the Session Details page offers statistics on:

• Waits

The following statistic, available on this tab, duplicates a statistic on the Locks tab

of the Users

page:

Locks

13 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

W

AITS

When the Sybase Server is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things or it can be an indicator that a database bottleneck exists. The Waits section shows processes that are currently waiting on the Sybase Server.

Here you find, in tabular format, details for:

Login: The logon name used by the session.

Database: The name of the database the process is attached to.

Wait Event: The name of the wait event.

Wait Class: The type of wait, often called a wait category or class.

Waits: The number of waits that have occurred.

Wait Time (sec): The amount of time waited in seconds.

Location

Sybase ASE Performance Analyst Statistics

> Users

> Session Waits tab

OS

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O, or Memory), a slow CPU, insufficient or slow I/O devices, and insufficient memory. The OS Statistics page of Performance

Analyst lets you examine operating system metrics for the following platforms:

• AIX

• HP-UX

• Linux

• Solaris

• Unix

• Windows XP and 2000

NOTE:

The statistics available on the OS page depend on the operating system platform.

TIP:

If you magnify a graph to change back to the original size or minimize the size, close the OS Page and then reopen it again. Performance Analyst displays the graph in its original form and size.

In addition to a Home

page, the OS category of Sybase Performance Analyst includes the following tabbed pages:

CPU Tab

I/O Tab

Memory Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1397

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Network Tab

Processes Tab

Space Tab

H

OME

The OS home page includes the following sections:

Bottleneck Analysis Pane

Memory Analysis Pane

Disk Analysis Pane

Workload Analysis Pane

Key Resource Usage Pane

K

EY

R

ESOURCE

U

SAGE

P

ANE

The following ratios are used on the Performance Analyst OS home page to communicate the general overall performance levels of the operating system:

Disk Time

Paged Memory Used

(Windows)

Load Average

Swap Memory Used (AIX, HP-UX,

Linux, Solaris, Unix)

Processor Time

TIP:

To open the CPU tab, right-click Processor Time. To open the I/O tab, right-click Disk

Time. To open the Memory tab, right-click Paged Memory Used.

D

ISK

T

IME

The Disk Time statistic is the percentage of elapsed time that the selected disk drive/device was busy servicing read or write requests.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home > Key Resource Usage Pane

Metrics You should avoid consistently seeing values for this statistic greater then 90%.

Correction Add more disk drives and partition the files among all of the drives.

L

OAD

A

VERAGE

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home > Key Resource Usage Pane

High load averages usually mean the system is being used heavily and the response time is correspondingly slow.

P

ROCESSOR

T

IME

The Processor Time statistic indicates the percentage of time the processor is working. This counter is a primary indicator of processor activity.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home > Key Resource Usage Pane

13 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics If your computer seems to be running sluggishly, this statistic could be displaying a high percentage.

Correction Upgrade to a processor with a larger L2 cache, a faster processor, or install an additional processor.

P

AGED

M

EMORY

U

SED

The Paged Memory Used statistic is the ratio of Commit Memory Bytes to the Commit Limit.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk. The commit limit is determined by the size of the paging file. As the paging file increases, so does the commit limit.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home > Key Resource Usage Pane

This value displays the current percentage value only and not an average. If the percentage of paged memory used is above 90%, you may be running out of memory.

Correction Increase the size of page file.

S

WAP

M

EMORY

U

SED

The Swap Memory Used statistic is the percentage of swap space currently in use.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home > Key Resource Usage Pane

Metrics If the percentage of swap memory used is above 90%, you may be running out of memory.

Correction Increase the size of your swap files.

B

OTTLENECK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Average Disk Queue Length Interrupts/Sec

Page Faults/Sec

Processor

Processor Queue Length

Network Output Queue Length/

Network Queue Length

Processor Speed

TIP:

To open the I/O tab, right-click any Details menu item. To open the CPU tab, right-click the Item Processor Queues Length Details menu item. To open the Network tab, rightclick Network Output Queues Length.

NOTE:

The statistics available in this section depend on the platform of operating system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1399

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

A

VERAGE

D

ISK

Q

UEUE

L

ENGTH

The Average Disk Queue Length statistic is the average number of both read and write requests that were queued for the selected disk during the sample interval.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

This metric is useful in identifying I/O related bottlenecks. If the disk queue lengths for certain disks are consistently much higher than others, you may need to redistribute the load among available disks. If the disk queues lengths for all disks are consistently large, and you see a high amount of I/O activity, your disks may be inefficient.

Correction Some things you can do if you have problems with this statistic include:

Redistribute the data on the disk with the large average disk queue to other disks.

Upgrade to faster disk(s).

I

NTERRUPTS

/S

EC

Interrupts/Sec is the average rate, in incidents per second, at which the processor received and serviced hardware interrupts. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards, and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended. The system clock typically interrupts the processor every 10 milliseconds, creating a background of interrupt activity. This statistic shows the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

A high value indicates possible excessive hardware interrupts; justification is dependent on device activity.

N

ETWORK

O

UTPUT

Q

UEUE

L

ENGTH

/N

ETWORK

Q

UEUE

L

ENGTH

The Network Output Queue Length statistic is the number of threads in the processor queue.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

14 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

AGE

F

AULTS

/S

EC

The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Metrics This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction If the number of page faults remains consistently high, you can check with your Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

P

ROCESSOR

Q

UEUE

L

ENGTH

The Processor Queue Length statistic is the number of threads in the processor queue.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

P

ROCESSOR

S

PEED

The Processor Speed statistic displays the speed of the active processor in MHz. The speed is approximate.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

P

ROCESSOR

The Processor Statistic displays the type of processor currently in use, for example, GenuineIntel.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1401

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

M

EMORY

A

NALYSIS

P

ANE

The following metrics are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Available Paged Memory

(Windows)

Available Swap Memory Available Swap Memory

(AIX, HP-UX,

Linux, Solaris, Unix)

Used Disk Space

Total Physical Memory

TIP:

To open the Memory tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VAILABLE

P

AGED

M

EMORY

The Available Paged Memory statistic shows the amount of virtual memory available for the processes.

NOTE:

This statistic is available for the Windows platform.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Memory Analysis Pane

If the available virtual memory is less than 10% of the total virtual memory, your system may run out of memory.

Correction Increase the size of page file.

A

VAILABLE

P

HYSICAL

M

EMORY

The Available Physical Memory statistic represents the amount of RAM available to all processes.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Memory Analysis Pane

This counter displays the last observed value only and not an average. Use this value with the Total physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

Correction Some things you can do if you have problems with this statistic include:

Check the running processes to see if there are any memory leaks.

Stop any services that are not required.

Install additional RAM.

A

VAILABLE

S

WAP

M

EMORY

The Available Swap Memory statistic represents the amount of virtual memory available for the processes.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Memory Analysis Pane

If the available Available Swap Memory is less than 10% of the total Swap Memory, your system may run out of memory.

Correction Increase the size of swap files.

14 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

T

OTAL

P

AGED

M

EMORY

/T

OTAL

S

WAP

M

EMORY

The Total Paged Memory statistic shows the maximum amount of virtual memory available to all processes.

NOTE:

The name of this statistic depends on the platform of the operating system.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Memory Analysis Pane

It is recommended that this be 1½ - 3 times the amount of RAM on the system.

T

OTAL

P

HYSICAL

M

EMORY

The Total Physical Memory statistic shows the amount of physical memory installed on your computer.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Memory Analysis Pane

This is an informational metric and displays the total amount installed on the machine. Use this value with the available physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

D

ISK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Free Disk Space

Total Disk Space Used Disk Space

TIP:

To open the Space tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

F

REE

D

ISK

S

PACE

The Free Disk Space statistic shows the unallocated space, in megabytes on all logical disk drives.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1403

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

U

SED

D

ISK

S

PACE

The Used Disk Space statistic shows the amount of allocated space, in megabytes on all logical disk drives.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

T

OTAL

D

ISK

S

PACE

Total Disk Space displays the total allocated and unallocated space, in megabytes on all logical disk drives.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

W

ORKLOAD

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Number of Logins

Top I/O Process

Number of Processes

Top Memory Process

Top CPU Process

TIP:

To open the Processes tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

T

OP

M

EMORY

P

ROCESS

Top Memory Process shows the current process that is consuming the most amount of memory.

The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Workload Analysis Pane

14 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Metrics If you are running out of memory on the system, this is a quick way to identify the top memory user. If the displayed process is using a significant portion of the total memory, it could be causing the memory issues.

T

OP

CPU P

ROCESS

Top CPU Process shows the current process that is consuming the most amount of CPU. The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Workload Analysis Pane

If the amount of CPU time used by this process is close to 100% and the CPU usage is very high, this process may be the bottleneck on the server.

Correction Investigate the process further to see if it is in an inconsistent state. Also, look at minimum requirements for CPU speed for the process. You may need to upgrade your CPU.

T

OP

I/O P

ROCESS

The Top I/O Process statistic shows the current process that is consuming the most amount of

CPU. The information displayed is dependent on the platform of the operating system.

Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major

Page Faults, and the amount of I/O expressed in KB/sec.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Workload Analysis Pane

N

UMBER OF

L

OGINS

This statistic displays the total number of logins on the server.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Workload Analysis Pane

N

UMBER OF

P

ROCESSES

This statistic displays the total number of processes on the server.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Home >

Workload Analysis Pane

CPU T

AB

The CPU tab of the OS Detail includes the following sections:

Context Switches/Sec

Load Averages

CPU Events

CPU Utilization

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1405

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

The following statistics, available on this tab, are duplicates of statistics available on the

Bottleneck Analysis Pane

of the OS

Home

page:

Interrupts/Sec

Processor Queue Length

NOTE:

The sections available on this tab depend on the platform of operating system.

CPU U

TILIZATION

The CPU Utilization section includes the following information:

% Privileged Time % User Time

% P

RIVILEGED

T

IME

The % Privileged Time statistic is the percentage of elapsed time that the process threads spent executing code in privileged mode.

NOTE:

For Windows systems, when a Windows system service is called, the service will often run in privileged mode to gain access to system-private data. Such data is protected from access by threads executing in user mode. Calls to the system can be explicit or implicit, such as page faults or interrupts. These kernel commands, are considered privileged to keep the low-level commands executing and prevent a system freeze.

Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. Some work done by Windows on behalf of the application might appear in other subsystem processes in addition to the privileged time in the process.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

The ideal range should be 0-40% (less than 40% indicates excessive system activity).

Correction If your CPU consistently runs at less than 40% you may need to upgrade your system to include a faster processor(s).

% U

SER

T

IME

The % User Time statistic is the percentage of elapsed time the processor spends in the user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory. The operating system switches application threads to privileged mode to access operating system services. This counter displays the average busy time as a percentage of the sample time.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

If the Privileged Time is high in conjunction with Physical Disk Reads, consider upgrading the disk I/O subsystem.

14 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

CPU E

VENTS

The CPU Events section includes the following information:

Context Switches/Sec Load Averages System Calls/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

C

ONTEXT

S

WITCHES

/S

EC

The Context Switches/Sec section shows the combined rate at which all processors on the computer are switched from one thread to another. Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

The ideal range should be between 0-10,000. GA number greater then 10,000 may indicate too many threads contending for resources.

S

YSTEM

C

ALLS

/S

EC

System calls are functions which require the services of the operating system. Usually they involve access to some data that users must not be permitted to corrupt or even change.

Location

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

Correction Try to find a good ratio between the amount of time the operating system runs (fulfilling system calls and doing process scheduling), and the amount of time the application runs. Your goal should be running 60% to 75% of the time in application mode, and 25% to 40% of the time in operating system mode. If you find that the system is spending 50% of its time in each mode, then you should investigate to determine what is wrong.

L

OAD

A

VERAGES

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> CPU Tab

High load averages usually mean that the system is being used heavily and the response time is correspondingly slow.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1407

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

P

ROCESSES

T

AB

The Processes tab of the OS Detail page succinctly communicates the general overall performance levels of processes. The columns available in this table depend on the platform of operating system. The table below describes the information available in the table on this tab:

Column

Process

User

ID

CPU

Description

The name of the process.

The user of the process.

The ID Process is the unique identifier of this process. ID Process numbers are reused, so they only identify a process for the lifetime of that process.

The CPU is the percentage of elapsed time that all of process threads used the processor to execution instructions.

User Mode

Memory WINDOWS

ONLY

Memory (MB)

The User Mode is the percentage of elapsed time that the process threads spent executing code in user mode.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory

Active Memory

I/O Data

Elapsed Time

Thread Count

Handle Count

Priority

Creating Proc ID

Page Faults/Sec

Page File

Memory is the percentage of the memory used of the total memory.

Active Memory is the amount of committed virtual memory, in bytes for this process. Active memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive. This counter displays the last observed value only; it is not an average.

The rate at which the process is reading and writing bytes in I/O operations. This counter counts all I/O activity generated by the process to include file, network and device I/Os.

The total elapsed time, in seconds, that this process has been running.

The number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread.

The total number of handles currently open by this process. This number is equal to the sum of the handles currently open by each thread in this process.

The current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process' base priority.

The Creating Process ID value is the Process ID of the process that created the process. The creating process may have terminated, so this value may no longer identify a running process.

Page Faults/Sec is the rate at which page faults by the threads executing in this process are occurring. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This may not cause the page to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with whom the page is shared.

Page File is the current number of kilobytes that this process has used in the paging file(s).

Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and the lack of space in paging files can prevent other processes from allocating memory.

14 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Column

Private

Description

Private is the current size, in kilobytes, of memory that this process has allocated that cannot be shared with other processes.

I/O T

AB

The I/O tab includes the following sections:

Bytes per I/O Operation

Average Disk Queue/Total Disk

Queue

Disk Transfers/Sec

I/O Details

Disk I/O Time

Transfer Rate

NOTE:

The sections available on this tab depend on the platform of operating system.

I/O D

ETAILS

The table below describes the information available in this section:

Column

Disk

Reading (KB/s)

Writing (KB/s)

Disk Read Time

Disk Write Time

Disk Time

Avg. Read Queue

Avg. Write Queue

Disk Reads/Sec

Disk Writes/Sec

Description

The disk number assignment.

The amount of bytes read from the device.

The amount of bytes written to the device.

Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.

Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Disk Time is the percentage of elapsed time that the selected disk was busy servicing requests.

Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.

Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.

Disk Reads/Sec is the rate of read operations on the disk.

Disk Writes/Sec is the rate of write operations on the disk.

NOTE:

The columns available in this table depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1409

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

T

RANSFER

R

ATE

The Transfer Rate section succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Description

The average number of bytes transferred from the disk during read operations.

Writing The average number of bytes transferred to the disk during write operations.

Transferred The amount of time required to transfer the data between the device's cache and the actual device media.

Metrics

It is measured in number of KBs per second.

It is measured in number of KBs per second.

N/A

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

B

YTES PER

I/O O

PERATION

The Bytes per I/O Operation section of the OS Detail succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Writing

Description

The average number of bytes transferred from the disk during read operations.

The average number of bytes transferred to the disk during write operations.

Metrics

It is measured in number of bytes per second.

It is measured in number of bytes per second.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

14 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

A

VERAGE

D

ISK

Q

UEUE

/T

OTAL

D

ISK

Q

UEUE

The Average Disk Queue section of the OS Detail page succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Average Read Queue

Average Write Queue

Average Queue

Description

Average Read Queue Length is the average number of read requests that were queued for a particular disk.

Average Write Queue is the average number of write requests that were queued for a particular disk.

Average time in ms. to service I/O requests which for disks includes seek, rotational latency and data transfer time).

Information

Sustained loads on any of the disk queue lengths could represent problems within your system.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Windows System

Administrator for assistance in Correction these problems.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Unix System

Administrator for assistance in Correction these problems.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

Correction Contact your Windows System Administrator for assistance in Correction these problems.

D

ISK

I/O T

IME

The Disk I/O Time section of the OS Detail page succinctly communicates the general overall performance levels of the disk’s I/O. The table below describes the statistics in this section:

Statistic

% Disk Read Time

% Disk Write Time

% Disk Time

Description

% Disk Read Time is the percentage of time during the sample interval that the disk is busy servicing read requests.

Metrics

Use this in conjunction with the % Disk Write Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

% Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

% Disk Time is the percentage of time during the sample interval that the disk is busy servicing requests.

Use this in conjunction with the % Disk Read Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Use this statistic to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1411

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

D

ISK

T

RANSFERS

/S

EC

The Disk Transfers/Sec section of the OS Detail page succinctly communicates the general overall performance levels of the disk transfers. The table below describes the statistics in this section

Statistic

Reads/Sec

Writes/Sec

Transfers/Sec

Description

The the rate of read operations on the disk.

The rate of write operations on the disk.

The rate of transfer operations per second.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> I/O Tab

M

EMORY

T

AB

The Memory tab of the OS Detail page includes the following sections:

Buffer Size

Memory Available

Cache Efficiency

Paging Activity

Cache Size

Page Replacements

The following statistic, available on this tab, duplicates a statistic available on the Bottleneck

Analysis Pane

of the

OS

Home page:

Page Faults/Sec

NOTE:

The sections available on this tab depend on the platform of operating system.

P

AGING

A

CTIVITY

The Paging Activity section includes the following statistics:

Blocks Input/Sec

Paged Out

Blocks Output/Sec

Pages Input/Sec

Paged In

Pages Output/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

B

LOCKS

I

NPUT

/S

EC

The Blocks Input/sec statistic is the number of blocks sent to a block device per second.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

14 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck:

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

B

LOCKS

O

UTPUT

/S

EC

The Blocks Output/sec statistic is the number of blocks received from a block device per second).

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

P

AGED

I

N

The number of disk block paged into core from disk which occurs when the server is experiencing a shortage of RAM. Any nonzero value indicates excessive swap activity. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk.

This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Correction High values indicate the possible need to increase the amount of RAM on the system.

P

AGED

O

UT

The number of disk block paged out of core from disk. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk. This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1413

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

P

AGES

I

NPUT

/S

EC

The Pages Input/Sec statistic is the number of pages read from disk to resolve hard page faults.

Hard page faults occur when a process requires code or data that is not in its working set or elsewhere in physical memory, and must be retrieved from disk.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

This value was designed as a primary indicator of the kinds of faults that cause system-wide delays. It includes pages retrieved to satisfy faults in the file system cache (usually requested by applications) and in non-cached mapped memory files. This counter counts numbers of pages, and can be compared to other counts of pages, such as Memory: Page Faults/sec, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

P

AGES

O

UTPUT

/S

EC

This metric is the number of pages written to disk to free up space in physical memory. Pages are written back to disk only if they are changed in physical memory. A high rate of pages output might indicate a memory shortage.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Windows NT writes more pages back to disk to free up space when low in physical memory. This counter counts numbers of pages, and can be compared to other counts of pages, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

14 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

M

EMORY

A

VAILABLE

The Memory Available section of the OS Detail page succinctly communicates the general overall performance levels of the server's memory. The statistics available in this section depend on the platform of operating system. The table below describes these statistics:

Statistic

Physical

Memory

Description

The Physical Memory statistic is the amount of committed virtual memory, in megabytes.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk.

Metrics

This counter displays the last observed value only and not an average.

Physical The Physical statistic is the total physical memory available.

Paged Memory The Paged Memory statistic is the amount of committed virtual memory, in bytes. Used Memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive.

Swap Memory The Swap Memory statistic is the free, unreserved swap space.

N/A

This counter displays the last observed value only; it is not an average.

N/A

Swap

Correction

N/A

N/A

N/A

Increase the size of your swap file or add additional files if you consistently see a shortage of free, unreserved swap space.

N/A

Total Physical

Total Swap

Swap-ins

The Swap statistic is the total swap memory being used.

The Total Physical statistic is the total physical memory available.

The Total Swap statistic is the total swap memory available.

The number of memory pages paged in from swapspace.

N/A

N/A

N/A

N/A

N/A

N/A

Swap-outs

Buffers

The number of memory pages paged in from swapspace.

N/A

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes.

Increase the size of your swap file or add additional files.

If the system is consistently low on free memory (over a

30 second average), the memory scheduler will start to swap out processes.

Increase the size of your swap file or add additional files.

N/A The Buffers statistic represents the amount of buffers used by the kernel in kilobytes.

N/A

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1415

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

Statistic Description

Page Faults/Sec The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Metrics

This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction

If the number of page faults remains consistently high, you can check with your

Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

B

UFFER

S

IZE

The Buffer Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

C

ACHE

S

IZE

The Cache Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

P

AGE

R

EPLACEMENTS

The following statistics are available in this section:

Memory Freed (Pages/sec) Clock Algorithm Scans (Pages/sec)

M

EMORY

F

REED

(P

AGES

/

SEC

)

Freed or destroyed (Kb/s).

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

C

LOCK

A

LGORITHM

S

CANS

(P

AGES

/

SEC

)

The VMM uses a technique known as the clock algorithm to select pages to be replaced. This technique takes advantage of a referenced bit for each page as an indication of what pages have been recently used (referenced). When the page-stealer routine is called, it cycles through the PFT, examining each page's referenced bit.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

14 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

C

ACHE

E

FFICIENCY

The Cache Efficiency section of the Memory tab succinctly communicates the general overall performance levels of the server's memory. The following statistics are available in this section:

Copy Read Hits %

Pin Read Hits %

Data Map Hits % MDL Read Hits %

C

OPY

R

EAD

H

ITS

%

The Copy Read Hits % statistic is the percentage of cache copy read requests that hit the cache and does not require a disk read to provide access to the page in the cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

When the page is pinned in the memory, the page's physical address in the file system cache will not be altered. A copy read is a file read operation where a page in the cache is copied to the application's buffer. Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate

D

ATA

M

AP

H

ITS

%

The Data Map Hits % statistic is the percentage of data maps in the file system cache that could be resolved without having to retrieve a page from the disk.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

MDL R

EAD

H

ITS

%

The MDL Read Hits % statistic is the percentage of Memory Descriptor List Read requests to the file system cache that hit the cache and does not require disk access to provide memory access to the pages in the cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1417

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

P

IN

R

EAD

H

ITS

%

The Pin Read Hits % statistic is the percentage of pin read requests that hit the file system cache and does not require a disk read in order to provide access to the page in the file system cache.

Location

Metrics

Sybase ASE Performance Analyst Statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction

Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

S

PACE

T

AB

The Space tab of the OS Detail page includes the following sections:

Device Summary Device Detail

D

ISK

S

PACE

F

REE

The Disk Space Free metric displays the amount of free disk space in megabytes.

D

ISK

S

PACE

D

ETAIL

The Disk Space Detail section of the Space tab succinctly communicates the general overall performance levels of the server’s disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Space Tab

14 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

D

EVICE

S

UMMARY

The Device Summary section of the Space tab displays a bar chart for all devices. The Device

Summary section succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Used

Free

Description

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/device.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Space Tab

D

EVICE

D

ETAIL

The Device Detail section of the Space tab succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Space Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1419

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

N

ETWORK

T

AB

The Network tab of the OS Detail page succinctly communicates the general overall performance levels of the server's networking. The Network tab of the OS Detail page includes the following sections:

Network Details

Packet Errors

Transmission Queue Length

Packet Collisions

Transmission Rate

Packet Discards

Transmission Rate (Bytes)

NOTE:

The sections available on this tab depend on the platform of operating system.

N

ETWORK

D

ETAILS

The statistics available in this section depend on the platform of operating system. The table below describes the information available in this section:

Column

Network Interface

INET Address/

Address

Pkts Sent/Sec

Pkts Received/Sec

Sent (KB/Sec)

Received (KB/Sec)

Out Pkts Discarded

In Pkts Discarded

Out Pkt Errors

In Pkt Errors

Queue Length

Collisions

Packets Discarded

Description

The name of network interface.

The IP address assigned to the network interface.

The number of packets sent per second.

The number of packets received per second.

The number of bytes sent per second.

The number of bytes received per second.

The number of outbound packets discarded.

The number of inbound packets discarded.

The number of outbound packet errors.

The number of inbound packet errors.

The queue length.

The number of collisions.

The number of packets discarded.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

T

RANSMISSION

R

ATE

The Transmission Rate section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Packets Received/Sec Packets Sent/Sec

14 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

P

ACKETS

S

ENT

/S

EC

The Packets Sent/Sec statistic is the number of packets sent over each network adapter per second.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

P

ACKETS

R

ECEIVED

/S

EC

The Packets Received/Sec statistic is the number of packets received over each network adapter per second.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

T

RANSMISSION

R

ATE

(B

YTES

)

The Transmission Rate (Bytes) section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Received (KB/Sec) Sent (KB/Sec)

S

ENT

(KB/S

EC

)

The Sent (KB/Sec) statistic is the rate at which bytes are sent over each network adapter including framing characters.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

R

ECEIVED

(KB/S

EC

)

The Received (KB/Sec) statistic is the rate at which bytes are received over each network adapter, including framing characters.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

T

RANSMISSION

Q

UEUE

L

ENGTH

The number of pending outgoing packets on either the software transmit queue or the hardware transmit queue

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1421

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

P

ACKET

C

OLLISIONS

A collision occurs when two devices on the network sense that the network is idle and end up trying to send data at the same time. Some collisions are normal on a repeated network, but excess collisions can cause serious performance problems.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

Correction Contact your network administrator if there is high rate of persistent Packet Collisions.

P

ACKET

D

ISCARDS

The Packet Discards section of the Network tab succinctly communicates the packet discard rate. The following statistics are available in this section:

Inbound Packets Discarded Outbound Packets Discarded Packet Discards

O

UTBOUND

P

ACKETS

D

ISCARDED

The Outbound Packets Discarded statistic is the number of outbound packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

I

NBOUND

P

ACKETS

D

ISCARDED

Received Packets Discarded is the number of received packets that were discarded even though no errors had been detected to prevent from being transmitted.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

P

ACKET

D

ISCARDS

The Packet Discards statistic represents the number of network packets discarded.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

Correction Contact your network administrator if there is high rate of persistent packet discards.

P

ACKET

E

RRORS

The Packet Errors section of the Network tab succinctly communicates the packet error rate. The following statistics are available in this section:

Inbound Packet Errors Outbound Packet Errors

14 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SY B A SE A SE P E R FOR M A N C E A N AL Y S T ST A T IS TI C S > S Y B A SE AS E PE R F OR M A N C E A N A L Y ST S T AT I ST I C S

O

UTBOUND

P

ACKET

E

RRORS

The Outbound Packet Errors statistic is the outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

I

NBOUND

P

ACKET

E

RRORS

The Packets Received Errors statistic is the received packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Location

Sybase ASE Performance Analyst Statistics

> OS

> Network Tab

T

OP

SQL S

TATISTICS

A lot of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements or stored procedures can drag an otherwise well-configured database down in terms of user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

'bad SQL' is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional's satisfaction. The Top SQL results grid displays the top SQL statements across various performance categories.

The SQL Details tab of the Top SQL view presents information as follows:

Active SQL Results Selected SQL Text

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you need to answer:

• What has been the worst SQL that’s historically been run in my database?

• What is the worst SQL that’s running right now in my database?

When Correction a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1423

SY B A S E A SE P E R FO R M A N C E A N A LY S T ST A T IS T IC S > S Y B A S E A S E P E R F O R M A N C E A N A L Y S T S T A T I ST I C S

A

CTIVE

SQL R

ESULTS

The Active SQL results section displays the following information in grid format:

SQL Text: A snippet of the full SQL statement. Clicking on the statement will cause the full statement to be presented in the Selected SQL Text grid.

Database: The name of the database.

SPID: The process ID.

CpuTime: The accumulated CPU time for the statement.

Wait Time: The time the process has been waiting to be serviced, in milliseconds. A value of zero indicates there was no waiting.

Memory Usage (KB): The number of pages in the procedure cache that is currently allocated to the process. A negative number indicates that pages are being released (freed) from the process.

Physical Reads: The current cumulative number of physical disk reads issued by the process.

Logical Reads: The current cumulative number logical reads issued by the process.

Pages Modified: The number of pages that were modified by the process.

Packets Received

Packets Sent

Start Time: The date/time when the statement was first executed.

Batch ID

S

ELECTED

SQL T

EXT

In this section of SQL details, you see the fully expanded SQL statement that you highlighted in the Active SQL Results grid. By clicking Explain SQL you open the Explain Plan with its ISQL window.

14 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

P

ERFORMANCE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX AND

W

INDOWS

T

UTORIAL

Embarcadero Performance Analyst provides key insight into the complex world of database performance. Running inside the Embarcadero DBArtisan console, or standalone in a Web browser, Performance Analyst helps you pinpoint performance problems that threaten a database’s availability or response times. The powerful analysis facilities will satisfy advanced experts, yet novices will find Performance Analyst’s interface easy to use and the expert help a welcome aid to troubleshooting difficult performance issues.

About This Performance Analyst for IBM DB2 Tutorial

This tutorial is intended to help you get started with Embarcadero Performance Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Performance Analyst. You will have learned how to accurately monitor your database using the most popular performance methodologies in use today. You will know how to drill down into the many layers of database performance and also be able to locate performance issues in your database in a fast and effective manner. Finally, you’ll understand how to fix performance problems using the integration that exists between Performance Analyst and Embarcadero DBArtisan.

This tutorial is divided into 8 sections.

Session 1: Getting Started With Performance Analyst for DB2

Session 2: Using Ratio-based Performance

Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for DB2

Session 4: Using Workload Performance Analysis

Session 5: Using SQL Performance Analysis

Session 6: Using Operating System Performance Analysis

Session 7: Identifying and Getting Help With Performance Problems

Session 8: Fixing Performance Problems Using Performance Analyst for DB2

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

For more information, see Additional Evaluation Resources .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1425

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

S

ESSION

1: G

ETTING

S

TARTED

W

ITH

P

ERFORMANCE

A

NALYST FOR

DB2

Download and Install

You can obtain the latest version of Performance Analyst by downloading the DBArtisan software from the Embarcadero Web site at http://www.embarcadero.com/downloads/ downloaddbartisan.asp

. Performance Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Performance Analyst (although Performance Analyst can also run in standalone fashion within a Microsoft Internet Explorer Web browser).

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Overview for Performance Analyst for DB2

O

VERVIEW FOR

P

ERFORMANCE

A

NALYST FOR

DB2

When DBArtisan is connected to an DB2 database, you can open Performance Analyst two ways:

1 On the toolbar, click the Performance Analyst icon.

2 On Utilities menu, select Performance Analyst.

DBArtisan opens Performance Analyst.

DB2 requires that certain monitor switches be turned on for collecting various performance metrics. When Performance Analyst is first invoked, you will be prompted to turn on the monitor switches. Also, you can increase or decrease the size of the monitor heap depending on the activity of your database.

If you do not want to see this dialog each time you start Performance Analyst, you can check the

"Save these settings as default" check box.

Proceed to

Product Navigation

P

RODUCT

N

AVIGATION

Navigating through Performance Analyst is easily accomplished through two main mechanisms:

1 The main Performance Analyst toolbar contains buttons and drop-down menus that invoke the performance analysis main views and drill-downs within the product as well as frequently used actions like Refresh and Performance Threshold Customizations.

2 Positioning the mouse pointer on any area within Performance Analyst and right-clicking brings up a navigation menu that allows you to easily move between any of the main

Performance Analyst home pages and drill-down views. The right mouse menu also contains context-sensitive options like drilling down further into a particular statistic, copying the display to a text file, and more.

14 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

Proceed to

Session 2: Using Ratio-based Performance

S

ESSION

2: U

SING

R

ATIO

-

BASED

P

ERFORMANCE

Ratio-based analysis has been around for many years, and used to be the only technique database administrators used when they were called on to diagnose the cause of a database slowdown. Performance ratios are very good roll-up mechanisms for busy DBAs, making possible the analysis-at-a-glance approach, however ratios must be computed correctly for them to be meaningful. Key ratios in Performance Analyst are calculated using delta statistics, which is superior to computing ratios with cumulative values. Delta statistics, which are values derived by using the before and after measures in each statistical refresh done in Performance Analyst, lets you see changes in performance metrics that would otherwise be invisible if cumulative statistics were used. Performance Analyst makes it easy to see the ratios that are computed with delta statistics vs. cumulative. A triangle symbol denotes a delta-based statistic, while square symbols represent a cumulative-based measure.

Ratio-based analysis is available for all performance categories (memory, etc.) where ratios can assist in determining the performance level of a database. For example, if you would like to see memory-specific ratios, on the Performance Analyst toolbar click Memory. Performance Analyst displays the Memory home page that showcases all important memory-related ratios.

Proceed to

Obtaining Detail Information for a Ratio Using Performance Analyst for DB2

O

BTAINING

D

ETAIL

I

NFORMATION FOR A

R

ATIO

U

SING

P

ERFORMANCE

A

NALYST

FOR

DB2

A ratio gives you a global picture for a particular performance measure. However, you often need more information regarding a statistical measure so you can make an informed decision.

Performance Analyst has easy-to-use drill down features that make obtaining detailed information for various ratios a breeze.

For example, to view more information for the Buffer Cache Hit Ratio statistic, do the following:

1 On either the main Home page or the I/O home page, locate the Buffer Pool Hit Ratio statistic.

2 Position the pointer over the statistic.

The pointer changes to a hand symbol.

3 Double-click the left mouse button.

Performance Analyst opens the Buffer Cache Tab of the memory drill down view.

4 Or right-click the statistic, select Details or Navigate to… > I/O > Buffer Pool.

Once either of these actions has been taken, you will be taken to a drill-down view that provides more information on the DB2 buffer pools.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1427

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

Proceed to Session 3: Using Bottleneck/wait-based Performance Analysis in Performance Analyst for DB2

S

ESSION

3: U

SING

B

OTTLENECK

/

WAIT

-

BASED

P

ERFORMANCE

A

NALYSIS

IN

P

ERFORMANCE

A

NALYST FOR

DB2

When a DB2 database is up and running, every connected process is either busy doing work or waiting to perform work. A process that is waiting may mean nothing in the overall scheme of things, or it can be an indicator that a database bottleneck exists. Bottleneck analysis is a valid method of measuring performance because it helps you track where a database and user sessions have been spending their time. If lock contentions or heavy table-scan activity has been dragging a database’s performance down, you can use bottleneck analysis to confirm the actual root cause.

Performance Analyst uses several key areas of DB2 metrics to form its bottleneck analysis. These areas are usually the main sources of performance drag on the databases.

Performance Analyst prominently displays bottleneck analysis on every performance home page. On the main home page, you will see a summary of all key bottlenecks threatening the database. You can also see specific bottlenecks for memory, I/O, space, objects, and users by navigating to each home page and viewing the Bottleneck Analysis section for that home page.

For example, to see bottlenecks that specifically relate to user applications, follow these steps:

1 Click the Users Performance Analyst toolbar button

2 Locate the Bottleneck Analysis section at the lower-left portion of the screen

The Users Bottleneck Analysis section shows the top bottlenecked applications, concurrency issues, and bottleneck activity count.

Proceed to

Obtaining Detail on System Bottlenecks

O

BTAINING

D

ETAIL ON

S

YSTEM

B

OTTLENECKS

You can easily obtain more information regarding global bottlenecks that are plaguing a database by drilling down into a particular bottleneck metric. For example, if you would like to see more data regarding the current top concurrency bottlenecks, do the following:

1 Open the Performance Analyst main Home page.

2 Double-click the Concurrency area in the Bottlenecks section to be taken to the Lock Waits drill-down section.

Performance Analyst opens the System Waits view.

3 Or right-click anywhere in Performance Analyst, point to Users, and then click Lock Waits.

Performance Analyst opens the System Waits view.

14 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

The Lock Waits view displays critical details regarding all the lock wait events that DB2 has recorded. You can easily see what applications are waiting on locks and the average lock wait times for all applications.

NOTE:

If you would like to see an expanded view of the Lock Waits grid shown on the top of the Lock Waits view, click the Expand button located at the top right corner of the section. All section views in Performance Analyst can be maximized/minimized using this control.

Proceed to

Viewing Detail for Application Bottlenecks

V

IEWING

D

ETAIL FOR

A

PPLICATION

B

OTTLENECKS

Not only can you obtain detail information for system bottlenecks, but you can also use

Performance Analyst to get drill-down information regarding the locks held by and waited on by applications.

To see more information regarding application locks, do the following:

1 Open the Performance Analyst main Home page.

2 Double-click the Concurrency Bottlenecks area to be taken to the Lock Waits drill-down view.

Performance Analyst opens the Lock Waits tab.

3 Or right-click anywhere in Performance Analyst, point to Users, and then click Locks.

Once on the Locks drill-down view, you can view the details for locks held and waited on by an application details by following these steps:

1 Examine the Application Details grid

2 Select an application that appears to be experiencing lock waits problem

You will see details on the locks held by, and the locks waited on, by the selected application.

You can get further details on the application that is holding the locks by navigating to the

Attributes drill-down and selecting the appropriate Application ID.

Proceed to

Session 4: Using Workload Performance Analysis

S

ESSION

4: U

SING

W

ORKLOAD

P

ERFORMANCE

A

NALYSIS

Key ratios give you a global perspective on database activity. Bottleneck analysis gives you insight into things that are holding up user activity and throughput. But another technique is necessary if a database professional is to really get a handle on what’s occurring inside a badly performing database.

Workload analysis involves the investigation of two critical areas of a database’s performance:

• Application resource consumption and activity

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1429

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

• SQL execution

Without looking at these two key performance categories, you can miss a lot of what could be responsible for perceived performance problems. When performance on a database takes a sudden nosedive, it is not uncommon to find one or two sessions that are causing the bulk of the workload. Finding these processes can be easily accomplished by viewing session metadata coupled with resource consumption and statistical execution statistics.

Proceed to

Pinpointing Top Resource Consumers

P

INPOINTING

T

OP

R

ESOURCE

C

ONSUMERS

Performance Analyst identifies top resource consumers in a couple of different ways. On the main home page, Performance Analyst highlights the top resource consumers across lock usage,

CPU usage, and I/O usage. The percentage used across all statistical categories are displayed so a DBA can immediately pinpoint a session that is using all or most of a particular resource. The top resource sessions are also displayed on the memory, I/O, and other home pages as well with a listing for the top sessions for that category (for example, the top IO consumers appear on the

I/O home page, etc.).

Proceed to

Getting Workload Details Using Performance Analyst for DB2

G

ETTING

W

ORKLOAD

D

ETAILS

U

SING

P

ERFORMANCE

A

NALYST FOR

DB2

Performance Analyst offers several details on top resource applications in addition to the summaries provided on each home page. A detailed and flexible top applications view lets you view a summary of all the major resource applications on the database as well as every critical detail regarding each application connected to the database.

Further drill-downs are available that highlights specific details regarding each application’s activities and submitted SQL. To see detailed information regarding an application identified in one of Performance Analyst’s Workload Analysis sections, do the following:

1 In a Workload Analysis display, position the pointer over one of the processes.

2 Double-click the process or right-click, and then select Details.

If you want like to see all key workload analysis metadata for sessions, do the following:

1 On the toolbar, click the Top Sessions button.

2 Or right-click anywhere in Performance Analyst, point to Users, and then click Top Sessions.

Proceed to

Session 5: Using SQL Performance Analysis

14 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

S

ESSION

5: U

SING

SQL P

ERFORMANCE

A

NALYSIS

SQL-based performance analysis is really a subset of Workload Analysis. Understanding current and historical SQL execution patterns lets you to have the second set of data points necessary to properly perform workload analysis. You may find that optimizing SQL code produces some of the best performance-enhancing boosts available for a database.

Proceed to

Understanding SQL Activity

U

NDERSTANDING

SQL A

CTIVITY

Performance Analyst offers plenty of insight into SQL performance and execution patterns. Each one of the home pages depicts the current levels of SQL activity as determined by a variety of different metrics for that performance category. For example, Performance Analyst might show that rows reads account for

75% of all SQL statement I/O on the database

.

Proceed to

Getting Details on Top SQL

G

ETTING

D

ETAILS ON

T

OP

SQL

Getting details on identified SQL statements is easy in Performance Analyst. For example, if you would like to see further information on a SQL statement identified on the Performance Analyst

Home page, do the following:

1 In the SQL Analysis section, position the pointer over Hash Values.

2 Double-click or right-click, and then select Details.

Performance Analyst opens the Top SQL summary page that shows a breakdown of all top

SQL statements along with their execution statistics

If you would like to see the full SQL text of a SQL statement, do the following

1 In the Top SQL Details section, double-click a statement.

Performance Analyst opens the SQL Details Tab of the Top SQL view to display the entire

SQL statement and the execution metrics. While on this pane, you can also perform an

EXPLAIN of the SQL statement and examine its access path information.

NOTE:

To automatically tune a problem SQL statement if you have Embarcadero SQL Tuner installed on your workstation, do the following:

2 On the SQL Details Tab, select a problem statement, and then click the Tune SQL button.

SQL Tuner opens and you can begin a tuning session.

Proceed to

Session 6: Using Operating System Performance Analysis

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1431

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

S

ESSION

6: U

SING

O

PERATING

S

YSTEM

P

ERFORMANCE

A

NALYSIS

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O or Memory), a slow CPU, insufficient I/O devices, and insufficient memory. Performance Analyst allows you to examine the relevant operating system metrics for DB2.

To view the operating system metrics of the machine hosting the DB2 server you are monitoring, do the following:

1 Click the OS Performance Analyst toolbar button.

OR

2 Navigate to the OS Home Page by going to OS, and then Home.

NOTE:

The first time you invoke the OS feature you will be prompted for an operating system login. Please specify the correct operating system, host name, username and password, and protocol.

The Operating System home page has been designed in a similar fashion as the datasource home page. On this page you can see the pertinent operating system metrics displayed in five quadrants broken down into the following categories:

• Resource Usage

• Memory Analysis

• Disk Analysis

• Workload Analysis

• Bottleneck Analysis

Proceed to

Obtaining Details on the Operating System

O

BTAINING

D

ETAILS ON THE

O

PERATING

S

YSTEM

You can easily obtain more information regarding operating system problems that are degrading database performance by drilling down into a particular analysis quadrant. For example if you'd like to see more information regarding the processes running on the host machine, do the following:

1 Navigate to the Performance Analyst Operating System home page.

2 Double-click the Top Memory Process in the Workload Analysis quadrant.

Performance Analyst opens the Processes detail view.

OR

3 Right-click anywhere in Performance Analyst and select the Navigate to, OS, and then

Processes.

14 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

The Processes detail tab shows all the processes on the host machine. From this view you can easily determine which processes are showing high marks in I/O or CPU, for example, by simply double clicking on the column headers and sorting the processes in ascending or descending order.

Proceed to

Session 7: Identifying and Getting Help With Performance Problems

S

ESSION

7: I

DENTIFYING AND

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

You do not need to be an advanced expert in performance tuning to spot trouble in a database if you use Performance Analyst. There are a number of mechanisms in the tool that help you quickly locate areas of concern within a database.

Proceed to

Using the Alarm Log

U

SING THE

A

LARM

L

OG

Performance Analyst has a central and flexible alarm log that lists every performance violation found in all monitored databases. Unlike some products that only show you alarms for a particular database, Performance Analyst lists all alarms for each database you are monitoring in one central log so you can see every problem in one place. To view the Performance Analyst

Alarm log, do the following:

1 On the toolbar, click the Alarms button.

Once in the Alarm log, you can perform a number of actions including:

• Selecting an alarm and viewing the application page that shows details regarding the metric in violation.

• Filtering the types of alarms shown through the Options dialog.

• Clearing all current alarms.

• Copying or saving the Alarm log into a different format.

To select any of these options, do the following:

1 Position the pointer over any area of the Alarm Log.

2 In the shortcut menu, select an option.

Proceed to

Recognizing Performance Violations

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1433

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

R

ECOGNIZING

P

ERFORMANCE

V

IOLATIONS

Performance Analyst makes it easy to visually pinpoint performance violations in a database. Any statistic that does not conform to your predefined performance standards is colorized in any view that it appears so you can easily see potential troublespots.

The colors used to highlight a particular performance violation depend on the severity of the problem. Performance Analyst uses several layers of performance standards/threshold violations with each layer being represented by a different color. You can control everything regarding threshold violations, including how thresholds are determined, their color representation in

Performance Analyst’s display, and more by using the Threshold Template feature of

Performance Analyst.

How can Performance Analyst inform you of performance violations in your database if you minimize the product to your desktop and are working on other things? Even if Performance

Analyst isn’t right in front of you, it can still let you know that a problem has been found in your database through the systray alarm icon. When Performance Analyst detects a problem in one of your databases, one of the things the product does is enable an alarm icon in your workstation’s systray area that communicates the presence of alarms in your database. So even if the

Performance Analyst interface isn’t in sight, the product can let you know that something in your database requires attention.

Proceed to

Creating Threshold Templates

C

REATING

T

HRESHOLD

T

EMPLATES

How does Performance Analyst know what to signal as a problem in a database? It uses predefined performance standards that you define and enforce. All of this is accomplished by using Performance Analyst’s Threshold templates. A template is a set of performance metrics and their thresholds that can be reused to enforce performance standards across any number of databases. Embarcadero provides a default performance template that contains nearly all of the most-watched performance statistics so you can begin monitoring with confidence right out of the box. However, you can create your own Threshold templates so you only are alerted to performance violations that are important to you and your particular environment.

To view or create Threshold templates, do the following:

1 On the toolbar, click the Thresholds button.

Performance Analyst opens the Threshold maintenance dialog box.

The Threshold Template Properties dialog box lets you select the options to add or edit templates, as well as other maintenance options. For example, you can copy the original

Embarcadero Threshold template and modify it to fit your own needs. You can control what statistics are sampled for performance violations as well as the levels of severity you would like reported. Once you are satisfied with your template, you can save it and then apply it to one or more datasources in one action to immediately begin enforcing your performance standards.

Proceed to

Getting Help With Performance Problems

14 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

P E R F OR M A N C E AN A L Y ST FOR I B M D B 2 FOR L I N UX , U N I X A N D W I N D OW S TUT O RIA L > P E R F OR M A N C E

G

ETTING

H

ELP

W

ITH

P

ERFORMANCE

P

ROBLEMS

As databases become more complex, so do the problems that plague them. Knowing what to do for a particular performance problem can be hard in some cases, but Performance Analyst helps by providing a complete set of expert help that you can use as a guide when performance problems occur. To obtain expert help for any statistic shown in Performance Analyst, do the following:

1 Position the pointer over a statistic that you need help with.

2 Right-click and select Help.

The Expert Help gives you a general description of the statistic, the range of values that are considered optimal, and some suggestions on how to fix a problem situation. Expert help can also be invoked for any of the Ratio, Bottleneck, SQL, or Workload Analysis sections shown on every home page by clicking on the help icon for that section, which is located at the top right corner of the section.

Proceed to

Session 8: Fixing Performance Problems Using Performance Analyst for DB2

S

ESSION

8: F

IXING

P

ERFORMANCE

P

ROBLEMS

U

SING

P

ERFORMANCE

A

NALYST FOR

DB2

Finding performance problems is one thing, but fixing them is another. Many performance monitors point out a particular problem in a database, but then offer no way to actually correct the situation. Such is not the case with Performance Analyst. Because of its tight integration with

DBArtisan, certain problems found in Performance Analyst can be visually corrected by

DBArtisan.

If a DB2 tablespace is about to run out of free space, Performance Analyst can issue an alarm that a space shortage exists. Once the space problem has been identified, do the following:

1 On the Space home page toolbar, click the Space button.

2 In the Space Analyst grid, right-click a tablespace, and then select Manage with DBArtisan.

You will then be taken to DBArtisan’s Tablespace Editor where you can perform corrective actions, such as adding new containers to the tablespace, or resizing the tablespace’s existing container(s)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1435

P E R F O R M A N C E A N A L Y S T F O R I BM D B 2 F OR L I N U X , U N I X A N D W IN D O W S TUT O RIA L > P E R F O R M A N C E

14 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

IBM DB2 (W/U/L) P

ERFORMANCE

A

NALYST STATISTICS

This section includes expert help for all DB2 categories and statistics in the Embarcadero

Performance Analyst views and pages.This help is divided into the following sections:

Home

Space

Instance

Memory

Users

OS

I/O

Cfg (Database Configuration)

Top SQL

H

OME

The Embarcadero Performance Analyst Home view lets you review availability and overall performance of all monitored databases from a single window. Statistics on the Home view are organized into the following categories:

Key Ratio Analysis Pane

Storage Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

SQL Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use ratio-based or wait/bottleneck-based methods for examining the performance levels. Ratio-based analysis involves examining a number of key database ratios that indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the DB2 Snapshot Monitor. The snapshot monitor returns metrics for the Instance and particular databases since the start of monitoring.

Some metrics are cumulative (e.g., counters) and others are instantaneous (e.g., gauges).

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1437

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

The following ratios are used on the Performance Analyst Home page to succinctly communicate the general overall performance levels of the monitored database:

Package Cache Hit Ratio

Efficiency

Buffer Pool Hit Ratio

Shared Workspace Hit Ratio

Resource Utilization

Database Heap Utilization

Shared Sort Memory

Utilization

Catalog Cache Hit Ratio

Log Space Utilization Lock List Utilization

B

UFFER

P

OOL

H

IT

R

ATIO

The DB2 database server reads and updates all data from a bufferpool because memory access is much faster than disk access. Data is copied from disk to a bufferpool as needed by the applications using the database. When the server needs to read/write data and the data is already in the bufferpool, no disk access is required. However, if the data is not in the bufferpool, it needs to be read from the disk, which is significantly slower process.

The buffer pool hit ratio indicates the percentage of time that the database server did not need to load a page to service the request for a page. The calculation takes into account all the index and data pages that were requested.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

Avoiding disk I/O is the main issue when you try to improve the performance tuning. A high buffer pool hit ratio is desirable because it indicates a lower frequency of synchronous disk I/O. A database where data is accessed uniformly from very large tables will have a poor hit ratio. There is little you can do to improve the performance in such cases.

Correction The buffer pool hit ratio on the database Home page is the overall hit ratio of the database. First, drill down to the bufferpool level and check the individual buffer pool hit ratios to identify the elements that may require tuning. Increasing the bufferpool size generally improves the buffer pool hit ratio.

You can use one of the following methods to increase the bufferpool size depending on the layout of the data:

If the tablespaces using the bufferpool have tables and indexes on them, increase the bufferpool size incrementally until the index page hit ratio stops increasing for that bufferpool. You will not usually get any benefit increasing the bufferpool size after you reach that point.

If the tablespaces associated with the bufferpool have only indexes on them, increase the bufferpool size until the index page hit ratio stops increasing.

If the tablespaces associated with the bufferpool have only data on them, increase the bufferpool size until the data page hit ratio stops increasing.

One general design guideline is to try and use different tablespaces for indexes and tables and associate different bufferpools with them. This generally improves performance and makes bufferpool tuning much easier.

C

ATALOG

C

ACHE

H

IT

R

ATIO

Catalog cache is used to cache the following types of catalog information:

• Metadata for tables, views, and aliases.

14 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Database authorization information that is used to check authorization when performing operations like CONNECT, LOAD, CREATE, BIND, and so on.

• Execute privileges for user-defined functions and stored procedures.

When a database operation accesses catalog information, it inserts this information into the catalog cache so operations accessing the same information can read it from the cache and avoid disk reads. The catalog cache hit ratio indicates how well the catalog cache avoids accesses to the catalog.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

>

Caches Tab

A high catalog cache hit ratio (> 80%) indicates that the catalog cache is working well. A smaller ratio can indicate that this parameter needs tuning. You may see a smaller ratio immediately following the first connection to the database and execution of DDL/DCL statements since these require heavy catalog accesses.

Correction If the catalog cache hit ratio is consistently small, increase the database configuration parameter

catalogcache_sz. When you increase this value, pause to consider whether it would be more effective to allocate the extra memory you are reserving to another purpose such as package cache or bufferpools.

In a partitioned database environment, make the catalogcache_sz larger on the catalog partition than on other partitions because the catalog information required for all partitions will go through this partition.

When tuning this parameter, it is advisable to monitor changes to the database catalog via DDL statements. During the execution of DDL statements, there may be a large drop in the catalog cache hit ratio due to invalidation of the cached data.

P

ACKAGE

C

ACHE

H

IT

R

ATIO

Embarcadero DBArtisan’s Database Manager caches the sections for frequently used dynamic and static SQL statements in the package cache. The package cache hit ratio indicates how well the package cache is avoiding catalog accesses to packages and recompilations.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

A high package cache hit ratio (> 80%) indicates that the package cache is working well. In the case of static SQL statements, package caching allows the Database Manager to reduce the internal overhead by eliminating the need to access system catalogs when reloading a package. For dynamic SQL, the benefit of package caching is even greater since it a cache hit eliminates the need for recompilation.

The package cache hit ratio metric is particularly important for transaction-processing applications since a typical workload involves repeatedly executing the same SQL statements.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1439

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction Executing DDL statements can invalidate sections of SQL statements in the cache, causing the hit ratio to decrease dramatically. Before attempting to tune this parameter, you should check the DDL activity to see if that is causing a skew. No amount of tuning will improve the package cache performance if the DDL activity is causing package invalidations in the cache.

If the DDL activity is minimal and package cache hit ratio is consistently small, consider increasing the package cache size (pckcachesz) in the database configuration. When increasing the value of this parameter, consider whether it might be more effective to allocate the extra memory being reserved to another purpose such as catalog cache or bufferpools.

S

HARED

W

ORKSPACE

H

IT

R

ATIO

When sections are required by an application for executing dynamic or static SQL statements, they are placed in the shared workspace. The shared workspace exists at the application level and is shared among applications using the database. The hit ratio is a percentage indicating how well the shared SQL workspace is helping to avoid initialization of sections for SQL statements that are about to be executed. A high ratio indicates the shared workspace is successful in avoiding this action.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

>

Caches Tab

A shared workspace is shared by many applications. If applications have similar database access patterns, they can benefit greatly if they find required sections in the shared workspace. If an application finds a section in the shared workspace (e.g., a hit), that application avoids setup and initialization cost for that section. A high hit ratio is desirable for this metric. Typically, you should expect to see a high ratio (>80%) in transaction processing environments.

Correction Shared workspace memory is allocated from the application control heap (app_ctl_heap_sz database configuration parameter) and increasing this may improve the hit ratio.

D

ATABASE

H

EAP

U

TILIZATION

There is one database heap per database, and the database manager uses it on behalf of all applications connected to the database. The database heap utilization is the percentage of database heap that is currently being used.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

Metrics The database heap contains control block information for tables, indexes, table spaces, and bufferpools. It also contains space for event monitor buffers, the log buffer, and temporary memory used by utilities. Tthe heap utilization can increase or decrease whenever any of the constituent elements change. If the utilization goes above 85% several times or stays above 85% for a sustained period, you may need to increase the maximum database heap size.

Correction The dbheap database configuration parameter determines the maximum amount of heap memory that can be allocated. Examine the individual memory pools and how they are using the memory before increasing this parameter. An excessively large use of one of the memory pools may be the cause of this problem.

NOTE:

On the main toolbar, click Memory and then Memory Pools to see the Memory Pools

Details.

14 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

L

OG

S

PACE

U

TILIZATION

Log space utilization is the percentage of total available log space on the database that is currently being used.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

Metrics Very high log space utilization (>75%) can indicate that the database might run out of log space soon.

Usually, consistently high log space utilization has one of the following causes:

Large transaction size. Applications are performing large numbers of updates on the database but are not committing the transactions frequently.

The log space configured for the database is insufficient for the level of database activity

Very low log space utilization (< 5) %may indicate an excessively large log file and that you may be able to free some of the space occupied by log files on disk.

Correction If the log utilization is mostly low but increases to near 100% for short periods, then you can increase the number of secondary log files (logsecond database configuration parameter). This allocates and deallocates additional log files as needed. If however, the log size is consistently high and changes frequently, you can increase the primary log size and/or the log file size (logfilsiz and logprimary database configuration parameters).

Also, check the SQL activity on the SQL Activity tab of the Users Detail section to see if any applications are performing infrequent commits. If this is the case, evaluate whether such applications can be changed to have shorter transactions and hence less need for log space.

L

OCK

L

IST

U

TILIZATION

Lock list utilization is the percentage of total database memory allocated for locks that is currently being used.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Lock Memory Tab

There is only one lock list for each database and it contains the locks held by all applications connected to the database. Once the lock list is full, the database manager starts escalating row locks to table locks to free up space. This escalation may result in serious performance degradation because of reduced concurrency. Additionally, the number of deadlocks and transaction rollbacks may go up. If this metric reaches the 75% mark, you should consider bringing this percentage down with tuning.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1441

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction Depending on the database’s activity level, you may be able to reduce the lock utilization by following these recommendations:

Increase size of lock list: If there is not enough lock list space available, lock escalations will occur, increasing contention and reducing concurrency. Update the locklist database configuration parameter to increase this value.

Tune applications to reduce locking: On the Locks tab of the Users detail section, identify the applications that are holding many locks and then consider the following steps for controlling the size of the lock list:

Make the transactions shorter by increasing the COMMIT frequency. This ensures that locks are released frequently, thus freeing up lock space.

Before you update many rows in a single table, lock the entire table (using the SQL LOCK TABLE statement). This prevents many row-level locks from being obtained (although this decreases concurrency)

To control how locking is done for a specific table, use the LOCKSIZE parameter of the ALTER TABLE.

To decrease the number of share locks held, use the Cursor Stability isolation level when possible. If the applications’ integrity requirements are not compromised, use Uncommitted Read instead of

Cursor Stability to further decrease the amount of locking.

Decrease percentage of lock list: If a small number of applications are consuming most of the lock space, decrease the percentage of lock list for each application. You can throttle back those applications by decreasing the maxlocks database configuration parameter. This reduces the amount of lock list memory available to each application thereby allowing for better distribution of lock list memory.

NOTE: Decreasing the percentage of lock list should be a last resort, used only if you cannot decrease utilization with the other recommendations. It can cause a large number of lock escalations.

S

HARED

S

ORT

M

EMORY

U

TILIZATION

The amount of memory allocated for each sort may be some or all of the available sort heap size. Sort heap size is the amount of memory available for each sort as defined in the database configuration parameter sortheap. Shared sort memory utilization gives the percentage of the sort heap being used. It is possible for a single application to have concurrent sorts active. For example, in some cases a SELECT statement with a subquery can cause concurrent sorts.

Location

Metrics

Correction

IBM DB2 (W/U/L) Performance Analyst statistics > Home > Key Ratio Analysis Pane

Memory estimates do not usually include sort heap space. If excessive sorting is occurring, the extra memory used for the sort heap should be added to the base memory requirements for running the database manager. Generally, the larger the sort heap, the more efficient the sort.

Typically the shared sort utilization should be less than or equal to 70%. You should consider tuning the database if you see a utilization value greater than this.

To bring the sort heap utilization to an acceptable level, use the following guidelines:

Examine the queries you are running on the database to see if you can add indexes to columns frequently accessed in the WHERE clause. This minimizes the use of the sort heap.

If you are using dynamic bitmaps or hash join buffers in your queries, or your queries frequently require large sorts, increase the sortheap size.

If you adjust the sortheap size, also look at the sheapthres database manager configuration parameter to see if it too needs to be adjusted

If you are adjusting the sortheap size, you may also benefit from rebinding your packages since the optimizer takes this parameter into account when determining the access paths.

14 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

B

OTTLENECK

A

NALYSIS

P

ANE

When a DB2 database is active, applications accessing the database can either successfully access the database resources, or wait for resources to become available. Waiting applications can indicate normal database activity, or can indicate that a database bottleneck exists. A database administrator can use wait-based or bottleneck performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Performance Analyst Bottleneck analysis section helps a DBA isolate potential problem areas where there are waits, resource overloads or potential failures. If concurrency issues or heavy table scan activity is impacting database performance, you can use bottleneck analysis to isolate the root cause. Once one or more bottlenecks have been isolated as possible areas of interest, you can drill down and examine details on why the applications or resources are causing the problem. The Performance Analyst home page identifies the top system and application bottlenecks that may be currently a cause of lessened performance.

The following bottleneck indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Concurrency

I/O Activity

Object Bottlenecks

Sorts and Joins

Storage Bottlenecks

Apps Waiting on Locks

Lock Escalations

Avg. Lock Wait Time

Lock Timeouts

Log Pages I/O Synchronous I/O

Accesses to Overflowed Records Page Reorganizations

Deadlocks Detected

Hash Join Overflows

Sort Overflows

DMS Tablespaces Low on Space Inaccessible Containers

Node with Smallest Log

Tablespaces in Abnormal State

A

PPS

W

AITING ON

L

OCKS

This metric gives the percentage of all currently connected applications that are waiting for locks.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

If this number is high, you should investigate whether the applications are having concurrency problems.

Correction Compare this metric with the lock escalations metric to identify if the lock list memory is too small.

Go to the Locks Waiting Details section of the Locks tab of the Users detail view and examine the lock activity at application level to identify the applications that are holding a large number of row locks and table-level locks. You may be able to tune the applications with high number of locks.

A

VG

. L

OCK

W

AIT

T

IME

The average lock wait time metric gives the average amount of time applications waited for a lock in the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Lock Waits tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1443

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Metrics This metric gives an overview of the concurrency performance of the database. If this value is too high, it may mean that either too many applications are vying for the same resources or that applications are executing long transactions that make other applications wait longer. You should examine this metric over a period of time to determine the normal operational state of the database.

Correction As a first step, examine the lock activity at the application level to identify if any particular application is causing excessive lock contentions.

If you see a high value, consider tuning the application to provide better concurrency. If lock timeouts are excessive, and average lock wait times are very short, you can increase the locktimeout database configuration parameter to make the applications wait longer before timing out.

NOTE: You can find the lock activity in the Applications Waiting on Locks section of the Lock Waits tab of the User detail page.

D

EADLOCKS

D

ETECTED

Deadlocks detected is the total number of deadlocks that have occurred since this instance of Performance Analyst started monitoring the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

If a large number of deadlocks are detected, it can indicate that applications are experiencing lock contention problems. Deadlocks are usually caused by one of the following situations:

Lock escalations on the database

Catalog tables locked for Repeatable Read

Applications are using inappropriate isolation levels at bind time

Applications are obtaining the same locks in a different order

Applications are locking tables explicitly where row level locks are sufficient.

Correction You may be able to modify the applications causing lock contentions for better concurrency. To identify the applications that may be causing contentions, go to the Lock Waits tab of the Users detail page and review the Application Details section.

L

OCK

E

SCALATIONS

The lock escalations metric indicates the number of times that locks have been escalated from row locks to table locks, since this instance of Performance Analyst started monitoring the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Bottleneck Analysis Pane

A lock is escalated when the total number of locks held by an application reaches the maximum amount it is allowed in the lock list memory. There are several possible causes of lock escalations:

The database lock list size is too small for the concurrent workload

The maximum percentage of lock list memory allowed for each application is too small

One or more applications are obtaining an excessive number of locks

Monitor the lock escalations over a period of time to determine what levels are acceptable in your environment. If the escalations are excessive, or are accompanied by deadlocks or long lock waits, consider tuning the database.

14 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Correction Examine the locklist database configuration parameter together with the

Lock List Utilization

metric to see if the locklist size needs to be increased. If the lock list utilization is within acceptable range, try raising the maxlocks database configuration parameter to increase the percentage of lock list space available to each application.

You should also examine the detailed lock usage for each application on the Locks tab of the Users detail page to see if applications are holding a high number of locks. In this case, tune your application for better concurrency.

L

OCK

T

IMEOUTS

This metric identifies the number of times that a request to lock an object timed out without being granted.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

Metrics If the number of lock timeouts becomes excessive when compared to the acceptable range for your database, it can indicate that an application is holding locks for long durations. It can also indicate that the amount of time an application waits for a lock before timing out is too short. If you have too few lock timeouts and the average lock wait time is too high, it can indicate that the lock timeout configuration parameter is set to an excessively high value.

Correction First you should examine the lock activity at the application level to identify any particular application that is causing excessive lock contentions. If so, you can tune the application to provide better concurrency. If lock timeouts are excessive, and average lock wait times are very short, you can increase the locktimeout database configuration parameter to make the applications wait longer before timing out.

L

OG

P

AGES

I/O

The log pages I/O statistic is the total number of pages that are read and written to the disk by the database logger.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

You can use this element with an operating system monitor to get a bird's eye view of the amount of I/

O on a device that is attributable to database activity.

S

YNCHRONOUS

I/O

This metric presents the number of I/O operations that had to be performed synchronously by the database agents.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

DB2 read and write operations are always performed through bufferpools. If the page being read or written is not present in the bufferpool, it is first read into the bufferpool and then the I/O operation is performed on it. DB2 pre-fetchers fetch the data page into the bufferpool asynchronously in anticipation of a read/write operation. If the page is not available at the time of I/O, the database manager agent has to perform synchronous I/O. Synchronous I/O can decrease responsiveness of a database, and if the database tablespaces are spread across multiple physical devices you may be able to reduce the number of synchronous operations by tuning the database configuration.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1445

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction You can set the num_ioserver database configuration parameter to 1-2 more than the number of physical storage devices used by the database to ensure that parallel I/O is occurring. To minimize synchronous I/O, you may also need to layout your tablespaces such that the containers are defined on different physical devices.

A

CCESSES TO

O

VERFLOWED

R

ECORDS

This metric is the number of accesses (reads and writes) to overflowed rows in the database tables.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

A row overflows if it is updated and no longer fits in the data page where it was originally written. This usually happens as a result of an update of a VARCHAR or an ALTER TABLE statement. Overflowed rows indicate that data fragmentation has occurred. If this number is high, you can try to improve performance by reorganizing the tables using the Space Analyst.

P

AGE

R

EORGANIZATIONS

The page reorganization statistic is the number of page reorganizations executed in the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

Too many page reorganizations can result in less than optimal insert performance. You can use the

Space Analyst to reorganize tables and eliminate fragmentation. You can also use the APPEND parameter for the ALTER TABLE statement to indicate that all inserts are appended at the end of a table and so avoid page reorganizations. In situations where updates to rows cause the row length to increase, the page may have enough space to accommodate the new row, but a page reorganization can be required to defragment that space. Or if the page does not have enough space for the new larger row, an overflow record is created that causes overflow_accesses during reads. You can avoid both situations by using fixed length columns instead of varying length columns.

H

ASH

J

OIN

O

VERFLOWS

Hash join is an option for the DB2 optimizer. A hash join compares the hash codes before comparing the predicates for tables involved in a join. This reduces the number of comparisons.

The hash join overflows metric gives the percentage of all hash join operations that ran out of sort heap and may have required disk space for temporary storage since the current instance of

Performance Analyst started monitoring the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

Metrics An overflowing hash join incurs a large overhead because of the amount of disk I/O required to complete the operation. If this value crosses the 30% mark, the DBA should take action.

Correction Increase the sortheap database configuration parameter to reduce the number of overflows.

14 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

S

ORT

O

VERFLOWS

The sort overflows statistic is the total number of sorts that ran out of sort heap and that may have required disk space for temporary storage.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Bottleneck Analysis Pane

Metrics When a sort overflows, additional overhead is incurred. The sort requires a merge phase and can potentially require more I/O if data needs to be written to disk.

Correction Sort overflows can be reduced by increasing the sortheap database configuration parameter.

DMS T

ABLESPACES

L

OW ON

S

PACE

The DMS Tablespaces Low on Space metric gives the number of DMS tablespaces in the database where more than 90% of the total available space is in use.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

This metric is an indicator that some of the tablespaces in your database may be running out of space.

You should drill down to the Space metrics to identify the tablespaces that may be at the critical utilization level. In tablespaces where there are little on no inserts after the initial data is loaded, little or no free space may have been left on purpose. In such cases, it is normal to see a high utilization.

Correction If this metric goes beyond the normal operational value for your database, consider creating additional space on the DMS tablespaces that are running out of space. You can do this by performing one or more one of the following tasks:

Clean up unused space by deleting the tables/indexes that are no longer required.

Resize or extend the existing containers in the tablespaces.

Add new containers to the tablespaces.

I

NACCESSIBLE

C

ONTAINERS

The inaccessible containers metric identifies the number of containers on all tablespaces that are currently inaccessible.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics Inaccessible containers represent a serious problem on the database. The database is unable to access/write any data on an inaccessible container. Usually this is caused by either media errors or modifications to the container files/directories from outside DB2.

Correction Drill down to the Space metrics to examine the inaccessible containers and the tablespaces on which they are contained. You may need to perform a redirected restore on the tablespace from a backup to correct this.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1447

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

N

ODE WITH

S

MALLEST

L

OG

The node with smallest log metric is only returned for global snapshots and indicates the node with the least amount of available log space.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

Use this metric in conjunction with the log space utilization metrics to check if the log space or applications on the specified node need to be adjusted.

Correction If the log utilization is mostly low but increases to near 100% for short periods, then you can increase the number of secondary log files (logsecond database configuration parameter). This allocates and deallocates additional log files as needed. If, however, the log size is consistently high and changes frequently, you can increase the primary log size and/or the log file size (logfilsiz and logprimary database configuration parameters).

Also, check the SQL activity, under Users Drilldown > SQL activity to see if any applications are performing infrequent commits. If possible, such applications can be changed to have shorter transactions and less need for log space.

T

ABLESPACES IN

A

BNORMAL

S

TATE

This metric is a count of the number of tablespaces in your database that are not in a 'Normal

State'.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Bottleneck Analysis Pane

Metrics Tablespaces in not normal state are not necessarily a cause for alarm. They may have been transitioned to that state intentionally by the DBA for maintenance related tasks. If this metric shows a value that is higher than you anticipated, you may need to drilldown to the Space metrics to see which tablespaces are not normal. A tablespace can be in one or more of the following states when it is not

'Normal':

Quiesced: SHARE, UPDATE, EXCLUSIVE

Pending: Load, delete, backup, roll forward, restore, disable, drop

In progress: Roll forward, reorg, backup, TBS deletion, TBS creation

Storage must be defined

Restore in progress

Offline and not accessible

Storage may be defined

Storage definition is in 'final' state

Storage definition was changed prior to rollforward

DMS rebalancer is active

Correction If the number of 'Not Normal' tablespaces is higher than you expect, drill down to the space metrics to examine the abnormal tablespaces and take appropriate action.

SQL A

NALYSIS

P

ANE

A lot of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured server down in terms of user response times.

14 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Before you can identify problem SQL in your database, you need to understand the level of SQL activity that is occurring in the database. A high level overview of the type of SQL activity helps determine not only they types of statements that are being executed but also the type of internal activity they may be causing.

The following indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Static SQL

Internal Rebinds

Dynamic SQL

Internal Rollbacks Due to Deadlocks

Units of Work

S

TATIC

SQL

The static SQL metric is the number of static SQL statements that were executed on the database since the start of this instance of Performance Analyst.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

SQL Analysis Pane

Together with dynamic and failed SQL statements, this metric represents the number of SQL statements executed on the database.

D

YNAMIC

SQL

This metric is the number of static SQL statements that were executed on the database since the start of this instance of Performance Analyst.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

SQL Analysis Pane

Together with Static and Failed SQL statements, this metric represents the number of SQL statements executed on the database.

F

AILED

SQL

The failed SQL metric is the number of failed SQL statements that were executed on the database since the start of this instance of Performance Analyst.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

Together with static and dynamic SQL statements, this metric represents the number of SQL statements executed on the database. This metric may also help you determine reasons for poor performance, since failed statements mean time wasted by the database manager. This results in lower throughput for the database.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1449

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

U

NITS OF

W

ORK

This is the number of transactions executed on the database since the start of this instance of

Performance Analyst.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

SQL Analysis Pane

A low number of units of work compared to the overall SQL activity (static + dynamic SQL statements) indicate long transactions. This may in turn be an indicator of poor concurrency and heavy log usage.

I

NTERNAL

R

EBINDS

The internal rebinds metric is the number of automatic rebinds (or recompiles) that have been attempted on the database since the beginning of this instance of the Performance Analyst.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

SQL Analysis Pane

Automatic rebinds are the internal binds the system performs when a package has been invalidated.

The rebind is performed the first time the database manager needs to execute an SQL statement from the package. For example, packages are invalidated when you:

Drop an object, such as a table, view, or index, on which the plan depends

Add or drop a foreign key

Revoke object privileges on which the plan depends.

You can use this element to determine the level of database activity at the application or database levels. Since internal rebinds can significantly degrade performance, they should be minimized whenever possible.

I

NTERNAL

R

OLLBACKS

D

UE TO

D

EADLOCKS

The internal rollbacks due to deadlocks metric is the total number of forced rollbacks initiated by the database manager because of a deadlock for the current instance of Performance Analyst. A rollback is performed on the current unit of work in an application selected by the database manager to resolve the deadlock.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

SQL Analysis Pane

This metric shows the number of deadlocks that have been broken and can be used as an indicator of concurrency problems. It is important because this metric lowers the throughput of the database.

S

TORAGE

A

NALYSIS

P

ANE

While DBAs focus on memory settings and tuning SQL, they frequently forget how dangerous and insidious storage problems can be. This is not a good mindset because storage headaches can play a major role in wrecking an otherwise well-running database.

Storage problems generally take one of two forms:

14 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• The ‘hit-the-wall’ variety that can bring things to a complete standstill.

• The ‘performance vampire’ kind that slowly drains the performance of a database over time.

Storage problems have the capability to bring the curtain down on a database very quickly, as in the case of a transaction log running out of free space. But storage problems can also silently work behind the scenes to slowly, but surely rob a database of its performance. For example, a hub table in a busy database might be accessed very quickly when an application is first given life, but over time, if it develops a heavy forwarded row problem, it can cause things to run very differently.

The Storage Analysis section of the Performance Analyst Home page displays the total used and free space of all DMS tablespaces in the database. It also provides the total and available log space for the database.

The following ratios succinctly communicate the general overall performance levels of the datasource:

DMS Space

Last Backup

Total SMS Space Used

Log Space

DMS S

PACE

The total used and total free metrics show the space details for DMS tablespaces. Specifically, they show the amount of used and free space on the DMS tablespaces in the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Storage Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Storage Analysis Pane

Metrics Unlike SMS tablespaces, the total available space to the DMS tablespaces is defined at the time the database is defined. The DBA needs to explicitly increase the amount of space on DMS tables by adding/extending tablespace containers (using the ALTER TABLESPACE statement). If left unattended, a DMS tablespace can either remain underutilized or fill up completely. Keeping an eye on the DMS space is important because the once it fills up, the applications trying to write to the database will come to a halt suddenly.

Correction Go to the Space home page or drill-down to see the usage metrics for individual tablespaces and allocate/deallocate space to containers accordingly using ALTER TABLESPACE command.

T

OTAL

SMS S

PACE

U

SED

This metric shows the total amount of SMS space used by the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Storage Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Storage Analysis Pane

The maximum size of SMS tablespaces is not set at the time the tablespaces are created. The maximum size that can be reached is the space available on the drives/volumes that the SMS tablespace containers are defined on. You need to periodically examine the available space of the drives/volumes (using OS metrics Space page) to make sure there is enough space available for your database requirements. Since the space is determined by the space available on the drives/volumes, remember that if other applications are reading and writing to the same devices (especially logs, traces, etc), DB2 may be periodically competing for space with these applications.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1451

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction Ideally, try and isolate the DB2 SMS drives/volumes from other applications. If the OS level metrics show that you are running out of space on a volume that is used by a tablespace's containers, you can add more containers defined on volumes with more space, to the tablespace using the ALTER

TABLESPACE command.

L

OG

S

PACE

The log space metrics show the amount of free and used log space on the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Storage Analysis Pane

Metrics Very high log space utilization (>75%) indicates that the database could run out of log space soon.

Usually, consistently high log space utilization has one of the following causes:

Large transaction size. Applications are performing a large number of updates on the database but are not committing the transactions frequently.

The log space configured for the database is insufficient for the level of database activity

Very low log space utilization (< 5) % can indicate an excessively large log file. It’s possible you can free some of the space occupied by log files on disk.

Correction If the log utilization is mostly low but increases to near 100% for short periods, you can increase the number of secondary log files (logsecond database configuration parameter). This allocates and deallocates log files as needed. If however, the log size is consistently high, and changes frequently, you can increase the primary log size and/or the log file size (logfilsiz and logprimary database configuration parameters).

Also, check the SQL activity, under Users Drilldown>SQL activity to see if any applications are performing infrequent commits, and if possible such applications can be changed to have shorter transactions and hence less need for log space.

L

AST

B

ACKUP

The last backup metric indicates when the database was last backed-up.

Location

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Storage Analysis Pane

W

ORKLOAD

A

NALYSIS

P

ANE

When experiencing performance slowdowns, some of the first questions you should answer are:

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Home page provides insight into the leading resource hogs of a server, as well as a count of total active and inactive processes. Drilldown's are available so you can easily get detailed information into what each leading application is currently involved with.

14 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Workload Analysis statistics include:

Application Activity Analysis Applications Currently Executing Idle Applications

A

PPLICATION

A

CTIVITY

A

NALYSIS

Ideally, database resource usage should be spread evenly across connected applications. In many cases, however, a couple of renegade application can hog most of the resources and starve the other applications that are competing for the same resources. If you see a slowdown of the database, but cannot identify the root cause from ratio / bottleneck analysis, you need to examine any connected applications that are using more than their fair share of system resources (CPU, I/O, locklist, etc.)

Performance Analyst provides an easy way to identify the top users of the database resources and what percentage of total usage can be attributed to these applications.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Workload Analysis Pane

If any one application is using more than 50% of the total resource you should drilldown into that application (Users drill-down) to isolate the problem.

A

PPLICATIONS

C

URRENTLY

E

XECUTING

The applications currently executing statistic gives the number of applications for which the database manager is currently executing requests.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Workload Analysis Pane

You can use this number to understand how many of the database manager agent tokens are being used by applications connected to this database

I

DLE

A

PPLICATIONS

The idle applications statistic the number of applications that are currently connected to the database for which the database manager is not executing any requests

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics > Home

> Workload Analysis Pane

You can use this statistic to help you understand the level of activity within a database and the amount of system resources currently in use.

M

EMORY

The Memory category of DB2 Performance Analyst includes the following tabbed pages:

Caches Tab

Memory Pools Tab

Lock Memory Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1453

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

H

OME

The Home page of the Memory performance category view has statistics in the following categories:

Key Ratio Analysis Pane

SQL Analysis Pane

Bottleneck Analysis Pane

Workload Analysis Pane

Memory Analysis Pane

K

EY

R

ATIO

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards you should always adhere to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Most of the global ratios that a DBA will examine come from the DB2 Snapshot Monitor. The Snapshot Monitor returns various metrics for the instance and database since the start of monitoring. Some of the metrics are cumulative (i.e., counters) and others are instantaneous (i.e., gauges).

In the case of cumulative metrics, the values can grow quite large over the monitoring period and the ratios calculated on these metrics can hide the skews that may occur during the monitoring. However, if delta statistics are used (taking, for a specified sampling period, the before and after counts of each statistic that make up a ratio), then an accurate and current portrayal of the database activity over the sampling period can be had.

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each DB2 databases' individual personality with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following memory ratios are used on the Performance Analyst Key Ratio Analysis section to succinctly communicate the general overall memory performance levels of the monitored database:

Data Page Hit Ratio Private Workspace Hit Ratio Index Page Hit Ratio

The following topics, available on this pane, duplicate statistics available on the Home

page:

Buffer Pool Hit Ratio Catalog Cache Hit Ratio

Package Cache Hit Ratio

14 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Shared Workspace Hit Ratio

D

ATA

P

AGE

H

IT

R

ATIO

This metric is the percentage of all data reads satisfied because the page was already available in a bufferpool.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

The index page hits are used in conjunction with data page hits to calculate the overall buffer pool hit ratio. Use this element, in conjunction with the index page hit ratio when tuning the overall buffer pool hit ratio.

P

RIVATE

W

ORKSPACE

H

IT

R

ATIO

Each application executing on the database has access to the private workspace of the agents working for it.

The private workspace hit ratio is a percentage indicating how well the private SQL workspace is helping to avoid initialization of sections for SQL statements that are about to be executed. A high ratio indicates it is successful in avoiding this action.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

Correction Shared workspace memory is allocated from the application heap (app_ heap_sz database configuration parameter) and increasing this may improve the private workspace hit ratio.

I

NDEX

P

AGE

H

IT

R

ATIO

The index page hit ratio is the percentage of all index reads that were satisfied because the page was already available in a bufferpool.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home > Key Ratio Analysis Pane

The index page hits are used in conjunction with data page hits to calculate the overall buffer pool hit ratio. Use this element, in conjunction with the data page hit ratio when tuning the overall buffer pool hit ratio.

B

OTTLENECK

A

NALYSIS

P

ANE

The Bottleneck Analysis section identifies the number of times when overflows or over-utilization may have occurred in areas of memory. An overflow occurs when the usage of a memory area goes beyond the allocated amount.

Overflows are serious bottlenecks and may cause unnecessary lock escalations, out of memory errors or performance degradations.

The following statistics are used on the Performance Analyst for DB2 Memory home page to succinctly communicate the general overall performance levels of the memory structures:

Catalog Cache Overflows Hash Join Small Overflows Package Cache Overflows

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1455

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Private Workspace Overflows Shared Workspace Overflows

The following statistics, available on this pane, dupicte statistics availabe on the

Bottleneck

Analysis Pane

of the

Home

page.

Hash Join Overflows

Lock Escalations

Sort Overflows

C

ATALOG

C

ACHE

O

VERFLOWS

The catalog cache overflow statistic is the number of times the catalog cache overflowed the bounds of its allocated memory.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

Metrics Catalog cache overflows can cause unnecessary lock escalations. This can result in loss of concurrency, or ‘out of memory’ errors from other heaps allocated to the database’s shared memory. Overflows of the catalog cache can also cause performance degradation. DB2 reclaims the catalog cache space by evicting table descriptor information for tables, views, or aliases and/or authorization information that is not currently being used by any transaction.

Correction Use this element with the catalog cache high watermark (Memory> Caches Drilldown) to determine whether the size of the catalog cache needs to be increased to avoid overflowing.

If the number of overflows is large, the catalog cache may be too small for the workload. Enlarging the catalog cache can improve its performance. If the workload includes transactions that compile a large number of SQL statements referencing many tables, views, aliases, user-defined functions, or stored procedures in a single unit of work, then compiling fewer SQL statements in a single transaction can improve the performance of the catalog cache. Or, if the workload includes binding packages that contain many SQL statements referencing many tables, views, aliases, user-defined functions, or stored procedures, you can try splitting packages so that they include fewer SQL statements to improve performance.

H

ASH

J

OIN

S

MALL

O

VERFLOWS

The hash join small overflows statistic is the number of times that hash join data exceeded the available sort heap space by less than 10%.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

If the value of hash join small overflows is greater than 10% of hash join overflows, then you should consider increasing the sort heap size. Values at the application level can be used to evaluate hash join performance for individual applications.

Correction Increase the sortheap database configuration parameter to reduce the number of overflows.

P

ACKAGE

C

ACHE

O

VERFLOWS

The package cache overflows metric is the number of times that the package cache overflowed the bounds of its allocated memory.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

Package cache overflows can cause unnecessary lock escalations. This can result in loss of concurrency, or ‘out of memory’ errors from other heaps allocated to the database’s shared memory.

Overflows of the package cache can also cause performance degradation.

14 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Correction Use this element with the package cache high watermark (Memory > Caches Drilldown) to determine whether the size of the package cache needs to be increased to avoid overflowing.

P

RIVATE

W

ORKSPACE

O

VERFLOWS

The private workspace overflows statistic is the number of times that private workspaces overflowed the bounds of their allocated memory.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

Private workspace overflows can cause performance degradation as well as ‘out of memory’ errors from other heaps allocated to the agent’s private memory.

Correction Use this element with the private workspace high watermark (Memory -> Caches Drilldown) to determine whether the size of the private workspace needs to be increased to avoid overflowing.

S

HARED

W

ORKSPACE

O

VERFLOWS

The shared workspace overflows metric is the number of times that shared workspaces overflowed the bounds of their allocated memory.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Bottleneck Analysis Pane

Overflows of shared workspaces can cause performance degradation. Overflows can also ‘out of memory’ errors from the other heaps allocated out of application’s shared memory.

Correction Use this element with the shared workspace high watermark (Memory > Caches Drilldown) to determine whether the size of the shared workspaces need to be increased to avoid overflowing.

M

EMORY

A

NALYSIS

P

ANE

This section helps you to track memory usage for database processes through

Memory Analysis

Heaps .

NOTE:

The memory metrics for DB2 are only available if you are using a DB2 version 8 server and a DB2 version 8 client

NOTE:

The memory management for DB2 (and hence the metrics) varies between platforms.

You only see the memory metrics at the database level for UNIX system. If you are tracking the memory metrics for a Windows system, please refer to Instance -> Memory

Pool Drilldown.

M

EMORY

A

NALYSIS

H

EAPS

Under normal operating conditions you can track the memory usage for the following elements:

Application Heap

Lock Manager Heap

Package Cache Heap

Query Heap

FCMBP Heap

Database Heap

Backup/Restore/Utility Heap

Catalog Cache Heap

Database Monitor Heap

Application Control

Statistics Heap

DFM Heap

Statement Heap

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1457

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Buffer Pool Heap

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Home >

Memory Analysis Pane

The various memory heap usages are useful when tuning the corresponding database configuration parameters.

Correction To see greater details on the current utilizations, maximum available, and high watermarks, go to the

Memory Pools tab of the Memory detail view. Based on these you can make decisions about whether you need to increase or decrease the maximum allocations for the heaps (mostly through database configuration parameters)

SQL A

NALYSIS

P

ANE

A lot of a database's overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag an otherwise well-configured server down in terms of user response times.

Before you can identify problem SQL in your database, you need to understand the level of SQL activity that is occurring in the database. A high level overview of the type of SQL activity helps determine not only they types of statements that are being executed but also the type of internal activity they may be causing.

The following indicators are used on the Performance Analyst Memory page to succinctly communicate the general overall performance level of the monitored database. They duplicate

statistics available on the SQL Analysis Pane

of the Home

page:

Static SQL

Internal Rebinds

Dynamic SQL

Internal Rollbacks Due to Deadlocks

Units of Work

W

ORKLOAD

A

NALYSIS

P

ANE

When your phone starts ringing with complaints of performance slowdowns, one of the first things you should get a handle on is:

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Memory page provides insight into the leading applications that caused memory overflows to disk or lock escalations. Drill down's are available so you can easily get detailed information into what each leading application is currently involved with.

A

PPLICATION

A

CTIVITY

A

NALYSIS

P

ANE

Top memory issues are displayed in the following categories:

14 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Top Locks

• Top Lock Escalations

• Top Cache Overflows

• Top Sort Overflows

• Top Workspace Overflows

Metrics

The list of top memory hogs can help you quickly identify the applications that are causing memory usage problems. You can drill down into the Memory tab views to see how these applications are using memory compared to their peers and the overall memory being used by the database. This is a good place to start, if you think that the memory problems you are noticing on the database may be as a result of poorly written applications rather than database configuration or overall system memory availability.

C

ACHES

T

AB

The Caches tab of the Memory Detail page offers detailed views of cache usage metrics and includes the following statistics:

Application Details

Private Workspace Usage Details

Catalog Cache Usage Details

Shared Workspace Usage Details

Package Cache Usage Details

The following statistics, available on this page, dupication statistics available on the

Key Ratio

Analysis Pane

of the

Home

page:

Catalog Cache Hit Ratio

Package Cache Hit Ratio

Shared Workspace Hit Ratio

The following statistic, available on this page, dupication statistics available on the

Caches Tab

of the

Memory page:

Private Workspace Hit Ratio

A

PPLICATION

D

ETAILS

The Application Details section shows the list of applications connected to the database and the various cache usage metrics for each application. It also shows the rolled up metrics at the database level in the same list. You can select the type of cache monitoring you intend to perform for the applications from the following:

• Catalog Cache: Shows the details of all catalog cache activity for connected applications

• Package Cache: Displays the details of all package cache activity for connected applications

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1459

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Shared Workspace: Gives the details of all shared workspace activity for connected applications

Private Workspace: This shows the details all of private workspace activity for connected applications

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

Correction Depending on the category of cache details you select, you can view cache activity associated with the applications. This section is very useful in isolating the applications and the cache areas you need to tune by comparing the cache performance for all the applications and also the overall cache performance at the database level.

C

ATALOG

C

ACHE

U

SAGE

D

ETAILS

This section shows detailed catalog cache usage metrics for the selected item. The metrics presented here include:

• Catalog Cache Lookups: The number of times that the catalog cache was referenced to obtain table descriptor information or authorization information

• Catalog Cache Inserts: The number of times that the system tried to insert table descriptor or authorization information into the catalog cache.

• Catalog Cache Overflows: The number of times that the catalog cache overflowed the bounds of its allocated memory

• Catalog Cache High Watermark: The largest size reached by the catalog cache

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

These metrics are used for calculating the catalog cache hit ratio. They also give you an estimate of catalog access activity occurring in the database. You can use the catalog cache overflow metric with the catalog cache high watermark to determine if the catalog cache size is too small. If the catalog cache overflows frequently, you consider increasing the catalog cache size.

Correction If catalog cache overflows are large, the catalog cache may be too small for the workload. Enlarging the catalog cache may improve its performance. If the workload includes transactions that compile a large number of SQL statements referencing many tables, views, aliases, user-defined functions, or stored procedures in a single unit of work, then compiling fewer SQL statements in a single transaction may improve the performance of the catalog cache. Or if the workload includes binding packages that contain many SQL statements referencing many tables, views, aliases, user-defined functions, or stored procedures, you can try splitting packages. If they include fewer SQL statements, performance can improve.

Monitor the catalog cache metrics for your normal workload. If you see frequent overflows, you can increase the value of catalogcache_sz database configuration parameter to the catalog cache high

watermark/4096 (rounded up to whole integer).

P

ACKAGE

C

ACHE

U

SAGE

D

ETAILS

The Package Cache Usage Details section shows the detailed package cache usage metrics for the selected item. The metrics presented here include:

14 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Package Cache Lookups: The number of times that an application looked for a section or package in the package cache. At a database level, it indicates the overall number of references since the database was started, or monitor data was reset.

• Package Cache Inserts: The total number of times that a requested section was not available for use and had to be loaded into the package cache. This count includes any implicit prepares performed by the system.

• Package Cache Overflows: The number of times the package cache overflowed the bounds of its allocated memory

• Package Cache High Watermark: The largest size reached by the package cache.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

These metrics are used to calculate the package cache hit ratio. They also give you an estimate of package cache access activity occurring on the database. You can use the package cache overflow metric with the package cache high watermark to determine if the package cache size is too small. If the package cache overflows frequently, you may need to increase the package cache size.

Correction Monitor the package cache metrics for your normal workload. If you see frequent overflows, you can increase the value of the pckcachesz database configuration parameter to the package cache high

watermark/4096 (rounded up to whole integer).

P

RIVATE

W

ORKSPACE

U

SAGE

D

ETAILS

This section shows the detailed private workspace usage metrics for the selected item. The metrics presented here include:

• Private Workspace Lookups: Lookups of SQL sections by an application in its agents' private workspace.

• Private Workspace Inserts: Inserts of SQL sections by an application into the private workspace.

• Private Workspace Overflows: The number of times that the private workspaces overflowed the bounds of its allocated memory.

• Private Workspace High Watermark: The largest size reached by the Private Workspace.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

These metrics are used to calculate the private workspace hit ratio. They also give you an estimate of private workspace access activity occurring on the database.

When the private workspace overflows, memory is temporarily borrowed from other entities in agent private memory. This can result in memory shortage errors from these entities or possibly performance degradation.

Correction You can reduce the chance of overflow by increasing APPLHEAPSZ.

S

HARED

W

ORKSPACE

U

SAGE

D

ETAILS

This section shows the detailed shared workspace usage metrics for the selected item. The metrics presented here include:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1461

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Shared Workspace Lookups: Lookups of SQL sections by applications in shared workspaces.

• Shared Workspace Inserts: Number of inserts of SQL sections by applications into shared workspaces.

• Shared Workspace Overflows: The number of times that shared workspaces overflowed the bounds of their allocated memory.

• Shared Workspace High Watermark: The largest size reached by shared workspaces.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Caches Tab

These metrics are used to calculate the shared workspace hit ratio. They also give you an estimate of shared workspace access activity occurring on the database. When the shared workspace overflows, memory is temporarily borrowed from other entities in application shared memory. This can result in memory shortage errors from these entities or possibly performance degradation.

Correction You can reduce the chance of overflow by increasing APPL_CTL_HEAP_SZ.

M

EMORY

P

OOLS

T

AB

The Memory Pools tab offers the following detailed views:

Application Details

Memory Pool Utilization

Memory Pool Details

Memory Pool Usage

A

PPLICATION

D

ETAILS

This section shows the list of applications connected to the database. You can select an application to show the breakdown of the memory pool usage by the application.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Memory Pools Tab

M

EMORY

P

OOL

D

ETAILS

This section shows the memory pool usage details for the selected application (or database level) in the application details section. The metrics shown here include:

• Pool ID: This is the kind of memory pool. Each pool type is only shown once

• Pool Current Size: The current size of a memory pool.

• Pool Max Size: The internally configured size of a memory pool in DB2.

Pool High Watermark: The largest size of a memory pool since its creation.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Memory Pools Tab

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Memory Pools tab

14 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Metrics The nature of memory_pool data elements varies between platforms. On Windows systems, no memory usage is reported at the database level, while on UNIX systems, memory is reported at the database level. Instead of reporting this memory at the database level, the system monitor for

Windows systems reports it in instance -level snapshots. This divergence in reporting is due to differences in the underlying memory architecture between Windows systems and UNIX systems.

M

EMORY

P

OOL

U

SAGE

This section shows the memory pool usage details of the selected memory pool over time including the current size of the memory pool, its high watermark, and the maximum size of the memory pool.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

>

Memory >

Memory Pools Tab

M

EMORY

P

OOL

U

TILIZATION

This section shows the percentage utilization of the selected memory pool.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Memory Pools Tab

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Memory Pools tab

Metrics You can use this metric to see if a memory pool is nearly full. You can diagnose the problems with specific memory pools by monitoring their utilization over time.

Correction If the value of the pool utilization is consistently close to or exceeds 100%, you may need to increase the configuration parameter associated with that pool.

L

OCK

M

EMORY

T

AB

The Lock Memory tab of the Memory Detail view shows the following statistics:

Lock List Utilization

(dupiicates a statistics available on the Key Ratio Analysis Pane of the

Home

page)

• Lock Escalations

L

OCK

E

SCALATIONS

This section shows the metrics for lock escalations in the database. The metrics shown here are:

• Lock Escalations: The number of times that locks have been escalated from several row locks to a table lock.

• Exclusive Lock Escalations: The number of times that locks have been escalated from several row locks to one exclusive table lock, or the number of times an exclusive lock on a row caused the table lock to become an exclusive lock.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Memory

> Lock Memory Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1463

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Metrics A lock is escalated when the total number of locks held by an application reaches the maximum amount of lock list space available to the application, or the lock list space consumed by all applications is approaching the total lock list space. The amount of lock list space available is determined by the maxlocks and locklist configuration parameters.

When an application reaches the maximum number of locks allowed and there are no more locks to escalate, it will then use space in the lock list allocated for other applications. When the entire lock list is full, an error occurs.

This data item includes a count of all lock escalations, including exclusive lock escalations.

There are several possible causes for excessive lock escalations:

The lock list size (locklist) may be too small for the number of concurrent applications

The percent of the lock list usable by each application (maxlocks) may be too small

One or more applications may be using an excessive number of locks.

Correction To resolve these problems, you may be able to:

Increase the locklist configuration parameter value. See the Administration Guide for a description of this configuration parameter.

Increase the maxlocks configuration parameter value. See the Administration Guide for a description of this configuration parameter.

Identify the applications with large numbers of locks (see locks_held_top), or those that are holding too much of the lock list, using the following formula:

(((locks held * 36) / (locklist * 4096)) * 100) and comparing the value to maxlocks. These applications can also cause lock escalations in other applications by using too large a portion of the lock list. These applications may need to resort to using table locks instead of row locks, although table locks may cause an increase in lock_waits and lock_wait_time.

I/O

In addition to a

Home

page, the I/O category of DB2 Performance Analyst includes the following tabbed pages are available on the I/O Detail view:

Applications Tab

Tablespaces Tab

Bufferpools Tab

Logging Tab

H

OME

The Home Page of the I/O performance category page displays the following vital DB2 I/O statistic categories:

Key System Analysis Pane

Non Buffered I/O Activity

Bottleneck Analysis Pane

Workload Analysis Pane

SQL Analysis Pane

14 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

K

EY

S

YSTEM

A

NALYSIS

P

ANE

The root cause of many database problems can be attributed to I/O-related operations. I/O monitoring is essentially a review of your physical database design. All physical storage characteristics and placements, table and index designs, and the speed with which all processes works are on display when I/O is monitored. Because a database's main index of performance is measured by how fast I/O needs are satisfied, it is your responsibility to quickly determine if a reported database slowdown is I/O related.

The following statistics are used on the Performance Analyst for DB2 I/O Home Page to succinctly communicate the general overall performance levels of I/O:

Efficiency

Async Read Ratio Async Write Ratio

Victim Page Cleaners %

Resource Utilization

Log Space Cleaners Triggered Victim Page Cleaners Triggered

Threshold Cleaners Triggered

A

SYNC

R

EAD

R

ATIO

Async read ratio is the percentage of all index and data reads that performed asynchronously by the database manager prefetchers.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

Prefetching refers to the technique whereby the Database Manager can read several pages on the physical reads device simultaneously into a bufferpool in anticipation of access to these pages. Since each physical read operation is costly, a 50% async read ratio is desirable. It shows that prefetchers are working well and read waits are minimal.

Correction The num_ioserver database configuration parameter defines the number of prefetchers that are available for the database. To get an optimal async read ratio, you should set the num_ioserver database configuration parameter to 1-2 more than the number of physical storage devices used by the database to ensure that asynchronous I/O is occurring. This parameter should be changed judiciously. Having too many prefetchers invariably results in high system I/O because prefetchers can read many more pages than required into the bufferpools.

A

SYNC

W

RITE

R

ATIO

Async write ratio is the percentage of all index and data writes that were performed asynchronously by the database manager bufferpool page cleaners.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1465

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Metrics Page cleaners write changed pages from bufferpool to disk before the space in the bufferpool is needed by a database agent. If the page cleaners are not working well, the problem may manifest itself in two ways:

The database agents need to synchronously free space in bufferpools resulting in poorer response time.

If the system crashes, recovery time is greater because there will be a large number of pages that would not have been committed to disk at the time of the crash and they require processing for a large number of log records.

An overall async write ratio of 50% is desirable for most transactional database systems. If your database is 'query only' (i.e., updates are rarely or never performed), it is fine to have an async write ratio of 0 to less than 50%. Even in 'query only' databases if the queries create temp tables on the database for intermediate results, a 30-40% async write ratio is desirable.

Correction The async write ratio can be tuned using the num_iocleaners database configuration parameter, which specifies the number of asynchronous page cleaners for a database. Increasing the number of page cleaners generally results in a higher async write ratio. The following rules of thumb should be followed when tuning this parameter:

For most transactional systems set this parameter to between one and the number of physical storage devices used by the database.

For workloads that consists mainly of simple reads from the database, set this parameter to zero.

When you define very large bufferpools on your database you may need to increase the num_iocleaners

Monitor the victim page cleaners% metric when tuning the num_iocleaners.

V

ICTIM

P

AGE

C

LEANERS

%

The victim page cleaners % metric is the percentage of times the page cleaners were invoked because synchronous write was needed during the victim buffer replacement in the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

Metrics Usually this metric should be maintained around the 50-60% level. If this ratio much lower than 50%, it can indicate that you have defined too many page cleaners. If the chngpgs_thresh database configuration parameter is set too low, the page cleaners may be writing out pages that will be dirtied later. Aggressive cleaning defeats one purpose of the bufferpool, that is to defer writing to the last possible moment.

If this ratio is high, you may have too few page cleaners defined. This can increase recovery time after failures.

Correction You may increase or decrease the chngpgs_thresh database configuration parameter to bring the victim page cleaner % to optimal range. Usually, for databases with heavy transaction workloads,

chngpgs_thresh should be set to around 60%. For a database with only a few very large tables you can try and increase this parameter to a higher value to see if you get performance improvements.

NOTE:

DB2 version 8.1.4 introduces the DB2_USE_ALTERNATE_PAGE_CLEANING registry variable. If this is set to ON, this metric may not be relevant.

14 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

L

OG

S

PACE

C

LEANERS

T

RIGGERED

The log space cleaners triggered metric is the number of times a page cleaner was triggered because log space usage reached a predefined threshold for the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

The log space cleaners are triggered every time the space used by the DB2 log reaches the limit set in the softmax database configuration parameter. This parameter specifies the percentage of primary log size at which the cleaners are triggered. By default this parameter is set to 100.

A low rate of log space cleaners getting triggered may indicate that logs are not being written to disk frequently enough and that you may need to process a large number of log records and redundant log records in the event of a crash recovery.

High rates of log space cleaners getting triggered can indicate that your primary log is too small or that you have set the softmax too high. In either case, a very high rate of log cleaners being triggered may adversely impact database performance.

It is important to keep in mind, however, that more page cleaner triggers and more frequent soft checkpoints increase the overhead associated with database logging.This can have an impact on the performance of the Database Manager. Also, more frequent soft checkpoints may not reduce the time required to restart a database, if you have:

Very long transactions with few commit points.

A very large bufferpool and the pages containing the committed transactions are not written back to disk very frequently. The use of asynchronous page cleaners can help avoid this situation.

In both of these cases, the log control information kept in memory does not change frequently and there is no advantage in writing the log control information to disk, unless it has changed

Correction Examine this metric together with other page cleaner metrics and the async write ratio to determine if excessive numbers of log page cleaners are being triggered. If this is true, you need to either increase your primary log size or adjust the softmax parameter to a higher value.

NOTE:

Decreasing the log page cleaner triggering rate can impact the overall crash recovery time so it needs to be done judiciously.

V

ICTIM

P

AGE

C

LEANERS

T

RIGGERED

The victim page cleaners triggered statistic is the number of times the page cleaners were invoked because synchronous write was necessary during the victim buffer replacement in the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

If the chngpgs_thresh database configuration parameter is set too low, the page cleaners may be writing out pages that will be dirtied later. Aggressive cleaning defeats one purpose of the bufferpool, which is to defer writing to the last possible moment. If this ratio is high, it may indicate that you have too few page cleaners defined. Too few page cleaners increases recovery time after failures.

Correction You may increase or decrease the chngpgs_thresh database configuration parameter to bring the victim page cleaner triggering rate to optimal range. For databases with heavy transaction workloads,

chngpgs_thresh should be set to around 60%. For a database with only a few very large tables you can try and increase this parameter to a higher value to see performance improvements.

NOTE:

DB2 v8.1.4 introduces the DB2_USE_ALTERNATE_PAGE_CLEANING registry variable.

If this is set to ON, this metric may not be relevant

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1467

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

HRESHOLD

C

LEANERS

T

RIGGERED

The threshold cleaners triggered metric is the number of times a page cleaner was invoked because a bufferpool had reached the dirty page threshold criterion for the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Key System Analysis Pane

Metrics The dirty page threshold is set by the chngpgs_thresh database configuration parameter. It is a percentage applied to the bufferpool size. When the number of dirty pages in the pool exceeds this value, the cleaners are triggered.

If this value is set too low, pages might be written out too early, requiring them to be read back in. If set too high, then too many pages may accumulate, requiring users to write out pages synchronously.

Correction For databases with frequent update transactions, you can generally ensure that there are enough clean pages in the bufferpool by setting the chngpgs_thresh parameter value to be equal-to or lessthan the default value. A percentage larger than the default can help performance if your database has a small number of very large tables.

B

OTTLENECK

A

NALYSIS

P

ANE

High prefetch waits and file closures are good indicators of I/O waits at the database. Often, heavy I/O activity may not be due to non-optimal settings of the database configuration parameters. Rather, the underlying cause can be poor physical layout of a few tables/ tablespaces or a few poorly written/suboptimal database applications.

It is usually best to try and tune individual objects/applications before attempting to tune database configuration parameters. Database configuration changes can have a profound impact on every application and object that resides in the database and if there are only a couple of apps/objects dragging down the performance of the entire database, it may be best to first isolate and tune these.

I/O Bottleneck analysis provides information on applications and tablespaces that are performing the highest number of read and write operations on the database at a glance. It also shows the bufferpool I/O metrics that point to direct I/O waits.

The following statistics are used on the Performance Analyst for DB2 I/O home page to succinctly communicate the general overall performance levels of I/O:

Hottest Tablespaces

Total Time Spent Waiting for Prefetchers

Hottest Apps Total Database Files Closed

H

OTTEST

T

ABLESPACES

This section displays the list of top three tablespaces with the highest number of physical reads and writes.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Bottleneck Analysis Pane

14 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Metrics Understanding the storage-level hot spots of a database is beneficial for a two reasons. First, you can get a feel for overworked physical disks by viewing I/O statistics at the tablespace level. If a particular tablespace is under too much strain, you can attempt to relocate tablespace containers to other lessused devices. You can also try to create new tablespaces on different disks and move hot objects to them (assuming, of course, you have extra disks available). Second, if you have used standard DBA practices and placed indexes in their own tablespace, you can review the I/O statistics for the hottest tablespaces and see if the indexes are actually being used.

Correction Some areas to consider when reviewing the hottest tablespaces display are:

A temp tablespace showing high volumes of physical I/O could indicate a problem with excessive sort overflows.

Quickly review all physical I/O for each drive/file system at the OS level and get a feel for the overworked disks on your server. If you have underutilized disk drives (with their own controllers), then you should consider relocating some tablespaces/containers that exhibit high I/O characteristics to those drives

To minimize contention at the physical disk level, and to improve performance overall, it is generally recommended that a database have its tablespaces and log files physically separated onto different drives/file systems.

H

OTTEST

A

PPS

This metric shows the top three applications connected to the database with the highest number of physical reads and writes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Bottleneck Analysis Pane

A few applications with suboptimal queries/database accesses can drag down the performance of the entire database. The hottest apps section allows you to get a good feel for the applications that are causing the highest number of reads and writes on the database. It is also a good indicator of where you will reap the greatest benefit when tuning the application’s performance.

Correction Drill down to the application I/O pages and see how the high I/O applications are behaving compared to other applications.

Check the SQL Snapshot Metrics for the high read/write apps to see what queries these applications are running on the database and try to optimize these queries.

T

OTAL

D

ATABASE

F

ILES

C

LOSED

Both SMS tablespaces and DMS tablespace file containers are treated as files in the Database

Manager's interaction with the operating system, and file handles are required. There is a limit to the number of files that can be open concurrently by each database agent and a file is closed when the limit of open files for an agent is reached and the agent needs to open another file.

This metric gives the number of times a database file was closed because the limit for concurrently open files was reached.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Bottleneck Analysis Pane

Both SMS table spaces and DMS tablespace file containers are treated as files in the Database

Manager's interaction with the operating system. More files are generally used by SMS tablespaces compared to the number of containers used for a DMS file table space. Thus, if you use SMS tablespaces, the database needs to open a larger number of files compared to what would be required for DMS file tablespaces. Closing and opening files is a very expensive operation and a large number of closed files can adversely affect the performance of the database. It is recommended that the number of files closed be as small as possible (preferably 0).

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1469

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction If you notice that files are being closed during the monitoring, first check the rate at which the files are being closed at the database level, from the I/O drill-down. If you see files being closed frequently, increase the maxfilop database configuration parameter. Note that the operating system on which the database is running also has a limit on the number of files that can be opened concurrently. Make sure that you do not increase the maxfilop parameter beyond the operating system limit.

T

OTAL

T

IME

S

PENT

W

AITING FOR

P

REFETCHERS

This is the total time database applications spent waiting for prefetchers to finish loading.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Bottleneck Analysis Pane

Correction If you see a high number for this metric, it indicates there is a bottleneck in the prefetcher operations.

Experiment with changing the number of I/O servers (num_ioserver) and the I/O server sizes.

SQL A

NALYSIS

P

ANE

Most of database's I/O performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag down an otherwise well-configured server in terms of user response times. This section shows a snapshot of row level SQL operations that have been performed on the database since you started monitoring. This gives you an insight into the row level of read/write activity that is currently occurring within the database and comparing this to the prefetcher, and cleaner activity allows you to relate the two.

The following statistics are used on the Performance Analyst for DB2 I/O home page to succinctly communicate the general overall performance levels of I/O:

Rows Deleted

Rows Updated

Rows Inserted

Rows Read

Rows Selected

R

OWS

D

ELETED

The rows deleted metric is the total number of row deletions attempted on the database. It includes the internal row deletions that were caused by constraints or triggers.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

SQL Analysis Pane

R

OWS

I

NSERTED

The rows inserted metric is the total number of row insertions attempted on the database. This metric includes the internal row insertions that were caused by triggers.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

SQL Analysis Pane

14 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

R

OWS

S

ELECTED

The rows selected statistic is the total number of rows selected at the database. This metric does not include a count of rows accesses for operations such as COUNT(*) or joins.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

SQL Analysis Pane

R

OWS

U

PDATED

The rows updated metric is the total number of row updates attempted on the database. This metric includes the internal row updates that were caused by triggers or constraints

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

SQL Analysis Pane

R

OWS

R

EAD

The rows read statistic is the number of rows read from the table. This count is not the number of rows that were returned to the calling application. Rather, it is the number of rows that had to be read in order to return the result set.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

SQL Analysis Pane

N

ON

B

UFFERED

I/O A

CTIVITY

Some database operations such as backups, loads, restores, LOB (large object I/O) bypass the bufferpools and read and write directly to storage. Sometimes, even if your database I/O configurations and all of the other activities are within the normal thresholds, the I/O performance may be poor because LOB reads/writes or load/backup/restore operations are causing or waiting on I/O contentions on your storage devices.

The non buffered I/O activity section allows you to quickly identify the level of direct I/O activity on the database. The level of direct I/O activity is succinctly presented using the following metrics:

Direct Reads from the Database

Direct Writes to the Database Direct I/O Averages

D

IRECT

R

EADS FROM THE

D

ATABASE

The direct reads from the database metric identifies the number of read operations that did not use a bufferpool. Direct reads are performed for the following database operations:

• Reading LONG VARCHAR columns

• Reading LOB (BLOB/CLOB/DBCLOB) columns

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1471

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Performing a backup

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

D

IRECT

W

RITES TO THE

D

ATABASE

The direct writes to the database metric identifies the number of write operations that did not use a bufferpool. Direct writes are performed for the following database operations:

• Writing LONG VARCHAR columns

• Writing LOB (BLOB/CLOB/DBCLOB) columns

• Performing a load

• Performing a restore

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

D

IRECT

I/O A

VERAGES

The following values show how well the direct I/O operations are performing:

• Avg. Sectors / Read: Average number of sectors read for each direct read operation

• Avg Sectors / Write: Average number of sectors written for each direct write operation

• Avg Read Time: Average read time per sector for direct reads

Avg Write Time: Average write time per sector for direct writes

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

SQL Analysis Pane

Understanding the level of direct I/O averages is important. A high level of activity with a slowdown in database performance can indicate that you need to have dedicated and/or high performance storage devices for your LOB objects or backup and load images. These metrics, when viewed with the device metrics at the OS level can also indicate I/O resource conflicts with other processes.

Correction You can monitor these metrics for the LOB storage devices at the OS level to see if they are inordinately high for the database compared to the OS level. If so, there may be an I/O conflict with another process.

W

ORKLOAD

A

NALYSIS

P

ANE

When experiencing performance slowdowns, some of the first questions you should answer are:

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

14 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

The Workload Analysis section of the Performance Analyst I/O page provides insight into the leading resource hogs of a server, as well as a count of total active and inactive processes. Drilldown's are available so you can easily get detailed information into what each leading application is currently involved with.

Workload Analysis statistics includes:

• Top I/O Apps

T

OP

I/O A

PPS

The Top I/O Apps section gives a list of the apps with performing that are performing the highest number of most aggressive I/O activities The list includes:

• Application with most bufferpool misses

• Application with highest direct reads and writes

• Application with highest sort overflows

• Application with highest direct read/write time

Application with highest bufferpool read write time

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O > Home >

Workload Analysis Pane

Correction Drill down to the application I/O level to see the details and compare the metrics with the application's peers, and the database. In a lot of cases simple SQL rewrites, logic changes, and defining indexes based on access patterns can make a world of difference.

A

PPLICATIONS

T

AB

This section shows the list of applications connected to the database and the various I/O metrics for each application. It also shows the rolled up metrics at the database level in the same list.

You can select the type of I/O monitoring you intend to perform for the applications from the following:

Direct I/O

: This shows the details of all direct I/O activity for the applications.

Buffered I/O

: This shows the details of all bufferpool I/O activity for the applications connected to the database.

Extended Storage

: This shows the level of extended storage usage by the applications.

• Sorts & Joins: This shows the details for the number of files closed for the various applications.

• Block / Vectored I/O: This shows the detailed of block and vectored I/O performed by the applications.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1473

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction

Depending on the type of details you select, you can view the different types of I/O activity associated with the applications. This section is very useful in isolating the applications, and the

I/O areas you need to tune by comparing the I/O performance for all the applications and also the overall I/O performance at the database level.

D

IRECT

I/O

The Direct I/O Application or Tablespace Details view lets you the following statistics:

Direct Reads and Writes Direct Read and Write Requests

Direct Read and Writes Time

Direct Reads and Writes

This section shows the rate at which direct read/write operations are occurring for the selected element. Direct I/O operations are those that do not use the bufferpools. Direct read and write operations are performed when:

• Reading/Writing LONG VARCHAR columns

• Reading/Writing LOB data

• Performing a backup operation

• Performing a restore operation

• Performing a load operation

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

When using the performance analyst to track I/O, these elements help you distinguish the database I/

O from the non-database I/O on storage devices.

Direct Read and Write Requests

This section shows the rate at which direct read/write operations requests are occurring for the selected element. Direct I/O operations are those that do not use the bufferpools. Direct read and write operations are performed when:

• Reading/Writing LONG VARCHAR columns

• Reading/Writing LOB data

• Performing a backup operation

• Performing a restore operation

• Performing a load operation

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

14 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Metrics Use these metrics together with the Direct R/W metrics and Direct R/W request metrics to determine if the rate at which the read/write occurring is similar to the rate at which they are being satisfied. If there is a large discrepancy between the Direct I/O request rates and Direct I/O rates, it may mean that there are I/O contentions on the device(s) where the direct I/O operations are being performed.

Correction If you suspect there are I/O contentions, you can investigate whether the contentions are being caused by the DB2 processes or other processes by examining the I/O metrics at the operating system level. Consider using dedicated devices for the direct I/O operations to reduce the contention levels.

Direct Read and Writes Time

This section shows the elapsed time to perform the direct I/O operations. Direct I/O operations are those that do not use the bufferpools. Direct read and write operations are performed when:

• Reading/Writing LONG VARCHAR columns

• Reading/Writing LOB data

• Performing a backup operation

• Performing a restore operation

Performing a load operation

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

Use these metrics together with the Direct R/W metrics to determine average time it is taking to perform the read write operations. If the level of Direct I/O rates is low and the Direct RW times, it may mean that there are I/O contentions on the device(s) where the direct I/O operations are being performed.

Correction If you suspect there are I/O contentions, you can investigate whether the contentions are being caused by the DB2 processes or other processes by examining the I/O metrics at the operating system level. Consider using dedicated devices for the direct I/O operations to reduce the contention levels. If the contention levels are low, you may also benefit from using faster storage devices for direct I/O.

B

UFFERED

I/O

The Buffered I/O Application Details view lets you see the following statistics:

Hit Ratios

Write/Read Ratios

Hit Ratios

The DB2 database server reads and updates all data from a bufferpool because memory access is much faster than disk access. Data is copied from disk to a bufferpool as needed by the applications using the database. When the server needs to read/write data and the data is already in the bufferpool, no disk access is required. However, if the data is not in the bufferpool, it needs to be read from the disk, which is significantly slower process.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1475

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

The buffer pool hit ratio indicates the percentage of time that the database server did not need to load a page to service the request for a page. The calculation takes into account all the index and data pages that were requested

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

Avoiding disk I/O is the main issue when trying to improve performance tuning. A high buffer pool hit ratio is desirable because it indicates a lower frequency of synchronous disk I/O. A database where data is accessed uniformly from very large tables will have a poor hit ratio. There is little you can do to improve the performance in such cases.

Correction The buffer pool hit ratio on the database Home page is the overall hit ratio of the database. First, drill down to the bufferpool level and check the individual buffer pool hit ratios to identify the elements that may require tuning. Increasing the bufferpool size generally improves the buffer pool hit ratio.

You can use one of the following methods to increase the bufferpool size depending on the layout of the data:

If the tablespaces using the bufferpool have tables and indexes on them, increase the bufferpool size incrementally until the index page hit ratio stops increasing for that bufferpool. You will not usually get any benefit increasing the bufferpool size after you reach that point.

If the tablespaces associated with the bufferpool have only indexes on them, increase the bufferpool size until the index page hit ratio stops increasing.

If the tablespaces associated with the bufferpool have only data on them, increase the bufferpool size until the data page hit ratio stops increasing.

One general design guideline is to try and use different tablespaces for indexes and tables and associate different bufferpools with them. This generally improves performance and makes bufferpool tuning much easier.

Write/Read Ratios

This section shows the overall level of read / write activity being performed on the selected element.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

E

XTENDED

S

TORAGE

The Extended Storage Application or Transaction Details view lets you see the following statistics:

Index I/O on Extended Storage

Data I/O on Extended Storage

Index I/O on Extended Storage

This section shows the Index Pages copied to/from extended storage for the selected element.

On 32-bit platforms, virtual addressable memory is usually limited to between 2 and 4 GB. If your

32-bit machine has more real addressable memory than the maximum amount, you can configure any additional real addressable memory beyond virtual addressable memory as an extended storage cache. Any of the defined bufferpools can use an extended storage cache to improve performance. You define the extended storage cache as a number of memory segments.

14 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

The bufferpools perform first-level caching, and any extended storage cache is used by the bufferpools as secondary-level caching. Ideally, the bufferpools hold the data that is most frequently accessed, while the extended storage cache hold data that is accessed less frequently.

Pages are copied from the bufferpool to extended storage, when they are selected as victim pages. This copying is required to make space for new pages in the bufferpool.

Required index pages are copied from extended storage to the bufferpool, if they are not in the bufferpool, but are in extended storage. This copying may incur the cost of connecting to the shared memory segment, but saves the cost of a disk read.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

Because an extended storage cache is an extension to a bufferpool, it must always be associated with one or more specific bufferpools. Therefore, only the bufferpools that are declared to take advantage of advantage of the extended storage use it. The CREATE and ALTER BUFFERPOOL statements have the attributes NOT EXTENDED STORAGE and EXTENDED STORAGE that control cache usage. By default neither IBMDEFAULTBP nor any newly created bufferpool will use extended storage.

Use these metrics together with the Data I/O on Extended Storage metrics to determine the level of I/

O being performed on extended storage. If there is significant activity on this section, you may improve performance by increasing the size of extended storage.

Correction The amount of extended storage for a database is determined by the following two database configuration parameters:

num_estore_segs defines the number of extended storage memory segments. The default for this configuration parameter is zero, which specifies that no extended storage cache exists. estore_seg_sz defines the size of each extended memory segment. This size is determined by the platform on which the extended storage cache is used.

Data I/O on Extended Storage

This section shows the DataPages copied to/from extended storage for the selected element.

On 32-bit platforms, virtual addressable memory is usually limited to between 2 and 4 GB. If your

32-bit machine has more real addressable memory than the maximum amount, you can configure any additional real addressable memory beyond virtual addressable memory as an extended storage cache. Any of the defined bufferpools can use an extended storage cache to improve performance. You define the extended storage cache as a number of memory segments.

The bufferpools perform the first-level caching, and any extended storage cache is used by the bufferpools as secondary-level caching. Ideally, the bufferpools hold the data that is most frequently accessed, while the extended storage cache hold data that is accessed less frequently.

Pages are copied from the bufferpool to extended storage, when they are selected as victim pages. This copying is required to make space for new pages in the bufferpool. Required pages are copied from extended storage to the buffer pool, if they are not in the bufferpool, but are in extended storage. This copying may incur the cost of connecting to the shared memory segment, but saves the cost of a disk read.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Applications Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1477

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Metrics Because an extended storage cache is an extension to a bufferpool, it must always be associated with one or more specific bufferpools. Therefore, only the bufferpools that are declared to take advantage of advantage of the extended storage use it. The CREATE and ALTER BUFFERPOOL statements have the attributes NOT EXTENDED STORAGE and EXTENDED STORAGE that control cache usage. By default neither IBMDEFAULTBP nor any newly created bufferpool will use extended storage.

Use these metrics together with the Index I/O on Extended Storage metrics to determine the level of

I/O being performed on extended storage. If there is significant activity on this section, you can improve performance by increasing the size of extended storage.

B

UFFERPOOLS

T

AB

This section shows the list of bufferpools on the database and the various I/O metrics for each bufferpool. It also shows the rolled up metrics at the database level in the same list. You can select the type of monitoring you intend to perform for the bufferpools from the following:

Direct I/O

: This shows the details of all direct I/O activity for the various bufferpools

Buffered I/O

: This shows the details of all bufferpool I/O activity for the various bufferpools in the database

Extended Storage

: This shows the level of extended storage usage by the various bufferpools that use extended storage

Total Database Files Closed : This shows the details for the number of files closed for the

various bufferpools in the database

Block/Vectored I/O : This shows the detailed of block and vectored I/O performed by the

various bufferpools.

Correction

Depending on the type of details you select, you can view the different types of I/O activity associated with the bufferpools. This section is very useful in isolating the bufferpools, and the I/

O areas you need to tune by comparing the I/O performance for all the bufferpools and also the overall I/O performance at the database level.

B

LOCK

/V

ECTORED

I/O

The Block/Vectored I/O section of the Bufferpool Details view displays the following statistics:

Vectored I/O

Block I/O

Vectored I/O

The Vectored I/O section gives the metrics for vectored I/O requests and reads.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Bufferpools Tab

Use this element to determine how often vectored I/O is being done. The number of vectored I/O requests is monitored only during sequential prefetching.

14 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Block I/O

The Block I/O section gives the metrics for block I/O requests and reads. If block-based bufferpool is enabled, this section reports how often block I/O is being done. The number of block I/O requests is monitored only during sequential prefetching when using block-based bufferpools.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Bufferpools Tab

If block-based bufferpool is enabled and the block I/O activity is very low, or close to the values in the vectored I/O section, consider changing the block size. This state can be an indication of the following:

The extent size of one or more tablespaces bound to the bufferpool is smaller than the block size specified for the bufferpool.

Some pages requested in the prefetch request are already present in the page area of the bufferpool.

The prefetcher allows some wasted pages in each bufferpool block, but if too many pages are wasted, then the prefetcher will decide to perform vectored I/O into the page area of the bufferpool.

To take full advantage of the sequential prefetch performance improvements that block-based bufferpools provide, it is essential to choose an appropriate value for the block size. This can, however, be difficult because multiple tablespaces with different extent sizes can be bound to the same block-based bufferpool. For optimal performance, it is recommended that you bind tablespaces with the same extent size to a block-based bufferpool with a block size equal to the extent size. Good performance can be achieved when the extent size of the tablespaces are greater than the block size, but not when the extent size is smaller than the block size. For example, if extent size is 2 and block size is 8, vectored I/O would be used instead of block I/O (block I/O would have wasted 6 pages). A reduction of the block size to 2 would solve this problem.

Correction You can alter the block size for a buffer pool using the ALTER BUFFERPOOL ddl statement.

L

OGGING

T

AB

The Logging tab of the I/O Detail view displays Logging I/O statistics. This section shows the level of read/write activity being performed by the logger. The information presented here is:

Log Reads: The number of log pages read from the disk by the logger per second.

Log Writes: The number of log pages written to the disk by the logger.

Metrics

You can use this page with the operating system level I/O metrics, to quantify the amount of I/O on a device that is attributable to database activity.

T

ABLESPACES

T

AB

The Tablespace Tab of the I/O detail view shows the list of tablespaces in the database and the

I/O metrics for each tablespace. It also shows the rolled-up metrics at the database level in the same list. You can select the type of monitoring you intend to perform for the tablespaces from the following:

Direct I/O

: Shows the details of all direct I/O activity for the various tablespaces

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1479

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Buffered I/O

: Shows the details of all bufferpool I/O activity for the various tablespaces in the database

Extended Storage

: Shows the level of extended storage usage by the tablespaces that use extended storage

Total Database Files Closed : Shows details for the number of files closed for various

tablespaces in the database

Correction

Depending on the type of details you select, you can view the different types of I/O activity associated with the tablespaces. This section is very useful in isolating the tablespaces, and the

I/O areas you need to tune by comparing the I/O performance for all the tablespaces and also the overall I/O performance at the database level.

B

UFFERED

I/O

The following statistics are available on the Buffered I/O section of the Tablespace Details of the

I/O view:

Hit Ratios

Async I/O

Write/Read Ratios

Async I/O

Async read ratio is the percentage of all index and data reads that were performed asynchronously by the database manager prefetchers. Async write ratio is the percentage of all index and data writes that were performed asynchronously by the database manager bufferpool page cleaners.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> I/O

> Tablespaces Tab

Prefetching refers to the technique whereby the Database Manager can read several pages on the physical reads device simultaneously into a bufferpool in anticipation of an access to these pages.

Since each physical read operation is costly, a 50% async read ratio is desirable since it shows that the prefetchers are working well and read waits are being minimized.

Page cleaners write changed pages from bufferpool to disk before the space in the bufferpool is needed by a database agent. If the page cleaners are not working well, the problem may manifest itself in two ways:

The database agents will need to synchronously free up space in bufferpools resulting in poorer response time.

If the system crashes, the recovery time of the system will be greater because there will be a large number of pages that would not have been committed to disk at time of crash and will require processing of a large number of log records.

An overall async write ratio of 50% is desirable for most transactional database systems. If your database is ‘query only’ (i.e., updates are rarely or never performed), it is okay to have an async write ratio of 0 to less than 50%. Even in ‘query only’ databases if the queries create temp tables on the database for intermediate results, a 30-40% async write ratio is desirable.

14 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Correction num_ioserver database configuration parameter defines the number of prefetchers that are available for the database. To get an optimal async read ratio, you should set the num_ioserver database configuration parameter to 1-2 more than the number of physical storage devices used by the database to ensure that asynchronous I/O is occurring. This parameter should be changed judiciously since having too many prefecthers invariably results in high system I/O because prefecthers can read many more pages than required into the bufferpools.

Async write ratio can be tuned using the num_iocleaners database configuration parameter. This parameter specifies the number of asynchronous page cleaners for a database. Increasing the number of page cleaners generally results in a higher async write ratio. The following rules of thumb can be followed when tuning this parameter:

For most transactional systems set this parameter to between 1 and the number of physical storage devices used by the database.

For workloads that consists of mainly simple reads from the database, set this parameter to 0.

When you define very large bufferpools on your database you may need to increase the num_iocleaners.

Monitor the victim page cleaners% metric when tuning the num_iocleaners.

S

PACE

While DBAs focus on memory settings and tuning SQL, they often forget just how dangerous and insidious storage problems can be. This is not a good mindset because storage headaches can play a major role in wrecking an otherwise well-running database.

Storage problems generally take one of two forms:

• The 'hit-the-wall' variety that can bring things to a complete standstill

• The 'performance vampire' kind that slowly drains the performance of a database over time

Storage problems can quickly lead to performance problems, such as when a transaction log runs out of free space. But storage problems can also silently work behind the scenes to slowly but surely rob a database of its performance.

In addition to a Home

page, the Space category of DB2 Performance Analyst includes the following tabbed pages:

Usage tab

Objects tab

Reorganization tab

Logging tab

Quiesce tab

Rollforward tab

Bufferpools tab

Rebalance tab

H

OME

The Home page of the Space performance category view displays statistics i the following categories:

Tablespace Analysis Pane

Storage Analysis Pane

Bottleneck Analysis Pane

Log Analysis Pane

SQL Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1481

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

ABLESPACE

A

NALYSIS

P

ANE

The Tablespace Analysis section includes a list of all of the tablespaces in the database. The following information is presented for each tablespace:

• Tablespace Name: The name of the tablespace

• Type: system managed (SMS) or database managed (DMS) tablespace

• State: This element describes the current state of the tablespace

• Used Space: The space currently in use on tablespace

• Free Space: The space currently free on the tablespace. (This is not applicable to SMS tablespaces)

• Content Type: The type of data that can be stored on the tablespace. It can be one of the following:

• Any (any type of data)

• Long (LOB/ Structured type / Index data)

• System Temporary (work area used by database manager to perform operations like sorts and joins.

• User Temporary (Stores declared global temporary tables)

• Page Size: Size of pages used by the tablespace

• Extent Size: Number of pages that will be written to a container before writing to the next container on the tablespace

• Prefetch Size: Number of pages that will be read from the tablespace by the prefetchers in a single prefetch

• Total Space: Total space (Used + Free) used by the tablespace on the storage device(s). This will be the same as used space for SMS tables

• High Watermark: Highest amount of used space for the tablespace (This is not applicable to

SMS tablespaces)

Other statistics appearing in this section include:

Total Tablespaces

SMS Tablespaces

DMS Tablespaces

The total tablespaces statistic is the total number of tablespaces in the database.

The SMS tablespaces statistic is the number of system managed (SMS) tablespaces in the database.

The DMS tablespaces statistic is the number of database managed (DMS) tablespaces in the database.

14 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

B

OTTLENECK

A

NALYSIS

P

ANE

Total Tablespaces SMS Tablespaces DMS Tablespaces

Space shortfalls or inaccessible tablespaces can quickly bring a database to a halt. The space bottleneck analysis section provides an at a glance look at the items that may require your attention. You can drilldown to the details pages to see further details of the various metrics.

The metrics presented here are:

DMS Tablespaces at Utilization

>80%

Inaccessible Tablespaces

The following statistics, available on this pane, are duplicates of statistics found on the

Bottleneck Analysis Pane

of the Home

page:

Inaccessible Containers

Tablespaces in Abnormal State

DMS T

ABLESPACES AT

U

TILIZATION

>80%

The DMS tablespaces at utilization greater than 80% metric gives the number of DMS tablespaces in the database where the used space on the tablespace is more than 80% of the total available space.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Bottleneck Analysis Pane

This metric is an indicator that some of the tablespaces in your database may be running out of space.

You should drill down to the Space metrics to identify the tablespaces that may be at the critical utilization level. In tablespaces where there are little on no inserts after the initial data is loaded, little or no free space may have been left on purpose. In such cases, it is normal to see a high utilization

Correction If this metric goes beyond the normal operational value for your database, consider creating additional space on the DMS tablespaces that are running out of space. You can do this by performing one or more one of the following tasks:

Clean up unused space by deleting the tables/indexes that are no longer required.

Resize or extend the existing containers in the tablespaces.

Add new containers to the tablespaces.

I

NACCESSIBLE

T

ABLESPACES

The inaccessible tablespaces statistic is the number of tablespaces that are offline.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Bottleneck Analysis Pane

Sometimes a problem (such as inaccessible containers) will cause a tablespace to go offline. Even when the problem is corrected, such tablespaces are not accessible by any application and need to be brought online explicitly.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1483

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction From Tablespace Analysis section, identify the tablespaces whose state is set to Offline

Drill down to space details to make sure all of the containers for these tablespaces are accessible. If they are not, first fix the problem with the containers

Disconnect all applications from the database (you can use DBArtisan DB Monitor).

Reconnect to the database.

Use the ALTER TABLESPACE .. SWITCH ONLINE command to bring the tablespace back online.

If the tablespace can be brought up successfully after issuing the command, or if the tablespace was not in the OFFLINE state to begin with, DB2 returns an SQLCODE of 0.

If the tablespace cannot be brought up successfully because there are still problems with one or more of the containers, DB2 returns an SQLCODE of --293. You can force the database to restart by using the RESTART ... DROP PENDING TABLESPACE, but have to drop any faulty table spaces afterward.

SQL A

NALYSIS

P

ANE

The metrics presented here are:

DDL Statements Executed Insert/Updates/Deletes Statements

Executed

Select Statements Executed

Total SQL Executed

DDL S

TATEMENTS

E

XECUTED

This metric indicates the number of SQL Data Definition Language (DDL) statements that have been executed.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

SQL Analysis Pane

You can use this element to determine the level of database activity at the application or database level. DDL statements are expensive to run because of their impact on the system catalog tables. As a result, if the value of this element is high, you should determine the cause, and possibly restrict this activity from being performed.

DDL statements can also impact:

The catalog cache, by invalidating table descriptor information and authorization information that are stored there and causing additional system overhead to retrieve the information from the system catalogs

The package cache, by invalidating sections that are stored there and causing additional system overhead due to section recompilation.

I

NSERT

/U

PDATES

/D

ELETES

S

TATEMENTS

E

XECUTED

This is the number of SQL UPDATE, INSERT, and DELETE statements that were executed.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

SQL Analysis Pane

You can use this element to determine the level of database activity at the application or database level. This information can be useful for analyzing application activity and throughput.

14 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

S

ELECT

S

TATEMENTS

E

XECUTED

This statistic is the number of SQL SELECT statements that were executed.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

SQL Analysis Pane

You can use this element to determine the level of database activity at the application or database level. This information can be useful for analyzing application activity and throughput.

T

OTAL

SQL E

XECUTED

You can use this element to calculate the total number of SQL statements at the database level.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

SQL Analysis Pane

This element can also help you in determine reasons for poor performance. Failed statements mean time wasted by the database manager, and as a result, lower throughput for the database. You can use this element in conjunction with the other SQL metrics to understand the portion of SQL activity that can be attributed to various statement types.

S

TORAGE

A

NALYSIS

P

ANE

While DBAs focus on memory settings and tuning SQL, they frequently forget how dangerous and insidious storage problems can be. This is not a good mindset because storage headaches can play a major role in wrecking an otherwise well-running database. Storage problems generally take one of two forms:

• The ‘hit-the-wall’ variety that can bring things to a complete standstill.

• The ‘performance vampire’ kind that slowly drains the performance of a database over time.

Storage problems have the capability to bring the curtain down on a database very quickly, as in the case of a transaction log running out of free space. But storage problems can also silently work behind the scenes to slowly, but surely rob a database of its performance. For example, a hub table in a busy database might be accessed very quickly when an application is first given life, but over time, if it develops a heavy forwarded row problem, it can cause things to run very differently.

The Storage Analysis section of the Performance Analyst Home page displays the total used and free space of all DMS tablespaces in the database. It also provides the total and available log space for the database.

The following ratios succinctly communicate the general overall performance levels of the datasource:

Log Space Last Backup

The following statistics, available on this pane, duplicate statistics available on the

Storage

Analysis Pane

of the Home page:

DMS Space Total SMS Space Used

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1485

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

L

OG

A

NALYSIS

P

ANE

The Log Analysis section gives you at-a-glance information about all your log configuration parameters and the high watermarks for the log space usage. You can use this information to quickly determine the logging mechanism in place for your database and if the high watermarks are getting too close to the maximum allocations for the log space.

The metrics presented here are:

Log Configuration

High Watermarks

L

OG

C

ONFIGURATION

The log configuration metric gives a list of space related log configuration parameters for your database. The values of these parameters determine how the logger uses storage space on the database:

• Block on Log Disk Full(blk_log_dsk_ful): this configuration parameter can be set to prevent disk full errors from being generated when DB2 cannot create a new log file in the active log path. Instead, DB2 will attempt to create the log file every five minutes until it succeeds.

After each attempt, DB2 will write a message to the administration notification log. The only way to confirm that your application is hanging because of a log disk full condition is to monitor the administration notification log. Until the log file is successfully created, any user application that attempts to update table data is not able to commit transactions. Read-only queries may not be directly affected; however, if a query needs to access data that is locked by an update request or a data page that is fixed in the bufferpool by the updating application, read-only queries also appear to hang.

Setting blk_log_dsk_ful to YES causes applications to hang when DB2 encounters a log disk full error. You are then able to resolve the error and the transaction can continue. A disk full situation can be resolved by moving old log files to another file system, or by increasing the size of the file system so that hanging applications can complete.

If blk_log_dsk_ful is set to NO, a transaction that receives a log disk full error fails and is rolled back. In some cases, the database comes down if a transaction causes a log disk full error.

14 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Log File Size(logfilsiz): specifies the size of each configured log, in number of 4-KB pages.

There is a 256-GB logical limit on the total active log space that you can configure. This limit is the result of the upper limit on logfilsiz, which is 262144, and the upper limit on

(logprimary + logsecond), which is 256.

The size of the log file has a direct bearing on performance. There is a performance cost for switching from one log to another. So, from a pure performance perspective, the larger the log file, size the better. This parameter also indicates the log file size for archiving. In this case, a larger log file is size it not necessarily better, since a larger log file size may increase the chance of failure or cause a delay in log shipping scenarios. When considering active log space, it may be better to have a larger number of smaller log files. For example, if there are two very large log files and a transaction starts close to the end of one log file, only half of the log space remains available.

Every time a database is deactivated (all connections to the database are terminated), the log file that is currently being written is truncated. So, if a database is frequently being deactivated, it is better not to choose a large log file size because DB2 will create a large file only to have it truncated. You can use the ACTIVATE DATABASE command to avoid this cost, and having the bufferpool primed will also help with performance.

Assuming that you have an application that keeps the database open to minimize processing time when opening the database, the log file size should be determined by the amount of time it takes to make offline archived log copies.

Minimizing log file loss is also an important consideration when setting the log size.

Archiving takes an entire log. If you use a single large log, you increase the time between archiving. If the medium containing the log fails, some transaction information will probably be lost. Decreasing the log size increases the frequency of archiving but can reduce the amount of information loss in case of a media failure since the smaller logs before the one lost can be used.

• Log Retain(logretain): if logretain is set to RECOVERY, archived logs are kept in the database log path directory and the database is considered to be recoverable, meaning that rollforward recovery is enabled.

NOTE:

The default value for the logretain database configuration parameter does not support rollforward recovery and must be changed if you are going to use it.

• User Exit(userexit): causes the database manager to call a user exit program for archiving and retrieving logs. The log files are archived in a location that is different from the active log path. If userexit is set to ON, rollforward recovery is enabled.

NOTE:

The userexit database configuration parameter must be enabled to set logsecond parameter to-1

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1487

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Primary Logs(logprimary): specifies the number of primary logs of size logfilsz that will be created.

A primary log, whether empty or full, requires the same amount of disk space. Thus, if you configure more logs than you need, you use disk space unnecessarily. If you configure too few logs, you can encounter a log-full condition. As you select the number of logs to configure, you must consider the size to make each log and whether your application can handle a log-full condition. The total log file size limit on active log space is 256 GB.

If you are enabling an existing database for rollforward recovery, change the number of primary logs to the sum of the number of primary and secondary logs, plus 1. Additional information is logged for LONG VARCHAR and LOB fields in a database enabled for rollforward recovery.

• Secondary Logs(logsecond): specifies the number of secondary log files that are created and used for recovery, if needed.

If the primary log files become full, secondary log files (of size logfilsiz) are allocated, one at a time as needed, up to the maximum specified by this parameter. If this parameter is set to

-1, the database is configured with infinite active log space. There is no limit on the size or number of in-flight transactions running on the database.

NOTE:

If this parameter is set to -1, crash recovery time may be increased since DB2 may need to retrieve archived log files.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Log Analysis Pane

H

IGH

W

ATERMARKS

The high watermarks statistic shows the maximum total and secondary log space used by the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space > Home >

Log Analysis Pane

The total log space used high watermark in conjunction with the total log space allocated, helps you determine if applications have come close to using the total log space available to your database. The

total secondary log space used high watermark in conjunction with total log space used high watermark helps you determine your current dependency on secondary logs.

Correction High values of either high watermarks can indicate that you either need to increase the log space on the database or that the applications using the database need to perform more frequent COMMITS.

You can increase the overall log space available by adjusting one or more of the following database configuration parameters: logfilsiz, logprimary, logsecond, and logretain.

U

SAGE TAB

The Space Detail Usage tab section shows you the list of tablespaces for the database. The following information is presented for each tablespace:

Tablespace Details

Container Details

14 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

T

ABLESPACE

D

ETAILS

ID: Internal DB2 Tablespace identifier.

Name: Tablespace Name

Type: Tablespace Type – SMS (System Managed Space) or DMS (Database Managed Space)

Content Type: Shows the type of data that can be stored on the tablespace. The valid types are:

Any meaning can store any type of data

Sys Temp meaning, used internally by DB2 to store intermediate result data

User Temp meaning, can be used to create temporary tables

Long meaning, can be used to store LOB/LONG/Index data

State: Can be one or more of the following:

• Normal (see the definition SQLB_NORMAL in sqlutil.h)

• Quiesced: SHARE

• Quiesced: UPDATE

• Quiesced: EXCLUSIVE

• Load pending

• Delete pending

• Backup pending

• Roll forward in progress

• Roll forward pending

• Restore pending

• Recovery pending (not used)

• Disable pending

• Reorg in progress

• Backup in progress

• Storage must be defined

• Restore in progress

• Offline and not accessible

• Drop pending

• Storage may be defined

• Storage Definition is in 'final' state

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1489

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Storage Definition was changed prior to rollforward

• DMS rebalancer is active

• TBS deletion in progress

• TBS creation in progress

Page Size: The size of tablespace pages

Extent Size: Number of pages that will be written to a container before writing to the next container on the tablespace

Prefetch Size: The maximum number of pages the prefetcher gets from the disk at a time

Usable Space: The total space in a table space minus overhead space. (Note: For SMS tablespaces, this element will have the same value as Used Space).

Used Space: The total space in the tablespace that is currently used in the tablespace (including overhead)

Free Space: The total space that is free to be used for storage of data. This element is not applicable for SMS tablespace. free space for an SMS tablespace is the OS file system free space for the SMS containers.

Total Space: The total space used by the tablespace

Pending Free Pages: The number of pages in the tablespace that would become free if all pending transactions are committed or rolled back and new space is requested for an object.

(Applies only to DMS tablespaces)

# Containers: The number of containers in the tablespace

Usable Pages: The total pages in a table space minus overhead pages. (Note: For SMS tablespaces, this element will have the same value as Used Pages).

Used Pages: The total pages in the tablespace that is currently used in the tablespace (including overhead)

Free Pages: The total pages that are free to be used for storage of data. This element is not applicable for SMS tablespace. Free pages for an SMS tablespace are dependent on the OS file system free space for the SMS containers.

Total Pages: The total pages used by the tablespace

Page HWM: For DMS, this element represents the page number of the first free extent following the last allocated extent of a table space. Note that this is not really a "high water mark", but rather a "current water mark", since the value can decrease. For SMS, this is not applicable.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Usage tab

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Rebalance tab

14 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

C

ONTAINER

D

ETAILS

This section shows the list of containers for the selected tablespace. The information presented here includes:

ID: A value that uniquely identifies the container within the tablespace

Name: The name of the container. Typically this is the full path of the file/directory/device where the container exists.

Type: The type of container. An SMS Container will be a directory. A DMS Containers will be a raw device/file/stripped disk/ or stripped file. Together with Container name, and partition, this metric identifies the physical location of the container.

DB Partition: The database partition where the container exists

Usage Pages: Usable pages in the container (Applicable to DMS Tablespaces only).

Total Pages: Total pages in the container

Stripe Set: The stripe set that a container belongs to.

Accessible: This element describes if a container is accessible or not

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Usage tab

This section can be used to get a better understanding of the physical layout of a tablespace. Also, it lets you quickly identify if any containers are inaccessible.

L

OGGING TAB

The Logging tab of the Space Detail view displays Logging Space statistics:

Log Read/Writes

Secondary Logs

Indoubt Transactions Log Usage

L

OG

R

EAD

/W

RITES

This section shows the level of read/write activity being performed by the logger. The information presented here is:

Log Reads: The number of log pages read from the disk by the logger per second.

Log Writes: The number of log pages written to the disk by the logger.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Logging tab

You can use this page with the operating system level I/O metrics, to quantify the amount of I/O on a device that is attributable to database activity.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1491

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

I

NDOUBT

T

RANSACTIONS

This section shows the number of outstanding indoubt transactions in the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Logging tab

Indoubt transactions hold log space for uncommitted transactions, which can cause the logs to become full. When the logs are full, further transactions cannot be completed. The resolution of this problem involves a manual process of heuristically resolving the indoubt transactions. This monitor element provides a count of the number of currently outstanding indoubt transactions that must be heuristically resolved.

L

OG

U

SAGE

This section shows the following log usage details:

Total Used Space: Total space used by log files

Total Free Space: Total space still available to the logger

Total Used Space Highwatermark: The maximum amount of total log space used.

Secondary Space Used High Watermark: The maximum amount of secondary log space used.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Logging tab

Metrics Use these metrics to check your current log space usage and the highest amount of space used by the logger. If the usage is high and the high watermarks are also near the total available space, you may need to increase the amount of log space or end/commit/rollback the oldest transaction.

Correction You can use the following database configuration parameters to change the amount of log space available: logfilsiz, logprimary, and logsecond.

You can end (force) a connection with a long running transaction using the DBArtisan database monitor.

S

ECONDARY

L

OGS

This section shows the secondary logs allocations by the database over the monitoring period.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Logging tab

When the primary log files become full, the secondary log files are allocated one at a time as needed, up to a maximum number as controlled by the logsecond database configuration parameter.

Secondary log files are useful in preventing occasional log fill ups but they may not be as efficient as primary log and they also increase the recovery time. If you see a constant reliance on secondary log files, it may indicate infrequent commits by database applications or insufficient primary log space.

Correction First examine the database applications to see if secondary log files are due to long running transactions and whether these transactions can be shortened. If the transactions cannot be shortened or you still see a very frequent use of secondary logs after transaction tuning, increase the primary log size (logprimary,logfilsiz Database configuration parameters) to reduce the dependence on secondary logs.

If there is an occasional long running transaction, and you see your see transaction log full (SQL0964C) error messages, you can either increase the number of secondary log files (logsecond database configuration parameter) or set the number to -1 (no limit on number of secondary log files).

14 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

B

UFFERPOOLS TAB

The Bufferpools tab of the Space Detail View shows the list of tablespaces, with the current bufferpool associated with each tablespace and also the bufferpool used by the database at next startup

O

BJECTS TAB

The Objects tab of the Space Detail View shows the following statistics:

Tablespace Object Summary Tablespace Object Details

T

ABLESPACE

O

BJECT

S

UMMARY

This section shows information about how tablespaces are being used on the database. The information presented here includes:

Tablespace: Name of the tablespace

Table Count: Number of tables on the tablespace

Page Size: Tablespace page size

Index Count: Number of indexes on the tablespace

Table Space: Space used by tables on the tablespace

Index Space: Space used by indexes on the tablespace

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Bufferpools tab

T

ABLESPACE

O

BJECT

D

ETAILS

This section shows the details of the objects on the tablespaces shown in the Tablespace Object summary section. The user can toggle between the list of tables and indexes for the tablespace.

The information presented here for tables includes:

Table Schema: Schema name of the table

Table Name: Name of the tables

Avg Row Length: Approximate length of the table row.

# Rows: Table Cardinality

#Pages Allocated: Number of pages allocated to the table

Table Size: Total space used by the rows on the table

Available: Total available space on the table

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1493

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Total: Total space used by the table pages

NOTE:

The information presented here is based on the table/index statistics and if the statistics haven’t been collected /updated, this information may be out of date.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Bufferpools tab

Q

UIESCE TAB

The Quiesce tab of the Space Detail view shows displays the following information:

Quiesced Tablespaces Quiescer Details

Q

UIESCED

T

ABLESPACES

This section shows a list of quiesced tablespaces. A quiesce is a persistent lock. Its benefit is that it persists across transaction failures, connection failures, and even across system failures (such as power failure, or reboot).

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Quiesce tab

A quiesce is owned by a connection. If the connection is lost, the quiesce remains, but it has no owner, and is called a phantom quiesce. For example, if a power outage caused a load operation to be interrupted during the delete phase, the tablespaces for the loaded table would be left in delete pending, quiesce exclusive state. With a database restart, this quiesce would be an unowned (or phantom) quiesce. The removal of a phantom quiesce requires a connection with the same user ID used when the quiesce mode was set. This section is useful in identifying the tablespaces that are in a quiesced state.

Correction To remove a phantom quiesce:

Connect to the database from DBArtisan with the same user ID used when the quiesce mode was set.

Re-quiesce the table space using the current quiesce state from DBArtisan.

Reset the quicesce from DBartisan.

Q

UIESCER

D

ETAILS

This section shows the list of quiescers for the selected quiesced table.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Quiesce tab

Metrics Any quiescers whose agent ids are not listed under Users Detail >Attributes are phantom.

Correction To remove a phantom quiesce:

Connect to the database from DBArtisan with the same user ID used when the quiesce mode was set.

Re-quiesce the table space using the current quiesce state from DBArtisan.

Reset the quicesce from DBartisan.

14 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

R

EBALANCE TAB

The Rebalance tab of the Space Detail page displays the following information:

• Rebalance Status

The following statistic, available on this pane, are duplicates of statistics on the

Space

Usage tab

.

Tablespace Details

R

EBALANCE

S

TATUS

This section shows a graph of the percentage of extents that have been processed and the percentage that remains incomplete for the selected tablespace.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Rebalance tab

R

EORGANIZATION TAB

The Reorganization tab of the Space Details View displays the following statistics:

Table Details

Reorganization Status Reorganization Attributes

T

ABLE

D

ETAILS

This section shows the details of all the tables on which reorganization has been attempted since the start of monitoring. It also shows the status of tables that are presently undergoing reorganization. The information presented in this includes:

Table Schema: Table Schema of the table on which reorganization is being/was performed

Table Name: Table Name of the table on which reorganization is being/was performed

Tablespace: Tablespace of the table on which reorganization is being/was performed

Start: Start time of the reorganization

End: End Time of the reorganization

Phase Start: Start time of a phase of reorganization

Current Counter: Percentage of reorganization operation completed (0 if the reorganization status is complete)

Max Phase: The maximum number of reorganization phases that will occur during reorganization processing. This applies to classic (offline) reorganizations only.

Status: The status of an in-place (online) table reorganization. This is not applicable to classic

(offline) table reorganizations.

An in-place table reorganization can be in one of the following states:

• Started/Resumed

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1495

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Paused

• Stopped

• Completed

• Truncate

Completion: Table reorganize success indicator.

Phase: Table reorganize phase. This applies to classic (offline) table reorganizations only).

For classic table reorganization, the following phases are possible:

• Sort

• Build

• Replace

• Index Recreate

% Complete: Shows the completion status of the reorganization jobs

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Reorganization tab

R

EORGANIZATION

S

TATUS

Shows a graphical status view of the currently selected reorganization.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Reorganization tab

R

EORGANIZATION

A

TTRIBUTES

This section shows the reorganization attributes of the currently selected reorganization. The attributes include:

• Allow Write Access

• Allow Read Access

• Allow No Access

• Recluster Via Index Scan

• Reorg Long Field LOB Data

• No Table Truncation

• Reclustering

• Reclaiming

• Inplace Table Reorg

14 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Table Reorg

• Recluster Via Table Scan

• Reorg Data Only.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Space

> Reorganization tab

R

OLLFORWARD TAB

Recovering database changes is time-consuming. You can use the database system monitor to monitor the progression of a recovery. This section provides the following elements to help you monitor the status of rollforwards:

Timestamp: Timestamp of the log being processed. This is an indicator of the data changes that will be recovered

Tablespace: Tablespace being rolled forward. This element identifies the tablespaces involved in the rollforward

Type: An indicator of whether the recovery is happening at a database or tablespace level

Log#: The log being currently processed. This identifies the log involved in the rollforward.

Status: The status of rollforward recovery. This metric indicates if the recovery is in an undo

(rollback) or redo (rollforward) phase.

#Tablespaces: Number of tablespaces involved in the rollforward

Node: Indicates the database partition number for the rollforward operation

U

SERS

The database activity can be examined using key performance metrics and wait/bottleneck-

based analysis. In addition to a Home page, the Users category of DB2 Performance Analyst

includes the following tabbed pages:

Top Sessions tab

Attributes tab

Cursors tab

Lock Waits tab

SQL Activity tab

Locks tab

H

OME

The Home page of the Users performance category view displays the vital DB2 user statistics in the following categories:

Key User Analysis Pane

Connection Analysis Pane

Bottleneck Analysis Pane

SQL Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1497

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

K

EY

U

SER

A

NALYSIS

P

ANE

Database performance analysts typically use one of two methods for examining the performance levels of a database - ratio-based or wait/bottleneck-based. Ratio-based analysis involves examining a number of key database ratios that can be used to indicate how well a database is running. Performance ratios serve as very good roll-up mechanisms for busy DBAs to use for at-a-glance performance analysis. Many DBAs have large database farms to contend with and cannot spend time checking detailed wait-based analysis outputs for each and every database they oversee. Succinctly presented performance ratios can assist in such situations by giving DBAs a few solid indicators that can be quickly scanned to see if any database needs immediate attention.

While there are certainly many opinions as to what rules to follow, there are some standards that should always be adhered to. To start with, many of the formulas that make up ratio-based analysis must be derived from delta measurements instead of cumulative statistics. Many of the global ratios that a DBA will examine come from the DB2 Snapshot Monitor. The snapshot monitor returns metrics for the Instance and particular databases since the start of monitoring.

Some metrics are cumulative (e.g., counters) and others are instantaneous (e.g., gauges).

A final thing to remember about using ratio-based analysis is that, while there are a number of rules of thumb that can be used as starting points to begin the evaluation of database performance, DBAs must determine each SQL Server's individual 'personality' with respect to the key performance ratios. Some hard and fast rules simply do not apply to every database. The danger in using blanket ratio standards is that they can lead the DBA to haphazardly take action, which can at times contribute nothing to the situation, and sometimes even degrade performance.

The following ratios are used on the Performance Analyst User page to succinctly communicate the general overall performance levels of the monitored database:

Efficiency

Transactions/sec

Static SQL/sec Dynamic SQL/sec

Activity

Location

Applications Executing Connections High Watermark

T

RANSACTIONS

/

SEC

Transactions/sec is the number of transactions (units of work) completed per second on the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

A small rate of transactional activity on the database can indicate that applications are not doing frequent commits, which may lead to logging and concurrency problems.

Correction Drill down to the Users Detail>SQL Activity page to check which applications are running their transactions for long periods of time

14 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

S

TATIC

SQL/

SEC

The static SQL/sec metric is the number of static SQL statement executions attempt on the database each second.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

D

YNAMIC

SQL/

SEC

This metric is the number of dynamic SQL statement executions being attempted on the database each second.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

A

PPLICATIONS

I

DLE

The idle applications metric indicates the number of applications that are currently connected to the database for which the database manager is not executing any requests

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

This can help you understand the level of activity within a database and the amount of system resource being used.

A

PPLICATIONS

E

XECUTING

The executing applications statistic indicates the number of applications for which the database manager is currently executing requests.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

You can use this element to understand how many of the database manager agent tokens are being used by applications connected to this database.

C

ONNECTIONS

H

IGH

W

ATERMARK

The connections high watermark is the highest number of simultaneous connections to the database since the database was activated.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Key User Analysis Pane

Metrics You can use this element to evaluate the setting of the maxappls configuration parameter. If the value of this element is the same as the maxappls parameter, it is likely that some database connection requests were rejected, since maxappls limits the number of database connections allowed.

Correction Increase the value of the maxappls parameter to allow more connections.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1499

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

B

OTTLENECK

A

NALYSIS

P

ANE

When a DB2 database is active, the applications accessing the database can either successfully access the database resources, or they can wait for resources to become available. An application that is waiting can indicate normal database activity, or it can be an indicator that a database bottleneck exists. This is where wait-based or bottleneck analysis comes into play. A database administrator can use this form of performance analysis to determine if perceived bottlenecks in a database are contributing to a performance problem.

Performance Analyst Bottleneck analysis section helps a DBA isolate potential problem areas where there are waits, resource overloads or potential failures. If concurrency issues or heavy table scan activity has been dragging a database's performance down, a DBA can use bottleneck analysis to isolate the root cause. Once one or more bottlenecks have been isolated as possible areas of interest, the DBA can drill down and examine details on why the applications or resources are causing the problem. The Performance Analyst Users page identifies the top system and application bottlenecks that may be currently a cause of lessened performance.

The following bottleneck indicators are used on the Performance Analyst Home page to succinctly communicate the general overall performance level of the monitored database:

Top Bottlenecked User Processes

Waits

Automatic Rebinds

Deadlocks

Internal Rollbacks

Timeouts

The following statistics, appearing on this page, duplicate statistics available on the Bottleneck

Analysis Pane

of the

Home

page:

Lock Escalations

Sort Overflows

Failed SQL

The following statistic, available on this pane, duplicates a statistic on the SQL Analysis Pane of

the Home page:

Failed SQL

T

OP

B

OTTLENECKED

U

SER

P

ROCESSES

The top bottlenecked user processes grid shows the top bottlenecked applications in the system. These applications are either performing the top I/O operations or have idled the longest to obtain locks.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

A

UTOMATIC

R

EBINDS

The automatic rebinds statistic is the number of automatic rebinds (or recompiles) that have been attempted.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

15 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Metrics Automatic rebinds are the internal binds the system performs when an package has been invalidated.

The rebind is performed the first time the database manager needs to execute an SQL statement from the package. For example, packages are invalidated when you:

Drop an object, such as a table, view, or index, on which the plan depends

Add or drop a foreign key

Revoke object privileges on which the plan depends.

Since automatic rebinds can have a significant impact on performance, they should be minimized where possible.

I

NTERNAL

R

OLLBACKS

The internal rollbacks statistic is the total number of rollbacks initiated internally by the database manager.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

An internal rollback occurs when any of the following cannot complete successfully:

A reorganization

An import

A bind or pre-compile

An application ends as a result of a deadlock situation or lock timeout situation

An application ends without executing an explicit commit or rollback statement (on Windows).

W

AITS

The lock waits metric is the total number of times that applications or connections waited for locks within the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

D

EADLOCKS

The deadlocks statistic is the total number of deadlocks that have occurred since this instance of

Performance Analyst started monitoring the database.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

Metrics If a large number of deadlocks are detected, it can indicate that applications are experiencing lock contention problems. Deadlocks are usually caused by one of the following situations:

Lock escalations on the database

Catalog tables locked for Repeatable Read

Applications are using inappropriate isolation levels at bind time

Applications are obtaining the same locks in a different order

Applications are locking tables explicitly where row level locks are sufficient.

Correction You may be able to modify the applications causing lock contentions for better concurrency. To identify the applications that may be causing contentions, go to the Lock Waits tab of the Users detail page and review the Application Details section.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1501

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

IMEOUTS

The lock timeouts metric identifies the number of times that a request to lock an object timed out without being granted.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Bottleneck Analysis Pane

Metrics If the number of lock timeouts becomes excessive when compared to the acceptable range for your database, it can indicate that an application is holding locks for long durations. It can also indicate that the amount of time an application waits for a lock before timing out is too short.

If you have too few lock timeouts and the average lock wait time is too high, it can indicate that the lock timeout configuration parameter is set to an excessively high value

Correction First you should examine the lock activity at the application level (Users>Lock, Lock Waits drilldown) to identify any particular application that is causing excessive lock contentions. If so, you can tune the application to provide better concurrency. If lock timeouts are excessive, and average lock wait times are very short, you can increase the locktimeout database configuration parameter to make the applications wait longer before timing out.

SQL A

NALYSIS

P

ANE

Most of database's I/O performance can be attributed to SQL statement execution. Poorly optimized SQL statements can drag down an otherwise well-configured server in terms of user response times.

This section shows a snapshot of row level SQL operations that have been performed on the database since you started monitoring. This gives you an insight into the row level of read/write activity that is currently occurring within the database and comparing this to the prefetcher, and cleaner activity allows you to relate the two.

The following statistics are used on the Performance Analyst for DB2 User home page to succinctly communicate the general overall performance levels of I/O. They duplicate statistics

appearing on the SQL Analysis Pane

of the I/O Home page.:

Rows Deleted

Rows Updated

Rows Inserted

Rows Read

Rows Selected

C

ONNECTION

A

NALYSIS

P

ANE

The Connection Analysis section displays the level of application connect/disconnect activity occurring on the database.

The following statistics are used on the Performance Analyst for DB2 User home page to succinctly communicate general overall connectivity:

Current Connections

High Watermark for Concurrent Connections

Disconnects Connections Since Database Activation

15 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

C

URRENT

C

ONNECTIONS

The current connections metric is the number of applications currently connected to the database.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Connection Analysis Pane

You can use this metric to help you get an overview of the level of database activity and the amount of system resources in use.

Correction This metric can help you adjust the setting of the maxappls and max_coordagents configuration parameters. For example, if this value is always the same as maxappls, you consider increasing the value of maxappls.

D

ISCONNECTS

This metric shows the number of disconnects from the database since the first connect, activate, or last reset.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Connection Analysis Pane

C

ONNECTIONS

S

INCE

D

ATABASE

A

CTIVATION

The connections since database activation statistic indicates the number of connections to the database since the first connect, activate, or last reset.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Connection Analysis Pane

Use this metric in conjunction with the database connection time and the database start time to see if the application connection frequency is low. When there are no connections to db2, by default the database is automatically deactivated until the next connection. The connection that reactivates the database encounters slow connection time because it needs to wait for the database to reinitialize. If very few applications are connecting to the database, some connections can be slow because of this

Correction If there are short periods when your database has no applications connected to it, activate the database explicitly using the ACTIVATE DATABASE command. This significantly improves the connection performance for the database.

H

IGH

W

ATERMARK FOR

C

ONCURRENT

C

ONNECTIONS

The connections high watermark is the highest number of simultaneous connections to the database since the database was activated.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users > Home >

Connection Analysis Pane

You can use this element to evaluate the setting of the maxappls configuration parameter. If the value of this element is the same as the maxappls parameter, it is likely that some database connection requests were rejected, since maxappls limits the number of database connections allowed.

Correction Increase the value of the maxappls parameter to allow more connections.

W

ORKLOAD

A

NALYSIS

P

ANE

When your phone starts ringing with complaints of performance slowdowns, one of the first things you should get a handle on is:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1503

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Who is currently connected to the database?

• What resources are they using?

• What are they currently executing?

The Workload Analysis section of the Performance Analyst Users page provides insight into the leading resource hogs of a server. Drill-downs are available so you can easily get detailed information into what each leading application is currently involved with. The Workload Analysis section presents the following metrics:

Top Lock Escalations

Top CPU Process

Top I/O Process

Oldest Transaction

The top lock escalation displays the application with largest number of lock escalations.

The top CPU process displays the application with the highest CPU usage.

The top I/O process displays the application with the highest I/O read/write time.

The oldest transaction displays the application with the longest running current transaction.

T

OP

S

ESSIONS TAB

Very often, one renegade client application brings a healthy database down by hogging most of the available resources. This page shows the top resource hogs in each of the resource usage areas to help you quickly identify the worst offenders in each area. You see:

Top I/O Process

Top Sessions

Top Memory Process

Top CPU Process

T

OP

I/O P

ROCESS

This section shows the application with the top IO time and compares it with the IO time of all other applications.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Top Sessions tab

The metrics are calculated by measuring the total time spent by each application doing reads and writes (buffered and non-buffered).

T

OP

M

EMORY

P

ROCESS

This section shows the application with the largest memory pool usage aggregate. It also shows the total memory pool usage for all other applications.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Top Sessions tab

This metric is calculated by aggregating all of the memory pools for each application and showing the top application. This section is useful in determining if the top application is using a lot more resources

15 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

T

OP

CPU P

ROCESS

This section shows the application with the top CPU time usage and compares it with the CPU usage of all other applications.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Top Sessions tab

Metrics are calculated using the total user and system CPU time for each application connected to the database.

T

OP

S

ESSIONS

Shows a list of all applications connected to the database and the resource usage for these applications. The information presented for each application includes:

Auth ID: The authorization ID of the user who invoked the application that is being monitored

Name: The name of the application running at the client as known to the database manager

Handle: A system-wide unique ID for the application. On a single-partitioned database, it consists of a 16 bit counter. On a multi-partitioned database, it consists of the coordinating partition number concatenated with a 16 bit counter. In addition, this identifier will be the same on every partition where the application may make a secondary connection.

ID: This identifier is generated when the application connects to the database at the database manager

Client PID: The process ID of the client application that made the connection to the database

I/O Time: The total time spent by application in performing buffered and non-buffered reads and writes

Memory Usage: Total memory pool usage for the application

CPU Time: The total user + system cpu time used by the application agents

# Agents: Number of agents for the application

Status: Current Status of the application. Values for this field are:

• Database Connect Pending: The application has initiated a database connection but the request has not yet completed.

• Database Connect Completed: The application has initiated a database connection and the request has completed.

• Unit of Work Executing: The database manager is executing requests on behalf of the unit of work.

• Unit of Work Waiting: The database manager is waiting on behalf of the unit of work in the application. This status typically means that the system is executing in the application's code.

• Lock Wait: The unit of work is waiting for a lock. After the lock is granted, the status is restored to its previous value.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1505

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

• Commit Active: The unit of work is committing its database changes.

• Rollback Active: The unit of work is rolling back its database changes.

• Recompiling: The database manager is recompiling (that is, rebinding) a plan on behalf of the application.

• Compiling: The database manager is compiling an SQL statement or precompiling a plan on behalf of the application.

• Request Interrupted: An interrupt of a request is in progress.

• Database Disconnect Pending: The application has initiated a database disconnect but the command has not yet completed executing. The application may not have explicitly executed the database disconnect command. The database manager will disconnect from a database if the application ends without disconnecting.

• Decoupled from Agent: The application has been decoupled from an agent.

• Transaction Prepared: The unit of work is part of a global transaction that has entered the prepared phase of the two-phase commit protocol.

• Transaction Heuristically Committed: The unit of work is part of a global transaction that has been heuristically committed.

• Transaction Heuristically Rolled Back: The unit of work is part of a global transaction that has been heuristically rolled-back.

• Transaction Ended: The unit of work is part of a global transaction that has ended but has not yet entered the prepared phase of the two-phase commit protocol.

• Creating Database: The agent has initiated a request to create a database and that request has not yet completed.

• Restarting Database: The application is restarting a database in order to perform crash recovery.

• Restoring Database: The application is restoring a backup image to the database.

• Backing Up Database: The application is performing a backup of the database.

• Data Fast Load: The application is performing a "fast load" of data into the database.

• Data Fast Unload: The application is performing a "fast unload" of data from the database.

• Wait to Disable Tablespace: The application has detected an I/O error and is attempting to disable a particular table space. The application has to wait for all other active transactions on the table space to complete before it can disable the table space.

• Quiescing a Tablespace: The application is performing a quiesce table space request.

• Wait for Remote Partition: The application is waiting for a response from a remote partition in a partitioned database instance.

• Remote Request Pending: The application is waiting for results from a federated datasource.

15 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Last UOW Start Time: The date and time that the unit of work first required database resource

Last UOW End Time: The date and time that the most recent unit of work completed, which occurs when database changes are committed or rolled back

Current UOW Elapsed Time: The elapsed execution time of the most recently completed unit of work.

Login Timestamp: The date and time that a connection request was granted.

Inbound Comm Address: This is the communication address of the client.

Client Protocol: The communication protocol that the client application is using to communicate with the server.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Top Sessions tab

C

URSORS TAB

The Cursors tab of the Users Detail view displays the Application SQL Cursor Activity. It details the SQL cursors open for each application. The information presented here includes:

Open Cursors: The number of cursors (local and remote) currently open for an application.

Blocking Cursors: The number of blocking cursors (local and remote) currently open for the application

Block Requests Accepted: The percentage of all blocking I/O requests that were accepted by the database

Block Requests Rejected: The percentage of all blocking I/O requests that were rejected by the database

Metrics

The number of blocking cursors for an application should be close to the number of open cursors. If this is not the case the application performance may be affected. If there are many cursors blocking data, the communication heap may become full. When this happens, instead of returning an error, the database stops allocating I/O blocks for blocking cursors.

Correction

If the number of blocking cursors in an application is not close to the number of open cursors, you may be able to improve application performance by tweaking the precompile options for record blocking for the treatment of ambiguous cursors, and by redefining the cursors with FOR

FETCH ONLY clause where possible

If a large number of cursors were unable to perform blocking, you may be able to improve performance by increasing the query_heap database manager configuration parameter.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1507

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

SQL A

CTIVITY TAB

The SQL Activity tab of the Users Detail view displays the following statistics:

Application List

UOW Details

SQL Executed

Binds and Precompiles Executed

SQL Activity

A

PPLICATION

L

IST

This section shows a list of applications connected to the database. You can select an application from this list and see details for the SQL activity for this application.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

SQL Activity tab

SQL E

XECUTED

This section shows the details for the various types of SQL statements executed by the particular application. It also gives you the total application throughput. The information presented here includes:

Selects: Percentage of statements that are select statements

Updates/Inserts/Deletes: Percentage of statements that modify/write data on the database

DDLs: Percentage of CREATE/DROP/ALTER statements

Others: All other types of statements (Fetch, Open cursor etc)

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

SQL Activity tab

Various types of statements have varying impact on the performance and concurrency of the database. For example - DDL statements can cause catalog and package cache invalidations, Insert/ update/delete statements usually obtain locks and perform log IO. This section can help you determine the contributing statement types to the activity for an application.

SQL A

CTIVITY

This section gives details on the sql activity for the selected application. It allows you to quick compare the number of static dynamic and failed sql statements with the overall application throughput. The metrics presented here include:

Static SQL: The number of static SQL statements that the application tried to execute

Dynamic SQL: The number of dynamic SQL statements that the application tried to execute

Failed SQL: The number of SQL statements (static and dynamic) that the application tried to execute but failed

SQL Throughput: Number of SQL statements (dynamic and static) that the application executed successfully

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

SQL Activity tab

15 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Metrics These elements may help you determine the nature of the application. Failed SQL statements metric may also help identify the cause of poor performance on the database since failed statements mean time wasted by the database manager.

UOW D

ETAILS

Shows the units of work being completed by the application over the refresh time interval.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

SQL Activity tab

A low rate of unit of work completion may be an indicator of one of the following:

The application is not committing transactions frequently and may be causing concurrency issues for other applications

The application is idling and not performing any work on the server

Correction Examine the locks obtained by the application (Users Detail >Locks page) to see if a low number here should be a cause for concern.

B

INDS AND

P

RECOMPILES

E

XECUTED

This section shows the total number of implicit and explicit binds and precompiles executed by the application.

Implicit rebinds are performed by the system when the application tries to execute a sql statement from a package and the package has been invalidated. A package is usually invalidated when you perform DDL/DCL operations on objects on which the package plan is dependent. Explicit rebinds occur when the user executes the REBIND PACKAGE command.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

SQL Activity tab

Bind and precompile operations have significant overhead for the database operations and they should be minimized during periods of heavy usage when possible.

A

TTRIBUTES TAB

The Attributes tab of the Users Detail page displays the following statistics:

Application List

Indirect Authorities

Application Attributes

Direct Authorities

A

PPLICATION

L

IST

This section shows the list of applications connected to the database. The user can obtain further details for an application from other sections on this page by selecting the application from this list.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Attributes tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1509

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

A

PPLICATION

A

TTRIBUTES

Shows the main information for the selected application. This information is useful in determining the applications connection attributes and its state.The information shown here includes:

Application Status: The status of the application. Values for this field are:

• Database Connect Pending: The application has initiated a database connection but the request has not yet completed.

• Database Connect Completed: The application has initiated a database connection and the request has completed.

• Unit of Work Executing: The database manager is executing requests on behalf of the unit of work.

• Unit of Work Waiting: The database manager is waiting on behalf of the unit of work in the application. This status typically means that the system is executing in the application's code.

• Lock Wait: The unit of work is waiting for a lock. After the lock is granted, the status is restored to its previous value.

• Commit Active: The unit of work is committing its database changes.

• Rollback Active: The unit of work is rolling back its database changes.

• Recompiling: The database manager is recompiling (that is, rebinding) a plan on behalf of the application.

• Compiling: The database manager is compiling an SQL statement or precompiling a plan on behalf of the application.

• Request Interrupted: An interrupt of a request is in progress.

• Database Disconnect Pending: The application has initiated a database disconnect but the command has not yet completed executing. The application may not have explicitly executed the database disconnect command. The database manager will disconnect from a database if the application ends without disconnecting.

• Decoupled from Agent: The application has been decoupled from an agent.

• Transaction Prepared: The unit of work is part of a global transaction that has entered the prepared phase of the two-phase commit protocol.

• Transaction Heuristically Committed: The unit of work is part of a global transaction that has been heuristically committed.

• Transaction Heuristically Rolled Back: The unit of work is part of a global transaction that has been heuristically rolled-back.

• Transaction Ended: The unit of work is part of a global transaction that has ended but has not yet entered the prepared phase of the two-phase commit protocol.

15 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

• Creating Database: The agent has initiated a request to create a database and that request has not yet completed.

• Restarting Database: The application is restarting a database in order to perform crash recovery.

• Restoring Database: The application is restoring a backup image to the database.

• Backing Up Database: The application is performing a backup of the database.

• Data Fast Load: The application is performing a "fast load" of data into the database.

• Data Fast Unload: The application is performing a "fast unload" of data from the database.

• Wait to Disable Tablespace: The application has detected an I/O error and is attempting to disable a particular table space. The application has to wait for all other active transactions on the table space to complete before it can disable the table space.

• Quiescing a Tablespace: The application is performing a quiesce table space request.

• Wait for Remote Partition: The application is waiting for a response from a remote partition in a partitioned database instance.

• Remote Request Pending: The application is waiting for results from a federated datasource.

ID of code page used by the application: The code page identifier.

Application status change time: The date and time the application entered its current status.

Sequence Number: This is incremented whenever a unit of work ends (that is, when a COMMIT or ROLLBACK terminates a unit of work). Together, the application id and sequence number uniquely identify a transaction.

Client Product/Version ID: The product and version of DB2 that is running on the client.

Database Alias used by the Application: The alias of the database provided by the application to connect to the database.

User login id: The ID that the user specified when logging in to the operating system. This ID is distinct from auth_id, which the user specifies when connecting to the database

DRDA correlation token: The DRDA correlation token is used for correlating the processing between the application server and the application requester. It is an identifier dumped into logs when errors arise, that you can use to identify the conversation that is in error. In some cases, it will be the LUWID of the conversation

Client operating platform: The operating system on which the client application is running.

Database territory code: The territory code of the database for which the monitor data is collected

Application agent priority: The priority of the agents working for this application

Application priority type: Operating system priority type for the agent working on behalf of the application

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1511

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Coordinating node: In a multinode system, the node number of the node where the application connected or attached to the instance

Connection request start timestamp: The date and time that an application started a connection request.

Connection request completion timestamp: The date and time that a connection request was granted.

Previous unit of work completion timestamp: This is the time the unit of work completed.

Unit of work start timestamp: The date and time that the unit of work first required database resources.

Unit of work stop timestamp: The date and time that the most recent unit of work completed, which occurs when database changes are committed or rolled back.

Most recent unit of work elapsed time: The elapsed execution time of the most recently completed unit of work.

Unit of work completion status: The status of the unit of work and how it stopped.

Application idle time: Number of seconds since an application has issued any requests to the server. This includes applications that have not terminated a transaction, for example not issued a commit or rollback.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Attributes tab

D

IRECT

A

UTHORITIES

Shows the highest level of direct authority granted to the application

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Attributes tab

I

NDIRECT

A

UTHORITIES

Shows the highest level of indirect authority granted to the application

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Attributes tab

L

OCK

W

AITS TAB

The Lock Waits tab of the Users Detail view shows the details for all applications in the database that are waiting on locks. This information is useful in tracking concurrency issues in the database. The statistics available here are:

Application Details Applications Waiting on Locks

The following statistic, available on this tab, duplicates a statistic on the Bottleneck Analysis

Pane

of the

Home page:

15 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Avg. Lock Wait Time

A

PPLICATION

D

ETAILS

This section shows the list of applications waiting for locks to be released on objects they need to access. The information presented here includes:

Auth ID: The authorization ID of the user who invoked the application that is being monitored.

Name: Name of the application executable

Handle: A systemwide unique ID for the application

ID: This identifier is generated when the application connects to the database at the database manager

Client PID: The process ID of the client application that made the connection to the database

Total Lock Waits: The total number of times that applications or connections waited for locks

Total Lock Waiting Time: This is the total amount of elapsed time that this connection or transaction has waited for a lock to be granted to it.

Locks Waiting: Indicates the number of agents waiting on a lock

UOW Lock Waiting Time: The total amount of elapsed time current unit of work has spent waiting for locks

Wait Start Time: The date and time that this application started waiting to obtain a lock on the object that is currently locked by another application

Lock App Handle: System wide Unique ID of the application holding the lock

Lock App ID: ID of the application holding the lock

Lock Sequence ID: The sequence number of the application that is holding a lock on the object that this application is waiting to obtain.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Lock Waits tab

AuthID, Name, Handle, ID, and Client PID help you identify the application waiting on the lock.

Lock App Handle, Lock App ID, and Lock Sequence number help you identify the application that is holding the waited on lock. You can use this information on Users Detail Locks tab to get further details on the application holding the locks and the locks it’s holding.

Correction If an application is not performing well, and it has a high number of total lock waits, and a high total lock waiting time you may need to improve concurrency of the applications that are holding the locks.

A

PPLICATIONS

W

AITING ON

L

OCKS

This metric indicates the percentage of all connected applications waiting on locks.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Lock Waits tab

If this number is high, the application may have concurrency problems.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1513

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction You can identify the applications that are holding locks or exclusive locks for a long time from the

Users Detail> Locks page and tune such applications for better concurrency.

L

OCKS TAB

The Locks tab of the Users Detail view gives you information for the following statistics:

Application Details Locks Held Details

Locks Waiting Details

A

PPLICATION

D

ETAILS

This section shows a list of applications connected to the database. You can look at the lock details for an application in the list by selecting the application. The attributes presented for each application include:

Handle: A system-wide unique ID for the application

ID: This identifier is generated when the application connects to the database at the database manager

Seq No

Name: Name of the application executable

Auth ID: The authorization ID of the user who invoked the application that is being monitored.

Status

Code Page

Locks Held

Total Wait Time:

UOW Lock Waiting Time

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Locks tab

L

OCKS

H

ELD

D

ETAILS

This section gives the details of all the locks that the selected application is currently holding.

The details presented here include:

Lock Name: Internal binary lock name. This element serves as a unique identifier for locks

Lock Attributes: Gives the lock attribute settings

Release Flags: The lock release flags can either be untracked or SQL Compiler

15 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Lock Count: The number of locks on the lock being held. This value ranges from 1 to 255. It is incremented as new locks are acquired, and decremented as locks are released. When lock_count has a value of 255, this indicates that a transaction duration lock is being held. At this point, lock_count is no longer incremented or decremented when locks are acquired or released. The lock_count element is set to a value of 255 in one of two possible ways:

1 lock_count is incremented 255 times due to new locks being acquired.

2 A transaction duration lock is explicitly acquired. For example, with a LOCK TABLE statement, or an INSERT.

Hold Count: The number of holds placed on the lock. Holds are placed on locks by cursors registered with the WITH HOLD clause and some DB2 utilities. Locks with holds are not released when transactions are committed.

Object Name: It is the name of the object for table-level locks is the file ID (FID) for SMS and

DMS table spaces. For row-level locks, the object name is the row ID (RID). For table space locks, the object name is blank. For buffer pool locks, the object name is the name of the buffer pool.

Object Type: The type of object against which the application holds a lock (for object-lock-level information), or the type of object for which the application is waiting to obtain a lock (for application-level and deadlock-level information).

Tablespace: This is the name of the table space against which the lock is held.

Table Schema: Schema of the table that the lock is on

Table Name: Name of the table that the lock is on. This element is only set if Object Type indicates Table

Lock Mode: The type of lock being held.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Locks tab

L

OCKS

W

AITING

D

ETAILS

This section gives the details of all the locks that the selected application is currently waiting on.

The details include:

Subsection: Identifies the subsection associated with the waited on lock

Agent ID: The application handle of the agent holding a lock for which this application is waiting

App ID: The application ID of the application holding a lock on the object that this application is waiting to obtain.

Lock Name: Internal binary lock name. This element serves as a unique identifier for locks.

Lock Attributes: Gives the lock attribute settings

Release Flags: Lock release flags

Object Type: The type of object against which the application holds a lock

Lock Mode: The type of lock being held

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1515

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Lock Mode Requested: The lock mode being requested by the application

Tablespace: This is the name of the table space against which the lock is held.

Table Schema: Schema of the table that the lock is on

Table Name: Name of the table that the lock is on. This element is only set if Object Type indicates Table

Wait Start Timestamp: The date and time that this application started waiting to obtain a lock on the object that is currently locked by another application

Escalation: Indicates whether a lock request was made as part of a lock escalation.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Users >

Locks tab

C

FG

(D

ATABASE

C

ONFIGURATION

)

The Database Configuration view displays the following tabbed pages:

Configuration tab

Objects tab

History tab

Indoubt Transactions tab

C

ONFIGURATION TAB

This tab lets you view the current values for the DB2 database configuration parameters.

H

ISTORY TAB

The History tab of the Database Configuration Details viewlets you browse the history file entries for the database. The history file contains a record of recovery and administrative events.

Recovery events include full database and table space level backup, incremental backup, restore, and rollforward operations. Additional logged events include create, alter, drop, or rename table space, reorganize table, drop table, and load.

On this tab, you’ll find the following information:

History Details

DDL View

SQLCA Structure Tablespaces List

15 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

H

ISTORY

D

ETAILS

This section allows you to select the operation for which you want to see the history details. You can also narrow the history list to operations since a certain date or operations involving a certain object name. You can show the history for the following types of operations:

Backups

Quiesce

Tablespace Alters

Tablespace Drops

Dropped Tables

Reorganizations

Tablespace Renames

Load

Rollforward

Tablespace Creates

You can see further detail on some operations in the lower sections, by selecting that operation from the history detail operation list.

SQLCA Structure

Tablespaces List

DDL View

Shows the SQLCA structure for the selected operation from the history detail. This information is not available for Quiesce, Rollforward, and Reorganization operations.

Shows the list of tablespaces involved in the selected operation in history detail.

Shows the DDL for the selected operation in the history detai

I

NDOUBT

T

RANSACTIONS TAB

The Indoubt Transactions tab provides a list of transactions that are in doubt. The Indoubt

Transaction Detail metrics displayed for each indoubt transaction include:

Application ID: Specifies the application identifier assigned by the database manager for this transaction

Sequence Number:

Specifies the sequence number assigned by the database manager as an extension to the application ID

Status:

Indicates the status of this indoubt transaction. Valid values are:

SQLXA_TS_PREP The transaction is prepared. The connected parameter can be used to determine whether the transaction is waiting for the second phase of normal commit processing or whether an error occurred and resynchronization with the transaction manager is required.

SQLXA_TS_HCOM The transaction has been heuristically committed.

SQLXA_TS_HROL The transaction has been heuristically rolled back.

SQLXA_TS_MACK The transaction is missing commit acknowledgement from a node in a partitioned database.

SQLXA_TS_END The transaction has ended at this database. This transaction may be re-activated, committed, or rolled back at a later time. It is also possible that the transaction manager encountered an error and the transaction will not be completed. If this is the case, this transaction requires heuristic actions, because it may be holding locks and preventing other applications from accessing data.

Timestamp:

Specifies the time when the transaction entered the indoubt state.

Auth ID:

Specifies the authorization ID of the user who ran the transaction.

Log Full: Indicates whether or not this transaction caused a log full condition

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1517

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Originator

XID: Specifies the XA identifier assigned by the transaction manager to uniquely identify a global transaction

O

BJECTS TAB

Tables and indexes consume the storage in all databases. The Database Object Detail grid displays object space details for the database selected in the Database Object Summary grid.

The following statistics are presented for tables:

Table Schema: The owner of the object

Table Name: The name of the object

File Group: File group where the object resides

Reserved (KB): The amount of space (in KB) reserved by the object

Used (KB): The amount of space (in KB) used by the object

Free (KB): The amount of free space (in KB) used by the object

Percent Used: The percentage of space used by the object

I

NSTANCE

The Embarcadero Performance Analyst Instance view lets you review availability and overall performance of all monitored databases from a single window.

In addition to a Home

page, the Instance category of DB2 Performance Analyst includes the following tabbed pages:

Configuration tab

FCM Resources tab

Sorts & Joins tab

Agents & Connections tab

FCM Throughput tab

Utilities tab

Memory Pools tab

H

OME

Statistics on the Instance home view are organized into the following categories:

Agent Analysis Pane

Instance Information Pane

Bottleneck Analysis Pane

Key Ratio Analysis Pane

Location

15 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

A

GENT

A

NALYSIS

P

ANE

The Agent Analysis section presents the following metrics:

Connections

Agents Waiting

Connections Executing

Idle Agents

Agents Registered

C

ONNECTIONS

The connections statistic gives the total Number of connections to databases in the current instance.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Agent Analysis Pane

Metrics Shows the number of connections from remote/local clients to databases in this instance. This changes frequently, so you may need to sample it at specific intervals over an extended period of time to get a realistic view of system usage.

Correction This element can help you adjust the setting of the max_coordagents configuration parameter.

C

ONNECTIONS

E

XECUTING

The connections executed statistic is the number if applications that are currently connected to a database and are currently processing a unit of work within the Database Manager instance being monitored.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Agent Analysis Pane

The connections executing metric can help you determine the level of concurrent processing occurring on the Database Manager. This value can change frequently, so you may need to sample it at specific intervals over an extended period of time to get a realistic view of system usage

Correction This element can help you adjust the setting of the maxcagents configuration parameter.

A

GENTS

R

EGISTERED

The agents registered metric is the number of agents registered in the Database Manager instance that is being monitored (coordinator agents and subagents).

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Agent Analysis Pane

Correction You can use this element to help evaluate your setting for the maxagents configuration parameter.

A

GENTS

W

AITING

The number of agents waiting for a token so they can execute a transaction in the database manager.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Agent Analysis Pane

Each application has a dedicated coordinator agent to process database requests within the

Database Manager. Furthermore, each agent has to get a token before it can execute a transaction.

The maximum number of agents that can execute Database Manager transactions is limited by the configuration parameter maxcagents.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1519

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction You can use this element to help evaluate your setting for the maxcagents configuration parameter.

I

DLE

A

GENTS

The idle agents metric is the number of agents in the agent pool that are currently unassigned to an application and are, therefore, "idle.”

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Agent Analysis Pane

Having idle agents available to service requests for agents can improve performance.

Correction You can use this element to help set the num_poolagents configuration parameter.

B

OTTLENECK

A

NALYSIS

P

ANE

The Bottleneck Analysis section presents the following metrics:

Sorts and Joins

Post Threshold Sorts

Piped Sorts Rejects Hash Join Thresholds

Agent Bottlenecks

Agents Waiting on a Token

Agents Created Due to Empty Pool

P

OST

T

HRESHOLD

S

ORTS

This metric shows the number of sorts that have requested heaps after the sort heap threshold has been exceeded.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Bottleneck Analysis Pane

Under normal conditions, the Database Manager allocates sort heap using the value specified by the

sortheap configuration parameter. If the amount of memory allocated to sort heaps exceeds the sort heap threshold (sheapthres configuration parameter), the database manager allocates sort heap using a value less than that specified by the sortheap configuration parameter.

Each active sort on the system allocates memory, which may result in sorting taking up too much of the system memory available. Sorts that start after the sort heap threshold has been reached may not receive an optimum amount of memory to execute. As a result, however, the entire system may benefit.

Correction

By modifying the sort heap threshold and sort heap size configuration parameters, the performance of sort operations and/or the overall system can be improved. If this element's value is high, you can:

Increase the sort heap threshold (sheapthres) or,

Adjust applications to use fewer or smaller sorts via SQL query changes.

15 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

P

IPED

S

ORTS

R

EJECTS

The piped sorts rejects statistic is the number of piped sorts that were rejected by the database manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Bottleneck Analysis Pane

Metrics Each active sort allocates memory, and can result in sorting taking up too much available system memory. A piped sort is not accepted if the sort heap threshold is exceeded when the sort heap is allocated for the sort. The sort list heap (sortheap) and sort heap threshold (sheapthres) configuration parameters help control the amount of memory used for sort operations. These parameters are also used to determine whether a sort will be piped. Since piped sorts may reduce disk I/O, allowing more piped sorts can improve the performance of sort operations and possibly the performance of the overall system.

Correction If piped sorts are being rejected, you might consider decreasing your sort heap or increasing your sort heap threshold. You should be aware of the possible implications of either of these options. If you increase the sort heap threshold there is the possibility that more memory will remain allocated for sorting. This could cause paging memory to disk. If you decrease the sort heap, you might require an extra merge phase that could slow down the sort

H

ASH

J

OIN

T

HRESHOLDS

The hash join thresholds metric is the total number of times that a hash join heap request was limited because of concurrent use of shared or private sort heap.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Bottleneck Analysis Pane

Metrics Each active sort allocates memory, and can result in sorting taking up too much of the available system memory. A piped sort is not accepted if the sort heap threshold is exceeded when the sort heap is allocated for the sort. The sort list heap (sortheap) and sort heap threshold (sheapthres) configuration parameters help control the amount of memory used for sort operations. These parameters are also used to determine whether a sort will be piped. Since piped sorts may reduce disk I/O, allowing more piped sorts can improve the performance of sort operations and possibly the performance of the overall system.

Correction If this value is large (greater than 5% of

Hash Join Overflows ), the sort heap threshold should be

increased.

A

GENTS

W

AITING ON A

T

OKEN

The agents waiting statistic is the percentage of agents registered that are waiting for a token so they can execute a transaction in the Database Manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Bottleneck Analysis Pane

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1521

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Metrics Each application has a dedicated coordinator agent to process database requests within the

Database Manager. Each agent has to get a token before it can execute a transaction.

The maximum number of agents that can execute database manager transactions is limited by the configuration parameter maxcagents. This parameter is used to control the load on the system during periods of high simultaneous application activity. For example, you may have a system requiring a large number of connections but with a limited amount of memory to serve those connections.

Adjusting this parameter can be useful in such an environment, where a period of high simultaneous activity could cause excessive operating system paging.

This parameter does not limit the number of applications that can have connections to a database. It only limits the number of Database Manager agents that can be processed concurrently by the

Database Manager at any one time, thereby limiting the usage of system resources during times of peak processing.

Correction In cases where the high concurrency of applications is causing problems, you can use benchmark testing to tune this parameter to optimize the performance of the database.

A

GENTS

C

REATED

D

UE TO

E

MPTY

P

OOL

The agents created due to empty pool metric shows the number of agents created because the agent pool was empty. It includes the number of agents started when the current instance started (num_initagents).

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Bottleneck Analysis Pane

FCM A

NALYSIS

P

ANE

The fast communication manager (FCM) provides communication support for Enterprise Server

Editions. Each database partition server has one FCM thread to provide communications between database partition servers to handle agent requests and to deliver message buffers.

The FCM thread starts when you start the instance.

The following ratios are used on the FCM Analysis section to succinctly communicate the general overall FCM performance levels of the monitored instance:

Buffer Throughput

Message Anchor Utilization

Buffer Utilization

Request Block Utilization

Connection Entry Utilization

B

UFFER

T

HROUGHPUT

The buffer throughput metric is the total number of buffers that have been sent and received by this database partition since the start of monitoring.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home

This gives the level of traffic to and from the selected partition.

>

FCM Analysis Pane

Correction If this traffic level is high, you should consider redistributing one or more databases on the instance or move tables to reduce internode traffic.

15 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

B

UFFER

U

TILIZATION

This element indicates the percentage of all FCM buffers currently being used by the fast communication manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

FCM Analysis Pane

Correction You can use this information to tune fcm_num_anchors. If the utilization percentage is high, you should increase the fcm_num_anchors to ensure that operations do not run out of FCM message anchors. If the utilization is low, you can decrease fcm_num_anchors to conserve system resources.

C

ONNECTION

E

NTRY

U

TILIZATION

The connection entry utilization element indicates the percentage of all connection entries that are currently being used by the fast communication manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

FCM Analysis Pane

Correction You can use this information to tune fcm_num_connect. If the utilization percentage is high, you should increase the fcm_num_connect to ensure that operations do not run out of FCM connection entries. If the utilization is low, you can decrease fcm_num_connect to conserve system resources.

NOTE:

This metric is only applicable to DB2 version 7. In DB2 version 8, the maximum connection entries are adjusted dynamically and automatically

M

ESSAGE

A

NCHOR

U

TILIZATION

This metric shows the percentage of all message anchors currently being used by the fast communication manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

FCM Analysis Pane

Correction You can use this information to tune fcm_num_buffers. If the utilization percentage is high, you should increase the fcm_num_buffers to ensure that operations do not run out of FCM buffers. If the utilization is low, you can decrease fcm_num_buffers to conserve system resources.

NOTE:

This metric is only applicable to DB2 version 7. In DB2 version 8, the maximum message anchors are adjusted dynamically and automatically

R

EQUEST

B

LOCK

U

TILIZATION

This element indicates the percentage of all request blocks that are currently being used by the fast communication manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

FCM Analysis Pane

Correction You can use this information to tune fcm_num_rqb. If the utilization percentage is high, you should increase the fcm_num_rqb to ensure that operations do not run out of FCM request blocks. If the utilization is low, you can decrease fcm_num_rqb to conserve system resources.

NOTE:

This metric is only applicable to DB2 version 7. In DB2 version 8, the maximum request blocks are adjusted dynamically and automatically

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1523

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

I

NSTANCE

I

NFORMATION

P

ANE

Here you see the following information:

Product Name

Operating System

Active Local Databases

FixPack Level

Instance Name

Instance Type

Number of Partitions

K

EY

R

ATIO

A

NALYSIS

P

ANE

The Key Ratio Analysis section presents the following metrics:

Efficiency

Agents Registered

FCMBP

Agents Waiting

Private Sort Memory

Monitor Heap

A

GENTS

R

EGISTERED

The agents registered metric shows the percentage of total allowable agents (coordinator agents and subagents) that are currently working in the instance.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Key Ratio Analysis Pane

When this value is close to 100% it means that the number of agents currently working is close to the hard limit set in the database manager configuration. If this value stays high for long periods of time it means that there is high level of activity occurring in the databases on the instance.

Correction Use this element to help you evaluate your setting for the maxagents database manager configuration parameter. When you increase the value of this parameter, make sure that your system has enough memory available to accommodate the additional agents that may be created.

A

GENTS

W

AITING

The agents waiting statistic is the percentage of agents registered that are waiting for a token so they can execute a transaction in the Database Manager.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Key Ratio Analysis Pane

Each application has a dedicated coordinator agent to process database requests within the

Database Manager. Each agent has to get a token before it can execute a transaction.

The maximum number of agents that can execute database manager transactions is limited by the configuration parameter maxcagents. This parameter is used to control the load on the system during periods of high simultaneous application activity. For example, you may have a system requiring a large number of connections but with a limited amount of memory to serve those connections.

Adjusting this parameter can be useful in such an environment, where a period of high simultaneous activity could cause excessive operating system paging.

This parameter does not limit the number of applications that can have connections to a database. It only limits the number of Database Manager agents that can be processed concurrently by the

Database Manager at any one time, thereby limiting the usage of system resources during times of peak processing.

15 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Correction In cases where the high concurrency of applications is causing problems, you can use benchmark testing to tune this parameter to optimize the performance of the database.

M

ONITOR

H

EAP

This metric shows the percentage of total monitor heap that is currently being used by the

Database Manager.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Key Ratio Analysis Pane

Metrics The amount of memory required for monitoring activity depends on the number of monitoring applications (applications taking snapshots or event monitors), which switches are set, and the level of database activity.

Memory is allocated from the monitor heap when you perform database monitoring activities such as taking a snapshot, turning on a monitor switch, resetting a monitor, or activating an event monitor.

If this metric is running at over 70% utilization and you have many applications performing snapshot / event monitoring, you may need to increase the size of the monitor heap.

Correction Increase the value of mon_heap_sz database manager configuration parameter to increase the available monitor heap size.

FCMBP

The fast communication manager bufferpool (FCMBP) is the percentage of total amount of the

FCMBP that is currently being used. This metric is only applicable to multipartitioned database environments.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Key Ratio Analysis Pane

You can use this information to tune the fcm_num_buffers database manager configuration parameter.

NOTE:

FCM buffers are used for internal communication both among and within database servers. The FCMBU metric gives the percentage utilization of the available fcm buffers in the Database Manager.

P

RIVATE

S

ORT

M

EMORY

The private sort memory metric is the percentage of the total private sort memory heap that is currently in use.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance > Home >

Key Ratio Analysis Pane

You can use this information to tune the sheapthres database manager configuration parameter. If the value of this element is close to 100%, it means that the sorts for some databases are not getting the full sort heap as defined by the sortheap database configuration parameter.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1525

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

C

ONFIGURATION TAB

The Configuration tab of the Instance Detail view lets you view and change the instance configuration parameter. It also allows you to look at some information about the instance such as Product Name, Type, Fixpak Level, Operating System, instance name, partitions, and number of active databases.

A

GENTS

& C

ONNECTIONS TAB

The Agents & Connections tab of the Instance Detail view gives you the following analyses:

Connection Analysis Agent Pool Analysis

Agent Analysis

C

ONNECTION

A

NALYSIS

This section presents the metrics for the current local and remote connections to databases in the instance. The information presented here includes:

Local Connections: The number of local applications that are currently connected to a database within the database manager instance being monitored.

Remote Connections: The current number of connections initiated from remote clients to the instance of the database manager that is being monitored.

Local Connections Executing: The number of local applications that are currently connected to a database within the database manager instance being monitored and are currently processing a unit of work.

Remote Connections Executing: The number of remote applications that are currently connected to a database and are currently processing a unit of work within the database manager instance being monitored.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Agents & Connections tab

These metrics can help you determine the level of concurrent processing occurring in the database manager. These metrics will change frequently so it is important to obtain a sampling over an extended period. These metrics are useful when tuning the max_coordagents, and maxcagents database manager configuration parameters.

A

GENT

P

OOL

A

NALYSIS

The metrics in this section help determine how often the database agents are created due to empty pool and how often they are assigned from the agent pool.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Agents & Connections tab

If the number of agents created due to empty pool is high compared to the agents assigned from pool, it may mean that the number of pool agents should be increased. It may also mean that the overall workload is too high.

Correction You can change the maxcagents and num_poolagents database manager configuration parameters to tune these metrics.

15 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

A

GENT

A

NALYSIS

The metrics presented here give a detailed view of how the database manager agents are working. The metrics presented here include:

Registered Agents: The number of agents registered in the database manager instance that is being monitored (coordinator agents and subagents).

Agents Waiting for Token: The number of agents waiting for a token so they can execute a transaction in the database manager.

Idle Agents: The number of agents in the agent pool that are currently unassigned to an application and are, therefore, "idle".

Stolen Agents: The number of times that agents are stolen from an application. Agents are stolen when an idle agent associated with an application is reassigned to work on a different application.

Maximum Agents Registered: The maximum number of agents that the database manager has ever registered, at the same time, since it was started (coordinator agents and subagents).

Maximum Agents Waiting: The maximum number of agents that have ever been waiting for a token, at the same time, since the database manager was started.

Maximum Coordinating Agents: The maximum number of coordinating agents working at one time.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Agents & Connections tab

U

TILITIES TAB

The Utilities tab of the Instance Detail View gives information on the utilities currently executing in the database manager (available in DB2 version 8 only). The Utility Execution Details are as follows:

Utility ID: The unique identifier corresponding to the utility invocation

Type: Class of the utility ( Rebalance, Backup, Restore, Reorg etc..)

Utility Description: A brief description of the work the utility is performing

Utility Start Time: The time the utility was invoked

DBName: Database on which the utility is operating.

FCM R

ESOURCES TAB

The FCM Resources tab of the Instances Detail View presents statistics on the following:

Node Details FCM Buffer Utilization

FCM Connection Entries Utilization FCM Connection Entries Utilization

FCM Message Anchor Utilitization

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1527

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

N

ODE

D

ETAILS

This section gives a detailed view of inter- node communication in a multipartition environment.

The information shown here includes the connection status and buffers sent and received between various combinations of partitions in a multi-partitioned environment. The columns presented here include:

Source Node: Partition that sends the information

Target Node: Partition that received the information

Buffers Sent: Number of Buffers sent from source node to the target node

Buffers Received: Number of Buffers sent from source node to the target node

Connection Status

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Resources tab

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Throughput tab

FCM B

UFFER

U

TILIZATION

This section provides details on the current utilization and low watermark of FCM buffers.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Resources tab

You can monitor the buffer utilization for the selected partition together with the low watermark to determine the usage trend of the fcm buffers.

Correction If you notice a very small value for the low watermark and similar values for free FCM buffers over a long period, you may need to increase the fcm_num_buffers database manager configuration parameter to increase the number of available FCM buffers. If on the other hand you notice a very high value for the low watermark – you may have allocated too many buffers and you can reduce the value of fcm_num_buffers database manager configuration parameter.

FCM M

ESSAGE

A

NCHOR

U

TILITIZATION

This section provides details on the current utilization and low watermark of FCM message anchors.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Resources tab

You can monitor the message anchor utilization for the selected partition together with the low watermark to determine the usage trend of the message anchors.

Correction If you notice a very small value for the low watermark and similar values for free message anchors over a long period, you may need to increase the fcm_num_anchors database manager configuration parameter to increase the number of available message anchors.

If on the other hand you notice a very high value for the low watermark – you may have allocated too many message anchors and you can reduce the value of fcm_num_anchors database manager configuration parameter.

NOTE:

DB2 version 8 automatically adjusts fcm_num_anchors parameter, so you do not need to adjust this manually in DB2 version 8.

15 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

FCM C

ONNECTION

E

NTRIES

U

TILIZATION

This section provides details on the current utilization and low watermark of FCM connection entries.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Resources tab

You can monitor the connection entry utilization for the selected partition together with the low watermark to determine the usage trend of connection entries.

Correction If you notice a very small value for the low watermark and similar values for free connection entries over a long period, you may need to increase the fcm_num_connect database manager configuration parameter to increase the number of available connection entries.

If on the other hand you notice a very high value for the low watermark – you may have allocated too many connection entries and you can reduce the value of fcm_num_connect database manager configuration parameter.

NOTE:

DB2 version 8 automatically adjusts fcm_num_rqb parameter, so you do not need to adjust this manually in DB2 version 8.

FCM R

EQUEST

B

LOCK

U

TILIZATION

This section provides details on the current utilization and low watermark of FCM request blocks.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Resources tab

You can monitor the request block utilization for the selected partition together with the low watermark to determine the usage trend of the request blocks.

Correction If you notice a very small value for the low watermark and similar values for free request blocks over a long period, you may need to increase the fcm_num_rqb database manager configuration parameter to increase the number of available request blocks.

If on the other hand you notice a very high value for the low watermark – you may have allocated too many request blocks and you can reduce the value of fcm_num_rqb database manager configuration parameter.

NOTE:

DB2 version 8 automatically adjusts fcm_num_rqb parameter, so you do not need to adjust this manually in DB2 version 8.

FCM T

HROUGHPUT TAB

The FCM Throughput tab of the Instance Detail VIew includes the following statistics:

• FCM Throughput

The following statistic, available on this tab, duplicates a statistic available on the Instance

FCM

Resources tab :

Node Details

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1529

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

FCM T

HROUGHPUT

This section shows the delta statistics for the FCM buffers sent and received between the selected nodes in the Node Details section

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> FCM Throughput tab

If the total number of FCM buffers sent or received between selected nodes is high, you may want to redistribute the database, or move tables to reduce the inter-node traffic.

M

EMORY

P

OOLS TAB

The Memory Pools tab is divided into three panes. Unique to this tab is the Memory Pool List pane . The

Memory Pool Details

and the

Memory Pool Utilization are duplicates of panes

available in the Memory category.

M

EMORY

P

OOL

L

IST PANE

This section shows the memory pool usage details of the selected memory pool over time.

S

ORTS

& J

OINS TAB

The Sorts & Joins tab of the Instance Detail View presents the following information:

Sort Heap Details

Piped Sort Details

Sort Threshold Details Hash Join Threshold Details

S

ORT

H

EAP

D

ETAILS

This section shows the metrics for the total number of allocated pages of sort heap space for all sorts. It represents the sum of sort heap space allocated for all sorts in all active databases in the database manager.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Sorts & Joins tab

Normal memory estimates do not include sort heap space. If excessive sorting is occurring, the extra memory used for the sort heap should be added to the base memory requirements for running the database manager. Generally, the larger the sort heap, the more efficient the sort. Appropriate use of indexes can reduce the amount of sorting required.

Correction You may use the information in this section to help you tune the sheapthres configuration parameter.

If the element value is greater than or equal to sheapthres, it means that the sorts are not getting the full sort heap as defined by the sortheap parameter.

15 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

S

ORT

T

HRESHOLD

D

ETAILS

This section details the number of sorts that have requested heaps after the sort heap threshold has been exceeded.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Sorts & Joins tab

Metrics Under normal conditions, the database manager will allocate sort heap using the value specified by the sortheap configuration parameter. If the amount of memory allocated to sort heaps exceeds the sort heap threshold (sheapthres configuration parameter), the database manager will allocate sort heap using a value less than that specified by the sortheap configuration parameter.

Each active sort allocates memory, which may result in sorting taking up too much of the system memory available. Sorts that start after the sort heap threshold has been reached may not receive an optimum amount of memory to execute, but, as a result, the entire system may benefit. By modifying the sort heap threshold and sort heap size configuration parameters, the performance of sort operations and/or the overall system can be improved.

Correction If this element's value is high, you can:

Increase the sort heap threshold (sheapthres) or,

Adjust applications to use fewer or smaller sorts via SQL query changes.

H

ASH

J

OIN

T

HRESHOLD

D

ETAILS

This section shows the total number of times that a hash join heap request was limited due to concurrent use of shared or private sort heap space.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Sorts & Joins tab

Correction If this value is large (greater than 5% of hash join overflows), the sort heap threshold should be increased

P

IPED

S

ORT

D

ETAILS

This section gives the details on the piped sorts that have been requested and accepted.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> Instance

> Sorts & Joins tab

Each active sort on the system allocates memory, which may result in sorting taking up too much of the available system memory. When the number of accepted piped sorts is low compared to the number requested, you can improve sort performance by adjusting one or both of the following configuration parameters: sortheap

and sheapthres.

Correction If piped sorts are being rejected, you might consider decreasing your sort heap or increasing your sort heap threshold. You should be aware of the possible implications of either of these options. If you increase the sort heap threshold, then there is the possibility that more memory will remain allocated for sorting. This could cause the paging of memory to disk. If you decrease the sort heap, you might require an extra merge phase that could slow down the sort.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1531

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

OS

In many scenarios, an optimally tuned database may not perform well because there are constraints imposed by the system where the database is running. These constraints may include processes competing with the database sever for resources (CPU, I/O, or Memory), a slow CPU, insufficient or slow I/O devices, and insufficient memory. The OS Statistics page of Performance

Analyst lets you examine operating system metrics for the following platforms:

• AIX

• HP-UX

NOTE:

To view processor info and swap disk info on an HP-UX box, you need to login as ROOT in the OS login.

• Linux

• Solaris

• Unix

• Windows XP and 2000

NOTE:

The statistics available on the OS page depend on the operating system platform.

TIP:

If you magnify a graph to change back to the original size or minimize the size, close the OS Page and then reopen it again. Performance Analyst displays the graph in its original form and size.

In addition to a

Home page, the OS category of DB2 Performance Analyst includes the following

tabbed pages:

CPU Tab

Network Tab

I/O Tab

Processes Tab

Memory Tab

Space Tab

H

OME

The OS home page includes the following sections:

Key Resource Usage Pane

Disk Analysis Panes

Bottleneck Analysis Pane

Workload Analysis Pane

Memory Analysis Pane

15 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

K

EY

R

ESOURCE

U

SAGE

P

ANE

The following ratios are used on the Performance Analyst OS home page to communicate the general overall performance levels of the operating system:

Disk Time

Paged Memory Used

(Windows)

Load Average

Swap Memory Used (AIX, HP-UX,

Linux, Solaris, Unix)

Processor Time

TIP:

To open the CPU tab, right-click Processor Time. To open the I/O tab, right-click Disk

Time. To open the Memory tab, right-click Paged Memory Used.

D

ISK

T

IME

The Disk Time statistic is the percentage of elapsed time that the selected disk drive/device was busy servicing read or write requests.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Key Resource Usage Pane

Metrics You should avoid consistently seeing values for this statistic greater then 90%.

Correction Add more disk drives and partition the files among all of the drives.

L

OAD

A

VERAGE

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Key Resource Usage Pane

High load averages usually mean the system is being used heavily and the response time is correspondingly slow.

P

ROCESSOR

T

IME

The Processor Time statistic indicates the percentage of time the processor is working. This counter is a primary indicator of processor activity.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Key Resource Usage Pane

Metrics If your computer seems to be running sluggishly, this statistic could be displaying a high percentage.

Correction Upgrade to a processor with a larger L2 cache, a faster processor, or install an additional processor.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1533

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

P

AGED

M

EMORY

U

SED

The Paged Memory Used statistic is the ratio of Commit Memory Bytes to the Commit Limit.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk. The commit limit is determined by the size of the paging file. As the paging file increases, so does the commit limit.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Key Resource Usage Pane

This value displays the current percentage value only and not an average. If the percentage of paged memory used is above 90%, you may be running out of memory.

Correction Increase the size of page file.

NOTE:

This statistic is available for the Windows platform.

S

WAP

M

EMORY

U

SED

The Swap Memory Used statistic is the percentage of swap space currently in use.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Key Resource Usage Pane

Metrics If the percentage of swap memory used is above 90%, you may be running out of memory.

Correction Increase the size of your swap files.

B

OTTLENECK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Average Disk Queue Length

Interrupts/Sec

Page Faults/Sec

Processor

Processor Queue Length

Network Output Queue Length/

Network Queue Length

Processor Speed

TIP:

To open the I/O tab, right-click any Details menu item. To open the CPU tab, right-click the Item Processor Queues Length Details menu item. To open the Network tab, rightclick Network Output Queues Length.

NOTE:

The statistics available in this section depend on the platform of operating system.

A

VERAGE

D

ISK

Q

UEUE

L

ENGTH

The Average Disk Queue Length statistic is the average number of both read and write requests that were queued for the selected disk during the sample interval.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

This metric is useful in identifying I/O related bottlenecks. If the disk queue lengths for certain disks are consistently much higher than others, you may need to redistribute the load among available disks. If the disk queues lengths for all disks are consistently large, and you see a high amount of I/O activity, your disks may be inefficient.

15 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Correction Some things you can do if you have problems with this statistic include:

Redistribute the data on the disk with the large average disk queue to other disks.

Upgrade to faster disk(s).

I

NTERRUPTS

/S

EC

Interrupts/Sec is the average rate, in incidents per second, at which the processor received and serviced hardware interrupts. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards, and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended. The system clock typically interrupts the processor every 10 milliseconds, creating a background of interrupt activity. This statistic shows the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

A high value indicates possible excessive hardware interrupts; justification is dependent on device activity.

N

ETWORK

O

UTPUT

Q

UEUE

L

ENGTH

/N

ETWORK

Q

UEUE

L

ENGTH

The Network Output Queue Length statistic is the number of threads in the processor queue.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

NOTE:

The name of this statistic depends on the platform of the operating system.

P

AGE

F

AULTS

/S

EC

The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second. A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1535

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction If the number of page faults remains consistently high, you can check with your Windows System

Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

P

ROCESSOR

Q

UEUE

L

ENGTH

The Processor Queue Length statistic is the number of threads in the processor queue.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

Unlike the disk counters, this counter shows ready threads only, not threads that are running. There is a single queue for processor time even on computers with multiple processors. Therefore, if a computer has multiple processors, you need to divide this value by the number of processors servicing the workload. A sustained processor queue of less than 10 threads per processor is normally acceptable, dependent of the workload.

Correction A sustained high value in the Processor Queue Length could indicate that a processor bottleneck has developed due to threads of a process requiring more process cycles than are available. If this is the case, you should look at installing a faster (or an additional) processor.

P

ROCESSOR

S

PEED

The Processor Speed statistic displays the speed of the active processor in MHz. The speed is approximate.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

P

ROCESSOR

The Processor Statistic displays the type of processor currently in use, for example, GenuineIntel.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Bottleneck Analysis Pane

M

EMORY

A

NALYSIS

P

ANE

The following metrics are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Available Paged Memory

(Windows)

Available Physical Memory Available Swap Memory

(AIX, HP-

UX, Linux, Solaris, Unix)

Total Paged Memory/Total Swap

Memory

Total Physical Memory

TIP:

To open the Memory tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

15 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

A

VAILABLE

P

AGED

M

EMORY

The Available Paged Memory statistic shows the amount of virtual memory available for the processes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Memory Analysis Pane

If the available virtual memory is less than 10% of the total virtual memory, your system may run out of memory.

Correction Increase the size of page file.

NOTE:

This statistic is available for the Windows platform.

A

VAILABLE

P

HYSICAL

M

EMORY

The Available Physical Memory statistic represents the amount of RAM available to all processes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Memory Analysis Pane

This counter displays the last observed value only and not an average. Use this value with the Total physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

Correction Some things you can do if you have problems with this statistic include:

Check the running processes to see if there are any memory leaks.

Stop any services that are not required.

Install additional RAM.

A

VAILABLE

S

WAP

M

EMORY

The Available Swap Memory statistic represents the amount of virtual memory available for the processes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Memory Analysis Pane

If the Available Swap Memory is less than 10% of the total Swap Memory, your system may run out of memory.

Correction Increase the size of swap files.

T

OTAL

P

AGED

M

EMORY

/T

OTAL

S

WAP

M

EMORY

The Total Paged Memory statistic shows the maximum amount of virtual memory available to all processes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Memory Analysis Pane

It is recommended that this be 1½ - 3 times the amount of RAM on the system.

NOTE:

The name of this statistic depends on the platform of the operating system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1537

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

OTAL

P

HYSICAL

M

EMORY

The Total Physical Memory statistic shows the amount of physical memory installed on your computer.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Memory Analysis Pane

This is an informational metric and displays the total amount installed on the machine. Use this value with the available physical memory and paging metrics (Memory details page). If the available physical memory is very small compared to this value, and the paging activity is high, your system may be running low on memory.

D

ISK

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Free Disk Space Total Disk Space

Used Disk Space

TIP:

To open the Space tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

F

REE

D

ISK

S

PACE

The Free Disk Space statistic shows the unallocated space, in megabytes on all logical disk drives.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

T

OTAL

D

ISK

S

PACE

Total Disk Space displays the total allocated and unallocated space, in megabytes on all logical disk drives.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations, here are two:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

15 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

U

SED

D

ISK

S

PACE

The Used Disk Space statistic shows the amount of allocated space, in megabytes on all logical disk drives.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

Correction There are many things a DBA can do to ensure that a database does not encounter a space problem due to physical space limitations:

If a database currently resides on a disk that has little free space, you can add more files to the database. Of course, you should add the new files to other physical hard disks that can accommodate a growing database.

You should examine hard disks with shrinking disk space to see if you can relocate or delete files to allow more free space.

W

ORKLOAD

A

NALYSIS

P

ANE

The following ratios are used on the Performance Analyst OS home page to succinctly communicate the general overall performance levels of the operating system:

Number of Logins

Top I/O Process

Number of Processes

Top Memory Process

Top CPU Process

TIP:

To open the Processes tab, right-click any Details menu item.

NOTE:

The statistics available in this section depend on the platform of operating system.

N

UMBER OF

L

OGINS

This statistic displays the total number of logins on the server.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Workload Analysis Pane

N

UMBER OF

P

ROCESSES

This statistic displays the total number of processes on the server.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

T

OP

CPU P

ROCESS

Top CPU Process shows the current process that is consuming the most amount of CPU. The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

If the amount of CPU time used by this process is close to 100% and the CPU usage is very high, this process may be the bottleneck on the server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1539

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Correction Investigate the process further to see if it is in an inconsistent state. Also, look at minimum requirements for CPU speed for the process. You may need to upgrade your CPU.

T

OP

I/O P

ROCESS

The Top I/O Process statistic shows the current process that is consuming the most amount of

CPU. The information displayed is dependent on the platform of the operating system.

Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major

Page Faults, and the amount of I/O expressed in KB/sec.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

T

OP

M

EMORY

P

ROCESS

Top Memory Process shows the current process that is consuming the most amount of memory.

The information displayed is dependent on the platform of the operating system. Information displayed includes the name of the process, process ID, amount of memory consumed expressed in KB, amount of CPU expressed as a percentage, the amount of Major Page Faults, and the amount of I/O expressed in KB/sec.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS > Home >

Disk Analysis Pane

If you are running out of memory on the system, this is a quick way to identify the top memory user. If the displayed process is using a significant portion of the total memory, it could be causing the memory issues.

P

ROCESSES

O

VERVIEW

The Processes Overview of the OS Summary includes the following sections:

Top CPU Process

Top I/O Process Top Memory Process

CPU T

AB

The CPU tab of the OS Detail includes the following sections:

Context Switches/Sec

Load Averages

CPU Events CPU Utilization

The following statistics, available on this tab, are duplicates of statistics on the

OS Home page:

Processor Queue Length

Interrupts/Sec

NOTE:

The sections available on this tab depend on the platform of operating system.

15 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

CPU U

TILIZATION

The CPU Utilization section includes the following information:

• % Privileged Time

• % User Time

% P

RIVILEGED

T

IME

The metric shows the percentage of elapsed time that the process threads spent executing code in privileged mode.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

The ideal range should be 0-40% (less than 40% indicates excessive system activity).

Correction If your CPU consistently runs at less than 40% you may need to upgrade your system to include a faster processor(s).

NOTE:

For Windows systems, when a Windows system service is called, the service will often run in privileged mode to gain access to system-private data. Such data is protected from access by threads executing in user mode. Calls to the system can be explicit or implicit, such as page faults or interrupts. These kernel commands, are considered privileged to keep the low-level commands executing and prevent a system freeze.

Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. Some work done by Windows on behalf of the application might appear in other subsystem processes in addition to the privileged time in the process.

% U

SER

T

IME

The % User Time statistic is the percentage of elapsed time the processor spends in the user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory. The operating system switches application threads to privileged mode to access operating system services. This counter displays the average busy time as a percentage of the sample time.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

If the Privileged Time is high in conjunction with Physical Disk Reads, consider upgrading the disk I/O subsystem.

CPU E

VENTS

The CPU Events section includes the following information:

Context Switches/Sec System Calls/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1541

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

C

ONTEXT

S

WITCHES

/S

EC

The Context Switches/Sec section shows the combined rate at which all processors on the computer are switched from one thread to another. Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

The ideal range should be between 0-10,000. GA number greater then 10,000 may indicate too many threads contending for resources.

S

YSTEM

C

ALLS

/S

EC

System calls are functions which require the services of the operating system. Usually they involve access to some data that users must not be permitted to corrupt or even change.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

Correction Try to find a good ratio between the amount of time the operating system runs (fulfilling system calls and doing process scheduling), and the amount of time the application runs. Your goal should be running 60% to 75% of the time in application mode, and 25% to 40% of the time in operating system mode. If you find that the system is spending 50% of its time in each mode, then you should investigate to determine what is wrong.

L

OAD

A

VERAGES

The Load Average statistic represents the system load averages over the last 1, 5, and 15 minutes.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> CPU Tab

High load averages usually mean the system is being used heavily and the response time is correspondingly slow.

P

ROCESSES

T

AB

The Processes tab of the OS Detail page succinctly communicates the general overall performance levels of processes. The columns available in this table depend on the platform of operating system. The table below describes the information available in the table on this tab:

Column

Process

User

ID

CPU

Description

The name of the process.

The user of the process.

The ID Process is the unique identifier of this process. ID Process numbers are reused, so they only identify a process for the lifetime of that process.

The CPU is the percentage of elapsed time that all of process threads used the processor to execution instructions.

15 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Column

User Mode

Memory WINDOWS

ONLY

Memory (MB)

Memory

Active Memory

Description

The User Mode is the percentage of elapsed time that the process threads spent executing code in user mode.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.

Memory is the percentage of the memory used of the total memory.

I/O Data

Active Memory is the amount of committed virtual memory, in bytes for this process. Active memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive. This counter displays the last observed value only; it is not an average.

The rate at which the process is reading and writing bytes in I/O operations. This counter counts all I/O activity generated by the process to include file, network and device I/Os.

Elapsed Time

Thread Count

Handle Count

Priority

The total elapsed time, in seconds, that this process has been running.

The number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread.

The total number of handles currently open by this process. This number is equal to the sum of the handles currently open by each thread in this process.

The current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process' base priority.

Creating Proc ID

Page Faults/Sec

Page File

Private

The Creating Process ID value is the Process ID of the process that created the process. The creating process may have terminated, so this value may no longer identify a running process.

Page Faults/Sec is the rate at which page faults by the threads executing in this process are occurring. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This may not cause the page to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with whom the page is shared.

Page File is the current number of kilobytes that this process has used in the paging file(s).

Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and the lack of space in paging files can prevent other processes from allocating memory.

Private is the current size, in kilobytes, of memory that this process has allocated that cannot be shared with other processes.

I/O T

AB

The I/O tab includes the following sections:

Bytes per I/O Operation Average Disk Queue/Total Disk

Queue

Disk Transfers/Sec

I/O Details

Disk I/O Time

Transfer Rate

NOTE:

The sections available on this tab depend on the platform of operating system.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1543

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

I/O D

ETAILS

The table below describes the information available in this section:

Column

Disk

Reading (KB/s)

Writing (KB/s)

Disk Read Time

Disk Write Time

Disk Time

Avg. Read Queue

Avg. Write Queue

Disk Reads/Sec

Disk Writes/Sec

Description

The disk number assignment.

The amount of bytes read from the device.

The amount of bytes written to the device.

Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.

Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

Disk Time is the percentage of elapsed time that the selected disk was busy servicing requests.

Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.

Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.

Disk Reads/Sec is the rate of read operations on the disk.

Disk Writes/Sec is the rate of write operations on the disk.

NOTE:

The columns available in this table depend on the platform of operating system.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

T

RANSFER

R

ATE

The Transfer Rate section succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Description

The average number of bytes transferred from the disk during read operations.

Writing The average number of bytes transferred to the disk during write operations.

Transferred The amount of time required to transfer the data between the device's cache and the actual device media.

Metrics

It is measured in number of

KBs per second.

It is measured in number of

KBs per second.

N/A

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

15 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

B

YTES PER

I/O O

PERATION

The Bytes per I/O Operation section of the OS Detail succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Reading

Writing

Description

The average number of bytes transferred from the disk during read operations.

The average number of bytes transferred to the disk during write operations.

Metrics

It is measured in number of bytes per second.

It is measured in number of bytes per second.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

A

VERAGE

D

ISK

Q

UEUE

/T

OTAL

D

ISK

Q

UEUE

The Average Disk Queue section of the OS Detail page succinctly communicates the general overall performance levels of the server's I/O. The table below describes the statistics in this section:

Statistic

Average Read Queue

Average Write Queue

Average Queue

Description

Average Read Queue Length is the average number of read requests that were queued for a particular disk.

Average Write Queue is the average number of write requests that were queued for a particular disk.

Average time in ms. to service I/O requests which for disks includes seek, rotational latency and data transfer time).

Information

Sustained loads on any of the disk queue lengths could represent problems within your system.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Windows

System Administrator for assistance in troubleshooting these problems.

Sustained loads on any of the disk queue lengths could represent problems within your system. Contact your Unix System

Administrator for assistance in troubleshooting these problems.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

Correction Contact your Windows System Administrator for assistance in troubleshooting these problems.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1545

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

D

ISK

I/O T

IME

The Disk I/O Time section of the OS Detail page succinctly communicates the general overall performance levels of the disk’s I/O. The statistics available in this section depend on the platform of operating system. The table below describes the statistics in this section:

Statistic

% Disk Read

Time

% Disk Write

Time

% Disk Time

Description

% Disk Read Time is the percentage of time during the sample interval that the disk is busy servicing read requests.

% Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.

% Disk Time is the percentage of time during the sample interval that the disk is busy servicing requests.

Metrics

Use this in conjunction with the % Disk Write

Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Use this in conjunction with the % Disk Read

Time to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Use this statistic to identify the disks that may be running at capacity and may require upgrades. This metric may also be used to balance the load between under/over utilized disks.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

D

ISK

T

RANSFERS

/S

EC

The Disk Transfers/Sec section of the OS Detail page succinctly communicates the general overall performance levels of the disk transfers. The table below describes the statistics in this section

Statistic

Reads/Sec

Writes/Sec

Transfers/Sec

Description

The the rate of read operations on the disk.

The rate of write operations on the disk.

The rate of transfer operations per second.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> I/O Tab

M

EMORY

T

AB

The Memory tab of the OS Detail page includes the following sections:

Buffer Size

Cache Efficiency

Cache Size

15 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Memory Available

Paging Activity

Page Replacements

The following statistic, available on this tab, duplicates a statistic on the OS

Memory Tab .

Page Faults/Sec

NOTE:

The sections available on this tab depend on the platform of operating system.

P

AGING

A

CTIVITY

The Paging Activity section includes the following statistics:

Blocks Input/Sec

Paged Out

t

Blocks Output/Sec

Pages Input/Sec

Paged In

Pages Output/Sec

NOTE:

The statistics available in this section depend on the platform of operating system.

B

LOCKS

I

NPUT

/S

EC

The Blocks Input/sec statistic is the number of blocks sent to a block device per second.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck:

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

B

LOCKS

O

UTPUT

/S

EC

The Blocks Output/sec statistic is the number of blocks received from a block device per second).

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Correction Although it never hurts to have as much physical memory as your system can handle, here are two things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your swap file. Normally, the bigger the initial size of your swap file, the better, in performance terms.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1547

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

P

AGED

I

N

The number of disk block paged into core from disk which occurs when the server is experiencing a shortage of RAM. Any nonzero value indicates excessive swap activity. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk.

This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Correction High values indicate the possible need to increase the amount of RAM on the system.

P

AGED

O

UT

The number of disk block paged out of core from disk. In any virtual memory environment, it is not uncommon to see RAM pages moved out to a swap disk. This is a special disk area in UNIX that's reserved for holding memory pages so that the processor is capable of addressing RAM in excess of its full capability. While page-out of operations are a normal part of any server's operations, page-in operations indicate that the real amount of available RAM has been exceeded and that additional RAM pages are required on the server.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

P

AGES

I

NPUT

/S

EC

The Pages Input/Sec statistic is the number of pages read from disk to resolve hard page faults.

Hard page faults occur when a process requires code or data that is not in its working set or elsewhere in physical memory, and must be retrieved from disk.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

This value was designed as a primary indicator of the kinds of faults that cause system-wide delays. It includes pages retrieved to satisfy faults in the file system cache (usually requested by applications) and in non-cached mapped memory files. This counter counts numbers of pages, and can be compared to other counts of pages, such as Memory: Page Faults/sec, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

15 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

P

AGES

O

UTPUT

/S

EC

The Pages Output/Sec statistic is the number of pages written to disk to free up space in physical memory. Pages are written back to disk only if they are changed in physical memory. A high rate of pages output might indicate a memory shortage.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Windows NT writes more pages back to disk to free up space when low in physical memory. This counter counts numbers of pages, and can be compared to other counts of pages, without conversion. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

Correction Although it never hurts to have as much physical memory as your system can handle, there are some things you can check within your system to alleviate the memory bottleneck.

Check to see if you have any drivers or protocols that are running but not being used. They use space in all memory pools even if they are idle.

Check to see if you have additional space on your disk drive that you could use to expand the size of your page file. Normally, the bigger the initial size of your page file, the better, in performance terms.

M

EMORY

A

VAILABLE

The Memory Available section of the OS Detail page succinctly communicates the general overall performance levels of the server's memory. The statistics available in this section depend on the platform of operating system. The table below describes these statistics.

Statistic

Physical

Memory

Description

The Physical Memory statistic is the amount of committed virtual memory, in megabytes.

Committed memory is where memory space has been reserved in the paging file if it needs to be written to disk.

Metrics/Correction

This counter displays the last observed value only and not an average.

Physical

Swap

The Physical statistic is the total physical memory available.

Paged Memory The Paged Memory statistic is the amount of committed virtual memory, in bytes. Used Memory is the physical memory which has space reserved on the disk paging file(s). There can be one or more paging files on each physical drive.

Swap Memory The Swap Memory statistic is the free, unreserved swap space.

N/A

This counter displays the last observed value only; it is not an average.

Increase the size of your swap file or add additional files if you consistently see a shortage of free, unreserved swap space.

N/A

Total Physical

The Swap statistic is the total swap memory being used.

The Total Physical statistic is the total physical memory available.

N/A

Total Swap The Total Swap statistic is the total swap memory available.

N/A

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1549

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Statistic

Swap-ins

Swap-outs

Description

The number of memory pages paged in from swapspace.

The number of memory pages paged in from swapspace.

Metrics/Correction

If the system is consistently low on free memory (over a 30 second average), the memory scheduler will start to swap out processes. Increase the size of your swap file or add additional files.

If the system is consistently low on free memory (over a 30 second average), the memory scheduler will start to swap out processes. Increase the size of your swap file or add additional files.

N/A Buffers The Buffers statistic represents the amount of buffers used by the kernel in kilobytes.

Page Faults/Sec The Page Faults/Sec statistic is the overall rate faulted pages are handled by the processor. It is measured in numbers of pages faulted per second.

A page fault occurs when a process requires code or data that is not in its working set. This counter includes both hard faults and soft faults.

This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.

If the number of page faults remains consistently high, you can check with your

Windows System Administrator for further investigation. Often, large numbers of page faults are not a problem so long as they are soft faults. However, hard faults, that require disk access, can cause delays.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

B

UFFER

S

IZE

The Buffer Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

C

ACHE

S

IZE

The Cache Size statistic represents the amount of cache used by the kernel in kilobytes.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

P

AGE

R

EPLACEMENTS

The following statistics are available in this section:

Memory Freed (Pages/sec) Clock Algorithm Scans (Pages/sec)

15 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

M

EMORY

F

REED

(P

AGES

/

SEC

)

Freed or destroyed (Kb/s).

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

C

LOCK

A

LGORITHM

S

CANS

(P

AGES

/

SEC

)

The VMM uses a technique known as the clock algorithm to select pages to be replaced. This technique takes advantage of a referenced bit for each page as an indication of what pages have been recently used (referenced). When the page-stealer routine is called, it cycles through the PFT, examining each page's referenced bit.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

C

ACHE

E

FFICIENCY

The Cache Efficiency section of the Memory tab succinctly communicates the general overall performance levels of the server's memory. The following statistics are available in this section:

Copy Read Hits %

Pin Read Hits %

Data Map Hits %

MDL Read Hits %

C

OPY

R

EAD

H

ITS

%

The Copy Read Hits % statistic is the percentage of cache copy read requests that hit the cache and does not require a disk read to provide access to the page in the cache.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

When the page is pinned in the memory, the page's physical address in the file system cache will not be altered. A copy read is a file read operation where a page in the cache is copied to the application's buffer. Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate

D

ATA

M

AP

H

ITS

%

The Data Map Hits % statistic is the percentage of data maps in the file system cache that could be resolved without having to retrieve a page from the disk.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1551

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

MDL R

EAD

H

ITS

%

The MDL Read Hits % statistic is the percentage of Memory Descriptor List Read requests to the file system cache that hit the cache and does not require disk access to provide memory access to the pages in the cache.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

P

IN

R

EAD

H

ITS

%

The Pin Read Hits % statistic is the percentage of pin read requests that hit the file system cache and does not require a disk read in order to provide access to the page in the file system cache.

Location

Metrics

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Memory Tab

Because this value reflects hits, it ideally should be close to 100%. An amount below 100% indicates misses.

Correction Adding physical memory to a server results in a larger file system cache, which is generally more efficient. Defragmenting disks also helps, putting related pages in the cache together and thereby improving the cache hit rate.

S

PACE

T

AB

The Space tab of the OS Detail page includes the following sections:

• Device Summary

• Device Detail

D

ISK

S

PACE

F

REE

The Disk Space Free metric displays the amount of free disk space in megabytes.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

D

ISK

S

PACE

D

ETAIL

The Disk Space Detail section of the Space tab succinctly communicates the general overall performance levels of the server’s disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Description

The drive letter of the disk.

15 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Statistic

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

D

EVICE

S

UMMARY

The Device Summary section of the Space tab displays a bar chart for all devices. The Device

Summary section succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Used

Free

Description

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/device.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1553

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

D

EVICE

D

ETAIL

The Device Detail section of the Space tab succinctly communicates the general overall performance levels of the server's disks and space allotment. The table below describes the statistics in this section:

Statistic

Partition

Local Filesystem

Type

Total Space

Used Space

Free Space

Capacity

Mounted On

Description

The drive letter of the disk.

The name of the file system.

The type of file system.

Total size of the disk/device's capacity expressed in MBs.

Amount of MBs currently allocated on the particular disk/device.

Amount of MBs currently unallocated and free on the particular disk/ device.

The percentage of space used on the device.

The mount point of the device.

NOTE:

The statistics available in this section depend on the platform of operating system.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

N

ETWORK

T

AB

The Network tab of the OS Detail page succinctly communicates the general overall performance levels of the server's networking. The Network tab of the OS Detail page includes the following sections:

Network Details

Packet Errors

Transmission Queue Length

Packet Collisions

Transmission Rate

Packet Discards

Transmission Rate (Bytes)

NOTE:

The sections available on this tab depend on the platform of operating system.

N

ETWORK

D

ETAILS

The statistics available in this section depend on the platform of operating system. The table below describes the information available in this section:

Column

Network Interface

INET Address/

Address

Pkts Sent/Sec

Pkts Received/Sec

Description

The name of network interface.

The IP address assigned to the network interface.

The number of packets sent per second.

The number of packets received per second.

15 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Column

Sent (KB/Sec)

Received (KB/Sec)

Out Pkts Discarded

In Pkts Discarded

Out Pkt Errors

In Pkt Errors

Queue Length

Collisions

Packets Discarded

Description

The number of bytes sent per second.

The number of bytes received per second.

The number of outbound packets discarded.

The number of inbound packets discarded.

The number of outbound packet errors.

The number of inbound packet errors.

The queue length.

The number of collisions.

The number of packets discarded.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Network Tab

T

RANSMISSION

R

ATE

The Transmission Rate section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Packets Sent/Sec

Packets Received/Sec

The Packets Sent/Sec statistic is the number of packets sent over each network adapter per second.

The Packets Received/Sec statistic is the number of packets received over each network adapter per second.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

T

RANSMISSION

R

ATE

(B

YTES

)

The Transmission Rate (Bytes) section of the Network tab succinctly communicates the packet transmission rate. The following statistics are available in this section:

Sent (KB/Sec)

Received (KB/Sec)

The Sent (KB/Sec) statistic is the rate at which bytes are sent over each network adapter including framing characters

The Received (KB/Sec) statistic is the rate at which bytes are received over each network adapter, including framing characters.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1555

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

RANSMISSION

Q

UEUE

L

ENGTH

The number of pending outgoing packets on either the software transmit queue or the hardware transmit queue

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

P

ACKET

C

OLLISIONS

A collision occurs when two devices on the network sense that the network is idle and end up trying to send data at the same time. Some collisions are normal on a repeated network, but excess collisions can cause serious performance problems.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

Correction

Contact your network administrator if there is high rate of persistent Packet Collisions.

P

ACKET

D

ISCARDS

The Packet Discards section of the Network tab succinctly communicates the packet discard rate. The following statistics are available in this section:

Outbound Packets

Discarded

Inbound Packets

Discarded

Packet Discards

The Outbound Packets Discarded statistic is the number of outbound packets that were discarded even though no errors had been detected to prevent from being transmitted.

Received Packets Discarded is the number of received packets that were discarded even though no errors had been detected to prevent from being transmitted.

The Packet Discards statistic represents the number of network packets discarded.

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

Correction A possible reason for discarding such a packet could be to free up buffer space.

Contact your network administrator if there is high rate of persistent packet discards.

P

ACKET

E

RRORS

The Packet Errors section of the Network tab succinctly communicates the packet error rate. The following statistics are available in this section:

Outbound Packet Errors The Outbound Packet Errors statistic is the outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.

Inbound Packet Errors The Packets Received Errors statistic is the received packets that contained errors preventing them from being deliverable to a higher-layer protocol.

15 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

Location

IBM DB2 (W/U/L) Performance Analyst statistics

> OS

> Space Tab

T

OP

SQL

One or two bad queries can cause a lot of trouble for the remaining sessions in a database, and so can one or two bad queries. It is important to find them before they get into a production system, but sometimes a few sneak through.

By applying custom filters and performance-related thresholds, the Top SQL view locates inefficient SQL. By applying filters to certain I/O and statistical counters, you hope to isolate queries that far exceed their nearest competitors in the same area (like disk reads). When you find them, you should reduce the number of sorts a query performs. Or, for a query that returns only a few records, you should try to minimize the number of rows a query processes.

Metrics

When you begin to look for inefficient SQL in a database, there are two primary questions you need to answer:

• What has been the worst SQL that’s historically been run in my database?

• What is the worst SQL that’s running right now in my database?

When troubleshooting a slow system, you should be on the lookout for any query that shows an execution count that is significantly larger than any other query on the system. It may be that the query is in an inefficient loop, or other problematic programming construct. Only by bringing the query to the attention of the application developers will you know if the query is being mishandled from a programming standpoint.

The following tabs are available on the Top SQL page:

Summary tab

Dynamic SQL Cache tab

Criteria tab SQL Details tab

S

UMMARY TAB

The Summary tab is divided into two sections:

• Top SQL Statements

• Top SQL Details

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1557

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

T

OP

SQL S

TATEMENTS

A lot of a database’s overall performance can be attributed to SQL statement execution. Poorly optimized SQL statements or stored procedures can drag an otherwise well-configured database down in terms of user response times.

Before you can identify problem SQL in your database, you have to ask the question of what

‘bad SQL’ is. What criteria do you use when you begin the hunt for problem SQL in your critical systems? Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there is no way to sufficiently answer this question to every SQL Server professional’s satisfaction. The Top SQL results grid displays the top SQL statements across various performance categories including Reads, Writes, CPU statistics, and Elapsed Time.

T

OP

SQL D

ETAILS

This section shows the details of the top SQL statements. The columns presented here include:

Usage: % of all operations of this type performed by the selected sql statement.

SQL text: Text of the selected SQL statement.

Total Reads: Total number of read operations performed by the selected SQL statement.

Total Writes: Total number of write operations performed by the selected SQL statement.

Executions: Number of times the selected SQL statement was executed.

First Start Time: First time the selected SQL statement was executed.

Avg CPU Time: Avg CPU time used by the selected SQL statement.

Avg Elapsed Time: Avg Elapsed time for selected SQL statement.

C

RITERIA TAB

The Top SQL view displays all SQL running or executed in the current datasource. You can use the lists and boxes to reorder the display according to your specific needs. The Criteria tab of the Top SQL page includes the following sections that you can mix and match to give you the information you want to find.

• Demographic Criteria

• Statistical Criteria

• Sort Criteria

SQL D

ETAILS TAB

The SQL Details tab presents the following sections:

Top SQL Results

Selected SQL Text Selected SQL Last Snapshot Details

15 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

T

OP

SQL R

ESULTS

This section shows the details of the SQL statements and (their metrics) captured at each refresh of the performance analyst. The information presented here includes

SQL text: Partial text of the captured SQL statement. The full text is shown in the selected SQL text section.

Agents Top: The maximum number of agents that were used when executing the selected statement at the time of last refresh

Max Agents Top: the maximum number of agents that were used when executing the selected statement over all captured executions

Fetch Count: Number of successful fetches performed for the specific statement at the time of last refresh

Avg Fetch Count: Avg number of successful fetches for the selected statement over all its captured executions

Int. Rows Deleted: Number of internal rows deleted for the selected statement as a result of internal activity

Avg Int Rows Deleted: over all its captured executions

Int Rows Inserted

Avg Int Rows Inserted over all its captured executions

Int. Rows Updated

Avg Internal Rows Updated over all its captured executions

#Agents

#Rows Estimate

Avg # Rows Estimate over all its captured executions

Cost Estimate

Avg Cost Estimate over all its captured executions

Rows Read

Avg Rows Read over all its captured executions

Rows Written

Avg Rows Written over all its captured executions

Sorts

Avg Sorts over all its captured executions

Sys CPU Time

Avg Sys CPU Time over all its captured executions

Usr CPU Time

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1559

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

Avg Usr CPU Time over all its captured executions

Total Sort Time

Avg Total Sort Time over all its captured executions

Buffer pool Hit Ratio

Overall Buffer pool Hit Ratio over all its captured executions

Temp Data Hit Ratio

Overall Temp Data Hit Ratio over all its captured executions

S

ELECTED

SQL T

EXT

The Selected SQL Text window allows you to select any of the Top SQL result rows and get the complete SQL text. From here you can open an Explain Plan or Tune the SQL.

S

ELECTED

SQL L

AST

S

NAPSHOT

D

ETAILS

This displays attributes for the last snapshot of the selected SQL statement

D

YNAMIC

SQL C

ACHE TAB

The Dynamic SQL Cache tab of the Top SQL view, displays the following sections:

Dynamic SQL Cache Details

Bufferpool Analysis

Dynamic SQL Statement

Execution Time Details

Execution and Preparation Details

D

YNAMIC

SQL C

ACHE

D

ETAILS

The DB2 statement cache stores packages and statistics for frequently used SQL statements.

This section shows the statements in this cache and the metrics associated with each statement.

Metrics

By examining the contents of this cache, you can identify the dynamic SQL statements that are most frequently executed and the queries that consume the most resources. Using this information, you can examine the most commonly executed and most expensive SQL operations, to determine if SQL tuning could result in better database performance.

D

YNAMIC

SQL S

TATEMENT

The Dynamic SQL Text window allows you to select any of the Dynamic SQL Cache Detail and get the complete SQL text. From here you can open an Explain Plan or Tune the SQL.

15 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T S T AT I S T I C S > I B M D B 2 ( W / U / L ) P E R F O R M A N C E A N A L Y S T

E

XECUTION AND

P

REPARATION

D

ETAILS

Here you see the number of times the selected SQL statement was compiled and executed.

Metrics

You can use the execution information to identify the most commonly executed SQL statements in your system. You will probably see the greatest performance benefit from tuning them.

You can use the compilation information to determine the number of different compilations for the selected SQL statement. Use this information together with the number of executions to determine if a bad compilation environment is skewing the metrics.

B

UFFERPOOL

A

NALYSIS

This section shows the various bufferpool usage metrics for the selected SQL statement.

Metrics

This information helps you determine the scope when you tune bufferpools.

E

XECUTION

T

IME

D

ETAILS

The information presented here may be used to identify the longest running SQL.

Metrics

The longest running SQL statements together with the most frequently used SQL statements help you identify the most likely candidates for SQL tuning.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1561

IB M D B 2 ( W / U /L ) PE R F O R M AN C E A N A L Y S T S T AT I S T IC S > IB M D B 2 ( W / U /L ) PE R F O R M A N C E A N A L Y S T

15 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S

PACE

A

NALYST

Space management plays a key role in a database’s uptime and overall performance. Because of this, it’s important that a database administrator understand the various types of space bottlenecks that can occur in a database.

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to help you effectively locate and troubleshoot bottlenecks and performance inefficiencies that result from the challenges of space management. Running inside the Embarcadero DBArtisan console,

Space Analyst automates all diagnostic and correction procedures so any space-related headache can be quickly detected and corrected before it reaches critical mass.

The table below describes the major sections of the help available for the Space Analyst.

Section

Welcome to Space Analyst

Description

Provides information about opening, and licensing Space

Analyst.

Space Analyst Product Design

Provides conceptual information about Space Analyst’s product design and navigation.

Using Space Analyst

Shows how to use each component of the application.

Using Space Analyst breaks each process and procedure into simple step-by-step instructions.

Space Analyst for Oracle tutorial

Space Analyst for Microsoft

SQL Server Tutorial

Space Analyst for Sybase ASE

Tutorial

Space Analyst for IBM DB2 for

Linux, Unix, and Windows

Tutorial

Space Analyst Expert Guide

Helps you get started with Embarcadero Space Analyst.

Provides the foundation you need to explore the many features and benefits of Space Analyst.

Helps you get started with Embarcadero Space Analyst.

Provides the foundation you need to explore the many features and benefits of Space Analyst.

Helps you get started with Embarcadero Space Analyst.

Provides the foundation you need to explore the many features and benefits of Space Analyst.

Helps you get started with Embarcadero Space Analyst.

Provides the foundation you need to explore the many features and benefits of Space Analyst.

Provides detailed information on each tab of the Space

Analyst and discusses fragmentation concepts.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1563

SP A C E AN A L Y ST >

15 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WEL C O M E TO S P AC E A N A L YS T > WE L C OM E T O SP A C E AN A L Y ST

W

ELCOME TO

S

PACE

A

NALYST

Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance problems that result from poor space management. Space Analyst helps ensure that database storage is being used as efficiently as possible.

Space Analyst also includes a Reorganization Wizard as part of the Space Management Wizard

that handles full storage structure and object reorganization needs.

For more information, see:

• What You Should Know Before Installation

• Opening an Analyst

• Licensing Space Analyst

• Using Space Analyst

W

HAT

Y

OU

S

HOULD

K

NOW

B

EFORE

I

NSTALLATION

When you install the Analyst, several Embarcadero-generated stored objects are pushed onto the database server.

These objects are as follows:

SQL Server

Procedures sp_embt_sa_database_map sp_embt_sa_database_overview sp_embt_sa_filegroups sp_embt_sa_files sp_embt_sa_index_space_reorg sp_embt_sa_index_space_reorg_summar y sp_embt_sa_table_space_general sp_embt_sa_table_space_reorg sp_embt_sa_index_reorg_summa ry sp_embt_sa_table_reorg_summary sp_embt_sa_dbbottlenecks sp_embt_sa_index_space_general sp_embt_sa_server_overview sp_embt_sa_table_space_reorg_su mmary sp_embt_sa_version

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1565

WEL C OM E T O SP A C E A N AL Y ST > WEL C O M E TO S PA C E A N A L YS T

SYBASE

Procedures sp_embt_sa_dbspace sp_embt_sa_database_overview sp_embt_sa_db_frag_summary sp_embt_sa_server_overview sp_embt_sa_version sp_embt_sa_device_summary sp_embt_sa_db_obj_space sp_embt_sa_index_diag_summary sp_embt_sa_table_diag_summary

NOTE:

No procedures are installed in Space Analyst for Oracle or DB2.

sp_embt_sa_device_detail sp_embt_sa_database_detail sp_embt_sa_index_diag sp_embt_sa_table_diag

O

PENING AN

A

NALYST

To open the Space Analyst, do the following:

1 On the Analyst menu, click Space Analyst.

NOTE:

The first time that you open the Space Analyst, DBArtisan alerts you that you need to install the Analyst’s procedures. If you elect to install the procedures, an Analyst

Repository Installation dialog opens, prompting for credentials and other security details. When you install the Analyst, several procedures and tables are pushed onto

the database server. For a list of these procedures and tables, see What You Should

Know Before Installation .

U

NINSTALLING A

R

EPOSITORY

To uninstall an Analyst repository, do the following:

1 On the Command Menu, select Uninstall Repository.

The Analyst Repository Uninstallation Wizard opens.

A

NALYST

R

EPOSITORY

U

NINSTALLATION

W

IZARD

- P

ANEL

1

The table below describes the options and functionality on this panel of the Analyst Repository

Uninstallation Wizard:

Option

Administrator Login

Information

Database to hold the procedures

Uninstall

Description

Displays the login name, password, and login as information.

Displays the database that stores the procedures.

Uninstalls the repository and opens Panel 2. For more

information, see Analyst Repository Uninstallation Wizard -

Panel 2 .

15 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WEL C O M E TO S P AC E A N A L YS T > WE L C OM E T O SP A C E AN A L Y ST

A

NALYST

R

EPOSITORY

U

NINSTALLATION

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on this panel of the Analyst Repository

Uninstallation Wizard:

Option

Repository Login

Execution Log

Execution Error(s)

Finish

Description

Displays repository login.

Displays the repository execution log and links to

ETRepoLog.txt.

Displays any errors.

Closes wizard.

L

ICENSING

S

PACE

A

NALYST

Availability of this feature depends on your DBArtisan licensing. For more information, see

Licensing .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1567

WEL C OM E T O SP A C E A N AL Y ST > WEL C O M E TO S PA C E A N A L YS T

15 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P AC E A N A L Y S T A P P L IC A T IO N B AS IC S > S P A C E AN A L Y S T AP P L IC AT I O N B A S I C S

S

PACE

A

NALYST

A

PPLICATION

B

ASICS

The Space Analyst utility assists DBAs with space diagnostics and reorganizations by displaying

pertinent reorganization diagnostics and providing a Reorganization Wizard as part of the Space

Management Wizard that builds scripts that you can execute or schedule to perform

reorganizations.

For more information, see

Product Design .

S

PACE

A

NALYST

P

RODUCT

D

ESIGN

The Space Analyst product design includes tabs for

Oracle , Microsoft SQL Server and IBM DB2

.

O

RACLE

S

PACE

A

NALYST

T

ABS

The Space Analyst includes the following tabs:

Database Overview Tab

Tables Tab

Datafiles Tab

Indexes Tab

Tablespace Map Tab

M

ICROSOFT

SQL S

ERVER

S

PACE

A

NALYST

T

ABS

The Space Analyst includes the following tabs:

Storage Overview Tab

Databases Tab

Files/File Groups Tab

Objects Tab

IBM DB2 S

PACE

A

NALYST

T

ABS

The Space Analyst includes the following tabs:

Database Overview Tab

Tables Tab

Tablespaces Tab

Indexes Tab

S

YBASE

S

PACE

A

NALYST

T

ABS

The Space Analyst includes the following tabs:

Storage Overview Tab

Tables Tab

Database Devices

Indexes Tab

Map Tab

Tablespace Map Tab

Databases Tab

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1569

S P A C E AN A L Y S T AP P L I C AT I O N B A S I C S > S P A C E A N AL Y S T A PP L I C A T IO N B A S I C S

D

ATABASE

O

VERVIEW

T

AB

The Database Overview Tab displays the storage overview for the DB2 datasource.

There are four distinct sections displayed on the first Database Overview Tab of Space Analyst:

• Database Overview

• Log Overview (DB2 Only)

• Tablespace Space Overview

• Tablespace Fragmentation Overview

• Tablespace Objects Overview

For more information, see

Space Analyst Tabs

.

D

ATA

F

ILES

T

AB

The Data Files Tab displays datafile fragmentation information, and displays how much space in

each datafile is assigned to tables, indexes, clusters, and rollback segments.

For more information, see

Space Analyst Tabs

.

T

ABLESPACE

M

AP

T

AB

The Tablespace Map Tab allows for tablespace mapping.

For more information, see

Space Analyst Tabs

.

T

ABLES

T

AB

The Tables Tab lets you identify tables with wasted space. The Space Analyst computes a block

inefficiency ratio that quickly communicates the severity of the space problem. Space Analyst provides a summary count of all tables in a database that violate a customizable block inefficiency threshold, details on the tables, and the extent of wasted space.

For more information, see

Space Analyst Tabs

.

I

NDEXES

T

AB

The Indexes Tab

lets you select index reorganization candidates. The tab also offers the option to obtain deleted leaf row information for each index, although such data gathering can take some time, especially on large systems.

Space Analyst runs diagnostics against your database and graphically display a count of indexes that are found to contain various types of space problems.

For more information, see

Space Analyst Tabs

.

15 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P AC E A N A L Y S T A P P L IC A T IO N B AS IC S > S P A C E AN A L Y S T AP P L IC AT I O N B A S I C S

T

ABLESPACES

T

AB

The Tablespaces Tab

displays the Tablespace Container allocations and Database Partition

Breakdown for each Tablespace.

There are three distinct sections displayed on the Tablespaces Tab of Space Analyst:

• Space Allocation by Container

• Space Allocation by Node

• Tablespaces

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1571

S P A C E AN A L Y S T AP P L I C AT I O N B A S I C S > S P A C E A N AL Y S T A PP L I C A T IO N B A S I C S

15 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

U

SING

S

PACE

A

NALYST

Using Space Analyst covers how to use each component of the application. The Using chapter breaks each process and procedure into simple step-by-step instructions.

The Space Analyst includes the following tabs, by platform:

Space Analyst for Oracle

Database Overview Tab

Tables Tab

Datafiles Tab

Indexes Tab

Tablespace Map Tab

Space Analyst for Microsoft SQL Server

Storage Overview Tab

Databases Tab

Files/File Groups Tab

Objects Tab

Map Tab

Space Analyst for Sybase ASE

The Space Analyst includes the following tabs:

Storage Overview Tab

Tables Tab

Database Devices Tab

Indexes Tab

Databases Tab

Space Analyst for IBM DB2 for Linux, Unix, and Windows

The Space Analyst includes the following tabs:

Storage Overview Tab

Tables Tab

Datafiles Tab

Indexes Tab

Tablespace Tab

S

PACE

A

NALYST FOR

O

RACLE AND

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

- D

ATABASE

O

VERVIEW

T

AB

The Database Overview Tab lets you view the global storage picture of your database.

The table below describes the options and functionality on the Database Overview Tab of Space

Analyst for Oracle:

Option

Database Overview

Description

Shows how much space in KB is taken up in the database by various object types (tables, indexes, etc.) along with a pie chart that represents the percentage of each object type.

You can switch between the default graphical view and a grid view.

NOTE: Objects owned by SYS and SYSTEM are not included in this breakdown.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1573

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Option

Tablespace Space

Overview

Tablespace

Fragmentation Overview

Tablespace Objects

Overview

Description

When in graphical mode, this section contains a bar chart graph that displays all tablespaces and how much total space each has allocated. When in grid mode, Space

Analyst displays detailed information about all tablespaces (status, total, used, free, percent free, etc.)

ORACLE ONLY: When in grid mode, Space Analyst displays tablespace status.

You can switch between the default graphical view and a grid view.

Contains fragmentation information for all tablespaces and displays how badly fragmented a tablespace or datafile is. Higher scores for the tablespace's fragmentation index indicate little or no fragmentation, while lower scores indicate fragmentation. You can switch between graphical and grid views of tablespace fragmentation. If fragmentation is present, you can view detailed object and fragmentation information for the tablespace in the tablespace map. You can correct fragmentation problems via

Space Analyst's Reorganization Wizard. You can switch between the default graphical view and a grid view.

Contains a grid that displays how much space in each tablespace is assigned to tables, indexes, clusters, and rollback segments.

ORACLE ONLY: When in grid mode, Space Analyst displays tablespace LOB data values.

The table below describes the options and functionality on the Database Overview Tab of Space

Analyst for IBM DB2 for Linux, Unix, and Windows:

Option

Database Overview

Log Space Overview

Description

Shows how much space in KB is taken up in the database by various object types (tables, indexes, etc.) along with a pie chart that represents the percentage of each object type.

You can switch between the default graphical view and a grid view.

Displays all of the log options for the database:

Total Used

Total Free

Block Log When Disk Full

Log File Size

User Exit

Primary Logs

Secondary Logs

Maximum Secondary Log Space Used

Maximum Total Log Space Used

15 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Option

Tablespace Space

Overview

Tablespace Objects

Overview

Description

When in graphical mode, this section contains a bar chart graph that displays all tablespaces and how much total space each has allocated. When in grid mode, displays detailed information about all tablespaces:

Name

Type

State

Used Space (MB)

Free Space (MB)

Content Type (Any, Long, Temp, System temp)

Number of containers

NOTE: You can switch between the default graphical view and a grid view.

Contains a grid that displays how much space in each tablespace is assigned to each object. Also displays tablespace LOB data values. Displays detailed information about all tablespace objects:

Tablespace Name

Table - total space used by tables

Index - total space used by indexes

Extent Size - tablespace extent size

Page size - Tablespace page size

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

NOTE:

Functionality differ by platform.

Analysis Report

Extract

Convert to Dictionary-Managed

Estimate Size

Convert to Locally-Managed

Map

Open Editor. For information on modifying database objects, see

Modifying objects using editors .

Open Wizard

Tablespace Wizard (DB2 LUW)

Reorganize

Threshold Options

Update Statistics

For more information, see:

Correcting Tablespace 'out of space' Problems

Space Analyst Tabs

S

PACE

A

NALYST FOR

O

RACLE AND

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

-

D

ATAFILES

T

AB

The Data Files Tab lets you view fragmentation and object placement information for data files.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1575

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

The table below describes the options and functionality on the Datafiles Tab of the Space

Analyst:

Option Description

Datafile Fragmentation Displays fragmentation about datafiles. Higher scores for a datafile's fragmentation index indicate little or no fragmentation, while lower scores indicate fragmentation. If fragmentation is present, you can view detailed object and fragmentation information for the datafile's tablespace in the tablespace map. You can correct fragmentation problems via Space Analyst's Reorganization Wizard.

NOTE: Datafiles for temporary tablespaces are not included in the Datafile

Fragmentation grid.

Datafile Objects

Overview

Contains a grid that displays how much space in each datafile is assigned to tables, indexes, clusters, and rollback segments.

TIP:

To open a Tablespace Editor, right-click a datafile in any grid, and then select Open.

To extract the tablespace DDL in an ISQL editor, right-click a datafile in any grid, and then select Extract.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

NOTE:

Functionalists differ by platform.

Analysis Report

Estimate Size

Convert to Dictionary-Managed

Extract

Convert to Locally-Managed

Map

Open Editor. For information on modifying database objects, see

Modifying objects using editors .

Reorganize

Threshold Options

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

O

RACLE

- T

ABLESPACE

M

AP

T

AB

The Tablespace Map Tab lets you view a graphical layout regarding the physical placement of every object inside a selected tablespace. The tablespace map also helps identify fragmentation problems for a tablespace (honeycomb and bubble). An object grid is also present that lets you view detailed information about every object's storage properties.

The Space Info section contains information regarding the total, used, and free space (in MB) for the tablespace.

15 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The View By section allows you to switch between two different tablespace map views:

Option

Object Type

Extent Problems

Description

The normal tablespace map mode, which is color-coded by object type. Pressing the legend button shows the various colors assigned to the object types contained within the tablespace.

When in this mode, the tablespace map highlights in red any object containing one or both of these object extent problems:·

- Max extent problem - the object has reached or is near its maximum extent limit.

- Extent deficit - the object may not be able to allocate its next extent because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

When in Object Type mode, the accompanying grid of the tablespace map contains the following data:

Data

Name

Extents

Blocks

Bytes

Type

Initial Extent

Next Extent

Percent Increase

Description

The name of the object in owner.object name.partition name format.

The total number of allocated extents for the object.

The total number of allocated blocks for the object.

The total number of allocated bytes for the object.

The object type (table, index, etc.)

The initial space extent (in bytes) allocated to the object.

The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

The percent increase property for the object.

When in Extent Problems mode, the accompanying grid of the tablespace map contains the following data:

Data

Name

Extents

Blocks

Bytes

Type

Initial Extent

Next Extent

Percent Increase

Max Extent Percent

Extendibility

Description

The name of the object in owner.object name.partition name format.

The total number of allocated extents for the object.

The total number of allocated blocks for the object.

The total number of allocated bytes for the object.

The object type (table, index, etc.)

The initial space extent (in bytes) allocated to the object.

The next extent (in bytes) that the object will attempt to allocate when more space for the object is required.

The percent increase property for the object.

A percentage indicating how close the object is to reaching its maximum extent limit. For example, a 100 indicates an object that has reached its maximum extent limit.

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1577

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

When viewing a tablespace in the graphical map, there are two broad categories of fragmentation that you will want to be on the lookout for: free space honeycombs and free space bubbles. Honeycomb fragmentation is really not difficult to detect or handle and occurs when two free space extents in a tablespace reside next to one another. For example, rather than having one large free space extent of 6MB, a tablespace might have two extents that are next to each other (a honeycomb) that make up 3MB and 3MB. If an incoming object required a single 4MB extent allocation, Oracle would have to coalesce the honeycomb to make room for the object. The necessary coalesce operation would cause a small degree of performance degradation, however the situation would be resolved and no space-related bottleneck would remain.

Fragmentation bubbles, however, are another story and are the traditional reason DBAs have had to perform full tablespace reorganizations. Bubbles occur when objects are continuously added and dropped in a tablespace, with the end result being free space pockets (or bubbles) being interspersed between objects that remain in the tablespace. This can become problematic when, for example, an incoming object requires a single 5MB extent allocation, but there is not enough contiguous space in the tablespace to meet the demand. Even if the total amount of free space in the tablespace equals the required 5MB, it will do no good if that 5MB is made up of 5 non-contiguous blocks of free space. In this situation, Oracle has no alternative but to either extend the datafile to make room for the object (if the tablespace's datafile has the

AUTOEXTEND property enabled), or return an error and deny the object entry into the tablespace.

Space Analyst makes it easy to recognize both of these bottleneck headaches. When the map is viewed in Object Type mode, pockets of green seen throughout the tablespace indicate bubble fragmentation, while two or more blocks of green segments viewed next to one another in the map indicate honeycomb fragmentation.

The Tablespace Map Tab includes the following buttons:

Button

Legend

Display

Fit to Window

Full Screen

Print Map

Description

Opens the Tablespace Map Legend.

Opens the Display window. The Display window lets you specifies the magnification level for the Tablespace Map.

Fits the Tablespace Map to the window.

Fits the Tablespace Map to the full screen.

Opens the Print dialog box to print the Tablespace Map.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Estimate Size

Open Wizard

Tablespace Wizard (DB2 LUW)

Convert to Dictionary-Managed

Extract

Reorganize

Threshold Options

Convert to Locally-Managed

Open Editor

Update Statistics

For more information, see Space Analyst Tabs .

15 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

S

PACE

A

NALYST FOR

O

RACLE

, S

YBASE

,

AND

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

- T

ABLES

T

AB

The Tables Tab displays diagnostic information regarding table space inefficiencies that may exist in your database.

The Table Reorganization Candidate Summary section uses a bar chart to count the various types of table space inefficiencies in your database. Note that the reorganization threshold options are used to compute the counts for each type of space inefficiency.

The table below describes the four distinct types of table space inefficiencies that Space Analyst computes for Oracle and Sybase:

Problem

Block Inefficiencies

Next Extent Problems

Chain Problems

Max Extent Problems

Description

These tables have wasted space that exceeds the allowable percentage of wasted space set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options). Tables with wasted space can take longer to scan and therefore contribute to slower response times.

These tables cannot obtain their next extent of free space due to a lack of needed contiguous free space in the tablespace. Tables suffering from this problem may produce error conditions in the database if more data is added to them. This problem will be highlighted even if the tablespace that contains the table has its autoextend property for one or more datafiles set to true.

These tables suffer from a chained or migrated row problem. The percentage of chained or migrated rows to overall rows contained in the table exceeds the allowable percentage of chained rows set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Because chained/migrated rows cause more I/O to occur when they are accessed, overall response times can be degraded when these tables are referenced in SQL queries.

These tables are nearing their maximum extent limit and have exceeded the allowable maximum extent percentage set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Tables suffering from this problem may cause space-related errors to result if more data is added to them.

The Table Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected tables. The table below describes the grid data:

Data

Table Owner

Table Name

Segment Type

Table (KB)

Number of Rows

Number of Blocks

Description

The owner of the table.

The name of the table.

Indicates if the object is a table, table partition, etc.

The total allocated space of the table in KB.

The number of rows that the table contains.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The total number of blocks allocated to the table. NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1579

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Data

Empty Blocks

Highwater Mark

Average Used Blocks

Block Inefficiency

Chained Row Percent

Max Extent Percent

Number of Extents

Max Extents

Extent Deficit

Next Extent

Max Free Space

Tablespace Name

Description

The number of empty blocks that the table contains. NOTE: This column may report

NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

The last block that Oracle will scan up to when searching the table for data.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The average number of blocks that the table is using. NOTE: This column may report

NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

A percentage that indicates how much wasted space (space that the table is not using) that the table contains. High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

A percentage that indicates how many rows in the table suffer from chaining or migration. High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

A percentage indicating how close an object is to reaching its maximum extent limit.

High percentages indicate tables that may be candidates for reorganization.

The number of extents that the table consumes.

The maximum extent limit for the table.

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

The next extent (in bytes) that the table will attempt to allocate when more space for the table is required.

The largest contiguous block of free space that exists in the tablespace where the table resides.

The tablespace that contains the table.

IBM DB2 for Linux, Unix, and Windows

The table below describes the four distinct types of Reorganization Candidate Summary that

Space Analyst computes for IBM DB2 for Linux, Unix, and Windows:

Problem

Overflow Problems

Description

Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Space Utilization

Problem

Page Utilization Problem Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Index Contention

Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Displays the number of tables where the index space is shared by the Tablespace. To resolve, use the

Space Management Wizard

to change the Index Tablespace in table definition.

15 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The table below describes the options and functionality on the Table Reorganization Candidate

Details section:

Option

Tablespace

Table Schema

Display

Refresh

Description

Displays all Tablespaces (regular) in the database and the value [All].

Displays all schema in the database and the value [All].

All Tables

Tables with Overflow Problems - Displays a list of all tables where overflow threshold is exceeded.

Tables with Space Utilization problems - Displays a list of all tables where space utilization threshold is exceeded.

Tables with Page Utilization problems - Displays a list of all tables where the page utilization threshold is exceeded.

Tables with Index Contention - Displays a list of all tables where the table and indexes on the table share the same Tablespace.

Refreshes the table grid with criteria selected in the above lists.

The Table Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected tables. The table below describes the grid data:

Data

Table Schema

Table Name

Cardinality

Size

Overflow

Description

The schema name for the table.

The name of the table.

The number of rows in the table.

The size of Table in bytes.

The number of overflow rows. Overflow rows can be created when rows are updated and the new rows contain more bytes than the old ones (VARCHAR fields), or when columns are added to existing tables.

Pages with Data The number of allocated pages that contain data.

Total Pages The total number of allocated pages.

Active Blocks

Overflow %

Space

Utilization%

The number of Active Blocks in Tables with Multidimensional clustering).

Percentage of overflow rows. This should typical be a small value (5%).

Page Utilization

%

Reorg

Tablespace

Indexspace

A low space utilization is an indicator of excessive fragmentation (internal and external). This can occur when there are many pages with free space and/or many free pages. This should typically be

> 68%.

A low page utilization is an indicator of excessive external fragmentation. This value should typically be more than 80%.

This is an indicator of how severe the fragmentation problem for the table is. --- means

Overflow%, Space Utilization% and Page Utilization % are all with in the thresholds. *-* means that

Overflow%, and Page Utilization % are outside the threshold but Space Utilization% is with in the threshold.

Tablespace where the table data resides.

Tablespace where the index data resides.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1581

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Available Functionality

NOTE:

Functionality differ by platform.

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Estimate Size

Table Wizard (DB2 LUW)

Place

Threshold Options

Finding Space-related Table

Problems

Analyze

Extract

Open Editor

Quick

Reorganize /Reorg

Update Statistics

Space Analyst Tabs .

DBCC

Map

Open Wizard

Reorganize

For more information, see:

S

PACE

A

NALYST FOR

O

RACLE

- T

ABLES

T

AB

The Tables Tab displays diagnostic information regarding table space inefficiencies that may exist in your database.

The Table Reorganization Candidate Summary section uses a bar chart to count the various types of table space inefficiencies in your database. Note that the reorganization threshold options are used to compute the counts for each type of space inefficiency.

The table below describes the four distinct types of table space inefficiencies that Space Analyst computes for Oracle and Sybase:

Problem

Block Inefficiencies

Next Extent Problems

Chain Problems

Max Extent Problems

Description

These tables have wasted space that exceeds the allowable percentage of wasted space set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options). Tables with wasted space can take longer to scan and therefore contribute to slower response times.

These tables cannot obtain their next extent of free space due to a lack of needed contiguous free space in the tablespace. Tables suffering from this problem may produce error conditions in the database if more data is added to them. This problem will be highlighted even if the tablespace that contains the table has its autoextend property for one or more datafiles set to true.

These tables suffer from a chained or migrated row problem. The percentage of chained or migrated rows to overall rows contained in the table exceeds the allowable percentage of chained rows set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Because chained/migrated rows cause more I/O to occur when they are accessed, overall response times can be degraded when these tables are referenced in SQL queries.

These tables are nearing their maximum extent limit and have exceeded the allowable maximum extent percentage set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Tables suffering from this problem may cause space-related errors to result if more data is added to them.

15 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The Table Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected tables. The table below describes the grid data:

Data

Table Owner

Table Name

Segment Type

Table (KB)

Number of Rows

Number of Blocks

Empty Blocks

Highwater Mark

Average Used Blocks

Block Inefficiency

Chained Row Percent

Max Extent Percent

Number of Extents

Max Extents

Extent Deficit

Next Extent

Max Free Space

Tablespace Name

Description

The owner of the table.

The name of the table.

Indicates if the object is a table, table partition, etc.

The total allocated space of the table in KB.

The number of rows that the table contains.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The total number of blocks allocated to the table. NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

The number of empty blocks that the table contains. NOTE: This column may report

NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

The last block that Oracle will scan up to when searching the table for data.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The average number of blocks that the table is using. NOTE: This column may report

NULL if the table has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

A percentage that indicates how much wasted space (space that the table is not using) that the table contains. High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

A percentage that indicates how many rows in the table suffer from chaining or migration. High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

A percentage indicating how close an object is to reaching its maximum extent limit.

High percentages indicate tables that may be candidates for reorganization.

The number of extents that the table consumes.

The maximum extent limit for the table.

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

The next extent (in bytes) that the table will attempt to allocate when more space for the table is required.

The largest contiguous block of free space that exists in the tablespace where the table resides.

The tablespace that contains the table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1583

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Available Functionality

NOTE:

Functionality differ by platform.

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Estimate Size

Table Wizard (DB2 LUW)

Place

Threshold Options

Analyze

Extract

Open Editor

Quick

Reorganize /Reorg

Update Statistics

DBCC

Map

Open Wizard

Reorganize

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST

- T

ABLES

T

AB

The Tables Tab displays diagnostic information regarding table space inefficiencies that may exist in your database.

The Table Reorganization Candidate Summary section uses a bar chart to count the various types of table space inefficiencies in your database. Note that the reorganization threshold options are used to compute the counts for each type of space inefficiency.

The table below describes the four distinct types of table space inefficiencies that Space Analyst computes for Sybase:

Problem

Next Extent

Problems

Description

Block Inefficiencies These tables have wasted space that exceeds the allowable percentage of wasted space set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options). Tables with wasted space can take longer to scan and therefore contribute to slower response times.

These tables cannot obtain their next extent of free space due to a lack of needed contiguous free space in the tablespace. Tables suffering from this problem may produce error conditions in the database if more data is added to them. This problem will be highlighted even if the tablespace that contains the table has its autoextend property for one or more datafiles set to true.

Chain Problems

Max Extent

Problems

These tables suffer from a chained or migrated row problem. The percentage of chained or migrated rows to overall rows contained in the table exceeds the allowable percentage of chained rows set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options). Because chained/ migrated rows cause more I/O to occur when they are accessed, overall response times can be degraded when these tables are referenced in SQL queries.

These tables are nearing their maximum extent limit and have exceeded the allowable maximum extent percentage set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options). Tables suffering from this problem may cause space-related errors to result if more data is added to them.

15 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The Table Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected tables. The table below describes the grid data:

Data

Table Owner

Table Name

Segment Type

Table (KB)

Number of Rows

Number of Blocks

Description

The owner of the table.

The name of the table.

Indicates if the object is a table, table partition, etc.

The total allocated space of the table in KB.

The number of rows that the table contains.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The total number of blocks allocated to the table. NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

Empty Blocks

Highwater Mark

Average Used

Blocks

Block Inefficiency

The number of empty blocks that the table contains. NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The last block that Oracle will scan up to when searching the table for data.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

The average number of blocks that the table is using. NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

A percentage that indicates how much wasted space (space that the table is not using) that the table contains. High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

Chained Row

Percent

A percentage that indicates how many rows in the table suffer from chaining or migration.

High percentages indicate tables that may be candidates for reorganization.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

Max Extent Percent A percentage indicating how close an object is to reaching its maximum extent limit. High percentages indicate tables that may be candidates for reorganization.

Number of Extents The number of extents that the table consumes.

Max Extents The maximum extent limit for the table.

Extent Deficit

Next Extent

Max Free Space

Tablespace Name

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

The next extent (in bytes) that the table will attempt to allocate when more space for the table is required.

The largest contiguous block of free space that exists in the tablespace where the table resides.

The tablespace that contains the table.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1585

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

IBM DB2 for Linux, Unix, and Windows

The table below describes the four distinct types of Reorganization Candidate Summary that

Space Analyst computes for IBM DB2 for Linux, Unix, and Windows:

Problem

Overflow Problems

Description

Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Space Utilization

Problem

Page Utilization Problem Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Index Contention

Displays the number of tables that fall outside the preset limits for the thresholds of this area. Can be addressed with reorganization of the affected table(s).

Displays the number of tables where the index space is shared by the Tablespace. To resolve, use the

Space Management Wizard

to change the Index Tablespace in table definition.

The table below describes the options and functionality on the Table Reorganization Candidate

Details section:

Option

Tablespace

Table Schema

Display

Refresh

Description

Displays all Tablespaces (regular) in the database and the value [All].

Displays all schema in the database and the value [All].

All Tables

Tables with Overflow Problems - Displays a list of all tables where overflow threshold is exceeded.

Tables with Space Utilization problems - Displays a list of all tables where space utilization threshold is exceeded.

Tables with Page Utilization problems - Displays a list of all tables where the page utilization threshold is exceeded.

Tables with Index Contention - Displays a list of all tables where the table and indexes on the table share the same Tablespace.

Refreshes the table grid with criteria selected in the above lists.

The Table Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected tables. The table below describes the grid data:

Data

Table Schema

Table Name

Cardinality

Size

Overflow

Pages with Data

Description

The schema name for the table.

The name of the table.

The number of rows in the table.

The size of Table in bytes.

The number of overflow rows. Overflow rows can be created when rows are updated and the new rows contain more bytes than the old ones (VARCHAR fields), or when columns are added to existing tables.

The number of allocated pages that contain data.

15 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Data

Total Pages

Active Blocks

Overflow %

Description

The total number of allocated pages.

The number of Active Blocks in Tables with Multidimensional clustering).

Percentage of overflow rows. This should typical be a small value (5%).

Space Utilization% A low space utilization is an indicator of excessive fragmentation (internal and external). This can occur when there are many pages with free space and/or many free pages. This should typically be > 68%.

Page Utilization % A low page utilization is an indicator of excessive external fragmentation. This value should typically be more than 80%.

Reorg

Tablespace

This is an indicator of how severe the fragmentation problem for the table is. --- means

Overflow%, Space Utilization% and Page Utilization % are all with in the thresholds. *-* means that Overflow%, and Page Utilization % are outside the threshold but Space Utilization% is with in the threshold.

Tablespace where the table data resides.

Indexspace Tablespace where the index data resides.

Available Functionality

NOTE:

Functionality differ by platform.

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Estimate Size

Table Wizard (DB2 LUW)

Place

Threshold Options

Analyze

Extract

Open Editor

Quick

Reorganize /Reorg

Update Statistics

DBCC

Map

Open Wizard

Reorganize

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

S

YBASE AND

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

-

I

NDEXES

T

AB

The Indexes Tab displays diagnostic information regarding index space inefficiencies that may exist in your database.

The Index Reorganization Candidate Summary section uses a bar chart to count the various types of index space inefficiencies in your database. Note that the reorganization threshold options are used to compute the counts for each type of space inefficiency.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1587

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

The table below describes the three distinct types of table space inefficiencies that Space

Analyst computes:

Problem

BLevel

Next Extent Problems

Max Extent Problems

Description

These indexes have extended beyond the allowable B-level size set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled

Reorganization Threshold Options). Indexes with extended levels can take longer to scan and can therefore contribute to slower response times.

These indexes cannot obtain their next extent of free space due to a lack of needed contiguous free space in the tablespace. Indexes suffering from this problem may cause space-related errors if more data is added to their parent table. This problem will be highlighted even if the tablespace that contains the table has its autoextend property for one or more datafiles set to true.

These indexes are nearing their maximum extent limit and have exceeded the allowable maximum extent percentage set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Indexes suffering from this problem may cause space-related errors to result if more data is added to their parent table.

The Index Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected indexes. The grid contains the following data:

Data

Index Owner

Index Name

Index Type

Index (KB)

Number of Rows

Clustering Factor

Index Blevel

Number of Blocks

Max Extent Percent

Number of Extents

Max Extents

Can Extent Space

Description

The owner of the index.

The name of the index.

Indicates if the type of index (index, index partition, etc.)

The total allocated space of the index in KB.

The number of rows that the parent table contains.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

Indicates the amount of order of the rows in the table based on the values of the index. If the value is near the number of blocks, then the table is very well ordered. If the value is near the number of rows, then the table is very randomly ordered. In this case, it is unlikely that index entries in the same leaf block point to rows in the same data blocks.

Indicates the level of the index. Numbers beyond 3-4 can indicate a fragmented index.

The total number of blocks allocated to the index. Note: this column may report NULL if the index has not been analyzed via the ANALYZE command or through the

DBMS_STATS package.

A percentage indicating how close an object is to reaching its maximum extent limit.

High percentages indicate indexes that may be candidates for reorganization.

The number of extents that the index consumes.

The maximum extent limit for the index.

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

15 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Data

Next Extent

Max Free Space

Tablespace Name

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Description

The next extent (in bytes) that the index will attempt to allocate when more space for the index is required.

The largest contiguous block of free space that exists in the tablespace where the index resides.

The tablespace that contains the index.

NOTE:

The grid can also contain a column for deleted leaf rows if the Get Deleted Leaf Row

Statistics option has been selected. Be aware that the calculation of this statistic can take a lot of time for databases with large numbers of indexes. Large numbers of deleted leaf rows can indicate an index in need of reorganization.

IBM DB2 for Linux, Unix, and Windows

The Index Reorganization Candidate Summary section uses a bar chart to represent the various types of index space inefficiencies in your database:

• Indexes with Cluster Ratio Problems

• Indexes with Used Space% problems

• Indexes with Balance Problems

• Indexes with Deleted RID problems

• Indexes with Empty Leaf Problems

• Indexes with Low Uniqueness

NOTE:

Space Analyst uses the options you select in the Reorganization Wizard

to compute each type of space inefficiency.

TIP:

All of the problems in the Index Reorganization Candidate Summary section except low cardinality can be corrected with index reorganization. The Low cardinality is an indicator of an index where the columns on which it is defined have low level of uniqueness. Such indexes should either be dropped or changed to include columns that will make the index more unique.

The table below describes the options and functionality on the Index Reorganization Candidate

Details section:

Option

Tablespace

Index Schema

Description

Displays all Tablespaces (regular/large) in the database and the value [All].

Displays all schema in the database and the value [All].

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1589

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Option

Display

Description

All Indexes

Indexes with Cluster Ratio Problems

Indexes with Used Space% problems

Indexes with Balance Problems

Indexes with Deleted RID problems

Indexes with Empty Leaf Problems

Indexes with Low Uniqueness

Refreshes the index grid with criteria selected in the above lists. Refresh

The Index Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected indexes. The grid contains the following data:

Data

Index Schema

Index Name

Table Schema

Table Name

Table Cardinality

Avg Key Size

Leafs

Pseudo Empty Leafs

Pseudo Deleted RIDs

Levels

Unique Entries

Page Size

% Free

Cluster Ratio

Used Space%

Description

The schema name for the index.

The name of the index.

The schema name for the base table

The base table name.

The number of rows in the base table.

The index key size, calculated from the average column length of all columns participating in the index.

The total number of index leaf pages.

The number of pseudo empty index leaf pages. A pseudo empty index leaf page is a page on which all the RIDs are marked as deleted, but have not been physically removed.

A RID that is marked deleted. This statistic reports pseudo deletes RIDs on leaf pages that are not pseudo empty. It does not include RIDs marked as deleted on leaf pages where all the RIDs are marked deleted.

The number of index levels.

The number of unique index entries that are not marked deleted.

The page size of the table space in which the table indexes reside, specified at the time of table creation.

Specifies the percentage of each index page to leave as free space, a value that is assigned when defining the index.

The clustering ratio of an index should be greater than 80 percent. When multiple indexes are defined on one table, some of these indexes have a low cluster ratio. (The index sequence is not the same as the table sequence.) This cannot be avoided. Be sure to specify the most important index when reorganizing the table. The cluster ratio is usually not optimal for indexes that contain many duplicate keys and many entries.

Less than 50 percent of the space reserved for index entries should be empty.

15 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Data

Balance

Deleted RIDs

Empty Leaf

Uniqueness

Reorg

Tablespace

Indexspace

Description

To determine if recreating the index would result in a tree having fewer levels. This formula checks the ratio between the amount of space in an index tree that has one less level than the current tree, and the amount of space needed. If a tree with one less level could be created and still leave PCTFREE available, then a reorganization is recommended. The actual number of index entries should be more than 90% (or 100-

PCTFREE) of the number of entries an NLEVELS-1 index tree can handle (only checked if

NLEVELS>1).

The number of pseudo-deleted RIDs on non-pseudo-empty pages should be less than

20 percent.

The number of pseudo-empty leaf pages should be less than 20 percent of the total number of leaf pages.

100 * Index Cardinality / Table Cardinality - A low index uniqueness may indicate the need to Alter or Drop the index.

An indicator of how severe the fragmentation problem for the index is. Each hyphen (-) displayed in this column indicates that the calculated results were within the set bounds of the corresponding formula, and each asterisk (*) indicates that the calculated result exceeded the set bounds of its corresponding formula:

- or * on the left column corresponds to Cluster Ratio

- or * in the second from left column corresponds to Used Space% - or * in the middle column corresponds to Balance

- or * in the second column from the right corresponds to Deleted RIDs

- or * on the right column corresponds to Empty Leaf

The tablespace where the table data resides.

The tablespace where the index data resides.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

NOTE:

Functionality differ by platform.

Analysis Report

Drop

Map

Open Wizard

Reorganize

Analyze

Extract

Index Wizard (DB2 LUW)

Place

Threshold Options

DBCC

Estimate Size

Open Editor

Quick

Reorganize /Reorg

Update Statistics

For more information, see:

Finding Space-related Table Problems

Space Analyst Tabs

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1591

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

S

PACE

A

NALYST FOR

O

RACLE

- I

NDEXES

T

AB

The Indexes Tab displays diagnostic information regarding index space inefficiencies that may exist in your database.

The Index Reorganization Candidate Summary section uses a bar chart to count the various types of index space inefficiencies in your database. Note that the reorganization threshold options are used to compute the counts for each type of space inefficiency.

The table below describes the three distinct types of table space inefficiencies that Space

Analyst computes:

Problem

BLevel

Next Extent Problems

Max Extent Problems

Description

These indexes have extended beyond the allowable B-level size set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled

Reorganization Threshold Options). Indexes with extended levels can take longer to scan and can therefore contribute to slower response times.

These indexes cannot obtain their next extent of free space due to a lack of needed contiguous free space in the tablespace. Indexes suffering from this problem may cause space-related errors if more data is added to their parent table. This problem will be highlighted even if the tablespace that contains the table has its autoextend property for one or more datafiles set to true.

These indexes are nearing their maximum extent limit and have exceeded the allowable maximum extent percentage set in the customizable thresholds of Space Analyst (to see all the thresholds, click the toolbar option labeled Reorganization Threshold Options).

Indexes suffering from this problem may cause space-related errors to result if more data is added to their parent table.

The Index Reorganization Candidate Details section provides filters and a grid that you can use to view detailed space diagnostics for all or selected indexes. The grid contains the following data:

Data

Index Owner

Index Name

Index Type

Index (KB)

Number of Rows

Clustering Factor

Index Blevel

Number of Blocks

Description

The owner of the index.

The name of the index.

Indicates if the type of index (index, index partition, etc.)

The total allocated space of the index in KB.

The number of rows that the parent table contains.

NOTE: This column may report NULL if the table has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

Indicates the amount of order of the rows in the table based on the values of the index. If the value is near the number of blocks, then the table is very well ordered. If the value is near the number of rows, then the table is very randomly ordered. In this case, it is unlikely that index entries in the same leaf block point to rows in the same data blocks.

Indicates the level of the index. Numbers beyond 3-4 can indicate a fragmented index.

The total number of blocks allocated to the index. Note: this column may report NULL if the index has not been analyzed via the ANALYZE command or through the DBMS_STATS package.

15 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Data Description

Max Extent Percent A percentage indicating how close an object is to reaching its maximum extent limit. High percentages indicate indexes that may be candidates for reorganization.

Number of Extents The number of extents that the index consumes.

Max Extents

Can Extent Space

The maximum extent limit for the index.

Indicates if the object can allocate its next extent. If 'N', this is because the tablespace does not currently have enough contiguous free space. This problem will be highlighted even if the tablespace has its autoextend property for one or more datafiles set to true.

Next Extent

Max Free Space

The next extent (in bytes) that the index will attempt to allocate when more space for the index is required.

The largest contiguous block of free space that exists in the tablespace where the index resides.

Tablespace Name The tablespace that contains the index.

NOTE:

The grid can also contain a column for deleted leaf rows if the Get Deleted Leaf Row

Statistics option has been selected. Be aware that the calculation of this statistic can take a lot of time for databases with large numbers of indexes. Large numbers of deleted leaf rows can indicate an index in need of reorganization.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

NOTE:

Functionality differ by platform.

Analysis Report

Drop

Map

Open Wizard

Reorganize

Analyze

Extract

Index Wizard (DB2 LUW)

Place

Threshold Options

DBCC

Estimate Size

Open Editor

Quick

Reorganize /Reorg

Update Statistics

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST

- S

TORAGE

O

VERVIEW

T

AB

The Storage Overview Tab displays an overview of the storage/space situation on the target server:

The table below describes the sections on the Storage Overview Tab of Space Analyst for

Microsoft:

Section

Server Overview

Description

Overview of total database and log space allocated on the SQL Server, as well as a count of databases, files, and file groups.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1593

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Section

Log Overview

Database Overview

Server Disk Overview

Description

Contains a graphical and grid control that works in the following way:

- When the graph is displayed, a bar chart is shown that lists the total percent used of all logs on the server.

- When the grid is displayed, detailed storage information for each database log is presented.

Contains a graphical and grid control that works in the following way:

- When the graph is displayed, a bar chart is shown that lists the total space usage of all databases on the server.

- When the grid is displayed, detailed storage information for each database is presented.

Contains an overview of total free space, by physical server drive, of the server that houses SQL Server.

The table below describes the sections on the Storage Overview Tab of Space Analyst for

Sybase:

Section

Server Overview

Description

Overview of total database and log space allocated on the Sybase Server, as well as a count of databases and devices.

Log Overview Contains a graphical and grid control that works in the following way:

- When the graph is displayed, a bar chart is shown that lists the total percent used of all logs on the server.

- When the grid is displayed, detailed storage information for each database log is presented.

Database name

Total log space

Free log space

Used log space

Log percent free

Database Overview Contains a graphical and grid control that works in the following way:

- When the graph is displayed, a bar chart is shown that lists the total space usage of all databases on the server.

- When the grid is displayed, detailed storage information for each database is presented:

Database name

Total database space

Database free space

Database used space

Database percent free

15 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Section

Device Overview

Description

Contains a graphical and grid control that works in the following way:

- When the graph is displayed, a bar chart is shown that lists the total space used (in MB) of all devices defined to the server.

- When the grid is displayed, detailed storage information for each database device is presented:

Device name

Physical name

Total space

Used space

Free space

Percent free

Percent used

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar for

Microsoft:

Analysis Report

Database Wizard (SQL Server)

Open Wizard

Threshold Options

Extract

Object Details

DBCC

Map

Open Editor

Shrink

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar for

Sybase:

Analysis Report

Open Editor

Move Log

Threshold Options

Space Analyst Tabs

Extract

Open Wizard

DBCC

For more information, see:

I

ndex Details

Database Wizard (Sybase)

Table Details

Pinpointing 'out of space' Problems

S

PACE

A

NALYST FOR

M

ICROSOFT

- F

ILE

G

ROUPS

/F

ILES

T

AB

The Files/File Groups Tab displays a graph and grid for filegroups on the server and a grid for files.

TIP:

You can toggle between the graphs and grid views.

The File Groups/Files Tab reports space usage on SQL Server by file group and by file.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1595

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

When the File Groups radio button is pressed, Space Analyst presents a graphical layout of file group space usage across all databases. For large servers, not all file groups will initially be shown, but the graph is scrollable so you can click the graph and scroll to see all file groups on the chart. When in grid mode, more detailed information is shown for each file group including its auto-growth properties, how many files make up the group, the amounts (in MB) taken up by tables and indexes, and more.

When the Files radio button is pressed, detailed information is displayed for each individual file for every database on the server.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Database Wizard (SQL Server)

Open Wizard

Open Wizard

Extract

Object Details

DBCC

Threshold Options

Map

Open Editor

Shrink

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

M

ICROSOFT

- M

AP

T

AB

The Map Tab displays a graphical file map that displays extent placement for objects within database files.

The Map Tab lets you view a graphical layout regarding the physical placement of every object inside a selected database and file. The map helps identify allocated and unused extents throughout a database file. An object grid is also present that lets you view detailed information about every object's storage usage in that file. Keep in mind that an object can span more than one file.

The Space Info section at the top contains information regarding the total number of extents allocated to a database file, a count of extents that contain table data, a count of extents that contain index data, and a count of extents that contain text data.

Databases are comprised of logical pages, each of which is a fixed 8KB in size. Note that the 8KB page is also a unit of I/O, which affects performance and locking. Extents are collections of database pages. An extent is made up of eight, 8K pages and is therefore 64KB in size. Extents are the graphical "blocks" displayed in the map.

Extents come in two flavors - uniform and mixed. Uniform extents ascribe all eight database pages to a single object, whereas mixed extents have the potential to hold multiple objects.

With mixed extents, SQL Server tries to preserve space by not letting very small objects take up an entire extent and therefore waste a lot of space. By placing your mouse pointer over an extent "block" in the map, Space Analyst will present a pop-up dialog displaying what object(s) is/are contained in that extent.

15 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The table below describes the options and functionality on the Map Tab of Space Analyst:

Option

Space Info

Description

Displays total extent count, extents with tables count, extents with indexes count, and extents with text count. Note that an extent can contain more than one object and more than one object type.

Map Displays object extent data from beginning to end of the database or file.

All blocks in the map are the same size. A Microsoft SQL Server extent is 64KB in size or 8, 8K pages.

Purple - Indicate extents that have been allocated to objects (used), and extents that are free.

Green - Free extents.

Displays table owner.

Owner

Table name

Object type

Index name

Pages used

Displays table name.

Displays object type.

Displays index name.

Displays pages used.

Pages allocated Displays pages allocated.

In extents How many extents each object is in.

Table id

Index id

Displays table id.

Displays index id.

The Tablespace Map Tab includes the following buttons:

Button Description

Legend

Display

Opens the Tablespace Map Legend.

Opens the Display window. The Display window lets you specifies the magnification level for the

Tablespace Map.

Fit to Window Fits the Tablespace Map to the window.

Full Screen

Print Map

Fits the Tablespace Map to the full screen.

Opens the Print dialog box to print the Tablespace Map.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Object Details

DBCC

Extract

Open Editor

Shrink

Database Wizard (SQL Server)

Open Wizard

Threshold Options

For more information, see Space Analyst Tabs .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1597

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

S

PACE

A

NALYST FOR

M

ICROSOFT

- D

ATABASES

T

AB

The Databases Tab lets you analyze databases.

TIP:

You can toggle between the graphs and grid views.

The Databases Tab displays information regarding space usage across all databases, potential space-related bottlenecks that are threatening databases, and recent database backup information.

When in graph form, the Database Summary section displays a graphical view of table, index, and free space usage (in MB) across all databases. For large servers, not all databases will initially be shown, but the graph is scrollable so you can click the graph and scroll to see all databases on the chart. When in grid form, the Database Summary section displays much more detail regarding database and log usage, object counts, and more.

The Database Bottlenecks section provides a graphical count of various space-related bottlenecks that are threatening the availability of your databases (some of which are controlled by Space Analyst's customizable thresholds). When in grid form, each database is listed along with information that relays whether or not a potential bottleneck exists for that database.

The Database Backups section details the most recent backup for each database and the size (in

MB) of the backup.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Database Wizard (SQL Server)

Open Wizard

Threshold Options

Extract

Object Details

DBCC

Map

Open Editor

Shrink

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

M

ICROSOFT

- O

BJECTS

T

AB

The Objects Tab displays database objects, including tables and indexes.

You can choose whether to view table or index information by clicking either the Tables or

Indexes ratio buttons. You can also choose whether to view general space information for tables and indexes or reorganization metrics by selecting the General Space or Space Diagnostics radio buttons.

NOTE:

To obtain space diagnostic information for each object, Space Analyst uses the SQL

Server DBCC SHOWCONTIG command. This command may take a while to run on large databases. Also, the command is not as efficient in terms of performance on version 7.0 of SQL Server as it is on SQL Server 2000, so understand that running space diagnostics on most versions of SQL Server will take some time.

15 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The Object summary presents one of two views:

• When the General Space radio button is pressed, a graph is presented that visually displays that amount of allocated space (in KB) for tables, indexes, and free space. For large servers, not all objects for a database will initially be visible on the chart, but the graph is scrollable so you can click the graph and scroll to see all database objects on the chart.

• When the Space Diagnostics radio button is pressed, Space Analyst presents a count of all objects (tables or indexes) that exceed your customizable thresholds for various forms of fragmentation of other space-related inefficiency. See below for a thorough discussion of these types of space problems.

The Object Details grid presents one of two views:

• When the General Space radio button is pressed, general space usage for tables or indexes is shown. Base object metadata (object name, type, partitions, etc.) is shown along with the amounts of total, used, and free space (in KB) for the object. The percent of space used for the object is also shown along with the percent of space in the database that the object consumes.

• When the Space Diagnostics radio button is pressed, Space Analyst present fragmentation and other space-related inefficiency information for all objects in the selected database.

Note that definitions for all the various forms of object fragmentation and space inefficiencies follow later in the help.

The table below describes the options and functionality on the Objects Tab of Space Analyst:

View

Database

Tables

Indexes

General Space View

Space Diagnostic View

File Group

Owner

Display

Description

Lets you switch between databases.

Lets you switch between viewing space for tables and indexes. Displays object details when you select.

Lets you switch between viewing space for tables and indexes.

Displays object details when you select.

Displays general space information for tables and indexes in the selected database.

Displays object details when you select.

Displays fragmentation and space information to help the DBA decide if a reorg is necessary.

Displays object details when you select.

Lets you view object data for all filegroups for the database or only a selected filegroup.

Lets you view object data for all table owners or only a selected owner.

Lets you view space diagnostic information for tables or indexes.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Extract

Database Wizard (SQL Server)

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1599

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

Open Editor

Threshold Options

Open Wizard

Update Statistics

For more information, see Space Analyst Tabs .

DBCC

S

PACE

A

NALYST FOR

S

YBASE

ASE - D

ATABASE

D

EVICES

T

AB

The Database Devices Tab displays database device information.

TIP:

You can toggle between graph and grid views.

The table below describes the sections on the Database Devices Tab of Space Analyst:

Section

Device Summary

Device Details

Database Fragments

Description

Contains summary information for all Sybase database devices. Displays the amount of data, log, data and log, and free space amounts (in MB).

Displays detailed information for selected devices. Lets you click in a bar chart and populate the lower section of the tab with that device's information.

Displays database fragments.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Index Details

Database Device Wizard (Sybase)

Open Wizard

Refit

Resize

Move Log

Segment Wizard (Sybase)

DBCC

Table Details

Extract

Database Wizard (Sybase)

Open Editor

Reinitialize

Threshold Options

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

S

YBASE

ASE - D

ATABASES

T

AB

The Databases Tab lets you analyze databases.

TIP:

You can toggle between graph and grid views.

16 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

The table below describes the sections on the Databases Tab of Space Analyst:

Section Description

Database Summary Contains chart that displays database used and free space, along with log used and free space information for databases.

The summary section totals up the total database, log, table, and index space. Also displays a summary count of all user tables and indexes.

Database Details Displays detailed information for selected databases. Lets you select whether the graph shows space utilization or object fragmentation scores.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

Analysis Report

Index Details

Database Device Wizard (Sybase)

Open Wizard

Refit

Resize

Move Log

Segment Wizard (Sybase)

DBCC

Table Details

Extract

Database Wizard (Sybase)

Open Editor

Reinitialize

Threshold Options

For more information, see Space Analyst Tabs .

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

- T

ABLESPACES

T

AB

The Tablespace Tab lets displays tablespace space allocation and tablespace.

Available Functionality

The following functionality is available in the Command menu, shortcut menu, and toolbar:

NOTE:

Functionality differ by platform.

Analysis Report

Open Wizard

Tablespace Wizard (DB2 LUW)

Extract

Reorganize

Threshold Options

Open Editor - see

Modifying objects using editors

Update Statistics

For more information, see Space Analyst Tabs .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1601

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

S

PACE

A

NALYST FOR TUNCTIONALITY

Space Analyst offers functionality that help you analyze space. The Space Analyst support the following functionality:

NOTE:

Functionality differ by platform.

Analysis Report

Resize

Estimate Size

Map

Database Device Wizard (Sybase)

Tablespace Wizard (DB2 LUW)

Options

DBCC

Reorganize

Update Statistics

Convert to Dictionary Managed

DBCC

Extract

Move Log

Segment Wizard (Sybase)

Open Editor

Place

Refit

Shrink

Convert to Locally Managed

Drop

Index Details

Database Wizard (Sybase)

Table Wizard (DB2 LUW)

Open Wizard

Quick

Reorganize /Reorg

Reinitialize

Table Details

S

PACE

A

NALYST

- A

NALYSIS

R

EPORT

The Analysis Report dialog box lets you build an HTML analysis report for the selected tablespace. You can run reports on a recurring basis and dynamically alter any saved thresholds that flag space problems in the tablespace being analyzed.

For Oracle, the report includes sections for particular reorganization needs, including:

• Fragmentation index for the tablespace

• Tables with high block inefficiencies

• Tables or indexes with next extent space deficit problems

• Tables or indexes with maximum extent limit problems

• Tables or indexes with percent increase greater than zero

• Tables with chained/migrated row problems

• Indexes with B-tree depth problems

For Microsoft, the report contains different sections that highlight particular reorganization needs, including:

• Free space levels for the database and log

• Tables with forwarded record problems

• Indexes with average fragmentation problems

• Tables or indexes with extent fragmentation problems

16 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

• Tables or indexes with logical fragmentation problems

• Tables or indexes with scan density problems

• Tables or indexes with average page density problems

For Sybase, the report contains different sections that highlight particular reorganization needs, including:

• Free space levels for the database and log

• Tables with forwarded row problems

• Tables with empty page problems

• Tables with deleted row problems

• Tables with low fragmentation scores

• Indexes with unused space problems

• Indexes with empty leaf problems

• Indexes with height/level problems

• Indexes with low fragmentation scores

For IBM DB2 for Linux, Unix, and Windows, the report contains different sections that highlight particular reorganization needs, including:

• Tables with overflow problems

• Tables with space utilization problems

• Tables with page utilization problems

• Tables with index space contention

• Indexes with cluster ratio problems

• Indexes with used space% problems

• Indexes with balance problems

• Indexes with deleted RID problems

• Indexes with empty leaf problems

• Indexes with low uniqueness

• Free levels of tablespace and log space

To open the Analysis Report dialog box:

1 Open the Space Analyst.

2 On the Command menu, click the Analysis Report.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1603

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

For all platforms, browse to or type a report title and make your desired selections from the drop-down lists. After the report executes, you can print it or save it.

To print the report:

1 Click Print from the Analysis Report toolbar.

To save the report:

1 Select Save from the File menu on the main toolbar.

S

PACE

A

NALYST

- C

ONVERT TO

L

OCALLY

-

MANAGED

NOTE:

The Convert to Locally-Managed dialog box is for Oracle 8.1.6 or later.

The Convert to Locally-Managed dialog box lets you convert a dictionary-managed tablespace to locally-managed. Objects in locally-managed tablespaces have unlimited extents; they will never fail to extend due to an imposed maximum extent limit.

Important Notes

There are a few restrictions on these conversion procedures (for example, Oracle9i UNDO tablespaces currently can't be converted, etc.), so you should check the Oracle documentation for the specifics on performing a conversion.

The Convert to Locally-Managed option is only available if the selected tablespace(s) are:

• ONLINE

• In Read/Write mode

• Dictionary managed

• Not UNDO tablespaces

• Not Temporary tablespaces

• Not the SYSTEM tablespace

The table below describes the options and functionality on the Convert to Locally-Managed dialog box:

Option

Tablespaces to be

Converted

Conversion Options

Description

Displays the tablespaces to be converted to locally-managed.

OPTIONAL: Lets you type allocation unit and relative file number information.

16 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G S PA C E A N A L YS T > US IN G SP A C E AN A L Y ST

Completing the Convert to Locally-Managed Dialog Box for Space Analyst

To complete this dialog box, do the following:

1 Select Convert to Locally-Managed.

OR

Right-click the target object, and then select Convert to Locally-Managed.

The Space Analyst opens the dialog box.

2 Do one of the following:

Button Description

Opens the Preview dialog box.

Opens a scheduling application.

Executes the task.

For more information, see

Convert to Locally-Managed .

S

PACE

A

NALYST

- C

ONVERT TO

D

ICTIONARY

-M

ANAGED

NOTE:

The Convert to Dictionary-Managed functionality is for Oracle 9i only.

The Convert to Dictionary-Managed dialog box lets you convert a locally-managed tablespace to dictionary.

Important Notes

The Convert to Dictionary-Managed dialog box is only available if the selected tablespace(s) are:

• ONLINE

• In Read/Write mode

• Locally managed

• Not UNDO tablespaces

• Not Temporary tablespaces

• Not the SYSTEM tablespace

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1605

U SIN G SP A C E A N AL Y S T > U SI N G S P AC E A N A L Y ST

The table below describes the options and functionality on the Convert to Dictionary-Managed dialog box:

Option

Tablespaces to be

Converted

Description

Displays the tablespaces to be converted to dictionarymanaged.

Completing the Dictionary-Managed Dialog Box for Space Analyst

To complete this dialog box, do the following:

1 Select Convert to Dictionary-Managed.

OR

Right-click the target object, and then select Convert to Dictionary-Managed.

The Space Analyst opens the dialog box.

2 Do one of the following:

Button Description

Opens the Preview dialog box.

Opens a scheduling application.

Executes the task.

For more information, see

Convert to Dictionary-Managed .

S

PACE

A

NALYST

- E

XTRACT

The Extract functionality lets you extract the database DDL in an ISQL editor.

To extract the database DDL in an ISQL editor, do the following:

1 Click the Extract DDL button.

OR

Select Extract.

OR

Right-click the target object, and then select Extract.

Space Analyst extract the database DDL in an ISQL editor.

16 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P A C E MA N A G E M E N T W I Z A RD > S P A C E M AN A G E ME N T W I Z A RD

S

PACE

A

NALYST

- M

AP

The Map functionality opens the

Tablespace Map Tab

or Map Tab

of the Space Analyst for the selected index.

Important Notes

None

For more information, see

Opening the Tablespace Map Tab

.

O

PENING THE

T

ABLESPACE

M

AP

T

AB FOR

S

PACE

A

NALYST

To open the Tablespace Map or Map Tab, do the following:

1 Select Map.

OR

Right-click the target object, and then select Map.

Space Analyst open the Tablespace Map Tab or Map Tab.

For more information, see

Map .

S

PACE

A

NALYST

- O

PEN

E

DITOR

The Open functionality lets you modify objects in the object editors.

To open the object editor, do the following:

1 In any grid, select an object.

2 Click the Open Editor button.

OR

Select Open.

OR

Right-click the target object, and then select Open.

Space Analyst opens the object editor.

S

PACE

M

ANAGEMENT

W

IZARD

The Space Management Wizard can create two specialized space management jobs that allow you to proactively eliminate space threats before they affect your database:

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1607

S P A C E M AN A G E ME N T W I Z A RD > S P A C E M A N AG E M E N T W IZ A RD

You can create a "reorganization analyst job" that allows you to specifically select various databases and/or objects and then set reorganization thresholds that determine when a reorganization will occur. Once constructed, you can schedule these jobs to run as often as you'd like. During execution, these jobs will interrogate your chosen database/objects and determine if a reorganization needs to occur by applying your customized reorganization thresholds. If any objects are found to need reorganization, they are dynamically reorganized using any customized options you specify.

You can build space maintenance jobs that will perform functions such as check the validity of your databases and filegroups, repair any found minor corruption, and eliminate unused space in your databases. You can also set the job up to notify you if any problems are found during job execution.

C

REATING OR EDITING A SPACE

M

ANAGEMENT

J

OB

The Space Management Wizard lets you create space reorganization or maintenance jobs without knowing the code. After creation, jobs can be reused as is, or edited.

To open the Space Management Wizard

1 Start the Space Analyst and click the Open Wizard button on the Space Analyst toolbar.

OR

Select Open Wizard from the Space Analyst menu.

The sections below display the fields you may find creating or editing a space management job.

Be aware that the sections you see, and the order in which they appear in the wizard vary depending on the selections you make and the database platform.

New or Used Task

Type of Space Management Task Database/Objects to Be Part of the

Reorganization or Maintenance Task

Global Customizations

Custom Reorganization

Specific Object Customization

Integrity Check for Specific Database

Objects

Save the OperationExecution

Preferences for a Reorganization

Operation

Threshold Criteria for Object

Reorganization

Unused Space Options

Integrity Check Options

Problem Notification

New or Used Task

Here you choose whether to create a new space management task or whether to use a previously saved task. If you want to reuse a previously created job, you can type or browse to find the previously saved task definition file (*.sptsk).

16 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P A C E MA N A G E M E N T W I Z A RD > S P A C E M AN A G E ME N T W I Z A RD

Type of Space Management Task

Required Information

Create standard reorganization job

Description

Select to build a reorganization job for a database or the objects you specify.

Create reorganization analyst job Select to create and deploy a reorganization job that runs periodically to detect and automatically correct space inefficiencies.

Create space maintenance job Select to build a space maintenance job that validates database structures and performs storage maintenance tasks.

Database/Objects to Be Part of the Reorganization or Maintenance Task

Choose the databases and/or objects you want to include in the job you are creating. Simply move items from the tree in the right pane to the left pane by clicking the right arrow. You can amend your selections using the left arrow. The selection is limited to entire databases for a space maintenance job.

Custom Reorganization

Required Information

Perform no customizations

Perform global customizations

Perform specific object customizations

Description

When you choose this option, all default object and database attributes are used.

This option gives you the chance to define options that will be globally applied to all objects being reorganized.

Here you individualize options for specific objects being reorganized.

Save the Operation

If you want to save the operation, you can use the default name supplied or type another in the upper panel. If you don’t want to save the operation, remove the default name. Browse to the location where you want to save the file. The job as it was created appears in the read-only preview panel. To make changes, you must go back and change your selections or open the job in an ISQL window prior to execution.

Execution Preferences for a Reorganization Operation

Option

Open the reorganization script in an ISQL editor.

Perform reorganization now

Schedule the reorganization script for later execution.

Description

The reorganization script will be generated and then opened in a new ISQL editing session.

The reorganization is run immediately with results presented afterward in an ISQL window.

The reorganization script will be generated and then scheduled to run at a specified date/time.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1609

S P A C E M AN A G E ME N T W I Z A RD > S P A C E M A N AG E M E N T W IZ A RD

Global Customizations

Option

Relocate to file group

Perform sorted reorg using table's clustered index

Perform online reorganization where possible

View reorganization output messages

Defragment tables in DROP/

CREATE fashion

Relocate to file group

Fill Factor

Description

Select to perform an extended alter and move the table(s) to the requested file group using the ON keyword in the table creation DDL.

Select to rebuild of any table's clustered index.

MICROSOFT SQL SERVER 2000 OR LATER ONLY: Select to use the DBCC

INDEXDEFRAG command to perform an online rebuild of every table's index(es).

Select for the WITH NO_INFOMSGS clause of any DBCC command to not be used.

Select to defragment tables in DROP/CREATE fashion.

Select for DROP_EXISTING clause instead of doing a drop and then create.

Select to specify a new fill factor for the DBCC DBREINDEX command or a create/drop of an existing index.

Index Reorganization

Perform online reorganization where possible

View reorganization output messages

Rebuild: This is the default (ALTER INDEX...REBUILD for MS SQL 2005; MS SQL

Server 2000 and 2005 display DBCC DBREINDEX).

Drop/Create

For MS SQL Server 2005 or later: Reorganize

MICROSOFT SQL SERVER 2000 OR LATER ONLY: Select to use the DBCC

INDEXDEFRAG command to perform an online rebuild of every index.

Select for the WITH NO_INFOMSGS clause of any DBCC command to not be used.

16 10 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P A C E MA N A G E M E N T W I Z A RD > S P A C E M AN A G E ME N T W I Z A RD

Specific Object Customization

Option

Select

Description

Drop-down list lets you switch between indexes and tables and see the particular objects for each.

Relocate to file group

Fill Factor

Perform sorted reorganization using table's clustered index

Index reorganization

Perform online reorganization where possible

View reorganization output messages

Defragment tables in DROP/CREATE fashion

Select a clause instead of doing a drop and then create.

For indexes, select to specify a new fill factor.

For tables, select to perform sorted reorganization using table's clustered index.

Rebuild: This is the default.

Drop/Create

Reorganize

MICROSOFT SQL SERVER 2000 OR LATER ONLY:

Select to perform an online rebuild of every index.

Select for the WITH NO_INFOMSGS clause of any DBCC command to not be used.

For tables, select to defragment tables in DROP/CREATE fashion.

Threshold Criteria for Object Reorganization

NOTE:

The table combines criteria for MS SQL Server 2000 and 2005.

Option

Table: Average Page Density

Scan Density Percent

Logical Fragmentation

Extent Fragmentation

Forwarded Record Percent

Index: Average Fragmentation

Scan Density Percent

Logical Fragmentation

Extent Fragmentation

Index Tree Depth

Average Page Density

Description

Default is less than or equal to 50.

Default is less than or equal to 0.

Greater than or equal to 25 is the default value.

Default is greater than or equal to 50.

Default is greater than or equal to 50.

Default is greater than or equal to 25.

Default is less than or equal to 0.

Greater than or equal to 25 is the default value.

Default is greater than or equal to 50.

Default is greater than or equal to 3.

Default is less than or equal to 50.

NOTE:

All defaults are editable. Also, all current metrics for these criteria can be found on the

Objects tab >Space Diagnostics view. The default thresholds are visible when you choose Threshold Options from the Space Analyst drop-down menu.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1611

S P A C E M AN A G E ME N T W I Z A RD > S P A C E M A N AG E M E N T W IZ A RD

Integrity Check Options

Option

Do not perform any integrity checks

Check databases

Check file groups

Check specific database objects

Include index checks for all tables

Attempt to repair minor problems

Include check for database catalogs

Correct data dictionary inaccuracies

Check data purity

Description

Self-explanatory.

Checks the database integrity for database(s) you identified earlier.

Self-explanatory.

In a later step you are able to select the particular objects.

This is the default and isn’t actually optional.

Enabled as a default for database or database objects integrity checks. You can unselect.

Enabled as a default for database integrity checks. You can unselect.

Enabled as a default for database integrity checks. You can unselect.

Verifies that columns only have data in the correct ranges, and so on.

Integrity Check for Specific Database Objects

Here you select objects for the database(s) you have included in this maintenance job.

Unused Space Options

Option Description

Do not eliminate unused space Self-explanatory

Eliminate unused space for databases Select to only truncate space for databases larger than a specific size (in

MB).

Only eliminate space when database is larger than

Amount of free space to leave for database

Available if you selected Eliminate unused space for databases option. Lets you specify maximum database size in MB.

Lets you specify how much free space is to remain after a space truncation.

Eliminate unused space for specific database tables

Self-explanatory.

Problem Notification

Option

No, do not notify me

Yes, notify me in the following ways.

Description

Select to not have Space Analyst notify you of any errors.

Select to have Space Analyst notify you of any errors and then type an e-mail or net send address.

S

PACE

A

NALYST

- T

HRESHOLD

O

PTIONS

The Space Analyst Reorganization Thresholds Options dialog box lets you customize the various reorganization thresholds that can be used to flag storage and data objects that need to be

reorganized. The thresholds you specify will apply to the Space Analysis Reports .

16 12 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P A C E MA N A G E M E N T W I Z A RD > S P A C E M AN A G E ME N T W I Z A RD

Important Notes

None

The table below describes the options and functionality on the Space Analyst Thresholds

Options dialog box for IBM DB2 for Linux, Unix, and Windows:

Option

Table

Reorganization

Thresholds

Index

Reorganization

Thresholds

Description

The table thresholds apply to the displays used in tab 4 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the tablespace analysis report.

The index thresholds apply to the displays used in tab 5 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the tablespace analysis report.

The table below describes the options and functionality on the Space Analyst Thresholds

Options dialog box for Oracle:

Option

Tablespace and Datafile

Fragmentation

Thresholds

Table Reorganization

Thresholds

Index Reorganization

Thresholds

Description

The tablespace and datafile thresholds apply to the tablespace and datafile fragmentation index. The default for each is 50 - meaning, flag any tablespace or datafile whose fragmentation index is less than 50. They are also used for the tablespace analysis report.

The table thresholds apply to the displays used in tab 4 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the tablespace analysis report.

The index thresholds apply to the displays used in tab 5 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the tablespace analysis report.

The table below describes the options and functionality on the Space Analyst Thresholds

Options dialog box for Microsoft SQL Server (excluding SQL Server 2005) and Sybase:

Option

Database and Log Space

Thresholds

Table Reorganization

Thresholds

Index Reorganization

Thresholds

Description

The database and log space thresholds apply to the database and log fragmentation index. The default for each is 80 - meaning, flag any database or log whose fragmentation index is less than 80. The database and log space thresholds apply to any grid that shows free space percent for those entities.

The table thresholds apply to the displays used in tab 5 of the Space Analyst and the procedures that are run to present the various customized displays. They are also used for the database analysis report.

The index thresholds apply to the displays used in tab 5 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the database analysis report.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1613

S P A C E M AN A G E ME N T W I Z A RD > S P A C E M A N AG E M E N T W IZ A RD

The table below describes the options and functionality on the Space Analyst Thresholds

Options dialog box for SQL Server 2005:

Option

Database and Log Space

Thresholds

Description

The database and log space thresholds apply to the database and log fragmentation index. The default for each is 80 - meaning, flag any database or log whose fragmentation index is less than 80. The database and log space thresholds apply to any grid that shows free space percent for those entities.

Table Reorganization Thresholds The table thresholds apply to the displays used in tab 5 of the Space Analyst and the procedures that are run to present the various customized displays.

They are also used for the database analysis report.

Index Reorganization Thresholds The index thresholds apply to the displays used in tab 5 of the Space Analyst and the queries that are run to present the various customized displays. They are also used for the database analysis report.

Fragmentation Analysis Mode Detailed is the default. The other options are Sampled and Limited. This option serves as a parameter that’s passed to the space diagnostic procedures use on the Objects tab for the reorganization summary and the detail views for indexes and tables.

Completing the Space Analyst Thresholds Options Dialog Box for Space Analyst

To complete this dialog box, do the following:

1 On the Analysts Toolbar, click the Options button.

The Space Analyst opens the dialog box.

2 Review thresholds.

3 Click OK.

16 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

S

PACE

A

NALYST FOR

O

RACLE TUTORIAL

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance inefficiencies that result from poor space management. Running inside the Embarcadero DBArtisan console, Space Analyst helps you identify and correct storage problems by supplying powerful analysis facilities and corrective utilities and that will satisfy advanced experts, yet are easy enough to use for database novices.

About This Space Analyst for Oracle Tutorial

This tutorial helps you get started with Embarcadero Space Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Space Analyst. You will have learned how to get a summary view of storage for your database as well as how to identify potential space-related threats. Finally, you’ll use the reorganization wizard to correct any space problems that you find.

This tutorial is divided into 5 sections.

Session 1: Getting started With Space Analyst for Oracle

Session 2: Obtaining a Global Vew of Storage Using Space Analyst for Oracle

Session 3: Identifying Storage Structure Problems Using Space Analyst for Oracle

Session 4: Pinpointing Object Performance Inefficiencies Using Space Analyst for Oracle

Session 5: Correcting Space-Related Problems Using Space Analyst for Oracle

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

For more information, see Additional Evaluation Resources .

S

ESSION

1: G

ETTING STARTED

W

ITH

S

PACE

A

NALYST FOR

O

RACLE

Download and Install

You can obtain the latest version of Space Analyst by downloading DBArtisan from the

Embarcadero Web site at http://www.embarcadero.com/downloads/downloaddbartisan.asp

.

Space Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Space Analyst.

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Space Analyst for Oracle Overview

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1615

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

S

PACE

A

NALYST FOR

O

RACLE

O

VERVIEW

Once you are connected to an Oracle database, you can open Space Analyst from within

DBArtisan two ways:

1 On the Analyst menu, select Space Analyst.

NOTE:

You do not need to install anything for Space Analyst to work.

Proceed to

Session 2: Obtaining a Global Vew of Storage Using Space Analyst for Oracle

S

ESSION

2: O

BTAINING A

G

LOBAL

V

EW OF

S

TORAGE

U

SING

S

PACE

A

NALYST FOR

O

RACLE

When it opens, Space Analyst shows a complete overview of the storage situation of a particular database or database server. The first tab of Space Analyst displays all pertinent global statistics regarding storage structure usage throughout a database.

There are four distinct sections displayed on the first Database Overview Tab of Space Analyst:

• Database Overview

• Tablespace Space Overview

• Tablespace Fragmentation Overview

• Tablespace Objects Overview

Proceed to

Space Analyst for Oracle - Database Overview

S

PACE

A

NALYST FOR

O

RACLE

- D

ATABASE

O

VERVIEW

The Database Overview displays:

• The total count of all tablespaces, datafiles and temporary files.

• The percentage breakdown of the various object types in a database. Positioning the mouse pointer over the graph causes it to display the actual percentage amounts for each object type.

• The amount of space in kilobytes that each object type consumes is also shown. This section helps you get a clear picture of exactly how much space the various object types in your database are taking up.

TIP:

If you want to see a grid-style display of the information shown in the graph, position your mouse over the graph, click the right mouse button and select the ‘toggle display’ option.

Proceed to

Space Analyst for Oracle - Tablespace Space Overview

16 16 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

S

PACE

A

NALYST FOR

O

RACLE

- T

ABLESPACE

S

PACE

O

VERVIEW

The Tablespace Space Overview section displays summary information regarding every tablespace in the database. When invoked in graph form, this section shows how much total space is currently allocated to each tablespace. When shown in grid form, this section shows not only the total space allocated for each tablespace, but also includes the used, free, and percent free amounts, along with an indicator that shows whether any of the tablespace’s underlying data or temp files can automatically grow if necessary.

TIP:

To see a grid-style display of the information shown in the graph, position your mouse over the graph, click the right mouse button and select the ‘toggle display’ option. To return to the graph, just perform the same actions over the grid.

When this section is in grid form, you can also perform a number of actions on a tablespace like open it in a DBArtisan editor, extract it’s DDL, convert it to either local or dictionary-managed, and more. For example, to open a tablespace in one of DBArtisan’s object editors, do the following:

1 In the grid, select a tablespace.

2 Right-click and select Open.

OR

Select a tablespace and click the Open toolbar button.

DBArtisan opens a Tablespaces Editor.

Proceed to

Space Analyst for Oracle - Fragmentation Overview

S

PACE

A

NALYST FOR

O

RACLE

- F

RAGMENTATION

O

VERVIEW

The fragmentation overview provides a quick glance into how badly fragmented a tablespace is.

Space Analyst computes a fragmentation index for every tablespace that can be used to quickly tell if fragmentation problems are plaguing a tablespace. A 100 percent reading indicates no fragmentation, while lower scores indicate the presence of fragmentation.

To see the percentage of fragmentation for each tablespace in the graph, do the following:

1 Position the pointer over each bar in the chart.

To see a grid-style display of the information shown in the graph, do the following:

1 Position the pointer over the graph.

2 Right-click and select Toggle Display.

Proceed to

Space Analyst for Oracle - Tablespace Objects Overview

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1617

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

S

PACE

A

NALYST FOR

O

RACLE

- T

ABLESPACE

O

BJECTS

O

VERVIEW

The tablespace objects overview provides a window into the types of objects that each tablespace contains. This view is useful because it helps you quickly understand if undesired objects are present in a tablespace.

NOTE:

There is no graphical view available for this section.

Proceed to

Session 3: Identifying Storage Structure Problems Using Space Analyst for Oracle

S

ESSION

3: I

DENTIFYING

S

TORAGE

S

TRUCTURE

P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

O

RACLE

Space Analyst can help you quickly find storage structure problems that threaten the availability of your database.

Proceed to

Pinpointing ‘out of space’ Problems Using Space Analyst for Oracle

P

INPOINTING

OUT OF SPACE

’ P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

O

RACLE

To quickly tell if any of the tablespaces in your database are about to run out of free space, do the following:

1 Select the Database Overview Tab.

2 In the Tablespace Space Overview section, position the pointer over the graph.

3 Right-click and select Toggle Display.

4 Examine the Percent Free columns of each tablespace along with the Autoextend column. If a tablespace is nearing the end of free space and cannot automatically grow, take action to prevent an out-of-space error.

Proceed to

Locating Fragmentation Issues Using Space Analyst for Oracle

L

OCATING

F

RAGMENTATION

I

SSUES

U

SING

S

PACE

A

NALYST FOR

O

RACLE

There are a number of facilities within Space Analyst that helps you understand storage structure fragmentation.

To get summary information regarding tablespace fragmentation, do the following:

1 Select the Database Overview Tab.

2 In the Tablespace Fragmentation section, position the pointer over the graph.

3 Right-click and select Toggle Display.

16 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

The tablespace fragmentation grid scores each tablespace in terms of fragmentation levels and also present data regarding the number of free chunks in a tablespace along with the largest free chunk size. Tablespaces with poor fragmentation ratings are highlighted in red. Note that you can sort the grid from worst to best tablespaces by clicking on the Fragmentation Index column header in the grid.

To get the same information for datafiles, do the following:

1 Select the Data Files Tab.

The datafile fragmentation grid scores each datafile in terms of fragmentation levels and also present data regarding the number of free chunks in the datafile along with the largest free chunk size. Note that temp files are not shown in this display. Datafiles with poor fragmentation ratings are highlighted in red.

To determine the type of fragmentation for a tablespace (bubble or honeycomb), do the following:

1 Select a tablespace or datafile that appears to have fragmentation issues.

2 Right-click and select Map.

Space Analyst displays a graphical rendering of the tablespace on the Tablespace Map Tab.

Bubble fragmentation can be confirmed by the presence of many free space fragments being found throughout the tablespace. Honeycomb fragmentation can be identified by seeing free space fragments adjacent to one another in the map.

NOTE:

Large tablespace maps can be read easier if the “Full Screen” option is chosen. The standard view may be returned from full screen by clicking on the small full screen dialog box that appears at the upper left side of the display.

Note that object extent fragmentation problems can also be identified in Space Analyst’s tablespace map. To see if any table or index in a designated tablespace suffers from extent fragmentation, do the following:

1 Select the Tablespace Map Tab.

2 Select a tablespace.

3 In the View By section, select the Extent Problems option.

Space Analyst reconstructs the tablespace map and accompanying left-hand object grid to reveal any objects that have extent problems. All objects with extent problems are colorcoded in red for easy identification. Objects colored in green indicate that they doe not suffer from any extent problems.

Proceed to

Using Analysis Reports in Space Analyst for Oracle

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1619

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

U

SING

A

NALYSIS

R

EPORTS IN

S

PACE

A

NALYST FOR

O

RACLE

You can run HTML-formatted reports that pinpoint all major storage-related problems for a particular tablespace and the objects that are contained within it. To produce an Analysis Report, do the following:

1 On the toolbar, click Analysis Report.

Space Analyst opens the Analysis Report dialog box.

2 In Report File Name and Report Title you can change the location and report title of the report.

3 In Category, select the types of space problems you would like to investigate. The default option is All.

4 In Tablespace, select the tablespace you would like to analyze.

5 Click Execute.

Space Analyst creates a frame-based Analysis report for the tablespace.

Proceed to

Session 4: Pinpointing Object Performance Inefficiencies Using Space Analyst for

Oracle

S

ESSION

4: P

INPOINTING

O

BJECT

P

ERFORMANCE

I

NEFFICIENCIES

U

SING

S

PACE

A

NALYST FOR

O

RACLE

Space Analyst can greatly accelerate the process of locating objects in your database that are degrading overall response times because of their current storage/space situation.

Proceed to

Finding Space-related Table Problems With Space Analyst for Oracle

F

INDING

S

PACE

-

RELATED

T

ABLE

P

ROBLEMS

W

ITH

S

PACE

A

NALYST FOR

O

RACLE

To quickly determine if any tables in your database may be contributing to performance slowdowns, do the following:

1 In DBArtisan connect to the database you would like to check.

2 Open Space Analyst.

3 Select the Tables Tab.

Space Analyst runs diagnostics against your database and graphically display counts of tables that are found to contain various types of space problems.

16 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

The graph at the top of the Tables Tab shows the overall count of problem tables, but you can also view the details for each type of problem by using the Details grid at the bottom of the tab.

For example, if Space Analyst identifies tables that have block inefficiencies, to find the actual tables and view details regarding the identified space problem, do the following in the Details grid:

1 In the Tablespace list, select All.

1 In the Table Owner list, select All.

2 In the Display list, select Tables with inefficient block usage.

3 Click Execute.

Space Analyst displays the actual tables that suffer from block inefficiencies along with their demographic details. To take corrective action on any object, select one or more tables and click the right mouse button to bring up a menu of possible actions.

Proceed to

Finding Space-related Index Problems with Space Analyst for Oracle

F

INDING

S

PACE

-

RELATED

I

NDEX

P

ROBLEMS WITH

S

PACE

A

NALYST FOR

O

RACLE

To quickly determine if any indexes in your database may be contributing to performance slowdowns by following these steps:

1 In DBArtisan connect to the database you would like to check.

2 Open Space Analyst.

3 Select the Indexes Tab.

The graph at the top of the Indexes Tab shows the overall counts of problem indexes, but you can also view the details for each type of problem by using the Details grid at the bottom of the tab. For example, if Space Analyst identifies indexes that have next extent problems, then to find the actual indexes and view details regarding the space problem, do the following in the

Details grid:

1 In the Tablespace list, select All.

2 In the Index Owner list, select All.

3 In the Display list, select Indexes with NEXT_EXTENT space deficits.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1621

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

4 Click Execute.

Space Analyst displays the actual indexes that suffer from next extent space problems along with their demographic details. If you wanted to take corrective action on any object, select one or more indexes and click the right mouse button to bring up a menu of possible actions.

NOTE:

Another critical statistic in determining index problems is deleted leaf rows. To display deleted leaf row statistics in the Details grid, do the following:

1 On the Command toolbar, select Get Deleted Leaf Row Statistics.

Proceed to

Session 5: Correcting Space-Related Problems Using Space Analyst for Oracle

S

ESSION

5: C

ORRECTING

S

PACE

-R

ELATED

P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

O

RACLE

After you have identified space-related bottlenecks in your database with Space Analyst, you can use a number of different tools and facilities within the product to eliminate each storage problems.

Proceed to

Correcting Storage Structure ‘out of space’ Problems for Space Analyst for Oracle

C

ORRECTING

S

TORAGE

S

TRUCTURE

OUT OF SPACE

’ P

ROBLEMS FOR

S

PACE

A

NALYST FOR

O

RACLE

Space Analyst can help you quickly remedy tablespaces that are running out of room by:

• Resizing an existing tablespace to have more room.

• Adding a new datafile to an existing tablespace.

• Setting the Autoextend attribute for one or more of a tablespace’s datafiles to allow for automatic growth.

To manage these functions, do the following:

1 Select the Database Overview Tab.

2 In the Tablespace Space Overview section, right-click the graph, and then select Toggle

Display.

3 Select the tablespace that is running low on free space.

4 Select the Open toolbar button or the Open shortcut menu option.

DBArtisan opens a Tablespace Editor.

In the Tablespace Editor, you can remedy the tablespace problem three ways:

16 22 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

• To resize an existing tablespace, open the tablespace’s datafile in the editor (using the Edit button) and change the datafile’s size to a new, larger size. Then close the editor and select the Alter toolbar button to make the change permanent to the database.

• To add a new datafile to the tablespace, select the Add button in the Datafile Tab of the tablespace editor, and specify the new datafile’s attributes. Once complete, close the Add

Datafile dialog and select the Alter toolbar button to make the change permanent to the database.

• To set Autoextend for one or more of a tablespace’s datafiles, open each datafile in the datafile editor by selecting the Edit button. Once in the Modify Datafile dialog, select the option for Auto Extend and specify other attributes as needed. When complete, close the dialog and select the Alter toolbar button to make the change permanent to the database.

Proceed to

Correcting Storage Structure Fragmentation Issues Using Space Analyst for Oracle

C

ORRECTING

S

TORAGE

S

TRUCTURE

F

RAGMENTATION

I

SSUES

U

SING

S

PACE

A

NALYST FOR

O

RACLE

Space Analyst can help you quickly fix tablespaces that are suffering from fragmentation by:

• Coalescing adjacent free space fragments (honeycombs) in a tablespace

• Reorganizing a tablespace to eliminate free space bubbles

• Converting a dictionary-managed tablespace to locally-managed

To coalesce free space fragments in a tablespace, follow these steps:

1 On the Database Overview Tab, select any tablespace that appears to be suffering from fragmentation problems.

2 Select the Open toolbar button or the Open shortcut menu option.

DBArtisan opens a Tablespaces Editor.

3 To view fragmentation details for the tablespace, click the Space Tab of the Tablespaces

Editor.

4 To combine adjacent free space pockets into singular free space chunks, click the Coalesce button.

NOTE:

The fragmentation score of the tablespace does not change after a coalesce operation, then the tablespace likely suffers from bubble fragmentation. This can be verified by viewing the tablespace map for the tablespace.

To reorganize any tablespace suffering from bubble fragmentation, do the following:

1 On the toolbar, click the Open Wizard button.

Space Analyst opens the Reorganization Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1623

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

2 Select the New Reorganization option, and then click Next to continue.

Space Analyst opens the next panel of the Reorganization Wizard.

3 Select Reorganize a Tablespace, and then click Next to continue.

Space Analyst opens the next panel of the Reorganization Wizard.

4 Select one or more tablespaces you would like to reorganize, and then click Next to continue.

Space Analyst opens the next panel of the Reorganization Wizard.

5 Select a scratch tablespace that temporarily holds the reorganized tablespace’s objects.

6 Select the option to perform a space analysis so you can be assured that the scratch tablespace has enough room to temporarily hold all of the reorganized tablespace’s objects.

7 If the selected scratch tablespace does not contain enough free space, select another tablespace to serve as the scratch tablespace.

8 Click Next to continue.

Space Analyst opens the next panel of the Reorganization Wizard.

9 You can choose to perform no customizations for the reorganization, or you can select various global or object-level options to customize your reorganization.

10 Click Finish.

Space Analyst builds a reorganization script to reorganize your selected tablespace. Note that while the script is being constructed, you can still perform other work in Space Analyst or DBArtisan. Just minimize the script build window and continue to do other work in

DBArtisan. You can check back whenever you’d like to see if the script is ready.

After the reorganization script is complete, you can choose to view/run the script in a DBArtisan

ISQL window, schedule the script for later execution, or immediately execute the reorganization.

If you would like to convert a dictionary-managed tablespace to locally-managed, you can do one of the following:

• Create a new locally-managed tablespace in DBArtisan and then use the Reorganization

Wizard to permanently relocate all objects from the dictionary-managed tablespace to the new locally-managed tablespace. This is the cleanest method for converting a dictionarymanaged tablespace to locally-managed.

• Choose the option in Space Analyst that allows a quick conversion of an existing dictionarymanaged tablespace to a locally-managed tablespace. This option is only available for

Oracle versions 8.1.6 or later. This option does not defragment an existing dictionarymanaged tablespace, but converts it so that all space management is conducted through the tablespace’s datafiles instead of the data dictionary and ensure that any new objects added to the tablespace conform to the tablespace’s storage attributes.

16 24 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y S T FO R O R A C L E T UT O RIA L > S PA C E A N A LY S T FO R ORA C L E T U TO RIA L

Proceed to

Correcting Space-Related Object Problems for Space Analyst for Oracle

C

ORRECTING

S

PACE

-R

ELATED

O

BJECT

P

ROBLEMS FOR

S

PACE

A

NALYST FOR

O

RACLE

Space Analyst can help you quickly fix objects that are experiencing space problems by:

• Modifying various storage-related properties for an object.

• Reorganizing the object to eliminate space inefficiencies.

Storage properties that are affecting the availability of an object (for example, the next extent or maximum extent values for a table or index) can easily be altered by using the integration that exists between Space Analyst and DBArtisan. For example, to modify a table’s next extent value, do the following:

1 On the Tablespace Map Tab or the Table Details grid on the Tables Tab, select a table you would like to alter.

2 Select the Open toolbar button or the Open shortcut menu option.

DBArtisan opens a Tablespaces Editor.

3 Select the Storage Tab.

4 Change the numeric value for the table’s next extent.

NOTE:

You can not change next extent values for tables that exist in locally-managed tablespaces.

5 On the toolbar, click the Alter button.

DBArtisan displays the DDL that change the table’s next extent value.

You can easily reorganize one or more objects with the Reorganization Wizard. To reorganize any table or index that in any grid, do the following:

1 Select the object(s).

2 On the toolbar, click the Reorganization Wizard button, or right-click and select Reorganize.

Space Analyst opens the Reorganization Wizard.

You can customize object reorganizations by using either the global or specific object customization options in the Reorganization Wizard. For example, you can perform online reorganizations of indexes or index-organized tables.

Space Analyst’s Reorganization Wizard can also intelligently identify objects that need to be reorganized. For example, to reorganize tables in your database that have chained/migrated rows, do the following:

1 On the toolbar, click the Reorg Wizard button.

Space Analyst opens the Reorganization Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1625

S PA C E A N A L YS T FO R ORA C L E T U TO RIA L > S P AC E A N A L Y ST F OR OR AC L E T U T ORI AL

2 Select the New Reorganization option, and then click Next to continue.

Space Analyst opens the next panel of the Reorganization Wizard.

3 Select Repair tables with chained/migrate rows, and then click Next to continue.

Space Analyst runs diagnostics against your database to find any table or table partition that suffers from chained rows. Space Analyst displays the objects under either the Tables or

Table Partition(s) node in the Reorg Wizard explorer tree. You can then select one or all table objects and continue with the reorganization process.

16 26 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

S

PACE

A

NALYST FOR

M

ICROSOFT

SQL S

ERVER

T

UTORIAL

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance inefficiencies that result from poor space management. Running inside the Embarcadero DBArtisan console, Space Analyst helps you identify and correct storage problems by supplying powerful analysis facilities and corrective utilities and that will satisfy advanced experts, yet are easy enough to use for database novices.

Space Analyst for Microsoft Product Benefits

Embarcadero Space Analyst allows the database administrator to quickly ascertain if space problems are threatening the availability or performance of their key databases. If storage problems are found, Space Analyst provides powerful but easy to use space management wizards and utilities that can accomplish simple or complex reorganizations of all or parts of a database.

About this Space Analyst for Microsoft Tutorial

This tutorial helps you get started with Embarcadero Space Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Space Analyst. You will have learned how to get a summary view of storage for your database as well as how to identify potential space-related threats. Finally, you’ll use the reorganization wizard to correct any space problems that you find.

This tutorial is divided into 5 sections.

Session 1: Getting Started with Space Analyst

Session 2: Obtaining a Global View of Storage

Session 3: Identifying Storage Structure Problems

Session 4: Pinpointing Object Performance Inefficiencies

Session 5: Correcting Space-Related Problems

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

For more information, see Additional Evaluation Resources .

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1627

SP A C E AN A L Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

S

ESSION

1: G

ETTING STARTED WITH

S

PACE

A

NALYST FOR

M

ICROSOFT

Download and Install

You can obtain the latest version of Space Analyst by downloading DBArtisan from the

Embarcadero Web site at http://www.embarcadero.com/downloads/downloaddbartisan.asp

.

Space Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Space Analyst.

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Space Analyst for Microsoft Overview

S

PACE

A

NALYST FOR

M

ICROSOFT

O

VERVIEW

Once you are connected to an Microsoft SQL Server database, you can open Space Analyst from within DBArtisan two ways:

1 On the Analyst menu, select Space Analyst.

NOTE:

You do not need to install anything for Space Analyst to work.

Proceed to Proceed to Session 2: Obtaining a Global View of Storage Using Space Analyst for

Microsoft

S

ESSION

2: O

BTAINING A

G

LOBAL

V

IEW OF

S

TORAGE

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

When first invoked, Space Analyst displays a complete overview of the storage situation of a particular SQL Server. The first tab of Space Analyst can be used to see all pertinent global statistics regarding storage structure usage throughout a server.

There are four distinct sections displayed on the first tab (labeled Storage Overview) of Space

Analyst:

Server Overview

Database Overview

Log Overview

Server Disk Overview

16 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

S

PACE

A

NALYST FOR

M

ICROSOFT

- S

ERVER

O

VERVIEW

The total count of all databases, file groups, and files are shown in this section. You can also see the percentage breakdown of the database vs. log space on the server. Positioning the mouse pointer over the graph causes it to display the actual percentage amounts for storage type.

TIP:

If you want to see a grid-style display of the information shown in most graphs, position your mouse over the graph, click the right mouse button and select the 'toggle display' option.

Proceed to

Space Analyst for Microsoft - Database Overview

S

PACE

A

NALYST FOR

M

ICROSOFT

- D

ATABASE

O

VERVIEW

Summary information regarding every database on the server is present in the database overview section. When invoked in graph form, this section shows how much total space is used by each database. When shown in grid form, this section shows not only the total space used for each database, but also includes the total allocated, free, and percent free amounts, along with an indicator that shows whether any of the database's underlying datafiles can automatically grow if necessary.

TIP:

To see a grid-style display of the information shown in the graph, position your mouse over the graph, click the right mouse button and select the ‘toggle display’ option. To return to the graph, just perform the same actions over the grid.

When this section is in grid form, you can also perform a number of actions on a database like open it in a DBArtisan editor, extract its DDL, shrink it, and more. For example, if you want to open a database in DBArtisan's database manager, do the following:

1 In the grid, select a database.

2 Right-click and select Open.

OR

3 Select a database and click the Open toolbar button.

DBArtisan opens the Database Manager.

Proceed to

Space Analyst for Microsoft - Log Overview

S

PACE

A

NALYST FOR

M

ICROSOFT

- L

OG

O

VERVIEW

The log overview provides a quick glance into database transaction log usage. When invoked in graph form, this section shows the percentage of used log space per database. When shown in grid form, this section shows not only the total percentage of transaction log space used for each database, but also includes the total allocated and free amounts (in MB), along with an indicator that shows whether any of the database's transaction logs underlying log files can automatically grow if necessary.

Proceed to

Space Analyst for Microsoft - Server Disk Overview

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1629

SP A C E AN A L Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

S

PACE

A

NALYST FOR

M

ICROSOFT

- S

ERVER

D

ISK

O

VERVIEW

The server disk overview provides a window into how much free space exists on the actual server machine. In graph form, this section shows the amount of free space (in MB) across each of the server's drives. When in grid form, it shows free space per drive, but also includes the amount of allocated SQL Server data and log space per drive.

Proceed to

Session 3: Identifying Storage Structure Problems in Space Analyst for Microsoft

S

ESSION

3: I

DENTIFYING

S

TORAGE

S

TRUCTURE

P

ROBLEMS IN

S

PACE

A

NALYST FOR

M

ICROSOFT

Space Analyst can help you quickly find storage structure problems that threaten the availability of your database.

Proceed to

Pinpointing ‘out of space’ Problems Using Space Analyst for Microsoft

P

INPOINTING

OUT OF SPACE

’ P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

To quickly tell if any of the tablespaces in your database are about to run out of free space, do the following:

1 Select the Storage Overview Tab.

2 In the Database Overview and Log Overview sections, position the pointer over the graph.

3 Right-click and select Toggle Display.

Examine the Percent DB Used columns of each database and transaction log along with the DB

Can Grow column. If a database or transaction log is nearing the end of free space and cannot automatically grow, then action should be taken to prevent an out-of-space error.

You can also obtain graphical views of databases and pertinent storage property information by viewing the Databases Tab of Space Analyst. You can visually get a handle on the amounts of table, index, and free space of your databases and quickly view critical storage property facts such as the number of databases that cannot automatically grow in size if needed.

All the graphs can be toggled to grids by using the right mouse menu option of Toggle Display.

When in grid mode, very detailed information is available concerning database and transaction log space. Note that the graph is scrollable so you may have to scroll to see all your databases.

You can perform a number of actions on a database, such as shrinking it or invoking databaserelated DBCC operations by using either the right mouse menu or the Command toolbar button

(the yellow arrow).

Proceed to

Viewing Filegroup and File Details Using Space Analyst for Microsoft

16 30 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

V

IEWING

F

ILEGROUP AND

F

ILE

D

ETAILS

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

You can also view space usage at the filegroup and file levels. To get summary and detailed information for filegroups and files, follow these steps:

1 Invoke Space Analyst and view the File Groups/Files Tab.

The default presentation is a graphical overview of filegroups. Note that the graph is scrollable so you may have to scroll to see all your filegroups.

2 To view detailed information for filegroups, right-click and select Toggle Display to view the grid.

3 To view file information instead of filegroup metrics, select Files.

When viewing filegroup and file information, you can perform a number of actions on selected filegroups and files such as extracting their DDL or shrinking the parent database or selected file. All options are available by using either the shortcut menu or Command menu.

Proceed to

Using Analysis Reports in Space Analyst for Microsoft

U

SING

A

NALYSIS

R

EPORTS IN

S

PACE

A

NALYST FOR

M

ICROSOFT

You can run HTML-formatted reports that pinpoint all major storage-related problems for a particular tablespace and the objects that are contained within it. To produce an Analysis Report, do the following:

1 On the toolbar, click Analysis Report.

Space Analyst opens the Analysis Report dialog box.

2 In Report File Name and Report Title you can change the location and report title of the report.

3 In Category, select the types of space problems you would like to investigate. The default option is All.

4 In Database, select the database you would like to analyze.

5 In File Group, select the filegroup level.

6 Click Execute.

Space Analyst creates a frame-based Analysis report for the database.

Proceed to

Session 4: Pinpointing Object Performance Inefficiencies Using Space Analyst for

Microsoft

S

ESSION

4: P

INPOINTING

O

BJECT

P

ERFORMANCE

I

NEFFICIENCIES

U

SING

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1631

SP A C E AN A L Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

S

PACE

A

NALYST FOR

M

ICROSOFT

Space Analyst can greatly accelerate the process of locating objects in your databases that are degrading overall response times because of their current inefficient storage usage.

Proceed to

Finding Space-related Table Problems with Space Analyst for Microsoft

F

INDING

S

PACE

-

RELATED

T

ABLE

P

ROBLEMS WITH

S

PACE

A

NALYST FOR

M

ICROSOFT

To quickly determine if any tables in your database may be contributing to performance slowdowns, do the following:

1 Open Space Analyst.

2 Select the Objects Tab.

3 In Object Details, select the target object.

By default, the General Space button is selected. This view will show you a graphical layout of table used and free space for the database. Note that the graph is scrollable so you can scroll to see all the tables for your database.

The Object details grid in the lower area of the tab can be used to view detailed storage information for every table in the selected database.

To troubleshoot table storage issues in your database, select the Space Diagnostics radio button. This option will interrogate your database and will provide you with a graphical count of the number of tables that are experiencing specific types of storage inefficiencies. Space Analyst uses predefined thresholds (which you can customize by selecting the Threshold Options toolbar button) to determine how many and what objects are suffering from storage inefficiencies.

The table below describes the types of table-related space problems shown in the bar graph found on the Objects Tab:

Problem

Scan Density

Logical Fragmentation

Extent Fragmentation

Description

This is computed by dividing the optimum number of extent switches by the actual number of extent switches. This percentage can be misleading, however, if the object spans more than one database file and should not be considered in such an event. Values close to 100% are best.

This metric represents the percentage of pages that are out of physical order. High values (greater than 25%) for this metric may mean that index scan performance is not what it could be.

Note that this statistic is meaningless for tables without clustered indexes (heap tables).

This highlights any gaps (lack of contiguous order) in extents and indicates the presence of external fragmentation.

Percentages of 25-50% or more are not a favorable reading.

16 32 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

Problem

Average Page Density

Forwarded Records

Description

This metric represents the fullness of the data or index pages, and is an indicator of internal fragmentation. Remember that the more full a data or index page is, the less I/O needed by

SQL Server when performing scans of tables or indexes. High values are good here, with anything below 50% being suspect.

Low values for this metric often indicate the presence of page splitting. Keep in mind, however, that internal fragmentation isn't necessarily bad in OLTP environments where large

FILLFACTORs are often specified. Also understand that small objects (those will little or no data) will likely show low readings because they simply don't consume enough space in a database page. You can ignore these objects.

SQL Server will move rows in a table under certain conditions.

One situation might arise when you update a row in a table that has a variable-length column to a larger size that will no longer fit on its original page. Another situation would be if

SQL Server moves a row when the clustered index column changes. Forwarded records can reduce performance at times because additional I/O is involved to first obtain the record pointer to the relocated row, and then the row itself. But when does row forwarding become a problem? For example, just because a table has one hundred forwarded rows, does that mean a performance problem exists? The answer is: it depends. If the table has one hundred rows in it, then yes, a problem exists - 100% of the table suffers from forwarded rows.

If the table has three million rows, then the forwarded row situation is likely not causing much fuss in the database.

The graph at the top of the Objects Tab shows the overall count of problem tables, but you can also view the details for each type of problem by using the Details grid at the bottom of the tab.

For example, if Space Analyst identifies tables that have forwarded records, then to find the actual tables and view details regarding the identified space problem, do the following:

1 In the File Group list, select All.

2 In the Owner list, select All.

3 In the Display list, select Tables with forwarded records problems.

4 Click Refresh.

You would then see the actual tables that suffer from forwarded records along with their demographic details. If you wanted to take corrective action on any object, you could highlight one or more tables and click the right mouse button to bring up a menu of possible actions.

Proceed to

Session 5: Correcting Space-related Problems Using Space Analyst for Microsoft

S

ESSION

5: C

ORRECTING

S

PACE

-

RELATED

P

ROBLEMS

U

SING

S

PACE

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1633

SP A C E AN A L Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

A

NALYST FOR

M

ICROSOFT

After you have identified space-related bottlenecks in your database with Space Analyst, you can use a number of different tools and facilities within the product to eliminate each storage problems.

Proceed to

Correcting Storage Structure ‘out of space’ Problems Using Space Analyst for

Microsoft

C

ORRECTING

S

TORAGE

S

TRUCTURE

OUT OF SPACE

’ P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

Space Analyst can help you quickly remedy databases and transaction logs that are running out of room by:

• Resizing an existing database or transaction log to have more room.

• Adding a new filegroup or file to an existing database or transaction log.

• Setting the Autogrowth attribute for one or more of a database's or transaction log's files to allow for automatic growth.

To manage these functions, do the following:

1 Select the Databases Tab.

2 In the Database Summary section, right-click the graph, and then select Toggle Display.

3 Select the database that is running low on free space.

4 Select the Open toolbar button or the Open shortcut menu option.

DBArtisan opens the Database Manager.

In the Database Manager, you can remedy the database problem in one of three ways:

• To resize an existing database or transaction log, open one of the database's or log's files in the editor (using the Edit button) and change the file's size to a new, larger size. Then close the editor and select the Alter toolbar button to make the change permanent to the database.

• To add a new file or file group to the database or transaction log (note: you can't add new filegroups to a transaction log, only files), select the Add button in the editor, and specify the new filegroup or file's attributes. Once complete, close the Add Datafile dialog and select the Alter toolbar button to make the change permanent to the database.

• To set Autogrowth for one or more of a database's or transaction log's files, open each file in the file editor by selecting the file and then pressing the Edit button. Once in the Modify File dialog, select the option for Allow Growth and specify other attributes as needed. When complete, close the dialog and select the Alter toolbar button to make the change permanent to the database.

Proceed to

Removing Wasted Space in Databases or Files Using Space Analyst for Microsoft

16 34 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N AL Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

R

EMOVING

W

ASTED

S

PACE IN

D

ATABASES OR

F

ILES

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

Space Analyst can help you quickly eliminate unused space in a database or database file. The unused space can be released back to the operating system for other use. To remove unused space from a database, do the following:

1 To shrink an entire database, right-click a database in any of Space Analyst's grids, and then select Shrink Database.

DBArtisan opens the Shrink File dialog box.

2 To shrink a specific file in a database, select the Filegroups/Files Tab and then view files by selecting the Files radio button.

3 Right-click a file and select Shrink File.

DBArtisan opens the Shrink File dialog box.

4 Select desired options.

5 Click Execute to make the change permanent.

Proceed to

Correcting Space-related Object Problems for Space Analyst for Microsoft

C

ORRECTING

S

PACE

-

RELATED

O

BJECT

P

ROBLEMS FOR

S

PACE

A

NALYST FOR

M

ICROSOFT

Once you identify specific objects that need storage corrections, you can use Space Analyst to help you quickly resolve your found issues. The Space Management wizard inside of Space

Analyst can be used to build reorganization and space maintenance jobs that run right the first time. All jobs can either be immediately run or scheduled for later execution.

To create a standard database or object reorganization job, do the following:

1 Click the Open Wizard button.

2 Select New Space Management Task.

3 Click Next.

4 Select Create standard reorganization job.

5 Click Next.

6 Select the databases and objects you would like to reorganize from the Explorer tree on the left hand side of the wizard. You can reorganize full databases, selected schema accounts, or selected objects.

7 Click Next.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1635

SP A C E AN A L Y ST FO R M I C ROS OF T SQ L S E R V E R TUT O RIA L > S PA C E A N A L YS T FO R M IC RO SO FT S QL

8 The next panel allows you to customize the reorganization. You can either set options at the global level (affects all objects) or specific object level. Using the options, you can relocate objects to different filegroups, perform online index rebuilds (for SQL Server 2000 or later), and specify other customizations.

9 Click Next.

10 The next panel builds your reorganization script and allows you to preview the operation.

Click Next when ready.

11 Click Next.

The final panel allows you to open the reorganization script in a SQL editor, immediately run it, or schedule it for later execution.

Proceed to

Proactive Space Management Using Space Analyst for Microsoft

P

ROACTIVE

S

PACE

M

ANAGEMENT

U

SING

S

PACE

A

NALYST FOR

M

ICROSOFT

If you have many databases to take care of, then you might want to relieve the burden of performing detailed storage analysis on every database, each of which may or may not require attention. Fortunately, Space Analyst makes it easy to create smart space management jobs that can automate this task for you.

You can create two specialized space management jobs that allow you to proactively eliminate space threats before they affect your database:

You can create a "reorganization analyst job" that allows you to specifically select various databases and/or objects and then set reorganization thresholds that determine when a reorganization will occur. Once constructed, you can schedule these jobs to run as often as you'd like. During execution, these jobs will interrogate your chosen database/objects and determine if a reorganization needs to occur by applying your customized reorganization thresholds. If any objects are found to need reorganization, they are dynamically reorganized using any customized options you specify.

You can build space maintenance jobs that will perform functions such as check the validity of your databases and filegroups, repair any found minor corruption, and eliminate unused space in your databases. You can also set the job up to notify you if any problems are found during job execution.

These "smart" space maintenance jobs allow you to truly "set and forget" the task of monitoring and reorganizing the space of your critical databases.

16 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N A L Y ST F OR SY B AS E AS E TU T ORI AL > S P AC E A N A L Y ST F OR SY B A S E A S E TU TO RIA L

S

PACE

A

NALYST FOR

S

YBASE

ASE T

UTORIAL

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance inefficiencies that result from poor space management. Running inside the Embarcadero DBArtisan console, Space Analyst helps you identify and correct storage problems by supplying powerful analysis facilities and corrective utilities and that will satisfy advanced experts, yet are easy enough to use for database novices.

Space Analyst for Sybase ASE Product Benefits

Embarcadero Space Analyst allows the database administrator to quickly ascertain if space problems are threatening the availability or performance of their key databases. If storage problems are found, Space Analyst provides powerful but easy to use space management wizards and utilities that can accomplish simple or complex reorganizations of all or parts of a database.

About this Space Analyst for Sybase ASE Tutorial

This tutorial helps you get started with Embarcadero Space Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Space Analyst. You will have learned how to get a summary view of storage for your database as well as how to identify potential space-related threats. Finally, you’ll use the reorganization wizard to correct any space problems that you find.

This tutorial is divided into 4 sections.

Session 1: Getting Started with Space Analyst

Session 2: Obtaining a Global View of Storage

Session 3: Identifying Storage Structure Problems

Session 4: Correcting Space-Related Problems

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

For more information, see Additional Evaluation Resources .

S

ESSION

1: G

ETTING

S

TARTED

W

ITH

S

PACE

A

NALYST FOR

S

YBASE

ASE

Download and Install

You can obtain the latest version of Space Analyst by downloading DBArtisan from the

Embarcadero Web site at http://www.embarcadero.com/downloads/downloaddbartisan.asp

.

Space Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Space Analyst.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1637

S PA C E A N A L YS T FO R SY B A SE A SE TUT O RIA L > SP A C E A N AL Y S T FO R S Y B A SE A SE TU T O RI A L

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Space Analyst for Sybase ASE Overview

S

PACE

A

NALYST FOR

S

YBASE

ASE O

VERVIEW

The graphic below illustrates all the main elements of the DBArtisan User Interface.

Once you are connected to an Sybase ASE database, you can open Space Analyst from within

DBArtisan two ways:

1 On the Analyst menu, select Space Analyst.

NOTE:

You do not need to install anything for Space Analyst to work.

Proceed to

Session 2: Obtaining a Global View of Storage Using Space Analyst for Sybase ASE

S

ESSION

2: O

BTAINING A

G

LOBAL

V

IEW OF

S

TORAGE

U

SING

S

PACE

A

NALYST FOR

S

YBASE

ASE

When first invoked, Space Analyst displays a complete overview of the storage situation of a particular server. The first tab of Space Analyst can be used to see all pertinent global statistics regarding storage structure usage throughout a server.

There are four distinct sections displayed on the Storage Overview Tab of Space Analyst:

Server Overview

Log Overview

Database Overview

Device Overview

S

PACE

A

NALYST FOR

S

YBASE

ASE - S

ERVER

O

VERVIEW

The total count of all databases, file groups, and files are shown in this section. You can also see the percentage breakdown of the database vs. log space on the server. Positioning the mouse pointer over the graph causes it to display the actual percentage amounts for storage type.

TIP:

If you want to see a grid-style display of the information shown in most graphs, position your mouse over the graph, click the right mouse button and select the 'toggle display' option.

Proceed to

Space Analyst for Sybase ASE - Log Overview

16 38 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N A L Y ST F OR SY B AS E AS E TU T ORI AL > S P AC E A N A L Y ST F OR SY B A S E A S E TU TO RIA L

S

PACE

A

NALYST FOR

S

YBASE

ASE - L

OG

O

VERVIEW

The log overview provides a quick glance into database transaction log usage. When invoked in graph form, this section shows the percentage of used log space per database. When shown in grid form, this section shows not only the total percentage of transaction log space used for each database, but also includes the total allocated and free amounts (in MB), along with an indicator that shows whether any of the database's transaction logs underlying log files can automatically grow if necessary.

Proceed to

Space Analyst for Sybase ASE - Database Overview

S

PACE

A

NALYST FOR

S

YBASE

ASE - D

ATABASE

O

VERVIEW

Summary information regarding every database on the server is present in the database overview section. When invoked in graph form, this section shows how much total space is used by each database. When shown in grid form, this section shows not only the total space used for each database, but also includes the total allocated, free, and percent free amounts, along with an indicator that shows whether any of the database's underlying datafiles can automatically grow if necessary.

TIP:

To see a grid-style display of the information shown in the graph, position your mouse over the graph, click the right mouse button and select the ‘toggle display’ option. To return to the graph, just perform the same actions over the grid.

When this section is in grid form, you can also perform a number of actions on a database like open it in a DBArtisan editor, extract its DDL, shrink it, and more. For example, if you want to open a database in DBArtisan's database manager, do the following:

1 Select a database, right-click, and select Open.

OR

Select a database and click the Open toolbar button.

DBArtisan opens the Database Manager.

Proceed to

Space Analyst for Sybase ASE - Device Overview

S

PACE

A

NALYST FOR

S

YBASE

ASE - D

EVICE

O

VERVIEW

The device overview section contains a graphical and grid control that works in the following way:

• When the graph is displayed, a bar chart is shown that lists the total space used (in MB) of all devices defined to the server.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1639

S PA C E A N A L YS T FO R SY B A SE A SE TUT O RIA L > SP A C E A N AL Y S T FO R S Y B A SE A SE TU T O RI A L

• When the grid is displayed, detailed storage information for each database device is presented:

• Device name

• Physical name

• Total space

• Used space

• Free space

• Percent free

• Percent used

Proceed to

Session 3: Identifying Storage Structure Problems in Space Analyst for Sybase ASE

S

ESSION

3: I

DENTIFYING

S

TORAGE

S

TRUCTURE

P

ROBLEMS IN

S

PACE

A

NALYST FOR

S

YBASE

ASE

Space Analyst can help you quickly find storage structure problems that threaten the availability of your database.

Proceed to

Pinpointing ‘out of space’ Problems Using Space Analyst for Sybase ASE

P

INPOINTING

OUT OF SPACE

’ P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

S

YBASE

ASE

To quickly tell if any of the tablespaces in your database are about to run out of free space, do the following:

1 Select the Storage Overview Tab.

2 In the Database Overview and Log Overview sections, position the pointer over the graph.

3 Right-click and select Toggle Display.

Examine the Database Percent Free columns of each database and Log Percent Free for each transaction log. If a database or transaction log is nearing the end of free space and cannot automatically grow, then action should be taken to prevent an out-of-space error.

You can also obtain graphical views of databases and pertinent storage property information by viewing the Databases Tab of Space Analyst. You can visually get a handle on the amounts of table, index, and free space of your databases and quickly view critical storage property facts such as the number of databases that cannot automatically grow in size if needed.

All the graphs can be toggled to grids by using the right mouse menu option of 'Toggle

Display'. When in grid mode, very detailed information is available concerning database and transaction log space. Note that the graph is scrollable so you may have to scroll to see all your databases.

Proceed to

Using Analysis Reports in Space Analyst for Sybase ASE

16 40 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N A L Y ST F OR SY B AS E AS E TU T ORI AL > S P AC E A N A L Y ST F OR SY B A S E A S E TU TO RIA L

U

SING

A

NALYSIS

R

EPORTS IN

S

PACE

A

NALYST FOR

S

YBASE

ASE

You can run HTML-formatted reports that pinpoint all major storage-related problems for a particular tablespace and the objects that are contained within it. To produce an Analysis Report, do the following:

1 On the toolbar, click Analysis Report.

Space Analyst opens the Analysis Report dialog box.

2 In Report File Name and Report Title you can change the location and report title of the report.

3 In Category, select the types of space problems you would like to investigate. The default option is All.

4 In Database, select the database you would like to analyze.

5 In File Group, select the filegroup level.

6 Click Execute.

Space Analyst creates a frame-based Analysis report for the database.

Proceed to

Session 4: Correcting Space-related Problems Using Space Analyst for Sybase ASE

S

ESSION

4: C

ORRECTING

S

PACE

-

RELATED

P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

S

YBASE

ASE

After you have identified space-related bottlenecks in your database with Space Analyst, you can use a number of different tools and facilities within the product to eliminate each storage problems.

Proceed to

Correcting Storage Structure ‘out of space’ Problems Using Space Analyst for Sybase

ASE

C

ORRECTING

S

TORAGE

S

TRUCTURE

OUT OF SPACE

’ P

ROBLEMS

U

SING

S

PACE

A

NALYST FOR

S

YBASE

ASE

Space Analyst can help you quickly remedy databases and transaction logs that are running out of room by:

• Resizing an existing database or transaction log to have more room.

• Adding a new filegroup or file to an existing database or transaction log.

• Setting the Autogrowth attribute for one or more of a database's or transaction log's files to allow for automatic growth.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1641

S PA C E A N A L YS T FO R SY B A SE A SE TUT O RIA L > SP A C E A N AL Y S T FO R S Y B A SE A SE TU T O RI A L

To manage these functions, do the following:

1 Select the Storage Overview Tab.

2 In the Database Overview or Log Overview section, right-click the graph, and then select

Toggle Display.

3 Select the database that is running low on free space.

4 Select the Open toolbar button or the Open shortcut menu option.

DBArtisan opens the Database Manager.

In the Database Manager, you can remedy the database problem in one of three ways:

• To resize an existing database or transaction log, open one of the database's or log's files in the editor (using the Edit button) and change the file's size to a new, larger size. Then close the editor and select the Alter toolbar button to make the change permanent to the database.

• To add a new file or file group to the database or transaction log (note: you can't add new filegroups to a transaction log, only files), select the Add button in the editor, and specify the new filegroup or file's attributes. Once complete, close the Add Datafile dialog and select the Alter toolbar button to make the change permanent to the database.

• To set Autogrowth for one or more of a database's or transaction log's files, open each file in the file editor by selecting the file and then pressing the Edit button. Once in the Modify File dialog, select the option for Allow Growth and specify other attributes as needed. When complete, close the dialog and select the Alter toolbar button to make the change permanent to the database.

Proceed to

Correcting Space-related Object Problems for Space Analyst for Sybase ASE

C

ORRECTING

S

PACE

-

RELATED

O

BJECT

P

ROBLEMS FOR

S

PACE

A

NALYST FOR

S

YBASE

ASE

Once you identify specific objects that need storage corrections, you can use Space Analyst to help you quickly resolve your found issues. The Space Management wizard inside of Space

Analyst can be used to build reorganization and space maintenance jobs that run right the first time. All jobs can either be immediately run or scheduled for later execution.

To create a standard database or object reorganization job, do the following:

1 Click the Open Wizard button.

2 Select New Space Management Task.

3 Click Next.

4 Select Create standard reorganization job.

5 Click Next.

16 42 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SP A C E A N A L Y ST F OR SY B AS E AS E TU T ORI AL > S P AC E A N A L Y ST F OR SY B A S E A S E TU TO RIA L

6 Select the databases and objects you would like to reorganize from the Explorer tree on the left hand side of the wizard. You can reorganize full databases, selected schema accounts, or selected objects.

7 Click Next.

8 The next panel allows you to customize the reorganization. You can either set options at the global level (affects all objects) or specific object level.

9 Click Next.

10 The next panel builds your reorganization script and allows you to preview the operation.

Click Next when ready.

11 Click Next.

The final panel allows you to open the reorganization script in a SQL editor, immediately run it, or schedule it for later execution.

Proceed to

Proactive Space Management Using Space Analyst for Sybase ASE

P

ROACTIVE

S

PACE

M

ANAGEMENT

U

SING

S

PACE

A

NALYST FOR

S

YBASE

ASE

If you have many databases to take care of, then you might want to relieve the burden of performing detailed storage analysis on every database, each of which may or may not require attention. Fortunately, Space Analyst makes it easy to create smart space management jobs that can automate this task for you.

You can create two specialized space management jobs that allow you to proactively eliminate space threats before they affect your database:

You can create a "reorganization analyst job" that allows you to specifically select various databases and/or objects and then set reorganization thresholds that determine when a reorganization will occur. Once constructed, you can schedule these jobs to run as often as you'd like. During execution, these jobs will interrogate your chosen database/objects and determine if a reorganization needs to occur by applying your customized reorganization thresholds. If any objects are found to need reorganization, they are dynamically reorganized using any customized options you specify.

You can build space maintenance jobs that will perform functions such as check the validity of your databases and filegroups, repair any found minor corruption, and eliminate unused space in your databases. You can also set the job up to notify you if any problems are found during job execution.

These "smart" space maintenance jobs allow you to truly "set and forget" the task of monitoring and reorganizing the space of your critical databases.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1643

S PA C E A N A L YS T FO R SY B A SE A SE TUT O RIA L > SP A C E A N AL Y S T FO R S Y B A SE A SE TU T O RI A L

16 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S PA C E A N A L YS T FO R IB M D B 2 FO R L IN U X , U N IX , A N D W IN D O W S TU T O RI A L > SP A C E A N AL Y S T FO R I B M

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

T

UTORIAL

Embarcadero Space Analyst provides sophisticated diagnostic capabilities to troubleshoot bottlenecks and performance inefficiencies that result from poor space management. Running inside the Embarcadero DBArtisan console, Space Analyst helps you identify and correct storage problems by supplying powerful analysis facilities and corrective utilities and that will satisfy advanced experts, yet are easy enough to use for database novices.

Space Analyst for IBM DB2 for Linux, Unix, and Windows Product Benefits

Embarcadero Space Analyst allows the database administrator to quickly ascertain if space problems are threatening the availability or performance of their key databases. If storage problems are found, Space Analyst provides powerful but easy to use space management wizards and utilities that can accomplish simple or complex reorganizations of all or parts of a database.

About this Space Analyst for IBM DB2 for Linux, Unix, and Windows Tutorial

This tutorial helps you get started with Embarcadero Space Analyst.

After completion of this tutorial, you will have the foundation you need to explore the many features and benefits of Space Analyst. You will have learned how to get a summary view of storage for your database as well as how to identify potential space-related threats. Finally, you’ll use the reorganization wizard to correct any space problems that you find.

This tutorial is divided into 5 sections.

Session 1: Getting Started with Space Analyst

Session 2: Obtaining a Global View of Storage

Session 3: Identifying Storage Structure Problems

Session 4: Pinpointing SQL server Performance Inefficiencies

Session 5: Correcting Space-related Problems

You can use this basic tutorial as a roadmap of product highlights.

After starting this tutorial, you can select Help from the menu to find many additional resources that complement and build on many of the activities shown in this brief tutorial.

For more information, see Additional Evaluation Resources .

S

ESSION

1: G

ETTING

S

TARTED WITH

S

PACE

A

NALYST FOR

IBM DB2

FOR

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1645

S PA C E A N A L YS T FO R IBM D B 2 FO R L IN U X , U N IX, A N D W IN D O W S TU T ORI A L > SP A C E AN A L Y ST FO R I B M

L

INUX

, U

NIX

,

AND

W

INDOWS

Download and Install

You can obtain the latest version of Space Analyst by downloading DBArtisan from the

Embarcadero Web site at http://www.embarcadero.com/downloads/downloaddbartisan.asp

.

Space Analyst runs fully contained within DBArtisan so you will need the DBArtisan product to use Space Analyst.

Click Download, and follow the steps indicated. Save the file on your computer and then double-click to launch the self-extracting file that will guide you through the installation process.

When you first install an evaluation copy of DBArtisan, you can use the tool for 14 days. After that time, a permanent license is needed.

Proceed to

Space Analyst for IBM DB2 for Linux, Unix, and Windows Overview

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

O

VERVIEW

Once you are connected to an IBM DB2 for Linux, Unix, and Windows database, you can open

Space Analyst from within DBArtisan two ways:

1 On the Analyst menu, select Space Analyst.

NOTE:

You do not need to install anything for Space Analyst to work.

Proceed to

Session 2: Obtaining a Global View of Storage Using Space Analyst for IBM DB2 for

Linux, Unix, and Windows

S

ESSION

2: O

BTAINING A

G

LOBAL

V

IEW OF

S

TORAGE

U

SING

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

When it opens, Space Analyst shows a complete overview of the storage situation of a particular database or database server. The first tab of Space Analyst displays all pertinent global statistics regarding storage structure usage throughout a database.

There are four distinct sections displayed on the first Storage Overview Tab of Space Analyst:

• Storage Overview

• Tablespace Space Overview

• Log Overview

• Tablespace Objects Overview

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

- S

TORAGE

16 46 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S PA C E A N A L YS T FO R IB M D B 2 FO R L IN U X , U N IX , A N D W IN D O W S TU T O RI A L > SP A C E A N AL Y S T FO R I B M

O

VERVIEW

The breakdown of space usage of the allocated tablespace space, by index, table and temp data is shown in this section. You can also see the total number of tablespaces and the number

SMS and DMS spaces here.

NOTE:

Make sure your database object statistics are up to date. Space analyst uses these statistics in the various graphs and grids.

Proceed to

Space Analyst for IBM DB2 for Linux, Unix, and Windows -Tablespace Space

Overview

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

-T

ABLESPACE

S

PACE

O

VERVIEW

The Tablespace Space Overview section displays summary information regarding every tablespace on the database. When invoked in graph form, this section shows how much total space is allocated to each tablespace. When shown in grid form, this section shows not only the total allocated for each tablespace, but also includes information such as used space, free space, state, number of containers etc.

TIP:

To see a grid-style display of the information shown in the graph, position your mouse over the graph, click the right mouse button and select the ‘toggle display’ option. To return to the graph, just perform the same actions over the grid.

When this section is in grid form, you can also perform a number of actions on a tablespace like open it in a DBArtisan editor, extract its DDL, update its object statistics and more. For example, if you want to update the statistics on all tables in a tablespace, you would perform the following:

1 Select a tablespace in a grid.

2 Right-click the tablespace, and select Update Statistics.

OR

3 On the Space Analyst toolbar click the Update Statistics.

Proceed to

Space Analyst for IBM DB2 for Linux, Unix, and Windows - Log Overview

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

- L

OG

O

VERVIEW

The log overview provides a quick glance into database transaction log usage. This section shows the percentage of used and free log space for the database, the various database configuration parameters associated with the log space and the high watermarks for the log space usage.

Proceed to

Space Analyst for IBM DB2 for Linux, Unix, and Windows -Tablespace Objects

Overview

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1647

S PA C E A N A L YS T FO R IBM D B 2 FO R L IN U X , U N IX, A N D W IN D O W S TU T ORI A L > SP A C E AN A L Y ST FO R I B M

S

PACE

A

NALYST FOR

IBM DB2

FOR

L

INUX

, U

NIX

,

AND

W

INDOWS

-T

ABLESPACE

O

BJECTS

O

VERVIEW

The tablespace objects overview section provides an overview of how much space is used by the tables and indexes on each tablespace.

Proceed to

Session 3: Identifying Storage Structure Problems

S

ESSION

3: I

DENTIFYING

S

TORAGE

S

TRUCTURE

P

ROBLEMS

Space Analyst can help you quickly find storage structure problems that threaten the availability of your databases.

Proceed to

Pinpointing 'out of space' Problems

P

INPOINTING

'

OUT OF SPACE

' P

ROBLEMS

You can quickly tell if your transaction logs are about to run out of free space by following these steps:

1 Open Space Analyst.

2 View the Database and Log Overview sections on the Storage Overview Tab.

3 Examine the free and used space metrics in the pie chart. If the transaction log is nearing the end of free space, then action should be taken to prevent a log full error.

You can also obtain graphical views of tablespaces and pertinent storage property information by viewing the Tablespaces tab of Space Analyst. You can visually get a handle on the amount of used and free space of your tablespaces and quickly view critical storage property facts such as the number of containers for each tablespace, the space allocated for each container, the usage of tablespace space on each partition in a multi-partition database.

All the graphs can be toggled to grids by using the right mouse menu option of 'Toggle

Display'. When in grid mode, very detailed information is available concerning the selected tablespace.

NOTE:

You can perform further corrective actions on a tablespace, by opening it in the tablespace editor by using either the right mouse menu or the Command toolbar button (the yellow arrow).

Proceed to

Using Analysis Reports

16 48 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S PA C E A N A L YS T FO R IB M D B 2 FO R L IN U X , U N IX , A N D W IN D O W S TU T O RI A L > SP A C E A N AL Y S T FO R I B M

U

SING

A

NALYSIS

R

EPORTS

You can run HTML-formatted reports that pinpoint all major storage-related problems for a particular database and the objects that are contained within it. To produce an Analysis Report, follow these steps:

1 On the Space Analyst toolbar, select Analysis Report.

2 If you want to change the location and report title of the report, edit the predefined entries for the Report File Name and Report Title.

3 Select the types of space problems you would like identified on the report by using the

Category list.

4 Click Execute.

Space Analyst creates a frame-based Analysis report for the database you indicated.

Proceed to

Session 4: Pinpointing SQL server Performance Inefficiencies

S

ESSION

4: P

INPOINTING

SQL

SERVER

P

ERFORMANCE

I

NEFFICIENCIES

Space Analyst can greatly accelerate the process of locating objects in your database that are degrading overall response times because of their current inefficient storage usage.

Proceed to

Finding Space-related Table Problems

F

INDING

S

PACE

-

RELATED

T

ABLE

P

ROBLEMS

You can quickly tell if any tables in a tablespace that may be contributing to performance slowdowns by following these steps:

1 Open the Space Analyst and select the Tables Tab.

2 Select the tablespace you would like to interrogate in the Tablespace list.

3 Click the Refresh button.

You with see a graphical count of the number of tables that are experiencing specific types of storage inefficiencies in the upper area of the tab. The table reorganization candidate details grid in the lower area of the tab can be used to view detailed storage information for every table in the selected tablespace. Space Analyst uses predefined thresholds (which you can customize by selecting the Threshold Options toolbar button) to determine how many and what tables are suffering from storage inefficiencies.

The types of table-related space problems shown in the bar graph found on the objects tab include:

• Overflow Problems -Overflows occur in tables when overflows occur when rows are updated with more bytes than the original row (VARCHAR fields etc.). Overflows also occurs when the new columns are added to existing tables. Since the overflow data will not be stored contiguously with the other data, it causes access inefficiencies.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1649

S PA C E A N A L YS T FO R IBM D B 2 FO R L IN U X , U N IX, A N D W IN D O W S TU T ORI A L > SP A C E AN A L Y ST FO R I B M

• Space Utilization Problems - Normally, DB2 reclaims any space freed up by deletes, in subsequent insert/update operations. However, if a DB2 table has the 'APPEND' mode set to on and a large amount of data is deleted from the table DB2 will not reclaim freed space.

Also when some types of large load operations are performed, the table may be left with a large amount of unused space.

• Page Utilization Problems - As the number of empty pages increases, the need for table reorganization also increases. Empty pages waste space and reduce the table scan efficiency, since empty pages are read into the buffer pool for a table scan wasting bufferpool memory.

• Index Contention - Unless the user explicitly separates the index and table tablespaces, DB2 tables and indexes are placed on the same tablespace. This can become a bottleneck with heavily accessed tables using index scans since data and index accesses will compete for the

IO device resources.

The graph at the top of the Tables tab shows the overall count of problem tables, but you can also view the details for each type of problem by using the Details grid at the bottom of the tab.

For example, if Space Analyst identifies tables that have overflow records, then to find the actual tables and view details regarding the identified space problem, you would perform the following:

1 Select All from the Tablespace list in the Details grid.

2 Select All from the Table Schema list in the Details grid.

3 Select Tables with Overflow Problems from the Display list in the Details grid.

4 Click Refresh.

You would then see the actual tables that suffer from overflowed records along with their demographic details. If you wanted to take corrective action on any object, you could highlight one or more tables and click the right mouse button to bring up a menu of possible actions.

Proceed to

Finding Space-related Index Problems

F

INDING

S

PACE

-

RELATED

I

NDEX

P

ROBLEMS

You can quickly tell if any indexes in your database may be contributing to performance slowdowns by following the exact same steps as outline above for tables with one exception:

You want to select the Indexes tab instead of the Tables tab. The overview graph and index details sections of the Indexes tab work in the exact same manner for indexes as they do for tables.

Proceed to

Session 5: Correcting Space-related Problems

16 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S PA C E A N A L YS T FO R IB M D B 2 FO R L IN U X , U N IX , A N D W IN D O W S TU T O RI A L > SP A C E A N AL Y S T FO R I B M

S

ESSION

5: C

ORRECTING

S

PACE

-

RELATED

P

ROBLEMS

Once you have identified space-related bottlenecks in your database with Space Analyst, you can use a number of different tools and facilities within the product to eliminate each storage headache.

Proceed to

Correcting Tablespace 'out of space' Problems

C

ORRECTING

T

ABLESPACE

'

OUT OF SPACE

' P

ROBLEMS

Space Analyst can help you quickly remedy tablespaces that are running out of room by:

• Resizing existing tablespace containers to have more room.

• Adding new containers file to an existing tablespace.

• Moving Objects from a near full tablespace to less utilized tablespace

Resizing and adding of tablespace containers can be managed by performing the following steps:

1 Open Space Analyst and select the Database Overview Tab.

2 Select the graph in Tablespace Overview section and change to the grid display by selecting the right mouse menu option toggle display.

3 Select the DMS tablespace that is running low on free space and either select the Open toolbar option or the Open right mouse menu option.

This opens the Tablespace in DBArtisan's tablespace editor. Once you are in the editor, you can remedy the tablespace problem in one of two ways:

• To resize an existing container, select the container from the grid and click the Edit button and extend/ resize the container to a new, larger size. Then close the editor and select the

Alter toolbar button to make the change permanent to the tablespace.

• To add a new container to the tablespace, select the Add button in the editor, and specify the new container attributes. Once complete, close the Add Container dialog and select the

Alter toolbar button to make the change permanent to the database.

Proceed to

Correcting Space-related Object Problems

C

ORRECTING

S

PACE

-

RELATED

O

BJECT

P

ROBLEMS

Once you identify specific objects that need storage corrections, you can use Space Analyst to help you quickly resolve your found issues. The Space Management wizard inside of Space

Analyst can be used to build reorganization and space maintenance jobs that run right the first time. All jobs can either be immediately run or scheduled for later execution.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1651

S PA C E A N A L YS T FO R IBM D B 2 FO R L IN U X , U N IX, A N D W IN D O W S TU T ORI A L > SP A C E AN A L Y ST FO R I B M

To create a standard database or object reorganization job, follow these steps:

1 On the toolbar, click the Space Management.

2 Select New Space Management Task.

3 Click Next.

4 Select Create standard reorganization job.

5 Click Next.

6 Select the objects you would like to reorganize from the Explorer tree on the left hand side of the wizard. Note that you can reorganize full tablespaces, selected schemas or selected tables.

7 Click Next.

8 The next few panels let you customize the reorganization. You can choose to either set options at the global level (affects all objects) or specific object level. Using the options, you can reorganize tables and indexes, perform LOB and Long data reorganizations and specify other customizations.

9 The second to last panel builds your reorganization script and allows you to preview the operation.

10 Click Next.

11 The final panel allows you to execute the reorganization script immediately, or schedule it for later execution.

Proceed to

Proactive Space Management

P

ROACTIVE

S

PACE

M

ANAGEMENT

If you have many tablespace/schemas to take care of, then you might want to relieve the burden of performing detailed storage analysis on every tablespace or schema, each of which may or may not require attention. Fortunately, Space Analyst makes it easy to create smart space management jobs that can automate this task for you.

You can create a "reorganization analyst job" that allows you to specifically select various tablespaces/ schemas or objects and then set reorganization thresholds that determine when reorganization will occur. Once constructed, you can schedule these jobs to run as often as you'd like. During execution, these jobs will interrogate your chosen database/objects and determine if a reorganization needs to occur by applying your customized reorganization thresholds. If any objects are found to need reorganization, they are dynamically reorganized using any customized options you specify. Optionally, this job can also automatically update the statistics for the selected objects before and after reorganization and rebind any packages that depend on the reorganized objects.

These "autonomic" space maintenance jobs allow you to truly "set and forget" the task of monitoring and reorganizing the space of your critical databases.

16 52 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P AC E A N A L Y ST E X P E R T G UI D E > S PA C E A N A L YS T E X PE R T G U I D E

S

PACE

A

NALYST

E

XPERT

G

UIDE

IBM DB2 fragmentation can be broken down into two basic types:

• External Fragmentation - this situation exists when indexes have a logical order, based on their key value, which does not match the actual physical order inside the database file that houses the index. When an ordered scan is performed on an index, I/O performance is enhanced when the physical order of the database pages matches the logical order of the index. This is because the disk head can scan in one direction instead of moving back and forth to obtain the needed information.

• Internal Fragmentation - this situation exists when tables and indexes aren't utilizing space as efficiently as they should. The amount of wasted space in the database pages artificially inflates the size of the table or index and causes more I/O to be performed than would otherwise be needed if the object were compacted.

Keep in mind that fragmentation is not a performance factor at all once data reaches the IBM

DB2 memory caches.

Related Topics

Environments That Benefit From Fragmentation Elimination

Diagnosing Fragmentation

"I've Reorganized, But It Didn't Help!"

Forwarded Rows

E

NVIRONMENTS

T

HAT

B

ENEFIT

F

ROM

F

RAGMENTATION

E

LIMINATION

One important point must be understood regarding fragmentation: not every situation benefits from fragmentation removal. Before you invest a lot of time and effort into diagnosing and attempting the removal of fragmentation, you first need to see if jumping through hoops will actually improve your database's availability and performance.

At the highest level, the environments that benefit the most from fragmentation removal are read-intensive databases where large indexes are being frequently scanned. There are a couple of reasons why this is the case.

In most OLTP environments, data retrieval tends to be mostly selective, which negates most of the bad effects of external fragmentation. OLTP environments also often benefit from internal fragmentation because it's smart to leave room on index pages that are being added to and updated frequently. Free index page space helps avoid the dreaded page split where a page is divided in two due to the fact that incoming clustered index data can't logically fit on a needed page, so IBM DB2 makes room by creating two index pages out of one. Administrators oftentimes specify a low FILLFACTOR for their indexes to create internal fragmentation and hopefully avoid page splits.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1653

S P A C E AN A L Y S T E X P E R T G U ID E > S P A C E AN A L Y S T E X P E R T G U ID E

Data warehousing or databases with many resource-intensive/scanning queries are another matter. These environments will likely benefit from fragmentation removal. One reason is that the indexes tend to be larger, and therefore are not cached by IBM DB2 as easily as small indexes. Remember that fragmentation has no effect on performance once the data is nestled safely in IBM DB2's memory caches.

Another reason why these environments benefit from fragmentation removal is the effect fragmentation has on IBM DB2's read ahead manager. The read ahead manager helps queries that perform large scans by scanning index pages (and data pages) that it believes will be read and placing them into memory before they are actually needed. Naturally, this process can reduce overall scan times because data read in memory is many times faster than when that same data must be retrieved from disk. However, fragmentation affects how well the read ahead manager works. The read ahead manager will dynamically adjust the size of I/O it performs based on the actual physical order of the data and index pages on the server. When little external fragmentation is present, the read ahead manager can work very efficiently because it can read larger blocks at a time, whereas excessive fragmentation causes the read ahead manager to read smaller blocks of data. The end result when fragmentation is present is less overall throughput.

SQL execution patterns are something else to examine. Queries that perform large index scans are the ones that should see performance improvements when fragmentation is removed in a database. In DBArtisan, you can visually set I/O statistics on in the ISQL facility and examine queries to determine the amount of physical and logical read activity. Queries that show physical and read ahead I/O may see their response times drop when fragmentation has been removed.

D

IAGNOSING

F

RAGMENTATION

If you have an environment that will benefit from reducing fragmentation, how do you go about recognizing it? There are a number of metrics and factors to consider before you can intelligently start creating reorganization plans.

When diagnosing fragmentation, pay particular attention to the following metrics:

• Extent Fragmentation - this highlights any gaps (lack of contiguous order) in extents and indicates the presence of external fragmentation. Percentages of 25-50% or more are not a favorable reading.

• Logical Fragmentation - this metric represents the percentage of pages that are out of physical order. High values (greater than 25%) for this metric may mean that index scan performance is not what it could be. Note that this statistic is meaningless for tables without clustered indexes (heap tables).

16 54 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

S P AC E A N A L Y ST E X P E R T G UI D E > S PA C E A N A L YS T E X PE R T G U I D E

• Average Page Density - this metric represents the fullness of the data or index pages, and is an indicator of internal fragmentation. Remember that the more full a data or index page is, the less I/O needed by IBM DB2 when performing scans of tables or indexes. High values are good here, with anything below 50% being suspect. Low values for this metric often indicate the presence of page splitting. Keep in mind, however, that internal fragmentation isn't necessarily bad in OLTP environments where large FILLFACTORs are often specified.

Also understand that small objects (those will little or no data) will likely show low readings because they simply don't consume enough space in a database page. You can ignore these objects.

• Extent Switches - in a perfect world, this will equal # of object extents - 1. Higher values

(values many times higher than an object's extent count) can indicate external fragmentation.

• Scan Density - this is computed by dividing the optimum number of extent switches by the actual number of extent switches. This percentage can be misleading, however, if the object spans more than one database file and should not be considered in such an event. Values close to 100% are best.

As you can see, you can't just blindly diagnose fragmentation in IBM DB2, but instead have to evaluate a number of factors.

"I'

VE

R

EORGANIZED

, B

UT

I

T

D

IDN

'

T

H

ELP

!"

Sometimes, a DBA will reorganize a table or index and no measurable benefits are noticed afterwards. The same or worse fragmentation metrics are observed for the objects in question.

What could have gone wrong?

When attempting the reorganization of either tables or indexes, you have to understand that only objects that are of a significant size will show improvement from a reorganization. IBM DB2 for Linux, Unix, and Windows has stated that objects with less than 1,000 pages will oftentimes offer no performance improvements whatsoever from being reorganized.

Other points to keep in mind include:

• Tables without indexes receive zero benefit (naturally) from running either a DBCC

DBREINDEX or a DBCC INDEXDEFRAG. The only way to reorganize a table without indexes is to create a clustered index on the table and then immediately drop it.

• Heap tables should not be diagnosed as having fragmentation through the logical scan fragmentation measure. This metric is meaningless for such tables.

• As mentioned above, small objects seldom benefit from reorganizations. For example, the page density for a table with only 10 rows in it will likely not be high, and reorganizing it won't change things one bit. You need to keep such things in mind when determining whether to reorganize an object or not. Space Analyst keeps you informed of not only reorganization metrics but object metrics (extent size, row counts, etc.) as well so you can make smart reorganization choices.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1655

S P A C E AN A L Y S T E X P E R T G U ID E > S P A C E AN A L Y S T E X P E R T G U ID E

• Lack of contiguous free space can result in all fragmentation not being eliminated. Without large amounts of contiguous free space, reorganization operations may have to reuse other areas of space within the database files. The end result is oftentimes an index being reorganized, but still having an amount of logical scan fragmentation.

F

ORWARDED

R

OWS

IBM DB2 will move rows in a table under certain conditions. One situation might arise when you update a row in a table that has a variable-length column to a larger size that will no longer fit on its original page. Another situation would be if IBM DB2 moves a row when the clustered index column changes. When IBM DB2 creates a forwarding pointer, the pointer remains in place unless one of two things happens. The first is when a row shrinks enough to move back to its original location. The second is when the entire database shrinks. When a database file shrinks,

IBM DB2 will reassign the row identifiers, which are used as the row locators, so the shrink process never generates forwarded rows.

Forwarded records can reduce performance at times because additional I/O is involved to first obtain the record pointer to the relocated row, and then the row itself. But when does row forwarding become a problem? For example, just because a table has one hundred forwarded rows, does that mean a performance problem exists? The answer is: it depends. If the table has one hundred rows in it, then yes, a problem exists - 100% of the table suffers from forwarded rows. If the table has three million rows, then the forwarded row situation is likely not causing much fuss in the database.

16 56 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B

ACKUP

A

NALYST

Welcome to the Embarcadero Backup Analyst. Backup Analyst increases the efficiency of performing and managing database backups. Backup Analyst can significantly improve operational efficiency and produce significant savings for your organization. A key capability of

Backup Analyst for SQL Server is its ability to compress database backup images significantly.

Because it can compress backup images by up to 90 percent or more, it will reduce your storage costs. The

Backup Analyst Backup Wizard

and

Backup Analyst Recovery Wizard

make backing up and recovering SQL Server databases straightforward and easy.

NOTE:

Backup Analyst does not have to be run from within DBArtisan. It is fully supported via scripting and command line functions so you can use the

Backup Operations and

Restore Operations

anywhere.

The table below describes the major sections of Help for the Backup Analyst.

Section

Welcome to Backup Analyst

Backup Analyst Application Basics

Using Backup Analyst for Microsoft SQL Server

Backup Analyst Command Line Reference

Description

Provides information about installing, opening, and licensing

Backup Analyst.

Provides conceptual information about Backup Analyst’s product design and navigation.

Shows how to use each component of the application. Using

Backup Analyst breaks each process and procedure into simple step-by-step instructions.

Describes the wide range of operations that Backup Analyst supports for backing up and restoring SQL Server databases using the command line interface.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1657

B A C K U P A N A L Y ST >

16 58 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WEL C O M E TO BA CK UP AN A L Y ST > WEL C O M E T O BA CK UP AN A L Y ST

W

ELCOME TO

B

ACKUP

A

NALYST

Establishing a reliable backup and recovery plan for production databases is perhaps the most important responsibility of any database administrator (DBA). Indeed, many DBAs find themselves spending a large share of their time implementing, refining and monitoring backup operations to safeguard the availability of critical database applications.

A number of major trends suggest that managing database backups will become a more pressing issue for professional DBAs over time because corporate databases are growing so quickly. Industry analysts estimate that corporate data is doubling every 2 - 2.5 years. As databases become larger, they become progressively harder to backup and recover as time windows become tighter and the risk of failed backups increases. Every DBA knows that it is far harder to backup a 500 GB database than one that is only 50 GB in size. In addition, DBAs find themselves managing more database applications and, therefore, more database backups. In the quest to compete more effectively, companies are automating more business processes and adopting a wider variety of applications, which means that more production databases get deployed in the enterprise. Finally, organizations have renewed their focus on controlling IT costs and raising staff productivity. The confluence of these factors has thrust DBAs into the uncomfortable position of managing a larger number of critical databases, each of which is growing rapidly in size, with limited incremental resources.

Backup Analyst increases the efficiency of performing and managing database backups. Backup

Analyst for SQL Server can significantly improve operational efficiency and produce significant savings for your organization. A key capability of Backup Analyst for SQL Server is its ability to compress database backup images significantly. Because it can compress backup images by up to 90% or even more, it will reduce your storage costs. In addition, Backup Analyst for SQL

Server can significantly cut the time required to perform backup and recovery operations and the network bandwidth consumed by them. As a result, DBA teams can achieve substantially greater productivity as well as better operational results in managing backup operations, freeing them to spend time on more strategic tasks.

Reliable - Backup Analyst for SQL Server extends the native functionality for performing backup and recovery in SQL Server to incorporate compression and encryption. Backup Analyst is tightly integrated with SQL Server and leverages native functionality of the database wherever possible in order to maximize product reliability and to minimize its footprint.

Fast and Efficient - Customers will find that they can reduce backup file sizes and total processing time substantially by using Backup Analyst for SQL Server. In fact, they will find that the gains are proportionally better as database backups get bigger. Backup Analyst for SQL

Server utilizes highly efficient and reliable compression algorithms in order to achieve the best balance of compression ratio vs. compression processing time.

Scalable - Customers can deploy Backup Analyst for SQL Server to a large number of SQL Server instances very efficiently. The product consumes very little computing resource and works very efficiently with large database servers.

Manageable - Backup Analyst for SQL Server builds on the strength of Embarcadero's DBArtisan family of database administration products. From the DBArtisan Workbench, users will find that it is easy to manage the disaster recovery plans for even a large number of SQL Servers.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1659

WEL C OM E T O B A C K U P A N A L Y ST > WE L C OM E T O B A C K U P A N A L Y ST

Economical - Because of its reliability, efficiency, scalability and ease of management, customers will find that Backup Analyst for SQL Server yields significant and tangible savings in storage costs, bandwidth requirements, processing time and manpower.

For more information, see

Backup Analyst Functionality .

B

ACKUP

A

NALYST

F

UNCTIONALITY

The Backup Analyst includes the following features:

• Backup/Recovery Management

Backup Wizard

that offers:

• Increased backup speed for large databases

• Backup compression

• Backup encryption

• Support for full, differential, file/file group, transaction log, table, and indexed view backups

• Scheduling

Recovery Wizard that offers:

• Increased backup speed for large databases

• Backup compression

• Backup encryption

• Support for full, differential, file/file group, transaction log, table, and indexed view backups

• Scheduling

• Notifications and scheduling via SQL Agent

• Reports

Alerts

• Basic database/object maintenance functions including:

• Database Wizard (SQL Server)

• Modifying objects using editors

• Extract

• Update Statistics

• DBCC

16 60 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WEL C O M E TO BA CK UP AN A L Y ST > WEL C O M E T O BA CK UP AN A L Y ST

B

ACKUP

A

NALYST

S

YSTEM

R

EQUIREMENTS

The basic requirements for installing and using Backup Analyst for SQL Server are quite modest.

Essentially, you must be running a supported version of SQL Server and have a small amount of disk space on the SQL Server machine to store the backup agent code.

Requirement

Supported Versions of

SQL Server

Disk Space

Windows Security

SQL Server Security

Description

SQL Server 2005

SQL Server 2000

SQL Server 2000 64-bit (forthcoming)

Yukon (forthcoming)

5 MB

Privileges to install software on the SQL Server machine

Must login to the SQL Server using a database account that is either system administrator ('sa') or is a member of the 'sysadmin' fixed server role.

For more information, see:

• Backup Analyst Installation

• Opening the Backup Analyst

• Licensing Backup Analyst

• Single-User Mode

W

HAT

Y

OU

S

HOULD

K

NOW

B

EFORE

I

NSTALLATION

When you install the Analyst, several Embarcadero-generated stored objects are pushed onto the database server:These objects are as follows: embt_ba_create_alerts embt_ba_list_backupdevices sp_BackupRestoreInstall sp_embt_ba_database_file_backup_ history sp_embt_ba_databases_needing_b ackup sp_embt_ba_list_database_status sp_embt_ba_trans_log_summary embt_ba_create_embt_backupinfo embt_ba_create_job_categories embt_ba_list_db_filegroups sp_BackupRestoreDrop sp_embt_ba_database_drill_down sp_embt_ba_database_backup_hist ory sp_embt_ba_database_overview sp_embt_ba_file_summary sp_embt_ba_database_restore_hist ory sp_embt_ba_filegroup_summary sp_embt_ba_root_db_summary sp_embt_ba_version sp_embt_ba_table_summary sp_execBackupRestore

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1661

WEL C OM E T O B A C K U P A N A L Y ST > WE L C OM E T O B A C K U P A N A L Y ST

B

ACKUP

A

NALYST

I

NSTALLATION

Installing Backup Analyst for SQL Server should only take several minutes for each database instance. The installation requires you to follow a simple setup wizard that walks you through the process of installing and registering the backup agents on an instance of SQL Server.

The Backup Analyst for SQL Server requires two components: a console that installs as part of the

DBArtisan 8.0 and higher client, and a set of EMBT proprietary extended stored procedures that are installed on the target SQL Server server.

NOTE:

Availability of this feature depends on your DBArtisan licensing. For more information,

see Licensing .

CAUTION:

Backup Analyst server components must be installed by the SQL Server service account owner who has administrative rights on the server machine.

In order to complete the wizard, you must:

• Know the name of the target SQL Server instance.

• Have sufficient Windows privileges to install software on the SQL Server machine. You must have local admin rights on the server machine.

NOTE:

The BackupAnalyst is installed and started on the SQL Server machine. You do not need to install DBArtisan on the server machine, just the Backup Analyst component.

• Obtain a login and password to that SQL Server instance with sufficient privileges to install

the agents (see Security Requirements

).

Installing Backup Analyst

To install Backup Analyst, do the following:

1 Copy the BackupAnalyst folder. This folder is typically located in the main DBArtisan installation directory, typically C:\Program Files\Embarcadero\DBA<version_identifier>\.

The BackupAnalyst folder includes the Backup Analyst components necessary for the serverside installation of Backup Analyst.

2 Paste the BackupAnalyst folder to any location on the machine that hosts the target, licensed SQL Server instance. You could paste the folder to the desktop for example.

3 Open the BackupAnalyst folder and double-click the setup.exe icon.

DBArtisan opens the Embarcadero Backup Analyst InstallShield Wizard that guides you through the installation of Backup Analyst. You

4 Complete the wizard panels, and then click Install.

DBArtisan installs the Backup Analyst engine on the SQL Server machine(s) that you will be testing against.

DBArtisan also performs the following tasks:

16 62 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

WEL C O M E TO BA CK UP AN A L Y ST > WEL C O M E T O BA CK UP AN A L Y ST

• Copies extended stored procedure DLLs and dependencies to target SQL Server directory

• Creates extended stored procedures into any target database

• Creates a standard stored procedures used by the product into any target database

• Creates a backup device if needed

• Creates a new role that controls security

• Grants a new role to all system administrator logins

• Creates a new system job categories (optional)

• Creates new alerts (optional)

NOTE:

When you first install an evaluation copy of DBArtisan and the Backup Analyst engine, you can use the tools for 14 days. After that time, a permanent license is needed.

Uninstalling Backup Analyst

To uninstall Backup Analyst, do the following:

1 In Program Files\Microsoft SQL Server\BackupAnalyst, double-click the setup.exe icon.

DBArtisan opens the Embarcadero Backup Analyst InstallShield Wizard.

2 Select Remove.

3 Click Next.

4 Select Remove.

The wizard uninstalls all Backup Analyst dlls, exes, and scripts.

5 Click Finish.

Repairing Backup Analyst

The InstallShield Wizard lets you repair installation errors in BackUp Analyst. Fixes missing or corrupt files, shortcuts, and registry entries.

1 In Program Files\Microsoft SQL Server\BackupAnalyst, double-click the setup.exe icon.

DBArtisan opens the Embarcadero Backup Analyst InstallShield Wizard.

2 Select Repair.

3 Click Next.

4 Select Install.

The wizard reinstalls Backup Analyst.

5 Click Finish.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1663

WEL C OM E T O B A C K U P A N A L Y ST > WE L C OM E T O B A C K U P A N A L Y ST

Starting the SQL Agent

To use Backup Analyst, your SQL Server SQL Agent should be running on the machine where you are installing the components. You can start it via the Services window.

1 Select Start, Settings, Control Panel, Administrative Tools, and then Services.

2 Right-click SQLSERVERAGENT, and select Start.

O

PENING

B

ACKUP

A

NALYST

To open the Backup Analyst, do the following:

1 On the Analyst menu, click Backup Analyst.

DBArtisan opens the

Backup/Recovery Manager .

L

ICENSING

B

ACKUP

A

NALYST

Availability of this feature depends on your DBArtisan licensing. For more information, see

Licensing .

S

INGLE

-

USER

M

ODE

Backup Analyst works with single-user mode databases with the following restrictions:

• While in single-user mode, Backup Analyst does not let you Backup or Restore a master database using the UI.

• While in single-user mode, use the command line interface to Backup

or Restore a master

database.

16 64 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B AC K U P A N AL Y S T AP P L I C A TI ON B A SI C S > B A C K UP AN A L Y S T AP P L IC AT I O N B A S I C S

B

ACKUP

A

NALYST

A

PPLICATION

B

ASICS

Backup Analyst includes the following features:

• Backup/Recovery Management

• Backup Wizard that offers:

• Increased backup speed for large databases

• Backup compression

• Backup encryption

• Support for full, differential, file/file group, transaction log, table, and indexed view backups

• Scheduling

Recovery Wizard that offers:

• Increased backup speed for large databases

• Backup compression

• Backup encryption

• Support for full, differential, file/file group, transaction log, table, and indexed view backups

• Scheduling

• Notifications and scheduling via SQL Agent

• Reports

Alerts

• Basic database/object maintenance functions including:

• Database Wizard (SQL Server)

• Modifying objects using editors

• Extract

• Update Statistics

• DBCC

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1665

B A C K U P A N A L Y ST A P P L IC A T IO N B A S IC S > B A C K U P A N A L YS T A P PL I C A T IO N B A SI C S

B

ACKUP

A

NALYST

P

RODUCT

D

ESIGN

The product leverages agent technologies that extend the native backup and restore functionality of SQL Server to include compression and encryption. These agents, which are installed on each supported instance of SQL Server, have a very small footprint, requiring only several megabytes of storage. In order to integrate the extended functionality tightly with SQL

Server, Backup Analyst registers these agents as extended stored procedures that can be called from inside the database.

The parameters passed to the extended stored procedures closely follow the patterns established by the native SQL Server backup and restore commands. As a result, users should find the product easy to learn and to integrate with established backup routines. The subsections that follow document the arguments for calling these extended stored procedures.

User Interface

Backup Analyst may be run within DBArtisan, Embarcadero's award-winning, cross-platform database administration tool. Customers using Backup Analyst through DBArtisan will find a rich interface that provides a central console to manage all their backup and recovery needs.

The Backup Analyst Backup Wizard and

Backup Analyst Recovery Wizard

make backing up and recovering SQL Server databases straightforward and easy. The

Backup Analyst Alerts Wizard

lets you create alerts and notifications so no backup or recovery problem goes overlooked. All backup and recovery jobs can be filtered, managed, and tracked in one place. And informative backup and recovery reports can be created and scheduled to run in an automated fashion so everyone is kept informed of backup operations.

NOTE:

Backup Analyst does not have to be run from within DBArtisan. It is fully supported via scripting and command line functions so you can use the

Backup Operations and

Restore Operations

anywhere.

16 66 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B AC K U P A N AL Y S T AP P L I C A TI ON B A SI C S > B A C K UP AN A L Y S T AP P L IC AT I O N B A S I C S

B

ACKUP

A

NALYST

T

OOLBAR AND

M

ENUS

Toolbar:

Main Toolbar Menu

Command Menu

The Backup Analyst Toolbar and menus help you perform the most common operations in

Backup Analyst like opening a Backup Wizard

and

Recovery Wizard

, creating

reports

, and using

DBArtisan functionalities including DBCC

and

Update Statistics

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1667

B A C K U P A N A L Y ST A P P L IC A T IO N B A S IC S > B A C K U P A N A L YS T A P PL I C A T IO N B A SI C S

B

ACKUP

/

RECOVERY

M

ANAGEMENT

Backup/Recovery management provides instant access to major backup and recovery needs, and key database objects. The Backup/Recovery management facilities also display the current status and events of objects, jobs, and other items.

Backup/Recovery management includes the following components:

Backup Analyst Explorer

Backup Analyst Server Information

Panel

Backup Analyst Toolbar

B

ACKUP

A

NALYST

E

XPLORER

The Backup Analyst Explorer lets you navigate the objects of your SQL Server as they relate to backup and recovery. For example, you can manage databases, files and filegroups, transaction logs, and tables, as well as system objects like backup devices, the SQL Server Agent, jobs, and alerts/notifications.

The Backup Analyst Explorer includes the following nodes:

• Server Node

• Databases Node

• Individual Database Nodes

• File Groups Node (and subnodes)

• Backup Recovery Management Node:

• Alerts Node

• Backup Devices Node

• Operators Node

• Jobs Node

Server Node

The SQL Server name is at the top of the Server Node. The default landing page is displayed when this node is selected.

The upper portion of the landing page displays the current status of various backup/recovery activities including the number of backups and recoveries running, databases needing backup, and job successes and failures. The lower pane displays the summary of the last 'N' backups for all databases on the server (where 'N' is an option defined in the global options dialog box).

16 68 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B AC K U P A N AL Y S T AP P L I C A TI ON B A SI C S > B A C K UP AN A L Y S T AP P L IC AT I O N B A S I C S

Databases Node

On the Explorer tree, green database nodes indicate the database is online. A red node indicates the database is offline. When you select the databases node, the right pane displays the Database Summary of backups. You see when each database was created, its online status, size, the log size, the last backup date and type, compressed and uncompressed sizes, and whether or not backup/restore jobs are actively running.

Individual Database Nodes

When you select a specific database’s node in the Explorer, Backup Analyst displays its database properties in the right pane. The top portion displays basic metadata regarding the database in graphic format, while the bottom displays a backup history for the database.

File Groups Node

When you select the Filegroups node in the Explorer, Backup Analyst displays both the File

Group Summary and the Filegroup/File Backup Summary in the right pane. The File Group summary identifies each group (for example, Log and Primary groups) and their capacities to grow, their sizes, and other helpful information. The File Backup summary gives you specific information about backups including the backup type, the run time, and so forth. Additional summaries are provided for subordinate nodes as you click them:

NOTE:

The list that follows are the default nodes. You can add nodes and subnodes with the

Database Wizard (SQL Server)

.

• Primary,

• Files,

• Tables

Transaction Log

The Transaction Log node, when selected, graphically displays transaction log properties in the right pane. The graph enables you to see how much physical space is used and how much is available. You also see a transaction log summary that includes information about when a backup job started and finished, along with its expiration date and other pertinent operation details.

Functions available from the Backup Analyst Databases Explorer Nodes include:

Backup Wizard

Modifying objects using editors

Update Statistics

Recovery Wizard

Extract

DBCC

Database Wizard (SQL Server)

Report

These functions are all available from the Backup Analyst toolbar’s command menu.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1669

B A C K U P A N A L Y ST A P P L IC A T IO N B A S IC S > B A C K U P A N A L YS T A P PL I C A T IO N B A SI C S

B

ACKUP

/

RECOVERY

M

ANAGEMENT

N

ODE

When you select the Backup/Recovery Management node in the Explorer, Backup Analyst displays default landing page for the server, which is the same information you see when you select the server node.

Available Functionality

• Start SQL Server Agent - starts the SQL Server Agent

• Stop SQL Server Agent - stops the SQL Server Agent

Select the Explorer Backup/Recovery Management node and use the command menu to effect these functions.

B

ACKUP

D

EVICES

N

ODE

When you select the Backup Devices node in the explorer, Backup Analyst displays the Backup

Devices Summary in the right pane.

Available Functionality

Backup Device Wizard (SQL Server)

Modifying objects using editors

Report

View Contents

Extract

B

ACKUP

A

NALYST

S

ERVER

I

NFORMATION

P

ANE

The Backup Analyst Server Information window displays information comparable to what you see when you open the About window for DBArtisan. You see the Backup Analyst version number along with pertinent license information.

You can open this information panel from the Backup Analyst drop-down menu on the main toolbar or by clicking on the Backup Analyst toolbar.

16 70 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

U

SING

B

ACKUP

A

NALYST FOR

M

ICROSOFT

SQL S

ERVER

Using Backup Analyst for Microsoft SQL Server covers how to use each component of the application. The Using chapter breaks each process and procedure into simple step-by-step instructions.

NOTE:

Backup Analyst is fully contained within DBArtisan. Backup Analyst can be open while you work with other components of DBArtisan.

B

ACKUP

A

NALYST FOR

M

ICROSOFT

SQL S

ERVER

F

UNCTIONALITY

Backup Analyst lets you create SQL Server backup jobs. Backup Analyst extends standard SQL

Server backup functionality by providing specialized features that offer backup file compression that results in storage savings, as well as security encryption that supplies special protection for sensitive database information.

The Backup Analyst supports the following functionality:

• Backup Wizard

• Recovery Wizard

• Alert Wizard

• Options

• Report

• Server Free Space

B

ACKUP

A

NALYST

B

ACKUP

W

IZARD

Implementing a plan to back up critical databases is perhaps the most important job for any database administrator. Without a sound disaster recovery plan, your company has no safeguards against hardware and software failures.

The Backup Analyst’s Backup Wizard lets you backup your databases without knowing the underlying syntax. It provides support for backing up databases as well as transaction logs, including commands to stripe the backup across multiple devices.

The Backup Analyst Backup Wizard lets you:

• Create a new backup operation.

• Re-use a previously defined operation.

• Specify the target server, database, and type of backup operation.

• Specify backup device type.

• Specify how to report the progress of the backup operation.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1671

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

To Open the Backup Analyst’s Backup Wizard:

1 With the Backup Analyst running:

On the Backup Analyst Explorer, right-click the database/node you want to back up and select Backup Wizard.

OR

From the Backup Analyst drop-down menu, select Backup Wizard.

OR

Select Backup Wizard from the Backup Analyst toolbar.

In the following sections, you’ll find all the fields you’ll encounter as you create or edit a backup operation:

Job Category Wizard

Database Backup Wizard

J

OB

C

ATEGORY

W

IZARD

The Job Category Wizard panels appear ONLY when you are performing a backup operation for a MS SQL datasource. The job categories are relevant to the Backup Analyst and are described below:

Option

Standard Backup

Advanced Backup

Recovery

Would you like to create the 16 popular SQL

Server Alerts for common Backup and

Recovery Errors?

Description

Any backup job which is a full database, differential database, file and file group, transaction log or table backup which does not include the compression or encryption options.

Any backup job which is a full database, differential database, file and file group, transaction log or table backup which includes at least one of the compression or encryption options.

Any recovery job created by Backup Analyst.

Yes - Opens the Alerts wizard.

No - Opens the

Database Backup Wizard

.

B

ACKUP

W

IZARD

The first panel of the Database Backup Wizard welcomes you to the Backup Wizard.

Subsequent panels of the wizard are as follows:

Playback or New Operation

Backup Style

Backup Options

Database Selection

Backup Location

Backup Operation Summary

Backup Type

Backup and Media Information

Backup Operation Execution

Selection

16 72 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

Playback or New Operation

Required Information

New Dump Operation

Previous Dump

Operation

Description

This initiates the process of creating a new backup operation.

If you want to replay a backup operation, when you select the radio button, the browse function is enabled so you can find the .DBDump file you want to re-use.

Database Selection

Here you select the database you want to backup from a drop-down list and name the backup operation. You can keep the default name for the operation or replace it with one you type. The job description is optional and you can accept the default or write another.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1673

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

Backup Type

Required Information

Full Database

Differential Database

File and File Group

Transaction Log

Description

Backs up the entire database. The size of the database is listed in parentheses.

Records all modifications made to a database after the last database backup, not just the changes made after the last differential database backup.

Select to specify a file or file group.

Full Truncate- Backs up the inactive portion of the transaction log. The size of the transaction log is listed in parentheses.

With No Log - Removes the inactive portion of the transaction log without making a backup of it. You should only use this command when you run out of room in the database and cannot issue DUMP TRAN WITH TRUNCATE_ONLY.

Full No Truncate - Makes it possible to dump a transaction log even if the database is inaccessible. You can use this option when the data portion of your database is damaged and the transaction log resides on a separate device.

With Truncate Only - Removes the inactive portion of the transaction log without making a backup of it. You should use this command prior to backing up a database.

Backup Style

Required Information

Backup Analyst Backup

Description

Select to use the Backup Analyst for your backup, assuming the Backup Analyst is installed on the database you are backing up. Also lets you compress the backup and apply an encrypted password.

NOTE: 128-bit encryption is supported

Standard SQL Server Backup Select to continue the Database Backup Wizard.

Backup Location

Required Information

Backup Device

Description

Depending on what is available to you, you can choose to backup to a disk, floppy, pipe, or tape device.

Disk Directory and Name Lets you specify a backup location on your machine or click the browse button and select a location.

View Contents

Click to open the Backup Media Contents dialog box .

Backup and Media Information

Here, for MS SQL, you specify the backup set name, backup description, backup set password, media name, media description, and media name password.

16 74 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

Backup Options

Option

Expire Date

Description

The date when the backup set expires and can be overwritten. If supplied as a variable

(@takeover), this date is specified as either a string constant (@takeover = date), as a variable of character string data type (except for the text or text data types), a small datetime, or datetime variable, and must follow the configured system datetime format.

Retain Days The number of days that must elapse before this backup media set can be overwritten. If supplied as a variable (@days_var), it must be specified as an integer.

Microsoft SQL Server will skip the set expiration and name checking before overwriting.

Skip backup set expiration and name checking before overwriting

Overwrite all backup sets on the device

Microsoft SQL Server will overwrite the contents of the device.

Format the entire media before backup operation

Read and verify the integrity after the backup after finish

Backup Threads

Will format the entire media before the backup operation starts.

After the operation completes, the integrity of the backup is verified.

0 is the default. Zero enables the server default value.

Backup Operation Summary

Here you indicate whether or not you want to save the operation, and if so, where the file should be saved. Also displayed are the elements of the function you are creating. You can go back to earlier panels if you want to make changes before the job runs.

Backup Operation Execution Selection

Option

Open the backup script in an ISQL editor

Perform the backup now

Schedule the backup for later execution

Description

The backup script will be opened into a new ISQL session.

The backup will be executed immediately.

The backup will be scheduled to run at a specified date/time.

Results Summary

If you selected to execute the job immediately, you see a summary of the results of the operation.

For more information, see:

Executing a Backup Script in the ISQL Window

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1675

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

E

XECUTING A

B

ACKUP

S

CRIPT IN THE

ISQL W

INDOW

To execute the actual command DBArtisan uses to backup your database in the ISQL Window, do the following:

1 On Backup Operation Execution Selection , click Open.

DBArtisan opens the ISQL Window, which is used to execute SQL and Transact-SQL commands. The ISQL Window displays the procedure call that Backup Analyst makes to back up SQL Server databases, complete with the parameters needed to perform the backup.

2 To execute your backup, on the ISQL Editor toolbar, click Execute.

DBArtisan completes your backup and displays a message "Procedure Succeeded" on the

Results tab of the ISQL Editor.

B

ACKUP

A

NALYST

R

ECOVERY

W

IZARD

To both validate your back ups and practice the disaster recovery process, you should regularly restore your database dumps. If possible, every day, you should restore your databases on a separate server to enhance system availability. In this manner, you can maintain a warm backup of your database guarding against downtime from system failure.

The Backup Analyst Recovery Wizard lets you:

• Create a new load operation.

• Reuse a previously defined operation.

• Specify the target server, database, and type of restore operation.

• Specify the recovery completion state.

• Specify how to report the progress of the load operation.

• Specify which file to load from the device.

• Specify whether to perform safety checks before replacing the database.

• Save the definition of the dump operation for future re-use.

Completing the Backup Analyst Recovery Wizard

1 On the Backup/Recovery Manager, right-click the target node.

2 Select Recovery Wizard.

DBArtisan opens the Recovery Wizard.

3 Complete the wizard panels, and then click OK.

DBArtisan recovers the database.

For more information, see

Database Recovery Wizard

.

16 76 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

B

ACKUP

A

NALYST

A

LERTS

W

IZARD

The Alert Wizard lets you create and configure popular SQL Server Alerts for backup and recovery operations. Alerts inform the user about actions that need to be taken or about events that are occurring and that do not require any action. For example, there is an alert that indicates a backup is in progress. Once the backup is complete, the alert is cleared.

To create backup alerts:

1 Connect to a SQL Server database.

2 From the Utilities menu, select Database Backup.

The Job Categories wizard opens and on the second panel of this wizard, if you elect to create Alerts, the Alert Wizard opens.

OR

1 Connect to a SQL Server database and open the Backup Analyst.

2 From the Backup Analyst drop-down menu on the toolbar, select Alerts Wizard.

OR

From the Command menu on the toolbar, select Alerts Wizard.

NOTE:

If an alert already exists and is mapped to one of the existing SQL Server Error numbers, the alert will not be created.

NOTE:

Be aware that when you work with the Alerts, Operators, or Jobs features and click

Help, you connect directly to SQL Server Books online. Embarcadero Technologies is not responsible for the contents of the SQL Server Books materials.

SQL Server Agent reads the application log and compares events to alerts that you defined.

When SQL Server Agent finds a match, it fires an alert. DBArtisan lets you define alerts to respond to SQL Server events by notifying operators, forwarding the event to another server, or executing a job. These administrative tasks runs automatically if the SQL Server Agent service has been started.

When you select the Alerts node on the Database Explorer, DBArtisan displays all alerts for the server in the right pane of the Explorer window. The column headings in the right pane of the

Explorer window provide important information about alerts. These headings are:

• Name

• Enabled

• Error

• Severity

• Last Occurred

• E-mail

• Panel

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1677

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

• Net Send

• Count

You can use the shortcut menu to access functionality associated with alerts. Shortcut menus let you:

• View Properties

• Create a New Alert

• Drop an Alert

• Find Object

• Select All

• Unselect All

NOTE:

On the shortcut menu, when you click New, DBArtisan opens the Microsoft SQL Server

Agent Alert Properties dialog box where you can enter the new alert information.

Backup Analyst Alert Wizard - Panel 1

The first panel of the wizard displays a message regarding the purpose of the wizard.

Backup Analyst Alert Wizard - Panel 2

This panel lets you select the alerts you would like to create for backup jobs.

NOTE:

If there are alerts already defined using any of the SQL Server Errors , the wizard will not create the alert.

Backup Analyst Alert Wizard - Panel 3

This panel lets you select the alerts you would like to create for recovery jobs.

NOTE:

If there are alerts already defined using any of the SQL Server Errors , the wizard will not create the alert.

Backup Analyst Alert Wizard - Panel 4

This panel confirms the creation of the alerts.

B

ACKUP

A

NALYST

O

PTIONS

The Backup Analyst options enable you to specify some global settings for queries pertaining to your backup jobs.

16 78 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

To Open the Backup Analyst Options dialog box:

1 With the Backup Analyst open:

Click the Options icon on the Backup Analyst toolbar,

OR

Select Options from the Backup Analyst drop-down menu.

The table below describes the options and functionality for the Backup Analyst Options dialog box:

Option

Grace period (days) for gap in backups

Show last... backups

Days to check for successful/failed jobs

Description

Lets you specify the query limit for when a database needs a backup (for example, database 'A' hasn't been backed up in 7 days).

Lets you specify how much backup history to show (for example, show the last 100 backups) for all backup display grids.

Lets you specify the query limit as to how many days to look back to report on succeeded and failed jobs in the main landing page.

B

ACKUP

A

NALYST

R

EPORT

The Backup Analyst Report Wizard lets you:

• Create a new report or re-execute a previously saved report.

• Select the report to create and select the time frame for report data.

• Select the object(s) to be used for the report.

• Select options for the report.

• Save the report definition.

• Preview and then execute or schedule the report.

Important Notes

None

Completing the Backup Analyst for Microsoft Report Wizard

To complete the Backup Analyst Report Wizard, do the following:

1 On the Backup/Recovery Manager, right-click the target node.

2 Select Report.

DBArtisan opens the Report Wizard.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1679

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

3 Complete the wizard panels, and then click OK.

DBArtisan creates the report(s).

B

ACKUP

A

NALYST

R

EPORT

W

IZARD

- W

ELCOME

The first panel of the Backup Analyst Report Wizard welcomes you to the wizard.

For more information, see Backup Analyst Report Wizard

.

B

ACKUP

A

NALYST

R

EPORT

W

IZARD

- P

ANEL

2

The table below describes the options and functionality on this panel of the Backup Analyst

Report Wizard.

Option

New Backup Analysis Report

Previous Backup Analyst Report

Description

Select to create a new analysis report.

Select to ‘playback’ a previously saved report definition. The saved report definition file suffix can end with '.ard'

For more information, see Backup Analyst Report Wizard

.

B

ACKUP

A

NALYST

R

EPORT

W

IZARD

- T

IME

The table below describes the options and functionality on this panel of the Backup Analyst

Report Wizard.

Option

Report

Time period sample

Databases

Description

Lets you select type of report:

Database Backup History - Provides information regarding all backups over the specified time period.

Database Restore History - Provides information regarding all restores over the specified time period.

Database File Backup Details - Provides information regarding the files backed up for a database over the specified time period.

Databases in Need of Backup - Provides any database that has not been backed up over the specified time period, along with a number of days since the last backup occurred.

Objects Modified in Transaction Log - Displays the objects and page counts that have been modified since the last transaction log backup.

Lets you enter a sampling time period.

Lets you select databases for the report.

For more information, see Backup Analyst Report Wizard

.

16 80 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

U SI N G B A C K UP AN A L Y ST FOR M I C ROS OF T SQ L SE R V E R > US IN G B A C K U P A N A L YS T FO R M IC RO SO FT S QL

B

ACKUP

A

NALYST

R

EPORT

W

IZARD

- S

AVE

The table below describes the options and functionality on this panel of the Backup Analyst

Report Wizard.

Option

Report File Name

Report Title

Save Operation

Execute Now

Schedule

Description

Lets you type a report file name. Or click the browse button and locate an existing file.

Lets you type a report title.

Lets you type a definition file name. Or click the browse button and locate an existing file.

Generates report immediately.

The report will be scheduled to run at a specified date/time.

For more information, see Backup Analyst Report Wizard

.

S

ERVER

F

REE

S

PACE

M

ONITOR

The Server Free Space Monitor displays the total amount of physical free space available on the hard drives of a server. This information helps you ensure there is enough physical space for any new backup devices you may need for local storage of hot backups

.

To Open the Free Space Monitor:

1 With the Backup Analyst open, select a datasource from the Explorer.

2 Choose Server Free Space from the Command drop-down menu.

OR

Right-click in the right pane and choose Server Free Space.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1681

U SIN G B A C K U P A N AL Y ST F OR M IC RO SO FT SQ L SE R V E R > U SI N G B A C K U P A N AL Y S T FOR M IC RO SO FT S QL

16 82 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

B

ACKUP

A

NALYST

C

OMMAND

L

INE

R

EFERENCE

If you do not want to use the Backup Analyst GUI, or if you want to wrap up your database backup and recovery into larger scripts, all of Backup Analyst's functionality is also available via an ISQL window within DBArtisan or from the command line using ETSBackupConsole.exe.

For specific command line operations and examples, see:

Backup Operations

Restore Operations

ETSBackupConsole.exe

For descriptions of all of the parameters for Backup and Restore operations, see:

Description of Backup Parameters

Description of Restore Parameters

B

ACKUP

O

PERATIONS

Backup Analyst supports a wide array of options for implementing a disaster recovery plan on

SQL Server 2000 and 2005. Specifically, the product allows you to perform a:

• Full database backup

• Incremental database backup

• Transaction log backup

• Backup of specific filegroups or files

• Dynamically naming a backup job

The following sections detail the syntax for executing each of these operations:

• Backing Up an Entire Database

• Backing Up a Database Incrementally

• Backing Up a Database Transaction Log

• Backing Up Specific File Groups

• Backing Up Specific Files

• Dynamic Naming of a Backup Job

• Description of Backup Parameters

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1683

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

B

ACKING UP AN

E

NTIRE

D

ATABASE

The syntax for backing up an entire database is as follows:

EXEC xp_embt_backup

@Action = {'database'},

@Database = {string},

@BackupFile = {string},

@Compress = {Boolean},

@DBLoginId = {string},

@DBLoginPassword = {string},

@DBPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@ExpirationDate = {string | date},

@RetainDays = {long},

@Initialize = {boolean},

@MediaDescription = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@BackupSetName = {string},

@BackupSetDescription = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Backing up the entire pubs database:

EXEC xp_embt_backup

@Action = 'database',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

16 84 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

For more information, see

Backup Operations

.

B

ACKING UP A

D

ATABASE

I

NCREMENTALLY

The syntax for backing up a database incrementally is as follows:

EXEC xp_embt_backup

@Action = {'incremental'},

@Database = {string},

@BackupFile = {string},

@Compress = {Boolean},

@DBLoginId = {string},

@DBLoginPassword = {string},

@DBPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@ExpirationDate = {string | date},

@RetainDays = {long},

@Initialize = {boolean},

@MediaDescription = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@BackupSetName = {string},

@BackupSetDescription = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Performing a differential backup of the pubs database:

EXEC xp_embt_backup

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1685

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@Action = 'incremental',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Backup Operations

.

B

ACKING UP A

D

ATABASE

T

RANSACTION

L

OG

The syntax for backing up a transaction log is as follows:

EXEC xp_embt_backup

@Action = {'log'},

@Database = {string},

@BackupFile = {string},

@Compress = {Boolean},

@DBLoginId = 'sa',

@DBLoginPassword = 'password',

@DBPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@ExpirationDate = {string | date},

@RetainDays = {long},

@Initialize = {boolean},

@MediaDescription = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@BackupSetName = {string},

@BackupSetDescription = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@TruncateLog = {'NoTruncate'},

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

16 86 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

Example

Backing up of the transaction log of the pubs database:

EXEC xp_embt_backup

@Action = 'log',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@TruncateLog = 'NoOption'

For more information, see

Backup Operations

.

B

ACKING

U

P

S

PECIFIC

F

ILE

G

ROUPS

The syntax for backing up a database filegroup is as follows:

EXEC xp_embt_backup

@Action = {'files'},

@Database = {string},

@BackupFile = {string},

@DatabaseFileGroups = {string},

@Compress = {Boolean},

@DBLoginId = 'sa',

@DBLoginPassword = 'password',

@DBPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@ExpirationDate = {string | date},

@RetainDays = {long},

@Initialize = {boolean},

@MediaDescription = {string},

@MediaName = {string},

@MediaPassword = {string},- SQL Server 2000 only

@BackupSetName = {string},

@BackupSetDescription = {string},

@BackupSetPassword = {string},- SQL Server 2000 only

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1687

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Backing up the primary filegroup of the pubs database:

EXEC xp_embt_backup

@Action = 'files',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@DatabaseFileGroups = 'PRIMARY'

For more information, see

Backup Operations

.

B

ACKING

U

P

S

PECIFIC

F

ILES

The syntax for backing up a database file is as follows:

EXEC xp_embt_backup

@Action = {'files'},

@Database = {string},

@BackupFile = {string},

@DatabaseFiles = {string},

@Compress = {Boolean},

@DBLoginId = 'sa',

@DBLoginPassword = 'password',

@DBPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@ExpirationDate = {string | date},

@RetainDays = {long},

@Initialize = {boolean},

@MediaDescription = {string},

16 88 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

@MediaName = {string},

@MediaPassword = {string},- SQL Server 2000 only

@BackupSetName = {string},

@BackupSetDescription = {string},

@BackupSetPassword = {string},- SQL Server 2000 only

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long}

Example

Backing up the primary data file of the pubs database:

EXEC xp_embt_backup

@Action = 'files',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@DatabaseFiles = 'c:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf'

For more information, see

Backup Operations

.

D

YNAMIC

N

AMING OF A

B

ACKUP

J

OB

You can easily give a backup job a dynamic name, that is, a time/date stamp by following the script in the example that follows: declare @sql varchar(500) select @sql = 'master..xp_embt_backup @DATABASE=N''PUBS'',

@ACTION=N''database'',

@BACKUPFILE=N''d:\PUBS_' + rtrim(convert(char(15), getdate(),112)) + '_' + rtrim(replace(convert(char(15), getdate(), 08),':','')) + '_embt.bak'',

@DBLOGINID=N''sa'',

@DBLOGINPASSWORD=N''password",

@JOBNAME=N''EMBT_PUBS_080405_083301'',

@OPERATION_STYLE=N''0'',

@BACKUPSETDESCRIPTION=N''Backup Description'',

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1689

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@BACKUPSETNAME=N''Backup Set Name'',

@JOBDESCRIPTION=N''PUBS Backup Job on 8/4/2005 8:33:01 AM''' exec (@sql)

D

ESCRIPTION OF

B

ACKUP

P

ARAMETERS

Parameter

@Action

@Database

@BackupFile

@Compress

@DBLoginId

@DBLoginPassword

@DBPassword

@DBInstanceName

@BackupThreads

@ExpirationDate

@RetainDays

@Initialize

Datatype Required

String

String

String

Boolean

String

String

String

String

Long

Date or

String

Long

Boolean

Always

Always

Optional

Optional

Optional

Optional

Optional

Optional

Optional

Optional

Optional

Description Microsoft SQL Server

Backup Parameter

N/A

database | files | incremental | log

The database that is the target of the backup operation.

The location and name of the target backup file.

Whether or not to apply compression to the backup. The default is set to true (1).

Database Name

Backup Device/File

The Login ID for accessing the SQL

Server and performing the backup. If omitted, then Backup Analyst will use the login of the owner of the extended stored procedure.

The password for the login. If omitted, then Backup Analyst will use the password of the owner of the extended stored procedure.

Encryption key used to obfuscate password.

It there are multiple instances of SQL

Server installed on the same machine, then you should specify the instance name using this parameter. If none is specified, then 'local' is assumed.

N/A

N/A

N/A

N/A

Number of processors to dedicate to the backup process.

N/A

Specifies the date when the backup set expires and can be overwritten.

Specifies the number of days that must elapse before this backup media set can be overwritten.

Specifies whether or not a backup should overwrite or be appended to any existing backup sets. If overwritten, the media header is preserved.

EXPIREDATE

RETAINDAYS

INIT | NOINIT

16 90 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

Parameter

@MediaDescription

@MediaName

@MediaPassword

@BackupSetDescrip tion

@BackupSetName

@BackupSetPasswor d

@Restart

@PercentComplete

Notification

@LogLevel

@DatabaseFileGrou ps

@DatabaseFiles

Datatype

String

String

String

String

String

String

Boolean

Long

String

String

String

Required

Optional

Optional

Description

Specifies information that helps to identify a backup set.

Specifies the media name, a maximum of

128 characters, for the entire backup media set. If MEDIANAME is specified, it must match the previously specified media name already existing on the backup volume(s). If not specified or if the

SKIP option is specified, there is no verification check of the media name.

Sets the password for the media set.

Microsoft SQL Server

Backup Parameter

MEDIADESCRIPTIO

N

MEDIANAME

PASSWORD Optional

SQL 2000

Only

Optional

Optional

Optional

SQL 2000

Only

Specifies the free-form text describing the backup set. The string can have a maximum of 255 characters.

Specifies the name of the backup set.

Names can have a maximum of 128 characters.

Sets the password for the backup set. If a password is defined for the backup set, the password must be supplied to perform any restore operation from the backup set.

DESCRIPTION

NAME

PASSWORD

Optional

Optional

Optional

Specifies that SQL Server restarts an interrupted backup operation. The

RESTART option saves time because it restarts the backup operation at the point it was interrupted.

Provides information on the progress of a backup or restore operation.

error | info | debug

Indicates the level of logging to occur during execution. The default is set to

'info'.

Names one or more filegroups to include in the database backup.

RESTART

STATS

FILEGROUPS When backing up file groups

When backing up files

Names one or more files to include in the database backup

FILES

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1691

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

Parameter

@TruncateLog

Datatype

String

Required Description

When backing up transaction logs

Valid values:

NoLog | NoOption | NoTruncate |

Truncate | TruncateOnly

NoLog - Records referencing committed transactions are removed. Transaction log is not backed up.

NoOption - Transaction log is backed up.

Records referencing committed transactions are removed.

NoTruncate - Transaction log is backed up. Records referencing committed transactions are not removed, providing a point-in-time image of the log.

Truncate - Transaction log is backed up.

Records referencing committed transactions are removed.

TruncateOnly - Records referencing committed transactions are removed.

Transaction log is not backed up.

Microsoft SQL Server

Backup Parameter

Various

For more information, see

Backup Operations

.

R

ESTORE

O

PERATIONS

Backup Analyst supports a wide array of options for implementing a disaster recovery plan on

Microsoft SQL 2000 and 2005. Specifically, the product allows you to:

• Restore a full database

• Restore a partial database

• Restore a transaction log

• Restore specific filegroups or files

• Verify the integrity of a backup

• Retrieve a summary of the contents of a backup

• Retrieve the header information for a backup

• Retrieve the label for a backup

The following sections detail the syntax for executing each of these operations.

• Restoring a Complete Database

• Restoring a Database to a Different Location

• Restoring a Database Transaction Log

16 92 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

• Restoring Specific File Groups

• Restoring Specific Files

• Retrieving the List of Databases and Log Files in a Backup Set

• Retrieving Backup Header Information

• Retrieving a Backup Label

• Verifying the Integrity of Backup Media

• Description of Restore Parameters

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

R

ESTORING A

C

OMPLETE

D

ATABASE

The syntax for restoring an entire database is as follows:

EXEC xp_embt_restore

@Action = {'database'},

@Database = {string},

@BackupFile = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@RelocateFiles = {multi-string},

@KeepReplication = {boolean}, - SQL Server 2000 only

@BackupSetName = {string},

@BackupSetPassword = {string},- SQL Server 2000 only

@ReplaceDatabase = {string},

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long},

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1693

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Restoring the entire pubs database:

EXEC xp_embt_restore

@Action = 'database',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

R

ESTORING A

D

ATABASE TO A

D

IFFERENT

L

OCATION

The syntax for restoring and moving a database is as follows:

EXEC xp_embt_restore

@Action = {'database'},

@Database = {string},

@BackupFile = {string},

@ReplaceDatabase = {string},

@RelocateFiles = {multi-string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@BackupSetName = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long},

16 94 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Restoring and moving the pubs database with different file locations (located in drive d, not c):

EXEC xp_embt_restore

@Action = 'database',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@ReplaceDatabase = 1,

@RelocateFiles =

'[pubs],[d:\mssql\data\pubs.mdf],[pubs_log],[d:\mssql\data\pubs_log.ldf]'

For more information, see

Restore Operations

.

R

ESTORING

P

ART OF A

D

ATABASE

The syntax for restoring part of a database is as follows:

EXEC xp_embt_restore

@Action = {'database'},

@Database = {string},

@BackupFile = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@RelocateFiles = {multi-string},

@BackupSetName = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@ReplaceDatabase = {string},

@Restart = {boolean},

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1695

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@PercentCompleteNotification = {long},

@LogLevel = {long},

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Performing a differential restore of the pubs database:

EXEC xp_embt_restore

@Action = 'database',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

R

ESTORING A

D

ATABASE

T

RANSACTION

L

OG

The syntax for restoring a database transaction log is as follows:

EXEC xp_embt_restore

@Action = {'log'},

@Database = {string},

@BackupFile = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@LastRestore = {boolean},

@ToPointInTime = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

@MediaPassword = {string} - SQL Server 2000 only

@RelocateFiles = {multi-string},

@KeepReplication = {boolean} ,- SQL Server 2000 only

@BackupSetName = {string},

16 96 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

@BackupSetPassword = {string}, - SQL Server 2000 only

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long},

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Restoring the transaction log of the pubs database:

EXEC xp_embt_restore

@Action = 'log',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@LastRestore = false

For more information, see

Restore Operations

.

R

ESTORING

S

PECIFIC

F

ILE

G

ROUPS

The syntax for restoring specific database file groups is as follows:

EXEC xp_embt_restore

@Action = {'files'},

@Database = {string},

@BackupFile = {string},

@DatabaseFileGroups = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

@MediaPassword = {string}, - SQL Server 2000 only

@RelocateFiles = {multi-string},

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1697

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@BackupSetName = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@ReplaceDatabase = {string},

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long},

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Restoring the primary filegroup of the pubs database:

EXEC xp_embt_restore

@Action = 'files',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@DatabaseFileGroups = 'PRIMARY'

For more information, see

Restore Operations

.

R

ESTORING

S

PECIFIC

F

ILES

The syntax for restoring specific database files is as follows:

EXEC xp_embt_restore

@Action = {'files'},

@Database = {string},

@BackupFile = {string},

@DatabaseFiles = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@FileNumber = {long},

@EncryptionPassword = {string},

@DBInstanceName = {string},

@MediaName = {string},

16 98 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

@MediaPassword = {string}, - SQL Server 2000 only

@RelocateFiles = {multi-string},

@BackupSetName = {string},

@BackupSetPassword = {string}, - SQL Server 2000 only

@ReplaceDatabase = {string},

@Restart = {boolean},

@PercentCompleteNotification = {long},

@LogLevel = {long},

@StandbyFiles = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

Restoring the primary data file of the pubs database:

EXEC xp_embt_restore

@Action = 'files',

@Database = 'pubs',

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat',

@DatabaseFiles = 'c:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf'

For more information, see

Restore Operations

.

R

ETRIEVING THE

L

IST OF

D

ATABASES AND

L

OG

F

ILES IN A

B

ACKUP

S

ET

The syntax for retrieving the list of databases and log files contained in a backup set is as follows:

EXEC xp_embt_restore_filelistonly

@BackupFile = {string},

@EncryptionPassword = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

EXEC xp_embt_restore_filelistonly

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1699

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

R

ETRIEVING

B

ACKUP

H

EADER

I

NFORMATION

The syntax for retrieving the backup header information is as follows:

EXEC xp_embt_restore_headeronly

@BackupFile = {string},

@EncryptionPassword = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

EXEC xp_embt_restore_headeronly

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

R

ETRIEVING A

B

ACKUP

L

ABEL

The syntax for retrieving the backup label is as follows:

EXEC xp_embt_restore_labelonly

@BackupFile = {string},

@EncryptionPassword = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

Example

EXEC xp_embt_restore_labelonly

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

V

ERIFYING THE

I

NTEGRITY OF

B

ACKUP

M

EDIA

The syntax for verifying the integrity of backup media is as follows:

EXEC xp_embt_restore_verifyonly

@BackupFile = {string},

@EncryptionPassword = {string}

NOTE:

Mandatory parameters to an extended stored procedure are shown in bold text.

17 00 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

Example

EXEC xp_embt_restore_verifyonly

@BackupFile = 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs.dat'

For more information, see

Restore Operations

.

D

ESCRIPTION OF

R

ESTORE

P

ARAMETERS

Xp_embt_restore

Parameter

@Action

@Database

@BackupFile

@DBLoginId

@DBLoginPassword

@DBPassword

@DBInstanceName

@FileNumber

@MediaName

Datatype Required

String

String

String

String

String

String

String

Long

String

Always

Always

Optional

Optional

Optional

Optional

Optional

Optional

Description Microsoft SQL Server

Backup Parameter

N/A

database | files | log

The database that is the target of the backup operation.

The location and name of the target backup file.

The Login ID for accessing the SQL

Server and performing the backup. If omitted, then Backup Analyst will use the login of the owner of the extended stored procedure.

Database Name

Backup Device/File

N/A

The password for the login. If omitted, then Backup Analyst will use the password of the owner of the extended stored procedure.

Encryption key used to obfuscate password.

N/A

N/A

It there are multiple instances of SQL

Server installed on the same machine, then you should specify the instance name using this parameter. If none is specified, then 'local' is assumed.

Identifies the backup set to be restored.

For example, a file_number of 1 indicates the first backup set on the backup medium and a file_number of 2 indicates the second backup set.

N/A

FILE

Specifies the media name, a maximum of

128 characters, for the entire backup media set. If MEDIANAME is specified, it must match the previously specified media name already existing on the backup volume(s). If not specified or if the

SKIP option is specified, there is no verification check of the media name.

MEDIANAME

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1701

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

Xp_embt_restore

Parameter Datatype

@BackupSetPasswor d

String

@PercentComplete

Notification

@LogLevel

Long

String

Required Description Microsoft SQL Server

Backup Parameter

PASSWORD @MediaPassword

@RelocateFiles

@KeepReplication

@BackupSetName

@ReplaceDatabase

@Restart

String Optional

SQL 2000

Only

Multi-string Optional

Sets the password for the media set.

Boolean

String

Boolean

Boolean

Optional

SQL 2000

Only

Optional

Optional

SQL 2000

Only

Optional

Optional

Optional

Optional

Specifies that the given logical_file_name should be moved to operating_system_file_name. By default, the logical_file_name is restored to its original location. If the RESTORE statement is used to copy a database to the same or different server, the MOVE option may be needed to relocate the database files and to avoid collisions with existing files. Each logical file in the database can be specified in different

MOVE statements.

MOVE

Instructs the restore operation to preserve replication settings when restoring a published database to a server other than that on which it was created.

Specifies the name of the backup set.

Names can have a maximum of 128 characters.

Sets the password for the backup set. If a password is defined for the backup set, the password must be supplied to perform any restore operation from the backup set.

Specifies that SQL Server should create the specified database and its related files even if another database already exists with the same name. In such a case, the existing database is deleted. When the REPLACE option is not specified, a safety check occurs (which prevents overwriting a different database by accident).

KEEP_REPLICATION

NAME

PASSWORD

REPLACE

Specifies that SQL Server restarts an interrupted backup operation. The

RESTART option saves time because it restarts the backup operation at the point it was interrupted.

Provides information on the progress of a backup or restore operation.

error | info | debug

Indicates the level of logging to occur during execution. The default is set to

'info'.

RESTART

STATS

17 02 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

Xp_embt_restore

Parameter

@DatabaseFileGrou ps

@DatabaseFiles

@StandbyFiles

@ToPointInTime

@LastRestore

@LoadHistory

Datatype

String

String

String

String

Boolean

Boolean

Required Description

When backing up file groups

Names one or more filegroups to include in the database backup.

Microsoft SQL Server

Backup Parameter

FILEGROUPS

When backing up files

Optional

When restoring transaction logs

When restoring transaction logs

Optional

Names one or more files to include in the database backup

Specifies the name of an undo file used as part of the backup strategy

Sets an endpoint for restoring a transaction log

Specifies whether the transaction log is the last in a chain of log backups

Specifies whether or not to verify the integrity of the backup

FILES

STANDBY

N/A

N/A

N/A xp_embt_restore_headeronly

Parameter Datatype

@BackupFile String

@EncryptionPasswo rd

String

Required

Yes

Optional

Description

Location and name of the target backup file.

Encryption key used to obfuscate password.

SQL Server Backup

Parameter

Backup Device/File

N/A xp_embt_restore_filelistonly

Parameter Datatype

@BackupFile String

@EncryptionPasswo rd

String

Required

Yes

Optional

Description

Location and name of the target backup file.

Encryption key used to obfuscate password.

SQL Server Backup

Parameter

Backup Device/File

N/A

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1703

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE xp_embt_restore_labelonly

Parameter Datatype

@BackupFile String

@EncryptionPasswo rd

String

Required

Yes

Optional

Description

Location and name of the target backup file.

Encryption key used to obfuscate password.

SQL Server Backup

Parameter

Backup Device/File

N/A xp_embt_restore_verifyonly

Parameter Datatype

@BackupFile String

@EncryptionPasswo rd

String

Required

Yes

Optional

Description

Location and name of the target backup file.

Encryption key used to obfuscate password.

SQL Server Backup

Parameter

Backup Device/File

N/A

For more information, see

Restore Operations

.

ETSB

ACKUP

C

ONSOLE

.

EXE

From the command line, the product allows you to perform a:

• Full database backup

• Incremental database backup

• Transaction log backup

• Backup of specific filegroups or files

• Restore a full database

• Restore a transaction log

• Restore specific filegroups or files

• Verify the integrity of a backup

• Retrieve a summary of the contents of a backup

• Retrieve the header information for a backup

• Retrieve the label for a backup

17 04 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

B A C K U P A N A L Y ST C O M M A N D L IN E R E FE REN C E > B AC KUP ANALYS T COMMAND LI NE REF ERE N CE

The syntax for backing up or restoring using ETSBackupConsole.exe follows. Mandatory parameters are shown in bold. All other parameters are optional.

NOTE:

In addition to {'backup_database'}, action parameters available for backup operations are: {'backup_incremental'}, {'backup_log'}, {'backup_files'}, {'restore_database'}, and for restore operations are: {'restore_files'}, {'restore_log'}, {'restore_filelistonly'},

{'restore_labelonly'}, {'restore_headeronly'}, and {'restore_verifyonly'}.

@Action = {'backup_database'},

@Database = {string},

@BackupFile = {string},

@DBLoginId = {string},

@DBLoginPassword = {string},

@DBInstanceName = {string},

@BackupThreads = {long},

@BackupSetName = {string},

@BackupSetDescription = {string},

@Log Level = {string},

@Compress = {boolean},

@DatabaseFileGroups = {multi-string},

@DatabaseFiles = {multi-string},

@ExpirationDate = {string},

@FormatMedia = {Boolean},

@Initialize = {Boolean},

@MediaDescription = {string},

@MediaName = {string},

@MediaPassword = {string} - SQL Server 2000 only

@BackupSetPassword = {string}, - SQL Server 2000 only

@Restart = {boolean},

@SkipTapeHeader = {boolean},

@TruncateLog = {string},

@UnloadTapeAfter = {string},

@NoRewind = {boolean},SQL Server 2000 only

@PercentCompleteNotification = {long},

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1705

B A C K U P A N A L Y ST C O M M AN D L IN E R E FE REN C E > B AC KUP ANAL YS T CO MM AND L I NE RE F ERE N CE

@RetainDays = {long}

Example:

Etsbackupconsole.exe

@action=backup_database

@Database=[pubs]

"@backupfile=c:\temp\pubs.embt.bak"

@EncryptionPassword=PASSWORD

17 06 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Index

deallocating unused space 591

Symbols

.mdf/.ndf/.ldf files 461

(VPXSEQT setting 442

#define 726

#include 726

default file location 106

Numerics

3D Rounded Docking Tabs. 51

A

A lock duration 29

abort tran on log full 524

ACCENT_SENSITIVITY 289

Access Methods

capacity/growth statistics 992

access methods, SQL Agent 281

access patterns, I/O 1238

account, user 519

accounting, logins 530

accounts/accounting

setting lock time 506

ACHKP status code 29

ACM OPERATION 623

activating roles 137

active

locks, current 1385

processes 1339

rollback ratio 1117

sessions 1159

threads running on database 30

transactions 1387

transactions, rollback segments 508

user processes 1222

Add Cluster Column 332

add/modify login trigger object action 551

ADDING disk (ASM) state 335

Additional resources 7

Address Windowing Extensions 1243

Advanced View 960

AES... algortihms 365

affected pool 525

After 100

AFTER trigger timing 480

agents

created due to empty pool 1522, 1526

percentage waiting on token 1524 percentage working in instances 1524

SQL, jobs/alerts details 1282

waiting on token statistic 1521

aggregate, MySQL functions 323

Alarm Log

Organizing 1022

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

alert association 297

alerts

SQL agent status 1282

Alerts, SQL Agent

creating 280

alerts, SQL Agent

editing 459

job association 297

object support summary 157

algorithms

encryption, Oracle columns 365

aliases

cration shortcut 580

creating, DB2 LUW 226

creating, Sybase 382

editor, DB@ LUW 420

editor, DB2 Z/OS 441

editor, Sybase 522

see also objects, database

support for 157

Alignment index partition setting 498, 504, 518, 529

ALL views 108

allocate extent object action 552

Allow Bit Data setting 439

Allow Duplicate Rows index setting 529

allow nulls

Oracle columns 365

Allow Nulls setting

tables 452

allow nulls setting

by default, databases 524

by default, databsaes 384

user datatype 539

allow parallel option 433

Allow Parallel setting 234, 424

Allow Reverse Scans index setting 426

ALLPAGES 536

allpages_locked tables 1386

ALTER SYSTEM SET "_recyclebin"= 602

ALTER_REBUILD 559

alter, rename style 108

analysis reports, Capacity Analyst 1004

Analyze Code 687

analyze tables object action 554

ANSI encoding

results sets 739

saving scripts 699

ANSI Labels 460

ANSI null default 284, 462

ANSI nulls 284, 462

ANSI padding 284, 462

ANSI warnings 284, 462

APF reads 1353

Append Data setting 434

Append, materialized query tables 427

1707

I N D E X applications

attributes of connected 1510

bind to database 524

binds attempted 1509

cache/workspace details 1459

causing bottlenecks 1453

currently connected 1503, 1509

direct authorities 1512

executing 1453, 1499

highest read/writes 1469

idle 1453, 1499

indirect authorities 1512

list of, resource usage 1505

memory pool usage 1462

percentage waiting on locks 1513

precompiles attempted 1509

specific, SQL activity 1508

SQL activity 1508

time waiting on prefetchers 1470

top bottlenecked 1500

top CPU 1505

top I/O 1473, 1504 top memory 1504

units of work 1509

waiting on locks 1443, 1513

ARBDP status code 29

archive log 1063

ARCHIVED LOG 623

AREO* status code 29

AREST status code 29

arithabort 462

AS DEFAULT 289

as locator 425

As Locator function setting 445

As Locator option 433

Asc Sort, indexes 497

ascending scans 1361, 1387

ASM 595, 617

checking disk group consistency 568

creating disk groups 334

editing disk groups 493

rebalancing disk groups 630

restrictions by connection type 617

support summary 167

undropping disks 677

Assisting Parallel Sequential setting 442

asymmetric keys

SQL Server logins 300

async prefetch 525

async read ratio 1465, 1480 async write ratio 1465, 1480

asynchronous I/O limit 1373

asynchronous prefetch, number of 1353

AT(COMMIT) clause 671

atabases 386

attach database object action 555

Audit table setting 453

authorization

owner, full-text catalogs 289

auto close 284, 462

auto commit status 688

auto create statistics 284, 462

auto format options, ISQL 115

auto format, DDL extract options 103

Auto Growth 523

auto identity 384, 524

auto shrink 284, 462 auto update statistics 284, 462

AUTOBACKUP ASM template 336

auto-create, databases without 1276

AUTOEXTEND, datafiles at extent limit 1105

auto-grow

databases with 1253

logs 1254

auto-increment, MySQL tables 325

automatic bufferpool size 421

automatic rebinds statistic 1500

automatic size setting 227

auto-param attempts, failed 1262

auto-reload

files, ISQL Editor 113 auto-reload, options 113

Auto-Save

ISQL editor 113 auto-save, files 113

auto-shrink, databases with 1254

auto-update, databases without 1277

AUXW status code 29

average disk queue length 1129, 1411

Average Size package setting 447

B backup

capacity/growth statistics 991

compressing dumps/logs 808

control files 827

databases 803

databases requiring 1276

growth reports 1005

last time 1452

statistics 1283

17 08 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X

Backup Analyst 1659

Alert Creation Wizard 1677

Backup Analyst Toolbar 1667

Backup Operation Syntax 1683

Entire Database 1684

File Groups 1687

Incremental 1685

Specific Files 1688

Transaction Log 1686

Backup Parameters 1690

Backup/Recovery Manager 1668

Command Line 1683

Encryption 1674

Explorer 1668

Any Database Node 1669

Backup Directories Node 1670

Backup Recovery Management Node 1670

Databases Node 1669

Filegroups Node 1669

Server Node 1668

Functionality 1671

Information Pane 1670

Installation 1662

License Status 1664

Licensing 1664

Managing more backups 1659

Opening 1664

Options 1678

Product Design 1666

Recovery Wizard 1676

Removing 1663

Repairing 1663

Report 1679

Restore Operation Syntax 1692

Backup Header Information 1700

Backup Label 1700

Backup Media Integrity 1700

Complete Database 1693

Different Location 1694

File Groups 1697

Files 1698

List of Databases and Log Files in Backup

Set 1699

Partial 1695

Transaction Log 1696

Restore Parameters 1701

Server Free Space Monitor 1681

Single-User Mode 1664

Starting the SQL Agent 1664

Transaction Log Node 1669

Uninstalling 1663

User Interface 1666

Using 1671

BACKUP CORRUPTION 623

BACKUP DATAFILE 623

backup devices

creating, SQL Server 282

editor, SQL Server 460

see also objects, database

viewing content details 683

BACKUP PIECE 623

BACKUP REDOLOG 623

backup server status 1376

BACKUP SET 623

BACKUP SPFILE 623

Backup Wizard 803

batch files

Java drop/load 103

Batch Mode execution 101

BCP Options 800

BCP Utility 753

Begin Transaction ON/OFF 688

BerkeleyDB storage engine 325

Big Endian encoding

results sets 739

saving scripts 699

bind options 559

bind package object action 555

bind size 118

Bind Time package setting 447

bind to temporary database action 558

Binder package setting 428

binding

application attempts 1509

application/login to database 524

caches 1380

default/rule 483

user datatype

default binding 539

binding logins to 558

bit data, user datatypes 439

bitmap index type 497

block I/O requests 1479

Block Size setting 227

blocked connections 1334

blocked processes 1261

blocked sessions 1162

blocking users, current 1215

blocks

in/out per second 1547

input/output details 1145

input/output per second 1412

BLOCKSIZE 227

body

function 444

packages 503

type bodies 516

BOM encoding

results sets 739

saving scripts 699

Bookmarks 47, 708

Clearing 709

Goto 708

Moving 708

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1709

I N D E X

boundary values, partition functions 303

BROKEN disk group state 334

broker, SQL Agent 281

buffer

SQL Agent 281

buffer cache

blocks by tablespace 1074

hit ratio 1212

memory configuration 1078

memory currently allocated 1347

page life expectancy 1229

percent used 1225

size in kernel 1143

total space used 1224

used by kernel 1142, 1304

utilization 1074

Buffer Manager

capacity/growth statistics 992

Buffer Partition

capacity/growth statistics 992

buffer pools

tablespace specification 272

buffer size 1550

Buffered Inset package setting 428

bufferpools

creating for IBM DB2 226 creating, DB2 LUW 226

dynamic SQL cache metrics 1561

editor, IBM DB2 LUW 421

editor, IBM DB2 Z/OS 441

event monitor, event type 230, 423

fast communication manager usage 1525

hit ratio 1076

1438

indexes 446, 456

object assignments 1077

primary key setting 449

see also objects, database

tablespace default 437

buffers

busy waits 1055

flushed lazy writes 1235

free, wait average 1068

grabbed dirty 1344

sent/received statistic 1522

used by kernel 1416

utilization, fast communication manager 1523

build procedure object action 559

Building a Query

Statements

UPDATE 867

bulkadmin server role 203

C

C

method type, DB2 LUW 433

C lock duration 29

C lock type 29

17 10 cache

bindings 1380

buffer, percent used 1225

buffer, used space 1224

clusters 490

efficiency 1142

flushing, packages 611

library, details/statistics 1082

log, reads 1235

log, statistics 1231

materialized view logs option 500, 502

property, tables 510, 1074

sequence setting 431, 509

size 1550

used in kernel 1416

caching strategy 385

call, system, per second 1137

called on NULL input option 433

Called on Null Input setting 234

Capacity Analyst

analysis reports 1004

charts/reports 1000

cloning collections 995

collection summary reports 1004

creating collections 994

deleting collections 996

editing collections 995

Installation 972

Licensing 977

purging older data 1000

scheduling collection updates 997

SQL Server Embarcadero Stored Objects 968

carriage return 113

CASCADE

delete rule 495

update/delete rule 464

cascade

set integrity options 666

shrink option 670

unique key setting 517

CASCADE delete rule 423

CASCADE, MySQL foreign key 322

Cascading Permissions 905

case

object identifiers 107

CAST FROM 433

Castout setting 442

catalog cache

hit ratio 1438

overflows 1456

usage details (lookups/inserts/overflows) 1460

Catalog Metadata 281

catalog, datasource

specifying storage method 102

categories

dropping outlines by 596

stored outlines 502

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

categories, datasource

assigning 127

customizing 129

introduced 144

user interface element treatment 103

categories, reassigning 629

categories, stored outline 560

CCSID

database setting 443

table setting 434

user datatype setting 457

certificate

SQL Server logins 300

Certificate setting

Asymetric Key setting 482

chained row fetch ratio 1117

chained tables 1118

change category object action 560 change job’s owner action 560

change status action

full-text indexes 563

change status object action

database triggers 562

change status object operation 561

changed option, check tables 570

CHANGETRACKING ASM template 336

CHANGGE TRACKING, full-text indexes 290

CHAR

unicode support, Data editor 893

unicode support, Results editor 748

character set

MySQL 322

character set, client 100

character strings. See strings

character type

unicode support, Data editor 893

unicode support, Results editor 748

check constraints

creating for IBM DB2 550 creating for IBM DB2 for OS/390 and z/OS 550 creating for Microsoft SQL Server 550 creating for Oracle 550 creating for Sybase ASE 550

editor, DB2 LUW 421

editor, DB2 Z/OS 442

editor, Oracle 489

editor, SQL Server 461

editor, Sybase 522

hiding source text 613

modifying for IBM DB2 550

see also objects, database

support for 159

table, DB2 LUW 435

tablespaces, checking 566 check data operation, tablespaces 566

check disk group operation 568

Check Flag table setting 453

check index operation 569

check pending states 666

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

I NDE X

check policy/expiration 300

check tables object action 570

Checking Syntax 687

checkpoint 571

checkpoints 1354

checkpoints, redo log groups 673

checksum tables object action 571

CHKP status code 29

CKPT PROGRESS 623

clean buffer grab rate 1330

clipboard, line end options 113

CLOB

unicode support, Data editor 893

unicode support, Results editor 748

xmltype display 110

clock algorithm scans 1147, 1416, 1551

clone

dropping, table 597

exchanging data 605

Close index setting 446, 456

Close primary key setting 449

Cluster Factor setting 426, 429, 438, 446, 450, 456, 497,

517

Cluster Factor, primary keys 504

Cluster Ration setting 426, 429, 438, 446, 450, 456

clustered indexes, SQL Server 467

clustered setting 539

indexes 426

primary keys 473, 481

clusters 491

allocating extents to 552

and materialized views 500

capacity/growth statistics 993

creating, Oracle 330

deallocating unused space 591

editor, Oracle 490

see also objects, database

support for 160

truncating 674

coalescing tablespaces 572

Code Formatting 687

Code Page package setting 428

Code Size setting 496, 505

packages 503

Code Workbench 900

Creating Auto Replace Shortcuts 902

Exporting Settings 903

Importing Settings 903

Modifying Auto Replace Shortcuts 902

collation

MySQL databases 322

Collation Compatible Server setting 475

Collecting sample statistics 680

Collection Analysis Viewer

adding metrics 1002

introduced 1000

opening 1001

viewing options 1002

1711

I N D E X collections, Capacity Analyst

analysis viewer 1000

analyst reports 1004

cloning 995

creating 994

deleting 996

editing 995

purging older data 1000

scheduling updates 997

summary reports 1004

colors

Query Builder options 120

colors/fonts

color, editors 114

column mapping

foreign keys, Sybase 527

columns

cluster 490

deleting statistics 592

dimension 434

distinct values in 452

distribution key 434

dropping unused 599

filtering for materialized view logs 501

full-text indexes 290

indexes, Oracle 497

managing, DB2 LUW indexes 426

managing, DB2 Z/OS indexes 446

MySQL foreign keys 323

MySQL tables 326

return, DB2 functions 425

summary, tables/views 664

tables, DB2 LUW 434, 452

unique keys editor, Sybase 538

updating statistics, Sybase 682

view statistics 681

views, SQL Server 484

comma-delimited file type 739

Command Line

ETSBackupConsole.exe 1704

commit memory/limit ratio 1399, 1534

commit, stop database option 671

committed transactions 1388

communication

inter-node, multipartition environment 1528

compact

shrink option 670

Compatible Level setting 462

compile options 559

compiled objects, hiding text 613

compiler directives 726

composite limit 506

Compress Backup 808

Compress setting 434

COMPRESSED

row format 325

compressed rows

percentage of 453

concat null yields null 284, 462

17 12 concurrent licenses

checkout, offline usage 15 selecting at startup 15

conditions

check constraint 522

check constraints, SQL Server 461

check contraints, DB2 LUW 421

check contraints, Oracle 489

event monitor WHERE 422 configuration parameters, DB2 LUW 422

configured size, data cache pool 525

confirmation dialogs

data editor options 101

connect string, database links 492

connect time 506

CONNECTED disk group state 334

connecting to the instance 617

connection entries

utilization 1523

connection memory 1347

connections

event monitor, event type 230, 423

high watermark statistic 1499

high watermark, concurrent 1503

options/preferences 100

packages 447

since database activation 1503 terminated, statistic 1503 total current 1503

constraints

table, DB2 LUW 435

tables, Sybase 537

consumers 682

containers

details 1491

inaccessible 1447

mangaing for tablespace 436

CONTAINS SQL function setting 430

context switches

per second 1137, 1295, 1407, 1542

task 1334

contiguous file creation 618

continue nodegroup redistribution option 637

Control Files 160

control files

displayig information in 623

CONTROL, DATAFILE, ONLINELOG, ARCHIVELOG,

TEMPFILE, BACKUPSET, PARAMETERFILE ASM

template 336

Controller Number 523

convert tables object action 576

COPY CORRUPTION 623

copy end of line options 113

Copy index setting 446, 456

copy operations

object names 577

objects, based on existing 582

schema 577

Copy primary key setting 449

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

copy read hits 1142, 1417, 1551

COPY status code 29

Copy To Copy operation 577

CPU

parsing percentage 1159

per call profile setting 506 per session profile setting 506

percentage busy 1330

percentage time working 1214

top application 1505

top process 1134, 1166, 1339, 1405, 1539

utilization statistic 1294

create alias object action 580

CREATE FUNCTION 390

Create Like 582

Created setting

packages 503

Creating

Space Management Job 1608

Creating a Recovery Operation 810

Creating Objects 221

current

object blocks 1061

response time 1188

workload 1187

current waits 1174

CURRENT_TIMESTAMP pseudocolumn 365

CurrentData package setting 447

Cursor Blocking package setting 428

cursor close on commit 284, 462

cursor management, SQL Agent 281

cursors

open 1160

cycle numbers, IBM LUW sequences 431 cycle numbers, sequences 431

Cycle When Reach Max/Min setting 431, 509

D

daily archive log summary 1098

DASD storage 453

data

extracting as xml 608

importing from external source 888

selecting all from a table 664

Data Access Server setting 475

Data Blks/Key

indexes 497

primary keys 504

unique keys 517

data block storage

clusters 490–491

materialized view logs 501

materialized views 500

unique keys 517

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

I NDE X data cache

hit ratio 1328

searches 1354

see also objects, database

summary/details/statistics 1348

support for 165

data caches

binding objects to 386

caching strategy 385

creating, Sybase 384

editing, sybase 525

DATA CAPTURE NONE/CHANGES 453

data capture option 427

Data Dictionary

role usage 108

data dictionary

viewing usage permission 107

Data Editor

Time Functions 894

Data editor

Calendar 894

Data Editor Filter 893

Date Functions 894

Date/Time Format Builder 894

Edit Window 891

Editing Date and Time Functions 894

Editing Date/Time 894

execution mode 101

filter 893

Modifying Criteria 893

options/preferences 99

SQL Window 891

Toolbar 892

type support 893

data editor

default column value handling 899

Data Export

Data Export Wizard 815

Data Export Wizard 815

Panel 1 816

Panel 2 816

Panel 3 817

Panel 4 818

Panel 5 818

Panel 6 819

Panel 7 819

Data Export Wizard for IBM DB2 for Windows/Unix

Panel 1 781

Panel 2 782

Panel 3 784

Panel 4 784

Panel 5 784

data files

attaching 555

detaching 592

Data Import 820

Data Import Wizard 821

1713

I N D E X

Data Import Wizard

Panel 1 821

Panel 2 821

Panel 3 822

Panel 4 823

Panel 5 824

Panel 6 824

Panel 7 825

Panel 8 825

Data Import Wizard for IBM DB2 for Windows/Unix

Panel 1 785

Panel 2 786

Panel 3 786

Panel 4 787

Panel 5 787

Panel 6 787

Panel 7 788

Starting 785

Data Load 784

Data Load Wizard 785

Panel 1 799

Panel 2 800

Panel 3 800

Panel 4 800

Panel 5 801

Panel 6 802

data map hits 1142, 1417, 1551

Data Pages setting 467, 473, 482, 529, 531, 539

data sources

export/import 139

Data Unload Wizard

Panel 1 797

Panel 2 797

Panel 3 798

Panel 4 798

Panel 5 798

Starting 797

Database Backup Wizard 805

Starting 804

DATABASE BLOCK CORRUPTION 623

database devices

capacity/growth statistics 991

creating, Sybase 382

editor, Sybase 523

mirroring 618

moving transaction logs 622

refitting 638

reinitializing 639

see also objects, database

support for 161

unmirroring 678

DATABASE INCARNATION 623

database links

creating, Oracle 333

editor, Oracle 492

see also objects, database

support for 161

Database Manager 802

monitor heap usage 1525

Opening 803

Database Monitor 764

All Locks Tab 773

Blocking Locks Tab 773

Database I/O Summary Tab 777

File I/O Summary Tab 778

Last 50 Backups Tab 777

Locks Tab 771

Opening 765

Processes 770

System I/O Summary Tab 776

Top SQL Cache Tab 777

Top Twenty SQL Tab 778

User I/O Summary Tab 777

Viewing Session Details 769

Wait Events Tab 778

Waits Tab 777

Database Object Finder 150

Database partition Group table setting 434

Database Restore Wizard

Last Panel 815

Starting 810

Database Search

Results 843

Database Search Wizard 842

Panel 1 842

Panel 2 843

database triggers

creating, SQL Server 285

editing, SQL Server 463 enabling 463

enabling/disabling 562

FOR/AFTER argument 285

support summary 162, 204

supported events 285

databasemanager configuration file parameters 422

17 14 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X databases

analysis, objects/users/size 1377

Backing Up 803

capacity/growth statistics 991

checkpoint 571, 673

configuration settings 1381

creating, DB2 LUW 228

creating, DB2 z/OS 255

creating, MySQL 321

creating, SQL Server 283

creating, Sybase 383

detaching 592

editor, DB2 LUW 422

editor, IBM DB2 Z/OS 442

editor, SQL Server 461

editor, Sybase 524

event monitor, event type 230, 423

growth reports 1004

heap utilization 1440

hiding source text 613

hottest files 1090

index/table details 1379

low on space 1218, 1335

mvings logs between devices’transaction logs

changing database devices 622

number of 1337

offline 1217

open 1346

publishing HTML reports 762

quiescing 627

requiring backup 1276

Restoring 809

same disk 1253

see also objects, database

setting online/offline 667

shrinking 669

size/objects comparison 1279

space statistics 1251

space summary 1370

starting 671 stopping 671

support for 163

suspect 1217, 1333

unquiescing 678

updating statistics 679

with suspect pages 1374

without auto-create 1276

without auto-update 1277

DATAFILE 623

DATAFILE COPY 623

DATAFILE HISTORY 623

datafiles

sizes per tablespace 1110

top fragmented 1107

DATAGUARDCONFIG ASM template 336

DATALINK integrity 666

DATAPAGES 536

Datasource

Edit Registration 125

Register 125

Datasource Catalog 132

Datasource Explorer 21

basic viewing/organization options 22

Blocking Locks 29

Configuration Node 37

Connections 40

Databases Node 24

DBRM Node 36

DDF 40

Displaying 44

filtering tree view 41

Image Copies 28

Instance Node 25, 27

Lock Node 28

options/preferences 99, 106

Organizing 22

Parameters 40

Performance Node 27

Plan 35

Processes Node 28

Server Node 36

Storage Node 39

Subsystem Node 40

Traces Node 33

Datasource Groups

Changing 134

Removing 143

Datasources 131

Auto-Discover 134

Connecting 135

Discovering 134, 136

Modifying 137

Properties 141

Registering 150

Selecting 141

datasources

basic viewing/organization options 22

categories 144

filtering objects/nodes view 41

HTML reports 762

indexing 116

locking ISQL editor to 736

options/preferences 99

specifying catalog storage 102

datatype

pprocedure parameters 451

datatypes

function parameters 445

methods, DB2 LUW 433

sequence 431, 509

user-defined DB@ LUW 438

datatypes, user

editor 539

date formats

data editor 101

Date Time Format package setting 428

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1715

I N D E X date/time format

results, ISQL 121

db chaining 284, 462

DB Protocol package setting 447

DB2 Export API Call 753

DB2 Import API Call 753

DB2GENERAL parameter style 433

DBA views 108

DBAs

data dictionary view pemission 107

dbcreator server role 203

DBETE status code 29

DBID table setting 453

DBINFO option 433

DBInfo parameter 424, 430

DBINFO setting 234

DBMS_JAVA 103

DBMS_JAVA package 103

DBMS_OUTPUT 105

dbo use only 284, 384, 462, 524

DBRMs

see also objects, database

support for 166

DBWR 1097

DDL

creating temporary objects 175, 195, 756

extraction options 103

object extraction 607

opening editor 688

statements executed statistic 1484

ddl in tran 384, 524

DDL triggers

database 285

server 311

DDWQT setting 442

deactivating roles 137

deadlocks 1332

detected, total 1444

event monitor, event types 230, 423

per second statistic 1216

percentage occurred/granted 1385

rollbacks due to 1450

total, statistic 1501

deallocate unused space 591

debugger, SQL

options/preferences 105

options/preferencess 99

Dec31 package setting 447

Decimal Point package setting 447

DEFAULT

row format 325

default binding 483

default to local cursor 284, 462

Default Value setting 452

default values

Oracle columns 365

17 16 defaults

creating, SQL Server 286

creating, Sybase 386

data editor handling 899

database device 523

editor, SQL Server 463

editor, Sybase 526

full-text catalog 289

hiding source text 613

package schema 428

see also objects, database

segment 539

segment name 536

support for 166

tablespace 665

Defer Prepare package setting 447

DEFER(PREPARE) 558

Deferable primary key setting 504

Deferrable/Deferred unique key setting 517

Deferred primary key setting 504

Deferred Write Threshold setting 442

deferred, create bufferpools 421

define directive 726

Definer package setting 428

degee of parallellism 292, 305, 317

Degree package setting 428, 447

degree, bind packages 557

degree, binding packages 558

Degrees settting 500, 502

delayed disk I/O 1355

delete rule 464, 495

delete rule CASCADE delete rule 444

delete rule, update rule 423

DELETE statements

number executed statistic 1484

delete statistics object operation 592

DELETED OBJECT 623

DELETEs

trigger firing on 480

deletes

rows, total 1470

delimited identifiers 100

Density setting 426, 429, 438, 446, 450, 456

dependencies 751, 753

debugger options 105

deprecated features, SQL Agent. 281

DES... algorithms 365

descending scans 1387

DESTROY 559

detach database object action 592

details history, event monitor 230, 423

deterministic option 433

Deterministic setting 234, 424, 430

DEV category 144

Developer Network 13

device container type files

container type 436

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

device fragments 524

device I/O contention 1333

device number, database device 523

device type

backup/dump device 460

device type, dump device 388, 526

devices

fragment summary 1372

growth reports 1005

I/O statistics 1363

number of 1337

space summary 1372

summary/details 1418, 1552

dimensions, columns 434

direct authorities, applications 1512

direct reads/writes

rate 1474 requests 1474

sectors/reads averages 1472

time performing 1475

total reads 1471

total writes 1472

DirectIO 523

directories

creating, Oracle 337

editor, Oracle 492

ETSQLX files 106

Oracle utilities 118

oracle utilities 101

see also objects, database

support for 167

dirty read restarts/requests 1340

disable

SQL Server indexes 593 disable job object action 593

disable keys object action 594

DISABLE TRIGGER 561–562

Disable Triggers 595

disabled environments 558

discarded 1152, 1422

disconnect ASM connection operation 595 disconnecting instance connection 595

disconnects statistic 1503

Discussion Groups 7

D BA RT I SA N XE 2 /9 .0 U SER G U ID E disk

average queue length 1288, 1400, 1411

busy time 1286

database/log on same 1253

device summary 1553

devices summary/details 1554

free space 1147, 1403, 1552

I/O structure contention 1356

I/O time 1411, 1546

outstanding I/O 1355

percent time reads/writes 1128

percentage busy time 1398

percentage time servicing requests 1141

queue length, average 1534

read/write time 1533

space free 1538

space, details 1552

space, total 1538

space, used 1539

total space 1404

total/available statistics 1132, 1291

transfers 1546

transfers per second 1141, 1412

usage statistics 1147

used space 1404

disk groups

checking internal consistency 568

connecting to the ASM instance 617

disabling instance connection 595

dropping disks 677

editing 334, 493

mounting 621

rebalancing 630

support summary 167

DISK MIRROR 618

diskadmin server role 203

DISMOUNTED disk group state 334

Display

Active Windows Dialog 58

Customizing 57

Full Screen Mode 58

Distinct Keys setting 497, 517

indexes 426, 429, 446

primary keys 450, 456

unique keys 438

distinct values, column 452

Distributed Queries 184

distribution key columns 434

Distribution Server setting 475

distribution statistics 681

DMS tablespaces

files closed 1469

low on space 1447

total disk space 1451

utilization > 80% 1483

docking tab colors 51

Documentation 7

DOL scans 1360, 1386

I NDE X

1717

I N D E X domains

SQL Server logins 300

drop by category object action 596

drop clone, object action 597 drop login trigger object action 597

DROP statements

extract/migrate defaults 104

DROP STORAGE clause 676

drop unused columns object action 599

drop Unused object action 598

drop, Java 103

drop, object action 595

DROPPED disk (ASM) state 335

DROPPING disk (ASM) state 335

Dsync 523

dump devices

creating, Sybase 387

editor, Sybase 526

dump utility, MySQL 118

DUMPSET ASM template 336

dupicate keys 467

DWQT setting 442

DYNAMIC

row format 325

Dynamic Rules package setting 447

Dynamic setting 499

Dynamic Sizing settings 508

dynamic SQL

cache statistics 1560

statements/sec statistic 1499

dynamic SQL, flushing 611

E

Edit registration

Datasource 125

Editing

Space Management Job 1608

Editing Result Sets 740

Adding a Column 743

Adding a Row 742

Columns 742

Copying 740

Cutting 740

Deleting a Column 744

Deleting a Row 743

Formatting Result Sets 745

Inserting a Column 743

Inserting a Row 743

Pasting 741

Resizing Columns 744

Resizing Rows 744

Rows 741

Sorting Data 745

Editing SQL Scripts 700

Changing Case 705

Commenting Code 705

Copying and Pasting a Column 707

Copying and Pasting Text 706

Cutting and Pasting a Column 707

Cutting and Pasting Text 707

Pasting SQL Statements 702

Pasting SQL Syntax 701

Selecting a Block of Text 704

Selecting Text 704

Setting Bookmarks 708

Uncommenting Code 705

editor, IBM DB2 LUW 438

17 18 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

editors

aliases, DB@ LUW 420

aliases, DB2 Z/OS 441

aliases, Sybase 522

backup devices, SQL Server 460

bufferpool, IBM DB2 Z/OS 441

bufferpools, IBM DB2 LUW 421 check constraints, DB2 LUW 421

check constraints, DB2 Z/OS 442

check constraints, Oracle 489

check constraints, SQL Server 461

check constraints, Sybase 522

clusters, Oracle 490

database devices, Sybase 523

database links, Oracle 492

databases, DB2 LUW 422

databases, IBM DB2 Z/OS 442

databases, Sybase 461

datbases, Sybase 524

defaults, SQL Server 463

defaults, Sybase 526

directories, Oracle 492

dump devices, Sybase 526

event monitor, IBM DB2 LUW 422

extended procedures, Sybase 527 foreign key, Sybase 527

foreign keys, DB2 LUW 423

foreign keys, IBM DB2 Z/OS 444

foreign keys, MySQL 485

foreign keys, Oracle 495

foreign keys, SQL Server 464

functions, DB2 LUW 424

functions, DB2 Z/OS 444

functions, Oracle 495

functions, SQL Server 466

functions, Sybase 528

groups, IBM DB2 LUW 425

groups, Oracle 496

groups, Sybase 528

indexes, DB2 z/OS 445

indexes, IBM LUW 426

indexes, MySQL 486

indexes, Oracle 496

indexes, SQL Server 466

indexes, Sybase 529

job queues, Oracle 498

libraries, Oracle 499

logins, Sybase 470, 530

materialized query tables 427

materialized view logs, Oracle 501

nodegroups, IBM DB2 LUW 428

options/preferences 113

outline, Oracle 502

packages, IBM DB2 Z/OS 446

packages, IBM LUW 428

packages, Oracle 503

plans, IBM DB2 Z/OS 448

primary keys, IBM LUW 429

primary keys, MySQL 486

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

primary keys, Oracle 503

primary keys, SQL Server 472

primary keys, Sybase 530

primary keys, z/OS 449

procedures, IBM DB2 Z/OS 450

procedures, IBM LUW 429

procedures, Oracle 505

procedures, SQL Server 474

procedures, Sybase 531

profiles, Oracle 505, 507

remote server, SQL Server 474

remote server, Sybase 532

roles, Sybase 533

rollbacksegments, Oracle 507

rules, SQL Server 476

segments, Sybase 535

sequences, IBM LUW 430

sequences, Oracle 508

stogroups, IBM DB2 Z/OS 451

structured types, IBM LUW 431

synonyms, DB2 Z/OS 452

synonyms, Oracle 509

tables, DB2 LUW 434

tables, DB2 Z/OS 452

tables, MySQL 487

tables, Sybase 535

tablespaces, DB2 LUW 436

tablespaces, DB2 Z/OS 454

tablespaces, Oracle 512

triggers, DB2 Z/OS 455

triggers, IBM DB2 LUW 437

triggers, Oracle 515

triggers, SQL Server 480

triggers, Sybase 538

type bodies, Oracle 516 types, Oracle 516

unique keys, DB2 z/OS 456

unique keys, IBM DB2 LUW 438

unique keys, MySQL 486

unique keys, Oracle 516

unique keys, SQL Server 481

unique keys, Sybase 538

user datatypes, DB2 LUW 438

user datatypes, IBM DB2 Z/OS 456

user datatypes, SQL Server 483 user messages, SQL Server 483

users, DB2 Z/OS 457

users, IBM DB2 LUW 439

users, MySQL 487

users, SQL Server 482

users, Sybase 540

views, DB2 LUW 439

views, DB2 Z/OS 458

views, Oracle 519

views, SQL Server 484

views, Sybase 541

EditProcedure table setting 453

email. See also SMTP

Embarcadero SQL Debugger for IBM DB2 911

I NDE X

1719

I N D E X

Embarcadero SQL Debugger for IBM DB2 for Windows/

Unix

Basics

Interface 922

DDL Editor 922

Features 922

Functionality 925, 927

Break 931

Breakpoints 929

Close 931

Go 930

Input Parameters 926

Restart 930

Run to Cursor 928

Step Into 927

Step Out 927

Step Over 928

Interface

Call Stack Window 924

Dependency Tree Window 925

Variables Window 924

Watch Window 923

Options 921

Requirements 913

Using 931

Debugging an SQL Script 932

Opening a Debugging Session 932

Embarcadero SQL Debugger for Sybase 911

Features 912

Functionality 925

Break 931

Breakpoints 929

Close 931

Go 930

Restart 930

Run to Cursor 928

Step Into 927

Step Out 927

Step Over 928

Stop 930

Interface 922

Call Stack Window 924

DDL Editor Window 922

Dependency Tree Window 925

Variables Window 924

Watch Window 923

Options 921

Using 931

Debugging an SQL Script 932

Opening a Debugging Session 932

enable job object action 601 enable keys object action 601

Enable Query Rewrite materialized view setting 500

ENABLE TRIGGER 561–562

Enable Triggers 595

enable/disable job action 599

enabled environments 558

Enabled primary key setting 504

Enabled setting 480

EnableQueryOptimization setting 440

enabling/disabling

check constraints 461

materialized query tables 427

unique keys 517

encoding

bind packages 558

Encoding package setting 447

Encoding Scheme database setting 443

encoding, Java 103

Encrypted setting 480

Encryption

Backup Analyst 1674

encryption

database DDL triggers 285

Oracle columns 365

remote servers, Sybase 397

rules 476

server DDL triggers 311

encryption algorithm 365

Endian encoding

results sets 739

saving scripts 699

end-of-line options 113

enforced foreign key 423

Enforcing Index settings 504

engine

configuration limit 1374

performance statistics 1376

ENGINE= option 576

enqueue waits

number of 1061

sessions with 1163

Enterprise Management Console 45

environments

adding to packages 555

environments, disabled/enabled 558

environments, packages 447

environments, plans 449

Erase primary key setting 449

error messages

SQL Server 317

Error Size setting 496, 505

packages 503

ERROR, check tables results 570

ERROR, repair tables results 656

errors

maximum before abort, ISQL 109

Errors materialized view setting 500

estmate size, object action 603

ETSBackupConsole.exe 1704

ETSQLX files, directory 106

ETStart/ETEnd tags 175, 195, 756

Event Monitors 169

event monitors

editor, IBM DB2 LUW 422

see also objects, database

17 20 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X events

dataabse triggers 285

server triggers 312

trigger 437, 455

Excel file type 739

exchange data, object action 605

exclusive lock escalations 1463

Executing a Recovery Script in the ISQL Window 814

Executing Procedures 688

Executing Scripts 709

Cancelling a Query 712

Compilation Error Tab 711

Executing from Command History 712

Executing Partial Scripts 710

Plan Facility 713

Script Execution Facility 710

Step Execution Facility 712

Token Matching Capability 725

execution

longest running SQL 1561

SQL details 1508

execution plans

waits on 1343

Expected Row Size setting 536

expired password 379

Explain Level/Snapshot/Mode setting 428

Explain package setting 447

explain plans

bind packages 558

table creation 111

Explicit Bind Time package setting 428

Explicit Permissions 905

export

data sources 139

default directory 101

utility directory 118

expression

check constraint 522

expressions

check constraint 442

check constraints, SQL Server 461

extended option, check tables 570, 572

extended option, repair tables action 656

extended procedures

creating, SQL Server 286

creating, Sybase 388

editor, Sybase 527

hiding source text 613

library name 527

number executed, sample interval 1383

see also objects, database

support for 170

extended storage

data I/O statistics 1477

Index I/O statistics 1476

extending a container 436

Extends setting 508

Extent Size tablespace setting 434

extents 491

allocated to tables/indexes 1277

allocating 552

allocating to tables/indexes/clusters

allocating extents 552

assigned to clusters 490

clusters 491

database files at limit 1105

free/save on truncate 675

LOB column usage 511

materialized view logs 501

materialized views 500

objects at maximum 1106

primary key settings 504

rebalance status 1495

unique keys 517

external action option 433

External Action setting 234, 424, 430

external applications 51

External Name setting 424, 430

Externally setting 507

extract operation 751

extract, object action 607

extraction

DDL options 103

schema 751

F

failed auto-param attempts 1262

failed login attempts 506

failed logins, Sybase 398

failure group 335

FAQs 7

fast communication manager

buffer utilization 1523

bufferpool usage 1525

connection entry utilization 1523

low watermarks 1527

message anchor utilization 1523 request blocks used 1523

utilization 1527

fast option, check tables 570

fenced option 433

Fenced setting 234, 424, 430

File Factor setting 473, 481

File Group setting 467, 473, 481

File Growth Rate setting 462

filegroups

capacity/growth statistics 991

full-text catalogs 289

full-text indexes 290

growth reports 1005

next used 622

partitions, SQL Server 304, 312

FILENAME 623

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1721

I N D E X files

auto-saving 113

data editor types 101

datasource stroage 102

growth reports 1005

hottest, database 1090

mdf, ndf, ldf 461

near max size 1253

read/write statistics 1249

SQL logging optionsLogging, SQL

truncating 117

top waits 1091

tracking 113 tracking, ISQL Editor 113

Fill Factor setting 467, 531

filtering, Datasource Explorer tree 41

Final Cal setting 234

final call option 433

Final Call setting 424

Fire On Delete/Update/Insert setting, rule 476

Fire On Insert/UpdateDelete 480

First Key index setting 426, 429, 446

First Key primary key setting 450, 456

First n Keys setting 438

first virtual page, database device 523

FIXED

row format 325

fixed server roles 203

flag, binding packages 558

FLASHBACK ASM template 336

FLASHBACK LOG 623

flashback recycle bin entry action 609

flashback table object action 610

Floating Output Window View 60

flush cache object action 611

flush tables object action 612

flushes, log 1234

fonts

data editor options 101

editor options 114

Qurey Builder options 120

For Data setting 452

For Data table setting 457

FOR VALUES arguments 303

FOR/AFTER argument, database ddl triggers 285

FOR/AFTER argument, server ddl triggers 311

FORCE disk group option 335

FORCE disk mounting option 621

FORCE GENERATED set integrity option 667

force, start database option 671

FORCING disk (ASM) state 335

FOREIGN ARCHIVED LOG 623

17 22 foreign keys

and set integrity 666

creating, DB2 LUW 231

creating, DB2 z/OS 256

creating, MySQL 322

creating, Oracle 337

creating, SQL Server 287

creating, Sybase 389

editor 527

editor, DB2 LUW 423

editor, IBM DB2 Z/OS 444

editor, MySQL 485

editor, Oracle 495

editor, SQL Server 464

MySQL tables 327

see also objects, database

support for 170

table, DB2 LUW 435

Format 687

formatting

ISQL 115

Formatting Code 687

Formatting Result Sets 745

Setting Border Properties 746

Setting Colors 747

Setting Fonts 746

Forums 7

fragmentation

growth reports 1005

fragmented datafiles, top 1107

fragments 524 fragments, database 524

free buffer wait average 1068

free list waits 1062

free packages object action 612

Free Page primary key setting 449

free shared pool percentage 1057

free space

database devices 524

freed memory 1147

freelists

cluster 490

clusters 491

in indexes 497, 511

in unique keys 517

primary key settings 504

freespace scans 1277

FULL ACCESS set integrity option 666

Full Keys

index setting 426, 429, 446

primary key setting 450, 456

unique keys setting 438

full-text catalogs

assocaited indexes 290

basic properties 289

editing 465

rebuilding 631

reorganizing 644

support summary 172

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

full-text indexes

basic properties 290 column specification 290

creating 289

editing 465

enabling/disabling 563

population status 625

fully qualofoed names

synonyms, SQL Server 312

Function Path package setting 428

Function-Based index setting 497

functions

creating synonyms to 583

creating, DB2 LUW 232

creating, DB2 z/OS 257

creating, MySQL 323

creating, Oracle 338

creating, SQL Server 291

editor, DB2 LUW 424

editor, DB2 Z/OS 444

editor, Oracle 495

editor, SQL Server 466

editor, Sybase 528

extract options 175, 195, 756

hiding source text 613

hot 1124

migration options 756

password verification 506

see also objects, database

support for 173

triggers, path 437, 455

wizard, Sybase 390

G

GBP Cache primary key setting 449

Generate Numbers in Order setting 431, 509

generated column, set integrity 667

Gets setting 508

global database statistics 991

Globally setting 507

grace period, password 506

Graph Types 1024

Changing 1024

GRECP status code 29

grid properties, results window 108

group commit sleeps 1334

Group Member database setting 443

Group Menber package setting 447

I NDE X groups

assigning users 541

assigning users to 540

creating, DB2 LUW 236

creating, Sybase 390

editor, IBM DB2 LUW 425

editor, Oracle 496

editor, Sybase 528

quiescing database to 627

quiescing instance to 628

see also objects, database

support for 175

GUARANTEED RESTORE POINT 623

H

H lock duration 29

H lock status 29

hash

cluster type 490

partitions, Sybase tables 537

spinlock contention 1347

hash chain length, average 1384

hash composite 529

hash joins

limited by concurrent use 1531

limited requests, statistic 1521

overflows 1446

small overflows 1456

header

type bodies 516

headers

packages 503

heap size

JDBC option 117 heap size, initial/max 117 heap size, JDBC 117

HEAP storage engine 325

HIDD_ORA_ORU_WIZARDPAGE_PARTITION_PROPER

TIES 520

HIDD_SQS_SSU_DEFAULT_EDITOR_BINDINGS_TAB 4

63

hide text object operation 613

HIGH redundancy 336

high watermarks 1121

concurrent connections 1503

connections, simultaneous 1499

log space 1488

rollback segment setting 508

highlighting. See style

Hiperpool Sequential Steal Threshold setting 442

Hiperpool Size setting 442

historgram steps 682

historical waits 1172

history file details 1516

history, event monitor 230, 423

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1723

I N D E X hit ratios

buffer cache 1212

buffer pool 1076

bufferpool 1438 catalog cache 1438

data cache 1328

data pages 1455

immediate latch 1079

index page 1455

Large I/O 1329

latch 1079

library cache 1082

log cache 1213, 1231

package cache 1439

private workspace 1455

procedure cache 1230

procedure plan 1212, 1329

shared workspaces 1440

host

MySQL users 328

hot/hottest

code 1124

database files 1090

databases 1248

devices 1356

log file 1236

tables 1123

HPSEQT setting 442

HTML

reports, default directories 106

schema/database/object reports 762

template directory 106

HTML file type, results 739

HUNG disk (ASM) state 335

I

I lock duration 29

17 24

I/O

access patterns 1093, 1238

application, top 1504

asynchronous, limit 1373

average bytes per transaction 1140

block requests/reads 1479

busy time 1356

bytes per operation 1410, 1545

delayed, number of 1355

details/summary 1139, 1409, 1544

device contention 1333

device statistics 1363

disk time 1411, 1546

errors, number of 1337, 1356

extents/pages statistics 1242

hot database statistics 1248

large, deferred 1343

large, hit ratio 1329

large, requests 1354

lock activity statistics 1246

maintenance-related operations 1242

network, statistics 1362

open objects 1361

outstanding/pending, maximum 1355

percentage busy 1330

percentage time servicing requests 1141

physical read/write statistics 1240

read/write error count 1236

rollback statistics 1095

SQL activity 1245

SQL Server busy 1214

structure contention 1356

synchronous operations 1445

tablespace settings 437

top applications 1473

top hogs 1359

top process 1135, 1166, 1338, 1405, 1540

top waits by wait time 1237 total read/writes 1237

total reads/writes 1356

transfer rate 1544

user-related object activity 1243

vectored requests/reads 1478

ICOPY status code 29

IDENTIFIED BY clause 365

identity

user datatype 539

Identity Column setting 452

Identity Gap setting 536

identity in nonunique index 384, 524

idle applications statistic 1499

idle server time 1331

idle time 506

IGNORE DELETE TRIGGERS clause 676

Ignore Duplicate Key setting 467, 473, 481

Ignore Duplicate Rows index setting 392, 529

Image Copies 176

immedaite offline mode 565

IMMEDIATE CHECKED set integrity option 666

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X

IMMEDIATE clause 676

immediate latch hit ratio 1079

immediate, create bufferpools 421

import

data sourcs 139

default directory 101

utility directory 118 utility, MySQL 118

Importing Data 888

IN PATH 289

inaccessible tablespaces 1483

inactive 1222, 1339

processes 1383

sessions 1160

threads 32

user processes 1383

inbound packets 1152, 1422

errors 1152

include columns 426

include directive 726

Include Longvar Columns setting 427

incremental refresh 638

index

cluster type 490

Index Buffer Pool database setting 443

Index Level setting 426, 429, 438, 446, 450, 456, 497, 517

Index Level, primary keys 504

Index Page Ratio setting 529, 531, 539

Index Tablespace setting 427

Index Type index setting 426

index, datasource 116

Indexes 176

Partitions 179

Rebuilding 632

indexes

allocating extents to 552

capacity/growth statistics 991

check index/data consistency 569

copy to copy 577

creating, DB2 LUW 236

creating, DB2 z/OS 259

creating, MySQL 324

creating, Oracle 340

creating, SQL Server 292

creating, Sybase 391

deallocating unused space 591

default segment warning 124

disabling, SQL Server 593

editor, DB2 z/OS 445

editor, IBM LUW 426

editor, MySQL 486

editor, Oracle 496

editor, SQL Server 466

editor, Sybase 529

estimating size 603

extents allocated to 1277

level trend 1005

maintenance from insets/updates/deletes 1373

MySQL tables 326

open 1345

pages copied/extended storage 1476

purging, recycle bin 626

rebuilding, SQL Server 635

recreating, missing 601

reorganizing, SQL Server 642

RunStats operation 660

same tablespace indexes warning 123

scans 1386

see also objects, database

segment placing 624

shrinking 670

space summary 1371

spinlock contention 1346

status codes 29

table, DB2 LUW 435

tables, same tablespace 1121

tables, Sybase 536

updating statistics 679

indirect authorities, applications 1512

Indoubt Threads 31

indoubt transactions

list of 1517

number of 1492

INFO, check tables results 570

INFO, repair tables results 656

Inherit Special Registers setting 234, 424, 430

Initial Extent

index setting 497

materialized view log setting 501

primary key settings 504

rollback segment setting 508

table setting 511

unique key setting 517

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1725

I N D E X initial extent

clusters setting 491

materialized view setting 500

initial heap size 117 initial heap size, JDBC option 117

Initial Transactions

cluster setting 491

index setting 497

materialized view log setting 501

materialized view setting 500

primary key settings 504

table setting 511

unique key setting 517

InnoDB storage engine 325

input parameters 451

INSERT statements

number executed statistic 1484

rows, total 1470

INSERT statments

generating from table data 581

INSERTs

trigger firing on 480

instance

Configuration 779

Instance Parameter Configuration

Changing 830

Extracting 831

Generating Report 831

Instance Parameters 26

INSTANCE SPACE RESERVATION 623

instances

Configuration 26

Displaying Version Information 27

materialized view log settting 500, 502

percentage agents working in 1524

quiescing 628

support for 180

unquiescing 678

INSTEAD OF trigger timing 480

internal rollbacks statistic 1501

inter-node communication 1528

interrupts

per second 1129, 1288, 1400, 1535

Intra-partition package setting 428

invalid objects 1120, 1124

invisible

indexes, Oracle 340

IP addresses

Performance Center 119

IS lock state 29

ISAM storage engine 325

isolation level 111

Isolation Level package setting 428

isolation, bind packages 557

ISQL Editor

Shortcut Keys 685

ISQL editor

locking datasources 736

results options 121

17 26

ISQL Window

Using Auto Replace Shortcuts 902

ISQL window

setting query options 715

ISQL Window Status Bar 688

IsValid index setting 497

IX lock state 29

J

JAVA

Java

method type, DB2 LUW 433

load/drop options 103

options/preferences 99

virtual machine options 117

Java Classes 181

java load object action 615

Java Resources 181

Java Sources 182

jConnect 117

JDBC

options/preferences 99, 117

job config files directory 106

Job Queues 182

job queues

creating, Oracle 343

disabling 593

editor, Oracle 498

enabling 601

ru8nning jobs 659

see also objects, database

jobs

problem 1102 queue summary 1102 running, details 1102

SQL agent status 1282

jobs, SQL Agent 297

changing owner 560

creating 293

editing 467

enabling/disabling 599

notifications 294

object support summary 182

single/multiple server 298

starting/stopping 672

viewing history 684

joins

type/index Query Builder restrictions 120

JVM options 117

K

Katakana Charset package setting 447

Keep Dynamic package setting 447

Kerberos authentication 126

key columns, cluster 490

KEY INDEX 290

key size, clusters 490

Keyboard Commands 53

Keyboard Emulation Mode 688

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

keyboard preferences 51

keys

disabling 594

enabling 601

Killing Processes 770

Knowledge Base 7

L

Label table setting 453

language

package setting 447

user messages 483

user messages, Sybase 407

Language Level package setting 428

large I/O

deferred 1343

hit ratio 1329

requests 1354

Last Bind Time package setting 428

last hour performance statistics 1188

Last Modified setting 496

packages 503

LAST RECID 623

Last Runstats setting 453

last transaction log dump 1376

last virtual page, database device 523

latches

and SQL Agent 281

capacity/growth statistics 992

contention 1343

details/statistics 1081

hit ratio 1079 immediate, hit ratio 1079

miss ratio 1056

sleep ratio 1080

top misses 1071

waits/time statistics 1225

layout, query plans 110

lazy writes 1235

Leaf Blks/Key setting 497, 517

Leaf Blks/Key, primary keys 504

Leaf Blocks setting 497, 517

Leaf Blocks, primary keys 504

Leaf Pages setting 426, 429, 438, 446, 450, 456

LEFT, partitojn function range 303

LGWR 1098

libraries

creating, Oracle 343

dynamic/status settings 499 editor, Oracle 499

extended procedure 527

modify path/file name 499

see also objects, database

support for 183

library

MySQL functions 323

library cache

details/statistics 1082

library name, extended procedures 527

licensing 13

offline/online, concurrent 15 selecting at startup 15

lifetime, password 506

line feed 113

line numbers 114

link options 559

Linked Servers 183

linked servers

creating for Microsoft SQL Server 298

see also objects, database

list composite 529

list partitions 537

Little Endian encoding

results sets 739

saving scripts 699

Live Mode execution 101

load average 1128, 1287, 1398, 1533

load averages 1137, 1295, 1407, 1542

load data

default directory 101

Load Data Utility Wizard for DB2 OS390 788

Load Java 103

range- 271

LOB tablespaces

checking data 566

local connections 1526

locale 121

localhost, MySQL users 328

Locality index partition setting 498, 504, 518, 529

locator, as 425

lock connections

default settings 110

lock contention, average 1384

Lock Isolation package setting 447

Lock Scheme setting 536

Lock Size setting 434

lock table object action 616

lock time, account 506

locked objects 1120

locking

rows/pages 293, 467

I NDE X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1727

I N D E X locks

all/blocking details 1175

and SQL Agent 281

applications waiting on 1443, 1513

applications/connections waited statistic 1501

average per second/transaction 1385

average wait time 1443

capacity/growth statistics 992

count, by database/lock type 1390

currently active 1385

details by application 1514–1515

escalations 1444

I/O activity statistics 1246

list utilization 1441

number of timeouts, sample period 1386

number of times escalated 1216

requests required waits 1263

status, state, type, duration 29

timed out 1262

timeouts 1445, 1502

total escalations 1463

type/database details 1273

wait time 1264

Locksize, materialized query tables 427

Log File

Truncating 780

log files

attaching 555

detaching 592

LOG HISTORY 623

log semaphore contention 1342

Logfile 779

Activating Logging 780

Opening 780

Options 780

Truncating 780

logfile

materialized view logs 501

options 780

logfiles

redo log groups 672

Logged Initially setting 427

logging 1253

allocations/writes/flushes 1358

backup of, statistics 1283

cache read hit ratio 1213

cache reads count 1235

cache statistics 1231

capacity/growth statistics 991

database files 461

errors, size/type statistics 1281

flushes count 1234

hottest file 1236

index setting 497

low on space 1218, 1335

materialized query table options 427

materialized view logs

500, 502

near max size 1254

number of errors in 1218

primary key index constraints 504

table setting 510

top waits 1091

unique keys 517

without auto-growth 1254

logging,

SQL options 117

logging, SQL

options/preferences 99

logical reads 506

logiins

remote servers, Sybase 532

login triggers

adding/modifying 551

configured for login 530

dropping 597

login/logout operations

number of successful 1266

LogIndexBuild setting 434

Logins 184

17 28 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

logins

accounting details 530

activating/deactivating roles 137

adding to server roles 301 adding user accounts to database 301

adding/modifying login triggers 551

associating with users 540

bind to database 524

binding to temporary databases 558

changing password 561

copying from existing 582

creating, SQL Server 300

creating, Sybase 392

dropping login triggers 597

editing, SQL Server 470

editor, Sybase 470, 530

extracting with user 103

login trigger configured 530

number of 1134, 1293, 1405, 1539

profile assignment 507

profile limits 506

remote servers, add/modify/drop 474, 532

role permissions 534

see also objects, database

server triggers, SQL Server 311

unbinding from temporary databases 677

LOGONLY cache type 385

logs

configuration parameters statistics 1486

free/used space 1452

high watermark, space 1488

node with smallest 1448

read/write activity level 1491

secondary, allocations 1492

space cleaners triggered 1467

space utilization 1441

usage/space details 1492

LOGSEGMENT 539

logsegment 624

LONG

unicode support, Data editor 893

unicode support, Results editor 748

Long Tablespace setting 427

longvarchar types 748, 893

low watermarks

FCM 1527

LPL status code 29

LSTOP status code 29

M

M lock duration 29

Mailing Result Sets 738

maintenance operations 1373

Make Unique setting 426, 429, 438, 446, 450, 456

manage ASM connection operation 617

mapping

foreign keys, Sybase 527

MySQL foreign keys 323

master database

object creation warning 124

Master View materialized view setting 500

Match Full setting 527

Materialized Query Tables 185

materialized query tables

alias creation shortcut 580

and set integrity 666

copying from existing 582

creating, DB2 LUW 238

editor 427

reloading/refreshing 638

see also objects, database

materialized query tabless

creating synonyms to 583

Materialized View Logs 187

creating, Oracle 349

materialized view logs

editor, Oracle 501

see also objects, database

materialized views

creating synonyms to 583

creating, Oracle 344

see also objects, database

support for 186

mathc full 527

Max Extents

index setting 497

materialized view log setting 501

primary key settings 504

rollback segment setting 508

table setting 511

unique key setting 517

Max Row Size setting 482

Max Size of Non-Leaf Index Row setting 482

Max Transactions

index setting 497

materialized view log setting 501

primary key settings 504

table setting 511

unique key setting 517

MAXDOP 292, 305, 317

Maximum

errors before abort, ISQL 109

maximum extents 491

maximum extentsmaterialized views 500

Maximum Rows Per Page setting 531, 536, 539

maximum transactions, clusters 491, 500

MDI Tab Swapping 51

MDL read hits 1143, 1417, 1552

medium option, check tables 570

I NDE X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1729

I N D E X memory

allocated to buffer cache 1347

allocated to open databases 1348 allocated to open indexes 1348

allocated to procedure cache 1347 allocated to user connections 1347

application details 1462 application, pool usage 1462

available 1402

available/total statistics 1131

buffer pool, configuration 1078

commit memory/limit ratio 1399

details/summary statistics 1415

freed 1147

freed/destroyed 1416

paged, used 1128

pages, database content 1229

pool, percentage utilization 1463

RAM available 1537

sort ratio 1053

swap available 1537

swap, used 1128

top application 1504

top hogs 1348

top process 1134, 1166, 1339, 1404, 1540

total 1403

total physical installed 1538

total vs target 1229

total/available statistics 1290

virtual, available 1537

Memory Manage

capacity/growth statistics 992

memory manager

and SQL Agent 281

MEMORY storage engine 325

Menu Contents 51 menu preferences 51

Menus

Main Menu 47

merge publish 284, 462

MERGE tables, MySQL 327

message anchors

utilization 1523

message integrity/confidentialty 397

messages

SQL Server 317

messages, language 483

methods

adding/editing,structured types 433

Microsoft SQL Server Agent 38

migration

default options 118

operation 753

options/preferences 99

migration, schema 753

17 30

Minimum Extents

index setting 497

materilized view log setting 501

primary key settings 504

rollback segment setting 508

table setting 511

unique key setting 517

minimum extents

cluster setting 491

materialized views setting 500

mirror object action 618

MIRROR redundancy 336

mirroring database devices 523

missing indexes, recreating 601

MIXED cache type 385

Mixed Character Set package setting 447

Mode

unmirroring database devices 678

Mode materialized view setting 500

MODIFIED SQL DATA functionn settting 430

Modify Cluster Column 332

modify conflicts 1333

modify recovery operation 619

modify statistics operation 620

monitor heap

percentage of, database manager usage 1525

mount disk groups operation

ASM

mounting disk groups 621

MOUNTED disk group state 334

MRG_MyISAM storage engine 325

MRU replacement 385

MRU Replacement Strategy setting 392, 529, 536

Msg_text , check tables results 570

Msg_text , repair tables results 656

Msg_type , check tables results 570

Msg_type, repair tables results 656

MTTR 623

Multi-node Bound package setting 428

multi-part names

synonyms, SQL Server 312

multipartition environment, inter-node

communication 1528

Multithreading 45

mutual authentication 397

MyISAM storage engine 325

MySQL

utilities options/preferences 99

utility options/preferences 118 mysqldump 118 mysqlimport 118

N

NCHAR

unicode support, Data editor 893

unicode support, Results editor 748

nchar

unicode support, Data editor 893

unicode support, Results editor 748

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

NCLOB

unicode support, Data editor 893

unicode support, Results editor 748

network

delays/errors, number of 1357

I/O statistics 1362

output queue length 1289, 1400

statistics 1149

network output queue length 1535

New Datasource

Register 125

Next Extent

primary key settings 504

Next Extent setting 497, 501, 508, 511, 517

next extent, clusters 491

next extent, materialized views 500

next used filegroup action 622

NO ACTION delete rule 444

NO ACTION delete/update rule 423

NO ACTION, MySQL foreign key 322

NO BOM/ENDIAN encoding

results sets 739

saving scripts 699

no chkpt on recovery 384, 524 no free space acctg 384, 524

No Sort index setting 497

No Sort unique key setting 517

NO SQL function setting 430

No. of Block Pages setting 227

noclear sysmon option 1028

NODEFER(PREPARE) 558

nodegroups

associating with bufferpools 421

creating, DB2 LUW 240

editor, IBM DB2 LUW 428

redistributing data 637

see also objects, database

support for 187

tablespace default 437

nodes

filtering 41

smallest log 1448

NOFORCE disk group option 335

NOFORCE disk mounting option 621

non-clustered index, same segment warning 124

NONE update/delete rule 464

nonuniique 426

nonunique index type 497

nonunique indexes

stopping updates 594

Norely primary key setting 504

NOREPAIR clause, disk groups 568

NORMAL disk (ASM) state 335

normal offline mode 565

NOT ENFORCED option 423

Not For Replication setting 464

notifications

operator-associated 302

notifications, SQL Agent 294

NoValidate index constraint status 504

NSU lock state 29

ntext

unicode support, Data editor 893

unicode support, Results editor 748

num_freqvalues 681 num_quantiles 681

Number of Extents unique key setting 517

number, user message 406

NUMBLOCKPAGES 227

numeric roundabout 284, 462

NVARCHAR

unicode support, Data editor 893

unicode support, Results editor 748

nvarchar

unicode support, Data editor 893

unicode support, Results editor 748

nvarchar(max)

unicode support, Data editor 893

unicode support, Results editor 748

NVARCHAR2

unicode support, Data editor 893

unicode support, Results editor 748

O

OAM Page Ratio setting 529, 531, 539

OBID table setting 453

object editors

max per open operation 107

Object Status trigger setting 437, 455

object types

creating, Oracle 375

I NDE X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1731

I N D E X objects, database

associated with users 540

at maximum extent 1106

copying names 577

creating 221

dropping 595

editors 419

extracting DDL 607

extraction 751

filtering from tree view 41

growth reports 1005

invalid 1120, 1124

locked 1120

migration 753

no room to expand 1106

open 1345, 1361

owning user, DB2 Z/OS 457

problem 1060

publishing HTML reports 762

reloads 1069

segments, associated 535

space usage details 1518

suspect 1380

tablespace details 1493

tablespace-associated 437

transferring ownership 674

user dependencies 439

viewing/organization options 22

offline

database setting 284, 462

license usage 15

number of databases 1217

number of tablespaces 1107

tablespace status 565

OFFLINE RANGE 623

offline, setting databases 667

OLE methods 433

OMF

Oracle Managed Files 147

ON ALL SERVER argument 311

ON DATABASE argument 285

ON DELETE

MySQL foreign key 322

ON FILEGROUP 289

ON UPDATE

MySQL foreign key 322

OneNote style tabs 51

online

setting databases 667

tablespace status 565

Op, check tables results 570

Op, repair tables results 656

open cursors 1160

open databases and objects 1345

open databases memory 1348 open indexes memory 1348

Operative package setting 447

17 32 operators, SQL Agent

creating 301

editing 471

notification-associated 302

object support summary 188

Optimal Size setting 508

Optimization Hint package setting 447

optimization hints, bind packages 558

optimization, view queries 439

optimize tables object action 623

options (application) 99

options/preferences

Datasource Explorer 106

datasource indexing 116

Java 103

JDBC 117 logging 117

migration 118

Performance Center 119

results (ISQL) 121

results window grid 108

semantic validation 116

SMTP 122

space analyst 123

Oracle

Data Dictionary usage 108

global database statistics 991

utilities options/preferences 99

Oracle job queue 498

outbound packets

discarded 1151, 1422

errors 1152

outlines

creating, Oracle 351

editor, Oracle 502

reassigning categories 629

see also objects, database

support for 188

outln_pkg.drop_by_cat 596

outln_pkg.drop_unused 598

output parameters 451

Output Window

Configuring 60

Displaying 61

Docking 60

Hiding 61

maximum entries 107

Messages

Copying 62

Undocking 60

outstanding disk I/O 1355

overflow

catalog cache 1456

hash joins 1446

hash joins, small 1456

records accessed 1446

sorts 1447

Overflow Rows setting 427

Overhead setting 437

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

ownership (objects), transferring 674

P

P lock duration 29

P lock type 29

pack keys 325

package bodies

creating synonyms to 583

see also objects, database

suppport for 190

package cache

hit ratio 1439

usage details (lookups/inserts/overflows) 1460

Package Size package setting 447

Package Source package setting 447

packages

associated plans 448

binding 555

cache, flushing 611

connections 447

creating synonyms to 583

creating, Oracle 351

editor, IBM DB2 Z/OS 446

editor, IBM LUW 428

editor, Oracle 503

freeing 612

rebinding 630

see also objects, database

suuport for 189

packet size 100

packets

collisions/discards/errors 1420

collisions/error/discards 1149

sent/received, number of 1357

transmission statistics 1554

Pad Index setting 467, 473, 481

page activity 1228

page faults

per second 1130, 1401

per second statistic 1289

per second, statistic 1535

Page Fetch Pairs setting 426, 429, 446, 450, 456

page settings

tablespaces 437

Page Size tablespace setting 434

Page Stealing Algorithm setting 442

Page Writes package setting 447

paged memory

available 1290, 1402

total 1403

total/available statistics 1290

paged memory available 1537

pages

bufferpool size 421

copied, extended storage statistic 1476–1477

hit ratio 1455 index, hit ratio 1455

locking 293, 467

number of, table 453

read/write logged 1445

reorganizations, number of 1446

splits 1277, 1375

pages (memory)

checkpoint, flushed 1235

database content 1229 life expectancy 1229

read/write statistics 1233

Pages Reserved setting 482

paging

in buffer pools 227

in/out statistics 1547

paging (memory)

faults per second 1304

input/output statistics 1145

total/available statistics 1131

used 1128

paralellism, maximum degree of 292, 305, 317

Parallel Degree setting 510

Parallel Execution index settings 497

Parallel Instances setting 510

parallel queries 1383

Parallel Query Option

materialized view logs 500, 502

parallel query option 490

parallel query ratio 1057

Parallel Sequential setting 442

Parameter CCSID setting 234

Parameter Style setting 234, 424

Parameters

Extracting Server Configuration 137

parameters

configuration DB2 LUW databases 422

functions, DB2 424

methods, DB2 LUW 433

procedures, DB2 Z/OS 451

procedures, IBM LUW 430

style option 433

PARITY redundancy 336

parse execute ratio 1054

Parsed Size setting 496, 505

packages 503

parsing

percentage CPU on 1159

partition functions

creating, SQL Server 303

object support summary 191

referencing scheme 304, 312

partition scheme

referencing index 293, 313

I NDE X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1733

I N D E X partition schemes

creating, SQL Server 304

next used filegroup 622

object support summary 191

Partition Type index setting 498, 504, 518, 529

range- 271

Partitioning 368

Composite 368

Hash 368

List 368

Range 368

partitions

associated with bufferpools 421

buffer throughput 1522

capacity/growth statistics 991

editing in DB2 Z/OS tables 453

for materialized query tables 427

indexes

SQL Server 293, 313

indexes, Oracle 498

moving nodegroups 428

primary keys, Oracle 504

tables, DB2 LUW 434

tables, Sybase 537

tablespace 271

truncate operation 676

unique keys, Oracle 518

password

Oracle columns 365

password, Developer Network 13

passwords

changing 561

database links, associated 492

expired 379

profile limits 506

roles, Sybase 398

user, Oracle 519

paster end of line options 113

paths

full-text catalogs 289

Oracle directory object 492

trigger functions 437, 455

PDS Name package setting 447

Percent Free primary key setting 449

Percent Free setting 497, 511, 517

percent free, extents 491, 500

Percent Free,/Used setting 501

Percent Increase setting 497, 501, 511, 517

percent increase, extents 491

percent increase, materialized views extents 500 percent used, extents 491, 500

17 34

Performance Analyst

Copy Template 1034

Datasource Thresholds Maintenance 1032

Licensing 1016

Opening 1015

Product Design 1017

Save 1029

Select Datasource(s) 1033

sp_sysmon noclear 1028

Threshold Properties 1029

Threshold Template Maintenance 1031

Threshold Template Properties 1031

Threshold Templates 1030

Thresholds 1029

Top Sessions 1034

Turning off Alarm Sound 1019

Performance Analyst for Microsoft SQL Server

Tutorial 1199

Performance Analyst for Oracle

Alarm Log 1021

Copy 1024

Details 1025

Manage with DBArtisan 1025

Options 1026

Top SQL 1035

Tutorial 1037, 1425

Performance Center 899

client option 119 connectivity options 119 identifiers 119

Opening within DBArtisan 899

options/preferences 99, 119

Web Client 900

permanent generation size 117

permissions

cascading 905

DBA/data dictionary 107

explicit 905

using roles to grant 906 using roles to revoke 906

Permissions Management 905

PGA

details/statistics 1084

PGSTEAL setting 442

PH1 558

physical memory, total installed 1538

physical name

backup/dump device 460

physical name, dump device 388

Piece Size index setting 446, 456

Piece Size primary key setting 449

pin read hits 1143, 1418, 1552

pinned objects 1082

piped sorts

accepted statistic 1531

rejects 1521

pipe-delimited file type 739

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

PL/SQL Debugger 911

Debugging a Sample Script 942

Sample Script 1 944

Sample Script 2 948

Debugging a SQL Script 932

Debugging Sample Script 2 948

Exclusion List 920

Functionality 925

Breakpoints 929

Close 931

Go 930

Input Parameters 926

Pause 931

Restart 930

Run to Cursor 928

Step Into 927

Step Out 927

Step Over 928

Stop 930

Interface 922

Call Stack Window 924

Dependency Tree Window 925

Variables Window 924

Watch Window 923

Options 921

Using 931

Opening a Debugging Session 932

PL/SQL Profiler

Functionality 954

Clear Profile Table 958

Flush 955

Run Detail 956

Run Summary 956

Start 955

Stop 960

Unit Detail 958, 960

Unit Summary 957

Requirements 953

Setting Up 953

Using 960

Sample Session 962

placement, databases 524

Plan Cache, SQL Agent 281

plans

editor, IBM DB2 Z/OS 448

rebinding 631

see also objects, database

pools

configuring in data caches 525

population status object action 625

port numbers

Performance Center 119

post threshold sorts 1520

PP lock type 29

precision

function parameters 445

parameters, DB2 functions 424

precision, function parameters 445

Precompile Timestamp package setting 447

D BA RT I SA N XE 2 /9 .0 U SER G U ID E precompiles

application attempts 1509

precomplie options 559

preferences (application) 99

pre-fetch options 105

Prefetch Size setting 437

prefetch strategy 385

Prefetch Strategy setting 392, 529, 536

prefetch, async 525

prefetchers

time spent waiting for 1470

prelink options 559

primary

unmirror option 678

primary keys 591

creating, DB2 z/OS 264

creating, MySQL 324

creating, Oracle 352

creating, Sybase 395

editor, IBM LUW 429

editor, MySQL 486

editor, Oracle 503

editor, SQL Server 472

editor, Sybase 530

editor, z/OS 449

see also objects, database

support for 192

table, DB2 LUW 435

Primary Space Allocation 449

prinmary keys

creating, DB2 LUW 240

priority changes, total 1386

private SGA 506

private sort memory 1525

private workspaces

hit ratio 1455

privileged mode

percent time threads in 1136

percentage time processes in 1406

thread execution time 1541

thread time in 1294

privileges

Deny Privileges From 908

Grant Privileges 906

Revoke Privileges To 908

problem jobs 1102

problem objects 1060 problem tablespaces 1060

procedure cache

details 1231

hit ratio 1212, 1230

memory currently allocated 1347

percentage used 1225

summary/details/statistics 1230, 1351

used space 1224

procedure plans

hit ratio 1329

Procedures 194

I NDE X

1735

I N D E X procedures

aged out of cache 1344

building 559

creating for Oracle 354

creating synonyms to 583

creating, DB2 LUW 241

creating, DB2 z/OS 266

creating, Oracle 354

creating, SQL Server 306

creating, Sybase 395

details by user 1395

editor, IBM DB2 Z/OS 450

editor, IBM LUW 429

editor, Oracle 505

editor, SQL Server 474

editor, Sybase 531

extract options 175, 195, 756

hiding source text 613

hot 1124

migration options 756

number executed, sample interval 1384

reads from disk 1341 requests (execution) 1341

requests from disk 1353

see also objects, database

processadmin server role 203

processes 1339

active 1339, 1383

active users 1222

bottlenecks, top 1500

context switches 1542

currently blocked 1261

currently running 1293

inactive 1339

inactive users 1222

inactive, user 1383

internal executed, sample interval 1384

number of 1134

number on server 1405 top CPU 1134, 1339, 1389, 1405

top I/O 1135, 1338, 1389, 1405, 1540 top memory 1134, 1339, 1389, 1404, 1540

top, CPU 1539

top, statistics 1166

total on server 1539

workload-based statistics 1064

processor

context switches per second 1137

percent time working 1128

percent time, user mode 1136

percentage busy time 1398

percentage time working 1287, 1533

queue length 1130, 1289, 1401, 1536

queue, number of threads 1130

speed 1131, 1289, 1401, 1536

threads in queue 1535

type 1131, 1536

PROD category 144

profiles

creating, Oracle 355

editor, Oracle 505, 507

see also objects, database

support for 195

user-associated 519

profiller

options/preferences 105

PRUNE set integrity option 666

PSRBD status code 29

public, database device 492

Publication Server setting 475

published 284, 462

Publisher/Subscriber setting 475

purge recycle bin action 625

purge recycle bin entry action 626 purging, recycle bin 626

Q

QA category 144

Qualifier package setting 447

queries

builder options 119

eligible to run parallel 1383

optimization for views 440

optimization, DB2 LUW views 439

optimization, MQTs 427

options, introduced 715 options, setting 715

options, when sent 716

parallel, busy ratio 1057

sample, response time 1373

query

optimization, table refresh 638

Query Buiilder

Auto Join options 120 code generation options 120 display/style options 120 execution options 120 syntax check options 120

17 36 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X

Query Builder

Adding a Join 876

Auto Join Properties 858

Auto Joins 878

Auto Layout 878

Building a CREATE VIEW Statement 869

Building a DELETE Statement 868

Building a Query 865

Building a SELECT Statement 866

Building an INSERT Statement 867

Building an UPDATE Statement 867

Column Properties 859

Creating a Clause 878

Creating a GROUP BY Clause 883

Creating a HAVING Clause 884

Creating a WHERE Clause 879

Creating an AND Clause 880

Creating an ORDER BY Clause 882

Design 853

Display Options 858

DML Tab 854

Editing Joins 877

Execution Properties 858

Explorer 854

General Properties 858

Getting Started 862

Inserting an AND or OR Clause 881

Joins 874

Editing 876

Inner 875

Left Outer 875

Properties 860

Self 876

Keyboard Commands 857

Moving Additional Tables to the SQL Diagram

Pane 872

Moving Columns in the SQL Statement Tree 885

Moving Tables 871

Moving Tables and Columns in the SQL Statement

Tree 885

Moving Tables and Views 872

Moving Tables in the SQL Statement Tree 885

Opening Queries 887

options/preferences 99

Removing a Join 876

Results Tab 855

Saving Queries 887

Saving Queries as XML 887

Schema Change Detection 887

Selecting a Statement 863

Selecting ALL Columns 873

Selecting an Instance or Database 862

Selecting Columns 864

Selecting Columns in the SQL Diagram Pane 864

Selecting Columns in the SQL Statement Tree 865

Selecting DISTINCT Columns 874

Selecting Tables 871

Setting Column Properties 859

setting options/preferences 119

SQL Diagram Pane 855

SQL Statement Pane 855

SQL Tab 855

Statement Properties 857

Subqueries 885

Syntax Checker 886

Table Properties 859

Table Shortcut Menus 856

Tables in the SQL Diagram Pane 871

Tables/Views Tab 854

Toolbar 855

Using 861

Using Data Editor with Query Builder 888

View Properties 859

Working with Tables in the SQL Diagram Pane 871

Workspace Window Options 853

Query Optimization package setting 428

Query Plan Facility 713

query plans

default display type 110 default layout 110

query rewrite, materialized views 500

queue length, average 1288

quick option, check tables 570

quick option, checksum tables 572

quick option, repair tables action 656

quiesce database action 627

quiesce instance action 628 quiesce tablespace object action 628

quiesces

table quiescers 1494 tablespaces list 1494

quotas, user 513

quoted identifier 284, 462

quoted identifiers 100

R

R lock status 29

R lock type 29

RAM

available 1290, 1537

total/available statistics 1290

range

partition functions 303

range partitions 537

range-hash/list composite 529

ratios

reads/writes 1476

RBDP, status code 29

RBDP* status code 29

read

bytes read from disk 1297

read access

materialized query tables 638

read only 284, 384, 462, 524

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1737

I N D E X

reads 1141

activity level, log 1491

async ratio 1480

average disk queue requests 1400

average queue length 1297

average queued 1534

block I/O requests 1479

byte count 1248

bytes per transaction 1140

disk time 1533

elapsed time 1297

error count 1236

logical 506

number of 1336, 1356

number of physical 1353

paging statistics 1233

physical I/O statistics 1240

physical, per second 1248

procedure requests from disk 1353

queued requests average 1129

ratios, writes 1476

rows, total 1471

total count 1237

transfer rate 1139

transfers per second 1141

vectored I/O requests 1478

READS SQL DATA function setting 430

reassign by category object action 629

rebalance disk group operation 630

rebalance status 1495

REBIND 559

rebind package 630

rebind plans 631

rebinds

internal, count 1450

number attempted statistic 1500

REBUILD 559

rebuild

SQL Server objects 635

rebuild full-text catalogs action 631

Rebuild Index 632

rebuild outlines object action 635

RECID 623

recompilations

triggered per second 1264

recompile object action 636

recompute statiistics 467

records

maximum length 453

overflowed, accesses to 1446

recover tables operation 609

RECOVERY DESTINATION 623

Recovery Status setting 437

Recovery Wizard 809

RECP status code 29

recursive triggers 284, 462

17 38 recycle bin

displaying contents 196

enabling/disabling 602

flashback (recover) tables 609

object support summary 196

puging tables/indexes 626

purge options 625 purging entire 625

status of 602

redistribute object action 637

REDO LOG 623

redo log

daily archive 1098

generated, in bytes 1109

space wait time 1070

space waits 1069

wastage 1099

redo log groups

checkpoints 673

see also objects, database

support for 197

switching logfiles 672

REDO THREAD 623

reducing a container 436

Reducing the size of Microsoft SQL Server Restores 809

redundancy, ASM templates 336

redundancy, disk groups 334

REF CURSOR

Display in ISQL Window 685

referential contraints

tablespaces, checking 566

refit object action 638

REFP status code 29

Refresh Method materialized view setting 500

refresh table object action 638

refresh, materialized query tables 427

registration code 13 registration, product 13

registry

datasource storage 102

reinitialize object action 639

RELAXED polcy, caches 385

RELDP status code 29

Release Bound package setting 447

reloads, object 1069

Rely primary key setting 504

Rely unique key setting 517

remote connections 1526

remote servers

adding logins 532

creating, SQL Server 307

creating, Sybase 396

editor, SQL Server 474

editor, Sybase 532

see also objects, database

support for 197

REMOVABLE RECOVERY FILES 623

rename action style 108

Reoptvar package setting 447

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X

reordering parameters 424

reorganization, tables

attempts 1495

attributes 1496 status, current 1496

reorganize

SQL Server objects 642

reorganize full-text catalogs action 644

Reorganize Tablespace 649

REORP status code 29

REPAIR clause, disk groups 568

repair tables object action 656

Repairing Backup Analyst 1663

Replacement Strategy setting 511

replication

check constraints 461

materialized view logs 501

replication throughput details 1285

reports

Capacity Analyst 1004

HTML (schema/databases/objects) 762

request blocks

currently used, fast communication manager 1523

requests, dirty read 1340

Reserve Page Gap setting 392, 529, 531, 536

Reserved Psges setting 467, 473, 529, 531, 539

Resize 744

resizing a container 436

Resource Cost 832

Resource Limit Wizard

Last Panel 837

Panel 2 836

Panel 3 837

Starting 835

Resource Limits 833

Adding 835

Dropping 838

Editing 838

Editor 838

Scopes 837

Search Parameters 835

Setting Time Ranges 836

Showing 834

Types 837

resource pool statisstics 281

Resource Release package setting 447

response time

current 1188

sample query 1373

responses, SQL Agent 282

restart sequence 659

restarts, dirty read 1340

RESTORE POINT 623

restore point 610

Restoring Databases 809

Restoring Microsoft SQL Servers 809

RESTP status code 29

RESTRICT delete/update rule 423

RESTRICT WHEN DELETE TRIGGERS clause 676

RESTRICT,MySQL foreign key 322

RESTRICTdelete rule 444

RestrictDrop setting 434

RestrictDrop table setting 453

Result Sets

Closing 739

Editing 740

Formatting 745

Mailing 738

Saving 739

Saving as XML 739

results (ISQL) options 121

Results editor

closing a result set 739 closing a result window 739

configuring 736

editing result sets 740

exporting data 737

mailing a result set 738

opening result files 692

read-only mode 738

saving results 739

status bar 738

type support 747

results window

grid options 108

options/preferences 99

results, SQL

format options 121 window/file/set options 121

return values

MySQL functions 323

returns

column, DB2 functions 425 scalar, DB2 functions 425

returns, functions 444

reuse max, password 506

REUSE STORAGE clause 676

reuse time, password 506

Reverse index setting 497

Reverse primary key setting 504

reverse scans, indexes 426

Reverse unique key setting 517

Right Outer Joins 875

RIGHT, partition function range 303

RMAN CONFIGURATION 623

RMAN STATUS 623

RO status code 29

Roles 198

roles

activating/deactivating 137

assigned to logins 470, 530

assigning to users 482

creating, Oracle 358

creating, SQL Server 308

creating, Sybase 398

Data Dictionary usage 108

editor, Sybase 533

see also objects, database

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1739

I N D E X rollback

nodegroup redistribution option 637

Rollback Segments 200

rollback segments

capacity/growth statistics 991

creating, Oracle 359

editor, Oracle 507

see also objects, database

shrinking 669

rollbacks

active, ratio 1117

contention ratio 1055

due to deadlocks, count 1450

I/O statistics 1095

internal, attempted statistic 1501

rollbacks, materialized views 500

roundrobin partitions 537

row

lenght, average 453

Row Compression setting 434

Row Movement property

and shrink operation 670

Row Movement setting 510

Row Organization setting 510

ROWPAGES 536

rows

chained, fetch ratio 1117

deleted, total 1470

growth reports 1005

inserted, total 1470

locking 293, 467

read, total 1471 selected, total 1471

total in table 453

updated, total 1471

RPC Out Server setting 475

rpc secuity model 397

rule binding 483, 539

Rules 201

rules

creating, SQL Server 309

creating, Sybase 399

editor, SQL Server 476

hiding source text 613

see also objects, database

run job object action 659

running jobs detail 1102

runstats

last 453

RunStats Index operation 660

RunStats Tablespace operation 661

rypes

sequences, IBM LUW 431

S

S lock state 29

S lock type 29

SALT, Oracle columns 365

sample query response time 1373

17 40

save point function setting 430

scalar, return 425

scale

function parameter 445

parameters, DB2 functions 424

parameters, IBM LUW procedures 430

Scale setting 452

scan point revalidations 1264

scans, index 1386

schedules, SQL Agent 296

Scheduling

ISQL Window Scripts 847

Microsoft Task Scheduler 848

schema

copying 577

extraction 751

migration 753

publishing HTML reports 762

see also objects, database

schema object operation 664

Schema Path package setting 447

SCN 610

Scratchpad Length setting 234

scratchpad option 433

Scratchpad setting 234

Scratchpad settings 424

screen tips 51

Script Execution Facility

Using 845

Script Files 689

Inserting Files 691

scripts

query options 715

secondary

unmirror option 678

secondary database devices 618

secondary logs

allocations 1492

Secondary Space Allocation 449

sectors

average direct reads/writes 1472

Secure Socket Layer encrytion 129

security model a/b 397

Security Policy setting 434

securityadmin server role 203

Segment Name setting 392, 529, 531, 536

Segment setting 539

segmented tablespaces 271

segments

creating, Sybase 400

editor, Sybase 535

LOB column usage 511

object creation warnings 123

placing indexes/tables 624

see also objects, database

support for 202

Select * From operation 664

select into/bulkcopy/pllsort 284, 384, 462, 524

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

SELECT statements

number executed statistic 1485

rows, total 1471

semantic validation

options/preferences 116

sequences

alias creation shortcut 580

creating synonyms to 583

creating, Oracle 360

editor, IBM LUW 430

editor, Oracle 508

restarting 659

see also objects, database

support for 203

Sequential Pages setting 426, 429, 438, 446, 450, 456

Sequential Steal setting 442

serial number 13

serial write enforcement 618

Server Messages

Printing 61

Saving 61

server roles

adding logins 301

editing, SQL Server 477

support summary 203

server triggers

creating, SQL Server 311

editing, SQL Server 478 enabling/disabling 478

FOR/AFTER argument 311 logon versus other events 311

supported events 312

serveradmin server role 203

servers

configuration settings 1381

configuring 147

connection options/preferences 100

disconnecting 136

extracting configuration parameters 137

idle time 1331

idle time statistic 1214

number of reads 1336

Session Details 769

Session Files

Executing 149

Session Information 833

Session Recording 148

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

I NDE X sessions

activating/deactivating roles in 137

blocked 1162

blocks 1119

defining profile limits 506

in disk sorts 1162

inactive 1160

number active 1159

sort details 1100

time details 1191

top process 1166

top user 1389

waiting 1164

with enqueue waits 1163

sessions Per User setting 506

SET "_recyclebin"= 602

SET DEFAULT update/delete rule 464

set integrity object operation 665

SET NULL delete rule 423

SET NULL update/delete rule 464

SET NULL, MySQL foreign key 322

SET NULLdelete rule 444

set online/offline object operation 667

SET ROLE 137

set undo object operation 668

set... options

defaults 112

Setting Scope Level 767

setupadmin server role 203

shared sort memory

utilization 1442

shared workspaces

hit ratio 1440

usage details (lookups/inserts/overflows) 1461

Shortcut Menus 52

shortcuts 51

Show Only My Objects

default settings 107

Show System Objects

default settings 107

shrink object operation 668

Shrinks setting 508

Side option

unmirroring 678

single user 284, 384, 462, 524

SIX lock state 29

size

user datatype 539

Size setting 452

sleep ratio, latch 1080

Smart Docking 51

SMS tablespaces

filed closed 1469

SMTP

encoding 122

notification identifiers encoding

SMTP email 122 options/preferences 99, 122

1741

I N D E X sort heap space

allocated pages 1530

sort heaps

threshold exceeded 1531

Sort in Tempdb setting 467

sort, index setting 497

sorting

index columns 426, 446

sorts

index option 497

current disk 1101

memory

utilization 1442

overflows 1447

piped, rejects, statistic 1521

post heap threshold 1531

post threshold, statistic 1520

ratio, memory 1053

session details 1100

sessions in, disk 1162

Source SIze setting 496

packages 503

Source Size setting 505

source text, hiding 613

sp_add_alert 280

sp_add_job 294

sp_add_jobstep 295

sp_add_notification 302 sp_add_operator 302

sp_addalias 394

sp_addremotelogin 532

sp_addsrvrolemember 301

sp_adduser 394

sp_bindcache 384 sp_cacheconfig 384 sp_cachestrategy 384

sp_changedbowner 394

sp_hidetext 613

sp_poolconfig 525

sp_remoteoption 532

sp_rename action style 108

sp_start_job 672 sp_stop_job 672

sp_sysmon noclear 1028

sp_tempdb bind 558

sp_tempdb unbind 677

sp_update_job 560, 599

17 42 space

clusters 490

database object summary 1370

database usage details 1251

databases low on 1218

deallocating unused 591

device details 1554

device summary 1372, 1553

device summary/details 1418

disk, details 1552 disk, free 1552

disk, total 1538

fragment summary 1372

free, disk 1538

I/O statistics 1242

indexes/tables summary 1371

logs low on 1218

top user accounts 1115

total used/free 1221

total/available statistics 1062

used, disk 1539

used/free statistics 1337

Space Analyst

Analysis Report 1602

Convert to Dictionary-Managed 1605

Convert to Locally-Managed 1604

Database Devices Tab 1600

Database Overview Tab 1570

Databases Tab 1598, 1600

Datafiles Tab 1570, 1575

Extract 1606

Files/Filegroups Tab 1595

Functionality 1602

Indexes Tab 1570, 1587, 1592

Licensing 1567

LOB data 1573

Map 1607

Map Tab 1596

Objects Tab 1598

Open 1607

Opening 1566

Options 1612

options/preferences 100

options/preferences/defaults 123

Product Design 1569

Reports 1602

Storage Overview Tab 1593

Tables Tab 1570, 1579, 1582

Tablespace Map Tab 1570, 1576

Tablespace Status 1573

Thresholds Options 1612

Space Analyst Expert Guide 1653

Space Analyst for IBM DB2 for Open Systems

Tutorial 1645

Space Analyst for IBM DB2 for Windows/Unix

Tutorial 1645

Space Analyst for Microsoft

Diagnosing Fragmentation 1654

Forwarded Rows 1656

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

Space Analyst for Microsoft SQL Server

Tutorial 1627

Space Analyst for Oracle

Tutorial 1615

Space Analyst for Sybase ASE

Correcting Space-Related Problems 1641

Identifying Storage Structure Problems 1640

Obtaining a Global View of Storage 1638

Pinpointing Out of Space Problems 1640

Proactive Space Management 1643

Tutorial 1637

Using Analysis Reports 1641

Space Management Wizard 1607

space utilization

clusters 491

spacing. See style

special registers 424, 430

specific name, methods, DB2 LUW 433

spinlocks

contention statistics 1345

SQL

activity by application 1508 activity, applications 1508

DDL statements executed statistic 1484

dynamic statements executed 1449

dynamic statements/sec statistic 1499

dynamic, cache statistics 1560

executed during migration 756

execution details 1508

I/O activity 1245

logging options 117

method type, DB2 LUW 433 parameter style 433

parse execute ratio 1054

preprocessing/compiler directives 726

query options 715

recent activity 1156

recompilations/sec triggered 1264

reloads 1069

sample, by user 1395

script directory 106

See also debugger, SQL

statement count 1255

statements executed statistics 1485

statements failed 1449 static statements executed 1449

static statements/sec statistic 1499

top results 1155

top statements (execution) 1153

SQL * Loader

directory 118

SQL * Loader Utility 753

SQL Access Level setting 424, 430

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

I NDE X

SQL Editor 685

Closing a Query Window Tab 697

Closing a Script 700

Editing a Script 701

Executing Scripts 709

Goto 695

ISQL Windows 688

Navigating 695

Opening DDL Editors 689

Opening Script Files 689

Opening SQL Windows 688

Regular Expressions 694

Renaming a Query Window Tab 697

Saving a Script 699

Windows 692

Splitting 692

SQL Error package setting 447

SQL Logging 779

SQL Scripting 685

DDL Editor 688

Results Editor 736

SQL Editor 685

SQL SELECT 753

SQL Server

Clusters 143

Creating or Editing a Backup Operation 804

SQL Server Agent. See Agent, SQL Server

SQL SERVER EVENT ALERT 281

SQL SERVER PERFORMANCE CONDITION ALERT 281

SQL Warn/Math Warn package setting 428

SQL Windows 688

Find and Replace 692

Replacing 694

Searching 693

SQL. See also results, SQL

SSLencryption 129

staging tables 666

STANDBY DATABASE MATRIX 623

Start Database operation 671

start/stop job action 672

static SQL statements/sec statistic 1499

statistics

deleting unnecessary 619–620

RunStats Index 660

updating 679

Statistics Recompute setting 467, 473, 481

statistics.computng, SQL Server indexes 467

status

functions 496

libraries 499

packages 503

procedures 505

tablespaces 565

triggers 515

status bar

ISQL default 113

status codes 29

Status package setting 428

STATUS, check tables results 570

1743

I N D E X

STATUS, repair tables results 656

Stay Resident procedure setting 450

Step Execution Facility 713

step values 682

steps, SQL Agent 295

Stogroups 204

stogroups

creating, DB2 z/OS 267

editor, IBM DB2 Z/OS 451

see also objects, database

specified in tablespace 271

Stop database operation 671

STOP status code 29

STOPE status code 29

STOPLIST 290

STOPP status code 29

Storage

Database Devices 161

storage engine 576

Storage Group database setting 443

Storage Group primary key setting 449

stored outlines

changing categories 560

dropping by category 596

dropping unused 598

rebuilding 635

stored procedures

java, loading 615

STRICT policy, caches 385

String Delimiter package setting 447

stripe

ASM templates 336

Structured Types 205

structured types

adding/editing methods 433

editor, IBM LUW 431

style

see also objects, database

aoto-indent 114 editor 114

ISQL window 115

syntax highlighting options 114 tabs to spaces 114

Subpartition type index setting 498, 504, 518, 529

subscribed 284, 462

Subscription Server setting 475

summary reports, Capacity Analyst 1004

suspect databases 1217, 1333, 1380

suspect pages, databases with 1374

swap memory

available 1131, 1402, 1537

percentage current use 1399

total 1403

total/available statistics 1290

used 1128, 1287

switch logfile action 672

switch online object operation 673

Sybase

performance statistics 991

synchronous I/O operations 1445

synonyms

creating 583

creating, DB2 z/OS 269

creating, Oracle 362

creating, SQL Server 312

editing, SQL Server 478

editor, DB2 Z/OS 452

editor, Oracle 509

see also objects, database

support for 205

syntax

checking durng excute, ISQL 110

checking, Query Builder 120

Syntax Check 687

sysadmin server role 203

SYSDATE pseudocolumn 365

SysEntries package setting 447

sysmon, noclear option 1028

SYSTEM

tablespace, default 665

system

segment 539

segment name 536

system calls

per second 1137, 1407, 1542

per second statistic 1295

system change number 610

System Required setting 426, 429, 438, 446, 450, 456

SYSTEM tablespace

object/user creation warning 124

T

T lock type 29

Tab Menu 51

tab-delimited file type 739

table

last block 1121

Table Status setting 453

Table Tablespace setting 427

Table Type setting 453

17 44 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

tables 626

alias creation shortcut 580

allocating extents to 552

analyzing 554

capacity/growth statistics 991

chained 1118

check for errors 570

checksum 571

column summary 664

copying from existing 582

creating synonyms to 583 creating views from 583

creating, DB2 LUW 245

creating, DB2 z/OS 269

creating, Oracle 363

creating, SQL Server 313

creating, Sybase 400

deallocating unused space 591

default segment warning 124

deleting statistics 592

disabling keys 594

dropping clone 597

dropping unused columns 599

editor, DB2 LUW 434

editor, DB2 Z/OS 452

editor, MySQL 487

editor, Sybase 535

enabling keys 601

estimating size 603

event monitor, event type 230, 423

exchange data, clone 605

extents allocated to 1277

extracting data as XML.XML

extracting data as 608

flashback 610

flushing 612

growth reports 1005

hiding source text 613

high watermark, block 1121

hot 1123

indexes, same tablespace 1121

list of quiescers 1494

lock escalations 1216

locking 616

moving tables in the SQL Diagram Pane 871

optimizing 623

partitioning for Oracle 368

recompiling 636

recover from recycle bin 609

reorganization record 1495

repairing 656

see also objects, database

segment placing 624

selecting all data from 664

shrinking 670

space summary 1371

storage engine 576

support for 206

truncating 674

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

updating statistics 679

with CACHE property 1074

TABLESPACE 623

Tablespace Buffer Pool database setting 443

I NDE X

1745

I N D E X tablespaces

abnormal, count 1448

and materialized views 500

cached blocks 1074

capacity/growth statistics 991

changing status 565

check data 566

check index operation 569

coalescing 572

container details 1491

copy to copy 577

creating, DB2 LUW 248

creating, DB2 z/OS 271

creating, Oracle 369

database placement 422

datafile sizes 1110

datafiles at extent limit 1105

default, setting 665

details, all on database 1489

DMS, total space 1451

DMS, utilization > 80% 1483

editor, DB2 LUW 436

editor, DB2 Z/OS 454

editor, Oracle 512

extent details 514

extents, rebalance status 1495

files closed 1469

for materialized query tables 427

growth/failure prediction reports 1004

highest reads/writes 1468

in indexes 497, 511

inaccessible containers 1447

inaccessible/offline statistic 1483

index creation warning 123

inunique keys 517

low on space

DMS 1447

materialized view logs

501

modify recovery operation 619

modify statistics operation 620

object creation warnings 123

object details 1493

offline 1107

primary key settings 504

problem 1060

purage recycle bin options 625

quiesced statistic 1494

quiescing 628

RunStats Index operation 660

RunStats operation 661

see also objects, database

segment management 514

set undo action 668

space by object type 1110

status codes 29

support for 209

switching online 673

tables/indexes in same 1121

17 46

user default/temporary 519

user quotas 513

tabs

to spaces 114

take checkpoint action 673

tape stacking option 577

target, SQL Agent job 298

targetmap nodegroup redistribution option 637

task context switches 1334

Task Scheduler 848

Technical Requirements 8

Database 10

Hardware 8

Operating System 8

tempdb percent full 1333

templates

ASM disk groups 336

temporary databases 558, 677

temporary object activity 1247

temporary offline mode 565

temporary tables

automatic creation/deletion, extract 175, 195, 756 temporary tables, migration options 756

TEXT

unicode support, Data editor 893

unicode support, Results editor 748

The 561

THREAD INSTANCE NAME MAPPING 623

threads

active sessions 1159

in processor queue 1536

number in processor queue 1535

number, processor queue 1130

percent time in privileged mode 1136

privileged, execution time 1541 user mode, execution time 1541

Threadsafe function setting 424, 430

Threadsafe setting 234

threshold cleaners triggered 1468

thresholds

segments 535

time formats

data editor 101

time-based settings

profile limits 506

timeouts

debugger 105

lock object, statistic 1502

locks 1262

locks, sample period 1386

remote servers, Sybase 397

server connection/query 100

Timestamp package setting 447

timing, trigger 480

timing, triggers 515

tining, triggers 437

Toggle 686

Token Matching Capability 725

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

I NDE X tokens

agents waiting on 1521, 1524

Toolbars 48

toolbars

hiding/displaying 49

introduced 48

ISQL default 113 options/preferences 113

preferences 51

Tools

Code Workbench 900

Data Editor 890

Database Search 842

Embarcadero Products 899

File Execution Facility 844

Find in Files 842

Performance Center Integration 899

Query Builder 852

Scheduling 847

Script Execution Facility 844

SQL Logfile 779

Visual Difference 848

Tools Menu

Customizing 54

Specifying an Argument for a Command 56

top I/O waits 1237

top log file waits 1091

top memory process 1540

top... statistics

bottlenecked events 1164

CPU process 1134, 1339, 1405, 1539

CPU processes 1389

database file waits 1091

fragmented datafiles 1107

I/O hogs 1359

I/O process 1135, 1338, 1405, 1540

I/O processes 1389

I/O waits 1237

latch misses 1071

memory hogs 1348

memory process 1134, 1339, 1404

memory processes 1389

processes 1064, 1166

session bottlenecks 1059

sessions 1389

space, user accounts 1115

SQL details 1154

SQL results 1155

SQL statements 1153

system bottlenecks 1059

workload-based 1292

torn page detection 284, 462

Total Keys setting 426, 429, 438, 446, 450, 456

Total Pages Modified setting 467, 473, 482

total priority changes 1386

Total Rows Modified Since Last setting 482

Total Sections package setting 428

transaction log analysis 1368

transaction log files 461

attaching 555

detaching 592

transaction log writes 1336

transactional analysis 1387

transactions

active 1387

committed 1388

event monitor, event type 230, 423

indoubt, list of 1517

indoubt, number of 1492

per second statistic 1498

transfer ownership 674

transfer rate 1139, 1544

I/O

transfer rate 1410

Transfer Rate setting 437

transfers

disk 1546

transfers per second.disk 1412

transmission

rate/queue statistics 1420

transmission rate statistics 1554

transmission statistics 1149

transparent data encryption 365

triggers

adding login 551

creating, DB2 LUW 249

creating, DB2 z/OS 272

creating, Oracle 374

creating, SQL Server 315

dropping login 597

editor, DB2 Z/OS 455

editor, IBM DB2 LUW 437

editor, Oracle 515

editor, SQL Server 480

editor, Sybase 538

enabling/disabling 561

events 437, 455 function path 437, 455

hiding source text 613

login 530

see also objects, database

support for 211 support for, summary 211

timing 437, 455 type 437, 455

trunc log on chkpt 284, 384, 462, 524

truncate object operation 674

Truncating

Logfile 780

T-SQL Debugger for Microsoft 911

Basics

Interface 922

Requirements 915

Client 918

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1747

I N D E X

Server 915

Features 912, 922

Functionality 925, 927

Break 931

Breakpoints 929

Close 931

Go 930

Input Parameters 926

Restart 930

Run to Cursor 928

Step Into 927

Step Out 927

Step Over 928

Stop 930

Interface

Call Stack Window 924

DDL Editor 922

Dependency Tree Window 925

Variables Window 924

Watch Window 923

Options 921

Using 931

Debugging a Sample Script 934

Debugging an SQL Script 932

Opening a Debugging Session 932

type

columns, DB2 z/OS 452

Oracle columns 365

user datatype 539

Type Bodies 213

type bodies

editor, Oracle 516

types

editor, Oracle 516

parameters, DB2 functions 424

parameters, IBM LUW procedures 430

sequences, IBM LUW 431

triggers 515

U

U lock state 29

UI

Setting Appearance 51

Setting Classic Microsoft Office 97 style 51

Setting Microsoft Office 2003 style 51

Setting Microsoft Office XP style 51

UID pseudocolumn 365

ULC flushes 1359

unbind from temporary database action 677 unbinding logins from 677

UNCHECKED set integrity option 666

undrop disk operation 677

UNICHAR

unicode support, Data editor 893

unicode support, Results editor 748

UNICODE encoding

results sets 739

saving scripts 699

17 48

Unicode support

Data editor 893

Results editor 747

uniform nodegroup redistribution option 637

unique 426

unique auto_identity index setting 384

unique index type 497

unique keys 438

creating, DB2 z/OSS 274

creating, MySQL 324

creating, Oracle 376

creating, SQL Server 316

creating, Sybase 404

deallocating unused space 591

editor, MySQL 486

editor, Oracle 516

editor, SQL Server 481

editor, Sybase 538

editor, z/OS 456

see also objects, database

support for 213

table, DB2 LUW 435

unique setting

indexes 426

UNITEXT

unicode support, Data editor 893

unicode support, Results editor 748

units of work 1450, 1509

UNIVARCHAR

unicode support, Data editor 893

unicode support, Results editor 748

range- 271

UNKNOWN disk (ASM) state 335

UNKNOWN disk group state 334

Unlimited Max Size setting 462

unload data

default directory 101

unmirror object operation 678

UNPROTECTED redundancy 336

unquiesce object operation 678

unused space, deallocating 591

update rule 464

UPDATE statements

number executed statistic 1484

UPDATE STATISTICS 592

update statistics object action 679

UPDATEs

trigger firing on 480

updates

rows, total 1471

usage

user datatypes 539

use FRM file option, repair tables action 656

USE statements

DDL extract options 103

Used Pages setting 467, 473, 482, 529, 531, 539

used space

database devices 524

User Datatypes 214

D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

user datatypes

creating, DB2 LUW 251

creating, DB2 z/OS 276

creating, SQL Server 319

creating, Sybase 405

editor, DB2 LUW 438

editor, IBM DB2 Z/OS 456

editor, SQL Server 483

see also objects, database

user ID, Developer Network 13

user interface preferences 51

user messages

creating, SQL Server 317

creating, Sybase 406

editor, SQL Server 483

see also objects, database

support for 215

user mode

percentage time processes in 1406

user mode thread execution time 1541

user mode, percent time processor in 1294

user mode, processor time in 1136

user processes 1222

USER pseudocolumn 365

USER views 108

user-related I/O operations 1243

users 1383 active, processes 1383

alias definition 522

assigned to logins 470, 530

assigning to groups 528, 541

assigning to profiles 505

changing password 561

copying from existing 582

creating, DB2 LUW 252, 277

creating, MySQL 327

creating, Oracle 378

creating, SQL Server 318

creating, Sybase 408

database links, associated 492

editor, DB2 Z/OS 457

editor, IBM DB2 LUW 439

editor, MySQL 487

editor, Oracle,editors

users, Oracle 518

editor, SQL Server 482

editor, Sybase 540

extracting logins with 103

hiding source text 613

profile assigment 507

purge recycle bin options 625

quiescing database to 627

quiescing instance to 628

see also objects, database

support for 216

tablespace quotas 513

top account space 1115

UT status code 29

D BA RT I SA N XE 2 /9 .0 U SER G U ID E

I NDE X

UTF encoding

results sets 739

saving scripts 699

Utilities 749

Archive Activity 826

Chained Row Analysis 827

Data Export Wizard for IBM DB2 for Windows/

Unix 781

Data Export Wizard for Oracle 815

Data Import Wizard for IBM DB2 for Windows/

Unix 784

Data Import Wizard for Oracle 820

Data Load Wizard for Microsoft SQL Server and

Sybase ASE 799

Data Unload Wizard for Microsoft SQL Server and

Sybase ASE 796

Database Backup Wizard 803

Database Monitor 764

Database Restore Wizard 809

Free Space Deficit 828

Instance Parameter Configuration 830

Logfile 779

Maximum Extent Limits 830

Pinned Code 829

Resource Limits 833

Session Information 833

utility, start database option 671

utilization

FCM 1527

UTRO status code 29

UTRW status code 29

UTUT status code 29

V

Valid package setting 447

Validate index constraint status 504

Validate package setting 447

Validate unique key setting 517

validation, bind packages 557

ValidProc table setting 453

VARCHAR

unicode support, Data editor 893

unicode support, Results editor 748

varchar

unicode support, Data editor 893

unicode support, Results editor 748

VARCHAR2

unicode support, Data editor 893

unicode support, Results editor 748

VCAT 271

VCAT Catalog primary key setting 449

vectored I/O requests 1478

verify function, password 506

Vertical Deferred Write Threshold setting 442

victim page cleaners

percentage times invoked 1466

view

times invoked 1467

creating, Sybase 408

1749

I N D E X

view job history action 684

views

alias creation shortcut 580

column summary 664

creating from a table 583 creating synonyms to 583

creating, DB2 LUW 252

creating, DB2 z/OS 278

creating, Oracle 380

creating, SQL Server 320

editor, DB2 LUW 439

editor, DB2 Z/OS 458

editor, Oracle 519

editor, SQL Server 484

editor, Sybase 541

hiding source text 613

query optimization 440

see also objects, database

support for 218

update statistics, DB2 LUW 681

updating statistics 679

Virtual Address 523

virtual columns 365

virtual machine options, Java 117

Visual Difference

Comparing Files 849

Navigating 850

Opening 849

Options 851

Printing 850

Searching 851

visual style 51

Volatile setting 434

Volatile table setting 453

Volatile, materialized query tables 427

VPPSEQT setting 442

VPSEQT setting 442

VPSIZE setting 442

VPTYPE setting 442

W

W lock status 29

W lock type 29

wait events

capacity/growth statistics 991

wait statistics, SQL Agent 281

wait time

locks 1443

waits

buffer busy, count 1055

current 1174

details, by event 1169

enqueue 1061

file, top 1091

free list 1062

historical 1172

lock requests requiring 1263

log file, top 1091

on execution plans 1343

session, total/wait time percentages 1393

sessions on 1164

system statistics 1169

system, total/wait time percentages 1392

time, locks 1264

top bottlenecks 1215

total, statistic 1501

Waits setting 508

WARNING, check tables results 570

WARNING, repair tables results 656

Warnings

options/preferences 100

warnings

options/preferences 123

Query Builder options 120

wash size 525

wastage, redo logs 1099

WEPR status code 29

WHERE

event monitor condition 422

Windows

Navigating 59

SQL Server logins 300

Without Login setting 482

Wizard

Database Backup 805

Space Management 1607

wizards

functions, Sybase 390

wizards, default directories 106

WMI EVENT ALERT 281

WORKFILE database type 271

workload

current 1187

top... statisitics 1388

workload group, SQL Agent 281

workspaces

private, hit ratio 1455

Wraps setting 508

write access

materialized query tables 638

17 50 D BA RT I SA N XE 2 /9 .0 U SE R G UI D E

writes 1141

activity level, log 1491

async ratio 1480

average disk queue requests 1400

average queue length 1297

average queued 1534

byte count 1248

bytes per transaction 1140

bytes written to disk 1297

disk time 1533

elapsed time 1297

error count 1236

number of 1356

server

number of writes 1336

paging statistics 1233

physical I/O statistics 1240

physical, number of 1353

physical, per second 1248

queued requests average 1129

ratios, reads 1476

total count 1237

transfer rate 1139

transfers per second 1141

Writes setting 508

X

X lock state 29

XML

type support, Data editor 893

type support, Results editor 747

XML file type, results 739

xmltype

viewing as CLOB 110

XTRANSPORT ASM template 336

I NDE X

D BA RT I SA N XE 2 /9 .0 U SER G U ID E 1751

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents