0% found this document useful (0 votes)
5 views40 pages

SQLab Getting Started

The SQLab Getting Started guide provides an overview of SQLab and SQLab Xpert, applications designed for SQL identification, analysis, and tuning for Oracle databases. It outlines the features, installation instructions, and system requirements, emphasizing the importance of tuning SQL statements to enhance application performance. The guide also discusses the challenges of maintaining legacy applications and the benefits of using SQLab for tuning both custom and purchased software.

Uploaded by

dwillai9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views40 pages

SQLab Getting Started

The SQLab Getting Started guide provides an overview of SQLab and SQLab Xpert, applications designed for SQL identification, analysis, and tuning for Oracle databases. It outlines the features, installation instructions, and system requirements, emphasizing the importance of tuning SQL statements to enhance application performance. The guide also discusses the challenges of maintaining legacy applications and the benefits of using SQLab for tuning both custom and purchased software.

Uploaded by

dwillai9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

SQLab
Getting Started
Version 4.5
This guide contains proprietary information which is protected by copyright. The information in this guide is subject to
change without notice and does not represent a commitment on the part of Quest Software. The software described in this
guide is furnished under a license or nondisclosure agreement. This software may be used or copied only in accordance with
the terms of this agreement. No part of this guide may be reproduced or transmitted in any form or by any means, electronic
or mechanical, including photocopying and recording, for any purpose other than the purchaser’s personal use without the
written permission of Quest Software.

2000 Quest Software. All Rights Reserved.


Quest is a trademark of Quest Software.

Quest Software, Inc.


8001 Irvine Center Drive
Irvine, CA 92618

Phone: 949.754.8000
Fax: 949.754.8999
[email protected]
www.quest.com

SQLab and SQLab Xpert are trademarks of Quest Software. Other trademarks and registered trademarks used in this
guide are the property of their respective owners.
SQLab Getting Started
Updated – October 2000
Software Version – 4.5
Table of Contents

Before You Begin .............................................................................................................................................iii


Typographical Conventions....................................................................................................................... iii
Introducing SQLab ............................................................................................................................................1
In This Guide...............................................................................................................................................1
Overview .........................................................................................................................................................2
The Challenge of Maintaining Legacy and Custom Applications ...............................................................2
How SQLab Supports Improved Application Performance ........................................................................3
Analyzing and Tuning Offensive SQL ........................................................................................................5
Tuning SQL Across Multiple Connections .................................................................................................6
Features ...........................................................................................................................................................7
Recon™ (StealthCollect™) Feature............................................................................................................7
Shared SQL Area Analysis..........................................................................................................................7
Multiple Connections ..................................................................................................................................7
SQL Cache Collection and Monitoring .......................................................................................................8
Performance Analysis, Comparison, and Tuning ........................................................................................8
Repository for Benchmarking .....................................................................................................................9
Powerful Built-in SQL Editor .....................................................................................................................9
I/O Bottleneck Resolution ...........................................................................................................................9
Reports ........................................................................................................................................................9
Xpert Add-On Component ........................................................................................................................10
SQLab Integrated with SQL Impact ..........................................................................................................10
Comprehensive Product Integration ..........................................................................................................10
Analyze the Impact of Tuning a SQL Statement .......................................................................................11
System Requirements ....................................................................................................................................12
Hardware ...................................................................................................................................................12
Software ....................................................................................................................................................12

i
SQLab Getting Started

Installing and Starting SQLab ........................................................................................................................13


In This Section ..........................................................................................................................................13
Installing SQLab............................................................................................................................................14
Starting SQLab: Connecting to Your Database Instance...............................................................................16
Creating or Upgrading SQLab Objects on Your Database............................................................................19
Creating the SQLab Objects ......................................................................................................................19
Upgrading the SQLab Objects...................................................................................................................21
Removing the SQLab Objects from the Database .....................................................................................21
Troubleshooting Installation..........................................................................................................................22
Setting Up Background Options ....................................................................................................................29
In This Section ..........................................................................................................................................29
Background Collection Option......................................................................................................................30
About Quest Software.....................................................................................................................................31
In This Section ..........................................................................................................................................31
Overview .......................................................................................................................................................32
Contacting Quest Software ........................................................................................................................32
Quest Technical Support ...........................................................................................................................32
Index ...............................................................................................................................................................A-1

ii
Before You Begin

This section covers the typographical conventions used in the SQLab Getting Started guide. Before
you start using SQLab, it’s important to understand the conventions used in the guide.

Typographical Conventions
The following kinds of formatting in the guide text identify special information.

Formatting convention Type of information

Bold type Menu items, buttons, icons, and field names

Italic type Emphasized words, phrases, and sentences; also book titles
SELECT Code syntax in the text
MessageLog Code syntax examples

iii
SQLab Getting Started

Notes
The following note conventions are used in this guide:

Provides a reference to helpful information elsewhere in the guide.

Provides extra information about a specific feature.

Provides information that will assist you in using a specific feature.

Provides information that may affect whether a specific feature will work as you expect,
or alerts you to a possible adverse situation.

iv
Introducing SQLab

Quest Software’s SQLab and SQLab Xpert are easy-to-use Windows-based applications that provide
comprehensive SQL identification, analysis, and tuning for Oracle databases. SQLab and SQLab
Xpert perform in-depth analysis of SQL activity, allowing the DBA or developer to identify
inefficient SQL statements.

Using SQLab, you can analyze and tune online and batch transactions and the access to individual
tables. The products are especially useful for tuning applications such as Oracle Financials and other
purchased software, where access to the source code is not available. SQLab functionality includes
database reports and features that automatically provide comprehensive assistance with SQL
statement tuning.

For detailed instructions on using SQLab, see the SQLab User’s Guide.
The SQLab features described in this guide also apply in SQLab Xpert.

