My Oracle Support Banner

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

Last updated on JUNE 09, 2023

Applies to:

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



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 onwards, but Oracle11g or later has additional procedures / functions available. The '' 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.


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
 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.