Dienstag, 26. März 2013

Tutorial: Update Oracle Identity Manager 11.1.2.0 to 11.1.2.0.4 (in clustered environment)

This post shows how to patch Oracle Identity Manager 11.1.2.0 to version 11.1.2.0.4. The bundle patch brings some improvements including some bugfixes in reconciliation and provisioning processes and it also removes some glitches in OIM GUI.

Patch Number: 16229450 availale via metalink (oracle support)
Patch Filename: p16229450_111200_Generic.zip

Download the patch, unzip it and make it available and all servers you want to patch OIM. Read the Readme (that's what it is for).

Make sure you have at least OPatch Version 11.1.0.8.3 (I used 11.1.0.9.0). Also make sure you have recent backups of your file system and repository database.

1. Stop all OIM- and SOA-Servers in your OIM-Domain.
2. Change to the directory where you have unzipped the patch and


[oim0@server0 16229450]$ opatch apply
[WARN ][jrockit] MaxPermSize=256m ignored: Not a valid option for JRockit
Oracle Interim Patch Installer version 11.1.0.9.0
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/idm0/mwh/idm0
Central Inventory : /opt/idm0/oraInventory
   from           : /opt/idm0/mwh/idm0/oraInst.loc
OPatch version    : 11.1.0.9.0
OUI version       : 11.1.0.9.0
OUI location      : /opt/idm0/mwh/idm0/oui
Log file location : /opt/idm0/mwh/idm0/cfgtoollogs/opatch/16229450_Mar_19_2013_22_42_00/apply2013-03-19_22-43-33PM_1.log
Patch history file: /opt/idm0/mwh/idm0/cfgtoollogs/opatch/opatch_history.txt

OPatch detects the Middleware Home as "/opt/idm0/mwh"
OPatch will do the following:
[Oracle Home discovery]                      : Configure and Validate Oracle Home info.
[Prerequisite for apply]                     : Invoke prerequisites to see if patch can be applied.
[Patch conflict detection for apply patch]   : Check if any conflict with already installed patches in Oracle Home.
ApplySession applying interim patch '16229450' to OH '/opt/idm0/mwh/idm0'
Running prerequisite checks...
To continue, OPatch will do the following:
[Back up for restore]           : Back up 92 files for Oracle Home restore in case of patching error.
[Back up for rollback]          : Back up 86 files for future patch rollback.
[Patch Oracle Home for apply]   : Copy 86 file(s) to Oracle Home.
[Update inventory for apply]    : Modify the inventory to record  patch [16229450].
[Post-script processing]        : Excute post script for patch [16229450].

Do you want to proceed? [y|n]
y
User Responded with: Y
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/idm0/mwh/idm0')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '16229450' for restore. This might take a while...
Backing up files affected by the patch '16229450' for rollback. This might take a while...
   creating: /opt/idm0/mwh/idm0/server/apps/was/oim.ear/xlWebApp.war/META-INF/
  inflating: /opt/idm0/mwh/idm0/server/apps/was/oim.ear/xlWebApp.war/META-INF/MANIFEST.MF
Patching component oracle.oim.server, 11.1.2.0.0...
[cut ...]
Verifying the update...
Inventory check OK: Patch ID 16229450 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 16229450 are present in Oracle Home.
Execution of 'sh /share/stage/idm11g/patch/16229450/custom/scripts/post -apply 16229450 ':
[cut ...]

Return Code = 0
The local system has been patched and can be restarted.

OPatch succeeded.


3. confirm all prompts and repeat opatch apply on all cluster members (if you don't have your middleware home on shared storage).

4. After opatch succeeds you have to edit the file OIM_ORACLE_HOME/server/bin/patch_oim_wls.profile which is needed for the next update step. The file already contains all needed values but they have to be changed to fit the local environment (I have no idea why the patch mechanism does not do this automatically). You may specify your weblogic and db passwords in that file but you also can enter them interactively. The file is write-protected, for whatever reason.

5. Start all servers in OIM domain (AdminServer, soa_server1, oim_server1, and all others if clustered)

Execute patch_oim_wls.sh (and enter passwords if not already done in profile-file):

[oim0@server0 bin]$ . ./patch_oim_wls.sh
Buildfile: /opt/idm0/mwh/idm0/server/setup/deploy-files/automation.xml
    [input]Enter the oim db password:
    [input]Enter MDS db password:
    [input]Enter Weblogic password:
    [input]Enter OIM password:  

6. It is very important to check patch_oim_wls.log, because patch_oim_wls.sh does not generate any output. So check patch_oim_wls.log and see if everything went fine. I first had following error message:


BUILD FAILED
/opt/idm0/mwh/idm0/server/setup/deploy-files/automation.xml:132: The following error occurred while executing this line:
/opt/idm0/mwh/idm0/server/setup/deploy-files/automation.xml:77: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
So obviously I did not enter the correct schema password. 

Be careful, a "BUILD SUCCESSFUL" does not mean there were no errors before, so take a look at the whole file.

If the script fails, it can simply be re-executed.

7. If this is a clustered environment, repeat steps 4, 5 and 6 on every cluster member. The script recognizes all changes already commited to the repository database. 

8. Restart all servers in OIM domain.

9. Check if everything is fine and the version now is 11.1.2.0.4.

I thought you could check the version with the following SQL query in OIM repository:

select XSD_KEY, XSD_CODE, XSD_VALUE, XSD_CREATE, XSD_UPDATE  from XSD;

But this is not the case anymore, the output is still:

XSD_KEY                XSD_CODE                          XSD_VALUE                                 
---------------------- --------------------------------- ------------------------------------------
1                      XL_BUILD_NUMBER                   11.1.2.0.0.0.0                            
2                      XL_ENCRYPTED                      TRUE                                      
3                      XL_BUILD                          0.0                                       
4                      XL_PATCH_BASE                     11.1.2.0.0                                
5                      XL_PATCHLEVEL                     0.0                                       
6                      XL_BRANCH_NAME                    1                                         
7                      XL_ADE_LABEL                      IAM_11.1.2.0.0_GENERIC_120710.1630     

Oracle Support confirmed that only "opatch lsinventory" will give correct information about the patchlevel. It should output this:


Patch 16229450 : applied on Tue Mar 20 10:19:21 CET 2013Unique Patch ID: 15949936 Created on 14 Feb 2013, 04:42:10 hrs PST8PDT Bugs fixed: 14847432, 16027930, 14377844, 14607531, 14528143, 15993556, 9448227 14572885, 15829600, 15865789, 14294315, 15856138, 13849266, 15970366 14383293, 14118283, 14626660, 16022674, 14577685, 14274939, 14587847 14292212, 14501796, 14699616, 14616072, 14173555, 16084304, 14575653 15910342, 14579979, 16005515, 14292257, 14621587, 14347443, 14516538 14287866, 14597181, 14375429, 14690219, 14495107, 15905163, 14696429 14489661, 14149793, 14313692, 14298147, 14687681, 14553954, 14293783 14638470, 15911767, 14825743, 14762289, 15908074, 14627112, 14389156 14191812, 15896540, 16008683, 14345811, 14292190, 14293244, 14267405 15940692, 15879277, 14390529, 14522028, 16105425, 14667903, 13994326 15856621, 15872376, 14698977, 14310109, 14641595, 15971475, 14834319 14509729, 14309065, 14401981, 14313594, 14338499, 14475196, 15999820 14577886, 16105398, 14307751, 14665516, 15971696, 14844556, 13981517 14292237, 14571421, 14342301, 14512231, 14762113, 14512233, 14735224 14469575, 14367137, 14690304, 14345828, 14592982, 14493129, 16058277 14598437, 14072627, 15856565, 14318075, 14205971, 14808348, 14744480 14401887, 14764229, 14645564, 14230147, 16206358, 14350003, 14159688






Error when logging in to Oracle Identity Manager Design Console (11.1.2): java.net.MalformedURLException: no protocol: @jndi_url

This problem is caused by xlconfig.xml ($OIM_ORACLE_HOME/designconsole/config), just update the line


<java.naming.provider.url>@jndi_url</java.naming.provider.url>

with proper connection information, example:

<java.naming.provider.url>t3://linux:7102/Xellerate</java.naming.provider.url>

Another Error:


SEVERE: An error occured while trying to notify server that a new login session has been created.
oracle.iam.platform.utils.NoSuchServiceException: java.lang.reflect.InvocationTargetException
at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:279)
at oracle.iam.platform.OIMClient.getService(OIMClient.java:256)
at oracle.iam.platform.OIMClient.loginSessionCreated(OIMClient.java:291)
at oracle.iam.platform.OIMClient.login(OIMClient.java:216)
at oracle.iam.platform.OIMClient.login(OIMClient.java:184)
at com.thortech.xl.client.base.tcAppWindow.internalLogin(tcAppWindow.java:585)
at com.thortech.xl.client.base.tcAppWindow.login(tcAppWindow.java:504)
at com.thortech.xl.client.base.tcAppWindow.<init>(tcAppWindow.java:118)
at com.thortech.xl.client.base.tcAppWindow.main(tcAppWindow.java:174)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:275)
at oracle.iam.platform.OIMClient.getService(OIMClient.java:256)
at oracle.iam.platform.OIMClient.loginSessionCreated(OIMClient.java:291)
at oracle.iam.platform.OIMClient.login(OIMClient.java:215)
at oracle.iam.platform.OIMClient.login(OIMClient.java:184)
at com.thortech.xl.client.base.tcAppWindow.internalLogin(tcAppWindow.java:583)
at com.thortech.xl.client.base.tcAppWindow.login(tcAppWindow.java:504)
at com.thortech.xl.client.base.tcAppWindow.<init>(tcAppWindow.java:118)
at com.thortech.xl.client.base.tcAppWindow.main(tcAppWindow.java:173)
Caused by: oracle.iam.platform.utils.NoSuchServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: @jndi_factory [Root exception is java.lang.ClassNotFoundException: @jndi_factory]