In This Guide
•= Introducing SQLab
•= Installing and Starting
•= Setting Up Background Options
•= About Quest Software

1
SQLab Getting Started

Overview
SQLab’s key component is its Tuning Lab. The lab facilitates use of standard Oracle tuning
techniques and allows you to execute SQL differently tuned versions of a SQL statement and
compare them. An automatic feature drops four commonly used Oracle hints into your statement and
compares the performance statistics. In the lab, you can “step” through an explain plan that has cost
information per step and automatically describe tables and views. You can obtain context-sensitive
help on operations and tuning advice. You can also examine graphs of multiple executions to
compare response time and other statistics including logical and physical reads.

This powerful analysis and tuning capability allows you to improve the performance of your
programs, stored database procedures and purchased software utilized by an application. You can
examine SQL statements currently cached in the Oracle shared SQL area or you can run a SQL
Collection that finds statements over a set period of time. In addition, SQLab allows you to tune SQL
statements across multiple database connections.

You can trace SQL activity by database object to resolve I/O bottlenecks and detect missing indexes.
You can easily identify how I/O is distributed across and within files and objects, allowing you to
determine the optimal placement for objects across multiple disks.

The Challenge of Maintaining Legacy and Custom Applications


Software developers face many challenges in maintaining aging custom applications and purchased
software. Often the original developers of an application are no longer involved with the code. In-
house knowledge and understanding of the code as well as the original intent, requirements and
expectations for the application may be limited or nonexistent. Some problems may exist with long-
running batch jobs, and programs that may not have been tuned by previous developers (both for
custom and purchased software). In addition, there may be reluctance to modify an application
without knowing the impact of changing imbedded code. When we hire outside consultants to do the
work, the result may be that our staff is not as educated or well informed as needed.

Often, there is insufficient time to rewrite existing production code even though its initial SQL
statements may not be well tuned. It takes time to locate and correct post-implementation problems
such as I/O bottlenecks and performance limitations that emerge after a system is complete.

An application’s performance is governed by the efficiency of its SQL statements. Often, a small
number of SQL statements create most of the database activity and the amount of activity correlates
to the execution path known as Oracle’s explain plan. The amount of work caused by a SQL
statement is directly related to the number of its buffer gets and disk reads.

SQLab allows you to quickly find such problems and tune your system across multiple connections.
Because SQLab is easy-to-use, system administrators and developers who do not have much Oracle
experience can tune a database system using limited support from consultants.

2
Introducing SQLab

How SQLab Supports Improved Application Performance


Using SQLab, you can retrieve SQL statements from the cache using a variety of filtering criteria and
immediately view a comprehensive execution plan. You can display response times for long-running
batch jobs and individual applications. You can also specify criteria to retrieve only the most active
SQL statements as they are executed. You can improve the performance of views by tuning the
offensive SQL statements that use them, or tuning the view itself.

SQLab supports improved application performance by assisting you in finding, analyzing and tuning
offensive SQL in application programs and stored database procedures. SQLab analyzes SQL in both
custom applications and in purchased software. The same approach is used for tuning both purchased
software and custom applications.

SQLab’s analysis and tuning capabilities can be used throughout the development, production, and
post-production phases of a project. The goal of tuning custom and purchased applications is to
improve the performance without adversely affecting the stability of the system. Major tuning steps
include monitoring the database, tuning the database environment, and analyzing and tuning SQL
statements. You can analyze and tune your application’s online and batch transactions and the access
to individual tables.

Tuning Programs
SQLab allows you to tune online and batch programs within an application. Using SQLab you can
find, copy or import the SQL from programs into its lab for analysis and tuning.

Tuning the SQL code in programs should be handled differently depending on whether it is online or
batch SQL. Online programs perform multiple small, random queries and their performance is
measured by response time. In contrast, batch programs perform larger queries less often and their
performance is measured by total throughput time. Online programs join a variety of tables, while
batch programs join specific sets of tables.

For components of a larger batch program, the order of transactions and their operations can affect
performance, even if they perform well on their own. Some programs combine online and batch
transactions. The two types of transactions should be tuned separately, and you can tune both types.
SQLab also allows you to compare execution statistics so that you can find the best tuning strategy.

3
SQLab Getting Started

Tuning Stored Database Procedures


Using SQLab, you can tune packages, procedures, or triggers, by connecting to the database,
importing the desired object, and sending the selected SQL statement to the Tuning Lab. You can
then export the tuned statement to its original position in the file.

To make extracting imbedded SQL from PL/SQL blocks, procedures, packages, functions, and
triggers less confusing, SQLab allows you to execute a single stored code and capture only SQL
resulting from that code.

For editing stored procedures and packages, use SQL Navigator from Quest Software. SQL
Navigator is an integrated server-side SQL & PL/SQL editor for Oracle developers. Contact Quest
Software or visit our web site www.quest.com for more information.

Tuning Purchased Software


SQLab is especially useful for tuning purchased software where you do not have access to the source
code. Performance problems in purchased software are likely to be amplified compared to custom
applications for the following reasons:

•= Purchased software was created for general system requirements—not for the specific
requirements of your system. It was not created for your specific business rules, pattern of usage,
or pattern of growth within your application.
•= Purchased software is created to run on databases other than Oracle. To run on multiple
databases, the software may not take advantage of advanced features in Oracle (like optimizer).

It is important to watch the performance of purchased software as the system that uses the software
grows. You may spend more time on pre-implementation tuning for purchased software than for
custom applications, and you may have less control over changes to the database objects in
subsequent versions.

4
Introducing SQLab

Analyzing and Tuning Offensive SQL


SQLab assists you in finding the most offensive SQL statements. It is important to focus your tuning
efforts on the most inefficient SQL statements in your applications since generally a small number of
SQL statements are responsible for most of the activity that occurs in a database.

