暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 绑定执行计划

原创 尚雷 2022-11-24
371
select ss.snap_id, ss.instance_number node, begin_interval_time, sql_id, plan_hash_value,
nvl(executions_delta,0) execs,
(elapsed_time_delta/decode(nvl(executions_delta,0),0,1,executions_delta))/1000000 avg_etime,
(buffer_gets_delta/decode(nvl(buffer_gets_delta,0),0,1,executions_delta)) avg_io
from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS
where s.sql_id in (select sql_id from dba_hist_sqltext  t where t.SQL_TEXT
like '%insurancet0_.businessId%insurancet0_.createUserId%insurancet0_.agreementNo%insurancet0_.autotransrenewFlag%insurancet0_.carKindName%')
and ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
order by 1, 2, 3 ;

------sql_id 5nygqk4a0gju1




select sql_id, sql_text  from dba_hist_sqltext where sql_id = '5nygqk4a0gju1'
 
 

SQL> @coe_xfr_sql_profile.sql

Parameter 1:
SQL_ID (required)

Enter value for 1: 5nygqk4a0gju1


PLAN_HASH_VALUE AVG_ET_SECS
--------------- -----------
       30876376         .24
     2659022311        .325
     2431754535         .44
      792089389        .692
     2358162492      33.855

Parameter 2:
PLAN_HASH_VALUE (required)

Enter value for 2: 792089389

Values passed to coe_xfr_sql_profile:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL_ID         : "5nygqk4a0gju1"
PLAN_HASH_VALUE: "792089389"

SQL>BEGIN
  2    IF :sql_text IS NULL THEN
  3      RAISE_APPLICATION_ERROR(-20100, 'SQL_TEXT for SQL_ID &&sql_id. was not found in memory (gv$sqltext_with_newlines) or AWR (dba_hist_sqltext).');
  4    END IF;
  5  END;
  6  /
SQL>SET TERM OFF;
SQL>BEGIN
  2    IF :other_xml IS NULL THEN
  3      RAISE_APPLICATION_ERROR(-20101, 'PLAN for SQL_ID &&sql_id. and PHV &&plan_hash_value. was not found in memory (gv$sql_plan) or AWR (dba_hist_sql_plan).');
  4    END IF;
  5  END;
  6  /
SQL>SET TERM OFF;

Execute coe_xfr_sql_profile_5nygqk4a0gju1_792089389.sql
on TARGET system in order to create a custom SQL Profile
with plan 792089389 linked to adjusted sql_text.


COE_XFR_SQL_PROFILE completed.



