Tuesday, February 24, 2015

Deployment Steps for OIM 11g R1 Custom Scheduled Taks or Event Handler

Set the following ENV variables for ST/EH import/export/delete operation
New Scheduler Task import into OIM
-----------------------------------
1. Register/Import a ScheduledTask/EventHander  metadata configuration into OIM
2. Register the ST/EH plugin package into MDS
3. Clear the cache of MDS
4. Restart the OIM server(s)
Overwrite the ST/EH package plugin class for the existing one.
--------------------------------------------------------------
1. Make sure no change in the structure & parameters of the ST/EH
2. Make sure the plugin.xml file have higher version than the lower
3. Register the ST/EH plugin package into MDS
4. Clear the cache of MDS
5. Restart the OIM server(s)
Delete/Remove the ST/EH from OIM
--------------------------------
1. export the removing Scheduled task metadata file from OIM to xml file
2. Remove the Scheduled Task configured in OIM/Admin/Scheduled Jobs list
3. Unregister the ST/EH class  if already exists:
4. Delete the ST/EH configuration from metadata
5. Clear the cache of MDS


  • Set the following ENV variables for ST/EH import/export/delete operation
    ------------------------------------
    #
    /home/oracle> export MW_HOME=/opt/appbin/oracle/iam_middleware
    /home/oracle> export ORACLE_HOME=$MW_HOME/Oracle_IAM1
    /home/oracle> export OIM_ORACLE_HOME=$MW_HOME/Oracle_IAM1
    /home/oracle> export OIM_HOME=$MW_HOME/Oracle_IAM1
    /home/oracle> export WL_HOME=$MW_HOME/wlserver_10.3
    /home/oracle> export ANT_HOME=$MW_HOME/modules/org.apache.ant_1.7.1
    /home/oracle> export JAVA_HOME=/usr/java6_64
    /home/oracle> export PATH=$ORACLE_HOME/bin:$ANT_HOME/bin:JAVA_HOME/bin:$PATH
    /home/oracle> cd $OIM_HOME/server/bin

  • Unregister the ST/EH class  if already exists:
    --------------------------------------------------------
    /opt/appbin/oracle/iam_middleware/Oracle_IAM1/server/plugin_utility> ant -f pluginregistration.xml unregister
    -------
    /opt/appbin/oracle/iam_middleware/wlserver_10.3/server/lib/wlfullclient.jar
        [input] Enter the oim user id:
    xelsysadm
        [input]Enter the oim user password:
        [input] Enter the server url [t3://<host>:<port>] :
    t3s://<<OIMHostname>>:14001
        [input] Enter class name (complete class name with package) of the plugin:
    <<packageName.security.provisioning>>.LDAPSync
           [echo]
            ------
            -------
     [echo] <Oct 7, 2014 5:00:08 PM PDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=GeoTrust Primary Certification Authority - G3,OU=(c) 2008 GeoTrust Inc. - For authorized use only,O=GeoTrust Inc.,C=US". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
     [echo] Plugin Unregistered
        BUILD SUCCESSFUL
       Total time: 1 minute 33 seconds

Make sure the database record OIM DB got deleted -->
select * from plugins where id like '%LDAPSync%'
select * from plugin_zip where zipid=plugins.zipid

if the above unregister command not deletes the record, can delete the records from sql  with the above command..

Delete the ST/EH configuration from metadata :---------------------------------------------
Note: just specifiy only the desired event handler entry out of the existing event handlers
only considers the metadata_files parameter in weblogic.properties will be considered to remove. verify the path in mds_paths table @oim

--> select * from mds_paths where path_fullname like '%EventHandler/ScheduledTaskName%'

weblogic.properties
---------
metadata_from_loc=/home/oracle/ImportData
metadata_to_loc=/home/oracle/ExportData
metadata_files=/home/oracle/DeleteData/db/custom/del_eventhandlers.xml

-->
$:/opt/appbin/oracle/iam_middleware/Oracle_IAM1/server/bin> ./weblogicDeleteMetadata.sh
----- ---
-----
Starting delete metadata script ....
Please enter your username :weblogic
Please enter your password :
Please enter your server URL [t3://localhost:7001] :t3://<<OIMHostname>>:14200
Connecting to t3://<<OIMHostname>>:14200 with userid weblogic ...
Successfully connected to managed Server 'oim_server1' that belongs to domain 'OIM_domain'.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
Location changed to custom tree. This is a writable tree with No root.
For more help, use help(custom)

Disconnected from weblogic server: oim_server1
End of delete metadata script ...

Exiting WebLogic Scripting Tool.
log file:
[2014-10-08T10:29:19.859-07:00] [oim_server1] [WARNING] [MDS-01268] [oracle.mds] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: ea37b5dd1ddd0753:-2e24c29e:148e22fa064:-8000-0000000000006b59,0] [APP: OIMMetadata#11.1.1.3.0] The associated extended metadata document for the given document name /home/oracle/DeleteData/db/custom/del_eventhandlers.xml is missing.

-----
delete the record from database:
delete from mds_paths where path_docid in (<<path_docid of EH/ST entries)) 
Register/Import a ST/EH  metadata configuration into OIM:
-----------------------------------------------------------------------
$:/opt/appbin/oracle/iam_middleware/Oracle_IAM1/server/bin> vi weblogic.properties
modify the entries:
application_name=OIMMetadata  [scheduled task]; oim [event handlers]
metadata_from_loc=/home/oracle/importData/LDAPOutOfSync/metadata
metadata_file=/file/LDAPOutOfSync.xml

$:/opt/appbin/oracle/iam_middleware/Oracle_IAM1/server/bin> ./weblogicImportMetadata.sh
Starting import metadata script ....
Please enter your username :weblogic
Please enter your password :
Please enter your server URL [t3://localhost:7001] :t3s://<<oimhostname>>:14001
Connecting to t3s://<<oim admin host>>:7008 with userid weblogic ...
<Oct 8, 2014 2:22:57 PM PDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
----
For more help, use help(domainRuntime)

Disconnected from weblogic server: AdminServer
End of importing metadata script ...

Exiting WebLogic Scripting Tool.

Register the ST/EH plugin package into MDS
----------------------------------------------------------
/opt/appbin/oracle/iam_middleware1/Oracle_IAM1/server/plugin_utility> ant -f pluginregistration.xml register
Buildfile: pluginregistration.xml
register:
     [echo]
     -----
     ------
     [echo]
     [echo] /opt/appbin/oracle/iam_middleware1/Oracle_IAM1/server/ext/spring.jar:/opt/appbin/oracle/iam_middleware1/Oracle_IAM1/server/ext/jakarta-commons/commons-logging.jar:----------------------:/opt/appbin/oracle/iam_middleware1/wlserver_10.3/server/lib/wlfullclient.jar
    [input] Enter the oim user id:
xelsysadm
    [input]Enter the oim user password:
    [input] Enter the server url [t3://<host>:<port>] :
t3://<<oimhostname>>:14200
    [input] Enter name (complete file name with path) of the plugin file:
/home/oracle/ImportData/db/pluginzip/LDAPSync.zip
     [echo]
     [echo] Plugin Registered
BUILD SUCCESSFUL
Total time: 35 seconds

Clear the cache of MDS:------------------------------

$:/opt/appbin/oracle/iam_middleware/Oracle_IAM1/server/bin> ./PurgeCache.sh ALL
[Enter the admin username:]xelsysadm
[Enter the admin password:]
[Enter the service url : (i.e.: t3://oimhostname:oimportno)]t3s://<<oimhostname>>:14001
<Oct 8, 2014 3:04:08 PM PDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
PurgeCache Login Success...
Purging the cache categories:[ALL] is successful

Reference URLs:
--------------------
33 MDS Utilities and User Modifiable Metadata Files - http://docs.oracle.com/cd/E23943_01/doc.1111/e14309/utils.htm
http://docs.oracle.com/cd/E14571_01/doc.1111/e14309/utils.htm
#file location should be start with /db ,/file or /custom
http://docs.oracle.com/cd/E21764_01/doc.1111/e14309/oper.htm
#developing scheduled task -
http://docs.oracle.com/cd/E21764_01/doc.1111/e14309/refsched.htm
# Import and Export Metadata using EM Console -
http://oraclestack.blogspot.com/2014/02/import-and-export-metadata-using-em.html