My Oracle Support Banner

How to Create a SQL Patch to add Hints to Application SQL Statements (Doc ID 1931944.1)

Last updated on MARCH 12, 2021

Applies to:

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 Cloud Exadata Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.


In most applications, application code is static and cannot be modified by users. If there is a performance issue with application SQL, one potential solution is to modify it adding hints to force the desired access path. When the Application SQL statements cannot be modified, we have to look for better alternatives (such as SQL Plan Management Baselines etc.). However, in a time critical situation these solutions may not be applicable and a faster solution may be required.

In a time critical situation, one such alternative is the "SQL Patch". The SQL patch allows a user to "insert hints" into a query whose text cannot be edited due to the application constraints using an undocumented API called DBMS_SQLDIAG_INTERNAL.I_CREATE_PATCH() .


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
 Further Details

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