Thursday, November 5, 2009

Wow! Turn your Win7 laptop into a wireless router!

Just ran across this little gem! If you have a Windows7 laptop with a wireless adapter you no longer need a router... well that might be an overstatement, but you can turn your laptop into a wifi hotspot in a pinch.

This came in handy recently at a client site where we had only one network drop in the conference room. I plugged in my laptop, and boom everybody else in the room could share the connection over wifi!!

Learn more at Tom's Hardware or just head straight over to Connectify to download the beta.

In my case I had to download the latest WiFi adapter driver from Intel's web site in order to make it work.... but then it was a piece of cake to setup.

Friday, October 30, 2009

Installing Informatica PowerCenter 8.6.1 Server on Red Hat / Centos (including VMWare)

What a great thing VMWare is.  If you aren’t using it yet, you are missing out!

This blog will explain how to get an evaluation / developer version of Informatica Powercenter 8.6.1 along with how to install and configure the software under Red Hat Enterprise 5.3 Community Edition (aka Centos).

Downloading Informatica PowerCenter

Unfortunately Informatica has not seen the light with respect to allowing developers or consultants to have access to a trial or evaluation version of PowerCenter.  In my opinion this really hurts their market growth by limiting the number of people that are championing their product.  Fortunately, Oracle Corporation  gets it and has been providing evaluation software for free for many years.  How does this help?  Well, Oracle Business Intelligence Enterprise Edition includes Informatica PowerCenter!

To download Informatica, go to http://edelivery.oracle.com. Once you get through the license agreement and export restrictions, choose "Oracle Business Intelligence" in the Product Pack drop down box, and then choose "Linux x86" in the Platform drop down box. Select "Oracle Business Intelligence (10.1.3) Media Pack for Linux x86" and click continue. Download "Oracle Business Intelligence Suite Enterprise Edition 10.1.3.4.1 for Linux x86 (Red Hat / Oracle Enterprise)" - part #V16379-01.

Pre-Work

First you need to have an Oracle database repository for Informatica Server to use. If you need to create one, see my post on how to install Oracle 11g on Linux.

Next you need to create a user for the Informatica repository. If you want the repository stored someplace other than the 'users' tablespace, then you will need to modify the create user statement below.

sqlplus / as sysdba

SQL> create user inf identified by inf default tablespace users temporary tablespace temp quota unlimited on users;

SQL> grant connect, resource to inf;

su -

useradd inf
passwd inf
mkdir /opt/informatica
chown inf:inf /opt/informatica
chmod 755 /opt/informatica

Installing

Logon to Centos as the Informatica user you created above (inf) and then navigate into the downloaded and unzipped software directory and find the program "install.sh" and choose GUI install. In my case I accepted the default language of en_US.UTF-8 which worked fine. When you get to the license key prompt, navigate into the Informatica install directory and locate the file "Oracle_All_OS_Prod.key" and click next.

On the install location screen, change the home directory installation directory to /opt/informatica/PowerCenter 8.6.0

Accept remaining defaults

Choose to create a new domain

On the Configure Database window:

Database Type Oracle
Database URL localhost:1521
Service Name orcl.localdomain

On the Configure Domain window, you can use any names or values you want for your Informatica domain.  Just make sure you write down the values as you will need them later.  This is where you want to use your actual host name and not “localhost” or else you will have problems down the line.

Domain Name domain01
Host Name centos
Node Name node01
Domain Port Number 6001
Domain User Name admin

Voila!  After the installer completes your Informatica PowerCenter 8.6.1 server will be up and running.  Simply navigate to http://centos:8443 and logon with the admin username and password.

Installing Oracle 11g on Linux / Centos (Including VMWare)

An Oracle database can be a very handy thing to have around. I do database design and development, Business Intelligence, Data Warehousing, and also database administration. People often ask me how they can get an Oracle database up and running easily. Here is the answer.

