Tagged: etl

INFORMATICA Repository SQL-Collection

INFORMATICA REPOSITORY ABFRAGEN

-> tested until V 8.6.1 HF13

1 ÜBERBLICK

Mit den nachfolgenden SQL-Skripten kann man überprüfen, ob der eigene Code ETL-Standards entspricht! Für die entsprechenden Tabellen und Views im Informatica Repository werden nur lesende Rechte (GRANT SELECT on … to …) benötigt. Gegebenenfalls müssen die Skripte noch mit dem Schemanamen (vor Tabellen und Views) angepasst werden!.

2 FOLDER

2.1 List folder details

SELECT SUBJ_NAME,SUBJ_DESC FROM OPB_SUBJECT ORDER BY 1,2

2.2 List of shared folders

SELECT SUBJ_NAME,SUBJ_DESC FROM OPB_SUBJECT
WHERE IS_SHARED <> 0
ORDER BY 1,2

2.3 List of Users and groups having privileges’ on Folders

SELECT subj.subj_name folder_name, user_group.NAME user_name,
DECODE (obj_access.user_type, 1, 'USER', 2, 'GROUP') TYPE,
CASE WHEN ((obj_access.permissions - (obj_access.user_id + 1)) IN (8, 16))THEN 'READ'
WHEN ((obj_access.permissions - (obj_access.user_id + 1)) IN (10, 20))THEN 'READ & EXECUTE'
WHEN ((obj_access.permissions - (obj_access.user_id + 1)) IN (12, 24))THEN 'READ & WRITE'
WHEN ((obj_access.permissions - (obj_access.user_id + 1)) IN (14, 28))THEN 'READ, WRITE & EXECUTE'
ELSE 'NO PERMISSIONS'
END permissions
FROM opb_object_access obj_access,opb_subject subj,opb_user_group user_group
WHERE obj_access.object_type = 29
AND obj_access.object_id = subj.subj_id
AND obj_access.user_id = user_group.ID
AND obj_access.user_type = user_group.TYPE
--  and user_group.NAME not in ('Admin','READ_ONLY','Administrator','Administrators')
order by 1,2,3

3 SOURCE

3.1 List of source tables

SELECT
B.SUBJ_NAME,
C.DBDNAM,
D.DBTYPE_NAME,
A.SOURCE_NAME AS TABLE_NAME,
A.FILE_NAME SCHEMA_NAME,
A.OWNERNAME
FROM
OPB_SRC A,OPB_SUBJECT B, OPB_DBD C,OPB_MMD_DBTYPE D
WHERE A.SUBJ_ID = B.SUBJ_ID
AND A.DBDID = C.DBDID
AND C.DBTYPE = D.DBTYPE_ID
--AND A.SOURCE_NAME <> A.FILE_NAME
ORDER BY 1,2,3,4,5

3.2 List and count of tables in each folder by db type

 

SELECT
B.SUBJ_NAME,
D.DBTYPE_NAME,
count(*)
FROM
OPB_SRC A,OPB_SUBJECT B, OPB_DBD C,OPB_MMD_DBTYPE D
WHERE A.SUBJ_ID = B.SUBJ_ID
AND A.DBDID = C.DBDID
AND C.DBTYPE = D.DBTYPE_ID
--AND A.SOURCE_NAME <> A.FILE_NAME
group by B.SUBJ_NAME,D.DBTYPE_NAME
order by 1,2,3

 

3.3 List and count of tables overall used

 

SELECT SOURCE_NAME, COUNT(SOURCE_NAME) FROM REP_TBL_MAPPING
GROUP BY SOURCE_NAME
ORDER BY 1,2 ASC

3.4 List of source tables used in mapping

 

SELECT SUBJECT_AREA,SOURCE_NAME,MAPPING_NAME FROM REP_SRC_MAPPING
ORDER BY 1,2,3

3.5 List of source tables using as shortcuts

SELECT DISTINCT
B.SUBJ_NAME,
C.DBDNAM,
D.DBTYPE_NAME,
A.SOURCE_NAME AS TABLE_NAME,
A.FILE_NAME SCHEMA_NAME,
A.OWNERNAME
FROM
OPB_SRC A,OPB_SUBJECT B, OPB_DBD C,OPB_MMD_DBTYPE D
WHERE A.SUBJ_ID = B.SUBJ_ID
AND A.DBDID = C.DBDID
AND C.DBTYPE = D.DBTYPE_ID
--AND A.SOURCE_NAME <> A.FILE_NAME
and A.SOURCE_NAME like 'sc_%'
ORDER BY 1,2,3,4,5

4 TARGET

4.1 List of Target Tables

SELECT B.SUBJ_NAME,
A.TARGET_NAME,
DECODE(A.DBTYPE,
0,'VSAM',
1,'IMS',
2,'Sybase',
3,'Oracle',
4,'Informix',
5,'Microsoft SQL Server',
6,'DB2',
7,'Flat File',
8,'ODBC',
9,'SAP BW',
10,'PeopleSoft',
11,'SAP R/3',
12,'XML',
13,'MQSeries',
14,'Siebel',
15,'Teradata' ) as DB_TYPE
FROM
OPB_TARG A,
OPB_SUBJECT B
WHERE A.SUBJ_ID = B.SUBJ_ID
ORDER BY 1,2,3

4.2 List and count of tables in each folder by db type

SELECT B.SUBJ_NAME,
DECODE(A.DBTYPE,
0,'VSAM',
1,'IMS',
2,'Sybase',
3,'Oracle',
4,'Informix',
5,'Microsoft SQL Server',
6,'DB2',
7,'Flat File',
8,'ODBC',
9,'SAP BW',
10,'PeopleSoft',
11,'SAP R/3',
12,'XML',
13,'MQSeries',
14,'Siebel',
15,'Teradata' ) as DB_TYPE,
count(*)
FROM
OPB_TARG A,
OPB_SUBJECT B
WHERE A.SUBJ_ID = B.SUBJ_ID
GROUP BY B.SUBJ_NAME,A.DBTYPE
ORDER BY 1,2

4.3 List and count of table overall used

 

SELECT SOURCE_NAME, COUNT(SOURCE_NAME) FROM REP_TBL_MAPPING
GROUP BY SOURCE_NAME
ORDER BY 1,2 ASC

5 TRANSFORMATION

 

5.1 List of filer transformations

SELECT SUBSTR(WIDGET_NAME,1,3), COUNT(WIDGET_NAME)
FROM REP_ALL_TRANSFORMS
WHERE WIDGET_TYPE_NAME = 'Filter'
GROUP BY SUBSTR(WIDGET_NAME,1,3)

 

5.2 List of Sequence transformations

SELECT DISTINCT SUBJECT_AREA, PARENT_WIDGET_NAME FROM REP_ALL_TRANSFORMS WHERE WIDGET_TYPE_NAME =’Sequence‘ ORDER BY 1,2

5.3 List of tables used as lookups

SELECT DISTINCT
B.PARENT_SUBJECT_AREA AS FOLDER_NAME,
C.ATTR_VALUE AS TABLE_NAME,A.INSTANCE_NAME AS TRANSFORMATION_NAME, A.WIDGET_TYPE_NAME AS TRANSFORMATION_TYPE,B.MAPPING_NAME
FROM
REP_WIDGET_INST A INNER JOIN REP_ALL_MAPPINGS B ON A.MAPPING_ID = B.MAPPING_ID INNER JOIN
REP_WIDGET_ATTR C ON A.WIDGET_ID = C.WIDGET_ID
WHERE
C.ATTR_DESCRIPTION LIKE 'Lookup source table'
ORDER BY 1,2,3,4,5

5.4 List of transformations using sql overrides

