Sei sulla pagina 1di 14

Repository Queries

Informatica Administration
Sid (Inf4sid@gmail.com)
This Session will give the Road Map to get to know about the Meta Data Views & Tables

Category Description
Database Provides a list of database definitions in the repository.
Sources Provides a list of source definitions by folder.
Targets Provides a list of target definitions by folder.
Provides a list of sources, targets, and transformations used in mappings and
Mappings and Mapplets
mapplets by folder.
Metadata Extensions Provides details of metadata extensions defined for objects.
Transformations Provides details of transformation instances by folder.
Workflows, Worklets,
Provides static and run time details for workflows and worklets by folder.
and Tasks
Security Provides user and group information.
Provides deployment details such as deployment groups and objects that were
Deployment
deployed from one repository to another.
Provides repository details such as repository name and connection
Repository
information.
PowerCenter Server Provides details such as server name and host name.
Changed Management Provide version history of object and label details.
Folders Provides details such as folder name and description.

1. Database Views:

Views: REP_DATABASE_DEFS

View Definition:

Column Name Datatype Description

DATABASE_NAME VARCHAR2 (240) Database definition name.

DEF_SOURCE VARCHAR2 (240) Source of the definition.

SUBJECT_AREA VARCHAR2 (240) Folder name.


VERSION_ID INTEGER Version ID of the source.
2. Source Views:

View Description

This view provides a list of the latest version of sources defined in each folder
REP_ALL_SOURCES
of a repository. For more information.
This view provides all the fields and field properties for all sources defined in
REP_ALL_SOURCE_FLDS
REP_ALL_SOURCES MX View. For more information
This view provides a list of all file definitions in the repository. For more
REP_SRC_FILES
information.
This view provides a list of relational database table sources that have been
REP_SRC_TBLS analyzed through the Source Analyzer tool or imported from a DDL (Data
Definition Language) file.
REP_SRC_FILE_FLDS These views provide access to the fields in a non-relational source. For more
REP_SEG_FLDS information.
This view provides access to the fields in relational sources. You can use the
REP_SRC_TBL_FLDS source name to retrieve all the fields belonging to the source. For more
information.

3. Target Views:

View Description
This view provides a list of the latest version of all targets defined in each
REP_ALL_TARGETS
folder of a repository.
This view provides all the fields and field properties for targets defined in
REP_ALL_TARGET_FIELDS
REP_ALL_TARGETS view.
This view provides a list of targets in the repository. FIRST_COLUMN_ID
REP_TARG_TBLS
is a link to the set of columns for this table.
This view provides the properties of columns defined for the target tables in a
REP_TARG_TBL_COLS
data warehouse or data mart.

4. Mapping and Mapplet views:

View Description
This view provides a list of the latest version of all mappings defined in each
REP_ALL_MAPPINGS
folder of a repository.
This view provides a list of the latest version of all mapplets defined in each
REP_ALL_MAPPLETS
folder of a repository.
This view provides access to the compound table-level transformation
REP_TARG_MAPPING
expressions for each target table.
This view shows compound field-level transformation expressions associated
REP_TARG_FLD_MAP
with a target.
This view shows the source fields used by the target fields in a mapping. This
REP_FLD_MAPPING
is the companion view for the REP_TBL_MAPPING view.
REP_SRC_MAPPING This view shows all sources used in a mapping.
REP_SRC_FLD_MAP This view shows the entire source fields used in a mapping.
This view shows all of the target tables used in a mapping and provides
REP_TBL_MAPPING
source to target mapping information
REP_TARG_TBL_JOINS This view contains join information between target tables.
REP_MAPPING_UNCONN_ This view displays the unconnected ports in sources, targets, and
PORTS transformations in a mapping
REP_MAPPING_PORT_CON This view displays the port-level connections between the objects of a
N mapping.

5. Metadata Extension views:

View Description
REP_METADATA_EXTNS This view displays the details of all metadata extensions in the repository.
REP_METADATA_EXTN_ This view displays reusable metadata extensions defined for objects in
DEFINES metadata extension domains.

6. Transformation Views:

View Description
This view provides a list of the latest version of all transformations and their
REP_ALL_TRANSFORMS
properties in each folder of a repository.
REP_WIDGET_INST This view displays the details of all transformation instances.
This view displays the details of dependencies between transformation
REP_WIDGET_DEP
instances in a mapping.
REP_WIDGET_ATTR This view displays attribute details for transformations, instances, and sessions.
REP_WIDGET_FIELD This view displays field level details for transformations.

7. Workflow, Worklet and Task views:

View Description
This view contains information about individual workflows and workflow
REP_WORKFLOWS
scheduling.
This view provides a list of all reusable and non-reusable tasks that can be used
REP_ALL_TASKS
by a workflow or a Worklet.
REP_ALL_SCHEDULERS This view displays a list of schedulers by folder.
REP_WFLOW_VAR This view displays a list of all variables declared within a workflow or Worklet.
This view displays the details of events created at the workflow or Worklet
REP_EVENT
level.
REP_TASK_INST This view displays all task instances within workflows and worklets.
This view shows how individual tasks and worklets are connected within a
REP_WORKFLOW_DEP
Worklet or a workflow.
This view displays the run statistics and folder reference for tasks within a
REP_TASK_INST_RUN
workflow or Worklet.
REP_WFLOW_RUN This view displays the run statistics for all workflows by folder.
REP_LOAD_SESSIONS This view provides information about reusable sessions in the repository.
This view contains information about connections associated with reusable
REP_SESSION_CNXS
sessions.
REP_SESSION_INSTANC
ES
This view contains connection information for session instances.

REP_SESSION_FILES This view contains file connections associated with reusable sessions.
REP_SESSION_INSTANC
E_FILES
This view contains file connections associated with reusable sessions.

REP_SESS_WIDGET_CN
XS
This view contains information about the sources and targets used in a session.

This view displays the list of tasks such as a command or an email for each
REP_COMPONENT
session.
REP_SESS_PARTITION_ This view provides partition details of the sources, targets, and transformations
DEF in a session.
REP_SESS_CONFIG_PA This view displays session configuration parameter details. If the session
RM overrides a parameter in the configured object, the view displays two rows.
This view displays the attribute values and overridden values for session and
REP_TASK_ATTR
workflow tasks.
REP_SESS_LOG This view provides log information about sessions.
This view contains information about the status of an individual session run
REP_SESS_TBL_LOG
against a target.

8. Security Views:

View Description
This view provides a list of all PowerCenter users along with details on user
REP_USERS
privileges and contact information.
This view provides association details between PowerCenter users and the
REP_USER_GROUPS
group to which they belong.
This view provides a list of PowerCenter groups along with details on group
REP_GROUPS
privileges and contact information.

9. Deployment Views:

View Description
This view provides information on deployment group in Change
REP_DEPLOY_GROUP
Management.
REP_DEPLOY_GROUP_DETAIL This view provides Change Management deployment details.

10. Repository Views:

View Description
The repository view allows you to see repository name, database type,
REP_REPOSIT_INFO connection information on which the repository is created, and whether the
repository is local or global.
11. PowerCenter Server Views:

View Description
This view provides information about PowerCenter Server name, host name, IP
REP_SERVER_INFO
address, and timeout.
This view provides information on PowerCenter Server description, location,
REP_SERVER_NET
and usage.
This view provides information about PowerCenter Server identification and
REP_SERVER_NET_REF
usage.

12. Change Management Views:

View Description
Provides information on the version history of all objects in a PowerCenter
REP_VERSION_PROPS
repository.
REP_CM_LABEL Provides information on labels in Change Management.
REP_CM_LABEL_REF Provides information on label details in Change Management.