I have become a huge fan of VMWare. The VMWare Server version is free software that can be downloaded from www.vmware.com. My laptop has VMs available for Windows 7, Windows Vista, Windows XP Professional, Windows Server 2003, and Centos 5.3.

While the Oracle database can be created on Windows 7 or Windows Vista, the business intelligence tools I use cannot. Specifically Informatica Server is not supported on any non-server version of Windows. So I chose to create a simple default database configuration on Linux for the purposes of getting Informatica Server up and running.

If you are using VMware see the section at the end with specific VMware tips on how to create and use your virtual machine most effectively.

Installing and Configuring Centos

When you install Centos, the default is just a desktop configuration. Make sure you check the box to install the Server components as well. Because I am running on VMware and don't have any worries about attackers getting into my virtual machine, I am disabling the firewall and disabling SELinux. By doing this you greatly simplify the process of connecting from your host machine to the VM. If you choose to not follow this advice, you will be on your own in figuring out security or network connection issues. Also tick the box that allows you to install software from the Centos Extras repository.

Create Oracle User Account

You should run Oracle as a separate user account under Linux. To prepare for the install, we create a new group called "dba" and a new user called "oracle" as follows:

groupadd dba
tail -1 /etc/group
dba:x:501:
useradd -g 501 oracle
passwd oracle

Changing password for user oracle.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Create Oracle Software Installation Directory

Oracle by default will install software in the Oracle user's home directory. This poses complications down the road and is not standards compliant. You should create a new directory as the "Oracle Base" which is where the database software will be installed.

As the root user:

mkdir /opt/oracle
chown oracle:dba /opt/oracle
chmod 755 /opt/oracle

Oracle by default will install software in the Oracle user's home directory. This poses complications down the road and is not standards compliant. You should create a new directory as the "Oracle Base" which is where the database software will be installed.

Install Additional Centos Packages

In order to install Oracle, there are a variety of extra packages required on Centos. To install those extra packages, simply open a command line prompt as root and run:

yum install 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

You will be prompted to confirm, and at each prompt say YES. You will see each of the libraries being downloaded first, then you will be prompted about trusting the key signature of the software, then you will see the downloaded libraries being installed. This installs all of the necessary Oracle files as well as any dependent files. Note that yum is using your internet connection to download the libraries, so if you don't have access to the Internet this will fail.

Adding Swap Space

Oracle likes to have lots of memory and swap. If you are running in VM and did a default Centos installation, you should increase your swap space by 2GB as follows:

dd if=/dev/zero of=/swapfile2 bs=1024 count=2097152
mkswap /swapfile2
swapon /swapfile2

Add this entry to the /etc/fstab file to make the swap automount:

/swapfile2 swap swap defaults 0 0

Downloading Oracle

Download the media from http://e-delivery.oracle.com. Once you get through the license agreement and export restrictions, choose "Oracle Database" in the Product Pack drop down box, and then choose "Linux x86" in the Platform drop down box. Choose the most appropriate database release for your needs, in my case I chose "Oracle® Database 11g Release 2 (11.2.0.1.0) Media Pack for Linux x86." When you get to the next screen you will see the download is 2 parts, download both. Unzip the files into whatever directory you choose, and make sure the files are accessible by the oracle user account.

Installing Oracle

Open a terminal session and become the "oracle" user:

su - oracle

Navigate into the the folder that you downloaded and unzipped the Oracle software to. You will find a subfolder named "database", navigate there and execute the commands:

export ORACLE_BASE=/opt/oracle
./runInstaller

Tips on the Installer Prompts
  • If you don't have an Oracle Metalink support account, you will have to uncheck the option of receiving updates via My Support
  • Choose "Desktop Class"
  • When you get to the prerequisite checks you will get errors. Click on "fix and run again" which will generate a shell script for you to run as root to correct the kernel parameters. After running this script you should be down to warnings on swap and memory. Click ignore all.
Post Installation