SELECT DISTINCT d.subject_area AS Folder,
                  d.mapping_name,
                  a.widget_type_name AS Transformation_Type,
                  a.instance_name AS Transformation_Name,
                  b.attr_name,
                  b.attr_value,
                  c.session_name
    FROM REP_WIDGET_INST a,
         REP_WIDGET_ATTR b,
         REP_LOAD_SESSIONS c,
         REP_ALL_MAPPINGS d
   WHERE     b.widget_id = a.widget_id
         AND b.widget_type = a.widget_type
         AND b.widget_type IN (3, 11)
         AND c.mapping_id = a.mapping_id
         AND d.mapping_id = a.mapping_id
         AND b.attr_id = 1
         AND b.attr_datatype = 2
         AND b.attr_type = 3
ORDER BY d.subject_area, d.mapping_name

5.5 List all transformations

SELECT DISTINCT version_subject.subject_area "FOLDER_NAME",  version_props.object_name "OBJECT_NAME",
CASE
WHEN version_props.object_type = 1 THEN 'Source Definition' ELSE CASE
WHEN version_props.object_type = 2 THEN 'Target Definition' ELSE CASE
WHEN version_props.object_type = 3 THEN 'Source Qualifier' ELSE CASE
WHEN version_props.object_type = 4 THEN 'Update Strategy' ELSE CASE
WHEN version_props.object_type = 5 THEN 'Expression' ELSE CASE
WHEN version_props.object_type = 6 THEN 'Stored Procedure' ELSE CASE
WHEN version_props.object_type = 7 THEN 'Sequence' ELSE CASE
WHEN version_props.object_type = 8 THEN 'External Procedure' ELSE CASE
WHEN version_props.object_type = 9 THEN 'Aggregator' ELSE CASE
WHEN version_props.object_type = 10 THEN 'Filter' ELSE CASE
WHEN version_props.object_type = 11 THEN 'Lookup Procedure' ELSE CASE
WHEN version_props.object_type = 12 THEN 'Joiner' ELSE CASE
WHEN version_props.object_type = 13 THEN 'Procedure' ELSE CASE
WHEN version_props.object_type = 14 THEN 'Normalizer' ELSE CASE
WHEN version_props.object_type = 16 THEN 'Merger' ELSE CASE
WHEN version_props.object_type = 17 THEN 'Pivot' ELSE CASE
WHEN version_props.object_type = 18 THEN 'Session Obsolete' ELSE CASE
WHEN version_props.object_type = 19 THEN 'Batch' ELSE CASE
WHEN version_props.object_type = 20 THEN 'Shortcut' ELSE CASE
WHEN version_props.object_type = 21 THEN 'Mapping' ELSE CASE
WHEN version_props.object_type = 26 THEN 'Rank' ELSE CASE
WHEN version_props.object_type = 27 THEN 'Star Schema' ELSE CASE
WHEN version_props.object_type = 28 THEN 'Folder Version' ELSE CASE
WHEN version_props.object_type = 29 THEN 'Folder' ELSE CASE
WHEN version_props.object_type = 30 THEN 'Cube' ELSE CASE
WHEN version_props.object_type = 31 THEN 'Dimension' ELSE CASE
WHEN version_props.object_type = 32 THEN 'Level' ELSE CASE
WHEN version_props.object_type = 33 THEN 'Hierarchy' ELSE CASE
WHEN version_props.object_type = 34 THEN 'Fact Table' ELSE CASE
WHEN version_props.object_type = 35 THEN 'General Object' ELSE CASE
WHEN version_props.object_type = 36 THEN 'FTP Object' ELSE CASE
WHEN version_props.object_type = 37 THEN 'Oracle External Loader Object' ELSE CASE
WHEN version_props.object_type = 38 THEN 'Informix External Loader Object' ELSE CASE
WHEN version_props.object_type = 39 THEN 'Sybase IQ External Loader Object' ELSE CASE
WHEN version_props.object_type = 54 THEN 'Sybase IQ 12 External Loader Object' ELSE CASE
WHEN version_props.object_type = 53 THEN 'Tera Data External Loader Object' ELSE CASE
WHEN version_props.object_type = 40 THEN 'File Object' ELSE CASE
WHEN version_props.object_type = 41 THEN 'Server Object' ELSE CASE
WHEN version_props.object_type = 42 THEN 'Database Object' ELSE CASE
WHEN version_props.object_type = 43 THEN 'Repository' ELSE CASE
WHEN version_props.object_type = 44 THEN 'Mapplet' ELSE CASE
WHEN version_props.object_type = 45 THEN 'Application Source Qualifier' ELSE CASE
WHEN version_props.object_type = 46 THEN 'Input Transformation' ELSE CASE
WHEN version_props.object_type = 47 THEN 'Output Transformation' ELSE CASE
WHEN version_props.object_type = 50 THEN 'Advanced External Procedure' ELSE CASE
WHEN version_props.object_type = 48 THEN 'Business Component Framework' ELSE CASE
WHEN version_props.object_type = 49 THEN 'Business Component' ELSE CASE
WHEN version_props.object_type = 51 THEN 'SAP Structure' ELSE CASE
WHEN version_props.object_type = 52 THEN 'SAP Function' ELSE CASE
WHEN version_props.object_type = 15 THEN 'Router' ELSE CASE
WHEN version_props.object_type = 55 THEN 'XML Source Qualifier' ELSE CASE
WHEN version_props.object_type = 56 THEN 'MQ Source Qualifier' ELSE CASE
WHEN version_props.object_type = 57 THEN 'MQ Connection Object' ELSE CASE
WHEN version_props.object_type = 58 THEN 'Command' ELSE CASE
WHEN version_props.object_type = 59 THEN 'Decision' ELSE CASE
WHEN version_props.object_type = 60 THEN 'Event Wait' ELSE CASE
WHEN version_props.object_type = 61 THEN 'Event Raise' ELSE CASE
WHEN version_props.object_type = 62 THEN 'Start' ELSE CASE
WHEN version_props.object_type = 63 THEN 'Abort' ELSE CASE
WHEN version_props.object_type = 64 THEN 'Stop' ELSE CASE
WHEN version_props.object_type = 65 THEN 'Email' ELSE CASE
WHEN version_props.object_type = 66 THEN 'Timer' ELSE CASE
WHEN version_props.object_type = 67 THEN 'Assignment' ELSE CASE
WHEN version_props.object_type = 68 THEN 'Session' ELSE CASE
WHEN version_props.object_type = 69 THEN 'Scheduler' ELSE CASE
WHEN version_props.object_type = 70 THEN 'Worklet' ELSE CASE
WHEN version_props.object_type = 71 THEN 'Workflow' ELSE CASE
WHEN version_props.object_type = 72 THEN 'SessionConfig' ELSE CASE
WHEN version_props.object_type = 73 THEN 'Relational' ELSE CASE
WHEN version_props.object_type = 74 THEN 'Application' ELSE CASE
WHEN version_props.object_type = 75 THEN 'FTP' ELSE CASE
WHEN version_props.object_type = 76 THEN 'External Loader' ELSE CASE
WHEN version_props.object_type = 77 THEN 'Queue' ELSE CASE
WHEN version_props.object_type = 78 THEN 'Reader' ELSE CASE
WHEN version_props.object_type = 79 THEN 'Writer' ELSE CASE
WHEN version_props.object_type = 80 THEN 'Sorter' ELSE CASE
WHEN version_props.object_type = 81 THEN 'Vendor' ELSE CASE
WHEN version_props.object_type = 84 THEN 'App Multi-Group Source Qualifier' ELSE CASE
WHEN version_props.object_type = 91 THEN 'Control' ELSE CASE
WHEN version_props.object_type = 92 THEN 'Transaction Control' ELSE CASE
WHEN version_props.object_type = 97 THEN 'Custom Transformation' ELSE CASE
WHEN version_props.object_type = 93 THEN 'Query' ELSE CASE
WHEN version_props.object_type = 94 THEN 'Deployment Group' ELSE CASE
WHEN version_props.object_type = 95 THEN 'Label' ELSE CASE
WHEN version_props.object_type = 96 THEN 'Deployed Deployment Group' ELSE CASE
WHEN version_props.object_type = 98 THEN 'Server Grid' ELSE CASE
WHEN version_props.object_type = 99 THEN 'Profiling Ruleset' ELSE CASE
WHEN version_props.object_type = 100 THEN 'Template Extension' ELSE CASE
WHEN version_props.object_type = 101 THEN 'Global Profile Resource' ELSE CASE
WHEN version_props.object_type = 102 THEN 'Web Services Hub' ELSE CASE
WHEN version_props.object_type = 103 THEN 'Lookup Extension' ELSE CASE
WHEN version_props.object_type = 105 THEN 'Service Level' ELSE CASE
WHEN version_props.object_type = 106 THEN 'User Defined Function' ELSE 'Shortcut'
END AS  "OBJECT_TYPE"
FROM rep_users version_users,
rep_version_props version_props,
rep_reposit_info version_reposit_info,
rep_subject version_subject
WHERE (version_props.user_id = version_users.user_id
AND version_props.object_id <> version_reposit_info.repository_id
AND version_props.subject_id = version_subject.subject_id
)
ORDER BY 3, 1

