Home
PassAid
MuSQL
Utilities for Informatica MDM
Support
Mailing lists
 
 

Oracle SQL Script to Enhance an Informatica MDM ORS Export File

 
Informatica MDM Hub administrators and developers need to store, track changes, and compare configurations of Operational Reference Stores (ORS) from different environments (development, testing, production) or from different branches of development. The only way to generate and save an ORS configuration as a file is to take an ORS repository export (an XML document) in Repository Manager tool in MDM Hub Console. However, those files are not well suited for comparing. To begin with, they are big text files without line breaks, and many tools that compare files cannot work with such files. More importantly, same XML elements and attributes in ORS repository export documents do not consistently appear in the same order, even in exports of the same ORS taken at different times. This results in false differences reported where no differences really exist.

Moreover, ORS repository exports do not contain definitions of (nor they even mention) some configurable features stored in ORS repository that affect MDM Hub functionality and performance, like batch user exit programs, custom indexes and database procedures registered with the ORS.

This SQL script takes a regular ORS repository export and produces another XML document that contains an "enhanced" ORS repository export. Unlike original ORS exports, enhanced exports can easily be compared to each other using any text comparison utility, and results of such comparisons clearly show in detail all differences between compared ORS configurations.

This is achieved due to the following main features in enhanced ORS exports:

  • text of the XML document of enhanced ORS export is made "pretty" - each XML tag is on its own line, indented according to its nesting level;
  • in an enhanced ORS export, all XML elements and their attributes are always in the same order.
The above two enhancements even apply to XML elements whose text is itself an embedded XML document where special characters < and > are encoded (replaced with escape sequences &lt; and &gt;).

Enhanced ORS exports can also include definitions of other custom features implemented in that ORS that affect ORS functionality or performance but are not included in original ORS exports - batch user exits, custom database indexes and procedures registered with the ORS, database privileges granted to the ORS, etc.

When this script is executed, the session must be connected to an Oracle database. If the current database schema contains an ORS, and the source ORS repository export is from and up to date with that schema, the following additional options for inclusion in enhanced export become available and are enabled by default:

  1. In XML elements defining job groups that execute custom database procedures, original ORS export only includes system-generated ROWIDs assigned in ORS repository to procedures when they were registered with the ORS. Those IDs often vary in different environments of the same ORS (like development, testing, production, etc.). When comparing original exports taken from different environments of the same ORS shows a difference between two custom jobs, it is not clear whether those jobs execute different procedures, or the same procedure registered in those ORSs with different ROWIDs. This script adds actual names of procedures to XML elements that define custom jobs. When enhanced exports of the same ORS from different environments are compared, user can clearly see what really is different - the names of procedures executed by the job or just ROWIDs assigned to the same procedure.
  2. Metadata about user exits registered with the ORS - Java classes, interfaces they implement (which tell the jobs or events during which they are fired), Base64-encoded bytecode, even actual Java code (if included in the JAR file uploaded to the MDM Hub server during registration), etc. is included in enhanced ORS export.
  3. Enhanced ORS export includes DDL (Create ...) statements for
    1. custom table indexes registered with the ORS;
    2. database procedures registered with the ORS and used as custom jobs in ORS job groups;
    3. additional custom database objects used by MDM Hub but not directly registered with the ORS (like objects referenced in user exit Java programs or in external programs that access and perform operations in the MDM Hub application or in the ORS database, etc.);
    4. recursively, other custom database objects referenced by above objects.

    Users can specify custom database objects in 3.c above in one of two ways:

    • by populating PL/SQL collections INCLUDE_OBJECTS and EXCLUDE_OBJECTS inCustomizable Section in the script; this option does not require user to create custom tables.
    • by populating custom tables BS_INCLUDE_OBJECTS and BS_EXCLUDE_OBJECTS in the same database or in a remote database where, through a database link, the tables can be accessed from different databases that host ORS schemas.
    Both options allow users to specify names, types and owners of custom objects for which they want this script to generate DDL statements and include them in the enhanced export. Regular expressions for object names are supported. Entries in BS_EXCLUDE_OBJECTS table or EXCLUDE_OBJECTS collection exclude objects specified in entries of BS_INCLUDE_OBJECTS table or INCLUDE_OBJECTS collection respectively, and DDL statements for excluded objects are not generated.
  4. DCL (Grant ...) statements for roles, system privileges, and object privileges granted to the ORS are included in enhanced ORS export.

Despite all those additions, an enhanced ORS repository export file produced by this script is accepted by MDM Hub Console as a valid document that can be used there as a source for importing the entire ORS configuration or for comparison against a current ORS repository and creation of a change list for promotion to another ORS (alas, without the additions).

This script can be executed in Oracle Database command-line tools like SQL*Plus (a regular installation or Instant Client) or SQLcl (a command-line tool of SQL Developer; much slower with this script than SQL*Plus), on a Unix/Linux or Windows operation system. Executing this script in a SQL Developer worksheet is not recommended due to SQL Developer's peculiarity and bugs (e.g., saving spooled files in a special folder rather than the current folder like other tools, adding extra characters to quoted file names passed to HOST command, etc.) and may result in errors. Executing the script in TOAD or other Oracle Database GUI tools has not yet been extensively tested.

 

Download "enhance-ORS-export.sql" file
To ensure the file is downloaded and saved rather than opened for reading
in a browser tab, use the "Save link as" or a similar browser right-click menu option.
To save a file opened in a browser tab, use the "Save as..." menu option.