Archive for June, 2007

Problems with Oracle Migration Workbench

Database vendors like to bash each other, sponsoring dubious “objective industry studies” to “prove” they are better than others. All of them do it. In my opinion, Oracle is particularly bad in this regard, compared against IBM DB2 or Microsoft Sql Server. Talking about “unbreakable Oracle” and software full of bugs, and in many cases you need to pay the Metalink membership to simply get to know that the issue you are dealing with is a bug. That is not to say Sql Server and DB2 don’t have bugs in their software, though.

Each of them wants you to convert your database to their platform. To that end, they provide some program to help you along. Oracle has a thing called Oracle Migration Workbench. Sql Server has something similar called Sql Server Migration Assistant.

More often than not, marketing people from those companies will tell you how great their migration program is. That it is easy to migrate, you will see performance improvement, etc. Don’t believe them.

A couple of months ago, I worked on a project to migrate a database from Sql Server to Oracle. This database has a lot of stored procedures, user defined functions, and linked server stuff. I talked to Oracle people, and they recommended their own Migration Workbench, with Sql Server plug-in. I downloaded them and started working.

Basically, the Migration Workbench tries to go through database code in T-Sql. For code that uses built-in T-Sql functions, the Migration Workbench creates functions with the same name in Oracle, and try to writes something similar in PL/Sql that makes an attempt to do what T-Sql function does. I didn’t look too deep into this, but I am suspicious at all of them. The reason I didn’t look too deep into them was that the whole effort was derailed by a bigger problem. Let me explain.

In T-Sql, all variable names start with @ symbol. In fact, in many places, variable names are simply column names prefixed with the @ symbol. This can be pretty easy to read. And it actually works very well.

However, PL/Sql variable names don’t follow that convention. So, as Migration Workbench goes through T-Sql stored procedures, it simply strips off the @ symbol from the variable names. This basically renders all the code useless.

This is just very, very dumb. Oracle is a multi-billion dollar company, and you would think they should know this. Instead of stripping off the @ symbol, it could replace it with some kind of prefix. But it does not do that.

Another problem is with the identity field. Once again, one would expect that the Migration Workbench converts it to Oracle sequence, but it doesn’t. It changes that to NUMBER.

Eventually, the project was canceled. The moral of the story: migration from one RDBMS to another is not as easy as it sounds. It is doable. Sometimes it is probably easier to just write everything from scratch.

Comments (2)

Traveling observations, first half of 2007

Most cab drivers in big cities in the US are foreign born. I’ve taken taxi rides to and from airports a few times this year. Only once did I encounter an American born driver. He is African-American. I assume he was born here, since I didn’t ask. The rest were born in Uganda, India, Nepal, Serbia, Romania, Puerto Rico, Turkey, Cameroon, and other countries. When I am not tired and the mood is right, I usually try to strike a friendly conversation with the driver. I also understand that they might be tired of answering “where are you from” questions already, so I don’t always ask that question.

—–

During a two-week hotel stay in a Washington DC suburb, I used the hotel shuttle bus extensively. The driver’s name is Jerry. I think that might be his adapted English name. We always talk during the rides. He seems to be a nice fellow. I don’t agree with everything he says, but the ride was always pleasant.

Despite having lived in the US continuously for at least 14 years, I can see he still has a lot of trouble with English. Sometimes I have trouble with English too, but not as severely. Some hotel receptionists are not very friendly to him, probably because of that. During one ride, he had trouble explaining to one of the receptionists where he was. She hung up on him. Jerry then tossed the cell phone into a cup holder, and shook his head in frustration.

I asked where he was from. He told me he was from Indonesia, almost apologetically, and quickly added he was born in the US when his father worked in the Indonesian Embassy. The last time he visited Indonesia was 14 years ago. I asked gently if he ever wants to go back and visit, he paused and didn’t answer.

Jerry functions as a deacon in his church. He asked if I read the Bible and if I am a Christian. I didn’t tell him that I am an atheist, but I did tell him that I have read the Bible, although not from cover to cover. I told him that I like some passages in the Bible.