5.6 List all Expression transformations using ‘concat’ function

 

SELECT DISTINCT REP_ALL_MAPPINGS.SUBJECT_AREA, REP_ALL_MAPPINGS.MAPPING_NAME,                REP_WIDGET_INST.WIDGET_TYPE_NAME AS TRANSFORMATION_TYPE,                REP_WIDGET_INST.INSTANCE_NAME AS TRANSFORMATION_NAME,                REP_WIDGET_FIELD.FIELD_NAME AS PORT_NAME,
CASE
WHEN REP_WIDGET_FIELD.PORTTYPE = 1 THEN 'I'
WHEN REP_WIDGET_FIELD.PORTTYPE = 2 THEN 'O'
WHEN REP_WIDGET_FIELD.PORTTYPE = 3 THEN 'IO'
WHEN REP_WIDGET_FIELD.PORTTYPE = 32 THEN 'V'
END AS PORT_TYPE,
REP_WIDGET_FIELD.EXPRESSION
FROM REP_WIDGET_INST, REP_WIDGET_FIELD, REP_ALL_MAPPINGS
WHERE REP_WIDGET_INST.WIDGET_ID = REP_WIDGET_FIELD.WIDGET_ID
AND REP_WIDGET_INST.MAPPING_ID = REP_ALL_MAPPINGS.MAPPING_ID
AND REP_WIDGET_INST.WIDGET_TYPE = 5
AND REP_WIDGET_FIELD.EXPRESSION LIKE '%CONCAT%'
ORDER BY 1

 

5.7 List of all port details of an Expression transformations

SELECT S.SUBJ_NAME, W.WIDGET_NAME, F.FIELD_ID,F.FIELD_NAME,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_%'
ORDER BY 1,2,3

5.8 List of all Expression transformation port links

SELECT DISTINCT S.SUBJ_NAME, WF.INSTANCE_NAME ||'.'|| F.FIELD_NAME
FROM_NAME, F.FIELD_ORDER AS EXP_PORT_ORDER,
WT.INSTANCE_NAME ||'.'|| T.FIELD_NAME TO_NAME,  T.FIELD_ORDER
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_ID
AND 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_%'
AND S.SUBJ_NAME = :FOLDER_NAME
AND WF.INSTANCE_NAME = :EXP_NAME
ORDER BY 1,2,3

 

5.9 List of LKP transformation port links used in all mappings

 

SELECT DISTINCT OPB_SUBJECT.SUBJ_NAME,OPB_MAPPING.MAPPING_NAME,
OPB_WIDGET_FIELD.FIELD_NAME FIELD_NAME,
OPB_EXPRESSION.EXPRESSION EXPRESSION
FROM OPB_WIDGET_EXPR, OPB_EXPRESSION, OPB_WIDGET_FIELD, REP_FLD_DATATYPE, OPB_WIDGET, OPB_SUBJECT,OPB_WIDGET_INST,OPB_MAPPING
WHERE
OPB_WIDGET_FIELD.WIDGET_ID = OPB_WIDGET.WIDGET_ID
AND OPB_WIDGET.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_WIDGET_INST.WIDGET_ID = OPB_WIDGET.WIDGET_ID
AND OPB_MAPPING.MAPPING_ID = OPB_WIDGET_INST.MAPPING_ID
AND OPB_WIDGET_FIELD.VERSION_NUMBER = OPB_WIDGET.VERSION_NUMBER
AND OPB_WIDGET.IS_VISIBLE = 1
AND OPB_WIDGET_FIELD.WIDGET_ID= OPB_WIDGET_EXPR.WIDGET_ID
AND OPB_WIDGET_FIELD.FIELD_ID= OPB_WIDGET_EXPR.OUTPUT_FIELD_ID
AND OPB_WIDGET_EXPR.WIDGET_ID=OPB_EXPRESSION.WIDGET_ID
AND OPB_WIDGET_EXPR.EXPR_ID=OPB_EXPRESSION.EXPR_ID
AND OPB_EXPRESSION.LINE_NO = 1
AND OPB_WIDGET_EXPR.VERSION_NUMBER = OPB_EXPRESSION.VERSION_NUMBER
AND OPB_WIDGET_EXPR.VERSION_NUMBER = OPB_WIDGET_FIELD.VERSION_NUMBER
--AND OPB_SUBJECT.SUBJ_NAME = 'FOLDER_NAME'
--AND OPB_MAPPING.MAPPING_NAME = 'MAPPING_NAME'
AND UPPER(EXPRESSION) LIKE '%LKP_ACCT_B%'
ORDER BY 1,2

6 MAPPING

6.1 List mapping names

SELECT   SUBJECT_AREA, PARENT_MAPPING_NAME
FROM REP_ALL_MAPPINGS
ORDER BY 1, 2

6.2 List total count of mappings

SELECT   SUBJECT_AREA, COUNT(PARENT_MAPPING_NAME) AS TOTAL_MAPPINGS
FROM REP_ALL_MAPPINGS
GROUP BY SUBJECT_AREA
ORDER BY 1, 2

6.3 List last saved user for a mapping

SELECT REP_SUBJECT.SUBJECT_AREA "FOLDER",REP_VERSION_PROPS.OBJECT_NAME "MAPPING", REP_USERS.USER_NAME,REP_VERSION_PROPS.LAST_SAVED
FROM REP_USERS,REP_VERSION_PROPS,REP_SUBJECT
WHERE REP_USERS.USER_ID=REP_VERSION_PROPS.USER_ID
AND REP_VERSION_PROPS.OBJECT_TYPE IN (21)
--AND REP_SUBJECT.SUBJECT_AREA = 'FOLDER_NAME'
AND REP_SUBJECT.SUBJECT_ID = REP_VERSION_PROPS.SUBJECT_ID
ORDER BY 1,2,3,4

6.4 List Mapping parameters and variables

SELECT distinct rep_reposit_info.repository_name, rep_all_mappings.subject_area
as folder_name, rep_all_mappings.mapping_name as object_name,
case when opb_map_parmvar.pv_flag = 2 then 'Mapping Parameter' else
case when opb_map_parmvar.pv_flag = 3 then 'Mapping Variable' end
end as parameter_type, opb_map_parmvar.pv_name as parameter_name,
opb_map_parmvar.pv_default as parameter_value,
opb_map_parmvar.pv_desc as description
from rep_all_mappings, opb_map_parmvar, rep_reposit_info
where rep_all_mappings.mapping_id = opb_map_parmvar.mapping_id

6.5 List all the mappings using PARALLEL hints

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%'

7 MAPPLET

7.1 List Mapplets in all folders

SELECT subject_area,mapplet_name from rep_all_mapplets
order by 1,2

7.2 List Mapplet parameters and variables

