Monday, September 23, 2013

ORA-00214: control file '/u01/oradata/prod/control02.ctl' version 9240741

ORA-00214: control file '/u01/oradata/prod/control02.ctl' version 9242741
inconsistent with file '/u01/oradata/prod/control01.ctl' version 9099820
=================================================================================
Its because of the inconsistency between the mirrored copies of the control files.
All copies of the control file must have the same internal sequence number for oracle to start up the database or shut it down in normal or immediate mode.
Causes of the problem ORA-00214 includes,

1. You have restored the control file from backup, but forgot to copy it onto all of the mirrored copies of the control file as listed in the “CONTROL_FILES” parameter in the initialization parameter.
2. Improper Copy paste of the control file to a different location while the database is up and running.
4. The database or the system crashed while the mirrored copies of the control file were being updated, causing them to be out of sync.
5.  Not proper Shut down of the Oracle Machine. Like power failure, disk failure, Memory Failure

Solution:
----------------
Startup the database with single copy of the Control File. That should be a good copy.
To verify that
13:17:06 [SYS][PROD]>> show parameter control_files
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u01/oradata/prod/control01.ctl,
       /u01/oradata/prod/control02.ctl


1. Shut Abort
2. If you are using pfile, Edit init.ora file. Remove all the control file Except the Good one. Try One by one. Most probable highest Version Number will work.
3. If  you are using spfile;
 startup nomount. Then Set your control_file to the good one.

SQL> alter system set control_files=’/u01/oradata/prod/control01.ctl’ scope=spfile;
System altered

4. Startup restrict [If its working]. Shut down the database. Copy the good control file and Mirror it if not try with the other control file
SQL> shutdown immediate
cp /u01/oradata/prod/control02.ctl /u01/oradata/prod/control02.ctl_bkp
cp /u01/oradata/prod/control01.ctl /u01/oradata/prod/control02.ctl
SQL> startup nomount
SQL> alter database mount;
SQL> alter database open;
SQL> select name,open_mode from v$database;


Startup:
-----------------
If instead you get ORA-1122, ORA-1110, and ORA-1207, go back to step 2 and try with another control file.
If you have already tried each and every one of the mirrored copies unsuccessfully, you must create a new control file for the database.
If you get ORA-1113 and ORA-1110 pointing to one of the datafiles, it means the copy of the control file you picked is good, but the referenced datafile must be recovered before the database can be opened.Then RECOVER DATBASE, apply the log it prompt and ALTER DATABASE OPEN.

Saturday, July 27, 2013

Location of Different Logfiles in Exadata Environment


On the cell nodes

================

1. Cell alert.log file

/opt/oracle/cell/log/diag/asm/cell/{node name}/trace/alert.log
or
if the CELLTRACE parameter is set just do cd $CELLTRACE
2. MS logfile

/opt/oracle/cell/log/diag/asm/cell/{node name}/trace/ms-odl.log.
or
if the CELLTRACE parameter is set just do cd $CELLTRACE



3. OS watcher output data

/opt/oracle.oswatcher/osw/archive/

To get OS watcher data of specific date :
cd /opt/oracle.oswatcher/osw/archive
find . -name '*12.01.13*' -print -exec zip /tmp/osw_`hostname`.zip {} \; 
where 12- year 01- Month 13-day

4. Os message logfile
/var/log/messages


5. VM Core files
/var/log/oracle/crashfiles 
More details can be found in the following note:
Where / How to find OS crashcore file in Exadata Systems [Linux] (Doc ID 1389225.1)


6. SunDiag output files.
/tmp/sundiag_.tar.bz2


7. Cell patching issues related logfiles:   
/var/log/cellos

The major logfile of patch application output you will find in the db node from where you are patching in the location /tmp/<cell version>/patchmgr.stdout and patchmgr.err

8. Disk controller firmware logs:
/opt/MegaRAID/MegaCli/MegaCli64 -fwtermlog -dsply -a0

