0% found this document useful (0 votes)
178 views7 pages

Infa Repo Queries

The document contains several SQL queries to retrieve information from an Informatica repository such as mappings with PARALLEL hints, sessions populating specific target tables, transformations with attribute overrides at the session level, and SQL overrides.

Uploaded by

Ivan Pavlov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views7 pages

Infa Repo Queries

The document contains several SQL queries to retrieve information from an Informatica repository such as mappings with PARALLEL hints, sessions populating specific target tables, transformations with attribute overrides at the session level, and SQL overrides.

Uploaded by

Ivan Pavlov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

How to find all the mappings and sessions which have PARALLEL hints in the SQL Override SELECT

S.SUBJ_NAME, M.MAPPING_NAME, W.WIDGET_NAME, A.WIDGET_ID, W.VERSION_NUMBER, SUBSTR(A.ATTR_VALUE, 1, 60) ATTR_VALUE FROM OPB_WIDGET_ATTR A, OPB_WIDGET W, OPB_SUBJECT S, OPB_WIDGET_INST I, OPB_MAPPING M WHERE A.WIDGET_ID = W.WIDGET_ID AND W.IS_VISIBLE = 1 AND A.VERSION_NUMBER = W.VERSION_NUMBER AND A.WIDGET_TYPE IN(2, 3, 11) --Limit to Src/Tgt/Lkp Transformations AND W.WIDGET_ID = I.WIDGET_ID AND W.VERSION_NUMBER = I.VERSION_NUMBER AND I.MAPPING_ID = M.MAPPING_ID AND I.VERSION_NUMBER = M.VERSION_NUMBER AND W.SUBJECT_ID = S.SUBJ_ID AND UPPER(A.ATTR_VALUE) LIKE '%PARALLEL%' UNION SELECT S.SUBJ_NAME, W.TASK_NAME||'.'||TI.INSTANCE_NAME TASK_NAME, 'SQL Override' WIDGET_NAME, A.SESS_WIDG_INST_ID, TI.VERSION_NUMBER, SUBSTR(A.ATTR_VALUE, 1, 60) ATTR_VALUE FROM OPB_SWIDGET_ATTR A, OPB_TASK_INST TI, OPB_TASK W, OPB_SUBJECT S WHERE A.SESSION_ID = TI.TASK_ID AND A.VERSION_NUMBER = TI.VERSION_NUMBER AND TI.WORKFLOW_ID = W.TASK_ID AND TI.VERSION_NUMBER = W.VERSION_NUMBER AND W.IS_VISIBLE = 1 AND W.SUBJECT_ID = S.SUBJ_ID AND UPPER(A.ATTR_VALUE) LIKE '%PARALLEL%' ORDER BY 1, 2, 3, 4; How to turn on Write Backward Compatible Session Log File for all session tasks in a folder UPDATE OPB_TASK_ATTR A SET A.ATTR_VALUE=1 WHERE A.ATTR_ID=17 -- WBCSLF -- 102 Write performance data to repository -- 108 Collect performance data -- 105 Enable high precision AND EXISTS ( SELECT 0 FROM OPB_TASK T, OPB_SUBJECT S WHERE T.TASK_ID = A.TASK_ID AND T.VERSION_NUMBER = A.VERSION_NUMBER AND T.IS_VISIBLE = 1 AND T.SUBJECT_ID = S.SUBJ_ID AND S.SUBJ_NAME LIKE '%Sample%' ) -- AND A.INSTANCE_ID = 0 -- Reusable Session Only ; What are today's long-running tasks select -- the SRC_ROWS may look big if joiner is used T.SUBJECT_AREA, T.INSTANCE_NAME, TRUNC(AVG(END_TIME-START_TIME)*24, 2) RUN_HOUR, MIN(T.START_TIME) START_TIME, SUM(L.SRC_SUCCESS_ROWS) SRC_ROWS, SUM(L.TARG_SUCCESS_ROWS) TGT_ROWS from REP_TASK_INST_RUN T, OPB_SESS_TASK_LOG L where T.run_err_code=0 and (T.END_TIME-T.START_TIME)>= 1/24 and T.START_TIME >= TRUNC(SYSDATE)-2/24