13. Folder View:

View Description
The folder view allows you to see all the folders defined in the PowerCenter
REP_SUBJECT
repository. It describes the name, ID, and description of each folder.

DATABASE AND TABLE Level Information:

TO KNOW THE CONNECTION DETAILS(REG : WHO IS USING THE DATABASE AND CONNECTION NAME :
EX ARIS_M,ARIS_T...)
Select Database_Type, Database_Name, Table_Name, Subject_Area From Rep_Src_Tbls
TO CHECK THE USER USING THE PARTICULAR TABLE AS SOURCE OR NOT

Select Parent_Subject_Area,Parent_Source_Name From Rep_All_Sources Where Table_Name< From


Drop Down List>

TO CHECK USER USING THE PARTICULAR TABLE AS TARGET OR NOT

Select Parent_Subject_Area,Parent_Target_Name From Rep_All_Targets Where Table_Name< From


Drop Down List>

TO CHECK USER USING THE PARTICULAR TABLE AS SOURCE AND TARGET

Select Parent_Target_Name From Rep_All_Targets A,Rep_All_Sources B Where


A.Parent_Target_Name=B.Parent_Source_Name

FOR PARTICULAR USER:

Select Parent_Target_Name From Rep_All_Targets A,Rep_All_Sources B Where


A.Parent_Target_Name=B.Parent_Source_Name And Parent_Subject_Area <From Drop Down List>

To Check user using the particular table as source and not as target anywhere

Select Parent_Source_Name From Rep_All_Sources Where Parent_Source_Name Not In(Select


Parent_Target_Name From Rep_All_Targets)

FOR PARTICULAR USER:

Select Parent_Source_Name From Rep_All_Sources Where Parent_Source_Name Not In(Select


Parent_Target_Name From Rep_All_Targets Where Parent_Subject_Area <From Drop Down List>) And
Parent_Subject_Area <From Drop Down List>

TO CHECK USER USING THE PARTICULAR TABLE AS TARGET AND NOT AS SOURCE
ANYWHERE

Select Parent_Target_Name From Rep_All_Targets Where Parent_Target_Name Not In(Select


Parent_Source_Name From Rep_All_Sources)

FOR PARTICULAR USER :

Select parent_target_name from rep_all_targets


where parent_target_name not in(select parent_source_name from rep_all_sources where
parent_subject_area <from drop down list> )
and parent_subject_area <from drop down list>

***********************************************************************************

Mapping Level Information:

GETTING UNCONNECTED PORTS FOR A PARTICULAR MAPPING AND FOR A PARTICULAR USER.

SELECT MAPPING_NAME ,SUBJECT_AREA ,OBJECT_TYPE_NAME AS TRANSFORMATION


,OBJECT_INSTANCE_NAME AS TRANSFORMATION_NAME, FIELD_NAME
FROM REP_MAPPING_UNCONN_PORTS WHERE MAPPING_NAME <FROM DROP DOWN LIST> AND
SUBJECT_AREA <FROM DROP DOWN LIST>

GETTING TABLE INFORMATION

WHERE THE TABLE IS USING AS A SOURCE OR TARGET OR LOOKUP FOR PARTICULAR USER AND
MAPPING