SELECT distinct rep_reposit_info.repository_name, rep_all_mapplets.subject_area
as folder_name, rep_all_mapplets.mapplet_name as object_name,
case when opb_map_parmvar.pv_flag = 2 then 'Mapplet Parameter' else
case when opb_map_parmvar.pv_flag = 3 then 'Mapplet Variable' end
end as parameter_type, opb_map_parmvar.pv_name as parameter_name,
opb_map_parmvar.pv_default as parameter_value,
opb_map_parmvar.pv_desc as description
from rep_all_mapplets, rep_widget_inst, opb_mapping, opb_map_parmvar, rep_reposit_info
where rep_all_mapplets.mapplet_id=opb_mapping.mapping_id
and rep_widget_inst.widget_id=opb_mapping.ref_widget_id
and opb_mapping.mapping_id=opb_map_parmvar.mapping_id
and rep_widget_inst.widget_type=44

8 SESSION

8.1 List session names

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (68)
--AND SUBJECT_AREA= 'ABC'
ORDER BY 1, 2, 3

8.2 List save session log count

  SELECT DISTINCT
         cc.subject_area,
         cc.task_name AS session_name,
         bb.attr_value AS Savesessionlog
    FROM (SELECT a.session_id, MIN (a.config_id) AS config_id, a.attr_id
              FROM rep_sess_config_parm a
             WHERE a.attr_id = '103'
          GROUP BY a.session_id, a.attr_id) aa,
         (SELECT session_id, config_id, attr_value
            FROM rep_sess_config_parm
           WHERE attr_id = '103') bb,
         (SELECT subject_area, task_name, task_id FROM rep_all_tasks) cc
   WHERE     aa.session_id = bb.session_id
         AND aa.config_id = bb.config_id
         AND bb.session_id = cc.task_id
         AND bb.attr_value NOT IN (8, 4)
ORDER BY 1, 2, 3

8.3 List stop on errors count

SELECT DISTINCT
A.SUBJECT_AREA,
A.TASK_NAME AS SESSION_NAME,
B.ATTR_VALUE AS STOPONERRORS
FROM
REP_ALL_TASKS A ,
REP_SESS_CONFIG_PARM  B
WHERE
A.TASK_ID = B.SESSION_ID
AND TASK_TYPE_NAME = 'Session' AND B.ATTR_ID = '202'
--AND B.ATTR_VALUE NOT IN (1) 
--AND A.SUBJECT_AREA in ('ABC')
ORDER BY 1,2

8.4 List hard coded paths

SELECT DISTINCT
A.SUBJECT_AREA,
A.TASK_NAME AS SESSION_NAME,
B.FILE_NAME,
DIR_NAME
FROM
REP_ALL_TASKS A ,
OPB_SESS_FILE_VALS B
WHERE
A.TASK_TYPE_NAME = 'Session'
AND A.TASK_ID = B.SESSION_ID
--AND A.SUBJECT_AREA IN ('ABC')
ORDER BY 1,2

8.5 List parameter file paths

SELECT DISTINCT
B.SUBJECT_AREA,
B.TASK_NAME AS SES_WF_NAME,
A.ATTR_VALUE AS PRM_FILE_PATH
FROM
OPB_TASK_ATTR A,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (1,4)
AND A.TASK_ID = B.TASK_ID
AND A.ATTR_VALUE LIKE '%.prm%'
ORDER BY 1,2 ASC

 

8.6 List session log names

SELECT DISTINCT
A.SUBJECT_AREA,
A.WORKFLOW_NAME,
A.SESSION_NAME,
A.SESSION_INSTANCE_NAME,
SUBSTR(A.SESSION_LOG_FILE,25,300) AS EXISTING_SESSLOGNAME
FROM
REP_SESS_LOG A
WHERE
SUBSTR(A.SESSION_LOG_FILE,25,300) != CONCAT(LOWER(A.SESSION_INSTANCE_NAME),'.log')
ORDER BY 1,2,3

8.7 List commit intervals

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS COMMITINTERVEL
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (14)
AND A.ATTR_VALUE <> 10000
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.8 List total source partitions

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS TOTAL_SOURCE_PARTITIONS
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (12)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.9 List total target partitions

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS TOTAL_TARGET_PARTITIONS
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (11)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.10 List DTM Buffer Size

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS DTM_BUFFER_SIZE
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (101)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.11 List collect performance data

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS COLLECT_PERFORMANCE_DATA
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (102)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.12 List Incremental Aggregation

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS INCREMENTAL_AGGREGATION
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (103)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.13 List Reinitialize aggregate cache

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS REINITIALIZE_AGGREGATE CACHE
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (104)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.14 List Enable high precision

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS ENABLE_HIGH_PRECISION
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (105)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.15 List Session retry on deadlock

SELECT
B.SUBJECT_AREA,
B.TASK_NAME AS SESS_NAME,
A.ATTR_VALUE AS SESSION_ RETRYON_DEADLOCK
FROM
OPB_TASK_ATTR A ,
REP_ALL_TASKS B
WHERE
A.ATTR_ID IN (106)
AND A.TASK_ID = B.TASK_ID
AND TASK_TYPE_NAME IN ('Session')
ORDER BY 1,2 ASC

8.16 List write backward compatible check

SELECT DISTINCT
A.SUBJECT_AREA,A.TASK_NAME,
DECODE (B.ATTR_VALUE,0,'TO BE CHECKED',1,'CHECKED') WRITEBACKWARDCOMPATIBLE
FROM
REP_ALL_TASKS A ,
OPB_TASK_ATTR B
WHERE
A.TASK_ID = B.TASK_ID
AND B.TASK_TYPE IN 68
AND B.ATTR_ID = 17
--AND B.ATTR_VALUE <> 1
ORDER BY 1,2,3

8.17 List over ride tracing

SELECT REP_REPOSIT_INFO.REPOSITORY_NAME,
REP_ALL_TASKS.SUBJECT_AREA AS FOLDER_NAME,
REP_ALL_TASKS.TASK_NAME AS SESSION_NAME,
CASE
WHEN REP_SESS_CONFIG_PARM.ATTR_VALUE = 0 THEN 'NONE'
WHEN REP_SESS_CONFIG_PARM.ATTR_VALUE = 1 THEN 'TERSE'
WHEN REP_SESS_CONFIG_PARM.ATTR_VALUE = 2 THEN 'NORMAL'
WHEN REP_SESS_CONFIG_PARM.ATTR_VALUE = 3 THEN 'VERBOSE INITIALIZATION'
WHEN REP_SESS_CONFIG_PARM.ATTR_VALUE = 4 THEN 'VERBOSE DATA'
END AS OVERRIDE_TRACING
FROM
REP_REPOSIT_INFO,
REP_ALL_TASKS,
REP_SESS_CONFIG_PARM
WHERE
REP_ALL_TASKS.TASK_ID = REP_SESS_CONFIG_PARM.SESSION_ID
AND REP_SESS_CONFIG_PARM.ATTR_ID = 204
--AND REP_SESS_CONFIG_PARM.ATTR_VALUE NOT IN (0,2)
ORDER BY 1,2,3

8.18 List save session log by

SELECT  A.SUBJECT_AREA,
A.TASK_NAME AS SESSION_NAME,
B.ATTR_NAME,
DECODE(B.ATTR_VALUE,1,'TIME STAMP','BY RUNS') AS SAVE_SESSION_LOG_BY
FROM
REP_ALL_TASKS A ,
REP_SESS_CONFIG_PARM  B
WHERE
A.TASK_ID = B.SESSION_ID
AND TASK_TYPE_NAME = 'Session'
AND B.ATTR_ID IN ('102')
--AND B.ATTR_VALUE <> 0
ORDER BY 1,2

h2>8.19 List load type