Instead of attempting to learn and understand the entire application, it is more effective to focus on
those SQL statements that dominate the database activity. You can establish control limits for your
system resource usage, and then when a transaction exceeds the limit, mark the transaction as being
“out-of-control.” These limits are usually expressed as a percentage of the total available CPU used
or the total time to complete the process. SQLab finds these types of statistics for you.

In most production databases, fewer than ten transactions account for over 80 percent of resource
usage. Often, a transaction that appears small may be executed so many times that it becomes a major
resource user within the system. For each of the problem transactions, examine its execution path.
SQLab’s comprehensive explain plan allows you to “step” through an execution and provides cost
information and context-sensitive help on operations for each step.

Tuning the Access to Tables


Once the most offensive SQL statements in your application have been tuned, you should evaluate
the access to individual tables within your database. Tables that especially need checking are those
which are frequently used, extremely large, volatile, or remote. From SQLab, you can invoke another
product from Quest Software named SQL Impact. Opening SQL Impact can be useful for tuning the
access to individual tables, because SQL Impact informs you if a table is properly indexed.

A set of common tables is used throughout most database applications. Access to these tables should
be monitored regularly to determine how the tables and indexes are being used. The location and the
condition of the tables and indexes should be reviewed from time to time to ensure load balancing
and to avoid I/O bottlenecks. SQLab uses a view that contains the relationship between the SQL
statements and the tables being used.

The number one cause of poor performance is missing indexes; a missing index implies that simple
access to a table will result in full table scans. Scans are time-consuming and I/O intensive since
database blocks read for full table scans do not cache very well in the buffer cache. If the number of
buffer gets and the number of disk reads on individual SQL statements are of the same order of
magnitude, this may indicate missing indexes. On a broader level, another indication is I/O to an
entire file, which is characterized by a high percentage of multi-block read requests.

The original indexing scheme may not match your ever-changing business profile. As tables grow,
the selectivity of the indexes changes. Some tables have too many indexes. Tables used as temporary
data containers as part of a batch process are especially susceptible to stagnation and can benefit
from periodic reorganization. You can reorganize indexes to avoid index stagnation or empty index
blocks.

5
SQLab Getting Started

Tuning SQL Across Multiple Connections


SQLab allows you to simultaneously connect to multiple databases. The multiple connectivity feature
allows you to collect SQL statements from your production environment and test them against your
development environment. This saves putting an increased workload on your production
environments, caused by additional tests and tuning. The multiple connectivity feature allows you to
reduce workload and avoid adversely affecting your production environment. Once you have tuned a
SQL statement in a test on development environment, you can try it in production.

Two types of multiple connection environments exist, and you can use SQLab with both:

Multiple Connection Environment 1


You have test, development, and production environments. You migrate SQL statements between
these environments to test them throughout. You bring SQL statements that are performance-heavy in
production and run them in test. You make a fix in development and then run it in production to
check that it runs well. Thus, you migrate SQL from development to production and vice versa
regularly and frequently.

Multiple Connection Environment 2


You have multiple, identical production environments, for example, 18 factories that run the same
manufacturing software. From headquarters, you find offensive SQL statements in any one of the
systems, tune the statements, and check the statements against all 18 systems. You make identical
changes across all environments. You may change the indexing scheme and so create an index in
each of those sites.

SQLab’s multiple connection capability also supports multiple owners in a database. You may have a
production owner and a test owner for the same tables. You can check the code of one owner and
then connect to another owner on the same database for comparison. When you switch between them,
you can get the different synonyms and verify compliance or that the tuning works across both
owners. Switching connections is allowed in each of the following features:

Offensive SQL Activity Graph Repository


SQL Collections I/O Bottleneck Resolution
Tuning Session Lab Cursor Cache Activity Screen
SQL Editor

Switching connections allows you to compare SQLab statistics for more than one instance. The
tuning session lab offers an additional level of granularity by allowing you to create multiple
scenarios of a statement  each connected to a different instance. You can also switch connections
on a single scenario and immediately see the difference in the explain plan.

6
Introducing SQLab

Features

Recon™ (StealthCollect™) Feature


Recon (StealthCollect) is Quest Software's new server-based agent that periodically samples and
collects (at sub-second intervals) both historical and current session operating data from the Oracle
server's System Global Area (SGA) shared memory space.

By going directly to the SGA, Recon gathers session data samples from the Oracle server without
impacting the currently running Oracle processes. The raw data samples are combined into high-level
performance data and are made available to the user in a number of different ways that make Recon
an efficient and valuable analysis tool.

The two major Recon features are Historical Collection and Current Session Activity.

Shared SQL Area Analysis


The Offensive SQL Activity Graph displays buffer gets, rows processed, and physical read activity
for SQL statements in Oracle’s shared pool area. The graph retrieves the first 7,500 SQL statements
(default value) currently in the shared SQL area, displaying activity of the top SQL statements that
cumulatively cause 80 percent of the total activity. The graph displays the distribution of activity per
statement or per execution, and it displays activity by rows processed, disk reads, or buffer gets.

Multiple Connections
SQLab allows connections to multiple databases, for quick comparison of SQL performance. This
allows you to collect SQL statements from a production environment to test them against
development environment. This feature also allows you to compare SQL for multiple owners in a
database. The Tuning Lab offers additional granularity by allowing you to create multiple scenarios
of a SQL statement, each connected to a different instance. You can also switch connections for a
single scenario to immediately see a corresponding explain plan.

7
SQLab Getting Started

SQL Cache Collection and Monitoring


SQLab’s SQL Collection feature retrieves and displays SQL, user, and execution information by
session and object, allowing you to obtain a general impression of database activity and monitor
specific applications in development or production. SQL Collection explains the SQL it finds and
provides summary information of the explain plans. You can transfer a SQL statement’s syntax into
the lab for tuning and you can also save your query results to the repository for later reference. From
the SQL collection window, you can launch the SQL Impact product to find the location of a SQL
statement in source code.