On the Database nodes


=====================

1. Database alert.log
$ORACLE_BASE/diag/rdbms/{DBNAME}/{sid}/trace/alert_{sid}.log
Ex: /u01/app/oracle/diag/rdbms/dbfs/DBFS2/trace/alert_DBFS2.log


2. ASM alert.log

$ORACLE_BASE/diag/asm/+asm/+ASM{instance number}/trace/ alert_+ASM {instance number}.log
Ex: /u01/app/oracle/diag/asm/+asm/+ASM2/trace/alert_+ASM2.log


3. Clusterware CRS alert.log
$GRID_HOME/log/{node name}/alert{node name}.log
Ex: /u01/app/11.2.0/grid/log/dmorldb02/alertdmorldb02.log


4. Diskmon logfiles
$GRID_HOME/log/{node name}/diskmon/diskmon.lo*
Ex: /u01/app/11.2.0/grid/log/dmorldb02/diskmon/diskmon.log


5. OS Watcher output files

/opt/oracle.oswatcher/osw/archive/

To get OS watcher data of specific date :
cd /opt/oracle.oswatcher/osw/archive
find . -name '*12.01.13*' -print -exec zip /tmp/osw_`hostname`.zip {} \; 
where 12- year 01- Month 13-day


6. Os message logfile
/var/log/messages

7. VM Core files for Linux

/u01/crashfiles  
More details can be found in the following note:
Where / How to find OS crashcore file in Exadata Systems [Linux] (Doc ID 1389225.1)


8. Disk controller firmware logs:
    

/opt/MegaRAID/MegaCli/MegaCli64 -fwtermlog -dsply -a0

Sunday, July 14, 2013

Workflow Directory Services User/Role Validation

This is often experienced in Oracle Applications 11i/R12 that user has been assigned a responsibility but not able to see it while accessing it. However , everything seems fine with responsibility ,it is not end dated and looks good. To overcome this issue , there is a concurrent request that does sync up of such users and responsibility in 11i version.

Login as System Administrator --> Submit Concurrent Program ""Workflow Directory Services User/Role Validation' with parameters 10000, yes, yes

This request would check all users and assigned responsibilities and should sync up users with attached responsibilities , users should be able to view assigned responsibility now.
p_BatchSize – 10000 (Default Value 10000)
p_Check_Dangling – Yes (Default value No)
Add missing user/role assignments – Yes (Default Value No)
Update WHO columns in WF tables – No (Default Value No)

Tuesday, July 2, 2013

Form process is not getting cleared and occupying /tmp space

LSOF:

lsof is a command meaning "list open files", which is used in many Unix-like systems to report a list of all open files and the processes that opened them. This open source utility was developed and supported by Victor A. Abell, the retired Associate Director of the Purdue University Computing Center. It works in and supports several Unix flavors.

Open files in the system include disk files, pipes, network sockets and devices opened by all processes. One use for this command is when a disk cannot be unmounted because (unspecified) files are in use. The listing of open files can be consulted (suitably filtered if necessary) to identify the process that is using the files.


# lsof /var
COMMAND     PID     USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
syslogd     350     root    5w  VREG  222,5        0 440818 /var/adm/messages
syslogd     350     root    6w  VREG  222,5   339098   6248 /var/log/syslog
cron        353     root  cwd   VDIR  222,5      512 254550 /var -- atjobs


To view the port associated with a daemon:

# lsof -i -n -P | grep sendmail
sendmail  31649    root    4u  IPv4 521738       TCP *:25 (LISTEN)

From the above one can see that "sendmail" is listening on its standard port of "25".
-i Lists IP sockets.
-n Do not resolve hostnames (no DNS).
-P Do not resolve port names (list port number instead of its name).
One can also list Unix Sockets by using lsof -U.

The /tmp directory keeps filling up but the space reported with user space tools ("du" for example) is next to nothing.