SELECT DISTINCT
REP_LOAD_SESSIONS.SUBJECT_AREA AS FOLDER, REP_LOAD_SESSIONS.SESSION_NAME,
--REP_SESS_WIDGET_CNXS.CNX_NAME AS CONNECTION_NAME,
CASE WHEN OPB_EXTN_ATTR.ATTR_VALUE ='0' THEN 'NORMAL'
WHEN OPB_EXTN_ATTR.ATTR_VALUE ='1' THEN 'BULK'
END AS TARGET_LOAD_TYPE
FROM
REP_LOAD_SESSIONS,
REP_SESS_WIDGET_CNXS,
OPB_EXTN_ATTR
WHERE REP_LOAD_SESSIONS.SESSION_ID=REP_SESS_WIDGET_CNXS.SESSION_ID
AND REP_LOAD_SESSIONS.SESSION_ID=OPB_EXTN_ATTR.SESSION_ID
AND OPB_EXTN_ATTR.ATTR_ID=3
AND OPB_EXTN_ATTR.ATTR_VALUE BETWEEN '0' AND '1'
AND REP_SESS_WIDGET_CNXS.READER_WRITER_TYPE='Relational Writer'
--AND OPB_EXTN_ATTR.ATTR_VALUE ='1'
ORDER BY 1,2

8.20 List ‚post_session_success_command‘ in session

SELECT DISTINCT C.SUBJ_NAME AS FOLDER ,A.TASK_NAME AS TASK, B.PM_VALUE AS COMMAND
FROM OPB_TASK A,OPB_TASK_VAL_LIST B, OPB_SUBJECT C
WHERE A.TASK_TYPE=58 AND A.TASK_NAME='post_session_success_command'
AND B.TASK_ID=A.TASK_ID AND B.SUBJECT_ID=C.SUBJ_ID
ORDER BY 1

8.21 List of all the emails with attachment