SQLab’s SQL Collections feature record SQL statements over a preset time interval, allowing you,
for example, to trace the activity of a session. You can also submit a background SQL Collection to
the server job queue so that the collection continues after you have closed the application. You can
transfer a SQL statement’s syntax into the lab for tuning and save your collection results to the
repository for later reference.

Performance Analysis, Comparison, and Tuning


SQLab’s key component is its Tuning Lab which allows you to tune, execute, and compare SQL
statements using standard Oracle techniques. The lab’s Quick Scenario feature drops four commonly
used hints into your SQL statement for quick comparison. You can execute multiple scenarios and
generate alternate explain plans of a SQL statement. The Tuning Session lab also displays select rows
in spreadsheet form.

The Tuning Session lab allows you to “step” through its enhanced explain plan that automatically
describes tables and views. The plan provides context-sensitive help on operations, tuning advice,
and cost information per step. SQLab’s explain plan is also enhanced with order of execution, rows
processed, table, view, join, and other data dictionary information. When SQLab Xpert is installed,
the Tuning Session lab also displays TKPROF-style trace statistics for the number of rows processed
at each execution step.

In the Tuning Session lab, you can describe and analyze tables, and you can reorganize indexes to
avoid stagnation or empty index blocks. The lab’s powerful comparison feature displays SQL
differences per FROM and WHERE clause; per plan optimizer and plan cost; per data; and per logical
and physical reads, ROWID gets, sort and scan rows, and response time.

8
Introducing SQLab

Repository for Benchmarking


SQLab’s application repository is a comprehensive storage and retrieval area for captured SQL
statements. Using the repository you can save SQL statements from SQL Collections and Tuning
Sessions. When you install SQLab, the repository objects are placed in any database instance you
wish to save information on. As you collect and tune SQL statements, you can save the information
generated to the repository.

Powerful Built-in SQL Editor


The SQL editor allows you to edit, and execute SQL statements and scripts, and supports all standard
text editing functions. Using this feature, you can create and edit SQL scripts or other text files, and
you can save any changes that you make to a file. You can copy SQL syntax to the Tuning Lab for
tuning. A spool tab is provided for displaying the rows retrieved, the execution starting line and any
error messages. A log displays the status of an execution and provides timing statistics in the lower
windowpane. A result tab displays the returned rows in grid or single record format.

I/O Bottleneck Resolution


SQLab identifies I/O bottlenecks by spotting tables that are accessed by SQL with excessive disk
reads. This function shows how I/O is distributed across files, within files, and across objects,
assisting you in determining the optimal placement of objects and in improving performance.

Reports
SQLab provides a variety of printed reports on all or selected objects for the connected database
instance. SQLab also provides reports on execution statistics and the Oracle environment. An
example of some of the reports is:

•= Tables and columns •= Non-indexed tables •= Table comments

•= Table constraints •= Views and columns •= Clusters

•= Sequences •= Synonyms •= Stored program size

•= Stored procedures •= Stored functions •= Package specifications

•= Triggers and columns •= Invalid objects •= Total shared pool reloads

•= User resource usage •= Indexes w/common column •= Analyzed tables status

9
SQLab Getting Started

Xpert Add-On Component


The Xpert add-on component provides context-sensitive tuning advice for SQL statements that you
are examining and working with in tuning session lab. To do this, Xpert makes observations about
the SQL statement and gives a series of recommendations for improving performance including:
adding new indexes; changing the order of columns in existing indexes; adding or removing columns
from existing indexes; adding conditions to WHERE clauses; adding hints; changing the order of
tables in FROM clauses; and other minor recommendations.

The Xpert add-on is a regular component of SQLab Xpert.

Xpert incorporates the advice you select by rewriting the syntax for the SQL statement and placing it
into a new tab folder in the tuning session lab or by writing new syntax for a schema object change
and placing it into SQLab’s editor. When you apply Xpert’s rewritten SQL syntax, the new statement
is automatically explained in the tuning session lab. By applying Xpert’s advice in a lab tuning
session, you can utilize the multiple connection and comparison features to examine various tuning
scenarios until you find the best solution.

The About SQLab box will read SQLab with Xpert if you have the Xpert option. If you did
not purchase SQLab Xpert, you may purchase the Xpert add-on component separately by
contacting Quest Software sales.

SQLab Integrated with SQL Impact


SQLab is integrated with another of the tools by Quest Software. The tool is SQL Impact, an
automatic analyzer for finding and documenting interdependencies between applications and their
access of databases. This section describes the integration between SQLab and SQL Impact.

While SQLab assists you in identifying and tuning offensive SQL statements, SQL Impact can tell
you which program(s) in your source contain the SQL statement. SQL Impact can also tell you which
database objects are used by the SQL statement. The following feature allows you to utilize these
SQL Impact functions while working in SQLab.

Comprehensive Product Integration


In addition to being fully integrated with SQL Impact, SQLab also integrates with other products in
the Quest Software family. SQLab can be called from Instance Monitor, I Watch, Toad and SQL
Navigator. For more information on how these products can enhance the productivity of your DBA’s
and developers, contact your Quest Software sales representative.

10
Introducing SQLab

Analyze the Impact of Tuning a SQL Statement


SQLab provides a Display Source button in its SQL collection result sets. When you highlight a SQL
statement in a result set and click this button, SQLab checks if the SQL Impact repository is installed
in the currently connected database. You can also connect to other databases with SQL Impact
repositories to search for the SQL statement. When a match is found, SQLab lists the statement
syntax with its location by module and line number.