According to the standard system tools:


Digging deeper with "lsof" we see the following:


[root@mail tmp]# lsof | grep "/tmp"
bash       1970    root  cwd       DIR        9,3       4096          2 /tmp
screen    13507   jgray    3r     FIFO        9,3                 15747 /tmp/uscreens/S-jgray/13507.pts-0.mail
perl      19932  zimbra    1w      REG        9,3      71523         18 /tmp/logswatch.out (deleted)
perl      19932  zimbra    2w      REG        9,3      71523         18 /tmp/logswatch.out (deleted)
zmlogger  19937  zimbra    1w      REG        9,3      71523         18 /tmp/logswatch.out (deleted)
zmlogger  19937  zimbra    2w      REG        9,3      71523         18 /tmp/logswatch.out (deleted)
zmlogger  19937  zimbra    4w      REG        9,3 1884374605         26 /tmp/zmlogger.out (deleted)
mysqld_sa 21321  zimbra    1w      REG        9,3         70         15 /tmp/zmcontrol.out.20738 (deleted)
mysqld_sa 21321  zimbra    2w      REG        9,3         70         15 /tmp/zmcontrol.out.20738 (deleted)
logswatch 21391  zimbra    1w      REG        9,3         82         19 /tmp/logswatch.out
logswatch 21391  zimbra    2w      REG        9,3         82         19 /tmp/logswatch.out
mysqld    21402  zimbra    5u      REG        9,3          0         20 /tmp/ibD4jO0l (deleted)
mysqld    21402  zimbra    6u      REG        9,3          0         21 /tmp/ibzy1fOB (deleted)
mysqld    21402  zimbra    7u      REG        9,3          0         22 /tmp/ibXukIBR (deleted)
mysqld    21402  zimbra    8u      REG        9,3          0         23 /tmp/ibJj1dq7 (deleted)
mysqld    21402  zimbra   12u      REG        9,3          0         25 /tmp/iblBE0Vn (deleted)
perl      21423  zimbra    1w      REG        9,3         82         19 /tmp/logswatch.out
perl      21423  zimbra    2w      REG        9,3         82         19 /tmp/logswatch.out


Regards,
Jaagadish.

Sunday, May 26, 2013

Purging AUDIT TRAIL RECORDS (AUD$ Table)

If in your production database configured audit, DBA should maintain audit tables.
Because audit records may grows up to undesired size.
One of the most significant aspects of database security involves setting up auditing to record user activities.
When auditing is enabled, the audit output is recorded in an audit trail, which is usually stored in the database in a table under the SYS schema called AUD$. It can also reside as files in the file system, and the files can optionally be stored in XML format. For more-precise control, the Fine Grained Auditing feature of Oracle Database 11g provides granular control of what to audit, based on a more detailed set of policies. Fine Grained Auditing audits are usually stored in another table, FGA_LOG$, under the SYS schema.

These various audit trails can quickly grow out of control when database activity increases. As audit trails grow, two main challenges must be addressed: 
  1. Trails need to be kept to a manageable size (and old records purged) if they are to be used effectively in forensic analysis.
  2. Because database-resident trails are typically stored in the SYSTEM tablespace, they can potentially fill it up—bringing the database to a halt. 
Fortunately, the new auditing features in Oracle Database 11g Release 2 can help address these challenges. These capabilities, implemented in a package called DBMS_AUDIT_MGMT, enable you to move audit trails from the SYSTEM tablespace to one of your choice.
The new auditing features also let you set up one-time and automated purge processes for each of your audit trail types. Historically, to purge an audit trail, you were generally forced to stop auditing (which may have required bouncing the database), truncate, and then restart auditing (and bouncing the database again).
In this article, you will learn how to use the new features in Oracle Database 11g Release 2 to manage your audit trails. 
Oracle 11g Release 1 turned on auditng by default for the first time. Oracle 11g Release 2 now allows better management of the audit trail using theDBMS_AUDIT_MGMT package.
The AUDIT_TRAIL_TYPE parameter is specified using one of three constants.
  • DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD: Standard audit trail (AUD$).
  • DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD: Fine-grained audit trail (FGA_LOG$).
  • DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD: Both standard and fine-grained audit trails.