and T.INSTANCE_ID = L.INSTANCE_ID GROUP BY T.SUBJECT_AREA, T.INSTANCE_NAME Order By RUN_HOUR desc; Inside the Expression Transformation select S.SUBJ_NAME, W.WIDGET_NAME, F.WIDGET_ID, F.FIELD_NAME, F.FIELD_ID, E.EXPR_ID, E.VERSION_NUMBER, E.EXPRESSION from OPB_WIDGET W, OPB_SUBJECT S, OPB_WIDGET_FIELD F, OPB_WIDGET_EXPR R, OPB_EXPRESSION E where W.SUBJECT_ID=S.SUBJ_ID and W.WIDGET_ID=F.WIDGET_ID and W.WIDGET_ID=R.WIDGET_ID AND F.FIELD_ID=R.OUTPUT_FIELD_ID and W.WIDGET_ID=E.WIDGET_ID AND R.EXPR_ID=E.EXPR_ID and W.VERSION_NUMBER = F.VERSION_NUMBER and F.VERSION_NUMBER = R.VERSION_NUMBER and R.VERSION_NUMBER = E.VERSION_NUMBER and W.IS_VISIBLE = 1 and w.WIDGET_NAME like 'EXP_SAMPLE%' order by S.SUBJ_ID, W.WIDGET_ID, F.FIELD_ID; Which session populates the specific target table select SUBJECT_AREA, SESSION_NAME,TARGET_NAME, MAX(SUCC_ROWS) AS ROWS#, TYPE_ID, COUNT(1) SAMPLE# from ( select SUBJECT_AREA, SESSION_INSTANCE_NAME SESSION_NAME, TYPE_ID, SUCCESSFUL_AFFECTED_ROWS SUCC_ROWS, TABLE_NAME TARGET_NAME from PM_REPO.REP_SESS_TBL_LOG WHERE TYPE_ID in (2) -- Target Only and END_TIME >= TRUNC(SYSDATE-40) and SUCCESSFUL_AFFECTED_ROWS > 0 and TABLE_NAME like :TGT_NAME||'%' ESCAPE '\' ) Group By SUBJECT_AREA, SESSION_NAME, TARGET_NAME, TYPE_ID Order By SUBJECT_AREA, TARGET_NAME, SESSION_NAME ;

How the connection values is set at session level select x.WORKFLOW_ID , t.TASK_ID, t.TASK_NAME, b.INSTANCE_ID, b.INSTANCE_NAME, b.SESS_WIDG_INST_ID, x.CONNECTION_NUM, x.CONNECTION_TYPE, x.CONNECTION_ID, x.CONNECTION_VALUE, c.OBJECT_NAME from opb_session s, opb_task t, OPB_SWIDGET_INST b, OPB_SESS_CNX_VALS x, opb_cnx c where c.OBJECT_ID(+) = x.CONNECTION_ID and s.MAPPING_ID = b.MAPPING_ID and s.SESSION_ID = b.SESSION_ID and s.SESSION_ID = t.TASK_ID and s.SESSION_ID = x.SESSION_ID and b.SESS_WIDG_INST_ID = x.SESS_WIDG_INST_ID and t.SUBJECT_ID = :SUBJ_ID and b.INSTANCE_NAME like :WIDGET_NAME -- Source/Target and t.TASK_NAME like :SESS_NAME order by t.task_name, b.SESS_WIDG_INST_ID; Find Transformation Attribute Override at Session Level select f.SUBJ_NAME Folder, t.task_name SESSION_NAME, i.INSTANCE_NAME, o.OBJECT_TYPE_NAME, a.* from opb_swidget_attr a, OPB_SWIDGET_INST i, OPB_WIDGET w, OPB_OBJECT_TYPE o, opb_task t, opb_subject f where a.attr_value in (:VALUE1, :VALUE2, :VALUE3)

