Home » RDBMS Server » Server Administration » Oracle 10g SQL Tuning Advisor
Oracle 10g SQL Tuning Advisor [message #254795] Sat, 28 July 2007 06:20 Go to next message
jobasas
Messages: 1
Registered: July 2007
Junior Member
I am working as a junior DBA. I tried to tune a query using SQL Tuning Advisor that is with DBMS_SQLTUNE.I have created the tuning task successfully with DBMS_SQLTUNE.create_tuning_task.But when i execute the tuning task with EXEC DBMS_SQLTUNE.execute_tuning_task() i got an error like

SQL> EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');

BEGIN DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three'); END;

*
ERROR at line 1:
ORA-00081: address range [0x60000000000A7D70, 0x60000000000A7D74) is not
readable
ORA-00600: internal error code, arguments: [kesatmGetSqlStats:optCost], [], [],
[], [], [], [], []
ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SQLTUNE", line 1008
ORA-06512: at line 1


The oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi. The OS is HP-UX. The version is HP-UX B.11.23 U ia64.

I tried to execute DBMS_SQLTUNE as DWH user.I have granted the advisor,DROP ANY SQL PROFILE,ALTER ANY SQL PROFILE,CREATE ANY SQL PROFILE privileges and DBA roles to the DWH user. The way i ran DBMS_SQLTUNE is, first i logged in as DWH user and i tried to execute the query for getting the SQL_ID for the query. For getting the SQL_ID i selected the SQL_ID column value for the DWH user session from v$session.I kept that query executing and meanwhile i opened another session as DWH user and created the tuning task as follows

DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
sql_id => 'b65fj39dkkb9v',
scope => DBMS_SQLTUNE.scope_limited,
time_limit => 3600,
task_name => 'rep_three',
description => 'Report Tuning');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/

The creation of tuning task was successful.And i executed the tuning task as follows

EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');

The above mentioned errors came when i executed the tuning task.

I am also adding the query which i have tried to tune

select * from dwh.beneficiary_dim BEN_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 1) PERMANENT_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 2) BANK_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 3) NOM_GUARDIAN_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 4) CORR_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 6) MINOR_ADDRESS,
(Select rp.requestid as requestid,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,1,instr(rp.value,'|',1,1)-1),'','ALL',substr(rp.value,1,instr(rp.value,'| ',1,1)-1))) as Name,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'| ',1,1)+1))),'','ALL',substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))))) as Address,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,2)+1)),'','ALL',substr(rp.value,(instr(rp.value,'|' ,1,2)+1)))) as PAN
from disadmin.requestparameters rp, disadmin.requestparameters rps, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_PARAM_VALUE'
and rr.status = 'A'
and rp.requestid = rr.id
and rp.id = rps.id) P_PARAM_VALUE,
(Select rp.requestid as requestid, rp.value as Type
from disadmin.requestparameters rp, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_NAME_TYPE'
and rr.status = 'A'
and rp.requestid = rr.id) P_NAME_TYPE,
(Select rp.requestid as requestid, rp.value as Addtype
from disadmin.requestparameters rp, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_ADDRESS_TYPE'
and rr.status = 'A'
and rp.requestid = rr.id) P_ADDRESS_TYPE
where ( 1= case when P_NAME_TYPE.Type = 'F' then
case when BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%')
then 1
else null end
else
case when P_NAME_TYPE.Type = 'ALL' then
case when (BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%'))
and BEN_DIM.BDM_SECOND_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_SECOND_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
and BEN_DIM.BDM_THIRD_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_THIRD_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
then 1
else null end
else null end
end )
and BEN_DIM.BDM_IT_PAN like DECODE(P_PARAM_VALUE.PAN,'ALL','%'||BEN_DIM.BDM_IT_PAN||'%','%'||P_PARAM_VALUE.PAN||'%')
and (1 = case when P_ADDRESS_TYPE.ADDTYPE = 1 then
case when instr(PERMANENT_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',PERMANENT_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 3 then
case when instr(NOM_GUARDIAN_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',NOM_GUARDIAN_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 4 then
case when instr(CORR_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',CORR_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 6 then
case when instr(MINOR_ADDRESS.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',MINOR_ADDRESS.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
else null end );

The above query also tries to access some tables from another user DISADMIN. Could you please help me in solving this problem ? I am the only DBA here.
Re: Oracle 10g SQL Tuning Advisor [message #254804 is a reply to message #254795] Sat, 28 July 2007 07:42 Go to previous message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-00600 = Oracle bug => search on Metalink and/or call Oracle support

Regards
Michel
Previous Topic: SPFILE
Next Topic: A very confusing ORA-22930 for UTL_FILE_DIR
Goto Forum:
  


Current Time: Fri Sep 20 08:39:35 CDT 2024