D XSD for Registering XML Schema

To seed hierarchical attribute data in Oracle Identity Manager, an XML is created per the XSD and loaded into Oracle Identity Manager schema via the Catalog Synchronization scheduled job. Based on the database version on which Oracle Identity Manager schema resides, an appropriate XML storage model is used to store the hierarchical data. The XSD structure used to register XML schema in the database differs only on the XSD schema annotations used according to the database versions, as described in the following sections:

D.1 For Oracle Database 11g Release 1 or Later

If Oracle Database 11g Release 1 or later is used, then Binary XML storage model is used to register XML schema. The XSD schema URL and structure are as follows:

schemaurl:

http://localhost/public/xsd/hierarchicalEntitlement.xsd

schemadoc:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"  xmlns:xdb="http://xmlns.oracle.com/xdb">
<xs:element name="oim" xdb:defaultTable="" >
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="applicationInstances"/>  <!-- instead of namesapces/endpoints in OIA we can take in a list of application instances-->
      <xs:element ref="attributes"/>            <!-- you start with the attributes instead of the values -->
    </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:element name="applicationInstances" xdb:defaultTable="" >
    <xs:complexType>
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" ref="applicationInstance" />
        </xs:sequence>
    </xs:complexType>
</xs:element>
<xs:element name="applicationInstance" type="xs:string" xdb:defaultTable=""/>
<xs:element name="attributes"  xdb:defaultTable="">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="attribute"/>
      </xs:sequence>
    </xs:complexType>
</xs:element>
<xs:element name="attribute"  xdb:defaultTable="">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="entitlementValues"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
    </xs:complexType>
</xs:element>
<xs:element name="entitlementValues" xdb:defaultTable="">
  <xs:complexType>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="entitlementValue" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_EVAL"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:element name="entitlementValue" xdb:defaultTable="">
  <xs:complexType>
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" ref="value"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="description"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="attributes"/>
      </xs:sequence>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="value" type="xs:string"  xdb:defaultTable=""/>
  <xs:element name="description" type="xs:string"  xdb:defaultTable=""/>
</xs:schema>

Using the XSD structure, XML schema registration is done, as shown:

DBMS_XMLSCHEMA.REGISTERSCHEMA
(
   SCHEMAURL => schemaurl,
   SCHEMADOC => schemadoc,
   LOCAL     => TRUE,
   GENTYPES  => FALSE,
   GENTABLES => TRUE,
   OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML
 )
/

Table D-1 lists the database objects created in Oracle Identity Manager schema post successful XML schema registration.

Table D-1 Database Objects Created After XML Schema Registration

Object Type Count Object Name

LOB

1

System generated

TRIGGER

1

System generated

TABLE

1

CATALOG_HIERARCHICAL_ATTR_EVAL

INDEX

1

System generated


You can then run the following queries to verify the XML schema existence and fetch the list of underlying tables created in Oracle Identity Manager schema:

  • To verify XML schema registration:

    SELECT SCHEMA_URL FROM USER_XML_SCHEMAS;
    
  • To view the underlying tables created for the registered XML schema:

    SELECT * FROM USER_XML_TABLES;
    

D.2 For Oracle Database Earlier Than 11g Release 1

If Oracle Database earlier than 11g Release 1 is used, then Unstructured (CLOB) XML storage model is used to register XML schema. The XSD schema URL and structure are as follows:

schemaurl:

http://localhost/public/xsd/hierarchicalEntitlement.xsd

schemadoc:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"      xmlns:xdb="http://xmlns.oracle.com/xdb">
  <xs:element name="oim" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_OIM" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="applicationInstances"/>  <!-- instead of namesapces/endpoints in OIA we can take in a list of application instances-->
        <xs:element ref="attributes"/>            <!-- you start with the attributes instead of the values -->
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="applicationInstances" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_AINS" >
      <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" ref="applicationInstance" />
          </xs:sequence>
      </xs:complexType>
  </xs:element>
  <xs:element name="applicationInstance" type="xs:string" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_AIN"/>
  <xs:element name="attributes"  xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_ATRS">
      <xs:complexType>
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="attribute"/>
        </xs:sequence>
      </xs:complexType>
  </xs:element>
  <xs:element name="attribute"  xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_ATR">
      <xs:complexType>
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" ref="entitlementValues"/>
        </xs:sequence>
        <xs:attribute name="name" use="required"/>
      </xs:complexType>
  </xs:element>
  <xs:element name="entitlementValues" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_EVLS">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="entitlementValue"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="entitlementValue" xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_EVL">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" ref="value"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="description"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="attributes"/>
      </xs:sequence>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="value" type="xs:string"  xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_VAL"/>
  <xs:element name="description" type="xs:string"   xdb:defaultTable="CATALOG_HIERARCHICAL_ATTR_DESC"/>
</xs:schema>

Using the XSD structure, you can register the XML schema, as follows:

DBMS_XMLSCHEMA.REGISTERSCHEMA
(
   SCHEMAURL => schemaurl,
   SCHEMADOC => schemadoc,
   LOCAL     => TRUE,
   GENTYPES     => FALSE,
   GENTABLES => TRUE
 )
/

Table D-2 lists the database objects created in Oracle Identity Manager schema post successful XML schema registration.

Table D-2 Database Objects Created After XML Schema Registration

Object Type Count Object Name

LOB

9

System generated

TABLE

9

CATALOG_HIERARCHICAL_ATTR_OIM

CATALOG_HIERARCHICAL_ATTR_AINS

CATALOG_HIERARCHICAL_ATTR_AIN

CATALOG_HIERARCHICAL_ATTR_ATRS

CATALOG_HIERARCHICAL_ATTR_ATR

CATALOG_HIERARCHICAL_ATTR_EVLS

CATALOG_HIERARCHICAL_ATTR_EVL

CATALOG_HIERARCHICAL_ATTR_VAL

CATALOG_HIERARCHICAL_ATTR_DESC

TRIGGER

9

System generated

INDEX

9

System generated


You can then run the following queries to verify the XML schema existence and fetch the list of underlying tables created in Oracle Identity Manager schema:

  • To verify XML schema registration:

    SELECT SCHEMA_URL FROM USER_XML_SCHEMAS;
    
  • To view the underlying tables created for the registered XML schema:

    SELECT * FROM USER_XML_TABLES;