My Oracle Support Banner

How to Create a SQL-testcase Using the DBMS_SQLDIAG Package [Video] (Doc ID 727863.1)

Last updated on MAY 02, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.4 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.

Goal

 


How to create a SQL-testcase using the DBMS_SQLDIAG package.

Export the testcase using DBMS_SQLDIAG.EXPORT_SQL_TESTCASE and import it again via DBMS_SQLDIAG.IMPORT_SQL_TESTCASE.

The package DBMS_SQLDIAG is available from 10.2.0.4 onwards, but Oracle11g or later has additional procedures / functions available. The '10.2.0.4.0' is a subset of the 11G package.

This document describes the use of dbms_sqldiag.export_sql_testcase() using the SQL_ID of a cursor.

The SQL_ID might not always be available, for instance in cases where the parsing of a SQL statement fails.

Other versions of the export_sql_testcase() are using the SQL-statement or the INCIDENT_ID in case it is related to an error and can be used instead.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 1. Exporting the Testcase
 
 
2. Importing the Testcase in another Database



My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.