At this point, you can click the Launch SQL Impact button to open SQL Impact’s Programs
Containing Given SQL query in which the current SQL statement displays. By running the query, you
can view information on its database access and you can open its source code for editing. Once in
SQL Impact, you can continue working in SQL Impact or resume work in SQLab. This new feature is
useful when searching for programs or applications “responsible” for submitting a SQL statement
and when searching for programs, applications, and database objects that need the SQL code
changed.

11
SQLab Getting Started

System Requirements
SQLab is available as a 32-bit product. Installation is similar for both products and requires Oracle’s
SQL*Net. For SQLab 32-bit, you must have a 32-bit version of SQL*Net installed. For SQLab 16-
bit, you must have a 16-bit version of SQL*Net installed.

Before installing, check for minimum hardware and software requirements. We recommend that you
test the SQL*Net connection and validate its access string before trying to use SQLab. To test the
SQL*Net connection, run the tnsping.exe or nettest.exe program. If you can see the orawin\orainst
directory on your system, then you can install SQLab successfully.

When installing the SQLab tables, at least 1MB of free space is needed in any tablespace other than
SYSTEM. We recommend a SORT_AREA_SIZE between 500K and 2MB depending on the size of the
SHARED_POOL.

Hardware
•= A computer with an Intel 80486 or compatible processor
•= Minimum 25 MB hard disk space; 50 MB may be needed for best performance
•= Minimum 64 MB of RAM for Windows 95/98/2000 or minimum 80 MB RAM for
NT Workstation/Server  128 MB may be needed for best performance

Software
•= Oracle 7.1.6 (7.3 or higher is recommended)
•= Windows 98/95/2000/NT
•= Oracle SQL*Net for Windows 2.0 or higher with the appropriate network driver

12
Installing and Starting SQLab

This section covers information on system requirements and procedures for installing SQLab. Before
installing, check that your system has the minimum hardware and software required.

The first time that you connect to a database instance using SQLab, SQLab looks for its own objects
on the instance. If the objects do not exist or if the version of the objects is not current, SQLab
automatically creates or upgrades its objects.

In This Section
•= How To Install SQLab
•= Starting SQLab: Connecting to Your Database Instance
•= Creating or Upgrading SQLab Objects on Your Database
•= Troubleshooting Installation

13
SQLab Getting Started

Installing SQLab
The SQLab installation files are available on one compact disc or on several 3 ½” diskettes. Before
installing the files, close all active windows on your computer.

To abort the installation process at any point, press the Esc key or click the Cancel button
on the screen.

To install SQLab from CD-ROM or Disk:


1 Insert disk 1 or the CDROM disc into the appropriate drive.

2 For Windows 98, 95, or NT 4.0 click the Start|Run menu item.

3 Enter the appropriate drive letter in the Run Window and click OK.

4 In the list of files that displays, double-click SQLab’s .exe file.

5 Click Next in the Welcome screen.

6 In the Select Destination Directory screen, choose one of the following:

Install Over Existing Copy  installs the new version of SQLab in the same directory as a
previous version. Existing repository data and sqlab.ini settings remain intact during the
installation.

If a previously installed copy was manually removed yet still shows in the
registry, the installation program displays the directory where the copy previously
existed.

Install In Directory Below  suggests an installation path and creates a directory for the
installation.
Browse  allows you to choose a directory in which to install SQLab.

Any additional SQL scripts and files that you kept in a previous directory can be
moved manually to the new directory.

14
Installing and Starting SQLab

For information on installation errors, turn to “Troubleshooting Installation”


section of this guide.

7 Click Next to continue.

8 Click the Install button.

When the installation is complete, select either to read the release notes, run SQLab, or
finish the installation.

To uninstall SQLab, use the menu item provided in the Start|Programs|Quest


Software|SQLab pop-up menu in the Windows desktop.

15
SQLab Getting Started

Starting SQLab: Connecting to Your Database Instance


Once you have installed SQLab, you can connect to a database instance to analyze and display
information on the SQL statements in the system. Before connecting, you must define the database
instance. Perform the following steps to define your database instance.

To define your database instance in SQLab:


1 Start the application and Click the Setup button (or select the File|Defined Services
Setup menu item).

In Services Setup, add a service for your application to connect to by selecting a name
from the TNSNames List Field.

16
Installing and Starting SQLab

2 Enter a User Id and Password for the newly defined Nickname and Service Name. You
can give a service any name that is meaningful in your environment, for example, “Oracle
Development” or “Personal Oracle.”

3 In the Service Name field, enter a connect string for Oracle. For SQL*Net version 2, use
the connect descriptor defined in the TNSNAMES.ORA file.

4 To save the service that you have defined, click the Save button.

To add another service name, repeat steps 1 through 4.

To remove a defined service, highlight the name in the Defined Services list, and click
the Delete button.

To exit the Defined Services Setup window without connecting to an Oracle service,
click the Close button.
Select the Save Password check box when defining a service and your Password will be
saved in an encrypted format.

To connect to an instance in SQLab:


1 You can connect to a database instance in one of the following ways:
a. Click the Connect button on the main Window frame.
b. Select the File|Connect menu option.
c. In the Defined Services Setup box, highlight the instance you want to connect to and
click the Connect button. SQLab’s connect box opens.

The first user to connect to the database instance with SQLab should have full
DBA privileges for installation of the SQLab objects to be successful.

The first time that SQLab is run against an Oracle instance on which SQLab objects do not
exist, you will be prompted to install the objects.

The first time a new version of SQLab is run against an Oracle instance on which older
SQLab objects already exist, you will be prompted to reinstall or to upgrade the SQLab
objects.

Please turn to the following “Creating or Upgrading SQLab Objects on Your


Database” section for more information.

17
SQLab Getting Started

2 Using the drop list box of defined instances select an instance in the Nickname field. The
connect string that you have already defined will display in the Service field.