The conversation somehow turned to Islam. Jerry does not like Muslims. He says they are terrorists and they kill people. I didn’t say anything. Later on I thought I should have expressed my opinion, that there are good and bad people in every country, every religion.

The last time he gave me a ride, he knew I would fly home that day. At the end of the trip, he cautiously recommended that I read the Bible when I get back. I smiled and said “thanks”. I appreciate the way he said it, because it seemed to come out of his good will and there is no hint of any evangelical attitude. Sure, I may browse through the Bible once in a while, but I definitely want to read more on other religions. Someday I would read the Koran, because I virtually have no knowledge of it, much like I didn’t have any knowledge of Christianity when I came to the US more than a decade ago.

—–

The Ugandan cab driver is a nice, soft-spoken fellow. I rode with him twice. The second time I was in his car, he told me he gave ride to two brothers with guns early that morning. They brandished the gun to him, asked him to stop at convenience stores, and boasted their deeds. He was still nervous because of it when he picked me up. From my conversation with him, I thought he dealt with it very well: cool, analytical, and level-headed.

I use the same cab company quite a bit. So the next time I used it, I mentioned this Ugandan driver to a different driver who picked me up. He told me that the Ugandan driver has a Master degree in psychology or something like that from a university in Ohio.

—–

Lately, I noticed a few cars with Indiana license plates having “In God We Trust” on them, with American flag as background. Indiana is Illinois’ neighboring state, and there are people living in Northern Indiana who work in Chicago. So it is not unusual to see cars from Indiana. Subconsciously, I remember asking myself: Did I see what I thought I saw?

Last week I drove to Indiana for business. I can see that the “In God We Trust” plates are a fixture on Indiana highways. So my eyes were not lying to me in the past after all. I googled that on the web. It turned out the “In God We Trust” plate issue was brought up in the State Legislature before and was finally approved last year. Not only that, it is free to motorists, paid for by the state government. For other special plates, such as for arts, education, and other causes, you have to pay extra to get it.

One acquaintance, who lives in Indiana, told me that although Indiana is in the Midwest geographically, culturally it feels more like a Bible-belt state. Maybe this is one of the reasons he said that. I didn’t ask him about it, because the third person in the conversation, who is a Mormon, didn’t appear to be very comfortable with his discussions.

—–

One evening, a Romanian taxi driver picked me up. We had a nice conversation. I told him that I was from China. We talked a little about Nicolae Ceausescu, his life in the US, my life in the US, etc.. I commented that China and Romania were good friends when both countries were in the communist bloc.

He quipped: “Those are good ol’ times.”

We both had a good laugh.

Comments (5)

知了进车

到美国很多年来都没见过知了(cicada),还以为这儿没有。今年夏天到了,才知道美国的爱叫的知了(magicicada)是13或17年才出一次。今年正是这种知了的出没年。怪不得我以前没印象呢,因为我是1995年来美国的,而这种知了这些年里都在蛰居。查了一下字典,它并没有对应的中文名字,就暂叫它“美蝉”吧。

我家乡的知了可是年年都来。它们嗓音大,个子也大,好像不怎么爱飞。美蝉嗓子也不小,但个子相对小,非常爱飞,并且飞到公路上,到处都是。我想它们被撞死或轧死的肯定不少。

我小时候吃过没出壳的腌炸的知了。刚才在网上查了查,原来吃知了的国家也不少。

今天中午我开车出去。天气热,我把车窗打开。一开始我什么都没觉到,但忽然间觉得有什么东西在脖子上爬,用手一模,那厮立即飞了。原来是美蝉,看来它是把我棕色的脖子当成树干了。

美蝉并没有飞出车外,相反,它唧哩扑腾地在后座的空间里绕了几圈,看来是不知道怎么出去。我赶紧打开所有的车窗,还是不行,因为我不时听到它撞击车窗的噪音。我想它肯定是在后窗和后座靠背之间的狭小空间里。

我停了车,美蝉果然在那儿。赶紧伸手去够。够得着,可不想伤害它。从车厢里拿出冬天用的刮雪刷,刚把它够过来,又立即又往后窗飞。这傻冒一门心思认定它可以飞过后窗,但屡战屡败。干脆把所有的车门都打开,所以它自己飞出去的机率大一些。可这样一来,外面美蝉的同党飞进的机率也大,最后只留一个门开着。

