Skip to main content

Posts

Showing posts from July, 2018

Manual Creation of a SQL Profile

Occasionally as a DBA you will come across a query that works very well, but for some reason insists on using an index, even when you know that the index is not appropriate for that query. This problem may have multiple causes, and fixing it may not be easy.  Particularly if it is generated by an application, and you the DBA, do not have the ability to modify the query. In that case, it is helpful for the DBA to be able to manually create a hint for the query and load it into the database as a SQL profile.  This article will cover the steps for the manual creation of a SQL profile. For the purposes of this article, I have created a table using the commands below: create table perf_table (prim_key number, data_value1 varchar2(10), data_value2 varchar2(20), data_value3 varchar2(200)) tablespace users; insert into my_table ( select prim_key.nextval, decode(mod(prim_key.currval,2),1,'ODD','EVEN'), decode(mod(prim_key.currval,2),1,'EVEN...