Thursday, December 22, 2011

Enable FTP for Mac OS X Lion

I was just wondering where is the FTP option for Mac OS X Lion. It used to be in System Preferences -> Sharing but with OS X Lion, it looks like the FTP option is removed but it is not!

To enable FTP, you need to run the following in the terminal
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

To disable,
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

Monday, December 19, 2011

Installing Oracle XE 11g on Ubuntu 11.10

Ubuntu is not supported OS for Oracle XE 11g but still we can make it work by following below post. The main issue is due to memory management used by previous version vs ubuntu 11.10.

Friday, December 16, 2011

Oracle XE 11g Post Installation Issue

After installing Oracle XE 11g database, if you get below error when running below command,

[root@*** ~]# /etc/init.d/oracle-xe status

LSNRCTL for Linux: Version 11.2.0.2.0 - Beta on 19-APR-2011 04:07:41

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
 TNS-00511: No listener
  Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*******)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
 TNS-00511: No listener
  Linux Error: 111: Connection refused


then it is an issue with network settings of your OS. The main reason is that the listener.ora was referencing a network settings which was modified after the Oracle XE installation.

The solution is to rename the listener.ora to something different (for example, listener.ora_old) and then restart the database by /etc/init.d/oracle-xe restart

Saturday, June 25, 2011

How to calculate distance between two zipcode?