and i.SESSION_ID = a.SESSION_ID and i.SESS_WIDG_INST_ID = a.SESS_WIDG_INST_ID and i.WIDGET_ID = w.WIDGET_ID and i.WIDGET_TYPE = w.WIDGET_TYPE and i.WIDGET_TYPE = o.OBJECT_TYPE_ID and i.SESSION_ID= t.task_id and t.SUBJECT_ID= f.subj_id; List all the Transformations in a given Mapping Including the transformations within the mapplet WITH M AS ( select M.SUBJECT_ID, M.MAPPING_ID from OPB_MAPPING M, OPB_SUBJECT S where S.SUBJ_ID = M.SUBJECT_ID and S.SUBJ_NAME LIKE :Folder_Name and M.MAPPING_NAME like :Mapping_Name ) select O.OBJECT_TYPE_NAME, W.INSTANCE_NAME, W.COMMENTS from OPB_WIDGET_INST W, OPB_OBJECT_TYPE O, M where O.OBJECT_TYPE_ID = W.WIDGET_TYPE and O.OBJECT_TYPE_NAME NOT IN ('Mapplet') and W.MAPPING_ID = M.MAPPING_ID union select O.OBJECT_TYPE_NAME, W.INSTANCE_NAME, W.COMMENTS from OPB_WIDGET_INST W, OPB_OBJECT_TYPE O, M where O.OBJECT_TYPE_ID = W.WIDGET_TYPE and O.OBJECT_TYPE_NAME NOT IN ('Mapplet', 'Output Transformation', 'Input Transformation') and W.MAPPING_ID in ( select X.MAPPING_ID from OPB_WIDGET_INST W, OPB_OBJECT_TYPE O, M, OPB_MAPPING X where W.MAPPING_ID = M.MAPPING_ID and O.OBJECT_TYPE_ID = W.WIDGET_TYPE and O.OBJECT_TYPE_NAME = 'Mapplet' and X.REF_WIDGET_ID = W.WIDGET_ID ) order by 1,2 ;

Shows all workflows that do not create a backwards compatible logfile (Informatica 8.5 and up) SELECT OPB_SUBJECT.SUBJ_NAME AS FOLDER , OPB_TASK.TASK_NAME AS WORKFLOW , Workflow does not create a backwards compatible logfile AS ERROR FROM OPB_TASK , OPB_TASK_ATTR , OPB_SUBJECT WHERE OPB_TASK.TASK_TYPE = 71 AND OPB_TASK_ATTR.ATTR_ID = 12 AND OPB_TASK_ATTR.ATTR_VALUE <> 1 AND OPB_TASK_ATTR.TASK_ID = OPB_TASK.TASK_ID AND OPB_SUBJECT.SUBJ_ID = OPB_TASK.SUBJECT_ID AND UPPER(OPB_SUBJECT.SUBJ_NAME) LIKE UPPER(FOLDERNAME) ORDER BY 1,2

