3 Extending Repository Creation Utility to Configure Custom Application Repositories

RCU provides an XML-based framework for component owners to plug-in your schema creation and deletion scripts into RCU. This chapter provides some details of the configuration XML files and script-writing guidelines that are used to integrate your components with RCU.

The following topics are covered in this chapter:

3.1 RCU Integration Options

RCU provides the following options for integrating component scripts:

RCU JDBC Engine Compliant SQL*Plus Scripts is the recommended option for integrating component scripts. SQL*Plus and External Processes are only intended for integrating Legacy/Classic components such as Oracle Portal 10g or Identity Management. Components that have a dependency on SQL*Plus scripts cannot be loaded with RCU when running from the installed Oracle Home. They can only be used when running RCU from CD.

3.1.1 RCU JDBC Engine Compliant SQL*Plus Scripts

The RCU JDBC Engine emulates a set of SQL*Plus features over JDBC. This set is broad enough to cover the requirements of schema creation. Your component teams can integrate existing SQL*Plus scripts with a few minor changes.

The RCU JDBC Engine parses the SQL*Plus script to get individual statements and then runs each statement over JDBC. Command line arguments to scripts and substitution using DEFINE variables are supported. Script can be nested (for example, one script can call other scripts). Component teams can specify list of expected errors and fatal errors to RCU through configuration files and RCU would interpret these when running the scripts.

These scripts are easy to maintain and use as they can be run in SQL*Plus in development environment. However, Oracle recommends that the RCU JDBCEngine tool is also used in your development environment to ensure that these scripts run properly when integrated with RCU.

3.1.2 Pure JDBC Scripts

This option is recommended for non-Oracle databases (for Oracle databases, RCU JDBC Engine Compliant SQL*Plus scripts should be used). Contents of the script file should be a valid PL/SQL block, which can be called with Connection.prepareCall() or Connection.createStatement(). Standard JDBC Bind variables with '?' convention are supported.

Some disadvantages of this option are:

  • No nested scripts, which can mean a larger number of scripts.

  • May require a more significant re-work for component teams to re-write the scripts in this format.

  • Difficult to maintain as every DDL statement has to be wrapped with in EXECUTE IMMEDIATE.

  • Cannot be run using SQL*Plus in development environment.

  • Less useful error support since the whole block would fail in case of any errors.

Below is an example:

<Action TYPE="JDBC" PERCENT_PROGRESS="20">
   <ValidIf DBTYPE="ORACLE" />
   <Command TYPE="INLINE">DROP USER %SCHEMA_USER% CASCADE</Command>
</Action>

And a second example:

<Action TYPE="Java" PERCENT_PROGRESS="100">
   <Command TYPE="METHOD">
      oracle.ias.version.SchemaVersionUtil:utilSetComponentValid
   </Command>

   <Parameters>
      <Parameter TYPE="String">MDS</Parameter>
    </Parameters>
</Action>

3.1.3 SQL*Plus Scripts

This option is mainly for the consumption of legacy components that need to be loaded from RCU. This option is available only when running RCU from the CD or standalone shiphome. RCU will use Oracle client on the CD or database server. Any 11g component that is expected to be loaded by launching RCU from the Oracle Home should not use this option.

Example:

<Action TYPE="SQLPlus" PERCENT_PROGRESS="100">
   <Command TYPE="SCRIPT">%SCRIPT_HOME%/oid/scripts/seedldap.sql</Command>
   <IgnorableErrors>
      <Error Type="ORA-01918">user name does not exist</Error>
   </IgnorableErrors>
</Action>

And a second example:

<Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
   <ValidIf DBTYPE="ORACLE" />
   <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/sql/mds_user.sql</Command>
   <Parameters>
      <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
      <Parameter TYPE="CmdLine">%SCHEMA_PASSWORD%</Parameter>
      <Parameter TYPE="CmdLine">%DEFAULT_TABLESPACE%</Parameter>
      <Parameter TYPE="CmdLine">%TEMPORARY_TABLESPACE%</Parameter>
   </Parameters>
</Action>

3.1.4 External Processes

This option is provided only for those components that have their own configuration tool for schema creation, like OPCA (Oracle Portal 10g). This is not a recommended option for any new component, as this option cannot make use of RCU error handling framework.

Example:

<Action TYPE="HostCmd">
<Command TYPE="SCRIPT">%RCU_HOME%/rcu/integration/cdb/config/bin/configure</Command>
<Parameters>
   <Parameter TYPE="ProcessInput">%JDBC_CONNECT_STRING%</Parameter>
   <Parameter TYPE="ProcessInput">%DBADMIN_USER%</Parameter>
   <Parameter TYPE="ProcessInput">%DBADMIN_PASSWORD%</Parameter>
   <Parameter TYPE="ProcessInput">%PREFIX_NAME%</Parameter>
   <Parameter TYPE="ProcessInput">%SCHEMA_USER%</Parameter>
   <Parameter TYPE="ProcessInput">%SCHEMA_PASSWORD%</Parameter>
   <Parameter TYPE="ProcessInput">%DEFAULT_TABLESPACE%</Parameter>
   <Parameter TYPE="ProcessInput">%TEMPORARY_TABLESPACE%</Parameter>
</Parameters>
</Action>

3.1.5 Java Code Using JavaAction

This option is provided to components that have Java code, which can accept a JDBC connection and execute SQL statements. This is generally used when huge amounts of data has to be seeded or LOBs need to be created.

Example:

<Action TYPE="Java">
   <Command TYPE="METHOD">
      oracle.ias.version.SchemaVersionUtil:utilCreateRegistryEntry
   </Command>

   <Parameters>
      <Parameter TYPE="Connection"></Parameter>
      <Parameter TYPE="String">%SCHEMA_USER%</Parameter>
   </Parameters>
</Action>

A second example:

<Action TYPE="Java">
   <Command TYPE="METHOD">oracle.webdb.config.PortalConfigAssistant:main</Command>
   <Parameters>
      <Parameter TYPE="StringArray">-mode PORTAL -s %SCHEMA_USER% -p %DBADMIN_PASSWORD% -c %DB_HOSTNAME%:%DB_PORTNUMBER%:%DB_SERVICE% -silent -verbose -owa -u %DEFAULT_TABLESPACE% -t %TEMPORARY_TABLESPACE% -d %SCHEMA_USER%_DOC -l %SCHEMA_USER%_LOG -in %SCHEMA_USER%_IDX -demo -report -voh %RCU_HOME% -log %RCU_LOG_LOCATION% -oh %SQLPLUS_HOME% -mrc %PREFIX_NAME% -rcu </Parameter>
   </Parameters>
</Action>

3.2 RCU Configuration Files

RCU provides the following configuration files types for component integration:

3.2.1 XML DTDs Defined by RCU

This section describes the XML DTDs defined by RCU:

3.2.1.1 Component Descriptor Configuration File

Each component owner would provide a configuration file adhering to following DTD, which lists the pre-requisites and actions:

The Component Descriptor configuration file is called ComponentInfo.dtd and is located in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory:

<?xml version="1.0" encoding="UTF-8" ?>
<!ENTITY % commonDTD SYSTEM "RCUCommon.dtd">
%commonDTD;
<!ELEMENT ComponentInfo (Display, PrefixSettings, Component*, PrerequisiteDescriptor*, ExecutionDescriptor?, FatalErrors?, IgnorableErrors?)>
<!ATTLIST ComponentInfo
        VERSION CDATA #REQUIRED
        TYPE CDATA #REQUIRED
        RESOURCE_BUNDLE_PACKAGE CDATA #IMPLIED>
