Building SQL Test Cases

For many SQL-related problems, obtaining a reproducible test
case makes it easier to resolve the problem. Starting with the 11g Release
2 (11.2), Oracle Database contains the SQL Test Case Builder, which automates the somewhat
difficult and time-consuming process of gathering and reproducing as much
information as possible about a problem and the environment in which it
occurred.

SQL Test Case Builder captures information pertaining to a SQL-related
problem, along with the exact environment under which the problem occurred, so
that you can reproduce and test the problem on a separate database. After the
test case is ready, you can upload the problem to Oracle Support to enable
support personnel to reproduce and troubleshoot the problem.

The information gathered by SQL Test Case Builder includes the query being
executed, table and index definitions (but not the actual data), PL/SQL
functions, procedures, and packages, optimizer statistics, and initialization
parameter settings.

16.6.1 Creating a Test
Case

You can access the SQL Test Case Builder from Enterprise Manager or manually
using the DBMS_SQLDIAG package.

16.6.1.1 Accessing SQL Test
Case Builder from Enterprise Manager

From Enterprise Manager, the SQL Test Case Builder is accessible only when a
SQL incident occurs. A SQL-related problem is referred to as a SQL incident, and
each SQL incident is identified by an incident number. You can access the SQL
Test Case Builder from the Support Workbench page in
Enterprise Manager.

You can access the Support Workbench page in either of
the following ways:

  • In the Database Home page of Enterprise Manager,
    under Diagnostic Summary, click the link
    to Active Incidents (indicating the number of active
    incidents). This opens the Support Workbench page, with
    the incidents listed in a table.

  • Click Advisor
    Central under Related Links to open
    the Advisor Central page. Next, click SQL
    Advisors and then Click here to go to
    Support Workbench to open the Support
    Workbench
     page.

From the Support Workbench page, to access the SQL
Test Case Builder:

  1. Click an incident ID to open the problem details for the particular
    incident.

  2. Next, click Oracle Support in
    the Investigate and Resolve section.

  3. Click Generate Additional Dumps and Test
    Cases.

  4. For a particular incident, click the icon in the Go To
    Task
     column to run the SQL Test Case Builder.

    The output of the SQL Test Case Builder is a SQL script that contains the
    commands required to re-create all the necessary objects and the environment.
    SQL Test Case Builder stores the file in the following location,
    where inc_num refers to the incident
    number and run_num refers to the run
    number:

    $ADR_HOME/incident/incdir_inc_num/SQLTCB_run num

    For example, a valid output file name could be as follows:

    $ORACLE_HOME/log/diag/rdbms/dbsa/dbsa/incident/incdir_2657/SQLTCB_1

16.6.1.2 Accessing SQL Test
Case Builder Using DBMS_SQLDIAG

You can also invoke the SQL Test Case Builder manually, using
the DBMS_SQLDIAG package. This package consists of
various subprograms for the SQL Test Case Builder, some of which are listed
in Table
16-1
.

Table 16-1 SQL Test Case Builder Procedures in
DBMS_SQLDIAG














Procedure Name Function

EXPORT_SQL_TESTCASE

Generates a SQL test case

EXPORT_SQL_TESTCASE_DIR_BY_INC

Generates a SQL test case corresponding to the incident ID passed as an
argument

EXPORT_SQL_TESTCASE_DIR_BY_TXT

Generates a SQL test case corresponding to the SQL text passed as an
argument

For more information on this package and all of its procedures and
parameters, see Oracle Database PL/SQL Packages and Types
Reference
.

http://docs.oracle.com/cd/E11882_01/server.112/e41573/sql_overview.htm#PFGRF94838

时间: 2024-10-17 21:46:33

Building SQL Test Cases的相关文章

lvl plywood or solid wood is best for cajon construction

Solid Woodvs Lvl plywood If you're here, it's most likelybecause you need to know what kind of wood to use when buildingyour own cajon. There is some debate about whether lvl plywood or solid wood is best for cajon construction and even further so, w

053(二十六)

126. 126.Which statements are true regarding the creation of an incident package file by using the EM Workbench Support? (Choose all that apply.) A. You can add or remove the trace files to the package. B. You can create the incremental incident pack

052(十八)

86.Which statement is true about a whole consistent database backup on a database running in ARCHIVELOG mode? A. The backup will consist of used data blocks only. B. The database must be shut down to accomplish the backup. C. The backup can be accomp

About Quick Packaging and Custom Packaging

About Quick Packaging and Custom Packaging The Enterprise Manager Support Workbench provides two methods for creating and uploading an incident package: the quick packaging method and the custom packaging method. Quick Packaging--This is the more aut

My journey introducing the data build tool (dbt) in project’s analytical stacks

转自:https://www.lantrns.co/my-journey-introducing-the-data-build-tool-dbt-in-projects-analytical-stacks/ Not sure I remember how, but I had the good luck a few weeks ago to stumble upon posts from Tristan Handy where he mentioned a tool his team built

EF6 SQL Logging – Part 3: Interception building blocks | One Unicorn

In parts 1 and 2 of this series we looked at how to use DbContext.Database.Log to log the SQL generated by EF. But this code is actually a relatively thin fa?ade over some low-level building blocks for interception in general and, in this case, DbCom

Building Python 2.7.10 with Visual Studio 2010 or 2015 - Google Chrome

您的浏览器(Chrome 33) 需要更新.该浏览器有诸多安全漏洞,无法显示本网站的所有功能.?了解如何更新浏览器 × p-nand-q.com C++? Python? Programming? Languages? Humor? Tools? Misc? Building Python 2.7.10 with Visual Studio 2010 or 2015 7th revision, August 7, 2015.A document history can be found at t

SQL Server on Linux: How? Introduction: SQL Server Blog

SQL Server Blog Official News from Microsoft's Information Platform https://blogs.technet.microsoft.com/dataplatforminsider/2016/12/16/sql-server-on-linux-how-introduction/ This post was authored by Scott Konersmann, Partner Engineering Manager, SQL

Using ROW_NUMBER() to paginate your data with SQL Server 2005 and ASP.NET

Jason Witty, 20 Nov 2005 4.67 (23 votes)Rate: vote 1vote 2vote 3vote 4vote 5With the release of SQL Server 2005, Microsoft introduces the long overdue ROW_NUMBER() function. In this article, we will walk through a C# implementation of pagination usin