Showing posts with label mds. Show all posts
Showing posts with label mds. Show all posts

Sunday, May 4, 2014

Exporting all of the MDS data for OIM 11g

If you want to export/backup all the MDS configuration files for OIM, then use the below WLST command:
 
Step1: Create a directory where you want all the configuration to be exported, for example MDSExport.
 
Step2: From the shell/command prompt, navigate to $MW_HOME/oracle_common/common/bin
 
Step3: Execute the wlst.sh/wlst.cmd and issue the connect() command.
 
Step4: Provide the weblogic username, password and URL to Admin Server.
 
Step5: Execute the exportMetadata command providing at least the following arguments: application, server and toLocation.
 
For example, exportMetadata(‘OIMMedata’,’oim_server1’,’<<Full Path to MDSExport’)
 
Step6: You should see a list of the files exported, at that point you can issue the disconnect() command followed by the exit() command.
 
you can also save the above commands in a .py file, let’s say MDSExport.py and it can be executed directly without entering the credentails and URL everytime.
 
MDSExport.py
 
connect('weblogic',<<PASSWORD>>,'t3://<<server:7001>>)
exportMetadata(application='OIMMetadata', server='oim_server1', toLocation=<<Full Path to MDSExport’)
disconnect()
exit()
 
Now, you can simply run the below command:
./wlst.sh MDSExport.py
 
Note: You cannot export all the configuration files using Deployment Manager (DM) and also, DM doesn’t have version control.




Wednesday, November 13, 2013

OIM11g: How to Automate the deployment of User Modifiable Metadata Files

                 Here is how you can you or administrators can get away from providing user name and password or even server url in plain text when using WLST to modify the OIM metadata:
 
 
Step1: Connect to Admin Server using wlst.sh using the user using which you run the wlst.sh command. For example, in my case, I have created a user deployer with administrator and oimuser roles in the weblogic security realm to deploy the OIM metadata.
 
Step2: Run the below command:
 
storeUserConfig('configfile.secure','keyfile.secure')
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to cre
ate the key file? y or n y
The username and password that were used for this WebLogic Server connection are stored in configfile.secure and keyfile.secure.
 
Note: if you choose to create them in different directory, then prefix the directory path with the file name. For example, storeUserConfig('C:\configfile.secure','C:\keyfile.secure'). You can also choose a different name for the files.
 
This will create a user configuration file that contains your credentials in an encrypted form and a key file that WebLogic Server uses to unencrypt the credentials.

Step3: wls:/OIMDomain/serverConfig> exit()
 
Step4: Take the backup of weblogicExportMetadata.py.
 
Step5: Modify the weblogicExportMetadata.py as below:
 
Replace: connect() with
 
connect(userConfigFile='configfile.secure',userKeyFile='keyfile.secure',url='t3://host:14000')
 
Note: Please provide the absolute path if the configuration files are not in ORACLE_HOME/server/bin directory.
 
Step6: Save the python script.
 
Step7: Now, you can run the weblogicExportMetadata.bat and you will see that it won't prompt you to enter the username & password. See below:
 
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Starting export metadata script ....
Connecting to t3://host:14000 with userid deployer ...
Successfully connected to managed Server 'oim_server1' that belongs to domain 'OIMDomain'.
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 export metadata script ...
 
Note: In case of unix, follow step 1 -4 on .sh files. You can repeat the same steps for weblogicImportMetadata.sh & weblogicDeleteMetadata.sh.

Addendum:


In your weblogicExportMetadata.py script, if you want Server URL, path of the above files to be dynamic, here is what you need to do:

Step1: Create a properties file i.e., creds.properties as below:

[Properties File for Deployment]
url: t3://host:14000
userConfigFile: C:\configfile.secure
userKeyFile: C:\keyfile.secure

Step2: Updated your weblogicExportMetadata.py script as below:

"""
Custom OIM metadata Script for Deployment
"""
print 'Starting export metadata script .... '

import ConfigParser
import string
config = ConfigParser.ConfigParser()
config.read("C:\creds.properties")
for section in config.sections():
        serverurl = config.get(section,'url')
        userFile = config.get(section,'userConfigFile')
        keyFile = config.get(section,'userKeyFile')

connect(userConfigFile=userFile,userKeyFile=keyFile,url=serverurl)
exportMetadata(application=application_name,
               server=wls_servername,
               toLocation=metadata_to_loc,
                   docs=metadata_files,
                   applicationVersion='*')
disconnect ()
print 'End of export metadata script ...'
exit()
 
 
References:
 
 
 
 

Thursday, September 26, 2013

OIM: Audit handler failed

Here is the Error of the day:

Just saw it after restarting OIM Server in one of the environment:

Issue: oracle.iam.platform.async.TaskExecutionException: java.lang.Exception: Audit handler failed
        at com.thortech.xl.audit.engine.jms.XLAuditMessage.execute(XLAuditMessage.java:59)
        at oracle.iam.platform.async.impl.TaskExecutor.executeManagedTask(TaskExecutor.java:122)
        at oracle.iam.platform.async.impl.TaskExecutor.execute(TaskExecutor.java:69)
        at oracle.iam.platform.async.messaging.MessageReceiver.onMessage(MessageReceiver.java:68)
        at sun.reflect.GeneratedMethodAccessor644.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke


Cause: Under Investigation