<!ELEMENT PrefixSettings (DetectQuery*)>
<!ATTLIST PrefixSettings
          USE_SCHEMA_PREFIX (TRUE|FALSE) "TRUE"
          USE_TABLESPACE_PREFIX (TRUE|FALSE) "TRUE">
<!ELEMENT Component (ValidIfSet?, ValidIf?, Display, RepositoryConfigFile?, DetectQuery*, SchemaVersion?, SchemaUser?, AdditionalSchemaUser*, Dependents?, DatabaseName?, Tablespaces?, CustomVariables?)>
<!ATTLIST Component
        ID CDATA #REQUIRED
        PROGRESS_UNITS CDATA #IMPLIED
        IS_GROUPING_COMPONENT  (TRUE|FALSE) "FALSE"
        DEFAULT_SELECTED (TRUE|FALSE) "FALSE"
        CHILD_OF CDATA #IMPLIED
        MANDATORY_SELECTED (TRUE|FALSE) "FALSE">
<!ELEMENT Display (#PCDATA)>
<!ATTLIST Display
        NLS_ID CDATA #IMPLIED>
<!ELEMENT RepositoryConfigFile (#PCDATA)>
<!ELEMENT DetectQuery (#PCDATA)>
<!ATTLIST DetectQuery
        OPERATION (CREATE|DROP) 'CREATE'
        TYPE (ORACLE|SQLSERVER|IBMDB2) 'ORACLE'>
<!ELEMENT SchemaVersion (#PCDATA)>
<!ELEMENT SchemaUser (#PCDATA)>
<!ATTLIST SchemaUser
        USER_EDITABLE (TRUE|FALSE) "TRUE"
        PREFIXABLE (TRUE|FALSE) "TRUE"
        IS_CREATED  (TRUE|FALSE) "TRUE"
        MAX_LENGTH CDATA "30">
<!ELEMENT AdditionalSchemaUser (#PCDATA)>
<!ATTLIST AdditionalSchemaUser
        STARTS_WITH_SCHEMA_USER (TRUE|FALSE) "TRUE" >
<!ELEMENT Dependents (Dependent*)>
<!ELEMENT Dependent (#PCDATA)>
<!ATTLIST Dependent
        COMPONENT_ID CDATA #REQUIRED
        ALT_COMPONENT_ID CDATA #IMPLIED>
<!ELEMENT DatabaseName (#PCDATA)>
<!ELEMENT Tablespaces (Tablespace*)>
<!ATTLIST Tablespace TYPE (DEFAULT_TABLESPACE|TEMPORARY_TABLESPACE|ADDITIONAL_TABLESPACE1|ADDITIONAL_TABLESPACE2|ADDITIONAL_TABLESPACE3|ADDITIONAL_TABLESPACE4|ADDITIONAL_TABLESPACE5|ADDITIONAL_TABLESPACE6|ADDITIONAL_TABLESPACE7|ADDITIONAL_TABLESPACE8|ADDITIONAL_TABLESPACE9|ADDITIONAL_TABLESPACE10|ADDITIONAL_TABLESPACE11|ADDITIONAL_TABLESPACE12|ADDITIONAL_TABLESPACE13|ADDITIONAL_TABLESPACE14|ADDITIONAL_TABLESPACE15|ADDITIONAL_TABLESPACE16|ADDITIONAL_TABLESPACE17|ADDITIONAL_TABLESPACE18|ADDITIONAL_TABLESPACE19|ADDITIONAL_TABLESPACE20|ADDITIONAL_TABLESPACE21|ADDITIONAL_TABLESPACE22|ADDITIONAL_TABLESPACE23|ADDITIONAL_TABLESPACE24|ADDITIONAL_TABLESPACE25|ADDITIONAL_TABLESPACE26|ADDITIONAL_TABLESPACE27|ADDITIONAL_TABLESPACE28|ADDITIONAL_TABLESPACE29|ADDITIONAL_TABLESPACE30|ADDITIONAL_TABLESPACE31) "DEFAULT_TABLESPACE">
<!ELEMENT Tablespace (Prompt, TablespaceName)>
<!ELEMENT Prompt (#PCDATA)>
<!ATTLIST Prompt NLS_ID CDATA #IMPLIED>
<!ELEMENT TablespaceName (#PCDATA)>
<!ELEMENT CustomVariables (Variable*)>
<!ATTLIST Variable
          TYPE (STRING|NUMBER|PASSWORD|EXISTING_PASSWORD|FILE) "STRING"
          MAX_LENGTH CDATA "30"
          MIN_LENGTH CDATA "0"
          OPERATION (CREATE|DROP|BOTH) "BOTH"
          DEFAULT_VALUE CDATA "">
<!ELEMENT Variable (Name,Display)>
<!ELEMENT Name (#PCDATA)>

3.2.1.2 Repository Configuration File

The Repository configuration file is called RepositoryConfig.dtd and is located in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory:

<?xml version="1.0" encoding="UTF-8" ?>
<!ENTITY % commonDTD SYSTEM "RCUCommon.dtd">
%commonDTD;
<!ELEMENT RepositoryConfig (PrerequisiteDescriptor*, ExecutionDescriptor, DeleteDescriptor?)>
<!ATTLIST RepositoryConfig
        COMP_ID CDATA #REQUIRED>
<!ELEMENT DeleteDescriptor (Action*)>

3.2.1.3 Master List of Supported Components

RCU maintains a master list of supported components, which contains entries for each supported component. Every time a new component is added, the master list of supported components is updated with the reference of the XML integration file provided by component owner.

This configuration file is called RCUCommon.dtd and is located in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory:

<?xml version="1.0" encoding="UTF-8" ?>
<!ELEMENT PrerequisiteDescriptor (DBPrerequisiteSet*, DBPrerequisite*)>
<!ATTLIST PrerequisiteDescriptor
        TYPE (CREATE|DROP|REGISTER|DEREGISTER) 'CREATE'>
<!ELEMENT DBPrerequisiteSet (ValidIfSet?, ValidIf?, PrereqSetErrorMsg?, DBPrerequisite*)>
<!ATTLIST DBPrerequisiteSet
          OPERATOR (OR|AND) "OR"
          SOFT (TRUE|FALSE) "FALSE">
<!ELEMENT DBPrerequisite (ValidIfSet?, ValidIf?, PrereqIdentifier, PrereqValue, PrereqErrorMsg?)>
<!ATTLIST DBPrerequisite
PREREQ_TYPE (InitParameter|DBOption|Java|DBComponent|DBVersion|DBObject|CustomSQL|TablespaceFreeMB) "CustomSQL"
        DATA_TYPE (STRING|NUMBER) "STRING"
        COMPARE_OPERATOR (EQ|GT|LT|NE|GE|LE|COMPARE_VERSION) "EQ"
        SOFT (TRUE|FALSE) "FALSE">
 
<!ELEMENT PrereqIdentifier (#PCDATA)>
<!ELEMENT PrereqValue (#PCDATA)>
<!ELEMENT PrereqSetErrorMsg (#PCDATA)>
<!ATTLIST PrereqSetErrorMsg
        NLS_ID CDATA #IMPLIED>
<!ELEMENT PrereqErrorMsg (#PCDATA)>
<!ATTLIST PrereqErrorMsg
        NLS_ID CDATA #IMPLIED>
<!ATTLIST PrereqValue
        UNIT (KB|MB|NoUnit) 'NoUnit'>
<!ELEMENT ExecutionDescriptor (Action*)>
<!ATTLIST ExecutionDescriptor
        TYPE (Load|PreLoad|PostLoad) "Load">
<!ELEMENT Action (ValidIfSet?, ValidIf?, Command, Parameters?, FatalErrors?, IgnorableErrors?)>
<!ATTLIST Action
        TYPE (JDBCSqlScript|JDBC|SQLPlus|HostCmd|Java) "JDBCSqlScript"
        DB_VERSION CDATA #IMPLIED
        PERCENT_PROGRESS CDATA #IMPLIED
        CONNECT_AS_OWNER (TRUE|FALSE) "FALSE"
        RESET_SESSION (TRUE|FALSE) "FALSE">
<!ELEMENT Command (#PCDATA)>
<!ATTLIST Command
        TYPE (SCRIPT|INLINE|METHOD) "SCRIPT">
<!ELEMENT Parameters (Parameter*)>
<!ELEMENT Parameter (#PCDATA)>
<!ATTLIST Parameter
        TYPE (BindVar|CmdLine|ProcessInput|EnvVar|Connection|int|String|StringArray|boolean) "CmdLine">
<!ELEMENT FatalErrors (Error*)>
<!ELEMENT IgnorableErrors (Error*)>
<!ELEMENT Error (#PCDATA)>
<!ATTLIST Error
        Type CDATA #REQUIRED>
<!ELEMENT ValidIfSet (ValidIf*)>
<!ATTLIST ValidIfSet
          DBTYPE CDATA #IMPLIED
          DBVERSION CDATA #IMPLIED
          OSNAME CDATA #IMPLIED
          OPERATOR (OR|AND) "OR">
<!ELEMENT ValidIf (CustomQueryFilter?)>
<!ATTLIST ValidIf
        DBTYPE CDATA #IMPLIED
        DBVERSION CDATA #IMPLIED
        OSNAME CDATA #IMPLIED >
<!ELEMENT CustomQueryFilter (#PCDATA)>
<!ATTLIST CustomQueryFilter
        DATA_TYPE (STRING|NUMBER) "STRING"
        COMPARE_OPERATOR (EQ|GT|LT|NE|GE|LE|COMPARE_VERSION) "EQ"
        VALUE CDATA #REQUIRED >

3.2.1.4 Storage Attributes Configuration File

RCU would maintain the list of tablespaces/datafiles and their attributes to be created. This way the tablespaces and datafiles attributes can be modified externally.

The Storage Attributes configuration file is called Storage.dtd and is located in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory:

<?xml version="1.0" encoding="UTF-8" ?>
<!ELEMENT StorageAttributes (TablespaceAttributes*)>
<!ELEMENT TablespaceAttributes (Type?,DefaultTemp?,BlockSize?,ExtentSize?,PageSize?,AutoResize?,IncreaseSize?,MaxSize?,Bigfile?,AutoSegmentSpaceManagement?, DatafilesList)>
<!ATTLIST TablespaceAttributes
        NAME CDATA #REQUIRED>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT DefaultTemp (#PCDATA)>
<!ELEMENT BlockSize (#PCDATA)>
<!ELEMENT ExtentSize (#PCDATA)>
<!ELEMENT PageSize (#PCDATA)>
<!ATTLIST PageSize
        UNIT (KB|NoUnit) 'KB'>
<!ELEMENT AutoResize (#PCDATA)>
<!ELEMENT IncreaseSize (#PCDATA)>
<!ATTLIST IncreaseSize
        UNIT (KB|MB|GB) 'MB'>
<!ELEMENT MaxSize (#PCDATA)>
<!ATTLIST MaxSize
        UNIT (KB|MB|GB) 'MB'>
<!ELEMENT Bigfile (#PCDATA)>
<!ELEMENT AutoSegmentSpaceManagement (#PCDATA)>
<!ELEMENT DatafilesList (DatafileAttributes+)>
<!ELEMENT DatafileAttributes (Size, Reuse?, AutoExtend?, Increment?, Maxsize?)>
<!ATTLIST DatafileAttributes
 ID CDATA #REQUIRED>
<!ELEMENT Size (#PCDATA)>
<!ATTLIST Size
        UNIT (KB|MB|GB) 'MB'>
<!ELEMENT Reuse (#PCDATA)>
<!ELEMENT AutoExtend (#PCDATA)>
<!ELEMENT Increment (#PCDATA)>
<!ATTLIST Increment
        UNIT (KB|MB|GB) 'KB'>
<!ELEMENT Maxsize (#PCDATA)>
<!ATTLIST Maxsize
        UNIT (KB|MB|GB) 'MB'>

3.2.2 Component Repository Configuration File

A Component Repository Configuration File (<component>.xml) lists the pre-requisites and the list of scripts or actions that need to be performed to load or drop a schema. This file is provided and maintained by component owners. This configuration file is referenced from Component List Configuration File (ComponentInfo.xml).

Each <component>.xml file can be found in the RCU_HOME/rcu/integrationcomponent/component.xml (on UNIX operating systems) or RCU_HOME\rcu\integrationcomponent\component.xml (on Windows operating systems) file.

Component owners can use a set of predefined RCU parameters which will be substituted at runtime by RCU based on user input. Here is the list of predefined parameters:

Table 3-1 Predefined RCU Parameters

RCU Parameter Description

%ORACLE_HOME%

Location of the Oracle Home directory.

In this book, the actual location is referred to as RCU_HOME; this is the location where RCU was extracted on your system.

%SCRIPT_HOME%

Location where scripts are located. It may be same as RCU_HOME.

%SCHEMA_USER%

Database schema name (owner) entered by the user in RCU.

%SCHEMA_PASSWORD%

Database schema password entered by the user in RCU.

%ADDITIONAL_SCHEMA_USER%

Additional schema users as defined in the ComponentInfo.xml file

%ADDITIONAL_SCHEMA_PASSWORD<n>%

Password for the additional schema users.

%DEFAULT_TABLESPACE%

Default tablespace assigned to the component by the user.

%TEMPORARY_TABLESPACE%

Temporary tablespace assigned to the component by the user.

%ADDITIONAL_TABLESPACE<n>%

Additional tablespace assigned to the component by the user. Up to three additional tablespaces are supported.

%DEFAULT_PERMANENT_TABLESPACE%

Default permanent tablespace in the database (for example, USERS or SYSTEM) is none is set.

%DEFAULT_TEMP_TABLESPACE%

Default temporary tablespace in the database (for example, TEMP in Oracle shipped databases or SYSTEM) if none is set.

%DATAFILE_LOCATION%

Default location where the tablespace/datafile will be created.

%JDBC_CONNECT_STRING%

JDBC connect string.

%PREFIX_NAME%

User-specified prefix for schema and tablespace names.

%CONNECTION%

Already-connected java.sql.Connection object to be passed into JavaAction.

%DBADMIN_USER%

Database admin user that is provided on the Database Connection Details Screen.

%DBADMIN_PASSWORD%

Database admin user password that is provided on the Database Connection Details Screen.

%DBADMIN_ROLE%

Database admin user role that is provided on the Database Connection Details Screen.

%DB_HOSTNAME%

Database hostname that is provided on the Database Connection Details Screen.

%DB_SERVICE%

Database service name.

%DB_PORTNUMBER%

Database port number that is provided on the Database Connection Details Screen.

%RCU_HOME%

Directory where RCU is installed.

%SQLPLUS_HOME%

RCU_HOME where SQL*Plus is located.

%RCU_LOG_LOCATION%

Location of the directory where RCU log files are created.

%DATABASE_NMAE%

Database name (for SQLServer database).


Below is a sample Component Repository Configuration file for MDS (mds.xml), which lists the series of prerequisites and actions:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- DOCTYPE RepositoryConfig SYSTEM "file:////home/mmehta/development/XML/latest/RepositoryConfig.dtd" -->
<!--
  DESCRIPTION
 
    MDS's RCU configuration file for creating MDS repository.
 
  MODIFIED (MM/DD/YY)
  erwang    07/13/10 - #(9831116) Added SYSDBA role check.
  ????????  ??/??/?? - Creation
 
-->
 
<!DOCTYPE RepositoryConfig SYSTEM "RepositoryConfig.dtd">
<RepositoryConfig COMP_ID="MDS">
   <PrerequisiteDescriptor>
         <DBPrerequisite PREREQ_TYPE="TablespaceFreeMB" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GT">
            <ValidIf DBTYPE="ORACLE" />
            <PrereqIdentifier>%DEFAULT_TABLESPACE%</PrereqIdentifier>
            <PrereqValue>50</PrereqValue>
         </DBPrerequisite>
         <DBPrerequisite PREREQ_TYPE="TablespaceFreeMB" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GT">
            <ValidIf DBTYPE="ORACLE" />
            <PrereqIdentifier>%TEMPORARY_TABLESPACE%</PrereqIdentifier>
            <PrereqValue>20</PrereqValue>
         </DBPrerequisite>
         <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" 
                         COMPARE_OPERATOR="EQ">
            <ValidIf DBTYPE="ORACLE"/>
            <PrereqIdentifier>select count(*) from SESSION_PRIVS where PRIVILEGE = 'SYSDBA' </PrereqIdentifier>
            <PrereqValue>1</PrereqValue>
            <PrereqErrorMsg>
------------------------------------------------------------------------------
Component     : MDS
Error         : Repository creation check failed.
Cause         : Must connect as SYSDBA to create MDS repository.
Action        : Connect to the database as SYSDBA.  For example, you can login
                to the database using the SYS account.
-------------------------------------------------------------------------------
            </PrereqErrorMsg>
          </DBPrerequisite>
         <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" 
                         COMPARE_OPERATOR="EQ">
            <ValidIf DBTYPE="SQLSERVER"/>
            <PrereqIdentifier>select is_read_committed_snapshot_on from
                              sys.databases where name='%DATABASE_NAME%'
            </PrereqIdentifier>
            <PrereqValue>1</PrereqValue>
            <PrereqErrorMsg>
------------------------------------------------------------------------------
Component     : MDS
Error         : Repository creation check failed.
Cause         : Database: '%DATABASE_NAME%' is not configured correctly.
Action        : Alter database to turn on the READ_COMMITTED_SNAPSHOT option.
                Ensure you have DBA priviliges. Also the DBA should not have
                multiple logins on this database - else it will result in a
                lock error.
Command       : ALTER database %DATABASE_NAME% SET READ_COMMITTED_SNAPSHOT ON
-------------------------------------------------------------------------------
            </PrereqErrorMsg>
          </DBPrerequisite>
          <DBPrerequisite PREREQ_TYPE="CustomSQL" 
 DATA_TYPE="NUMBER" 
                          COMPARE_OPERATOR="GE">
            <ValidIf DBTYPE="SQLSERVER"/>
            <PrereqIdentifier>select count(*) from sys.databases
            where name='%DATABASE_NAME%' AND
            patindex('%%[_]CS[_]%%', collation_name) > 0
            </PrereqIdentifier>
            <PrereqValue>1</PrereqValue>
            <PrereqErrorMsg>
-------------------------------------------------------------------------------
Component     : MDS
Error         : Repository creation check failed.
Cause         : Database: '%DATABASE_NAME%' is not configured correctly.
Action        : Alter database to apply the correct collate to the database.
                Ensure you have DBA priviliges. Also, the DBA should not have
                multiple logins on this database - else it will result in a
                lock error.
Command       : DECLARE @collate   sysname
                SELECT @collate = convert(sysname, serverproperty('COLLATION'))
                IF ( charindex(N'_CI', @collate) > 0 )
                BEGIN
                  select @collate = replace(@collate, N'_CI', N'_CS')
                  exec ('ALTER database $(DATABASE_NAME) COLLATE ' + @collate)
                END
                GO
-------------------------------------------------------------------------------
             </PrereqErrorMsg>
           </DBPrerequisite>
 
   </PrerequisiteDescriptor>
 
   <PrerequisiteDescriptor TYPE="DROP">
       <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ">
 
           <ValidIf DBTYPE="ORACLE" />
               <PrereqIdentifier>select count(*) from v$session where
                  username='%SCHEMA_USER%'</PrereqIdentifier>
           <PrereqValue>0</PrereqValue>
           <PrereqErrorMsg>The schema owner '%SCHEMA_USER%' is connected to the
                database. Please disconnect and try again.</PrereqErrorMsg>
       </DBPrerequisite>
   </PrerequisiteDescriptor>
 
   <ExecutionDescriptor>
     <Action TYPE="Java">
         <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilCreateRegistryEntry</Command>
         <Parameters>
            <Parameter TYPE="Connection"></Parameter>
            <Parameter TYPE="String">MDS</Parameter>
            <Parameter TYPE="String">Metadata Services</Parameter>
            <Parameter TYPE="String">%PREFIX_NAME%</Parameter>
            <Parameter TYPE="String">MDS</Parameter>
            <Parameter TYPE="String">MDS</Parameter>
            <Parameter TYPE="String">%SCHEMA_USER%</Parameter>
            <Parameter TYPE="String">11.1.1.4.0</Parameter>
            <Parameter TYPE="String">LOADING</Parameter>
         </Parameters>
      </Action>
 <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="ORACLE" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/sql/mds_user.sql</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
            <Parameter TYPE="CmdLine">%SCHEMA_PASSWORD%</Parameter>
            <Parameter TYPE="CmdLine">%DEFAULT_TABLESPACE%</Parameter>
            <Parameter TYPE="CmdLine">%TEMPORARY_TABLESPACE%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="SQLSERVER" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/MSSQL/cremduser-rcu.sql</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%DATABASE_NAME%</Parameter>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
            <Parameter TYPE="CmdLine">%SCHEMA_PASSWORD%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="IBMDB2" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/db2/cremduser-rcu.db2</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
            <Parameter TYPE="CmdLine">%DEFAULT_TABLESPACE%</Parameter>
            <Parameter TYPE="CmdLine">%TEMPORARY_TABLESPACE%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="ORACLE" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/sql/cremds-rcu.sql</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20" CONNECT_AS_OWNER="TRUE">
         <ValidIf DBTYPE="SQLSERVER" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/MSSQL/cremds-rcu.sql</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%DATABASE_NAME%</Parameter>
            <Parameter TYPE="CmdLine">%RCU_VARCHAR%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20" CONNECT_AS_OWNER="TRUE">
         <ValidIf DBTYPE="IBMDB2" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/db2/cremds-rcu.db2</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%DEFAULT_TABLESPACE%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="Java">
         <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilSetComponentValid</Command>
         <Parameters>
            <Parameter TYPE="String">MDS</Parameter>
         </Parameters>
      </Action>
   </ExecutionDescriptor>
 <DeleteDescriptor>
      <Action TYPE="JDBC" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="ORACLE" />
         <Command TYPE="INLINE">DROP USER %SCHEMA_USER% CASCADE</Command>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="SQLSERVER" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/MSSQL/dropmduser-rcu.sql</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%DATABASE_NAME%</Parameter>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="JDBCSqlScript" PERCENT_PROGRESS="20">
         <ValidIf DBTYPE="IBMDB2" />
         <Command TYPE="SCRIPT">%SCRIPT_HOME%/mds/db2/dropmds-rcu.db2</Command>
         <Parameters>
            <Parameter TYPE="CmdLine">%SCHEMA_USER%</Parameter>
         </Parameters>
      </Action>
      <Action TYPE="Java">
          <ValidIf DBTYPE="IBMDB2" />
          <Command TYPE="METHOD">oracle.sysman.assistants.common.dbutil.jdbc.DB2DropUtil:dropCompRepos</Command>
          <Parameters>
             <Parameter TYPE="Connection"></Parameter>
             <Parameter TYPE="String">%SCHEMA_USER%</Parameter>
          </Parameters>
      </Action>
      <Action TYPE="Java">
         <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilDropRegistryEntry</Command>
         <Parameters>
            <Parameter TYPE="Connection"></Parameter>
            <Parameter TYPE="String">MDS</Parameter>
            <Parameter TYPE="String">%PREFIX_NAME%</Parameter>
            <Parameter TYPE="String">MDS</Parameter>
         </Parameters>
      </Action>
   </DeleteDescriptor>
</RepositoryConfig>

3.2.3 Component List Configuration File

The Component List configuration file (ComponentInfo.xml) lists all the components, their respective configuration files and their default user and tablespace mappings. This file also lists the high-level pre-requisite checks and high level actions (like creating schema_version_registry table) to be done globally for all the components. Also, a list of global Ignorable or Fatal errors can be specified.

This file can be found in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory.

Below is a sample ComponentInfo.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- DOCTYPE ComponentInfo SYSTEM "dtds/ComponentInfo.dtd" -->
<!DOCTYPE ComponentInfo SYSTEM "ComponentInfo.dtd" [
<!ENTITY mds SYSTEM "../integration/mds/mds_ComponentInfo.xml">
<!ENTITY oid SYSTEM "../integration/oid/oid_ComponentInfo.xml">
<!ENTITY soainfra SYSTEM "../integration/soainfra/soainfra_ComponentInfo.xml">
<!ENTITY bam SYSTEM "../integration/bam/bam_ComponentInfo.xml">
<!ENTITY WebCenterSuite SYSTEM "../integration/webcenter/WebCenterSuite_ComponentInfo.xml">
<!ENTITY iau SYSTEM "../integration/iau/iau_ComponentInfo.xml">
<!ENTITY discoverer SYSTEM "../integration/dc/discoverer_ComponentInfo.xml">
<!ENTITY sdpm SYSTEM "../integration/sdpm/sdpm_ComponentInfo.xml">
<!ENTITY portal SYSTEM "../integration/portal/portal_ComponentInfo.xml">
<!ENTITY oif SYSTEM "../integration/oif/oif_ComponentInfo.xml">
<!ENTITY oim SYSTEM "../integration/oim/oim_ComponentInfo.xml">
<!ENTITY oam SYSTEM "../integration/oam/oam_ComponentInfo.xml">
<!ENTITY oaam SYSTEM "../integration/oaam/oaam_ComponentInfo.xml">
<!ENTITY oaam_with_partition SYSTEM "../integration/oaam/oaam_with_partition_ComponentInfo.xml">
<!ENTITY oaam_with_mssql_unicode SYSTEM "../integration/oaam/oaam_with_mssql_unicode_ComponentInfo.xml">
<!ENTITY irm SYSTEM "../integration/irm/irm_ComponentInfo.xml">
<!ENTITY ess SYSTEM "../integration/ess/ess_ComponentInfo.xml">
<!ENTITY odi SYSTEM "../integration/odi/odi_ComponentInfo.xml">
<!ENTITY biplatform SYSTEM "../integration/biplatform/biplatform_ComponentInfo.xml">
<!ENTITY contentserver11 SYSTEM "../integration/contentserver11/contentserver11_ComponentInfo.xml">
<!ENTITY contentserver11search SYSTEM "../integration/contentserver11search/contentserver11search_ComponentInfo.xml">
<!ENTITY urm SYSTEM "../integration/urm/urm_ComponentInfo.xml">
<!ENTITY ipm SYSTEM "../integration/ipm/ipm_ComponentInfo.xml">
<!ENTITY commspresence SYSTEM "../integration/commspresence/commspresence_ComponentInfo.xml">
<!ENTITY commssds SYSTEM "../integration/commssds/commssds_ComponentInfo.xml">
<!ENTITY commsls SYSTEM "../integration/commsls/commsls_ComponentInfo.xml">
<!ENTITY epm SYSTEM "../integration/epm/epm_ComponentInfo.xml">
<!ENTITY apm SYSTEM "../integration/apm/apm_ComponentInfo.xml">
<!ENTITY opss SYSTEM "../integration/opss/opss_ComponentInfo.xml">
]>
<ComponentInfo VERSION="11.0.0.0" TYPE="AS_REPOSITORY" RESOURCE_BUNDLE_PACKAGE="oracle.sysman.rcu.as.ASBundle">
  <Display NLS_ID="ASREP_ID">Oracle AS Repository Components</Display>
  <PrefixSettings USE_SCHEMA_PREFIX="TRUE" USE_TABLESPACE_PREFIX="TRUE">
     <DetectQuery>
        Select distinct mrc_name from schema_version_registry
     </DetectQuery>
     <DetectQuery TYPE="IBMDB2">
        Select distinct mrc_name from NULLID.schema_version_registry
     </DetectQuery>
  </PrefixSettings>
 
  <!-- AS Common GROUP START -->
<Component ID="AS_COMMON" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="AS_COMMON_ID">AS Common Schemas</Display>
    </Component>
&mds;
&iau;
&ess;
&opss;
<!-- AS Common GROUP END -->

<!-- OID GROUP START -->
<Component ID="IDM" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="IDM_ID">Identity Management</Display>
    </Component>
&oid;
&oif;
&oim;
&oam;
&oaam;
&oaam_with_partition;
&oaam_with_mssql_unicode;
&apm;
 
<!-- OID GROUP START -->
 
<!-- ECM_SUITE START -->
<Component ID="ECM_SUITE" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="ECM_SUITE">Enterprise Content Management</Display>
    </Component>
&irm;
&contentserver11;
&contentserver11search;
&urm;
&ipm;
<!-- ECM_SUITE END -->
 
<!-- ODI_SUITE START -->
<Component ID="ODI_REPOSITORIES" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="ODI_REPOSITORIES">Oracle Data Integrator</Display>
    </Component>
&odi;
<!-- ODI_SUITE END -->
 
 
<!-- BI_SUITE START -->
<Component ID="BUSINESS INTELLIGENCE" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="BUSINESS INTELLIGENCE">Oracle Business Intelligence</Display>
    </Component>
&biplatform;
<!-- BI_SUITE END -->
 
<!-- OWLCS START -->
   <Component ID="OWLCS" IS_GROUPING_COMPONENT="TRUE">
       <ValidIf DBTYPE="ORACLE" />
       <Display NLS_ID="OWLCS_ID">WebLogic Communication Services</Display>
   </Component>
&commspresence;
&commssds;
&commsls;
<!-- OWLCS END -->
 
<!-- SOA INFRA GROUP START -->
        <Component ID="SOA" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="SOA_ID">SOA and BPM Infrastructure</Display>
    </Component>
&soainfra;
&bam;
&sdpm;
<!-- SOA INFRA GROUP END -->

<!-- WEBCENTER_SUITE START -->
        <Component ID="WEBCENTER_SUITE" IS_GROUPING_COMPONENT="TRUE">
      <Display NLS_ID="WEBCENTER_SUITE_ID">Webcenter Suite</Display>
    </Component>
&WebCenterSuite;
<!-- WEBCENTER_SUITE END -->
 
 
 
<!-- PORTAL_BI START -->
        <Component ID="PORTAL_BI" IS_GROUPING_COMPONENT="TRUE">
        <ValidIf DBTYPE="ORACLE" />
      <Display NLS_ID="PORTAL_BI_ID">Portal and BI</Display>
    </Component>
 
&portal;
&discoverer;
 
&epm;
<!-- AS Common GROUP END -->
 
 
 
<!-- PORTAL_BI END -->

 <PrerequisiteDescriptor>
      <DBPrerequisiteSet OPERATOR="OR">
      <ValidIf DBTYPE="ORACLE" />
       <DBPrerequisite PREREQ_TYPE="InitParameter" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GE">
            <PrereqIdentifier>SHARED_POOL_SIZE</PrereqIdentifier>
            <PrereqValue UNIT="KB">147456</PrereqValue>
         </DBPrerequisite>
         <DBPrerequisite PREREQ_TYPE="InitParameter" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GE">
            <PrereqIdentifier>SGA_MAX_SIZE</PrereqIdentifier>
            <PrereqValue UNIT="KB">147456</PrereqValue>
        </DBPrerequisite>
      </DBPrerequisiteSet>
 
      <DBPrerequisite PREREQ_TYPE="InitParameter" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GE">
            <ValidIf DBTYPE="ORACLE" />
            <PrereqIdentifier>DB_BLOCK_SIZE</PrereqIdentifier>
            <PrereqValue UNIT="KB">8</PrereqValue>
      </DBPrerequisite>
 <DBPrerequisite PREREQ_TYPE="DBVersion" DATA_TYPE="STRING" COMPARE_OPERATOR="GE">
        <ValidIf  DBTYPE="ORACLE" >
        <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
            select 1 from dual where exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') union select 0 from dual where not exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION')
          </CustomQueryFilter>
        </ValidIf>
        <PrereqIdentifier>version</PrereqIdentifier>
        <PrereqValue>10.2.0.4.0</PrereqValue>
                <PrereqErrorMsg>
                                The database you are connecting is not a supported version.  Enter Database with version equal to or higher than 10.2.0.4.0 in 10g or version equal to or higher than 11.1.0.7.0 in 11g. Refer to the certification matrix for supported DB versions
                  </PrereqErrorMsg>
        </DBPrerequisite>

<DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ">
        <ValidIf  DBTYPE="ORACLE" >
        <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
            select 1 from dual where exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') union select 0 from dual where not exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION')
          </CustomQueryFilter>
        </ValidIf>
        <PrereqIdentifier>select count(*) from product_component_version  where product like 'Oracle%Database%'  AND version BETWEEN '11' AND '11.1.0.6.0' </PrereqIdentifier>
        <PrereqValue>0</PrereqValue>
                <PrereqErrorMsg>
                                The database you are connecting is not a supported version.  Enter Database with version equal to or higher than 10.2.0.4.0 in 10g or version equal to or higher than 11.1.0.7.0 in 11g. Refer to the certification matrix for supported DB versions
                  </PrereqErrorMsg>
        </DBPrerequisite>
 
 
<DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ">
            <ValidIf DBTYPE="IBMDB2"/>
            <PrereqIdentifier>select count(*) from syscat.tablespaces where tbspace = 'SYSCATSPACE' and pagesize >= 32768
            </PrereqIdentifier>
            <PrereqValue>1</PrereqValue>
            <PrereqErrorMsg>
                        Component     : RCU
                        Error         : Database prerequisite check failed.
                        Cause         : Database: '%DATABASE_NAME%' needs to be configured with
                        default pagesize 32768 or 32K.
                        Action        : Modify the default of the current database or create a new
                        database with the required default pagesize.
           </PrereqErrorMsg>
    </DBPrerequisite>
 
 
<DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ">
                <ValidIf DBTYPE="SQLSERVER" />
                 <PrereqIdentifier>SELECT count(*) where CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) like '1.%' or CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) like '4.%' or CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) like '6.%' or CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) like '7.%' or CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) like '8.%'</PrereqIdentifier>
                <PrereqValue>0</PrereqValue>
                  <PrereqErrorMsg>
                  The database you are connecting is not a supported version. Enter Database with version equal to or higher than 2005. Refer to the certification matrix for supported DB versions.
                  </PrereqErrorMsg>
</DBPrerequisite>

 <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ">
                <ValidIf DBTYPE="IBMDB2" />
                  <PrereqIdentifier>select count(*) FROM TABLE (sysproc.env_get_inst_info()) where INT(substr(service_level, POSSTR(service_level, 'v')+1, LOCATE('.', service_level,POSSTR(service_level, 'v') +1) - POSSTR(service_level,  'v') -1 ) ) = 9  AND INT(substr(service_level, POSSTR(service_level,  '.')+1, LOCATE('.',service_level,POSSTR(service_level, '.') +1) - POSSTR(service_level, '.') -1 )) &lt; 7 OR INT(substr(service_level, POSSTR(service_level, 'v')+1, LOCATE('.', service_level,POSSTR(service_level, 'v') +1) - POSSTR(service_level, 'v') -1 ) ) &lt; 9</PrereqIdentifier>
                  <PrereqValue>0</PrereqValue>
                  <PrereqErrorMsg>
                          The database you are connecting is not a supported version. Enter Database with version equal to or higher than 9.7. Refer to the certification matrix for supported DB versions.
                </PrereqErrorMsg>
</DBPrerequisite>
 
 
        <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ">
                <ValidIf DBTYPE="ORACLE" />
                  <PrereqIdentifier>select GRANTED_ROLE from DBA_ROLE_PRIVS where((GRANTED_ROLE='DBA' and GRANTEE=(select user from dual) and lower(SYS_CONTEXT ('USERENV', 'SESSION_USER'))='sys') OR(GRANTED_ROLE='DBA' and GRANTEE=(select user from dual)))</PrereqIdentifier>
                  <PrereqValue>DBA</PrereqValue>
                  <PrereqErrorMsg>
                        User should have sysdba or dba privilages.
                  </PrereqErrorMsg>
                </DBPrerequisite>
 
<DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ">
                <ValidIf DBTYPE="SQLSERVER" />
                  <PrereqIdentifier>select Is_Member('db_owner')</PrereqIdentifier>
                  <PrereqValue>1</PrereqValue>
                  <PrereqErrorMsg>
                        User should have sysdba or dba privilages.
                 </PrereqErrorMsg>
    </DBPrerequisite>
 
       <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ" SOFT="TRUE">
                  <ValidIf DBTYPE="ORACLE" />
                  <PrereqIdentifier>select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET'</PrereqIdentifier>
                  <PrereqValue>AL32UTF8</PrereqValue>
                  <PrereqErrorMsg>
                                The database you are connecting is with non-AL32UTF8 character set. Oracle strongly recommends using AL32UTF8 as the database character set.
                  </PrereqErrorMsg>
                </DBPrerequisite>

 <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" SOFT="TRUE">
        <ValidIf  DBTYPE="ORACLE" >
        <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
            select 1 from dual where exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') union select 0 from dual where not exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION')
          </CustomQueryFilter>
        </ValidIf>
        <PrereqIdentifier>select count(*) from product_component_version  where product like 'Oracle%Database%'  AND version BETWEEN '10.2.0.6.0' AND '10.9.9.9.9' </PrereqIdentifier>
        <PrereqValue>0</PrereqValue>
                <PrereqErrorMsg>
                The database you are connecting to, is a more recent than the supported version. Refer to the certification matrix for supported DB versions.
                  </PrereqErrorMsg>
        </DBPrerequisite>
 
 
        <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" SOFT="TRUE">
        <ValidIf  DBTYPE="ORACLE" >
        <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
            select 1 from dual where exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') union select 0 from dual where not exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION')
          </CustomQueryFilter>
        </ValidIf>
        <PrereqIdentifier>select count(*) from product_component_version  where product like 'Oracle%Database%'  AND version > '11.1.0.7.0' AND version not like '11.2._._._'</PrereqIdentifier>
        <PrereqValue>0</PrereqValue>
                <PrereqErrorMsg>
            The database you are connecting to, is a more recent one than the supported version. Refer to the certification matrix for supported DB versions.
               </PrereqErrorMsg>
        </DBPrerequisite>
 
        <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" SOFT="TRUE">
        <ValidIf  DBTYPE="ORACLE" >
        </ValidIf>
        <PrereqIdentifier>select 1 from dual where exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') union select 0 from dual where not exists (select column_name from dba_tab_columns where table_name(+) like 'V_$INSTANCE' and column_name(+) = 'EDITION') </PrereqIdentifier>
        <PrereqValue>0</PrereqValue>
                <PrereqErrorMsg>
                                The database you are connecting is not a supported version. Enter Database with version equal to or higher than 10.2.0.4.0 in 10g or version equal to or higher than 11.1.0.7.0 in 11g. Refer to the certification matrixfor supported DB versions
                                </PrereqErrorMsg>
        </DBPrerequisite>

 <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ" SOFT="TRUE">
                <ValidIf DBTYPE="SQLSERVER" />
                  <PrereqIdentifier>SELECT count(*) where CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '1.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '4.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '6.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '7.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '8.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '9.%' and CAST(SERVERPROPERTY('productversion') as VARCHAR(20)) not like '10.%' </PrereqIdentifier>
                  <PrereqValue>0</PrereqValue>
                  <PrereqErrorMsg>
                   The database you are connecting to, is a more recent than the  supported version.  Refer to the certification matrix for supported DB versions.
                  </PrereqErrorMsg>
       </DBPrerequisite>
 
       <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ" SOFT="TRUE">
                <ValidIf DBTYPE="IBMDB2" />
                  <PrereqIdentifier>select count(*) FROM TABLE (sysproc.env_get_inst_info()) where INT(substr(service_level, POSSTR(service_level, 'v')+1, LOCATE('.', service_level, POSSTR(service_level, 'v') +1) - POSSTR(service_level, 'v') -1 ) ) = 9 and INT(substr(service_level, POSSTR(service_level, '.')+1, LOCATE('.', service_level, POSSTR(service_level, '.') +1) - POSSTR(service_level, '.') -1 )) &gt; 7 or INT(substr(service_level, POSSTR(service_level, 'v')+1, LOCATE('.', service_level, POSSTR(service_level, 'v') +1) - POSSTR(service_level, 'v') -1 ) ) &gt; 9</PrereqIdentifier>
                  <PrereqValue>0</PrereqValue>
                  <PrereqErrorMsg>
                          The database you are connecting to, is a more recent than the supported version. Refer to the certification matrix for supported DB versions.
                </PrereqErrorMsg>
        </DBPrerequisite>
 
   </PrerequisiteDescriptor>

 <ExecutionDescriptor TYPE="PreLoad">
         <Action TYPE="Java" PERCENT_PROGRESS="60">
         <ValidIf DBTYPE="ORACLE">
             <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="1">
               select count(*) from  dba_views where VIEW_NAME = 'APP_REGISTRY' and not exists (select view_name from  dba_views where VIEW_NAME= 'SCHEMA_VERSION_REGISTRY')
             </CustomQueryFilter>
         </ValidIf>
         <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilCreateRegistryAndCopyData</Command>
         <Parameters>
            <Parameter TYPE="Connection"></Parameter>
         </Parameters>
     </Action>
         <Action TYPE="Java" PERCENT_PROGRESS="60">
         <ValidIf DBTYPE="ORACLE">
             <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
             select count(*) from  dba_views where VIEW_NAME= 'SCHEMA_VERSION_REGISTRY'
             </CustomQueryFilter>
         </ValidIf>
         <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilCreateRegistryTable</Command>
         <Parameters>
            <Parameter TYPE="Connection"></Parameter>
         </Parameters>
     </Action>
         <Action TYPE="Java" PERCENT_PROGRESS="60">
        <ValidIf DBTYPE="SQLSERVER">
            <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
            select count(*) from  INFORMATION_SCHEMA.TABLES where TABLE_NAME='SCHEMA_VERSION_REGISTRY'
            </CustomQueryFilter>
        </ValidIf>
        <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilCreateRegistryTable</Command>
        <Parameters>
           <Parameter TYPE="Connection"></Parameter>
        </Parameters>
    </Action>
        <Action TYPE="Java" PERCENT_PROGRESS="60">
                <ValidIf DBTYPE="IBMDB2">
                        <CustomQueryFilter DATA_TYPE="NUMBER" COMPARE_OPERATOR="EQ" VALUE="0">
                         select count(*) from syscat.tables where TABNAME='SCHEMA_VERSION_REGISTRY'
                        </CustomQueryFilter>
                </ValidIf>
                <Command TYPE="METHOD">oracle.ias.version.SchemaVersionUtil:utilCreateRegistryTable</Command>
      <Parameters>
         <Parameter TYPE="Connection"></Parameter>
      </Parameters>
    </Action>
   </ExecutionDescriptor>

 <FatalErrors>
     <Error Type="ORA-17439">Invalid SQL type</Error>
         <Error Type="ORA-01435">user does not exist</Error>
         <Error Type="ORA-01435">user does not exist</Error>
     <Error Type="ORA-00955">name is already used by an existing object</Error>
         <Error Type="ORA-01031">name is already used by an existing object</Error>
   </FatalErrors>
 
   <IgnorableErrors>
     <Error Type="ORA-02289">sequence does not exist</Error>
     <Error Type="ORA-00904">invalid identifier</Error>
     <Error Type="ORA-01920">user name conflicts with another user or role name</Error>
     <Error Type="ORA-01418">specified index does not exist</Error>
     <Error Type="ORA-00942">table or view does not exist</Error>
     <Error Type="ORA-06512">Not found</Error>
     <Error Type="ORA-01403">no data found</Error>
         <Error Type="ORA-04043">does not exist</Error>
         <Error Type="ORA-04080">Trigger does not exist</Error>
         <Error Type="ORA-00959">Tablespace  does not exist</Error>
         <Error Type="ORA-24035">AQ agent not subscriber</Error>
         <Error Type="ORA-24185">Transformation not found</Error>
         <Error Type="ORA-24042">Does not exist</Error>
         <Error Type="ORA-24088">Does not exist</Error>
   </IgnorableErrors>
</ComponentInfo>

3.2.4 Soft-Prerequisite Support

In the ComponentInfo.xml file, If a particular <DBPrerequisiteSet> or <DBPrerequisite> is not mandatory, then you can use the soft-prerequisite option by setting the SOFT attribute to TRUE. When a soft-prerequisite is not met, a pop-up dialog window with an error or warning message will appear; the user will have the option to ignore the message or abort the operation. You can define a soft-prerequisite at the <DBPrerequisiteSet> level, the <DBPrerequisite> level, or both; if both are defined, then <DBPrerequisiteSet> will take higher precedence.

Below is an example of setting a soft-prerequisite at the <DBPrerequisite> level:

<DBPrerequisiteSet>
...
   <DBPrerequisite PREREQ_TYPE="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="EQ" SOFT="TRUE">
      <PrereqIdentifier>select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET'</PrereqIdentifier>
      <PrereqValue>AL32UTF8</PrereqValue>
      <PrereqErrorMsg>
      The database you are connecting is with non-AL32UTF8 character set.
      Oracle strongly recommends using AL32UTF8 as the database character
      set.
      </PrereqErrorMsg>
   </DBPrerequisite>
...
<DBPrerequisiteSet>

3.2.5 Default Tablespaces Configuration File

The default tablespaces configuration file (Storage.xml) lists the components for which tablespaces are created out-of-the-box. This file is located in the RCU_HOME/rcu/config (on UNIX operating systems) or RCU_HOME\rcu\config (on Windows operating systems) directory.

The actual tablespace configuration file for each component is located in the RCU_HOME/rcu/integrationcomponent/component_Storage.xml (on UNIX operating systems) or RCU_HOME\rcu\integrationcomponent\component_Storage.xml (on Windows operating systems) file. Each component has its own tablespaces configuration file.

Below is a sample soainfra_Storage.xml file:

<?xml version="1.0" encoding="UTF-8"?>
          <!-- SOAINFRA -->
      <TablespaceAttributes NAME="SOAINFRA" >
      <DatafilesList>
        <DatafileAttributes ID="%DATAFILE_LOCATION%/soainfra.dbf">
          <Size UNIT="MB">
            200
          </Size>
          <Reuse>
            True
          </Reuse>
          <AutoExtend>
            True
          </AutoExtend>
          <Increment UNIT="MB">
            50
          </Increment>
          <Maxsize UNIT="GB">
            2
          </Maxsize>
        </DatafileAttributes>
      </DatafilesList>
    </TablespaceAttributes>
 
   <!-- End 0f SOAINFRA -->

3.3 RCU Script Writing Guidelines

Below are some common RCU script writing guidelines:

Schema user names and passwords should not be hard coded. They should be coded as substitutable variables.

  • If schema user needs to be created, it should be created first using the parameters passed in by RCU.

  • Tablespace and temporary tablespace references should not be hard coded; they should be coded as variables.

  • Do not use CONNECT; instead, use “ALTER SESSION SET CURRENT_SCHEMA = <SCHEMA_OWNER>” after creating the schema user.

  • The set of ignorable and fatal ORA errors (if any) should be listed in the RCU XML component configuration file.

  • Avoid any “shutdown” or “startup” that would bounce the database instance.

  • SCHEMA_VERSION_REGISTRY should be updated before and after loading schema. This can be done using JavaAction as shown in Section 3.1.5, "Java Code Using JavaAction" or with in the component scripts using SCHEMA_VERSION PL/SQL package.

  • Block comments that contain line comments (/* -- comment */) are not supported.

3.3.1 Guidelines for RCU JDBC Engine Compliant SQL*Plus Scripts

Below are some guidelines for writing RCU JDBC Engine SQL*Plus scripts:

  • All statements must be terminated with appropriate terminating chars. CREATE PACKAGE, TYPE needs to be terminated with “;” with “/” on the next line. All other statements (Create TABLE, VIEW, etc.) need to be terminated by “;” or “/” (only one of them, not both).

  • EXECUTE calls should be replaced with “BEGIN/END blocks”.

  • DEFINE statements should be in one line, no comments in the same line and no “;” at the end.

  • SET, SHOW, SPOOL, WHENEVER, BREAK, EXIT statements are simply ignored.

  • HOST command is not supported yet.

  • VARIABLE and COL(UMN) are not supported.

    Dynamically calling another SQL Script within a PL/SQL block using the following technique is not supported:

    VARIABLE initfile VARCHAR2(32)
    COLUMN :initfile NEW_VALUE init_file NOPRINT;
    BEGIN
      IF (some condition) THEN
         :initfile := 'initcdc.sql';
      ELSE  
         :initfile := 'nothing.sql';
      END IF;
    END;
    /
    SELECT :initfile FROM DUAL;
    @@&init_file
    

    The work around is to have a separate Action with “ValidIf” tag to specify the condition.

3.3.2 Guidelines for Pure JDBC Scripts

Below are some guidelines for writing Pure JDBC scripts for RCU:

  • Should not contain any SQL*Plus directives (like SET, WHENEVER, etc.).

  • All DEFINES should be changed to PL/SQL variable declarations.

  • All SQL statements should be wrapped in EXECUTE IMMEDIATE.

  • PL/SQL style comments are allowed, But SQL*Plus style (REM) comments are not allowed.

  • DROP statements preceding CREATE statements do not work. DROP should only be done after checking for the existence of the object. Ideally, all DROP statements should put into different PL/SQL script and RCU can call this script before calling a CREATE script, if that is desired.

  • Contents of the script file should be a valid PL/SQL block, which can be called within Connection.prepareCall().

3.3.3 Guidelines for SQL*Plus Scripts

Below are some guidelines for writing SQL*Plus scripts for RCU:

  • Should not have any “exit” statements or “WHENEVER ERROR EXIT” directives. This would cause RCU SQL*Plus session to exit unexpectedly and may impact other component scripts to be executed later.

  • Scripts should not have any spool commands. RCU would generate a spool log for each component.

3.3.4 Guidelines for SQL Server-Based Scripts

Below are some guidelines for writing SQL Server-based scripts for RCU:

  • Support is a subset of what is supported in t-sql scripts that can be executed by sqlcmd.

  • “ValidIf” tags should be added around all database-specific Actions and Prerequisites. For example:

    <DBPrerequisite PREREQ_TYPE="TablespaceFreeMB" DATA_TYPE="NUMBER" COMPARE_OPERATOR="GT">
       <ValidIf DBTYPE="ORACLE" />
       <PrereqIdentifier>%DEFAULT_TABLESPACE%</PrereqIdentifier>
       <PrereqValue>50</PrereqValue>
    </DBPrerequisite>
    
  • RCU supports recursive variable definitions such as:

    setvar var1 value1
    setvar var2 $(var1)
    
  • There should be a “go” statement to end blocks of statements. All statements preceding the “go” statement will be executed as a single statement over JDBC.

  • The JDBC connection is created in the auto-commit “on” mode.

  • Currently, begin transaction and commit transaction statements are not supported.

  • Variables passed to scripts via the XML file will be passed as follows:

    Script.sql –v v1=value1 v2=value2
    

    This is only for scripts called using the XML files. If a script calls another script, you can use any other variable name.