Home > Enterprise >  Oracle accepting the recommended SQL profile
Oracle accepting the recommended SQL profile

Time:06-29

I have a query that I want to optimize in Oracle SQL Developer. On a Worksheet I write my query and I click SQL Tuning Advisor and it returns me a result as :

  Recommendation (estimated benefit: 82.8%)
  -----------------------------------------  
- Consider accepting the recommended SQL profile.
  execute dbms_sqltune.accept_sql_profile(task_name => 'staName51544',
  task_owner => 'sa', replace => TRUE);

I run the execute command and I get this result:

'PL/SQL procedure successfully completed.'

Can you show me how do I view the result of this execution ?

EDIT : I have run this query :

COLUMN category FORMAT a10
COLUMN sql_text FORMAT a20
SELECT NAME,type, SQL_TEXT, CATEGORY, STATUS FROM DBA_SQL_PROFILES;

but the SQL_TEXT here is exactly same as my query

CodePudding user response:

Regarding your question:

Can you show me how do I view the result of this execution ?

if you see your query on DBA_SQL_PROFILES, it means that a SQL Profile was created for your query, that's the purpose of the dbms_sqltune.accept_sql_profile procedure.

Indeed, a SQL Profile is based on your exact same query text, and Oracle will use it the next time the query is executed, which might( Or might not) improve your query execution plan.

I have the impression that you think that oracle will rewrite your query, that's not the case, a profile will just store attributes and statistics that oracle will use to run your query the next time

  • Related