SQL>@coe_xfr_sql_profile_5nygqk4a0gju1_792089389.sql
SQL>REM
SQL>REM $Header: 215187.1 coe_xfr_sql_profile_5nygqk4a0gju1_792089389.sql 11.4.4.4 2020/11/05 carlos.sierra $
SQL>REM
SQL>REM Copyright (c) 2000-2012, Oracle Corporation. All rights reserved.
SQL>REM
SQL>REM AUTHOR
SQL>REM   carlos.sierra@oracle.com
SQL>REM
SQL>REM SCRIPT
SQL>REM   coe_xfr_sql_profile_5nygqk4a0gju1_792089389.sql
SQL>REM
SQL>REM DESCRIPTION
SQL>REM   This script is generated by coe_xfr_sql_profile.sql
SQL>REM   It contains the SQL*Plus commands to create a custom
SQL>REM   SQL Profile for SQL_ID 5nygqk4a0gju1 based on plan hash
SQL>REM   value 792089389.
SQL>REM   The custom SQL Profile to be created by this script
SQL>REM   will affect plans for SQL commands with signature
SQL>REM   matching the one for SQL Text below.
SQL>REM   Review SQL Text and adjust accordingly.
SQL>REM
SQL>REM PARAMETERS
SQL>REM   None.
SQL>REM
SQL>REM EXAMPLE
SQL>REM   SQL> START coe_xfr_sql_profile_5nygqk4a0gju1_792089389.sql;
SQL>REM
SQL>REM NOTES
SQL>REM   1. Should be run as SYSTEM or SYSDBA.
SQL>REM   2. User must have CREATE ANY SQL PROFILE privilege.
SQL>REM   3. SOURCE and TARGET systems can be the same or similar.
SQL>REM   4. To drop this custom SQL Profile after it has been created:
SQL>REM  EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('coe_5nygqk4a0gju1_792089389');
SQL>REM   5. Be aware that using DBMS_SQLTUNE requires a license
SQL>REM  for the Oracle Tuning Pack.
SQL>REM   6. If you modified a SQL putting Hints in order to produce a desired
SQL>REM  Plan, you can remove the artifical Hints from SQL Text pieces below.
SQL>REM  By doing so you can create a custom SQL Profile for the original
SQL>REM  SQL but with the Plan captured from the modified SQL (with Hints).
SQL>REM
SQL>WHENEVER SQLERROR EXIT SQL.SQLCODE;
SQL>REM
SQL>VAR signature NUMBER;
SQL>VAR signaturef NUMBER;
SQL>REM
SQL>DECLARE
  2  sql_txt CLOB;
  3  h       SYS.SQLPROF_ATTR;
  4  PROCEDURE wa (p_line IN VARCHAR2) IS
  5  BEGIN
  6  DBMS_LOB.WRITEAPPEND(sql_txt, LENGTH(p_line), p_line);
  7  END wa;
  8  BEGIN
  9  DBMS_LOB.CREATETEMPORARY(sql_txt, TRUE);
 10  DBMS_LOB.OPEN(sql_txt, DBMS_LOB.LOB_READWRITE);
 11  -- SQL Text pieces below do not have to be of same length.
 12  -- So if you edit SQL Text (i.e. removing temporary Hints),
 13  -- there is no need to edit or re-align unmodified pieces.
 14  wa(q'[/* select t from InsuranceTaskEO t where     1=1  AND  submitTime  ]');
 15  wa(q'[<=  :$0  AND  uwLevel  in  (  :$1  ,  :$2  ,  :$3  ,  :$4  ,  :$]');
 16  wa(q'[5  ,  :$6  )  AND  submitTime  >=  :$7  AND  status  in  (  :$8 ]');
 17  wa(q'[ )  and (auditType is null or auditType <> 'Auto')  and category]');
 18  wa(q'[ in ('UW','Reprint','UWEndorsement','UWAgrEndorsement','UWAgr') ]');
 19  wa(q'[ and businessNo is not null  and serialno in (select Max(i.seria]');
 20  wa(q'[lNo) from InsuranceTaskEO i  where i.actualId = t.actualId) AND ]');
 21  wa(q'[((1=1 AND  exists(select s.partyId from StructureViewEO s where ]');
 22  wa(q'[s.partyId=structureId AND (( structurePath like 'Underwriting:00]');
 23  wa(q'[000000/37020000/%'))) AND productCode in (select v.productCode f]');
 24  wa(q'[rom ProductViewEO v where 1=1 and (v.parentId in('05'))) AND uwL]');
 25  wa(q'[evel in ( '3C' ,     '3B' ,  '3A' ,  '2C' ,  '2B' ,  '2A' ))) order]');
 26  wa(q'[ by submitTime asc */ select insurancet0_.businessId as business]');
 27  wa(q'[Id1_6_, insurancet0_.createDate as createDate2_6_, insurancet0_.]');
 28  wa(q'[createUserId as createUserId3_6_, insurancet0_.ownerUserId as ow]');
 29  wa(q'[nerUserId4_6_, insurancet0_.partitionId as partitionId5_6_, insu]');
 30  wa(q'[rancet0_.schemaName as schemaName6_6_, insurancet0_.setId as set]');
 31  wa(q'[Id7_6_, insurancet0_.structureId as structureId8_6_, insurancet0]');
 32  wa(q'[_.tenantId as tenantId9_6_, insurancet0_.updateDate as updateDat]');
 33  wa(q'[e10_6_, insurancet0_.updateUserId as updateUserId11_6_, insuranc]');
 34  wa(q'[et0_.actualId as actualId12_6_, insurancet0_.agentFee as agentFe]');
 35  wa(q'[e13_6_, insurancet0_.agreementNo as agreementNo14_6_, insurancet]');
 36  wa(q'[0_.agreementPolicyFlag as agreementPolicyFl15_6_, insurancet0_.a]');
 37  wa(q'[ppIdentifyNumber as appIdentifyNumber16_6_, insurancet0_.applica]');
 38  wa(q'[ntCode as applicantCode17_6_, insurancet0_.applicantName as appl]');
 39  wa(q'[icantName18_6_, insurancet0_.assignee as assignee19_6_, insuranc]');
 40  wa(q'[et0_.assigneeName as assigneeName20_6_, insurancet0_.auditType a]');
 41  wa(q'[s auditType21_6_, insurancet0_.autotransrenewFlag as autotransre]');
 42  wa(q'[newFla22_6_, insurancet0_.batchNo as batchNo23_6_, insurancet0_.]');
 43  wa(q'[businessNatureCode as businessNatureCod24_6_, insurancet0_.busin]');
 44  wa(q'[essNatureName as businessNatureNam25_6_, insurancet0_.businessNo]');
 45  wa(q'[ as businessNo26_6_, insurancet0_.businessNoType as businessNoTy]');
 46  wa(q'[pe27_6_, insurancet0_.businessOffice as businessOffice28_6_, ins]');
 47  wa(q'[urancet0_.businessOfficeName as businessOfficeNam29_6_, insuranc]');
 48  wa(q'[et0_.businessTaskStatus as businessTaskStatu30_6_, insurancet0_.]');
 49  wa(q'[carBrandCode as carBrandCode31_6_, insurancet0_.carKindCode as c]');
 50  wa(q'[arKindCode32_6_, insurancet0_.carKindName as carKindName33_6_, i]');
 51  wa(q'[nsurancet0_.carUserNature as carUserNature34_6_, insurancet0_.ca]');
 52  wa(q'[rUserNatureCode as carUserNatureCode35_6_, insurancet0_.category]');
 53  wa(q'[ as category36_6_, insurancet0_.channelName as channelName37_6_,]');
 54  wa(q'[ insurancet0_.channelType as channelType38_6_, insurancet0_.chgo]');
 55  wa(q'[wnerflag as chgownerflag39_6_, insurancet0_.classCode as classCo]');
 56  wa(q'[de40_6_, insurancet0_.coInsuranceFlag as coInsuranceFlag41_6_, i]');
 57  wa(q'[nsurancet0_.coinsCode as coinsCode42_6_, insurancet0_.coinsFlag ]');
 58  wa(q'[as coinsFlag43_6_, insurancet0_.coinsLinkCode as coinsLinkCode44]');
 59  wa(q'[_6_, insurancet0_.coinsLinkFlag as coinsLinkFlag45_6_, insurance]');
 60  wa(q'[t0_.createUserName as createUserName46_6_, insurancet0_.currentU]');
 61  wa(q'[WTime as currentUWTime47_6_, insurancet0_.customerLevel as custo]');
 62  wa(q'[merLevel48_6_, insurancet0_.dueTime as dueTime49_6_, insurancet0]');
 63  wa(q'[_.effectiveImmediatelyFlag as effectiveImmediat50_6_, insurancet]');
 64  wa(q'[0_.endTime as endTime51_6_, insurancet0_.endorseEffectiveTime as]');
 65  wa(q'[ endorseEffectiveT52_6_, insurancet0_.endorseNo as endorseNo53_6]');
 66  wa(q'[_, insurancet0_.endorseType as endorseType54_6_, insurancet0_.en]');
 67  wa(q'[ergyTypes as energyTypes55_6_, insurancet0_.energyTypesCode as e]');
 68  wa(q'[nergyTypesCode56_6_, insurancet0_.engineNumber as engineNumber57]');
 69  wa(q'[_6_, insurancet0_.fetchTime as fetchTime58_6_, insurancet0_.fina]');
 70  wa(q'[lUwLevel as finalUwLevel59_6_, insurancet0_.firstUWTime as first]');
 71  wa(q'[UWTime60_6_, insurancet0_.foreignCarFlag as foreignCarFlag61_6_,]');
 72  wa(q'[ insurancet0_.formKey as formKey62_6_, insurancet0_.identifyNumb]');
 73  wa(q'[er as identifyNumber63_6_, insurancet0_.inquiryStatus as inquiry]');
 74  wa(q'[Status64_6_, insurancet0_.insurantCode as insurantCode65_6_, ins]');
 75  wa(q'[urancet0_.insurantIdentifyNumber as insurantIdentifyN66_6_, insu]');
 76  wa(q'[rancet0_.insurantName as insurantName67_6_, insurancet0_.isCeded]');
 77  wa(q'[ as isCeded68_6_, insurancet0_.isCoInsurance as isCoInsurance69_]');
 78  wa(q'[6_, insurancet0_.isReinsurance as isReinsurance70_6_, insurancet]');
 79  wa(q'[0_.isRenew as isRenew71_6_, insurancet0_.licenseName as licenseN]');
 80  wa(q'[ame72_6_, insurancet0_.licensePlateNo as licensePlateNo73_6_, in]');
 81  wa(q'[surancet0_.licenseType as licenseType74_6_, insurancet0_.loanveh]');
 82  wa(q'[icleflag as loanvehicleflag75_6_, insurancet0_.mainSalesmanName ]');
 83  wa(q'[as mainSalesmanName76_6_, insurancet0_.mobileUWFlag as mobileUWF]');
 84  wa(q'[lag77_6_, insurancet0_.newCarFlag as newCarFlag78_6_, insurancet]');
 85  wa(q'[0_.operationType as operationType79_6_, insurancet0_.ownedStruct]');
 86  wa(q'[ureName as ownedStructureNam80_6_, insurancet0_.owner as owner81]');
 87  wa(q'[_6_, insurancet0_.passengersNumber as passengersNumber82_6_, ins]');
 88  wa(q'[urancet0_.policyForm as policyForm83_6_, insurancet0_.policySort]');
 89  wa(q'[Name as policySortName84_6_, insurancet0_.policyStatusCode as po]');
 90  wa(q'[licyStatusCode85_6_, insurancet0_.policyStatusName as policyStat]');
 91  wa(q'[usName86_6_, insurancet0_.preUWTime as preUWTime87_6_, insurance]');
 92  wa(q'[t0_.premium as premium88_6_, insurancet0_.printTypeCode as print]');
 93  wa(q'[TypeCode89_6_, insurancet0_.printTypeName as printTypeName90_6_,]');
 94  wa(q'[ insurancet0_.priority as priority91_6_, insurancet0_.productCod]');
 95  wa(q'[e as productCode92_6_, insurancet0_.productName as productName93]');
 96  wa(q'[_6_, insurancet0_.proposalNo as proposalNo94_6_, insurancet0_.re]');
 97  wa(q'[cordClerkName as recordClerkName95_6_, insurancet0_.rejectFlag a]');
 98  wa(q'[s rejectFlag96_6_, insurancet0_.rejectType as rejectType97_6_, i]');
 99  wa(q'[nsurancet0_.renewalPolicyno as renewalPolicyno98_6_, insurancet0]');