If you want the purge job to maintain an audit trail of a specific number of days, the easiest way to accomplish this is to define a job to set the last archive time automatically. The following job resets the last archive time on a daily basis, keeping the last archive time 90 days in the past.
Automated Purge with retention of 90 days.
BEGIN
  DBMS_SCHEDULER.create_job (
    job_name        => 'audit_last_archive_time',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN 
                          DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, TRUNC(SYSTIMESTAMP)-90);
                          DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD, TRUNC(SYSTIMESTAMP)-90);
                          DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS, TRUNC(SYSTIMESTAMP)-90);
                          DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(DBMS_AUDIT_MGMT.AUDIT_TRAIL_XML, TRUNC(SYSTIMESTAMP)-90);
                        END;',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'freq=daily; byhour=0; byminute=0; bysecond=0;',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'Automatically set audit last archive time.');
END;
/


 Manual Purging only aud$ table with retention of 120 days.


col owner for a20
select LAST_ANALYZED,owner, table_name,num_rows from dba_tables where table_name='AUD$';

LAST_ANALYZED   OWNER                TABLE_NAME                       NUM_ROWS
--------------- -------------------- ------------------------- ---------------
14-OCT-07       SYS                  AUD$                                    0

20:03:01 [SYS]>> exec dbms_stats.gather_table_stats (ownname=>'SYS', tabname=>'AUD$' , estimate_percent=>10, cascade=>TRUE, degree=>5);

PL/SQL procedure successfully completed.

Elapsed: 00:00:19.65
20:03:31 [SYS]>> select LAST_ANALYZED,owner, table_name,num_rows from dba_tables where table_name='AUD$';

LAST_ANALYZED   OWNER      TABLE_NAME                       NUM_ROWS
--------------- ---------- ------------------------- ---------------
24-MAY-13       SYS        AUD$                              1982500