When facing this error, you have to set the following setting in xlconfig.xml to a proper value:

<java.naming.factory.initial>weblogic.jndi.WLInitialContextFactory</java.naming.factory.initial>

This depends on what appserver you are using.


Error when logging in to Oracle Identity Manager Design Console (11.1.2): unable to find LoginModule class: org.jboss.security.ClientLoginModule

I tried to log into to OIM Design Console and after submittung xelsysadm credentials I got the following error (after clicking "Details"):


Error Keyword: DAE.LOGON_DENIED
Description: Invalid Login.
Remedy: Contact your system administrator.
Action: E
Severity: H
Help URL: 
Detail: 
javax.security.auth.login.LoginException: unable to find LoginModule class: org.jboss.security.ClientLoginModule

Strange message since I don't use JBoss for this installation. While looking in xlclient.sh for the error I noticed it points to the wrong auth file:

   -Djava.security.manager -Djava.security.auth.login.config=config/auth.conf 

Change this line to:

  -Djava.security.manager -Djava.security.auth.login.config=config/authwl.conf 

(not authws.conf!!) After that it works.

Error when starting Oracle Identity Manager Design Console (11.1.2): java.lang.NoClassDefFoundError: javax/ejb/CreateException

After a new installation of  Oracle Identity Manager (OIM) I tried to start the Design Console and all I got was the following error:

[oim@linux designconsole]$ ./xlclient.sh
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: javax/ejb/CreateException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethod(Class.java:1935)
at java.awt.Component.isCoalesceEventsOverriden(Component.java:5975)
at java.awt.Component.access$500(Component.java:169)
at java.awt.Component$3.run(Component.java:5929)
at java.awt.Component$3.run(Component.java:5927)
at java.awt.Component.checkCoalescing(Component.java:5926)
at java.awt.Component.<init>(Component.java:5895)
at java.awt.Container.<init>(Container.java:249)
at java.awt.Window.<init>(Window.java:430)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at javax.swing.JFrame.<init>(JFrame.java:158)
at com.thortech.xl.gui.base.tcFrame.<init>(tcFrame.java:34)
at com.thortech.xl.client.base.tcAppWindow.<init>(tcAppWindow.java:104)
at com.thortech.xl.client.base.tcAppWindow.main(tcAppWindow.java:173)

It turns out I missed one step in installation instruction. Fix:

  • Change to MW_HOME/wlserver_10.3/server/lib directory
  • Set JAVA_HOME
  • Execute 

java -jar wljarbuilder.jar
.
.
.
Created new jar file: /oracle/oim0/mwh/wlserver_10.3/server/lib/wlfullclient.jar

  • Copy wljarbuilder.jar to $OIM_ORACLE_HOME/designconsole/ext

After that it works.

Freitag, 15. März 2013

I don't always dump mysql databases ...

... but when I do, I use commandline tools instead of phpmyadmin - it's much faster and you don't get in trouble with large databases and php filelimits. Today I had to clone some mysql databases from one linux server to another. This happens every few months and I always forget the exact mysqldump commands - so I will note them down here.

Export database

mysqldump -u db_user -pPasswordWithoutBlank --databases db_name --result-file=dbname.sql

Import database

mysql -u db_user -pPasswordWithoutBlank db_name < dbname.sql
Thanks to this post by Ramesh Natarajan which is always my favorite google result on this topic.