To calculate the distance between two zipcode, you need a table which stores latitude and longitude for all the cities.
CREATE TABLE `zip_codes` (
  `zip` varchar(5) NOT NULL default '',
  `state` char(2) NOT NULL default '',
  `latitude` varchar(10) NOT NULL default '',
  `longitude` varchar(10) NOT NULL default '',
  `city` varchar(50) default NULL,
  `full_state` varchar(50) default NULL,
  UNIQUE KEY `zip` (`zip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `zip_codes` VALUES ('35004', 'AL', ' 33.606379', ' -86.50249', 'Moody', 'Alabama');

You can use the below logic to calculate the distance:-

import java.lang.Math;
import java.lang.Double;

public int calcDistance(double latA, double longA, double latB, double longB)
{
  double theDistance = (Math.sin(Math.toRadians(latA)) *
                        Math.sin(Math.toRadians(latB)) +
                        Math.cos(Math.toRadians(latA)) *
                        Math.cos(Math.toRadians(latB)) *
                        Math.cos(Math.toRadians(longA - longB)));

  return = (Math.toDegrees(Math.acos(theDistance))) * 69.09;
}

SQL script to setup zipcode table - http://zips.sourceforge.net/

JSON Validator and Formatter

WebCenter Login Setup

How to setup Task List portlet

Excellent article which talks about how to setup task list portlet in webcenter pages.

http://fusione2o.blogspot.com/2011/05/setting-up-task-list-portlets-in.html

Wednesday, June 15, 2011

Too many open files in Linux systems when running FMW applications

This is the most common issue with linux system & you may notice the error message like 'Too many open files' while running SOA or WebCenter or OSB servers.

The solutions is to,

Edit /etc/security/limits.conf file & add below
<user> soft nofile 4096
<user> hard nofile 4096


Note - Replace <user> with actual os user name.
 

If you want to apply the above to all the user, then
* soft nofile 4096
* hard nofile 4096

Edit the /etc/pam.d/system-auth, and add this entry:
session required /lib/security/$ISA/pam_limits.so

Edit /etc/pam.d/login and add the below:
session required pam_limits.so

Adding "session required pam_limits.so" to /etc/pam.d/login and /etc/pam.d/sshd

Edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:
# vi /etc/sysctl.conf
Append a config directive as follows:
fs.file-max = 100000

Try "sysctl -p" as root or Restart your machine.

After this change open a new terminal and issue ulimit -a.

Tuesday, June 14, 2011

If startManagedWeblogic.sh soa_server fails in 11g SOA

Problem:

When starting managed server for soa_server, the following error is shown in the console.

Enter username to boot WebLogic server:admin
<Jul 21, 2009 6:34:46 PM EDT> <Error> <Security> <BEA-090783> <Server is Running in Development Mode and Native Library(terminalio) to read the password securely from commandline is not found.> 
<Jul 21, 2009 6:34:46 PM EDT> <Notice> <WebLogicServer> <BEA-000388> <JVM called WLS shutdown hook. The server will force shutdown now> 
<Jul 21, 2009 6:34:46 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN> 

Solution:-

Set environment variable as below.

JAVA_OPTIONS=-Dweblogic.management.allowPasswordEcho=true

Saturday, June 11, 2011

How to assign normal privilages for any database user

You can revoke sysdba privileges from HR schema.

REVOKE sysdba from HR.

Normal HR schema will have privileges as below

GRANT CREATE SESSION TO hr;
GRANT ALTER SESSION TO hr;
GRANT CREATE DATABASE LINK TO hr;
GRANT CREATE SEQUENCE TO hr;
GRANT CREATE SYNONYM TO hr;
GRANT CREATE VIEW TO hr;
GRANT RESOURCE TO hr;
GRANT execute ON sys.dbms_stats TO hr;

You can find demo scripts at
$ORACLE_HOME/demo/schema folder

Top 25 ADF & WebCenter Resources

Tips and Tricks from Oracle Team

Thursday, June 9, 2011

Database as Custom Authentication Provider in Weblogic

Login/Logout Implementation

Security Implementation between ADF and SOA

After creating ADF application, follow the below link to configure security.



Once you are done with security setup with ADF, we need to configure keystore for weblogic domain.


Make sure that you have default-keystore.jks copied to $MW_HOME/user_projects/domains/<domain_name>/config/fmwconfig/

Now run the wlst.sh from $MW_HOME/oracle_common/common/bin/wlst.sh.

wls:/offline> connect()

Please enter your username [weblogic]
:weblogic

Please enter your password [weblogic] :

Please enter your server
URL [t3://localhost:7001] :t3://localhost:7101

Connecting to
t3://localhost:7101 with userid weblogic ...

Successfully connected to Admin
Server 'DefaultServer' that belongs to domain 'DefaultDomain'.

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.

wls:/DefaultDomain/serverConfig>

wls:/DefaultDomain/serverConfig> createCred(map="oracle.wsm.security", key="keystore-csf-key", user="owsm", password="welcome1", desc="Keystore key")
wls:/DefaultDomain/serverConfig> createCred(map="oracle.wsm.security", key="enc-csf-key", user="orakey", password="welcome1", desc="Encryption key")
wls:/DefaultDomain/serverConfig> createCred(map="oracle.wsm.security", key="sign-csf-key", user="orakey", password="welcome1", desc="Signing key")


If the credentials for keystore-csf-key, enc-csf-key and sign-csf-key already exist and their password is anything other than welcome1, update them, using the updateCred command, as shown below:

wls:/DefaultDomain/serverConfig> updateCred(map="oracle.wsm.security", key="keystore-csf-key", user="owsm", password="welcome1", desc="Keystore key")
wls:/DefaultDomain/serverConfig> updateCred(map="oracle.wsm.security", key="enc-csf-key", user="orakey", password="welcome1", desc="Encryption key")
wls:/DefaultDomain/serverConfig> updateCred(map="oracle.wsm.security", key="sign-csf-key", user="orakey", password="welcome1", desc="Signing key")

I am assuming that we are using single weblogic domain to test integration between ADF and SOA.

Restart both admin and soa server. You are ready to test!

Oracle UCM Workflow Setup

Wednesday, June 8, 2011

Weblogic Scripting Tool - WLST

Installing Oracle XE 11.2.0.0.5 , Weblogic 10.3.5 and SOA 11.1.1.5.0 in 64 bit CentOS 5.6

Make sure that you have downloaded all the required files for installation. I installed all the products in 64 bit CentOS 5.6 release.

Confirm your system type by following:
# uname -i
x86_64
# uname -a
Linux dhcpfbb8t-47.mdacc.tmc.edu 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/*release*
cat: /etc/lsb-release.d: Is a directory
CentOS release 5.6 (Final)

JDK 1.6 - jdk-6u27-ea-bin-b01-linux-amd64-18_may_2011.bin
Install jdk as root user and set the JAVA_HOME in the ~/.bashrc file

export JAVA_HOME=/opt/jdk1.6.27
export PATH=$JAVA_HOME/bin:$PATH

JDeveloper - jdevstudio11115install.bin
Install jdeveloper as root user and set the JDEV_HOME in ~/.bashrc file.

export JDEV_HOME=/opt/jdk1.6.27
export PATH=$JAVA_HOME/bin:$JDEV_HOME/bin:$PATH

Oracle XE - oracle-xe-11.2.0-0.5.x86_64.rpm
Download the above file and install as root user

rpm -ivh oracle-xe-11.2.0-0.5.x86_64.rpm

Now edit the ~/.bashrc and make the below changes.
export ORACLE_HOME="/u01/app/oracle/product/11.2.0/xe"
export PATH=$ORACLE_HOME/bin:$JAVA_HOME/bin:$JDEV_HOME/jdev/bin:$PATH
After the installation, you need to change the processes and sessions values using sqlplus.

sqlplus sys/<password>@<sid> as sysdba;

SQL> ALTER SYSTEM SET PROCESSES=900 SCOPE=SPFILE;

System altered.


SQL> ALTER SYSTEM SET SESSIONS=900 SCOPE=SPFILE;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Now start the database again by
/etc/init.d/oracle-xe start

Before proceeding further, you need to make sure that you have all the required os packages are installed.

yum install compat-libstdc++-296 binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21 libaio-devel-0.3.106 compat-libstdc++-33 unixODBC-2.2.11 unixODBC-devel-2.2.11 elfutils-libelf-devel

Also edit /etc/security/limits.conf and make the below changes
oracle          hard    nofile  4096
oracle          soft    nofile  4096

Create Schemas using RCU - ofm_rcu_linux_11.1.1.5.0_disk1_1of1.zip
Unzip and Run the command 'rcuHome/bin/rcu' an install schemas for SOA and webcenter.(Ignore warnings)

Oracle Weblogic 10.3.5 - wls1035_generic.jar
Now we are ready to install weblogic.
java -d64 -jar wls1035_generic.jar
Oracle SOA 11g
ofm_soa_generic_11.1.1.5.0_disk1_1of2.zip
ofm_soa_generic_11.1.1.5.0_disk1_2of2.zip

Download the above files and unzip to a directory. Now run the installater (./runInstaller) from Disk1.
Oracle UCM 11g
ofm_ecm_generic_11.1.1.5.0_disk1_1of2.zip
ofm_ecm_generic_11.1.1.5.0_disk1_2of2.zip
Oracle OSB 11g
ofm_osb_generic_11.1.1.5.0_disk1_1of1.zip


Oracle WebCenter 11g
ofm_wc_generic_11.1.1.5.0_disk1_1of1.zip

Setting up CentOS

Note - Login as root for all the commands below.

To enable telnet

yum install telnet-server

vi /etc/xinetd.d/telnet and change 'disable=no'

chkconfig telnet on

/etc/init.d/xinetd start

To enable FTP

/etc/init.d/vsftpd start
Starting vsftpd for vsftpd:         [ OK ]

If you want the vsftpd service to start and stop when recycling (rebooting) the machine, you can create the following symbolic links:

ln -s /etc/init.d/vsftpd /etc/rc3.d/S56vsftpd
ln -s /etc/init.d/vsftpd /etc/rc4.d/S56vsftpd
ln -s /etc/init.d/vsftpd /etc/rc5.d/S56vsftpd

Now before getting into the details of how to configure Red Hat Linux for root logins, keep in mind that this is VERY BAD security. Make sure that you NEVER configure your production servers for this type of login.

Configure Telnet for root logins

Simply edit the file /etc/securetty and add the following to the end of the file:

pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9

This will allow up to 10 telnet sessions to the server as root. 

How to add user to sudoers list
  1. Open terminal and type visudo
  2. Under the line, root ALL=(ALL)   ALL add <user> ALL=(ALL)  ALL
  3. Save
How to enable 'switch user' option

Tuesday, June 7, 2011

Templates to choose for the weblogic domain

When we are create domain for specific technology, we always get confused to select the additional libraries in domain configuration wizard.

Follow the below link to know what jars should be included:

Enable FTP with Ubuntu 11.04

open up a command line and typesudo apt-get install vsftpd. You will be required to type in the root password and after that, just follow the instructions vsftpd gives you in order to install it

Get to the file browser and type /etc. Next scroll down and double click on a file called vsftpd.conf. Remember that lines that start with a '#' are commented out:  
  1. Disable anonymous access: Change the "anonymous_enable" setting to NO
  2. Change the "local_enable" setting to YES
  3. Also make sure that local write is enabled.
  4. Restart the FTP server to enable your changes: in a shell window, type: sudo /etc/init.d/vsftpd restart

Oracle XE 11g Beta has been released

It sounds like an April 1st joke, the long awaited Oracle XE 11g Beta Version, but it is not. On OTN you can download either a Windows Installer or a Linux Installer.
In short the limitations of XE 11g:

* only one CPU is used
* only one installation of XE per Computer
* up to 11 gigabyte of user-data is allowed ! (XE10 had only 4GB)
* only 1 GB RAM is used (at most)
* no HTTPS with the built in EPG
Link to the : installation guide
Link to the : download location

The only thing you have to enter during the installation was a password for the SYS and SYSTEM DB Users, the rest went with the defaults. Just a couple minutes later XE 11g was up and running :-)

The first thing i did was allowing remote access to the new and shiny graphical admin interface. Simply enter this command “EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);” when connected to SQLPLUS as SYS or SYSTEM.

With the URL http://<hostname>:8080/apex/f?p=4950 you can start the graphical admin interface of your XE 11g database.

Try it yourself, It looks really great!

Monday, June 6, 2011

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library - libmawt.so

When installing any fusion middleware products, if the java run time has mismatch with underlying architecture, then you will get the below error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library

libmawt.so

 

Sample Scenario:-

When I tried installing rcu, I got the above error. The reason is that,

it was always using the jdk which comes with rcu bundle by default. Since

my machine has 64 bit architecture and the default jdk is made for 32 bit,

I got the above error.

Solution:-

Install 64 bit amd version and update the JAVA_HOME. If rcu still uses old jdk

path, replace the jdk folder of rcu with latest one.

Installing Oracle Express Edition on Ubuntu 11.04

I almost spent the half day of installing Oracle XE database in Ubuntu 11.04 and after going through many blogs, I found better way to install it.

Remember that there is no direct installation file available for ubuntu i.e., debian packages. You get only rpm version of oracle-xe installation file from oracle.com and you need to tweak to install as debian.

First, query for existing oracle packages and uninstall old versions of database.

dpkg-query -l | grep oracle

Now you can uninstall as follows

dpkg -r <package_name>

Now follow the below article to install as deb file.





Saturday, June 4, 2011

How to start Linux in command line or gui mode

When I installed CentOS, by default it landed in command line mode. To make gui mode as default during system startup, do the following as root user.

Change this line in /etc/inittab
id:3:initdefault:
to
id:5:initdefault:


You can also use startx to switch to gui mode.

User not found in Identity Store : Webcenter Integration with External LDAP like OID (or AD)

Very good post about how to integrate OID with weblogic server.




Friday, June 3, 2011

Install sun-java6-jdk on Ubuntu

I just had trouble to install the Sun Java6 JDK after updating to Ubuntu 10.04. The problem was that the system couldn’t find the package sun-java6-sdk and apt-get gave me the message:

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

What I did to solve this problem was to add a new source

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
After that a normal

sudo apt-get update
sudo apt-get install sun-java6-jdk
it worked for me.

Friday, May 27, 2011

UCM Import/Export

It is always fun when you are involved in migration. Ok, here is there situation. We want to move the ucm content from one server to another server.So what I am supposed to take care?

Before jumping into action, you need to understand the state of source and target machines. In my case, my target ucm server has some content and I want to upgrade the targer with source content.

Now the question is, is it ok to upgrade just content? definitely NO. You need to make sure that source & target servers are synchronized with meta data, security (roles & accounts),workflow definitions etc. If not, you should do that first by using 'Content Migration Utility' or from admin console, you can use content migration section to do it.

The steps are,

1. Migrate meta data,security,workflow using content migration utility.
2. Migrate content using archiver using admin applets from admin console.

Let's see how to migrate using content migration utility:-

1. Go to administration console of source machine.
2. Create or Update configuration migration template. Go to Administration -> Config Migration Admin -> Configuration Templates
3. If there are any previously used template, then edit the template to see the configuration. 
4. Otherwise, ‘Create New Template’ from Action drop down.
5. We are going to edit existing template.
6. Click on ‘Content Server Sections’ to review the selected items. You can go to ‘Preview’ from Actions drop down to see complete picture. 
7. Now click on ‘Export’ to export the selected items to bundle. You will be redirected to ‘Latest Action’ page where you can see the progress. 
8. Wait until you see ‘Finished in the message. 
9. Now go to ‘Administration -> Config Migration Admin -> Configuration Bundles’. 
10. You will see the bundle created with recent date & time.
11. Click on ‘Download’ from the drop menu and save the zip file in local file system.
12. Now go to the target server. Go to Administration ->Config Migration Admin->Upload Bundle. 
13. Now upload the zip file which was downloaded previously and select the options as shown below. And click on ‘upload’.
14. In the Configuration Bundles page, click on the one which was just uploaded. 
15. Now select drop down to preview. 
16. Select ‘import’ from drop down.
17. You will be redirected to ‘Latest Action’ page and you can see the progress of import. 

We are done with meta data migration. Now we can migrate content using archiver. I assume that you have already defined outgoing providers from stage to production.

1. Go to ‘Administration ->Admin Applets’. Then click on ‘Archiver’. 
2. In the archiver, Go to ‘Options -> Open Archive Collection’. Then select the collection you want to use. You should be able to see production instance in the list and select the instance you want to use & click ‘Open’. 
3. Go to ‘Edit -> Add’ to add new or update existing archive. Click ‘OK’.
4. Now newly created archive will be highlighted and review ‘Export Data’ tab settings. Click on ‘Edit’ button and select ‘Custom Query Expression’.
5. Let’s use custom query to fetch content created after 07-Mar-2011. The query will be dInDate >  {ts '2011-03-07 00:00:00'}.   
6.6. Select ‘Export Revisions with Release Date later than most recent Export date’.