就这样和它对峙了一会儿。最后终于下了狠心,用手抓住了美蝉的翅膀。原先还以为会造成其翅膀脱节,但美蝉居然没事儿。赶紧把它放飞了。

Comments (6)

Failed Oracle 10g R2 Express Linux Installation Notes

My first ever computer, the 10-year old HP Pavilion 4455 desktop, purchased after I finished my master degree in Economics, has seen very limited action in the last few years. My better half had suggested that I donate it away, since we really don’t have enough space to put it, but I refused, because I always thought I would use it in the future. Now I am working on my own, so I will need some spare machines to mess around with as my sandboxes. I finally got some time in the last two days to show it some love.

I decided to load Linux on it. Neither Ubuntu 7.04 nor Ubuntu 6.01 worked. (They might work better for newer desktops, I just don’t know) I have Fedora Core 2, so I installed that. I know the latest Fedora Core is version 6. I am kinda old school in this regard. Anyway, Fedora Core 2 worked on this computer.

I then decided to load Oracle 10g R2 on it. Here is a brief note of my process. It failed, because this machine has 160 MB of memory, not reaching the 256 MB required. I think I will purchase some memory tomorrow and try again.

1. Verify dependencies

[root@localhost haidong]# rpm -i oracle-xe-10.2.0.1-1.0.i386.rpm  --test
error: Failed dependencies:
        libaio >= 0.3.96 is needed by oracle-xe-10.2.0.1-1.0

2. Downloaded libaio source. libaio is Oracle’s library for asynchronous IO. configure failed, therefore I couldn’t compile and install it. Below is the last output on the screen.

ecking for libaio >= 0.3... no
checking for libaio 0.1... no
configure: error:
*** libaio is required.

3. I didn’t bother to look through the configure log file. Instead, I searched for “rpm libaio fedora core 2″ and got this link:

http://download.fedora.redhat.com/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/

Downloaded the package for libaio.

[root@localhost haidong]# rpm -ivh libaio-0.3.99-2.i386.rpm
warning: libaio-0.3.99-2.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...                ########################################### [100%]
   1:libaio                 ########################################### [100%]

4. Install. It failed. I will try again, if/when I get more memory for this old machine.

[root@localhost haidong]# rpm -ivh oracle-xe-10.2.0.1-1.0.i386.rpm
Preparing...                ########################################### [100%]
Oracle Database 10g Express Edition requires a minimum of 256 MB of physical
memory (RAM).  This system has 155 MB of RAM and does not meet minimum
requirements.
error: %pre(oracle-xe-10.2.0.1-1.0) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping oracle-xe-10.2.0.1-1.0

Comments (1)

八月回国

今年八月带大令(据说宋美龄受美文化影响深,总是称蒋介石为大令。这词儿用到我那位倒也贴切,因为她老是对我发号施令)和儿子回国一趟。大令和儿子从未到过中国,所以他们需要签证。几个星期前我便到芝加哥领事馆去帮他们申请签证,顺便也给我换一个新护照。

我最后一次到领事馆应当是四年前吧。那时签证的地方小,感觉顶多也就两间屋子那么大,也没有多少人。这回一去,好家伙,地儿大了,人也多了。记得至少有五个窗口,并且总有二三十人在排队。看来现在到我国的人明显增多了,无论是访问、旅游、读书、还是工作。这真是件好事情。签证官员看起来都很年轻,大部分都会说广东话。这也难怪,因为海外的侨民还是说广东话的多。给我办护照的那个小伙子看起来不一定会说粤语,满口的北方口音。如果照片不合格,可以在领事馆内照,收费十刀。

领事馆签证处的地址变了。不知什么时候变的,反正现在是在1 East Erie, Chicago。他们的效率和态度都很不错,看起来是文件齐了就批,很少问问题。大令和儿子的签证当天就到手。护照的时间长,要一个月。

领事馆把大令的名字拼错了。我询问了一下,答复是:不用担心,真正的信息都在计算机里,以护照的名字为准。看来领事馆犯打印错误是常事。比如西班牙领事馆把我的签证效期搞错。又如美国大使馆在我第一次申请赴美签证时把我的学校名字打错。我想这很可能是他们每天的工作量大的缘故。

