
Executive Summary: Mastering Informatica PowerCenter Repository Queries
Informatica PowerCenter Repository Queries are SQL-based commands used to extract metadata and operational insights directly from the repository database, bypassing the limitations of the Workflow Monitor client. By querying tables like OPB_TASK or views like REP_WFLOW_RUN, developers and admins can troubleshoot failed sessions, track performance metrics, and audit mapping structures with higher speed and precision.
/* Get Columns Types of a Specific Database Table */SELECT table_name, column_name, data_type, data_lengthFROM USER_TAB_COLUMNSWHERE table_name = 'TMP_QRY_1' ; -- Put the table name here/* Get Database Column Table Name Using a Database Column */SELECT table_name, column_nameFROM USER_TAB_COLUMNSwhere table_name in (select table_name from all_tables) and column_name in ('COUNTRY','REGION') ORDER BY 1SELECT FOLDER_NAME,WORKFLOW_NAME,SESSION_NAME,TARGET_NAME,TARGET_TABLE_NAMEFROM (SELECT DISTINCT Z.SUBJ_NAME FOLDER_NAME,C.TASK_NAME WORKFLOW_NAME,A.INSTANCE_NAME SESSION_NAME,D.INSTANCE_NAME TARGET_NAME,B.ATTR_VALUE TARGET_TABLE_NAME FROM OPB_TASK_INST A,OPB_SWIDGET_ATTR B,OPB_TASK C,OPB_SUBJECT Z,OPB_SWIDGET_INST D,OPB_TASK T,OPB_SESS_EXTNS EWHERE C.SUBJECT_ID = Z.SUBJ_ID AND C.TASK_TYPE IN (70, 71)AND C.TASK_ID = A.WORKFLOW_IDAND A.TASK_ID = B.SESSION_IDAND A.TASK_ID = D.SESSION_IDAND D.WIDGET_TYPE = 2AND D.SESS_WIDG_INST_ID = B.SESS_WIDG_INST_IDAND B.ATTR_ID = 19AND B.ATTR_VALUE IS NOT NULL AND T.TASK_ID = D.SESSION_IDAND E.SESSION_ID = D.SESSION_IDAND E.SESS_WIDG_INST_ID = D.SESS_WIDG_INST_IDAND C.IS_VISIBLE = 1AND C.VERSION_NUMBER = A.VERSION_NUMBERAND T.IS_VISIBLE = 1AND D.VERSION_NUMBER = T.VERSION_NUMBERAND B.VERSION_NUMBER = T.VERSION_NUMBERAND E.VERSION_NUMBER = D.VERSION_NUMBERUNIONSELECT DISTINCT Z.SUBJ_NAME FOLDER_NAME,C.TASK_NAME WORKFLOW_NAME,A.INSTANCE_NAME SESSION_NAME,D.INSTANCE_NAME TARGET_NAME,B.ATTR_VALUE TARGET_TABLE_NAMEFROM OPB_TASK_INST A,OPB_WIDGET_ATTR B,OPB_TASK C,OPB_SUBJECT Z,OPB_SWIDGET_INST D,OPB_TASK T,OPB_SESS_EXTNS E,OPB_MAPPING MWHERE C.SUBJECT_ID = Z.SUBJ_IDAND C.TASK_TYPE IN (70, 71)AND C.TASK_ID = A.WORKFLOW_IDAND A.TASK_ID = D.SESSION_IDAND B.MAPPING_ID = D.MAPPING_IDAND B.WIDGET_ID = D.WIDGET_IDAND B.WIDGET_TYPE = D.WIDGET_TYPEAND D.WIDGET_TYPE = 2AND B.ATTR_ID = 19AND B.ATTR_VALUE IS NOT NULLAND T.TASK_ID = D.SESSION_IDAND E.SESSION_ID = D.SESSION_IDAND E.SESS_WIDG_INST_ID = D.SESS_WIDG_INST_IDAND M.MAPPING_ID = B.MAPPING_IDAND C.IS_VISIBLE = 1AND C.VERSION_NUMBER = A.VERSION_NUMBERAND T.IS_VISIBLE = 1AND D.VERSION_NUMBER = T.VERSION_NUMBERAND E.VERSION_NUMBER = D.VERSION_NUMBERAND M.IS_VISIBLE = 1AND B.VERSION_NUMBER = M.VERSION_NUMBERAND NOT EXISTS(SELECT *FROM OPB_SWIDGET_ATTRWHERE SESSION_ID = D.SESSION_IDAND SESS_WIDG_INST_ID = D.SESS_WIDG_INST_IDAND ATTR_ID = 19AND VERSION_NUMBER = D.VERSION_NUMBER)) DUALORDER BY 1,2,3,4,5;/* Get Informatica Target Table Name Info */select * from BIAPPS_INFA_REP.rep_all_targetswhere parent_target_name like '%ABF%';/* Get mapping(s) name(s) for a source table */SELECT SUBJECT_AREA , MAPPING_NAME FROM BIAPPS_INFA_REP.REP_ALL_MAPPINGS where MAPPING_NAME in (<div> SELECT MAPPING_NAME FROM BIAPPS_INFA_REP.REP_SRC_MAPPING
where SOURCE_NAME = :ENTER_SRC_TBL_NAME);/* Number of transformation */
--transofrmations :
select WIDGET_TYPE_NAME Transformation_Type,
count (*) Number_OF_Transformations
from "BIAPPS_INFA_REP"."REP_ALL_TRANSFORMS"
group by WIDGET_TYPE_NAME ;
/* Get Informatica Mapping Info */
select mapping_name from BIAPPS_INFA_REP.OPB_mapping -- GET TARGET TABLE NAME INFO
where mapping_name like '%Daily%';
------------------ Get Infa Workflow Session run Status ----------------
select * from biapps_infa_rep.rep_sess_log
order by session_timestamp desc ;
/* Get Informatica Workflow Run Status */
select
SUBJECT_AREA folder_name,
WORKFLOW_NAME,
to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as Current_Date_Time,
to_char(START_TIME, 'YYYY-MM-DD HH24:MI:SS') as Starting_Date_Time,
to_char(END_TIME, 'YYYY-MM-DD HH24:MI:SS')as End_Date_Time,
round((END_TIME-START_TIME) *24*60,2) Time_Taken_Min,
RUN_ERR_CODE,
RUN_ERR_MSG,
RUN_STATUS_CODE
from
biapps_infa_rep.REP_WFLOW_RUN
where workflow_name like '%SDE_Product_Dim%' --------------------- put the workflow name here or remove the linbe for all
order by start_time desc;
/* Get Informatica Failed Sessions in the Past 10 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 biapps_infa_rep.rep_sess_log
WHERE run_status_code <> 1
AND TRUNC (Actual_Start) BETWEEN TRUNC (SYSDATE - 10) AND TRUNC (SYSDATE)
ORDER BY 1, 2;
/* Update Multiple Rows in a database table */
Alter Table WC_AGGR_F
add month_name varchar2(9) ;
UPDATE WC_AGGR_F
SET MONTH_NAME =
CASE MONTH
WHEN 1 THEN 'January'
WHEN 2 THEN 'Febreuary'
WHEN 3 THEN 'March'
WHEN 4 THEN 'April'
WHEN 5 THEN 'May'
WHEN 6 THEN 'June'
WHEN 7 THEN 'July'
WHEN 8 THEN 'August'
WHEN 9 THEN 'September'
WHEN 10 THEN 'October'
WHEN 11 THEN 'November'
WHEN 12 THEN 'December'
END ;
FAQ:
1. What are Informatica PowerCenter Repository Queries?
They are SQL statements run directly against the repository database to extract metadata and execution statistics. These queries provide a faster alternative to the Informatica client tools for monitoring and auditing.
2. Why should I query the repository instead of using the Workflow Monitor?
Querying the database is often faster, allows for custom filtering, and is essential when the client tools are unavailable. It also enables bulk reporting that the GUI cannot easily perform.
3. Is it safe to run SELECT queries on the repository?
Yes, running SELECT queries is generally safe and recommended for read-only metadata extraction. However, you should never perform INSERT or UPDATE operations on OPB_ tables, as this can corrupt your repository.
4. What is the difference between OPB tables and REP views?
OPB tables are the core “base” tables where Informatica stores its raw data. REP views are user-friendly layers built over those tables that make querying much simpler and more readable.
5. How can I find the start and end times of a workflow via SQL?
You can query the REP_WFLOW_RUN view, which includes START_TIME and END_TIME columns. By subtracting these, you can calculate the total duration of the ETL process.
6. How do I identify which sessions failed in the last 24 hours?
Query the REP_SESS_LOG table and filter by RUN_STATUS_CODE where it does not equal 1 (Success). Adding a date filter like Actual_Start > SYSDATE - 1 will isolate the last 24 hours.
7. Can I find which mapping uses a specific source table?
Yes, by querying the REP_SRC_MAPPING view, you can filter by SOURCE_NAME to see all associated mappings. This is vital for performing impact analysis before database changes.
8. What database permissions do I need to run these queries?
You typically need read-access (SELECT) permissions on the schema where the Informatica repository resides. Contact your Database Administrator to request access to the REP_ views specifically.
9. How do I count the number of transformations in my repository?
Use a COUNT and GROUP BY statement on the REP_ALL_TRANSFORMS view. This will categorize and count every transformation type, from Expressions to Aggregators.
10. Can these queries be used for automated reporting?
Absolutely, these SQL scripts can be integrated into Tableau, Power BI, or simple shell scripts. This allows teams to create automated health dashboards for their ETL environment.



