Oracle® Fusion Middleware Repository Creation Utility User's Guide 11g Release 1 (11.1.1) Part Number E14259-01 |
|
|
View PDF |
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:
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.
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, it is recommended that the RCU JDBCEngine tool is also used in your development environment to ensure that these scripts run properly when integrated with RCU.
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>
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>
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>
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>
RCU provides the following configuration files types for component integration:
This section describes the XML DTDs defined by RCU:
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) or RCU_HOME
\rcu\config
(on Windows) 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?)> <!ATTLIST Component ID CDATA #REQUIRED PROGRESS_UNITS CDATA #IMPLIED IS_GROUPING_COMPONENT (TRUE|FALSE) "FALSE" DEFAULT_SELECTED (TRUE|FALSE) "FALSE" CHILD_OF CDATA #IMPLIED > <!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"> <!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) "DEFAULT_TABLESPACE"> <!ELEMENT Tablespace (Prompt, TablespaceName)> <!ELEMENT Prompt (#PCDATA)> <!ATTLIST Prompt NLS_ID CDATA #IMPLIED> <!ELEMENT TablespaceName (#PCDATA)>
The Repository configuration file is called RepositoryConfig.dtd
and is located in the RCU_HOME
/rcu/config
(on UNIX) or RCU_HOME
\rcu\config
(on Windows) 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*)>
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) or RCU_HOME
\rcu\config
(on Windows) 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 >
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) or RCU_HOME
\rcu\config
(on Windows) directory:
<?xml version="1.0" encoding="UTF-8" ?> <!ELEMENT StorageAttributes (TablespaceAttributes*)> <!ELEMENT TablespaceAttributes (Type?,DefaultTemp?, BlockSize?, Bigfile?, AutoSegmentSpaceManagement?, DatafilesList)> <!ATTLIST TablespaceAttributes NAME CDATA #REQUIRED> <!ELEMENT Type (#PCDATA)> <!ELEMENT DefaultTemp (#PCDATA)> <!ELEMENT BlockSize (#PCDATA)> <!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'>
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/integration
component
/
component
.xml
(on UNIX) or RCU_HOME
\rcu\integration
component
\
component
.xml
(on Windows) 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 |
---|---|
|
Location of the Oracle Home directory. |
|
Location where scripts are located. It may be same as |
|
Database schema name (owner) entered by the user in RCU. |
|
Database schema password entered by the user in RCU. |
|
Additional schema users as defined in the |
|
Password for the additional schema users. |
|
Default tablespace assigned to the component by the user. |
|
Temporary tablespace assigned to the component by the user. |
|
Additional tablespace assigned to the component by the user. Up to three additional tablespaces are supported. |
|
Default permanent tablespace in the database (for example, |
|
Default temporary tablespace in the database (for example, |
|
Default location where the tablespace/datafile will be created. |
|
JDBC connect string. |
|
User-specified prefix for schema and tablespace names. |
|
Already-connected |
|
Database admin user that is provided on the Database Connection Details Screen. |
|
Database admin user password that is provided on the Database Connection Details Screen. |
|
Database admin user role that is provided on the Database Connection Details Screen. |
|
Database hostname that is provided on the Database Connection Details Screen. |
|
Database service name. |
|
Database port number that is provided on the Database Connection Details Screen. |
|
Directory where RCU is installed. |
|
|
|
Location of the directory where RCU log files are created. |
|
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" --> <!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> </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.1.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="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="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">%MDS_VARCHAR%</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="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>
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) or RCU_HOME
\rcu\config
(on Windows) 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 portlet SYSTEM "../integration/portlet/portlet_ComponentInfo.xml"> <!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 webcenter SYSTEM "../integration/webcenter/webcenter_ComponentInfo.xml"> <!ENTITY jive SYSTEM "../integration/jive/jive_ComponentInfo.xml"> <!ENTITY wiki SYSTEM "../integration/wiki/wiki_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 contentserver SYSTEM "../integration/contentserver/contentserver_ComponentInfo.xml"> <!ENTITY oif SYSTEM "../integration/oif/oif_ComponentInfo.xml"> <!ENTITY ess SYSTEM "../integration/ess/ess_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"> ]> <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> </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; <!-- AS Common GROUP END --> <!-- OID GROUP START --> <Component ID="IDM" IS_GROUPING_COMPONENT="TRUE"> <ValidIf DBTYPE="ORACLE" /> <Display NLS_ID="IDM_ID">Identity Management</Display> </Component> &oid; &oif; <!-- OID GROUP END --> <!-- OWLCS START --> <Component ID="OWLCS" IS_GROUPING_COMPONENT="TRUE"> <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 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> &webcenter; &portlet; &contentserver; &jive; &wiki; <!-- 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; <!-- 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="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> <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="CustomSQL" DATA_TYPE="STRING" COMPARE_OPERATOR="NE"> <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>11.1.0.6.0</PrereqValue> <PrereqErrorMsg> The database you are connecting is 11.1.0.6.0 version. 11.1.0.6.0 is not a supported version. The database version should be 11.1.0.7.0 or greater. </PrereqErrorMsg> </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. The database version should be either 10.2.0.4.0 or 11.1.0.7.0 or greater. </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> CU_HOME/rcu/config (on UNIX) <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> </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>
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>
leve, 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>
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) or RCU_HOME
\rcu\config
(on Windows) directory.
The actual tablespace configuration file for each component is located in the RCU_HOME
/rcu/integration
component
/
component
_Storage.xml
(on UNIX) or RCU_HOME
\rcu\integration
component
\
component
_Storage.xml
(on Windows) 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 -->
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.
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 workaround is to have a separate Action with “ValidIf” tag to specify the condition.
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()
.
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.
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.