当前位置:首页 > 开发 > 数据库 > 正文

Oracle 11g SQL Test Case Builder(原创)

发表于: 2013-11-10   作者:czmmiao   来源:转载   浏览次数:
摘要: Building SQL Test CasesFor 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 SQ

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.
Creating a Test Case
You can access the SQL Test Case Builder from Enterprise Manager or manually using the DBMS_SQLDIAG package.
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
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
SQL Test Case Builder Procedures in DBMS_SQLDIAG
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

 

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

本文原创,转载请注明出处、作者

如有错误,欢迎指正

邮箱:czmcj@163.com

Oracle 11g SQL Test Case Builder(原创)

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
Overview In Oracle Database 10g, Oracle introduced the new Transparent Data Encryption (TDE)
Automatic Diagnostic Repository The automatic diagnostic repository tracks all problems and i
##Objectives: 1.统一SQL语句编写格式 2.让SQL语句看起来美观点,更容易阅读 3.增强可维护性,在代
前言 数据的作业不仅仅是存放数据,它的更重要的作用是根据用户的需求(也就是条件)来显示用户所需
--书藉位置Place目录 drop table BookPlaceList; create table BookPlaceList ( BookPlaceID INT PR
首先看我准备一张数据表(这是做一个数据测试的表,就相当于它们,一天打好几场球) 没错,就需要得
需求:获取用户A和用户B的关系(关系包括:关注(00)、被关注(01)、相互关注(02)、无任何关系(该条记录
sql语言中有没有类似C语言中的switch case的语句?? 没有,用case when 来代替就行了. 例如,下面的
-- 每月入职人数统计 CASE WHEN 条件1 THEN 结果1 WHEN 条件2 THEN 结果2 ELSE 结果N END AS ALIAS
供应商评价管理系统中要对供应商的品质等级进行划分,规则如下: 根据供应商的综合得出其品质等级。
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号