Lists all sessions which do not have a parameter value in $Source or $Target SELECT OPB_SUBJECT.SUBJ_NAME AS FOLDER , OPB_TASK.TASK_NAME AS TASK , DECODE(OPB_TASK_ATTR.ATTR_ID , 7, $Source, 8, $Target) AS PARAMETER , OPB_TASK_ATTR.ATTR_VALUE AS CURRENT_VALUE , Value not set using parameter AS ERROR FROM OPB_SUBJECT , OPB_TASK , OPB_TASK_ATTR WHERE OPB_SUBJECT.SUBJ_ID = OPB_TASK.SUBJECT_ID AND OPB_TASK.TASK_ID = OPB_TASK_ATTR.TASK_ID AND OPB_TASK_ATTR.ATTR_ID IN (7,8) AND OPB_TASK.TASK_TYPE IN (68) AND UPPER(OPB_TASK_ATTR.ATTR_VALUE) NOT LIKE %$% AND UPPER(OPB_SUBJECT.SUBJ_NAME) LIKE FOLDERNAME ORDER BY 1,2,3,4 Shows all uncommented transformations in mappings SELECT distinct OPB_SUBJECT.SUBJ_NAME AS FOLDER , OPB_MAPPING.MAPPING_NAME AS MAPPING , OPB_WIDGET_INST.INSTANCE_NAME AS TRANSFORMATION , Missing comment in transformation AS ERROR , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 3, SOURCE QUALIFIER transformation (user defined) should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 4, UPDATE transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 5, EXPRESSION transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 6, STORED PROCEDURE transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 7, SEQUENCE transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 8, EXTERNAL PROCEDURE transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 9, AGGREGATOR transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 10, FILTER transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 11, LOOKUP transformation (with user defined SQL) should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 12, JOINER transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 14, NORMALIZER transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 15, ROUTER transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 26, RANKER transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 50, ADVANCED EXTERNAL PROCEDURE transformation should be commented , DECODE(OPB_WIDGET_INST.WIDGET_TYPE, 80,

SORTER transformation should be commented , Transformation should be commented ))))))))))))))) AS DESCRIPTION FROM OPB_SUBJECT , OPB_MAPPING , OPB_WIDGET , OPB_WIDGET_INST , (SELECT DISTINCT OPB_WIDGET.WIDGET_ID FROM OPB_WIDGET_ATTR, OPB_WIDGET, OPB_SUBJECT WHERE OPB_WIDGET.WIDGET_ID = OPB_WIDGET_ATTR.WIDGET_ID AND OPB_SUBJECT.SUBJ_ID = OPB_WIDGET.SUBJECT_ID AND OPB_WIDGET.IS_VISIBLE = 1 AND OPB_WIDGET.WIDGET_TYPE IN (3,11) AND OPB_WIDGET_ATTR.WIDGET_TYPE IN (3,11) AND ATTR_ID = 1 AND ATTR_VALUE IS NOT NULL) T1 WHERE OPB_SUBJECT.SUBJ_ID = OPB_MAPPING.SUBJECT_ID AND OPB_MAPPING.MAPPING_ID = OPB_WIDGET_INST.MAPPING_ID AND OPB_WIDGET_INST.WIDGET_ID = OPB_WIDGET.WIDGET_ID AND OPB_WIDGET_INST.COMMENTS IS NULL AND OPB_WIDGET.IS_VISIBLE = 1 AND OPB_WIDGET.IS_REUSABLE <> 1 Reusables do not need extra comments AND OPB_WIDGET_INST.WIDGET_TYPE NOT IN (1,2,46,47) Source Definitions, Targets, Mapplet Input/Output AND OPB_WIDGET.WIDGET_ID = T1.WIDGET_ID (+) SQ/LKP only need comments when User Defined AND CASE WHEN OPB_WIDGET.WIDGET_TYPE IN (3,11) AND T1.WIDGET_ID IS NULL THEN 1 ELSE 0 END = 0 ORDER BY 1,2,3

SQL Overrides select folder, wf_name, sess_name, mapping_name, transformation_name, attr_name, line_no, sql_value from (select f.subj_name folder, wf.task_name wf_name, sess.instance_name sess_name, m.mapping_name mapping_name, w_inst.instance_name transformation_name, attr.line_no, attr.attr_value sql_value, attr_type.attr_name attr_name, row_number() over (partition by wf.task_name, sess.instance_name, m.mapping_name, w_inst.instance_name, attr.line_no, attr.attr_value order by attr.session_task_id desc ) rn from opb_task_inst wf_inst ,opb_task_inst sess ,opb_session s

,opb_mapping m ,opb_subject f ,opb_widget_attr attr ,opb_widget_inst w_inst ,opb_task wf ,(select o.object_type_id object_type_id, o_attr.attr_id attr_id, o.object_type_name||': '||o_attr.attr_name attr_name from opb_attr o_attr, opb_object_type o where o.object_type_id = o_attr.object_type_id and o_attr.attr_datatype = 2 and o_attr.attr_value is null and upper(o_attr.attr_name) like '%SQL%' ) attr_type where wf_inst.task_id = sess.task_id and sess.task_type = 68 and sess.task_id = s.session_id and wf.subject_id = f.subj_id and s.mapping_id = m.mapping_id and attr.widget_id = w_inst.widget_id and w_inst.mapping_id = m.mapping_id and w_inst.widget_type = attr_type.object_type_id and wf_inst.workflow_id = wf.task_id and wf.task_type = 71 and (attr.session_task_id = s.session_id or attr.session_task_id = 0) and attr.attr_id = attr_type.attr_id and attr.attr_value is not null and attr.attr_value <> '0' and wf.task_name = 'WORKFLOW_NAME' and f.subj_name = 'FOLDER_NAME' ) where rn = 1 order by 1, 2, 3, 4, 5, 6, 7

