Friday, October 14, 2011

FIM 2010 With ORACLE MA

For a recent FIM 2010 installation, I had to connect to an ORACLE DB (which was the authoritative source).

I had found a number of articles and forum posts that had bits and pieces of information about what to do, none of which was complete. So, I decided to add this blog post as a short how-to.

Since FIM 2010 runs on Server 2008 R2, you need the 64-bit client tools for ORACLE. I found that the 64-bit 11.2.0 client setup package works best (for ORACLE 11g) and can be found here. Install the Full Client.

Now, there are a couple of steps you need to do (or make sure they where done by the installer) for the configuration to work:
  • Set (or create) the ORACLE_HOME environment variable. Should have a value of the installation path up to the client_X folder.
  • Add to the PATH environment variable the value leading up to the path where you have placed your TNSNAMES file.
  • Give access to the Synchronization Service account to the ORACLE client installation folder (make sure they are inherited up to the folder where your TNSNAMES file is stored).

After the installation completed, I fired up the Synchronization Service Manager, created an ORACLE MA, and tried to connect to the database to read a View I had created. Everything worked as a charm!

FIM 2010 with SAP

I was at a customer that requested a FIM installation that would get data from SAP HR 6.0.
So, after the installations where completed, the first thing I tried was actually connecting to SAP.
To do this, you need the SAP .NET Connector 2.0 from SAP website (http://service.sap.com/connectors) and you need some files from the msi package. More on this here.
Now, what the article does not say is that you additionally need to configure how FIM will communicate with SAP.
If you get an error when trying to connect through the ERP MA Configuration Tool stating that it cannot communicate with SAP, you need to configure the services.
The way to do this is to add in the services file (under Windows\System32\drivers\etc) the following lines:
sapdp##  32##/tcp # SAP Dispatcher.       
sapgw##  33##/tcp # SAP Gateway.          
sapsp##  34##/tcp # 
sapms##  36##/tcp # SAP Message Server.   
sapdp##s 47##/tcp # SAP Secure Dispatcher 
sapgw##s 48##/tcp # SAP Secure Gateway 

where the ## is the system number your client has given their SAP system.
(Find the documentation for the above here). 

There are a couple of things you should try if even this fails:
  • Run the ERP MA Configuration tool as Administrator.
  • Instead of providing the name of the server in ASHOST, type in the IP.
    (Even though I added the entry in the hosts file, I still needed to give the IP.)
Now, I also had an issue when Discovery started. The progress bar would go all the way to the end, and then I would get a message stating:     
The functions or structures in your configuration do not match those in the discovery cache. Saving will produce an unusable ERP MA.
Click ‘Yes’ to rebuild definitions from discovery cache.
Click ‘No’ to cancel Saving.

When I clicked 'Yes' I would get an application exception stating that there was an error retrieving a referenced BAPI function from Discovery. After spending a couple of hours trying to figure it out, I logged out of the machine and went home. The next day, it worked! No idea why, so just try to log out and then back in.

Another issue I faced, once I had the MA set-up in the Sync Service Manager, after trying to do a full import, I kept getting an error stating a "stopped-extension-dll-exception". Looking in the Eventlog, I found out that a FileNotFoundException was thrown and it was looking for the .xml file in the Extenstions directory. So, I needed to set the MA Name to the .xml file exported by the ERP MA Configuration Tool. Once I did that, everything worked like a charm.