You are on page 1of 9

Five Ways Toad Xpert Edition Can

Help You Write Better Code


Written by Brad Wulf
Product Manager, Dell Software

Abstract

Introduction

For many years, Toad for Oracle Base Edition has provided a firm
and reliable foundation for general database development tasks.
However, as the role of the database professional has evolved
to require more sophisticated processes and higher code quality
standards, many organizations have upgraded to Toad for
Oracle Xpert Edition for the additional functionality it provides
particularly, its support for developers in the areas of speed, code
quality, integration, testing and change management.

It is no longer enough for database developers to provide


syntactically correct code; today, the expectation is that code
also be semantically correct, optimized and enterprise-grade.
Therefore, organizations require a more holistic approach to
database development.

In this brief, well explore five ways Toad for Oracle Xpert
Edition can help you write better code. But you dont have
to take our word for it Dell makes it easy for your entire
organization to evaluate our solution with a free 30-day trial.
See for yourself how Toad for Oracle Xpert Edition provides the
advanced database tooling you need today.

Over the years, database professionals have made Toad for


Oracle Base edition the de facto standard tool for database
development work. However, to help database professionals
with todays challenges, Toad for Oracle Xpert Edition offers
advanced functionality to support emerging trends throughout
the database world.

This document explains five ways Toad


for Oracle Xpert Edition can help you
write better code. Youll be able to:

Toad for Oracles


built-in Auto
Optimize feature
enables quick
rewrites of code.

Quickly write more efficient code and


reduce the overhead associated with
long-running or inefficient queries
Analyze and report on the semantic
correctness (not just syntactic correctness)
of code, and ensure deployment of
compliant code across all applications
Easily integrate database changes using
your existing version control processes,
such as SVN or TFS 2012
Automatically generate real-world test data
if none is available or if production data
contains sensitive information
Ensure that database changes are
accurately, seamlessly and completely
migrated from development (DEV) to
testing (TEST) to production (PROD)

Reason #1. Write more efficient


code quickly and easily.
To ensure that you can deliver
syntactically correct and optimized code,
Toad for Oracle Xpert Edition includes
integrated SQL and PL/SQL performance
tuning. Tuning is accessible in two ways:

Auto Optimize Quick and simple


single-statement optimization within the
Toad Editor
SQL Optimizer for Oracle Finegrained and broader support for code
performance enhancements such as index
recommendations and SQL rewrites

Auto Optimize
For the database developer, Toad for
Oracles built-in Auto Optimize feature
enables quick rewrites of code (see
Figure 1). You can refactor and rewrite
statements, as well as choose from
alternatives suggested by Toad that are
optimized for environment-specific
requirements such as online transaction
processing (OLTP), data warehouses or
mixed database environments. And you
can do all of this without ever leaving
the Toad for Oracle interface.
SQL Optimizer for Oracle
For DBAs who require more finegrained and broader support for code
performance enhancements such
as index recommendations and SQL
rewrites, Toad for Oracle Xpert Edition

Figure 1. Developers can optimize statements quickly and easily using Toads Auto
Optimize feature.

Figure 2. SQL Optimizer identifies the SQL statements most likely to benefit from
tuning and automatically recommends the best rewrites.
includes SQL Optimizer for Oracle. SQL
Optimizer reduces query times for both:
New code Developers can use SQL
Optimizer to optimize code prior to its
promotion from DEV to TEST and PROD.
Existing code For DBAs with a large
body of legacy code, the spectre of
optimizing all of it can be daunting. But
SQL Optimizer makes it easy: Simply select
existing procedural code in bulk, and SQL
Optimizer will identify the SQL statements
most likely to benefit from tuning and
automatically recommend the best rewrites
for each to reduce the elapsed run time
(see Figure 2).

Reason #2. Ensure code quality.


Toad for Oracle Xpert Edition also provides
two interfaces for code validation:
Toad Editor For real-time validation
Code Analysis For review and
management reporting across the
entire project

Using the Editor


The Editor notifies users of semantic code
violations in real time, which ensures
that all code checked into version
control or promoted to production
conforms to enterprise standards for
program structure, efficiency, readability,
maintainability and code correctness.
(see Figure 3).

Figure 3. The Toad Editor validates code against enterprise standards for code quality
and semantic correctness in real time.

The Toad Editor


notifies users of
semantic code
violations in real
time.

Code Analysis helps


developers measure
the correctness
of their code
against enterprise
standards, ensuring
consistency and
facilitating easier
refactoring.

