-----手动创建SQL PROFILE (HINTS需要自己去找)
declare
sqltext clob;
begin
select sql_fulltext into sqltext from v$sql where sql_id='373x9rquqh040' and child_number=0 ;
dbms_sqltune.import_sql_profile
(name=>'chad_sqlprofile_002',
sql_text=> sqltext,
replace=>true,
profile=>sqlprof_attr('INDEX_RS_ASC(@"SEL$F5BB74E1" "A"@"SEL$2" ("POL_BEN"."POLNO"))')) ;
end;
-----手动创建SQL PROFILE(当V$SQL中没有时候)
select * from table(dbms_xplan.display_cursor('373x9rquqh040','1','ADVANCED'));
select * from table(dbms_xplan.display_awr('aju15b825a6vx','3855440803','174795715','ADVANCED'));
declare
sqltext clob;
begin
select sql_text into sqltext from dba_hist_sqltext where sql_id='373x9rquqh040' ;
dbms_sqltune.import_sql_profile
(name=>'chad_sqlprofile_003',
sql_text=> sqltext,
replace=>true,
profile=>sqlprof_attr('INDEX_RS_ASC(@"SEL$F5BB74E1" "A"@"SEL$2" ("POL_BEN"."POLNO"))')) ;
end;
declare
sqltext clob;
begin
select sql_fulltext into sqltext from v$sql where sql_id='373x9rquqh040' and child_number=0 ;
dbms_sqltune.import_sql_profile
(name=>'chad_sqlprofile_002',
sql_text=> sqltext,
replace=>true,
profile=>sqlprof_attr('INDEX_RS_ASC(@"SEL$F5BB74E1" "A"@"SEL$2" ("POL_BEN"."POLNO"))')) ;
end;
-----手动创建SQL PROFILE(当V$SQL中没有时候)
select * from table(dbms_xplan.display_cursor('373x9rquqh040','1','ADVANCED'));
select * from table(dbms_xplan.display_awr('aju15b825a6vx','3855440803','174795715','ADVANCED'));
declare
sqltext clob;
begin
select sql_text into sqltext from dba_hist_sqltext where sql_id='373x9rquqh040' ;
dbms_sqltune.import_sql_profile
(name=>'chad_sqlprofile_003',
sql_text=> sqltext,
replace=>true,
profile=>sqlprof_attr('INDEX_RS_ASC(@"SEL$F5BB74E1" "A"@"SEL$2" ("POL_BEN"."POLNO"))')) ;
end;