Run /opt/oracle/product/11.2.0/dbhome_1/root.sh as the root user.

Database Startup & Shutdown

After installation, your new database should be running. To verify, logon as the oracle user in a terminal session and execute ". oraenv" (that's dot-space-oraenv). At the prompt, type the database name you specified in the installation (default is orcl). Now you should be able to logon to the database as the sys account by running "sqlplus / as sysdba" -- if that doesn't work, it's troubleshooting time.

To startup the database & listener:

1. lsnrctl start

2. sqlplus / as sysdba
startup;
exit;

To shutdown the database & listener:

1. sqlplus / as sysdba
shutdown immediate;
exit;

2. lsnrctl stop

VMware Specific Tips

Creating the VM

If you are running on a real Linux server then this step can be skipped. If you are getting all of this running on VMware, like me, then make sure you allocate 1GB of memory and at least ??GB of disk space to the VM. I am using Centos, which is the community version of Red Hat. So when creating your VM choose Red Hat Enterprise 5.3. Configure two network adapters. The first network adapter is host only, which puts your VMs and host onto a private network segment. These IP addresses are DHCP assigned by VMware which means the IP addresses don't change frequently. The second network adapter is bridged. Bridged network adapters look like a separate network adapter on your network. They will request a DHCP IP address from your router, and the subnet of the IP address will be the same as the subnet of your PC's IP address. This bridged connection gets you outside to the internet.

Important Note: Linux will take the DNS settings of the last network adapter brought up. This is why your bridged network connection must be 2nd, otherwise Linux tries to use the host-only network which has no DNS server.

VMware Tools

You must install VMware tools into your Linux VM. This gives you more options for display resolutions and sound, but more importantly it must be re-run anytime you modify you virtual server configuration. For example, if you add a network interface to your virtual server, but you don't re-run the config tool, your network probably won't be working like you want it to!

Once you mount the VMware tools ISO image, just click on the RPM file. Configure VMware Tools for your kernel by executing /usr/bin/vmware-config-tools.pl. Once installed, /usr/bin/vmware-toolbox can be used within an X session to make changes.

Networking Explained

As suggested, create two networks on your VM: bridged and host-only. Bridged network adapters use the host network card, but emulate a separate network card on the same network with the host. Bridged adapters will request a DHCP IP address from the same router as your host PC, and the subnet of the IP address will be the same as the subnet of your PC's IP address. This bridged connection gets you outside to the internet. The second network adapter is host only, which puts your VMs and host onto a private network segment. Although these are still DHCP assigned, the DHCP server is VMware (instead of the host network router) which means the IP addresses don't change frequently. I would also suggest using the "Manage Virtual Networks" component of VMware to change the lease duration on IP addresses assigned by the VMware DHCP server to a very high number. Doing this prevents you from ever getting a different assigned IP address on your VM host-only network.

Once you have your network adapters on your VM then you need to make some entries in the hosts file on Centos. We will be using the host-only network interface to communicate internally to the VMware. With VMware up and running you will find you have additional virtual network adapters in your device list on your host operating system. I am using Windows Vista, so this example demonstrates how to find the information for Windows. Substitute the appropriate commands if you host operating system is not Windows.

Open a command window prompt and type the command "ipconfig". You may see several screens of data, but you are looking for the network adapter VMnet1 as below, specifically the IPv4 Address. This will show you the IP address of your host computer on the host-only network. This is the IP address that you must use in order to access your host computer from within the VM.

Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::3929:19ce:278d:feaa%14
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Now go to your Centos VM and we are going to look at the network configuration of the virtual machine. Open a terminal window and run "/sbin/ifconfig -a" command. You are looking for the IP address that is assigned to your virtual machine in the same subnet mask as your host VMNet1 adapter (above). You will be looking for data similar to below:

eth0 Link encap:Ethernet HWaddr 00:0C:29:D2:80:E5
inet addr:192.168.56.128 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed2:80e5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2994 (2.9 KiB) TX bytes:8806 (8.5 KiB)
Interrupt:75 Base address:0x2024

In the world of VMware these are your IP addresses you need to use and know about. To make your life simpler with Oracle configuration, you should create new entries in your centos hosts file that correspond to these names. DO NOT configure the database or SQLNet using IP addresses or "localhost" as this will cause you many problems down the line. So logon to centos as root and add the lines in bold red to your /etc/hosts. The lines in black already existed in my default /etc/hosts file.

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

192.168.56.1 vmhostname.localdomain vmhostname

192.168.56.128 centos.localdomain centos

Accessing Host Shares

You will need to make the Oracle software visible to your VM. So you have a couple of options. You can download the software using the browser within your VM, or you can download the software using your host operating systems and share it with the VM. Sooner or later you are going to want to transfer files from your host to your VM, so I suggest setting up the shared filesystem.

To make a shared filesystem available within a Linux VM, you need to first share the filesystem in windows. Then, as root from your VM, you mount the share like this:
mount -t cifs -o username=winuser,password=winpassword,dirmode=0777,filemode=0777 //vmhost/share_name /mnt/linux_mount_point_name
Now you can navigate to /mnt/linux_mount_point_name on centos and see the contents of the windows share. This share is read-only from Linux, which I haven't bothered to debug why files cannot be written to the share from Linux.

Note: For Samba to work, the host name you defined in the /etc/hosts file for your VM host machine must match the actual host name reported by windows, or you will get

Thursday, October 1, 2009

Virtualization on my laptop: I've seen the light!

Recently I had some colleagues telling me about how great VMWare is for virtualizing your laptop. Sure I've heard of companies using VMWare to virtualize servers -- my former company used it pretty extensively in the Windows server environment. But how does slicing my laptop up into virtual machines help me?

Well, I've quickly learned a few of the benefits:

Having multiple operating systems running on a single machine simultaneously rocks! My laptop came pre-installed with Windows Vista x64. Well as most have learned the hard way, not all Windows software works properly under a x64, software is mostly written and tested for 32 bit installation. So I created a Windows 7 32 bit virtual machine. And most of my background is in UNIX/Linux, so to keep my familiar surroundings I also have a virtual machine running Centos 5.3 (RedHat) Linux. And I don't have to reboot my machine in order to do something in Linux, and then re-boot again for Windows7, and then again to get back to my office applications running on Vista x64. I have access to everything at once.

Okay, so you think that seems pretty cool. If you are like me, maybe that's not enough to convince you to figure out how to download, install and configure VMWare. Is it really going to be worth it? Well consider this. Once you have virtual machines created, you can copy and clone them anywhere you want. Stick them on an external hard drive and move them over to another computer, or carry them with you to a client site. Also think about this, how many times have you installed some software and regretted it? Either because it drastically slowed down your computer, or it introduced some driver conflict or virus? VMWare also supports Virtual Machine snapshots. These snapshots allow you to rollback any changes made to a virtual machine. Or if you have cloned the virtual machine, then simply copy the clone back and your changes are "undone" magically!

So, gosh, wouldn't this run like mega-slow? Isn't there a lot of overhead? Amazingly, no, there isn't. When you create a virtual machine you allocate a certain chunk of memory and processor power to the virtual machine. It doesn't seem to impact the host machine (in my case the base Vista x64 O/S) and the virtual machines are fast. I have had my base O/S plus Windows7 plus Centos up and running with no problems. The efficiency is amazing.

Here's how I'm using VMWare. I would love to hear some comments from others about what they are doing with it. I'm sure I will be creating more VMs in the coming weeks and will update my post with new learnings.

Base OS: Vista x64 Home Premium with only essential productivity apps (like office)
Windows7 VM: Windows based development software including Visual Studio, Oracle 11g, Informatica
Centos 5.3 VM: Linux based development software including Oracle 11g, php, ruby