SELECT SRC.MAPPING_NAME,
CASE
WHEN SOURCE_NAME = 'S_ACCNT_POSTN'
THEN SOURCE_NAME
ELSE NULL
END AS SOURCE,
CASE
WHEN LKP.LOOKUP = 'S_ACCNT_POSTN'
THEN LKP.LOOKUP
ELSE NULL
END AS LOOKUP,
CASE
WHEN TARGET_NAME = 'S_ACCNT_POSTN'
THEN TARGET_NAME
ELSE NULL
END AS TARGET,
E.REPOSITORY_NAME
FROM REP_SRC_MAPPING SRC,
REP_TARG_MAPPING TAR,
(SELECT MAP.MAPPING_NAME AS MAPPING_NAME, TRAN.ATTR_VALUE AS LOOKUP
FROM REP_ALL_MAPPINGS MAP, REP_WIDGET_ATTR TRAN
WHERE WIDGET_TYPE = 11
AND ATTR_TYPE = 4
AND MAP.MAPPING_ID = TRAN.MAPPING_ID) LKP,
REP_REPOSIT_INFO E,
OPB_REPOSIT F
WHERE SRC.MAPPING_NAME = LKP.MAPPING_NAME
AND SRC.MAPPING_NAME = TAR.MAPPING_NAME
AND E.RECID = F.RECID
DEFAULT VALUE FOR A PARTICULAR FOLDER OR MAPPING NAME

SELECT E.REPOSITORY_NAME, C.SUBJECT_AREA, C.PARENT_MAPPING_NAME,


B.INSTANCE_NAME, A.FIELD_NAME, B.WIDGET_TYPE_NAME, A.DEFAULT_VALUE
FROM (SELECT WIDGET_ID, FIELD_NAME, DEFAULT_VALUE
FROM REP_WIDGET_FIELD) A,
(SELECT WIDGET_TYPE_NAME, WIDGET_ID, INSTANCE_NAME, MAPPING_ID
FROM REP_WIDGET_INST) B,
(SELECT PARENT_MAPPING_ID, PARENT_MAPPING_NAME, SUBJECT_AREA
FROM REP_ALL_MAPPINGS) C,
REP_REPOSIT_INFO E,
OPB_REPOSIT F
WHERE A.WIDGET_ID = B.WIDGET_ID
AND A.DEFAULT_VALUE IS NOT NULL
AND B.MAPPING_ID = C.PARENT_MAPPING_ID
AND E.RECID = F.RECID

GETTING OVERRIDE QUERIES FROM SOURCE QUALIFIER AND LOOKUP

SELECT E.REPOSITORY_NAME, C.SUBJECT_AREA, C.MAPPING_NAME, B.INSTANCE_NAME,


A.ATTR_NAME, A.ATTR_VALUE
FROM REP_WIDGET_ATTR A,
REP_WIDGET_INST B,
REP_ALL_MAPPINGS C,
REP_REPOSIT_INFO E,
OPB_REPOSIT F
WHERE A.WIDGET_ID = B.WIDGET_ID
AND B.MAPPING_ID = C.MAPPING_ID
AND A.WIDGET_TYPE IN (3, 11)
AND A.ATTR_ID = 1
AND A.ATTR_VALUE IS NOT NULL
AND E.RECID = F.RECID
ORDER BY C.SUBJECT_AREA,C.MAPPING_NAME

GETTING INFORMATION ABOUT THE TABLE FROM OVERRIDE QUERIES (SOURCE QUALIFIER, LOOKUP)

SELECT E.REPOSITORY_NAME, C.SUBJECT_AREA, C.MAPPING_NAME, B.INSTANCE_NAME,


A.ATTR_NAME, A.ATTR_VALUE
FROM REP_WIDGET_ATTR A,
REP_WIDGET_INST B,
REP_ALL_MAPPINGS C,
REP_REPOSIT_INFO E,
OPB_REPOSIT F
WHERE A.WIDGET_ID = B.WIDGET_ID
AND B.MAPPING_ID = C.MAPPING_ID
AND A.WIDGET_TYPE IN (3, 11)
AND A.ATTR_ID = 1
AND A.ATTR_VALUE IS NOT NULL
AND E.RECID = F.RECID
AND UPPER(SUBSTR(ATTR_VALUE , INSTR(ATTR_VALUE,'FROM')
,LENGTH(ATTR_VALUE))) LIKE '%TBL_SITE%'

GETTING FIELD DETAILS IN TRANSFORMATION:

SELECT E.REPOSITORY_NAME,C.SUBJECT_AREA, C.MAPPING_NAME,