00:36:00 [SYS]>> select max(ntimestamp#) from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -1000);

MAX(NTIMESTAMP#)
---------------------------------------------------------------------------
28-AUG-10 11.58.44.054379 PM


02:45:16 [SYS]>> select max(ntimestamp#) from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -500);

MAX(NTIMESTAMP#)
---------------------------------------------------------------------------
10-JAN-12 11.56.07.081514 PM

Elapsed: 00:00:01.51


02:46:13 [SYS]>> select max(ntimestamp#) from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -250);

MAX(NTIMESTAMP#)
---------------------------------------------------------------------------
16-SEP-12 11.58.46.296859 PM

Elapsed: 00:00:01.55


02:59:00 [SYS]>> select max(ntimestamp#) from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -120);

MAX(NTIMESTAMP#)
---------------------------------------------------------------------------
24-JAN-13 11.59.17.319628 PM


03:04:53 [SYS]>> delete from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -1000);

795713 rows deleted.

Elapsed: 00:01:02.47


03:06:08 [SYS]>> commit;

Commit complete.

Elapsed: 00:00:00.02


03:06:38 [SYS]>> delete from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -500);

660309 rows deleted.

Elapsed: 00:00:56.64


03:07:58 [SYS]>> commit;

Commit complete.

Elapsed: 00:00:00.01


03:08:08 [SYS]>> delete from sys.aud$ where trunc(NTIMESTAMP# ) < trunc(sysdate -120);

396701 rows deleted.

Elapsed: 00:00:46.57


03:09:07 [SYS]>> commit;

Commit complete.



Rebuilding Indexes
----------------------
03:25:23 [SYS]>> select owner,index_name,index_type,LAST_ANALYZED from dba_indexes where table_name='AUD$' and owner='SYS';

OWNER        INDEX_NAME                               INDEX_TYPE   LAST_ANALYZED
------------ ---------------------------------------- ------------ ---------------
SYS          SYS_IL0000000375C00040$$                 LOB
SYS          SYS_IL0000000375C00041$$                 LOB
SYS          I_AUD1                                   NORMAL       25-MAY-13


-->If any Indexes listed above needs to rebuild indexes.
 
03:27:50 [SYS]>> alter index SYS.I_AUD1 rebuild online;

Index altered.

Elapsed: 00:00:05.39


03:35:59 [SYS]>> exec dbms_stats.gather_table_stats (ownname=>'SYS', tabname=>'AUD$' , estimate_percent=>10, cascade=>TRUE, degree=>5);

PL/SQL procedure successfully completed.


03:37:31 [SYS]>> select LAST_ANALYZED,owner, table_name,num_rows from dba_tables where table_name='AUD$';

LAST_ANALYZED   OWNER        TABLE_NAME                  NUM_ROWS
--------------- ------------ -------------------- ---------------
25-MAY-13       SYS          AUD$                          123510


Saturday, May 18, 2013

MONITORING ALERT LOG ORA-ERRORS

MONITORING ALERT LOG ORA-ERRORS
######################################
Below script is used for monitoring all the ORA-Errors from the alert log and used to send to our mail boxes, we can schedule this through cronjob.

vi monitor_alertlog.sh
------------------------------
tail -10 /u01/app/oracle/diag/rdbms/db/PROD/trace/alert_PROD.log > /u01/app/oracle/monitoring/temp.lst
cat /u01/app/oracle/monitoring/temp.lst | grep ORA- > /u01/app/oracle/monitoring/temp1.lst
cnt=`cat /u01/app/oracle/monitoring/temp1.lst |wc -l`
if [ $cnt -gt 0 ]; then
/bin/mail -s "ORA ERRORS FOUND IN PROD ALERT LOG" jprasad@gmail.com < /u01/app/oracle/monitoring/temp1.lst
fi
rm /u01/app/oracle/monitoring/temp.lst /u01/app/oracle/monitoring/temp1.lst

Friday, April 12, 2013

Script to find all the Concurrent Programs which are Trace Enabled.

Below Query will help out in finding all the Concurrent programs which are Trace Enabled.

sqlplus apps/<password>

set linesize 600
set pages 1000 lines 1000
col Short_Name for a30
select a.CONCURRENT_PROGRAM_ID, b.USER_CONCURRENT_PROGRAM_NAME "Program_Name", a.CONCURRENT_PROGRAM_NAME "Short_Name", a.APPLICATION_ID
from fnd_concurrent_programs a, fnd_concurrent_programs_tl b
where a.CONCURRENT_PROGRAM_ID=b.CONCURRENT_PROGRAM_ID and a.ENABLE_TRACE='Y';

Sunday, March 24, 2013

To generate the DDL of the majority of objects in the database (METADATA)

set long 1000000
set pages 2000
set heading off feed off
set verify off
set serveroutput on size 1000000

spool genobj.lst

PROMPT
PROMPT Valid Object types Supported : 
PROMPT                                 CLUSTER
PROMPT                                 CONSTRAINT
PROMPT                                 CONTEXT
PROMPT                                 DATABASE LINK
PROMPT                                 DIMENSION
PROMPT                                 DIRECTORY
PROMPT                                 FUNCTION
PROMPT                                 INDEX
PROMPT                                 INDEXTYPE
PROMPT                                 JAVA SOURCE
PROMPT                                 LIBRARY
PROMPT                                 MATERIALIZED VIEW
PROMPT                                 OPERATOR
PROMPT                                 PACKAGE
PROMPT                                 PACKAGE BODY
PROMPT                                 PROCEDURE
PROMPT                                 ROLE
PROMPT                                 SEQUENCE
PROMPT                                 SYNONYM
PROMPT                                 TABLE
PROMPT                                 TRIGGER
PROMPT                                 TYPE
PROMPT                                 TYPE BODY                             
PROMPT                                 USER
PROMPT                                 VIEW
PROMPT                                 XML SCHEMA

PROMPT
ACCEPT obj_type PROMPT 'Enter Value for Object Type :'
PROMPT
PROMPT Object Name Context
PROMPT
PROMPT CONSTRAINT    (object_name => all PK/FK constraints for table_name)
PROMPT INDEX         (object_name => all indexes for table_name)
PROMPT
ACCEPT owner PROMPT 'Enter Value For Owner  for all : '
ACCEPT obj_name PROMPT 'Enter Value for Object Name  for all :'

WITH genobject AS (
   select object_type
          , dbms_metadata.get_ddl(
              DECODE(object_type,'DATABASE LINK','DB_LINK'
                                 ,'JAVA SOURCE','JAVA_SOURCE'
                                 ,'MATERIALIZED VIEW','MATERIALIZED_VIEW'
                                 ,'PACKAGE BODY','PACKAGE_BODY'
                                 ,'TYPE BODY','TYPE_BODY'
                                 ,'XML SCHEMA','XMLSCHEMA'
                    ,object_type)
              , object_name
              , DECODE(object_type,'DIRECTORY', null
                    ,owner)
              ) ddl
   from dba_objects
   where owner like UPPER('%&owner%')
   and object_name like UPPER('%&obj_name%')
   and object_type = UPPER('&obj_type')
   ),
     genindx AS (
   select 'INDEX' object_type
          , dbms_metadata.get_ddl('INDEX', index_name, owner ) ddl
   from dba_indexes
   where owner like UPPER('%&owner%')
   and table_name like UPPER('%&obj_name%')
   ),
     gencons AS (
   select 'CONSTRAINT' object_type
          , dbms_metadata.get_ddl('CONSTRAINT', constraint_name, owner ) ddl
   from dba_constraints
   where owner like UPPER('%&owner%')
   and table_name like UPPER('%&obj_name%')
   and constraint_type in ('P','R')
   ),
     genrole AS (
   select 'ROLE' object_type
          , dbms_metadata.get_ddl('ROLE', role) ddl
   from dba_roles
   where role like UPPER('%&obj_name%')
   ),
     genuser AS (
   select 'USER' object_type
          , dbms_metadata.get_ddl('USER', username) ddl
   from dba_users 
   where username like UPPER('%&obj_name%')
   )
SELECT dbms_lob.substr(ddl)
FROM genobject WHERE object_type = UPPER('&obj_type')
UNION
SELECT dbms_lob.substr(ddl)
FROM genindx WHERE object_type = UPPER('&obj_type')
UNION
SELECT dbms_lob.substr(ddl)
FROM gencons WHERE object_type = UPPER('&obj_type')
UNION
SELECT dbms_lob.substr(ddl)
FROM genrole WHERE object_type = UPPER('&obj_type')
UNION
SELECT dbms_lob.substr(ddl)
FROM genuser WHERE object_type = UPPER('&obj_type')
/

spool off

Informatica Powercenter repository queries

TABLE OF CONTENTS

1 Overview

2 FOLDER
  • 2.1 List folder details
  • 2.2 List of shared folders
  • 2.3 List of Users and Groups having Privileges on Folders
3 SOURCE
  • 3.1 List of source tables
  • 3.2 List and count of tables in each folder by db type
  • 3.3 List and count of tables overall used
  • 3.4 List of source tables used in mappings
  • 3.5 List of Sources tables using as Shortcuts
4 TARGET
  • 4.1 List of Target Tables
  • 4.2 List and count of tables in each folder by db type
  • 4.3 List and count of table overall used
5 TRANSFORMATION
  • 5.1 List of filer transformations
  • 5.2 List of Sequence transformations
  • 5.3 List of tables used as lookups
  • 5.4 List of transformations using sql overrides
  • 5.5 List all transformations
  • 5.6 List all Expression transformations using ‘concat’ function
  • 5.7 List of all port details of an Expression transformations
  • 5.8 List of all Expression transformation port links
  • 5.9 List of LKP transformation port links used in mappings
6 MAPPING
  • 6.1 List mapping names
  • 6.2 List total count of mappings
  • 6.3 List last saved user for a mapping
  • 6.4 List Mapping parameters and variables
  • 6.5 List all Mappings using PARALLEL hints
7 MAPPLET
  • 7.1 List Mapplets in all folders
  • 7.2 List Mapplet parameters and variables
8 SESSION
  • 8.1 List session names
  • 8.2 List save session log count
  • 8.3 List stop on errors count
  • 8.4 List hardcoded paths
  • 8.5 List parameter file paths
  • 8.6 List session log names
  • 8.7 List commit intervals
  • 8.8 List total source partitions
  • 8.9 List total target partitions
  • 8.10 List DTM Buffer Size
  • 8.11 List collect performance data
  • 8.12 List Incremental Aggregation
  • 8.13 List Reinitialize aggregate cache
  • 8.14 List Enable high precision
  • 8.15 List Session retry on deadlock
  • 8.16 List write backward compatible check
  • 8.17 List over ride tracing
  • 8.18 List save session log by
  • 8.19 List load type
  • 8.20 List 'post_session_success_command' in session
  • 8.21 List of all emails with attachment
  • 8.22 List Invalid Sessions and Workflows
9 TASKS
  • 9.1 List command tasks
  • 9.2 List decision tasks
  • 9.3 List Event Wait tasks
10 WORKLET
  • 10.1 List worklet names
  • 10.2 List hierarchies of all workflows and its worklets
11 WORKFLOW
  • 11.1 List workflow names
  • 11.2 List save workflow log count
  • 11.3 List workflow log names
  • 11.4 List write backward compatible check
  • 11.5 List fail_parent_if_task_fails objects
  • 11.6 List fail_parent_if_task_dont_run objects
  • 11.7 List is_task_enabled objects
  • 11.8 List treat_input_links_as objects
  • 11.9 List all workflows whose server is not assigned
  • 11.10 List of workflow run details
12 CONNECTIONS
  • 12.1 List of cnxs using alter in env sql
  • 12.2 List of cnxs used in session levels
  • 12.3 List Lotus connection details
  • 12.4 ODBC / SQL Server Connection details
  • 12.5 List of sessions used by a connection
  • 12.6 List all Connections with User and Privileges
13 REPOSITORY
  • 13.1 Repository Info
  • 13.2 List of objects which are Not Valid
  • 13.3 List of objects which are failed in last 5 days
  • 13.4 List where all a table is used
  • 13.5 List all source and target tables of mapping
  • 13.6 List comments of all object

14 MISLENIOUS
  • 14.1 Query to find list of objects saved by last user

15 GROUPS & USERS
  • 15.1 List User, Groups and status

1 OVERVIEW
Below Steps are intended for informatica development team to check if their etl code is as per ETL Standards’, developer team need to have read only access to informatica repository tables and Views. Please suffix your respective schema names for all your table / views names in below queries.

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 BY1,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 ASTRANSFORMATION_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 END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END
END "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_NAMEAS 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 REINTIALIZE 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

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_VALUEAS 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)
--AND SUBJECT_AREA= 'ABC'
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 fromopb_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 fromopb_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 whered.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 whered.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 xwhere 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_groupsx 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

15 GROUPS & USERS


Power Center Version 8 onwards Users and Groups details are stored in Domain database and in unreadable format. On execution of below attached scripts on domain database v_users and v_user_group views will be created and you can query on these views.

Steps to Follow:

Step 1 : Log into Domain db with create view, procedure & Function user Privileges
Step 2 : Execute below function

create or replace FUNCTION xblob_to_clob(l_blob BLOB) RETURN CLOB IS l_clob CLOB;
l_src_offset NUMBER;
l_dest_offset NUMBER;
l_blob_csid NUMBER := dbms_lob.default_csid;
v_lang_context NUMBER := dbms_lob.default_lang_ctx;
l_warning NUMBER;
l_amount NUMBER;
BEGIN

IF dbms_lob.getlength(l_blob) > 0 THEN
dbms_lob.createtemporary(l_clob, TRUE);
l_src_offset := 1;
l_dest_offset := 1;
l_amount := dbms_lob.getlength(l_blob);
dbms_lob.converttoclob(l_clob, l_blob, l_amount, l_src_offset, l_dest_offset, 1, v_lang_context, l_warning);
RETURN l_clob;
ELSE
l_clob := to_clob('');
RETURN l_clob;
END IF;

dbms_lob.freetemporary(l_clob);
END;
/

Step 3 : Execute below sql to create v_user view

CREATE OR REPLACE FORCE VIEW "V_USERS" ("USER_ID", "USER_NAME", "NAMESPACE", "FULL_NAME", "DESCRIPTION", "EMAIL", "PHONE", "READ_ONLY", "DISABLE") AS
SELECT id user_id,
extractvalue(xmltype(xblob_to_clob(metadata)),
'/metadata:User/userName',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) userName,
extractvalue(xmltype(xblob_to_clob(metadata)),
'/metadata:User/nameSpace',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) nameSpace,
extractvalue(VALUE(i),
'info/fullName',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) fullName,
extractvalue(VALUE(i),
'info/description',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) description,
extractvalue(VALUE(i),
'info/email',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) email,
extractvalue(VALUE(i),
'info/phone',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) phone,
extractvalue(VALUE(i),
'info/readOnly',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) readOnly,
extractvalue(VALUE(i),
'info/disable',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'
) disable
FROM pcsf_user x,
TABLE(
xmlsequence(
EXTRACT(
xmltype(xblob_to_clob(x.metadata)),
'/metadata:User/info',
'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"')
)
) i;
/


Step 4 : Execute below sql to create v_user_group view

CREATE OR REPLACE VIEW V_USER_GROUP
(GROUP_ID, GROUP_NAME, USER_NAME)
AS
SELECT id group_id,
extractvalue(xmltype(xblob_to_clob(metadata)), '/metadata:Group/groupName', 'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"') group_name,
extractvalue(VALUE(p), 'userRef/userName', 'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"') AS
user_name
FROM pcsf_group x,
TABLE(xmlsequence(EXTRACT(xmltype(xblob_to_clob(x.metadata)), '/metadata:Group/userRef', 'xmlns:common="http://www.informatica.com/pcsf/common" xmlns:usermanagement="http://www.informatica.com/pcsf/usermanagement" xmlns:domainservice="http://www.informatica.com/pcsf/domainservice" xmlns:logservice="http://www.informatica.com/pcsf/logservice" xmlns:domainbackup="http://www.informatica.com/pcsf/domainbackup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:metadata="http://www.informatica.com/pcsf/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:domainconfigservice="http://www.informatica.com/pcsf/domainconfigservice" xmlns:alertservice="http://www.informatica.com/pcsf/alertservice" xmlns:licenseusage="http://www.informatica.com/pcsf/licenseusage" xmlns:webserviceshub="http://www.informatica.com/pcsf/webserviceshub"'))) p
/


    15.1 USER , GROUP AND STATUS OF USER

select distinct 'DEV8_ABCD_REPO' as Repository ,(select name from pcsf_domain) domain_name, group_name,a.user_name,description,
decode(disable,'true','Disabled','false','Enabled',NULL) as user_status
from v_users a, v_user_group b
where a.user_name = b.user_name
and namespace = 'Native'
order by 1,2,3,4