SELECT DISTINCT
D.SUBJ_NAME AS FOLDER_NAME, C.WORKFLOW_NAME AS WORKFLOW_NAME,A.TASK_NAME AS TASK_NAME, B.ATTR_VALUE AS VALUE
FROM
OPB_TASK A, OPB_TASK_ATTR B, REP_TASK_INST_RUN C, OPB_SUBJECT D
WHERE A.TASK_ID = B.TASK_ID
AND A.TASK_TYPE = B.TASK_TYPE
AND C.SUBJECT_ID = A.SUBJECT_ID
AND A.SUBJECT_ID = D.SUBJ_ID
AND A.TASK_TYPE = 65
AND B.ATTR_ID IN (2,3)
AND(B.ATTR_VALUE LIKE '%\%a%' ESCAPE '\' OR B.ATTR_VALUE LIKE '%\%g%' ESCAPE '\')

8.22 Invalid Sessions and Workflows

SELECT opb_subject.subj_name, opb_task.task_name
from  opb_task,   opb_subject
where task_type in (68,71)
and is_valid = 0
and opb_subject.subj_id = opb_task.subject_id
order by 1,2
SELECT SUBJECT_AREA AS FOLDER_NAME,
DECODE(IS_REUSABLE,1,'Reusable',' ') || ' ' ||TASK_TYPE_NAME AS TASK_TYPE,
TASK_NAME AS OBJECT_NAME,
DECODE(IS_VALID,0,'INVALID OBJECT','VALID OBJECT') STATUS,
LAST_SAVED
FROM REP_ALL_TASKS
WHERE IS_VALID=0
AND IS_ENABLED=1
--AND CHECKOUT_USER_ID = 0 -- Comment out for V6
--AND is_visible=1 -- Comment out for V6
ORDER BY 1,2

9 TASKS

9.1 List command tasks

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME
FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (58)
--AND SUBJECT_AREA= 'ABC'
ORDER BY 1, 2, 3

9.2 List decision tasks

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME
FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (59)
--AND SUBJECT_AREA= 'ABC'
ORDER BY 1, 2, 3

9.3 List Event Wait tasks

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME
FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (60)
ORDER BY 1, 2, 3

10 WORKLET

10.1 List worklet names

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME
FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (70)
--AND SUBJECT_AREA= 'ABC'
ORDER BY 1, 2, 3

10.2 List hierarchies of all workflows and its worklets

SELECT DISTINCT
       '/' || temp1.task_id AS PATH, temp1.task_name AS hierarchy_structure
  FROM 
       opb_task temp1, 
       opb_subject temp2
 WHERE     temp1.subject_id = temp2.subj_id
       AND temp1.task_type = 71
       AND temp2.subj_name = 'FOLDER_NAME'
UNION ALL
SELECT DISTINCT temp1.PATH, temp1.task_name AS hierarchy_structure
  FROM (    
       SELECT opb_task_inst.workflow_id,
              opb_task_inst.task_id,
              opb_task_inst.instance_id,
              LEVEL DEPTH,
              SYS_CONNECT_BY_PATH (opb_task_inst.workflow_id, '/')|| '/'|| opb_task_inst.task_id|| '/' PATH,
              LPAD (' ', 4 * LEVEL, ' ')|| SYS_CONNECT_BY_PATH (opb_task_inst.instance_name, '/') task_name
              FROM opb_task_inst
             WHERE opb_task_inst.task_type IN (68, 70)
        START WITH workflow_id IN (SELECT task_id FROM opb_task WHERE task_type = 71)
        CONNECT BY PRIOR opb_task_inst.task_id = opb_task_inst.workflow_id
       ) temp1,
       opb_task temp2,
       opb_subject temp3
 WHERE     temp2.subject_id = temp3.subj_id
       AND temp2.task_id = SUBSTR (temp1.PATH,2,INSTR (temp1.PATH,'/',1,2)- 2)
       AND temp3.subj_name = 'FOLDER_NAME'
ORDER BY PATH ASC

11 WORKFLOW

11.1 List workflow names

SELECT   SUBJECT_AREA, TASK_TYPE_NAME, TASK_NAME
FROM REP_ALL_TASKS
WHERE TASK_TYPE IN (71)
--AND SUBJECT_AREA= 'ABC'
ORDER BY 1, 2, 3

11.2 List save workflow log count

SELECT DISTINCT
A.SUBJECT_AREA,
A.TASK_NAME AS WORKFLOW_NAME,
B.ATTR_VALUE AS SAVEWFLOG
FROM
REP_ALL_TASKS A ,
REP_TASK_ATTR  B
WHERE
A.TASK_ID = B.TASK_ID
AND B.ATTR_ID = '4'
AND B.TASK_TYPE = 71
--AND B.ATTR_VALUE NOT IN (8,4) 
-- AND A.SUBJECT_AREA = 'ABC'
ORDER BY 1,2,3

11.3 List workflow log names

SELECT DISTINCT
SUBJ_NAME,
WORKFLOW_NAME,
SUBSTR(LOG_FILE,23,300) AS EXISTING_WFLOGNAME
FROM
OPB_WFLOW_RUN,
OPB_SUBJECT
WHERE
OPB_WFLOW_RUN.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND SUBSTR(LOG_FILE,23,300) != CONCAT(LOWER(WORKFLOW_NAME),'.log')
ORDER BY 1,2

11.4 List write backward compatible check

SELECT DISTINCT
A.SUBJECT_AREA,A.TASK_NAME,
DECODE (B.ATTR_VALUE,0,'TO BE CHECKED',1,'CHECKED') WRITEBACKWARDCOMPATIBLE
FROM
REP_ALL_TASKS A,
OPB_TASK_ATTR B
WHERE
A.TASK_ID = B.TASK_ID
AND B.TASK_TYPE IN 71
AND B.ATTR_ID = 12
AND B.ATTR_VALUE <> 1

11.5 List fail_parent_if_task_fails objects

SELECT
REPOSITORY,
FOLDER_NAME,
WORKFLOW_OR_WORKLET,
TASK_TYPE,
WORKLET_OR_SESSION,
FAIL_PARENT_IF_TASK_FAILS
FROM
(
SELECT DISTINCT
OPB_REPOSIT_INFO.REPOSITORY_NAME AS REPOSITORY,
OPB_SUBJECT.SUBJ_NAME AS FOLDER_NAME,
OPB_TASK.TASK_NAME AS WORKFLOW_OR_WORKLET,
DECODE(OPB_TASK_INST.TASK_TYPE,58,'COMMAND',59,'DECISION',60,'EVENT WAIT',62,'START',65,'EMAIL',66,'TIMER',67,'ASSIGNMENT',68,'SESSION',70,'WORKLET',91,'CONTROL',NULL) TASK_TYPE,
OPB_TASK_INST.INSTANCE_NAME AS WORKLET_OR_SESSION,
DECODE (BITAND (OPB_TASK_INST.BIT_OPTIONS, 17),17,'SELECTED','NOT SELECTED') AS FAIL_PARENT_IF_TASK_FAILS
FROM OPB_TASK_INST,OPB_OBJECT_TYPE,OPB_TASK,
OPB_SUBJECT, OPB_REPOSIT_INFO
WHERE OPB_TASK_INST.TASK_TYPE != 62
AND OPB_TASK_INST.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_TASK_INST.WORKFLOW_ID = OPB_TASK.TASK_ID
AND OPB_TASK_INST.VERSION_NUMBER = OPB_TASK.VERSION_NUMBER
AND OPB_TASK.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_TASK.UTC_CHECKIN <> 0
--AND OPB_SUBJECT.SUBJ_NAME NOT LIKE 'WA%'
)
WHERE FAIL_PARENT_IF_TASK_FAILS <> SELECTED'

 

11.6 List fail_parent_if_task_dont_run objects

SELECT REPOSITORY,FOLDER_NAME,WORKFLOW_OR_WORKLET,TASK_TYPE,WORKLET_OR_SESSION,FAIL_PARENT_IF_TASK_DONT_RUN
FROM
(
SELECT DISTINCT
OPB_REPOSIT_INFO.REPOSITORY_NAME AS REPOSITORY,
OPB_SUBJECT.SUBJ_NAME AS FOLDER_NAME, OPB_TASK.TASK_NAME AS WORKFLOW_OR_WORKLET,
DECODE(OPB_TASK_INST.TASK_TYPE,
58,'COMMAND',
59,'DECISION',
60,'EVENT WAIT',
62,'START',
65,'EMAIL',
66,'TIMER',
67,'ASSIGNMENT',
68,'SESSION',
70,'WORKLET',
91,'CONTROL',
NULL) TASK_TYPE, 
OPB_TASK_INST.INSTANCE_NAME AS WORKLET_OR_SESSION, 
DECODE (BITAND (OPB_TASK_INST.BIT_OPTIONS, 49),49,
'SELECTED','NOT SELECTED') AS FAIL_PARENT_IF_TASK_DONT_RUN
FROM OPB_TASK_INST, OPB_OBJECT_TYPE,OPB_TASK,OPB_SUBJECT,OPB_REPOSIT_INFO
WHERE OPB_TASK_INST.TASK_TYPE != 62
AND OPB_TASK_INST.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_TASK_INST.WORKFLOW_ID = OPB_TASK.TASK_ID
AND OPB_TASK_INST.VERSION_NUMBER = OPB_TASK.VERSION_NUMBER
AND OPB_TASK.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_TASK.UTC_CHECKIN <> 0  )
WHERE FAIL_PARENT_IF_TASK_DONT_RUN <>  'SELECTED'
ORDER BY 2

 

11.7 List is_task_enabled objects

 

SELECT REPOSITORY,FOLDER_NAME,WORKFLOW_OR_WORKLET,TASK_TYPE,WORKLET_OR_SESSION,IS_TASK_ENABLED
FROM
(SELECT DISTINCT
OPB_REPOSIT_INFO.REPOSITORY_NAME AS REPOSITORY,
OPB_SUBJECT.SUBJ_NAME AS FOLDER_NAME, OPB_TASK.TASK_NAME AS WORKFLOW_OR_WORKLET,
DECODE(OPB_TASK_INST.TASK_TYPE,58,'COMMAND',59,'DECISION',60,'EVENT WAIT',62,'START',65,'EMAIL',66,'TIMER',67,'ASSIGNMENT',68,'SESSION',70,'WORKLET',91,'CONTROL', NULL) TASK_TYPE, OPB_TASK_INST.INSTANCE_NAME AS WORKLET_OR_SESSION,
DECODE (OPB_TASK_INST.IS_ENABLED,1, 'ENABLED','DISABLED') AS IS_TASK_ENABLED
FROM OPB_TASK_INST,OPB_OBJECT_TYPE,OPB_TASK,OPB_SUBJECT,OPB_REPOSIT_INFO
WHERE OPB_TASK_INST.TASK_TYPE != 62
AND OPB_TASK_INST.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_TASK_INST.WORKFLOW_ID = OPB_TASK.TASK_ID
AND OPB_TASK_INST.VERSION_NUMBER = OPB_TASK.VERSION_NUMBER
AND OPB_TASK.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_TASK.UTC_CHECKIN <> 0 )
WHERE IS_TASK_ENABLED = 'DISABLED'
ORDER BY 2,3

11.8 List treat_input_links_as objects

SELECT REPOSITORY,FOLDER_NAME,WORKFLOW_OR_WORKLET,TASK_TYPE,
WORKLET_OR_SESSION,TREAT_INPUT_LINKS_AS
FROM
(SELECT DISTINCT
OPB_REPOSIT_INFO.REPOSITORY_NAME AS REPOSITORY,
OPB_SUBJECT.SUBJ_NAME AS FOLDER_NAME,
OPB_TASK.TASK_NAME AS WORKFLOW_OR_WORKLET,
DECODE(OPB_TASK_INST.TASK_TYPE,
58,'COMMAND',
59,'DECISION',
60,'EVENT WAIT',
62,'START',
65,'EMAIL',
66,'TIMER',
67,'ASSIGNMENT',
68,'SESSION',
70,'WORKLET',
91,'CONTROL',
NULL) TASK_TYPE,
OPB_TASK_INST.INSTANCE_NAME AS WORKLET_OR_SESSION,
DECODE (BITAND (OPB_TASK_INST.BIT_OPTIONS, 3),1,'AND',2, 'OR') AS TREAT_INPUT_LINKS_AS
FROM OPB_TASK_INST,OPB_OBJECT_TYPE,OPB_TASK,OPB_SUBJECT,OPB_REPOSIT_INFO WHERE OPB_TASK_INST.TASK_TYPE != 62
AND OPB_TASK_INST.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_TASK_INST.WORKFLOW_ID = OPB_TASK.TASK_ID
AND OPB_TASK_INST.VERSION_NUMBER = OPB_TASK.VERSION_NUMBER
AND OPB_TASK.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_TASK.UTC_CHECKIN <> 0
)
--WHERE TREAT_INPUT_LINKS_AS = 'OR'
ORDER BY 2,3

11.9 List all workflows whose server is not assigned

SELECT SUBJECT_AREA,WORKFLOW_NAME,SERVER_NAME
FROM REP_WORKFLOWS
WHERE SERVER_NAME IS NULL

11.10 List of workflow run details

SELECT DISTINCT OPB_SUBJECT.SUBJ_NAME,OPB_WFLOW_RUN.WORKFLOW_NAME,
OPB_TASK_INST_RUN.INSTANCE_NAME,
TRUNC(OPB_TASK_INST_RUN.START_TIME) LOAD_DATE,
TO_CHAR(OPB_TASK_INST_RUN.START_TIME,'HH24:MI.SS') SESS_START_TIME,
TO_CHAR(OPB_TASK_INST_RUN.END_TIME,'HH24:MI.SS') SESS_END_TIME,
TRUNC((OPB_TASK_INST_RUN.END_TIME - OPB_TASK_INST_RUN.START_TIME) * 1440,2) DURATION_IN_MINS
FROM OPB_SUBJECT,OPB_TASK_INST_RUN,OPB_WFLOW_RUN,OPB_OBJECT_TYPE, OPB_SESS_TASK_LOG
WHERE
OPB_SUBJECT.SUBJ_ID = OPB_TASK_INST_RUN.SUBJECT_ID
AND OPB_WFLOW_RUN.WORKFLOW_ID = OPB_TASK_INST_RUN.WORKFLOW_ID
AND OPB_WFLOW_RUN.WORKFLOW_RUN_ID = OPB_TASK_INST_RUN.WORKFLOW_RUN_ID
AND OPB_TASK_INST_RUN.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_OBJECT_TYPE.OBJECT_TYPE = 68
AND OPB_WFLOW_RUN.WORKFLOW_ID = OPB_SESS_TASK_LOG.WORKFLOW_ID
AND OPB_WFLOW_RUN.WORKFLOW_RUN_ID = OPB_SESS_TASK_LOG.WORKFLOW_RUN_ID
AND OPB_TASK_INST_RUN.WORKLET_RUN_ID = OPB_SESS_TASK_LOG.WORKLET_RUN_ID
AND OPB_TASK_INST_RUN.INSTANCE_ID = OPB_SESS_TASK_LOG.INSTANCE_ID
ORDER BY 1,2,4

12 CONNECTIONS

12.1 List of cnxs using alter in env sql

SELECT DISTINCT
D.OBJECT_NAME,
C.DB, C.USERNAME,
C.ATTR_VALUE AS ENVIRONMENT_SQL
FROM OPB_CNX D,
(SELECT DISTINCT A.OBJECT_NAME CONN, B.OBJECT_ID,
A.CONNECT_STRING DB, A.USER_NAME USERNAME,
B.ATTR_VALUE FROM OPB_CNX A,
(SELECT B.OBJECT_ID, B.OBJECT_SUBTYPE,
B.OBJECT_TYPE, B.ATTR_VALUE
FROM OPB_CNX_ATTR B
WHERE B.ATTR_ID = 11) B
WHERE A.OBJECT_ID = B.OBJECT_ID
AND B.ATTR_VALUE IS NOT NULL) C
WHERE D.OBJECT_NAME = C.CONN
ORDER BY 1

12.2 List of cnxs used in session levels

SELECT DISTINCT
A.SUBJECT_AREA,
A.TASK_NAME,
B.CNX_NAME
FROM
REP_ALL_TASKS A,
REP_SESS_WIDGET_CNXS B
WHERE
A.TASK_ID = B.SESSION_ID
ORDER BY 1,2,3

12.3 List Lotus connection details

SELECT DISTINCT
a.object_name as connection_name,
case when a.OBJECT_SUBTYPE = 101 then 'Oracle'
when a.OBJECT_SUBTYPE = 104 then 'Microsoft SQL Server'
when a.OBJECT_SUBTYPE = 106 then 'ODBC'
when a.OBJECT_SUBTYPE = 0 then 'FTP'
when a.OBJECT_SUBTYPE = 404000 then 'Lotus Notes' end as type,
a.user_name as conn_user_name,
e.ServerHost,
e.DatabaseFilename,
b.user_name connection_owner,
case when user_type = '1' and d.user_id in (
SELECT id from opb_user_group y where y.type = 1)   then (
SELECT 'User - '||x.user_name from opb_users x where d.user_id=x.user_id)
when user_type = '2' and d.user_id in (
SELECT id from opb_user_group y where y.type = 2) then (
SELECT 'Group - '||z.name from opb_user_group z where d.user_id=z.id and z.type = 2)
when user_type = '3' and d.user_id in (
SELECT id from opb_user_group) then (
SELECT name from opb_user_group )
when d.user_id = '0' then 'Others'
end as CONN_USERS_LIST,
CASE   WHEN user_type = 1 THEN
CASE WHEN permissions = d.user_id + 15 THEN 'RWX'
WHEN permissions = d.user_id + 13 THEN 'RW'
WHEN permissions = d.user_id + 11 THEN 'RX'
WHEN permissions = d.user_id + 9  THEN 'R'
WHEN permissions = d.user_id + 7  THEN 'WX'
WHEN permissions = d.user_id + 5  THEN 'W'
WHEN permissions = d.user_id + 3  THEN 'X'
ELSE 'NULL' END
WHEN user_type = 2 THEN
CASE WHEN permissions = d.user_id + 29  THEN 'RWX'
WHEN permissions = d.user_id + 25  THEN 'RW'
WHEN permissions = d.user_id + 21  THEN 'RX'
WHEN permissions = d.user_id + 17  THEN 'R'
WHEN permissions = d.user_id + 13  THEN 'WX'
WHEN permissions = d.user_id + 9   THEN 'W'
WHEN permissions = d.user_id + 5   THEN 'X'
ELSE 'NULL'
END
WHEN user_type = 3
THEN CASE
WHEN permissions = d.user_id + 57 THEN 'RWX'
WHEN permissions = d.user_id + 39 THEN 'RW'
WHEN permissions = d.user_id + 41 THEN 'RX'
WHEN permissions = d.user_id + 33 THEN 'R'
WHEN permissions = d.user_id + 25 THEN 'WX'
WHEN permissions = d.user_id + 17 THEN 'W'
WHEN permissions = d.user_id + 9  THEN 'X'
ELSE 'NULL'
END
END PREVILIGES
FROM opb_cnx a, opb_users b, opb_groups c, opb_object_access d,
(SELECT  a.object_id,a.ServerHost,b.DatabaseFilename  from
(SELECT object_id,Attr_value as ServerHost  from opb_cnx_attr where OBJECT_SUBTYPE  = 404000 and attr_id = 1 ) a,
(SELECT object_id,Attr_value as DatabaseFilename  from opb_cnx_attr where OBJECT_SUBTYPE = 404000 and attr_id = 2 ) b
where a.object_id = b.object_id) e
WHERE a.owner_id = b.user_id
AND a.object_id = d.object_id
AND d.object_id = e.object_id
and a.OBJECT_SUBTYPE = 404000
ORDER BY object_name

 

12.4 ODBC / SQL Server Connection details

SELECT DISTINCT
a.object_name as connection_name,
a.user_name as conn_user_name,
a.connect_string,
b.user_name connection_owner,
b.user_desc AS conn_owner_desc,
case when user_type = '1' and d.user_id in (
SELECT user_id from opb_users) then (
SELECT 'User - '||x.user_name from opb_users x where d.user_id=x.user_id)
when user_type = '2' and d.user_id in (
SELECT group_id from opb_groups) then (
SELECT 'Group - '||x.group_name from opb_groups x where d.user_id=x.group_id)
when d.user_id = '0' then 'World' end as CONN_USERS_LIST,
CASE
WHEN user_type = 1 THEN
CASE WHEN permissions = d.user_id + 15 THEN 'RWX'
WHEN permissions = d.user_id + 13 THEN 'RW'
WHEN permissions = d.user_id + 11 THEN 'RX'
WHEN permissions = d.user_id + 9  THEN 'R'
WHEN permissions = d.user_id + 7  THEN 'WX'
WHEN permissions = d.user_id + 5  THEN 'W'
WHEN permissions = d.user_id + 3  THEN 'X'
ELSE 'NULL'
END
WHEN user_type = 2 THEN
CASE WHEN permissions = d.user_id + 29  THEN 'RWX'
WHEN permissions = d.user_id + 25  THEN 'RW'
WHEN permissions = d.user_id + 21  THEN 'RX'
WHEN permissions = d.user_id + 17  THEN 'R'
WHEN permissions = d.user_id + 13  THEN 'WX'
WHEN permissions = d.user_id + 9   THEN 'W'
WHEN permissions = d.user_id + 5   THEN 'X'
ELSE 'NULL'
END
WHEN user_type = 3
THEN CASE
WHEN permissions = d.user_id + 57 THEN 'RWX'
WHEN permissions = d.user_id + 39 THEN 'RW'
WHEN permissions = d.user_id + 41 THEN 'RX'
WHEN permissions = d.user_id + 33 THEN 'R'
WHEN permissions = d.user_id + 25 THEN 'WX'
WHEN permissions = d.user_id + 17 THEN 'W'
WHEN permissions = d.user_id + 9  THEN 'X'
ELSE 'NULL'
END
END PREVILIGES
FROM opb_cnx a, opb_users b, opb_groups c, opb_object_access d
WHERE a.owner_id = b.user_id
AND a.GROUP_ID = c.group_id
AND a.object_id = d.object_id and d.object_type=73
and a.object_subtype = 106
ORDER BY object_name

12.5 List of sessions used by a connection

SELECT DISTINCT C.SUBJECT_AREA, B.WORKFLOW_NAME,A.SESSION_INSTANCE_NAME, CONNECTION_NAME, CONNECT_STRING
FROM REP_SESSION_CNXS C , OPB_CNX,REP_SESS_LOG A,REP_WFLOW_RUN B
WHERE C.CONNECTION_ID=OPB_CNX.OBJECT_ID
AND C.SESSION_ID = A.SESSION_ID
AND A.WORKFLOW_ID=B.WORKFLOW_ID
AND CONNECTION_NAME IN
('CMX_NAME') ORDER BY 1,2

12.6 Query to fetch connection details users list and privileges’

SELECT DISTINCT
a.object_name as connection_name,
a.user_name as conn_user_name,
a.connect_string,
b.user_name connection_owner,
b.user_desc AS conn_owner_desc,
case when user_type = '1' and d.user_id in (
SELECT user_id from opb_users) then (
SELECT 'User - '||x.user_name from opb_users x where d.user_id=x.user_id)
when user_type = '2' and d.user_id in (
SELECT group_id from opb_groups) then (
SELECT 'Group - '||x.group_name from opb_groups x where d.user_id=x.group_id)
when d.user_id = '0' then 'World' end as CONN_USERS_LIST,
d.user_type CONN_USER_TYPE, d.permissions,
CASE
WHEN user_type = 1
THEN CASE
WHEN permissions = d.user_id + 15
THEN 'RWX'
WHEN permissions = d.user_id + 13
THEN 'RW'
WHEN permissions = d.user_id + 11
THEN 'RX'
WHEN permissions = d.user_id + 9
THEN 'R'
WHEN permissions = d.user_id + 7
THEN 'WX'
WHEN permissions = d.user_id + 5
THEN 'W'
WHEN permissions = d.user_id + 3
THEN 'X'
ELSE 'NULL'
END
WHEN user_type = 2
THEN CASE
WHEN permissions = d.user_id + 29
THEN 'RWX'
WHEN permissions = d.user_id + 25
THEN 'RW'
WHEN permissions = d.user_id + 21
THEN 'RX'
WHEN permissions = d.user_id + 17
THEN 'R'
WHEN permissions = d.user_id + 13
THEN 'WX'
WHEN permissions = d.user_id + 9
THEN 'W'
WHEN permissions = d.user_id + 5
THEN 'X'
ELSE 'NULL'
END
WHEN user_type = 3
THEN CASE
WHEN permissions = d.user_id + 57
THEN 'RWX'
WHEN permissions = d.user_id + 39
THEN 'RW'
WHEN permissions = d.user_id + 41
THEN 'RX'
WHEN permissions = d.user_id + 33
THEN 'R'
WHEN permissions = d.user_id + 25
THEN 'WX'
WHEN permissions = d.user_id + 17
THEN 'W'
WHEN permissions = d.user_id + 9
THEN 'X'
ELSE 'NULL'
END
END PREVILIGES
FROM opb_cnx a, opb_users b, opb_groups c, opb_object_access d
WHERE a.owner_id = b.user_id
AND a.GROUP_ID = c.group_id
AND a.object_id = d.object_id and d.object_type=73
ORDER BY 1

13 REPOSITORY

13.1 Repository Info

SELECT DOMAIN_NAME, REPOSITORY_NAME,PCSF_DOMAIN AS DOMAIN, DB_USER FROM OPB_REPOSIT_INFO

13.2 List of objects which are Not Valid

SELECT REPOSITORY,FOLDER_NAME,WORKFLOW_OR_WORKLET,TASK_TYPE,    WORKLET_OR_SESSION,IS_VALID
FROM
(
SELECT DISTINCT
OPB_REPOSIT_INFO.REPOSITORY_NAME AS REPOSITORY,
OPB_SUBJECT.SUBJ_NAME AS FOLDER_NAME, OPB_TASK.TASK_NAME AS WORKFLOW_OR_WORKLET,
DECODE(OPB_TASK_INST.TASK_TYPE,58,'COMMAND',59,'DECISION',60,'EVENT WAIT',62,'START',65,'EMAIL',66,'TIMER',67,'ASSIGNMENT',68,'SESSION',70,'WORKLET',91,'CONTROL',NULL) TASK_TYPE,
OPB_TASK_INST.INSTANCE_NAME AS WORKLET_OR_SESSION,
DECODE (OPB_TASK_INST.IS_VALID,1,'VALID','NOT VALID') AS IS_VALID
FROM OPB_TASK_INST,OPB_OBJECT_TYPE,OPB_TASK,OPB_SUBJECT,OPB_REPOSIT_INFO
WHERE OPB_TASK_INST.TASK_TYPE != 62
AND OPB_TASK_INST.TASK_TYPE = OPB_OBJECT_TYPE.OBJECT_TYPE_ID
AND OPB_TASK_INST.WORKFLOW_ID = OPB_TASK.TASK_ID
AND OPB_TASK_INST.VERSION_NUMBER = OPB_TASK.VERSION_NUMBER
AND OPB_TASK.SUBJECT_ID = OPB_SUBJECT.SUBJ_ID
AND OPB_TASK.UTC_CHECKIN <> 0  )
WHERE IS_VALID = 'NOT VALID'
ORDER BY 2,3

13.3 List of objects which are failed in last 5 days

 

SELECT Subject_Area AS Folder,
Session_Name,
Last_Error AS Error_Message,
DECODE (Run_Status_Code,3,'Failed',4,'Stopped',5,'Aborted') AS Status,
Actual_Start AS Start_Time,
Session_TimeStamp
FROM rep_sess_log
WHERE run_status_code != 1
AND TRUNC(Actual_Start) BETWEEN TRUNC(SYSDATE -5) AND TRUNC(SYSDATE)
order by 1,2

 

13.4 List where all a table is used

Sometimes you want to know if certain tables are listed in sql overrides of Source Qualifier or Lookup transformation. This helps you identifying dependencies. The query below will list folder, attribute type and sql override as output.

SELECT DISTINCT REP_ALL_MAPPINGS.SUBJECT_AREA, REP_ALL_MAPPINGS.MAPPING_NAME,REP_WIDGET_ATTR.ATTR_NAME, REP_WIDGET_ATTR.ATTR_VALUE
FROM REP_WIDGET_ATTR, REP_WIDGET_INST, REP_ALL_MAPPINGS
WHERE REP_WIDGET_ATTR.WIDGET_ID = REP_WIDGET_INST.WIDGET_ID
AND REP_WIDGET_INST.MAPPING_ID = REP_ALL_MAPPINGS.MAPPING_ID
AND REP_WIDGET_ATTR.WIDGET_TYPE IN (3,11)
AND REP_WIDGET_ATTR.ATTR_ID = 1
AND REP_WIDGET_ATTR.ATTR_VALUE LIKE '%' || REPLACE('TABLE_NAME', '_', '/_') || '%' ESCAPE '/'
ORDER BY 1,2,3

13.5 List all source and target tables of mapping

SELECT DISTINCT SUBJECT_AREA,SOURCE_NAME,TARGET_NAME,MAPPING_NAME FROM REP_TBL_MAPPING
ORDER BY 1,2,3,4

13.6 List comments of all objects

SELECT
B.SUBJECT_AREA AS FOLDER_NAME, A.OBJECT_NAME,A.COMMENTS, A.VERSION_NUMBER
FROM
REP_VERSION_PROPS A, REP_SUBJECT B
WHERE B.SUBJECT_ID = A.SUBJECT_ID
AND A.COMMENTS IS NOT NULL
ORDER BY 1,2