A.WIDGET_TYPE_NAME AS TRANSFORMATION_TYPE,
A.INSTANCE_NAME AS TRANSFORMATION_NAME,
B.FIELD_NAME AS PORT_NAME,
CASE
WHEN B.PORTTYPE = 1---INPUT--
THEN 1
WHEN B.PORTTYPE = 2---OUTPUT--
THEN 2
WHEN B.PORTTYPE = 3--I/0--
THEN 3
WHEN B.PORTTYPE = 32---VARIABLE--
THEN 32
END AS PORT_TYPE,
B.EXPRESSION
FROM REP_WIDGET_INST A, REP_WIDGET_FIELD B, REP_ALL_MAPPINGS C,
REP_REPOSIT_INFO E,
OPB_REPOSIT F
WHERE A.WIDGET_ID = B.WIDGET_ID
AND A.MAPPING_ID = C.MAPPING_ID
AND B.EXPRESSION IS NOT NULL
AND E.RECID = F.RECID

---IF WE NEED TO FILTER FOR PARTICULAR TRANSFORMATION THEN WE WILL ADD THE
TRANSFORMATION TYPE---
WE HAVE TO ADD THE BELOW CONDITION ALS0

REP_WIDGET_INST.WIDGET_TYPE IN (9)

GETIING INFORMATION FOR A PARTICULAR TABLE WHERE IT’S INSERTING, UPDATING AND
DELETING.

SELECT DISTINCT e.repository_name, conn.subject_area AS subject_area,


conn.mapping_name AS mapping_name,
inst.instance_name AS instance_name,
attr.attr_value AS attr_value, conn.target
FROM (SELECT widget_id, subject_id, mapping_id, instance_name
FROM rep_widget_inst
WHERE widget_type = 4) inst,
(SELECT DISTINCT subject_id, subject_area, mapping_id,
mapping_name, from_object_name,
to_object_name AS target
FROM rep_mapping_conn_ports
WHERE from_object_type = 4
AND to_object_name = 'TBL_EMP_JOB_TYPE'
AND to_object_type = 2) conn,
(SELECT widget_id, mapping_id, attr_value, widget_type
FROM rep_widget_attr
WHERE widget_type = 4 AND attr_type = 2) attr,
rep_reposit_info e,
opb_reposit f
WHERE attr.widget_id = inst.widget_id
AND conn.mapping_id = inst.mapping_id
AND e.recid = f.recid
UNION
SELECT DISTINCT e.repository_name, subject_area AS subject_area,
mapping_name AS mapping_name,
from_object_name AS instance_name, 'INSERT ' AS attr_value,
to_object_name AS target
FROM rep_mapping_conn_ports, rep_reposit_info e, opb_reposit f
WHERE from_object_type <> 4
AND to_object_type = 2
AND to_object_name = 'TBL_EMP_JOB_TYPE'
AND e.recid = f.recid

TRACING LEVEL –WE HAVE TO GIVE MAPPING_NAME OR SUBJECT NAME AT RUN TIME

SELECT e.repository_name, MAP.parent_subject_area, MAP.parent_mapping_name,


inst.instance_name,
DECODE (attr_value,
'1', 'Terse',
'2', 'Normal',
'3', 'Verbose Initialization',
'4', 'Verbose Data'
) AS tracing_level
FROM (SELECT mapping_id, attr_name, widget_id, attr_value
FROM rep_widget_attr) attr,
(SELECT parent_mapping_id, parent_mapping_name, parent_subject_area,
parent_subject_id
FROM rep_all_mappings) MAP,
(SELECT mapping_id, widget_id, instance_name, widget_type_name,
subject_id
FROM rep_widget_inst) inst,
rep_reposit_info e,
opb_reposit f
WHERE MAP.parent_mapping_id = inst.mapping_id
AND MAP.parent_subject_id = inst.subject_id
AND attr.widget_id = inst.widget_id
AND attr.attr_name = 'Tracing Level'
AND e.recid = f.recid
AND inst.subject_id = 29
AND inst.mapping_id = 548

