Saturday, May 30, 2009

I haven't disappeared!

I've been working on several interesting items. Unfortunately, they don't all have neat little fixes...

I've been working on migrating an Oracle database from Windows with direct attached storage to Linux with network attached storage.

On a more interesting note, I've gotten Mercurial ( a distributed version control system ) working under IIS!!!

With this, I won't need to fire up a Linux virtual machine to handle version control. (Yes, I know Apache runs under Windows. I was never able to get Mercurial properly configured under Apache.)

Wednesday, May 13, 2009

ODP.Net 10 - Data Change Notification


It was a perfect storm.

Version 10.... of Oracle's ODP.Net seems to misbehave... IF

You use data change notification
-- and --
hook up a delegate
-- and --
You have a CLOB in the table being watched

The latest (beta) release of 11.... works fine. Guess what? Too many other things are using 10 and would need to be retested. No time now.

What to do? Today I'll be trying a few things. (In order of nastiness)
  1. Create a timer to check for changes. I'll still hook up the DCN to the database, but instead of responding to the change immediately, I'll use the timer to check for changes (ON MY TERMS)
  2. If that doesn't work, I'll split the CLOB off to another table
  3. If THAT doesn't work, I'll have to poll the database and compare the results to what I already have in memory.
I'll let you know how it works out in the end...

-- Edit 5/30/2009 --
The problem turned out to be the connection. My connection to the database kept closing. Since I was trying to optimize my system, I opened the connection at the beginning and expected it to remain open. (It didn't) Any way; when you try to use a database connection that is no longer valid, you do not always get an error message or an exception. You get !@#$% ( I mean "a hung process")

Saturday, May 9, 2009

Installing VMware on Windows

Registration and Download
  1. Go to and register for download.
  2. When your e-mail arrives Write down the serial number then click on the link provided
  3. When the download finishes, double-click on the executable and W A I T ....

When the installation wizard FINALLY comes up
  1. press next
  2. Accept the license, then press next
  3. Select where you want to install the SOFTWARE. This does NOT have to be where you will create the virtual machines
  4. Press Next
  5. Select where you want to create the virtual machines. If you have a second hard drive, I would put the images on a different drive than the software
  6. Change the FQDN to localhost
  7. If you are on Windows XP and use "Fast User Switching" (and you want to continue to use it), uncheck "Allow virtual machines to start and stop automatically with the system". More on this later.
  8. Press Next
  9. Select which shortcuts you want. If you aren't going to be using a virtual machine all the time, I'd uncheck Desktop and Quick Launch toolbar
  10. Press Next
  11. Press Install... And W A I T some more.
  12. When the installation is almost over, you will be presented with a registration screen. It says it's optional and you can do it later. Don't believe it. I spent a full day trying to make an installation work, after I did this. I couldn't get the registration number to work for anything. Oh, by the way, you cannot use the system without entering a registration number. Enter your registration information NOW.
  13. Press the Enter button
  14. Press finsh
  15. If prompted, reboot your computer.
If you did not check "Allow virtual machines to start and stop automatically with the system"
1. Create a batch file named "Start VMware" containing the following:
net start "VMware Host Agent"
Save the file and create shortcuts on the desktop and/or the start menu pointing to this file. Clicking the link will start the required services. If you don't start the services, you will not be able to start any virtual machines.

2. Create a batch file named "Stop VMware" containing the following:
net stop "VMware Host Agent"
Save the file and create shortcuts on the desktop and/or the start menu pointing to this file. Clicking the link will shut down the services previously started. If you don't stop the services, you may corrupt one or more virtual machines.

Using VMware
  1. If necessary start the services (see above)
  2. From the start menu select VMware --> VMware Server --> VMware Server Home Page
  3. Your browser will open. If you are presented with a warning about a questionable certificate, you should accept it.
  4. You will eventually see a screen prompting you for your ID and password. Enter the ID and password you used to log in to Windows.
  5. When finished remember to stop the services (if you started them manually)
You can start creating virtual machine images now. (And I'll describe that in a future post)

Friday, May 8, 2009

Oracle XE on Ubuntu

Oracle XE on Ubuntu

Almost ANY left over machine can run Oracle XE on the popular Linux distro Ubuntu. Even if you've never used Linux, you can have a working database in just a few hours

This post will assume that you've already install Unbuntu Server 9.04. It goes by the cutesy name "Jaunty Jackelope".
During the install you should have created a user for Oracle - ID = oracle, password = oracle. All of the commands in this post will follow this assumption.

If you have less than 1GB of memory, you will need to create a swap file, before starting the real install:
sudo sh
dd if=/dev/zero of=/swpfs1 bs=1M count=1000
mkswap /swpfs1
swapon /swpfs1

Switch to the root account:
sudo sh

Add the download to the list of update sources:
echo "deb unstable main non-free" >> /etc/apt/sources.list
If you are comfortable with vi you can use it to perform the above action manually
vi /etc/apt/sources.list
scroll to the bottom of the file and press I (for insert) and type the line below
deb unstable main non-free
Press Escape, then
:wq and press Enter

Import the security key from Oracle:
wget -O- | sudo apt-key add -

Update the packages:
apt-get update

Install Oracle
apt-get install oracle-xe
That's it! This is completely unexpected, but simple

Configure Oracle
/etc/init.d/oracle-xe configure
When prompted for the Oracle Application Express port, accept the default 8080 by pressing enter
When prompted for the database listener port, accept the default 1521 by pressing enter
When prompted for the SYS and SYSTEM password, enter a password of your choice and press enter
When prompted to verify the password, enter the same password as above and press enter
When asked if you want the database to start with the system, accept the default y by pressing enter

Make sure you can still access the system:
Installing oracle actually removed your permission to become root. It's time to put it back, BEFORE you reboot.
echo "# let oracle sudo as root" >> /etc/sudoers
echo "oracle ALL=(ALL) ALL" >> /etc/sudoers

Become yourself again (not root)

Set up your environment:
echo "export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server" >> .bash_profile
echo "export PATH=$ORACLE_HOME/bin:$PATH" >> .bash_profile
echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" >> .bash_profile
echo "export ORACLE_SID=XE" >> .bash_profile
echo "export LD_LIBRARY_PATH=$ORACLE_HOME/lib" >> .bash_profile

Apply your changes
source .bash_profile

You now have a working Oracle installation!!!!

BUT... you're not through yet.
Because you're running server, you don't have all of the GUI goodness. You have to access it remotely, but
first you have to tell the system to allow remote connections
Start SQL*Plus and log in as SYSTEM:
sqlplus system
Enter the password you defined earlier
At the SQL prompt enter

sudo shutdown -r now

NOW you're finished.

Future posts will cover installing the client, and configuring for use under VmWare