Figure 4. Code Analysis enables you to validate code in bulk against enterprise
standards for code quality and semantic correctness.
Using Code Analysis
By launching the Code Analysis interface,
you get a more detailed view of the
same information, as well as additional
metrics measuring the overall quality of
your code. In addition, you can perform
code quality checks against multiple
statements and objects in a single
step, as well as generate HTML reports
detailing the results to share with other
stakeholders (see Figure 4).
Code Analysis also helps ensure that true
enterprise-level code quality standards
are met by all users. Users can modify or
create their own code quality standards
templates, categorize those templates
into manageable subsets, and share them
with teams across the entire organization.
Code Analysis provides objective
measures of code quality, including
Complexity, Toad Code Rating, Halstead
Volume and McCabes Cyclomatic,
which can be used to determine
which code might most benefit from
optimization with SQL Optimizer.
Integrated features like this help ensure
that your code base is consistent,
easy to manage and easy to refactor
throughout its lifecycle.

Reason #3. Manage code


changes effectively.
For years database developers
lagged their application development
counterparts in the area of source code
control. All Toad for Oracle editions
include a source control feature called
Team Coding, which helps database
development teams leverage investments
in existing version control tools (Microsoft
Team Foundation Server, Subversion
and Perforce). But with Xpert Edition,
you can combine Team Coding with
Code Analysis to enforce code quality
policies when developers check in their
code a critical step in helping database
developers manage their code changes
with confidence and consistency.
Many database developers today are
asked to leverage existing investments
in version control software by ensuring
that code changes are driven through
providers such as TFS, SVN and Perforce.
And they must also ensure that all code
conforms to a set of enterprise standards
governing quality and formatting.
Toad for Oracle Xpert Edition meets both
of these requirements. For the former,
Toad can seamlessly integrate with your

Figure 5. Toad can automatically generate a Code Analysis report as part of check-in of
version-controlled objects, ensuring that only validated code is added to your project.

organizations preferred version control


tool by virtue of context-sensitive menu
options in multiple locations within the
tool most notably the option to check
in/check out on the Object Explorer. In
addition, the Team Coding view provides
additional insight into controlled objects,
including history, as well as comparison
of local and previous file versions.
For the latter requirement, you can
configure the Team Coding feature to
automatically perform a chosen set of
Code Analysis validations on each object
when it is checked into your version
control system, thereby automating
what might otherwise be a laborintensive and easily forgotten task.

Reason #4. Quickly create valid


test data.
Developers creating new code often
have difficulty testing it, usually because
the new objects do not yet have data
associated with them. Toad for Oracle
Xpert Editions Data Generation feature
solves this problem by populating

empty tables with actual data that is


representative of the data types defined
within the schema objects (see Figure 6).
In other cases, there is already data in
the tables, but it is sensitive production
data that cannot securely be used in
development or testing environments.
You can use the Data Generation feature
to overwrite the sensitive data with
test data that is appropriate in size and
type, thereby enabling effective testing
without compromising security.
Enforcing referential integrity
The Data Generation feature of Toad
for Oracle Xpert Edition also provides
support for generating test data that
can be joined across related tables. This
is valuable when data in parent and
child tables must conform to referential
integrity constraints so that users
might write test queries to confirm that
datasets are related and can be joined.
For example, when you generate data
for related Customer and Order tables, if

You can configure


Toad Team Coding
to automatically
perform Code
Analysis validations
on each object
when it is checked
into your version
control system.

Toad for Oracle


Xpert Edition can
enforce referential
integrity, so the test
data it generates
can be joined across
related tables.

Figure 6. Toad generates data using real-world templates, so the data is appropriate
given the field name (such as US Address) and context.
you do not account for enforcement of
referential integrity, you will be unable to
return datasets when writing test queries
against the tables because none of the
data matches. By choosing the Enforce
Referential Integrity option when using
Data Generation, you can ensure data
consistency, and you also get fine-

grained control over the type and range


of the generated data values.
In the example shown in Figure 7, the
CUST_ID fields for the parent and child
tables have matching data (rather than
disparate, unrelated values), so they can
be joined during testing.

Figure 7. You can use Data Generations Enforce Referential Integrity option when
populating child tables with data from a parent table.

Figure 8. The Master Detail Browser in the Schema Browser lets you quickly confirm
that data generated in a parent table also has corresponding data in the child table.
This screenshot highlights a particular customer ID value in the parent table and the
corresponding value in the child table.
You can easily and visually confirm
that generated data is truly correct
and related by using the Master Detail
Browser in the Toad Schema Browser to
ensure that each generated record in the
parent table has a corresponding record
in the child table (see Figure 8).
Creating enterprise-size test datasets
If you need to generate large, enterprisesize test datasets, you can create serverside objects to handle data generation
operations on a more capable server,
rather than on your desktop.

Reason #5. Automatically generate