Mapplet used in mappings


select distinct rep_reposit_info.repository_name,
rep_all_mappings.parent_subject_area
as folder_name, rep_all_mappings.mapping_name,
rep_widget_inst.instance_name as mapplet_name
from rep_widget_inst, rep_all_mappings, rep_reposit_info
where rep_widget_inst.mapping_id=rep_all_mappings.mapping_id
and rep_widget_inst.widget_type=44

INVALID MAPPINGS

SELECT subject_area,parent_mapping_name,'NOT VALID' AS VALID FROM


REP_ALL_MAPPINGS WHERE PARENT_MAPPING_IS_VALID <>1

Workflow & Session Level Queries:

To Get last target load

SELECT TBL.SUBJECT_AREA ,WFL.WORKFLOW_NAME, TBL.SESSION_NAME ,CNXS.CNX_NAME,


TBL.WIDGET_NAME, MAX(TBL.END_TIME)
FROM REP_SESS_TBL_LOG TBL, REP_SESS_WIDGET_CNXS CNXS,REP_WORKFLOWS WFL
WHERE TBL.SESSION_ID = CNXS.SESSION_ID
AND TBL .START_TIME > TO_DATE('05/31/2007', 'MM/DD/YYYY') --DATE IS OPTION
AND TBL.SUCCESSFUL_ROWS > 0
AND CNXS.READER_WRITER_TYPE = 'Relational Writer'
AND WFL.SUBJECT_ID=TBL.SUBJECT_ID
AND WFL.WORKFLOW_ID=TBL.WORKFLOW_ID
AND TBL.WIDGET_NAME='SHAN_AGGRE' --- TABLE NAME IS ALSO
OPTION
GROUP BY CNXS.CNX_NAME, TBL.WIDGET_NAME,TBL.SUBJECT_AREA,TBL.SESSION_NAME
,WFL.WORKFLOW_NAME
ORDER BY MAX(TBL.END_TIME) DESC

To Get workflow details

SELECT DISTINCT
TBL.SUBJECT_AREA,WFL.WORKFLOW_NAME,TBL.SESSION_NAME,TBL.WIDGET_NAME
FROM REP_SESS_TBL_LOG TBL ,REP_WORKFLOWS WFL WHERE
WFL.WORKFLOW_ID=TBL.WORKFLOW_ID
--AND TBL.SUBJECT_AREA='SELECTED FROM DROP DOWN LIST'
-- AND TBL.WIDGET_NAME='SELECTED FROM DROPDOWN LIST
ORDER BY WFL.WORKFLOW_NAME
Getting load type of session(normal or bulk)

SELECT DISTINCT e.repository_name, sess.subject_area AS subject,


sess.MAPPING_NAME,sess.session_name,
cnxs.cnx_name AS connection_name,
CASE
WHEN attr.attr_value = '0'
THEN 'Normal'
WHEN attr.attr_value = '1'
THEN 'Bulk'
END AS target_load_type
FROM rep_load_sessions sess,
rep_sess_widget_cnxs cnxs,
opb_extn_attr attr,
rep_reposit_info e,
opb_reposit f
WHERE sess.session_id = cnxs.session_id
AND sess.session_id = attr.session_id
AND attr.attr_id = 3
AND attr.attr_value BETWEEN '0' AND '1'
AND cnxs.reader_writer_type = 'Relational Writer'
AND e.recid = f.recid

Query to give Invalid workflows =71 // invalid sessions =68 //

select opb_subject.subj_name, opb_task.task_name


from opb_task, opb_subject
where task_type = 71 --- 68 for sessions
and is_valid = 0
and opb_subject.subj_id = opb_task.subject_id

**************************************EOD*******************************************

Potrebbero piacerti anche