Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_SQLTUNE (2 merged) (oracle 10g)
DBMS_SQLTUNE (2 merged) [message #481132] Sun, 31 October 2010 23:30 Go to next message
vinodraj4u@gmail.com
Messages: 15
Registered: January 2010
Location: bangalore
Junior Member

hi,

Anybodby please help with this issue.
Im trying to execute dbms_sqltune package but it is giving error,the steps i followed is below

UAT28~> exec dbms_sqltune.create_tuning_task(begin_snap => 14728,end_snap => 14729,sql_id => '8t7vr62cfukkw');
BEGIN dbms_sqltune.create_tuning_task(begin_snap => 14728,end_snap => 14729,sql_id => '8t7vr62cfukkw'); END;

*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'CREATE_TUNING_TASK'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


im not able to understand the error.Is there any prerequisite to run dbms_sqltune.
Re: DBMS_SQLTUNE [message #481134 is a reply to message #481132] Sun, 31 October 2010 23:34 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Which part of the Posting Guidelines ( http://www.orafaq.com/forum/t/88153/0/ ) did you NOT read & follow?
Was it the part about using SEARCH ( http://www.orafaq.com/forum/s/136107/ ) or GOOGLE ( http://google.com ) before posting?

http://www.orafaq.com/node/1837
Re: DBMS_SQLTUNE (2 merged) [message #481139 is a reply to message #481132] Mon, 01 November 2010 01:46 Go to previous messageGo to next message
John Watson
Messages: 8989
Registered: January 2010
Location: Global Village
Senior Member
Hi - if you do this,
describe dbms_sqltune

you'll see that dbms_sqltune.create tuning_task is a function that returns a varchar2, so you can't execute it in the way that you are doing: your method will work only for procedures, that return nthing. Try this instead:
select dbms_sqltune.create_tuning_task(begin_snap => 14728,
end_snap => 14729,sql_id => '8t7vr62cfukkw') from dual;


Re: DBMS_SQLTUNE (2 merged) [message #481152 is a reply to message #481139] Mon, 01 November 2010 04:41 Go to previous messageGo to next message
vinodraj4u@gmail.com
Messages: 15
Registered: January 2010
Location: bangalore
Junior Member

i tried with the above stated statement its giving error,i tried with this

UAT28~> select dbms_sqltune.create_tuning_task(begin_snap => 14728,end_snap => 14729,sql_id => '8t7vr62cfukkw') from dual;
select dbms_sqltune.create_tuning_task(begin_snap => 14728,end_snap => 14729,sql_id => '8t7vr62cfukkw') from dual
*
ERROR at line 1:
ORA-00907: missing right parenthesis
Re: DBMS_SQLTUNE (2 merged) [message #481153 is a reply to message #481152] Mon, 01 November 2010 04:46 Go to previous messageGo to next message
cookiemonster
Messages: 13972
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can't use named notation for parameters in sql, it only works in PL/SQL. So call it within a begin-end block
Re: DBMS_SQLTUNE (2 merged) [message #481161 is a reply to message #481152] Mon, 01 November 2010 05:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68770
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Naming the parameter is allowed only in 11g, in 10g you have to use positional parameter values.

Regards
Michel
Re: DBMS_SQLTUNE (2 merged) [message #481162 is a reply to message #481161] Mon, 01 November 2010 05:54 Go to previous messageGo to next message
John Watson
Messages: 8989
Registered: January 2010
Location: Global Village
Senior Member
Sorry ! should gave done it like this:
jw> variable v varchar2(1000);
jw> exec :v:=dbms_sqltune.create_tuning_task(begin_snap => 1273,end_snap => 1274,sql_id => '459f3z9u4fb3u');

PL/SQL procedure successfully completed.

jw>

Re: DBMS_SQLTUNE (2 merged) [message #481171 is a reply to message #481162] Mon, 01 November 2010 08:50 Go to previous message
vinodraj4u@gmail.com
Messages: 15
Registered: January 2010
Location: bangalore
Junior Member

hi,
it worked.Thanks alot.

[Updated on: Mon, 01 November 2010 08:59] by Moderator

Report message to a moderator

Previous Topic: Please can you provide the query for this
Next Topic: join two table in different instance
Goto Forum:
  


Current Time: Tue Sep 09 14:15:40 CDT 2025