3 Enter the login information in the User ID and Password fields. To save your login
information for the next time you have to connect, click the Save Password check box.

4 To connect SQLab to your database instance, click the Connect button. The SQLab desktop
opens.

For information on connection errors, turn to “Troubleshooting Installation”


section.

Disconnecting From an Instance


You can disconnect from a database instance at any time in SQLab by selecting the File|Disconnect
menu item.

18
Installing and Starting SQLab

Creating or Upgrading SQLab Objects on Your Database


When you connect to an instance using SQLab, it looks at the version of any previously installed
SQLab objects. If the objects do not exist or if the version of the objects is older than the version of
SQLab currently installed, you will be prompted with options for creating or upgrading the objects in
the instance.

Creating the SQLab Objects


A dialog box opens allowing you to select various installation options:

19
SQLab Getting Started

You are encouraged to use the default size that SQLab provides for repository and other SQLab
objects:

SQLab Objects Installation Options Purpose/Definition

Install Server-side Objects The server-side objects are the objects that SQLab on the
selected Oracle instance. These objects must be installed for
the application to function.

Install SQLab Repository Tables The SQLab Repository tables must be installed if you want to
setup an application repository. You can leave this option
unchecked and install these tables at a later date if needed.

Setup Non-DBA Users to use SQLab Select this option if you wish to grant user privileges to non-DBA
users at the time of installation. Once the application is installed,
you can grant access at a later date.

Setup Oracle Application Views When this option is checked the setup program checks if Oracle
applications are installed on the currently connected instance. If
the setup program determines that they are it will install the
appropriate views.

Tablespace/Initial Size Allocation Select a tablespace in which to install the SQLab objects. This
list displays the available tablespaces in the instance and the
amount of free space in the tables. Since SQLab's repository
objects are used for storing SQL and can grow to an unknown
size, make sure the tablespace you choose has enough
available space.

Recommended Size The recommended space allocation for the repository and other
SQLab objects. The space allocation shown here is sufficient to
store 300 KB of collected SQL text and 300 KB of collected
explain plans.

Initial Allocation Size If you have a high number of SQLab users, you should increase
the size of the initial allocation.

20
Installing and Starting SQLab

Upgrading the SQLab Objects


The first time a new version of SQLab is run against an Oracle instance on which older SQLab
objects already exist, you will be prompted to reinstall or to upgrade the SQLab objects. The new
objects will be installed into the existing SQLab repository.

SQLab Objects Upgrade Options Purpose/Definition

Reinstall Drops all previously installed SQLab objects and recreates


them. Saved data, such as collected statements, registered
users and tuning sessions in the repository will be lost. To
save objects and data, select the Upgrade option.

Upgrade Recreates only the SQLab objects that have changed since the
previous installation. Previoulsy saved data, such as collected
statements, registered users and tuning sessions in the
repository are retained.

Removing the SQLab Objects from the Database


To remove SQLab objects from the database server, select the Server Side Installation item in the
File|Admin menu. You will also be prompted to choose whether to drop the SQLab repository
objects.

If you drop the repository objects, you will lose the data saved in the repository.

21
SQLab Getting Started

Troubleshooting Installation
The following table provides explanations and actions to take for installation errors. Error messages
that occur during installation include the name of the file and the exact SQL execution in which the
error occurred. Call Quest Technical Support immediately with the information required.

Error Explanation/Action

The message “ORA - 00900 invalid SQL This usually occurs during the installation process
statement” displays during installation. if the PL/SQL procedural option has not been
installed. The SQLab installation scripts are
written in PL/SQL and can not be interpreted by
Oracle when the installation process tries to add
objects to the database and the procedural option
has not been installed. To verify that it is
installed, check if a plsql directory under
$ORACLE_HOME exists. Also, to check if PL/SQL
has been linked into the RDBMS kernel, start
sqlplus or sqldba. If the procedural option is
installed and linked, it appears in a banner, for
example:
Oracle7 Server Release 7.1.3.00 -
Production Release

PL/SQL Release 2.1.3.0.0 - Production

If it does not appear in the banner, it is not


installed and you will have to install it before you
install SQLab again. Contact Oracle or Quest
Software Technical Support for instructions if
you need assistance on installing the procedural
option module.
A GPF occurs in SHADOW.EXE when SQLab 1.3c will not install with Windows NT
installing on a Windows NT. 3.51. Use version 1.4c or higher.

22
Installing and Starting SQLab

The following table provides explanations and actions to take for product authorization errors.

Error Explanation/Action

An “Illegal Serial Number” message This usually occurs after you have entered your
displays. The serial number validation connection information in the Connect window,
failed.
and attempted to connect to an oracle instance.
The license number is kept in /QUEST/SQLAB.INI
or where SQLab was installed. Check the number
in the license block of the SQLAB.INI file by
opening up the file in a text editor such as the
Windows Notepad. Make sure that the license
number is present. The number must be entered
correctly and be valid. Call Technical Support if
you have any questions about the validity of your
license key. You can update the file when you
receive a new code, rather than reinstall the
product.
A “Serial number validation failed when Check that the license code is valid in SQLAB.INI.
selecting from SYS.Dual” message If it is not valid, correct it or try a new code. Call
appears.
Technical Support to get another demo license
number.

23
SQLab Getting Started

The following table provides explanations and actions to take for connection errors.

Error Explanation/Action

ORA-12505 on connection attempt TNS:Listener could not resolve SID given in


