1. Advisor tuning results below
GENERAL INFORMATION SECTION
-------------------------------------------------------------------------------
Tuning Task Name : CNSGO7INFO281642270.6094852083
Tuning Task Owner : EDWM_AMZ_FINANCE_BO
Workload Type : Single SQL Statement
Scope : COMPREHENSIVE
Time Limit(seconds): 1800
Completion Status : INTERRUPTED
Started at : 09/23/2015 08:37:49
Completed at : 09/23/2015 09:08:04
-------------------------------------------------------------------------------
Error: ORA-13639: The current operation was interrupted because it timed out.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Schema Name: EDWM_AMZ_FINANCE_BO
SQL ID : 0j7p0qvjqt8pc
SQL Text : SELECT
'CST-1013',
Table__105.HIERARCHY_NAME,
Table__105.ORG_UNIT_DISPLAY_SORT,
Table__105.ORG_UNIT_DISPLAY_LEVEL,
Table__105.ORG_UNIT_DISPLAY_INDENT,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.PARENT_DISPLAY_NAME,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE || ' '
||EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'
'||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L2_Name
,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL3,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_NUMBER,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_DESC_SHORT,
EDWM_AMZ_FINANCE.MD_MONTH.YEAR_NUMBER,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_NAME
,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
,
EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE,
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME
='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END)
,
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_C
M * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT
_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_Y
TD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONEN
T_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_
FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_C
M * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT
_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_Y
TD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONEN
T_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_
FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_F
ACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY *
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FAC
TOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ACTUAL' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_
MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONE
NT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'BUDGET' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAM
E='Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_
MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONE
NT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'RBU2' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=
'Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MA
V * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT
_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE=
'ABU' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME='
Value' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MAV
* EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_
FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE )
END),
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_CODE
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_CODE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_CONTEXT_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L1_Code,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION
FROM
EDWM_AMZ_FINANCE.MF_AFG_MONTHLY,
(
Select Distinct ORG_HIER_KEY,HIERARCHY_NAME,ORG_UNIT_KEY_DISPLA
Y,ORG_UNIT_DISPLAY_CODE,ORG_UNIT_DISPLAY_NAME,ORG_UNIT_DISPLAY_SH
ORT_NAME,ORG_UNIT_REPORTING_CODE,ORG_UNIT_REPORTING_NAME,ORG_UNIT
_DISPLAY_INDENT,ORG_UNIT_DISPLAY_SORT,ORG_UNIT_DISPLAY_LEVEL,PARE
NT_DISPLAY_NAME
FROM EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS
) Table__105,
EDWM_AMZ_FINANCE.MD_ACTIVITY,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER,
EDWM_AMZ_FINANCE.MD_COST_CENTRE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER,
EDWM_AMZ_FINANCE.MD_MONTH,
EDWM_AMZ_FINANCE.MD_SCENARIO,
EDWM_AMZ_FINANCE.MD_CURRENCY EDWM_AMZ_FINANCE_MD_CURRENCY2,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE,
EDWM_AMZ_FINANCE.MD_BUDROX_RATES,
EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS
WHERE
( EDWM_AMZ_FINANCE.MD_MONTH.MONTH_KEY=EDWM_AMZ_FINANCE.MF_AFG_M
ONTHLY.MONTH_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.SCENARIO_KEY=EDWM_AMZ_FI
NANCE.MD_SCENARIO.SCENARIO_KEY )
AND ( EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_KEY=EDWM_AMZ
_FINANCE.MF_AFG_MONTHLY.COST_CENTRE_KEY )
AND ( EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_KEY=EDWM_AMZ_FINAN
CE.MF_AFG_MONTHLY.ACTIVITY_KEY )
AND ( EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS.ORG_UNIT_KEY_FACT=ED
WM_AMZ_FINANCE.MF_AFG_MONTHLY.ORGANISATION_KEY )
AND ( EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PRODUCT_HIER_KEY=EDWM_A
MZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_HIER_KEY )
AND ( EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_FACT_KEY=EDWM_A
MZ_FINANCE.MF_AFG_MONTHLY.PRODUCT_KEY )
AND ( EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_VARIAN
T_KEY=EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.VIRTUAL_METRIC
_VARIANT_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VARIANT_KEY=EDWM_
AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_VARIANT_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.CURRENCY_KEY=EDWM_AMZ_FI
NANCE.MD_BUDROX_RATES.CURRENCY_KEY_BASE )
AND ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.CURRENCY_KEY_TARGET=EDW
M_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_KEY )
AND ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.ACCOUNT_KEY=EDWM_AMZ
_FINANCE.MF_AFG_MONTHLY.ACCOUNT_KEY )
AND ( Table__105.ORG_HIER_KEY=EDWM_AMZ_FINANCE.MD_ORG_DESCENDA
NTS.ORG_HIER_KEY and Table__105.ORG_UNIT_KEY_DISPLAY=EDWM_AMZ_FIN
ANCE.MD_ORG_DESCENDANTS.ORG_UNIT_KEY_REPORTING and
Table__105.ORG_UNIT_DISPLAY_NAME=EDWM_AMZ_FINANCE.MD_ORG_DESCENDA
NTS.ORG_UNIT_REPORTING_NAME )
AND
(
( ( Table__105.HIERARCHY_NAME ) = 'International Org' )
AND
( ( Decode(Table__105.ORG_UNIT_REPORTING_CODE,'UNK',Table__105
.ORG_UNIT_REPORTING_NAME,Table__105.ORG_UNIT_REPORTING_CODE || '
| ' || Table__105.ORG_UNIT_REPORTING_NAME) ) IN ('International
Region') OR ' My Organisations' IN ('International Region') )
AND
( ( Table__105.ORG_UNIT_DISPLAY_INDENT )-1 <= '3' )
AND
( ( EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
) In 'International Product Hierarchy' )
AND
( (EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1 ) In ('
All Product Group L1') OR ' All Product Group L1' In (' All
Product Group L1') )
AND
( (EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2 ) In ('
All Product Group L2') OR ' All Product Group L2' In (' All
Product Group L2') )
AND
( ( EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3 ) In ('
All Product Group L3') OR ' All Product Group L3' In (' All
Product Group L3') )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION
) = 'Standard Cost Account Hierarchy' )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION )
IN (' All Account Group Names')
OR ' All Account Group Names' IN (' All Account Group Names')
)
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION )
IN (' All Account Sub Group Names')
OR ' All Account Sub Group Names' IN (' All Account Sub Group
Names') )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'
'||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION ) IN
(' All Enigma Account') Or ' All Enigma Account' IN (' All
Enigma Account') )
AND
( ( EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME ) IN
(' All Enigma Function') Or ' All Enigma Function' IN (' All
Enigma Function') )
AND
( ( EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L2_NAME ) IN
(' All Enigma Department') Or ' All Enigma Department' IN ('
All Enigma Department') )
AND
( ( EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
) In (' All Activities') OR ' All Activities' In (' All
Activities') )
AND
( to_number(( trim(to_char(EDWM_AMZ_FINANCE.MD_MONTH.MONTH_COD
E,'999999')) )) = (case when 'Latest Reporting Month' = 'Latest
Reporting Month'
then
to_number(to_char(ADD_MONTHS(SYSDATE,-1),'yyyymm'))
else
to_number('Latest Reporting Month') end) )
AND
( ( EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE ) IN 'USD'
)
AND
( ( substr(EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE_MONT
H_KEY,1,4) ) = (case when 'Default RoX Year' = 'Default RoX
Year'
then (select to_char(edwm_amz_finance.afg_default_budrox_year.def
ault_budrox_rates) from edwm_amz_finance.afg_default_budrox_year)
else 'Default RoX Year' end) )
AND
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE IN
( 'CFC' )
AND
Case
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,5,2) = 'CA' Then 'Central Actuals'
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,5,2) = 'OA' Then 'Operational Actuals'
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,5,2) = 'EA' Then 'Early View Actuals'
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,5,2) = 'MA' Then 'Emerging Actuals'
End IN ( 'Central Actuals' )
AND
( ( Case
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,7,2) = 'LB' Then 'Local (APEX)'
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,7,2) = 'CB' Then 'Central (Phase1)'
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_con
text_code,7,2) = 'OB' Then 'Operational (ERP)'
End )= 'Central (Phase1)' )
AND
(
( EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE In ' AUTO' OR '
AUTO' In ' AUTO' )
OR
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
IN ( 'ACTUAL','BUDGET' )
)
)
GROUP BY
'CST-1013',
Table__105.HIERARCHY_NAME,
Table__105.ORG_UNIT_DISPLAY_SORT,
Table__105.ORG_UNIT_DISPLAY_LEVEL,
Table__105.ORG_UNIT_DISPLAY_INDENT,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.PARENT_DISPLAY_NAME,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE || ' '
||EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'
'||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L2_Name
,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL3,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_NUMBER,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_DESC_SHORT,
EDWM_AMZ_FINANCE.MD_MONTH.YEAR_NUMBER,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_NAME
,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
,
EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_CODE
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_CODE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_CONTEXT_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L1_Code,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION
-------------------------------------------------------------------------------
ERRORS SECTION
-------------------------------------------------------------------------------
- The current operation was interrupted because it timed out.
-------------------------------------------------------------------------------
EXPLAIN PLANS SECTION
-------------------------------------------------------------------------------
1- Original
-----------
Plan hash value: 1402630000
-----------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
-----------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 563 | 991 (1)| 00:00:18 | | |
| 1 | TEMP TABLE TRANSFORMATION | | | | | | | |
| 2 | LOAD AS SELECT | SYS_TEMP_0FD9EEECA_DC0ED1A0 | | | | | | |
|* 3 | HASH JOIN | | 1 | 49 | 8 (13)| 00:00:01 | | |
|* 4 | TABLE ACCESS BY INDEX ROWID | MD_VIRTUAL_METRIC | 1 | 37 | 3 (0)| 00:00:01 | | |
|* 5 | INDEX RANGE SCAN | IDX_BUSINESS_METRIC_CODE | 8 | | 1 (0)| 00:00:01 | | |
| 6 | TABLE ACCESS FULL | MD_VIRTUAL_METRIC_STRUCTURE | 6480 | 77760 | 4 (0)| 00:00:01 | | |
| 7 | LOAD AS SELECT | SYS_TEMP_0FD9EEECB_DC0ED1A0 | | | | | | |
| 8 | NESTED LOOPS | | | | | | | |
| 9 | NESTED LOOPS | | 1 | 859 | 62 (2)| 00:00:02 | | |
| 10 | VIEW | | 1 | 824 | 60 (2)| 00:00:02 | | |
| 11 | SORT UNIQUE | | 1 | 139 | 60 (2)| 00:00:02 | | |
|* 12 | TABLE ACCESS BY INDEX ROWID | MD_ORG_DESCENDANTS | 1 | 139 | 59 (0)| 00:00:02 | | |
|* 13 | INDEX RANGE SCAN | XIE5MD_ORG_DESCENDANTS | 2851 | | 6 (0)| 00:00:01 | | |
|* 14 | INDEX RANGE SCAN | XIE3MD_ORG_DESCENDANTS | 1 | | 1 (0)| 00:00:01 | | |
| 15 | TABLE ACCESS BY INDEX ROWID | MD_ORG_DESCENDANTS | 1 | 35 | 2 (0)| 00:00:01 | | |
| 16 | HASH GROUP BY | | 1 | 563 | 921 (1)| 00:00:17 | | |
| 17 | NESTED LOOPS | | | | | | | |
| 18 | NESTED LOOPS | | 1 | 563 | 905 (1)| 00:00:17 | | |
|* 19 | HASH JOIN | | 1 | 477 | 903 (1)| 00:00:17 | | |
|* 20 | HASH JOIN | | 1 | 468 | 901 (1)| 00:00:17 | | |
|* 21 | HASH JOIN | | 1 | 446 | 874 (1)| 00:00:16 | | |
|* 22 | HASH JOIN | | 1 | 406 | 871 (1)| 00:00:16 | | |
|* 23 | HASH JOIN | | 1 | 372 | 867 (1)| 00:00:16 | | |
|* 24 | HASH JOIN | | 1 | 356 | 864 (1)| 00:00:16 | | |
|* 25 | HASH JOIN | | 1 | 273 | 861 (1)| 00:00:16 | | |
|* 26 | HASH JOIN | | 1 | 238 | 859 (1)| 00:00:16 | | |
|* 27 | HASH JOIN | | 1 | 212 | 850 (1)| 00:00:16 | | |
| 28 | MERGE JOIN CARTESIAN | | 1 | 144 | 46 (0)| 00:00:01 | | |
|* 29 | TABLE ACCESS BY INDEX ROWID | MH_PRODUCT_HIER | 1 | 30 | 2 (0)| 00:00:01 | | |
|* 30 | INDEX SKIP SCAN | SYS_C00175136 | 1 | | 1 (0)| 00:00:01 | | |
| 31 | BUFFER SORT | | 1 | 114 | 44 (0)| 00:00:01 | | |
|* 32 | TABLE ACCESS FULL | MD_GL_ACCOUNT_HIER | 1 | 114 | 44 (0)| 00:00:01 | | |
| 33 | PARTITION RANGE ALL | | 75 | 5100 | 804 (1)| 00:00:15 | 1 | 2641 |
|* 34 | TABLE ACCESS BY LOCAL INDEX ROWID| MF_AFG_MONTHLY | 75 | 5100 | 804 (1)| 00:00:15 | 1 | 2641 |
| 35 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
| 36 | BITMAP AND | | | | | | | |
| 37 | BITMAP MERGE | | | | | | | |
| 38 | BITMAP KEY ITERATION | | | | | | | |
| 39 | BUFFER SORT | | | | | | | |
| 40 | TABLE ACCESS FULL | SYS_TEMP_0FD9EEECA_DC0ED1A0 | 1 | 4 | 2 (0)| 00:00:01 | | |
|* 41 | BITMAP INDEX RANGE SCAN | XIE3MF_AFG_MONTHLY_2288 | | | | | 1 | 2641 |
| 42 | BITMAP MERGE | | | | | | | |
| 43 | BITMAP KEY ITERATION | | | | | | | |
| 44 | BUFFER SORT | | | | | | | |
|* 45 | TABLE ACCESS FULL | MD_MONTH | 1 | 12 | 8 (0)| 00:00:01 | | |
|* 46 | BITMAP INDEX RANGE SCAN | XIE1MF_AFG_MONTHLY_2288 | | | | | 1 | 2641 |
| 47 | BITMAP MERGE | | | | | | | |
| 48 | BITMAP KEY ITERATION | | | | | | | |
| 49 | BUFFER SORT | | | | | | | |
| 50 | TABLE ACCESS FULL | SYS_TEMP_0FD9EEECB_DC0ED1A0 | 6 | 30 | 2 (0)| 00:00:01 | | |
|* 51 | BITMAP INDEX RANGE SCAN | XIE2MF_AFG_MONTHLY_2288 | | | | | 1 | 2641 |
|* 52 | TABLE ACCESS FULL | MD_MONTH | 1 | 26 | 8 (0)| 00:00:01 | | |
| 53 | TABLE ACCESS FULL | SYS_TEMP_0FD9EEECA_DC0ED1A0 | 1 | 35 | 2 (0)| 00:00:01 | | |
| 54 | TABLE ACCESS FULL | SYS_TEMP_0FD9EEECB_DC0ED1A0 | 6 | 498 | 2 (0)| 00:00:01 | | |
| 55 | TABLE ACCESS FULL | MD_SCENARIO | 7 | 112 | 3 (0)| 00:00:01 | | |
| 56 | TABLE ACCESS FULL | MD_ACTIVITY | 33 | 1122 | 3 (0)| 00:00:01 | | |
| 57 | TABLE ACCESS FULL | MD_COST_CENTRE | 37 | 1480 | 3 (0)| 00:00:01 | | |
| 58 | TABLE ACCESS BY INDEX ROWID | MD_BUDROX_RATES | 6389 | 137K| 26 (0)| 00:00:01 | | |
|* 59 | INDEX RANGE SCAN | XAK1MD_BUDROX_RATES2 | 6389 | | 4 (0)| 00:00:01 | | |
| 60 | TABLE ACCESS FULL | AFG_DEFAULT_BUDROX_YEAR | 1 | 4 | 3 (0)| 00:00:01 | | |
| 61 | TABLE ACCESS BY INDEX ROWID | MD_CURRENCY | 1 | 9 | 2 (0)| 00:00:01 | | |
|* 62 | INDEX RANGE SCAN | IDX_CURRENCY_CODE | 1 | | 1 (0)| 00:00:01 | | |
|* 63 | INDEX UNIQUE SCAN | XPKMD_PRODUCT_HIER | 1 | | 1 (0)| 00:00:01 | | |
| 64 | TABLE ACCESS BY INDEX ROWID | MD_PRODUCT_HIER | 1 | 86 | 2 (0)| 00:00:01 | | |
-----------------------------------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - access("MD_VIRTUAL_METRIC"."VIRTUAL_METRIC_VARIANT_KEY"="MD_VIRTUAL_METRIC_STRUCTURE"."VIRTUAL_METRIC_VARIANT_KEY")
4 - filter(CASE SUBSTR("VIRTUAL_METRIC_CONTEXT_CODE",7,2) WHEN 'LB' THEN 'Local (APEX)' WHEN 'CB' THEN 'Central (Phase1)' WHEN 'OB'
THEN 'Operational (ERP)' END ='Central (Phase1)' AND CASE SUBSTR("VIRTUAL_METRIC_CONTEXT_CODE",5,2) WHEN 'CA' THEN 'Central Actuals'
WHEN 'OA' THEN 'Operational Actuals' WHEN 'EA' THEN 'Early View Actuals' WHEN 'MA' THEN 'Emerging Actuals' END ='Central Actuals')
5 - access("MD_VIRTUAL_METRIC"."BUSINESS_METRIC_CODE"='CFC')
12 - filter("ORG_UNIT_DISPLAY_INDENT"-1<=3 AND DECODE("ORG_UNIT_REPORTING_CODE",'UNK',"ORG_UNIT_REPORTING_NAME","ORG_UNIT_REPORTING_C
ODE"||' | '||"ORG_UNIT_REPORTING_NAME")='International Region')
13 - access("HIERARCHY_NAME"='International Org')
14 - access("TABLE__105"."ORG_HIER_KEY"="MD_ORG_DESCENDANTS"."ORG_HIER_KEY" AND
"TABLE__105"."ORG_UNIT_KEY_DISPLAY"="MD_ORG_DESCENDANTS"."ORG_UNIT_KEY_REPORTING" AND
"TABLE__105"."ORG_UNIT_DISPLAY_NAME"="MD_ORG_DESCENDANTS"."ORG_UNIT_REPORTING_NAME")
19 - access("MD_BUDROX_RATES"."CURRENCY_KEY_TARGET"="EDWM_AMZ_FINANCE_MD_CURRENCY2"."CURRENCY_KEY")
20 - access("MF_AFG_MONTHLY"."CURRENCY_KEY"="MD_BUDROX_RATES"."CURRENCY_KEY_BASE")
21 - access("MD_COST_CENTRE"."COST_CENTRE_KEY"="MF_AFG_MONTHLY"."COST_CENTRE_KEY")
22 - access("MD_ACTIVITY"."ACTIVITY_KEY"="MF_AFG_MONTHLY"."ACTIVITY_KEY")
23 - access("MF_AFG_MONTHLY"."SCENARIO_KEY"="MD_SCENARIO"."SCENARIO_KEY")
24 - access("C0"="MF_AFG_MONTHLY"."ORGANISATION_KEY")
25 - access("MF_AFG_MONTHLY"."METRIC_VARIANT_KEY"="C0")
26 - access("MD_MONTH"."MONTH_KEY"="MF_AFG_MONTHLY"."MONTH_KEY")
27 - access("ACCOUNT_KEY"="MF_AFG_MONTHLY"."ACCOUNT_KEY")
29 - filter("PROD_HIER_NAME"='International Product Hierarchy')
30 - access("ORGANISATION_KEY"=(-999))
filter("ORGANISATION_KEY"=(-999))
32 - filter("ORGANISATION_KEY"=(-999) AND "HIERARCHY_DESCRIPTION"='Standard Cost Account Hierarchy')
34 - filter("MF_AFG_MONTHLY"."PRODUCT_KEY" IS NOT NULL AND "MF_AFG_MONTHLY"."ACCOUNT_KEY" IS NOT NULL)
41 - access("MF_AFG_MONTHLY"."METRIC_VARIANT_KEY"="C0")
45 - filter(TO_NUMBER(TRIM(TO_CHAR("MONTH_CODE",'999999')))=CASE WHEN ('Latest Reporting Month'='Latest Reporting Month') THEN
TO_NUMBER(TO_CHAR(ADD_MONTHS(SYSDATE@!,-1),'yyyymm')) ELSE TO_NUMBER('Latest Reporting Month') END )
46 - access("MF_AFG_MONTHLY"."MONTH_KEY"="MD_MONTH"."MONTH_KEY")
51 - access("MF_AFG_MONTHLY"."ORGANISATION_KEY"="C0")
52 - filter(TO_NUMBER(TRIM(TO_CHAR("MONTH_CODE",'999999')))=CASE WHEN ('Latest Reporting Month'='Latest Reporting Month') THEN
TO_NUMBER(TO_CHAR(ADD_MONTHS(SYSDATE@!,-1),'yyyymm')) ELSE TO_NUMBER('Latest Reporting Month') END )
59 - access(SUBSTR(TO_CHAR("EXCHANGE_RATE_MONTH_KEY"),1,4)=CASE WHEN ('Default RoX Year'='Default RoX Year') THEN (SELECT
TO_CHAR("AFG_DEFAULT_BUDROX_YEAR"."DEFAULT_BUDROX_RATES") FROM "EDWM_AMZ_FINANCE"."AFG_DEFAULT_BUDROX_YEAR" "AFG_DEFAULT_BUDROX_YEAR")
ELSE 'Default RoX Year' END )
62 - access("EDWM_AMZ_FINANCE_MD_CURRENCY2"."CURRENCY_CODE"='USD')
63 - access("PRODUCT_HIER_KEY"="MD_PRODUCT_HIER"."PRODUCT_HIER_KEY" AND
"MD_PRODUCT_HIER"."PRODUCT_FACT_KEY"="MF_AFG_MONTHLY"."PRODUCT_KEY")
-------------------------------------------------------------------------------
2. Use DBMS_SQLTUNE to tune it.
下面
--1.赋予用户ADVISOR权限
grant ADVISOR to EDWM_AMZ_FINANCE_BO;
--2.创建sql tuning任务
DECLARE
my_task_name VARCHAR2(30);
my_sqltext CLOB;
BEGIN
my_sqltext := 'SELECT
''CST-1013'',
Table__105.HIERARCHY_NAME,
Table__105.ORG_UNIT_DISPLAY_SORT,
Table__105.ORG_UNIT_DISPLAY_LEVEL,
Table__105.ORG_UNIT_DISPLAY_INDENT,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.PARENT_DISPLAY_NAME,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE || '' '' ||EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'' ''||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L2_Name
,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL3,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_NUMBER,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_DESC_SHORT,
EDWM_AMZ_FINANCE.MD_MONTH.YEAR_NUMBER,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_NAME
,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
,
EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE,
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END)
,
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_PY_CM * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_FYPY * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ACTUAL'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''BUDGET'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''RBU2'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
Sum(CASE WHEN EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE= ''ABU'' AND EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.MEASURE_TYPE_NAME=''Value'' THEN EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VALUE_YTD_MAV * EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_COMPONENT_FACTOR* ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE ) END),
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_CODE
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_CODE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_CONTEXT_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L1_Code,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION
FROM
EDWM_AMZ_FINANCE.MF_AFG_MONTHLY,
(
Select Distinct ORG_HIER_KEY,HIERARCHY_NAME,ORG_UNIT_KEY_DISPLAY,ORG_UNIT_DISPLAY_CODE,ORG_UNIT_DISPLAY_NAME,ORG_UNIT_DISPLAY_SHORT_NAME,ORG_UNIT_REPORTING_CODE,ORG_UNIT_REPORTING_NAME,ORG_UNIT_DISPLAY_INDENT,ORG_UNIT_DISPLAY_SORT,ORG_UNIT_DISPLAY_LEVEL,PARENT_DISPLAY_NAME
FROM EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS
) Table__105,
EDWM_AMZ_FINANCE.MD_ACTIVITY,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER,
EDWM_AMZ_FINANCE.MD_COST_CENTRE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER,
EDWM_AMZ_FINANCE.MD_MONTH,
EDWM_AMZ_FINANCE.MD_SCENARIO,
EDWM_AMZ_FINANCE.MD_CURRENCY EDWM_AMZ_FINANCE_MD_CURRENCY2,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE,
EDWM_AMZ_FINANCE.MD_BUDROX_RATES,
EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS
WHERE
( EDWM_AMZ_FINANCE.MD_MONTH.MONTH_KEY=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.MONTH_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.SCENARIO_KEY=EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_KEY )
AND ( EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_KEY=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.COST_CENTRE_KEY )
AND ( EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_KEY=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.ACTIVITY_KEY )
AND ( EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS.ORG_UNIT_KEY_FACT=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.ORGANISATION_KEY )
AND ( EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PRODUCT_HIER_KEY=EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_HIER_KEY )
AND ( EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_FACT_KEY=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.PRODUCT_KEY )
AND ( EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_VARIANT_KEY=EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.VIRTUAL_METRIC_VARIANT_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.METRIC_VARIANT_KEY=EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC_STRUCTURE.METRIC_VARIANT_KEY )
AND ( EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.CURRENCY_KEY=EDWM_AMZ_FINANCE.MD_BUDROX_RATES.CURRENCY_KEY_BASE )
AND ( EDWM_AMZ_FINANCE.MD_BUDROX_RATES.CURRENCY_KEY_TARGET=EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_KEY )
AND ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.ACCOUNT_KEY=EDWM_AMZ_FINANCE.MF_AFG_MONTHLY.ACCOUNT_KEY )
AND ( Table__105.ORG_HIER_KEY=EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS.ORG_HIER_KEY and Table__105.ORG_UNIT_KEY_DISPLAY=EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS.ORG_UNIT_KEY_REPORTING and Table__105.ORG_UNIT_DISPLAY_NAME=EDWM_AMZ_FINANCE.MD_ORG_DESCENDANTS.ORG_UNIT_REPORTING_NAME )
AND
(
( ( Table__105.HIERARCHY_NAME ) = ''International Org'' )
AND
( ( Decode(Table__105.ORG_UNIT_REPORTING_CODE,''UNK'',Table__105.ORG_UNIT_REPORTING_NAME,Table__105.ORG_UNIT_REPORTING_CODE || '' | '' || Table__105.ORG_UNIT_REPORTING_NAME) ) IN (''International Region'') OR '' My Organisations'' IN (''International Region'') )
AND
( ( Table__105.ORG_UNIT_DISPLAY_INDENT )-1 <= ''3'' )
AND
( ( EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
) In ''International Product Hierarchy'' )
AND
( (EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1 ) In ('' All Product Group L1'') OR '' All Product Group L1'' In ('' All Product Group L1'') )
AND
( (EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2 ) In ('' All Product Group L2'') OR '' All Product Group L2'' In ('' All Product Group L2'') )
AND
( ( EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3 ) In ('' All Product Group L3'') OR '' All Product Group L3'' In ('' All Product Group L3'') )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION ) = ''Standard Cost Account Hierarchy'' )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION ) IN ('' All Account Group Names'')
OR '' All Account Group Names'' IN ('' All Account Group Names'') )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION ) IN ('' All Account Sub Group Names'')
OR '' All Account Sub Group Names'' IN ('' All Account Sub Group Names'') )
AND
( ( EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'' ''||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION ) IN ('' All Enigma Account'') Or '' All Enigma Account'' IN ('' All Enigma Account'') )
AND
( ( EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME ) IN ('' All Enigma Function'') Or '' All Enigma Function'' IN ('' All Enigma Function'') )
AND
( ( EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L2_NAME ) IN ('' All Enigma Department'') Or '' All Enigma Department'' IN ('' All Enigma Department'') )
AND
( ( EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
) In ('' All Activities'') OR '' All Activities'' In ('' All Activities'') )
AND
( to_number(( trim(to_char(EDWM_AMZ_FINANCE.MD_MONTH.MONTH_CODE,''999999'')) )) = (case when ''Latest Reporting Month'' = ''Latest Reporting Month''
then
to_number(to_char(ADD_MONTHS(SYSDATE,-1),''yyyymm''))
else
to_number(''Latest Reporting Month'') end) )
AND
( ( EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE ) IN ''USD''
)
AND
( ( substr(EDWM_AMZ_FINANCE.MD_BUDROX_RATES.EXCHANGE_RATE_MONTH_KEY,1,4) ) = (case when ''Default RoX Year'' = ''Default RoX Year''
then (select to_char(edwm_amz_finance.afg_default_budrox_year.default_budrox_rates) from edwm_amz_finance.afg_default_budrox_year) else ''Default RoX Year'' end) )
AND
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE IN ( ''CFC'' )
AND
Case
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,5,2) = ''CA'' Then ''Central Actuals''
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,5,2) = ''OA'' Then ''Operational Actuals''
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,5,2) = ''EA'' Then ''Early View Actuals''
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,5,2) = ''MA'' Then ''Emerging Actuals''
End IN ( ''Central Actuals'' )
AND
( ( Case
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,7,2) = ''LB'' Then ''Local (APEX)''
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,7,2) = ''CB'' Then ''Central (Phase1)''
When substr(EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.virtual_metric_context_code,7,2) = ''OB'' Then ''Operational (ERP)''
End )= ''Central (Phase1)'' )
AND
(
( EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE In '' AUTO'' OR '' AUTO'' In '' AUTO'' )
OR
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
IN ( ''ACTUAL'',''BUDGET'' )
)
)
GROUP BY
''CST-1013'',
Table__105.HIERARCHY_NAME,
Table__105.ORG_UNIT_DISPLAY_SORT,
Table__105.ORG_UNIT_DISPLAY_LEVEL,
Table__105.ORG_UNIT_DISPLAY_INDENT,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.ORG_UNIT_DISPLAY_NAME,
Table__105.PARENT_DISPLAY_NAME,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_CODE || '' '' ||EDWM_AMZ_FINANCE.MD_ACTIVITY.ACTIVITY_NAME
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL2_CODE,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_CODE||'' ''||EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL3_DESCRIPTION,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L2_Name
,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_L1_NAME,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.BUSINESS_METRIC_CODE,
EDWM_AMZ_FINANCE.MH_PRODUCT_HIER.PROD_HIER_NAME
,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.PRODUCT_LEVEL3,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL1,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL2,
EDWM_AMZ_FINANCE.MD_PRODUCT_HIER.SORT_ORDER_LEVEL3,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_NUMBER,
EDWM_AMZ_FINANCE.MD_MONTH.MONTH_DESC_SHORT,
EDWM_AMZ_FINANCE.MD_MONTH.YEAR_NUMBER,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_NAME
,
EDWM_AMZ_FINANCE.MD_SCENARIO.SCENARIO_CODE
,
EDWM_AMZ_FINANCE_MD_CURRENCY2.CURRENCY_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE.COST_CENTRE_CODE
,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.LEVEL1_CODE,
EDWM_AMZ_FINANCE.MD_VIRTUAL_METRIC.VIRTUAL_METRIC_CONTEXT_CODE,
EDWM_AMZ_FINANCE.MD_COST_CENTRE. COST_CENTRE_L1_Code,
EDWM_AMZ_FINANCE.MD_GL_ACCOUNT_HIER.HIERARCHY_DESCRIPTION';
my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
sql_text => my_sqltext,
user_name => 'EDWM_AMZ_FINANCE_BO',
scope => 'COMPREHENSIVE',
time_limit => 7200,
task_name => 'cst1102_sql_tuning2',
description => 'Task to tune a query on EDWM_AMZ_FINANCE_BO');
END;
/
--3.查看任务名
SELECT TASK_NAME
FROM DBA_ADVISOR_LOG
WHERE OWNER = 'EDWM_AMZ_FINANCE_BO';
--4.执行sql tuning任务
BEGIN
DBMS_SQLTUNE.EXECUTE_TUNING_TASK(task_name => 'cst1102_sql_tuning2');
END;
/
--5.查看sql tunning任务状态
SELECT status
FROM DBA_ADVISOR_TASKS
WHERE task_name = 'cst1102_sql_tuning2';
STATUS
-----------
COMPLETED
--6.展示sql tunning结果
SET LONG 1999999
SET LONGCHUNKSIZE 1999999
SET LINESIZE 100
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK('cst1102_sql_tuning2')
FROM DUAL;