100  wa(q'[_.reprintReason as reprintReason99_6_, insurancet0_.requestReaso]');
101  wa(q'[n as requestReason100_6_, insurancet0_.riskCode as riskCode101_6]');
102  wa(q'[_, insurancet0_.riskName as riskName102_6_, insurancet0_.saleama]');
103  wa(q'[n as saleaman103_6_, insurancet0_.saleamanName as saleamanName10]');
104  wa(q'[4_6_, insurancet0_.seatcount as seatcount105_6_, insurancet0_.se]');
105  wa(q'[condhandcarflag as secondhandcarfla106_6_, insurancet0_.sendSing]');
106  wa(q'[leCheckCarFlag as sendSingleCheckC107_6_, insurancet0_.serialNo ]');
107  wa(q'[as serialNo108_6_, insurancet0_.shortTermPolicyFlag as shortTerm]');
108  wa(q'[PolicyF109_6_, insurancet0_.sourceSystem as sourceSystem110_6_, ]');
109  wa(q'[insurancet0_.specId as specId111_6_, insurancet0_.startTime as s]');
110  wa(q'[tartTime112_6_, insurancet0_.status as status113_6_, insurancet0]');
111  wa(q'[_.structurePath as structurePath114_6_, insurancet0_.submitTime ]');
112  wa(q'[as submitTime115_6_, insurancet0_.taskId as taskId116_6_, insura]');
113  wa(q'[ncet0_.topFlag as topFlag117_6_, insurancet0_.transrenewFlag as ]');
114  wa(q'[transrenewFlag118_6_, insurancet0_.underwritingSource as underwr]');
115  wa(q'[itingSour119_6_, insurancet0_.useyears as useyears120_6_, insura]');
116  wa(q'[ncet0_.uwLevel as uwLevel121_6_, insurancet0_.vehicleQuality as ]');
117  wa(q'[vehicleQuality122_6_, insurancet0_.vehicleTonnage as vehicleTonn]');
118  wa(q'[age123_6_, insurancet0_.vinNo as vinNo124_6_, insurancet0_.visaC]');
119  wa(q'[odeType as visaCodeType125_6_ from act_policy_task insurancet0_ ]');
120  wa(q'[where 1=1 and insurancet0_.submitTime<=:1  and (insurancet0_.uwL]');
121  wa(q'[evel in (:2  , :3  , :4  , :5  , :6  , :7 )) and insurancet0_.su]');
122  wa(q'[bmitTime>=:8  and (insurancet0_.status in (:9 )) and (insurancet]');
123  wa(q'[0_.auditType is null or insurancet0_.auditType<>'Auto') and (ins]');
124  wa(q'[urancet0_.category in ('UW' , 'Reprint' , 'UWEndorsement' , 'UWA]');
125  wa(q'[grEndorsement' , 'UWAgr')) and (insurancet0_.businessNo is not n]');
126  wa(q'[ull) and (serialno in (select max(insurancet1_.serialNo) from ac]');
127  wa(q'[t_policy_task insurancet1_ where insurancet1_.actualId=insurance]');
128  wa(q'[t0_.actualId)) and 1=1 and (exists (select structurev2_.partyId ]');
129  wa(q'[from VIEW_STRUCTURE structurev2_ where structurev2_.partyId=stru]');
130  wa(q'[ctureId and (structurev2_.structurePath like 'Underwriting:00000]');
131  wa(q'[000/37020000/%'))) and (insurancet0_.productCode in (select prod]');
132  wa(q'[uctvie3_.productCode from VIEW_PRODUCT productvie3_ where 1=1 an]');
133  wa(q'[d (productvie3_.parentId in ('05')))) and (insurancet0_.uwLevel ]');
134  wa(q'[in ('3C' , '3B' , '3A' , '2C' , '2B' , '2A')) order by insurance]');
135  wa(q'[t0_.submitTime asc fetch first :10  rows only]');
136  DBMS_LOB.CLOSE(sql_txt);
137  h := SYS.SQLPROF_ATTR(
138  q'[BEGIN_OUTLINE_DATA]',
139  q'[IGNORE_OPTIM_EMBEDDED_HINTS]',
140  q'[OPTIMIZER_FEATURES_ENABLE('12.2.0.1')]',
141  q'[DB_VERSION('12.2.0.1')]',
142  q'[OPT_PARAM('_optimizer_extended_cursor_sharing' 'none')]',
143  q'[OPT_PARAM('_gby_hash_aggregation_enabled' 'false')]',
144  q'[OPT_PARAM('_optimizer_extended_cursor_sharing_rel' 'none')]',
145  q'[OPT_PARAM('_optimizer_adaptive_cursor_sharing' 'false')]',
146  q'[ALL_ROWS]',
147  q'[OUTLINE_LEAF(@"SEL$73B10338")]',
148  q'[MERGE(@"SEL$683B0107" >"SEL$6EF3DBF8")]',
149  q'[OUTLINE_LEAF(@"SEL$5")]',
150  q'[OUTLINE(@"SEL$6EF3DBF8")]',
151  q'[UNNEST(@"SEL$4")]',
152  q'[UNNEST(@"SEL$3")]',
153  q'[UNNEST(@"SEL$2")]',
154  q'[OUTLINE(@"SEL$683B0107")]',
155  q'[OUTLINE(@"SEL$7511BFD2")]',
156  q'[OUTLINE(@"SEL$4")]',
157  q'[OUTLINE(@"SEL$3")]',
158  q'[OUTLINE(@"SEL$2")]',
159  q'[OUTLINE(@"SEL$1")]',
160  q'[NO_ACCESS(@"SEL$5" "from$_subquery$_005"@"SEL$5")]',
161  q'[INDEX_RS_ASC(@"SEL$73B10338" "INSURANCET0_"@"SEL$1" ("ACT_POLICY_TASK"."STATUS" "ACT_POLICY_TASK"."UWLEVEL" "ACT_POLICY_TASK"."RISKCODE"))]',
162  q'[NUM_INDEX_KEYS(@"SEL$73B10338" "INSURANCET0_"@"SEL$1" "IDX1_ACT_POLICY_TASK_FIX2" 2)]',
163  q'[INDEX(@"SEL$73B10338" "PRODUCTVIE3_"@"SEL$4" ("VIEW_PRODUCT"."PARENTID" "VIEW_PRODUCT"."PRODUCTCODE"))]',
164  q'[INDEX(@"SEL$73B10338" "STRUCTUREV2_"@"SEL$3" ("VIEW_STRUCTURE"."PARTYID" "VIEW_STRUCTURE"."STRUCTUREPATH"))]',
165  q'[INDEX_RS_ASC(@"SEL$73B10338" "INSURANCET1_"@"SEL$2" ("ACT_POLICY_TASK"."ACTUALID"))]',
166  q'[LEADING(@"SEL$73B10338" "INSURANCET0_"@"SEL$1" "PRODUCTVIE3_"@"SEL$4" "STRUCTUREV2_"@"SEL$3" "INSURANCET1_"@"SEL$2")]',
167  q'[USE_NL(@"SEL$73B10338" "PRODUCTVIE3_"@"SEL$4")]',
168  q'[USE_NL(@"SEL$73B10338" "STRUCTUREV2_"@"SEL$3")]',
169  q'[USE_NL(@"SEL$73B10338" "INSURANCET1_"@"SEL$2")]',
170  q'[END_OUTLINE_DATA]');
171  :signature := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt);
172  :signaturef := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt, TRUE);
173  DBMS_SQLTUNE.IMPORT_SQL_PROFILE (
174  sql_text    => sql_txt,
175  profile     => h,
176  name        => 'coe_5nygqk4a0gju1_792089389',
177  description => 'coe 5nygqk4a0gju1 792089389 '||:signature||' '||:signaturef||'',
178  category    => 'DEFAULT',
179  validate    => TRUE,
180  replace     => TRUE,
181  force_match => FALSE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
182  DBMS_LOB.FREETEMPORARY(sql_txt);
183  END;
184  /

PL/SQL procedure successfully completed.

SQL>WHENEVER SQLERROR CONTINUE
SQL>SET ECHO OFF;

            SIGNATURE
---------------------
 12465785057307795270


           SIGNATUREF
---------------------
 12465785057307795270


... manual custom SQL Profile has been created


COE_XFR_SQL_PROFILE_5nygqk4a0gju1_792089389 completed
SQL>
SQL>
SQL>
SQL>\




select ss.snap_id, ss.instance_number node, begin_interval_time, sql_id, plan_hash_value,
nvl(executions_delta,0) execs,
(elapsed_time_delta/decode(nvl(executions_delta,0),0,1,executions_delta))/1000000 avg_etime,
(buffer_gets_delta/decode(nvl(buffer_gets_delta,0),0,1,executions_delta)) avg_io
from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS
where s.sql_id in (select sql_id from dba_hist_sqltext  t where t.SQL_TEXT
like '%insurancet0_.businessId%insurancet0_.createUserId%insurancet0_.agreementNo%insurancet0_.autotransrenewFlag%insurancet0_.carKindName%')
and ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
and sql_id='8bjp8uc94k007'
order by 8;



select ss.snap_id, ss.instance_number node, begin_interval_time, sql_id, plan_hash_value,
nvl(executions_delta,0) execs,
(elapsed_time_delta/decode(nvl(executions_delta,0),0,1,executions_delta))/1000000 avg_etime,
(buffer_gets_delta/decode(nvl(buffer_gets_delta,0),0,1,executions_delta)) avg_io
from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS
where s.sql_id in (select sql_id from dba_hist_sqltext  t where t.SQL_TEXT
like '%insurancet0_.businessId%insurancet0_.createUserId%insurancet0_.agreementNo%insurancet0_.autotransrenewFlag%insurancet0_.carKindName%')
and ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
--and sql_id='8uz9vrabvk279'
order by 1, 2, 3 ;



select sql_id, sql_text
  from dba_hist_sqltext
 where sql_id = '8bjp8uc94k007'
 
 select * from  gV$sql_plan where sql_id='254n8bq9duf7w';
 
 
 
最后修改时间:2022-11-29 09:28:43
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论