connect descriptor. The SID in the
CONNECT_DATA was not found in the listener's
tables.
Check to make sure that the specified SID is
correct. The SIDs that are supported can be
obtained by typing LSNRCTL STATUS
SERVICE_NAME and matching the SID specified
in TNSNAMES.ORA with one of the SIDs
displayed in the services summary.
If you have both Net*8 and SQL*Net installed,
the problem likely is that the SID information
was not copied into the Net*8 Tnsnames.ora file.
Copy the SQL*Net Tnsnames.ora file (or the
relevant SID) from network\admin to
net80\admin. This should resolve the connection
error.
An “Error ORA-999: DBMS not supported in This usually occurs after you have entered your
your current environment” message connection information in the Connect window
appears.
and attempted to connect to an Oracle instance.
This error references an incompatibility with
SQLab and the version of SQL*Net that is being
used. This means that a 16 bit version of
SQL*Net DLLs cannot be found. Check for the
existence of an ORAWIN directory. Its existence
indicates that 16 bit SQL*Net should be
installed. Check for the existence of the
ORA7WIN.DLL in the ORAWIN\BIN directory. If it
does exist, check if /ORAWIN/BIN is in your path.
If it does not exist, copy ORA7xWIN.DLL to
ORA7WIN.DLL (x is the update number for their
version of Oracle7) in directory /ORAWIN/BIN.

Continued on the next page

24
Installing and Starting SQLab

Error Explanation/Action

SQLab does not return any rows in the SQL If you have updated Oracle on the server from
Collection result set after connecting. 7.1 to a later version and SQLab does not return
rows in the SQL Collection, issue the following
SQL command in sqlplus or from the tuning
session lab. Then reinstall SQLab on the PC.
>drop public synonym sqlab_version;

A “This demo version of SQLab expired or Call your sales representative for a license
will expire….” message appears. extension if you want to continue evaluating the
product.
An Ora-942: “Table or view does not exist” This error sometimes occurs after the database
message appears. has been exported and then imported again.
Select the Drop SQLab DB Objects options from
the File|Admin menu. This will drop all the
objects that SQLab previously created. Then you
can reinstall SQLab.
An Error 1 or ORA-1749 “You may not grant You cannot log in as the user SYS during a first
revoke /privilege to/from self” message time installation. You must log in as the user
appears.
SYSTEM or another user that has DBA privileges.

When trying to connect, an Error 2 is The user who logged on may have DBA
generated. privileges but not have Alter User privileges. To
check, run the following select statements to
verify user privileges. To check if the login user
has DBA privileges, type:
Select * from dba_role_privs;

To check if the user has Alter User privileges,


type:
Select * from sys.role_sys_privs;

Continued on the next page

25
SQLab Getting Started

Error Explanation/Action

A “Cannot find ORA7WIN.DLL” message This error usually occurs if you have an earlier
appears. version of SQLab and the installation program
had not been updated to look for ORA71WIN.DLL,
ORA72WIN.DLL, or ORA73WIN.DLL. It still looks
for the ORA7WIN.DLL. Copy one of the previous
DLLs, preferably the latest one, to ORA7WIN.DLL.
The program will recognize it at connect time
and connect to your instance.
An ORA-1031 “Insufficient Privileges” This error occurs when connecting to your
message appears. instance for the first time. After the first connect,
you can grant privileges using the User
Registration window.
This error usually occurs if you are logged in as a
user who does not have DBA privileges. Make
sure the user you are logging in as, including the
user SYSTEM, has been assigned the DBA role.
You can check this by executing the following
SQL statement in sqlplus, sqldba, or the server
manager. To check if the user has the DBA role,
type:
Select * from dba_role_privs;

An ORA-3121 “No interface driver This error usually occurs for one of two reasons:
connected” message appears. the SQL*Net driver is not loaded into memory,
or a mismatch of the driver version exists. Take
the following steps:
1. Verify that your connect string used in the
Connect window is valid for the version of
SQL*Net that you are using, for example,
@Txxxx for SQL*Net version 1.x, and the
alias found in your
c:\orawin\network\admin\tnsnames.ora file
for SQL*Net version 2.x.
2. Check for the existence of a C:\ORAWIN
directory. Its existence indicates that 16 bit
SQL*Net should be installed. Make sure that
this directory path is in your path statement.

Continued on the next page

26
Installing and Starting SQLab

Error Explanation/Action

After connecting to the Oracle instance, you This error occurs when SQLab tries to create the
are prompted to select a tablespace to packages but pmerr.sql script file is missing from
install SQLab tables, views and stored
the SQLab directory. Re-install the product from
objects. An error message appears: Create
package errors, installation error! Call the diskettes. Then run the pmdrop.sql script and
Technical Support (error 8). re-connect to the same tablespace. Try installing
the tables, views and stored objects again.
A GPF error appears immediately after This is a bug that will be corrected in a future
clicking on the Connect button. version. The GPF occurs if the number of SQL
statements in the cache is large (for example,
more than 30k). It can occur if a PC does not
have enough RAM. To bypass the GPF, edit the
\quest\sqlab\sqlab.ini file as follows:

show_sql_activity=NO

27
SQLab Getting Started

28
Setting Up Background Options

This section covers setting up background options in SQLab. SQLab’s Collection function allows
you to collect SQL over a preset period of time as a background process. The SQLab background
collection feature relies on the Oracle DBMS_JOB package to run the background process. Your
database must be configured to enable background processes so you can install and use the
background Collection feature.

An Install Background Collection command is available from the File|Admin menu. This
option can be installed only if the Oracle DBMS_JOB package was previously installed.

In This Section
•= Background Collection Option

29
SQLab Getting Started

Background Collection Option


During installation, SQLab allows you to install the background option only if it can find the Oracle
package DBMS_JOB and if the status of the package is VALID.

If the background Collection is not installed when you install SQLab, you may install the background
options at a later time. When SQLab creates its server objects, it looks for the Oracle procedure
DBMS_JOB. If the package does exist, SQLab will check the database initialization parameters
job_queue_interval and job_queue_processes.