sync scripts and report on
schema changes.
Toad for Oracle Xpert Edition enables
you to automatically generate
sync scripts and reports detailing
schema changes detected between
environments, either manually or via the
automation interface. This is extremely
valuable because it enables you to
confirm that expected schema changes
are being migrated from DEV to TEST to
PROD, as well as ensure that unexpected
changes are identified and reconciled as
quickly and seamlessly as possible.

In addition, the Schema Compare


feature allows you to create metadata
snapshots during comparisons to
help you track changes within a single
environment. For example, using
a snapshot, you can run a schema
comparison job that will easily and
quickly compare the current state of
a database to an archived snapshot of
the same database from yesterday
or a month ago, thus ensuring
consistency within as well as between
database environments.
Many-to-many schema compare
You can also compare schema-level
objects in multiple schemas across two
databases in a single action using the
Multi Schema Compare function (manyto-many schema comparisons), as
shown in Figure 9. This can be extremely
valuable. For example, suppose you
must compare multiple PROD schemas
to multiple TEST schemas in a single
operation. Without Multi Schema
Compare, if there were 50 individual
TEST schemas, you would have to run
50 unique PROD to TEST comparison
jobs. However, with Multi Schema
Compare, you can configure a single

You can compare


schema-level
objects in multiple
schemas across two
databases in a single
action using Multi
Schema Compare.

Try Toad for Oracle


Xpert Edition free
for 30 days.

Figure 9. Using the Compare Multiple Schemas feature, you can efficiently compare
multiple schemas on one database with matching multiple schemas on another,
instead of having to configure multiple separate comparisons.
job to perform the 1-to-50 schema
comparison operation in one fell swoop,
saving you significant time.
Version control of schema snapshots
You can add any schema snapshots
to your organizations version control
process. This makes state information
easy to diagnose you can simply pull
schema changes for any period from
version control to assess changes
over time and even roll them back
if necessary.

Conclusion
Today, a successful development
team must do far more than produce
syntactically correct code. Toad
for Oracle Xpert Edition delivers the
advanced functionality your organization
needs, enabling you to:
Reduce the overhead associated with
long-running or inefficient queries (Auto
Optimize and SQL Optimizer).

Ensure consistent, enterprise-ready code


(Code Analysis).
Manage code effectively using your existing
version control repository (Team Coding).
Protect sensitive data and generate
real-world data for testing purposes
(Data Generation).
Ensure that all environments are
synchronized and changes flow seamlessly
and completely from DEV to TEST to PROD
environments (Schema Compare).

To learn more about Toad for Oracle


Xpert Edition and download your free
30-day trial, please visit software.dell.
com/products/toad-for-oracle/xpertedition.aspx.

For More Information


2015 Dell, Inc. ALL RIGHTS RESERVED. This document
contains proprietary information protected by copyright. No
part of this document may be reproduced or transmitted in
any form or by any means, electronic or mechanical, including
photocopying and recording for any purpose without the
written permission of Dell, Inc. (Dell).
Dell, Dell Software, the Dell Software logo and productsas
identified in this documentare registered trademarks of Dell,
Inc. in the U.S.A. and/or other countries. All other trademarks
and registered trademarks are property of their respective
owners.
The information in this document is provided in connection
with Dell products. No license, express or implied, by estoppel
or otherwise, to any intellectual property right is granted by
this document or in connection with the sale of Dell products.
EXCEPT AS SET FORTH IN DELLS TERMS AND CONDITIONS AS
SPECIFIED IN THE LICENSE AGREEMENT FOR THIS PRODUCT,

About Dell Software


Dell Software helps customers unlock greater potential through
the power of technologydelivering scalable, affordable and
simple-to-use solutions that simplify IT and mitigate risk. The Dell
Software portfolio addresses five key areas of customer needs:
data center and cloud management, information management,
mobile workforce management, security and data protection.
This software, when combined with Dell hardware and services,
drives unmatched efficiency and productivity to accelerate
business results. www.dellsoftware.com.

If you have any questions regarding your potential use of


this material, contact:
Dell Software
5 Polaris Way
Aliso Viejo, CA 92656
www.dellsoftware.com
Refer to our Web site for regional and international
office information.

9
TechBrief-FiveWaysToadXpertEdition-US-AC-25607

DELL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS


ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING
TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR
A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO
EVENT SHALL DELL BE LIABLE FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL
DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES
FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS
OF INFORMATION) ARISING OUT OF THE USE OR INABILITY
TO USE THIS DOCUMENT, EVEN IF DELL HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. Dell makes no
representations or warranties with respect to the accuracy or
completeness of the contents of this document and reserves
the right to make changes to specifications and product
descriptions at any time without notice. Dell does not make
any commitment to update the information contained in this
document.

You might also like