排队时随便翻了翻领事馆的新民晚报,读了一位上海老先生的短文,挺有意思。他写到要教他在美国的小孙女中文。于是在孙女夏天到上海时,他和她来一个语言学习大赛。他们互学对方的语言,假期后比一比谁掌握的词汇多。说不准我今年夏天可以用这一招:让我儿子和他的堂哥、堂姐来一个语言比赛。顺便说一句,现在我们说比一比、别苗头时会用PK,我不知道PK源自何处。不知道读者知不知道。

Comments (10)

Hasta La Vista, Vista

I purchased a laptop soon after this post. It was a HP Pavilion dv6253cl Notebook, pre-loaded with Windows Vista Home Premium Edition. This machine has 2 gig of RAM, 120 gig of hard disk space, and AMD Turion Dual Core processor. I bought it at Costco, 1000 bucks plus tax. It has a built-in card reader and webcam.

Vista is a huge disappointment. Here are a few problems I had:
1. A lot of device drivers are either not available, or do not work;
2. I am logged in as administrator, yet Vista repeatedly stops me from doing things I need to do, unless I confirm and click a Yes button. I heard it can be turned off, but I do not have time or too lazy to google it. It is a total waste of my time;
3. USB thumb drive does not work right. Sometimes I couldn’t even copy files from Vista to the USB drive;
4. I had trouble even moving files around. Granted, the files I move around are in the C: root folder or Program Files folders, but I AM AN ADMIN, let me do what needs to be done;
5. Little annoyances like I couldn’t sort files by type in my pictures folder. I am sure there are others, I just don’t remember now.

I’ve been thinking about moving off of Vista for the last couple of weeks. Today, I finally bit the bullet.

The first thing I tried is to load Ubuntu. Yes, currently I work primarily on the Windows platform, but I have strong interest in Linux. I reasoned I could use Linux virturalization software and create Windows virtual machines. I know there are people who use Mac with Parallel virturalization to run Windows on top, but Mac is too expensive for me.

I tried the latest Ubuntu, version 7.04. It actually didn’t start on the laptop, complaining some BIOS bug and firmware issues. Next I tried Ubuntu 6.01, an older version I happened to have. It didn’t start either. I was pretty disappointed.

Finally, I had to settle for Windows XP SP2. That cost more than half day. Now I almost have my system back. One big bummer is the built-in webcam is not working on XP. I do use the webcam with Skype, primarily for chatting with my family while on the road, so they can see me. It is a big plus, especially for my son. The webcam worked on Vista, but I would hate to go back to Vista just for that. Looking around for webcam drivers cost me at least 3 hours, to no avail!

The webcam driver issue seems to be a common one for HP Notebooks. HP doesn’t have the driver or the one it has don’t work. In fact, this afternoon I read tons of complaints with HP’s existing webcam drivers. I’d appreciate it if my readers have any leads on this.

Here is a note for myself, in case for whatever reason I need to rebuild XP SP2 on this laptop again. All links were obtained through HP’s web chat support.

Windows XP device driver links for HP Pavilion dv6253cl Notebook:

Broadcom Wireless LAN Driver:
ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33008.exe

HP Quick Launch Buttons:
ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33258.exe

Ricoh 5-in-1 Card Reader Driver:
ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33413.exe

NVIDIA GeForce Series Video Driver:
ftp://ftp.hp.com/pub/softpaq/sp33501-34000/sp33537.exe

NVIDIA nForce Chipset Driver and Network Controller:
ftp://ftp.hp.com/pub/softpaq/sp33001-33500/sp33411.exe

link for Microsoft UAA driver.
ftp://ftp.hp.com/pub/softpaq/sp33501-34000/sp33867.exe

Here is the web link for audio drivers.
ftp://ftp.hp.com/pub/softpaq/sp34001-34500/sp34200.exe

Here is the link for Webcam driver, but it did NOT work
ftp://ftp.hp.com/pub/softpaq/sp35001-35500/sp35414.exe

Comments (11)