Thursday, October 20, 2011

Practice Notes: Query for DAC metadata

Time and Again there may a situation where one may need find the DAC tasks which populate particular target table be it a temporary table or staging table or the warehouse table. This information could easily be found from the DAC interface. But if we need to get this data from a TOAD/SQL developer, the following query would do the work.

select step.name as "DAC TASK",
tbl.name as "TARGET TABLE",
step.app_wid as "ETL LAYER",
step.priority
from w_etl_step_tbl step_tbl,
w_etl_step step,
w_etl_table tbl
where tbl.row_wid = step_tbl.table_wid
and step.row_wid = step_tbl.step_wid
and tbl.name = 'W_EMPLOYEE_D'
and step_tbl.type_cd = 'Target'
order by step.priority, step.name