If one of these parameters is set to zero, you will be prompted to install the background Collection
option. However, the background Collection cannot be used unless the above parameters are
modified to valid nonzero values. The current values can be obtained by:

“Select name,value from sys.v_$parameter where name like ‘%queue%’;”

To modify these parameters, edit Oracle’s initialization file (default is ini.ora). The database must be
restarted for the changes to take effect.

Parameter Name Range of values and description Default

job_queue_interval 1 - 3600 ( seconds ) 60 ( seconds)


Sets the number of SNP background
processes per instance.
job_queue_processes 0 – 10 (processes) 0 (processes)
Sets the interval between wake-ups for the
SNP background processes of the instance.

30
About Quest Software

This section covers information about Quest Software, about other Quest Software products, and
about contacting technical support. Quest Software provides training for their products.

In This Section
•= Overview
•= Contacting Quest Software
•= Quest Technical Support

31
SQLab Getting Started

Overview
Quest Software, Inc., a publicly held company, provides innovative software solutions that enable
businesses to optimize enterprise-wide application and database implementations via Enterprise
Report Management solutions and a complete suite of Database Management tools for Oracle DBA’s
and developers. With Headquarters in Irvine, CA, Quest Software also has offices throughout the
U.S. in Chicago, Dallas, New York, San Francisco and Washington D.C., European offices in the UK
and Germany, and in the Pacific Rim in Australia. More information regarding Quest Software can
be found at www.quest.com or by calling 949.754.8000

Contacting Quest Software


Feel free to contact Quest Software for product information and class schedules. You can reach us in
any of the following ways:

Phone 1.949.754.8000

Fax 1.949.754.8999

Email Sales & Marketing: [email protected]

Home page: www.quest.com

For information on our international offices, please contact us at company headquarters.

Quest Technical Support


If you have questions about using a Quest product, please call our technical support staff Monday
through Friday from 8:00 a.m. to 5:00 p.m. (PST). Please have the version number handy. If your
question is about an error message, please write it down and have it available for the technical
support representative.

Phone 1.949.754.8000

Fax 1.949.754.8999

E-mail [email protected]

Send your comments on the content of this guide to:

E-mail [email protected]

32
A P P E N D I X A
Index

A F
Analyzing Features
Impact of changes......................................... 11 Multiple connections ...................................... 7
Offensive SQL................................................ 5 Performance, analysis, comparison, and tuning8
Applications Product integration ....................................... 10
Maintaining legacy, custom............................ 2 Product Integration ....................................... 10
Performance ................................................... 3 Repository ...................................................... 8
Shared SQL area analysis ............................... 7
B
SQL Cache collection..................................... 7
Background collector SQLab integrated with SQL Impact.............. 10
Setting up ..................................................... 29 Xpert add-on component .............................. 10
Batch programs, tuning ...................................... 3
H
C Hardware
Connect to an instance...................................... 17 Requirements for installation ........................... 12
In SQLab ...................................................... 17 I
Connections
Connecting to an instance............................. 17 Impact analysis ................................................. 11
Defining your instances in SQLab................ 16 Index................................................................... 1
Disconnecting from an instance.................... 18 Indexes
Introduction .................................................... 6 Performance.................................................... 5
Multiple.......................................................... 7 Installation ........................................................ 13
Setting up tracing ......................................... 18 Choosing tablespace for SQLab objects ....... 20
Connecting to instances ................................ 16
D Removing SQLab objects ............................. 21
Disconnecting instances ................................... 18 Sort area size ................................................ 12
Dropping SQLab objects.................................. 21 SQL*Net, testing connection ........................ 12
Steps for installing SQLab............................ 14
E System requirements..................................... 12
Editing database procedures............................... 4 Uninstalling SQLab ...................................... 15
Environments, use SQLab with multiple ............ 6 Upgrading SQLab................................... 14, 20
Errors O
Connection ................................................... 24
Installation.................................................... 22 Offensive SQL
Validation code ............................................ 23 Analyzing........................................................ 5
Tuning ............................................................ 5
Online programs, tuning ..................................... 3

A-1
SQLab Getting Started

P SQLab
Connecting to instances ................................16
Performance Features...........................................................7
SQLab supports improved .............................. 3 Installation ....................................................13
Tuning table access ........................................ 5 Integration with SQL Impact ........................10
Product Integration Introduction ......................................................1
I Watch ......................................................... 10 Multiple connect feature .................................6
Instance Monitor........................................... 10 System requirements.....................................12
SQL Impact .................................................. 10 Tuning offensive SQL.....................................2
SQL Navigator ............................................. 10 SQLab’s Repository
Toad ............................................................. 10 Overview ........................................................9
Purchased software, tuning................................. 4 SQLab's editor
Q Overview ........................................................9
System requirements.........................................12
Quest Software
Contacting Quest Software ........................... 32 T
Contacting Technical Support ...................... 32 Tables
R Tuning access .................................................5
Troubleshooting
Requirements for installation
Connection errors .........................................24
Hardware ....................................................... 12
Installation errors..........................................22
Software ........................................................ 12
Validation code errors ..................................23
S Tuning
Access to tables ..............................................5
Software requirements, SQLab ........................... 12
Across multiple connections ...........................6
SQL
Batch programs...............................................3
Area analysis .................................................. 7
Database procedures .......................................4
Cache collection ............................................. 7
Offensive SQL ................................................5
Monitoring...................................................... 7
Online programs .............................................3
SQL Impact, launching..................................... 10
Oracle .............................................................4
SQL Navigator ................................................... 4
Oracle Financials ............................................4
SQL statements
Purchased software .........................................4
Locating in source code................................ 10
Reasons for .....................................................2
SQL*Net, testing connection............................ 12
Source code ..................................................10
U
Upgrading SQLab.............................................14

A-2

You might also like