Link from EXP_FROM.PORT_NAME to ??? select S.SUBJ_NAME, WF.INSTANCE_NAME ||'.'|| F.FIELD_NAME FROM_NAME, F.WIDGET_ID, F.FIELD_ORDER, F.FIELD_ID, WT.INSTANCE_NAME ||'.'|| T.FIELD_NAME TO_NAME, T.WIDGET_ID, T.FIELD_ORDER,T.FIELD_ID from OPB_WIDGET Z, OPB_WIDGET_INST WF, OPB_WIDGET_INST WT,OPB_WIDGET_FIELD F, OPB_WIDGET_FIELD T, OPB_WIDGET_DEP D, OPB_SUBJECT S where Z.SUBJECT_ID = S.SUBJ_IDand Z.IS_VISIBLE = 1 and Z.WIDGET_ID = F.WIDGET_ID and Z.WIDGET_ID = WF.WIDGET_ID and Z.RU_VERSION_NUMBER = WF.VERSION_NUMBER and WF.REF_VERSION_NUMBER = F.VERSION_NUMBER and WF.VERSION_NUMBER = D.VERSION_NUMBER and WF.MAPPING_ID = D.MAPPING_ID and WF.INSTANCE_ID = D.FROM_INSTANCE_ID and F.FIELD_ID = D.FROM_FIELD_ID

and D.TO_INSTANCE_ID = WT.INSTANCE_ID and D.TO_FIELD_ID = T.FIELD_ID and D.MAPPING_ID = WT.MAPPING_ID and D.VERSION_NUMBER = WT.VERSION_NUMBER and WT.WIDGET_ID = T.WIDGET_ID and WT.REF_VERSION_NUMBER = T.VERSION_NUMBER and Z.WIDGET_NAME like 'EXP_FROM%' and F.FIELD_NAME like 'PORT_NAME%' order by F.FIELD_ID;

FAIL PARENT MISSING

/* Formatted on 21.01.2012 15:11:11 (QP5 v5.163.1008.3004) */

SELECT DISTINCT SUBJ.SUBJ_NAME FOLDER_NAME, WFLOW.TASK_NAME WORKFLOW_NAME, SESS.TASK_NAME SESSION_NAME, TINST.INSTANCE_NAME SESSION_INSTANCE_NAME FROM OPB_SUBJECT SUBJ, (SELECT TASK_ID, TASK_NAME, VERSION_NUMBER FROM OPB_TASK WHERE TASK_TYPE = 71 AND IS_VISIBLE = 1) WFLOW, (SELECT WORKFLOW_ID, TASK_ID, INSTANCE_NAME, BIT_OPTIONS, VERSION_NUMBER FROM OPB_TASK_INST i WHERE task_type = 68 AND NOT EXISTS (SELECT 1 FROM OPB_TASK_INST i2 WHERE i.workflow_id = i2.workflow_id AND i.task_id = i2.task_id AND i.version_number < i2.version_number)) TINST, (SELECT SUBJECT_ID, TASK_ID, TASK_NAME FROM OPB_TASK WHERE TASK_TYPE = 68) SESS WHERE WFLOW.TASK_ID = TINST.WORKFLOW_ID AND WFLOW.VERSION_NUMBER = TINST.VERSION_NUMBER AND TINST.TASK_ID = SESS.TASK_ID AND SESS.SUBJECT_ID = SUBJ.SUBJ_ID AND BITAND (BIT_OPTIONS, 16) = 0 AND SUBJ.SUBJ_NAME LIKE ('RWA%') AND SUBJ.SUBJ_NAME NOT LIKE ('%_ML%') AND SUBJ.SUBJ_NAME NOT LIKE ('%_DQ%') ORDER BY 1, 2, 3

You might also like