Wednesday, February 25, 2009

Oracle ucm content management installation

Use the link to get the installation and the documentations.

First install the Apache web server.

Create a user in the database with username and password ucm/ucm.


Go to the directory which contains the setup executable.
Linux - /home/ucm/V13684-01/UCM/ContentServer/linux
Windows - G:\ContentServer_Windows_10gR3_20080807\UCM\ContentServer\win32

Run ./ in linux or Installer.exe in windows.

Summery of values selected.

Review install settings. . .
Content Server Core Folder: /oracle/ucm/server
Java virtual machine: Sun Java 1.5.0_11 JDK
Content Server Native Vault Folder: /oracle/ucm/server/vault/
Content Server Weblayout Folder: /oracle/ucm/server/weblayout/
Proxy authentication through another server: no
Install admin server: yes
Web Browser Path: /usr/bin/firefox
Content Server System locale: English-US
Content Server Port: 4444
Admin Server Port: 4440
Incoming connection address filter:
Web Server Relative Root: /idc/
Company Mail Server: mailserver.somedomain
Administrator E-Mail Address: user@server.somedomain
Web Server HTTP Address: localhost.localdomain
Server Instance Name: idc
Server Instance Label: idc
Server Description: Content Server idc
Web Server: Apache
Content Server Database: Oracle
Manually configure JDBC settings for this database: false
Oracle Server Hostname: localhost
Oracle Listener Port Number: 1521
Oracle User: ucm
Oracle Password: hOYGE/WjtaG1G/Fgm3xJXa2194WX5GMrSeGcNyfW4OM=
Oracle Instance Name: orcl
Configure the JVM to find the JDBC driver in a specific jar file: false
Attempt to create database tables: yes

Select Proceed to continue

Add the configuration parameters from the installed directory server\data\users\apache22\apache.conf to the apache configuration file httpd.conf.

Change the Allow from any to
Allow from all

Also add the following parameter if it is not already there.
DirectoryIndex portal.htm

The parameters should look something like below.

LoadModule IdcApacheAuth "G:/product/"
IdcUserDB "idc" "G:/product/"
Alias "/idc" "G:/product/"
IdcSecurity "idc"
Allow from all
DirectoryIndex portal.htm

Start the content server by executing server\bin\IdcServer.exe
Start the admin server by executing server\admin\bin\IdcAdmin.exe

Restart the Apache server .

Point the browser to http://localhost/idc/

The following message will come if the web server is not configured properly.

Network message format error. Unable to parse browser environment or content item. Unable to parse properties. Name-value pairs are missing an '='.

Check the parameters and try again.

Once successful log in as sysadmin/idc

Sunday, February 22, 2009

Difference in two Dates, Daylight saving issue and fixing

Calculating the number of days between two dates is not straight forward if
you are in a Time Zone which has daylight saving. Most of the programmers miss this
point and waits until it get caught up by the testing team or by the public user.

The worst case is sometimes this issue will continue to stay even without noticing as this happens only when the dates which are chosen are inside a period of daylight saving and may cost a lot at the end of the year.

The simplest way of calculating the number of days between two dates is
get the UTC time difference of the two dates and divide it by number of milliseconds per day. But this is incorrect as this can give false results if daylight saving is active on that particular dates.

Try the following example in Java.

Date d = new Date(2009, 2, 28, 12, 0, 0);
System.out.println(d + " local <=> GMT " + d.toGMTString());

Here we have created a Date object for 28 March 2009 and set the time to 12:00. Assume your time zone is GMT. But if you run this code you will notice the GMT time shows as 11:00. That means if you use getTime() function to get the time it is 1 hour less than what you expect.

There are few methods to fix this in Java.

1/ Add 2 hours to the difference that is 3600000 * 2 milliseconds.

Date d1 = new Date(year, month-1, day, 12, 0, 0);
Date d2 = new Date(year, month-1, day, 12, 0, 0);
int dif = (int)((d1.getTime() - d2.getTime() + 3600000 * 2 ) / 86400000);

Since 3600000 * 2 / 86400000 is a fraction it will be eliminated when casting to int. So this method will work when you are in daylight saving or not. This method can be used in any language Java, C, VB, PHP etc. or even JavaScript.

2/ Remove the offset value from the time component

Date d1 = new Date(year, month-1, day, 12, 0, 0);Date d2 = new Date(year, month-1, day, 12, 0, 0);

int dif = (int)((d.getTime() - d.getTimezoneOffset() * 60000 - (td.getTime() - td.getTimezoneOffset() * 60000) ) / 86400000);

Here the d.getTimezoneOffset() * 60000 is used because the offset is given in minutes. This is not required if you use the Calendar Object instead.

3/ You can pass a Custom TimeZone object to the Calendar object which doesn’t have anything in method bodies.


Wednesday, February 11, 2009

TNS Listener Crashes with error

I got the follwoing error in TNS Listner after installing Oracle application server 10g.

lsnrctl Message 1073 not found; No message file for product=NETWORK, facility=TNS


Windows No such file or directory message.

To see this error use Start>Run and type cmd and press enter
then type lsnrctl status and press enter.

The issue is with the ORACLE_HOME envirnment variable which got change after installing the application server.

To fix this change the ORACLE_HOME to C:\oraclexe\app\oracle\product\10.2.0\server in my case. This should be done in My Computer>Properties>Advanced Tab>Envirnoment Variables.

Please check the registry key
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment

which should be the same as above.