Archive for November, 2005

Customize Oracle sqlplus editor

In Oracle sqlplus, if you type ed or edit at the command prompt, sqlplus will put the last command into an editor buffer for easy editing. In Windows, the default editor is Notepad. In Unix / Linux, the default editor is usually vi. I have changed the default sqlplus editor on my Windows machine to vi. In an earlier post, I explained how to change Microsoft SQL Server 2005 sqlcmd default editor.

I am taking Oracle 10g training this week. The lab is based on Red Hat Linux. I was surprised to learn that the default editor is not setup for sqlplus. When I typed ed, sqlplus would hang.

Here is what I did to fix it:
1. Create a file called login.sql and put it under your home directory
2. Put this line into login.sql file
DEFINE _EDITOR=vi

I also tried creating glogin.sql, as some web site suggested. But for some reason, it didn’t work for me on this Linux machine. I am pretty sure that’s what I did on Windows to make it work.

Update: It appears that if you start sqlplus from a directory other than your home, ed will fail. No big deal but still a bummer. Anybody can enlighten me?

Update1: $ORACLE_HOME/sqlplus/admin is the folder to put glogin.sql on Unix / Linux / Solaris systems. On Windows, the folder to put glogin.sql is c:\oracle\product\10.2.0\DbName\sqlplus\admin. Replace 10.2.0 with your version number. Replace DbName with your database name.

Another thing worth knowing is to set the sql prompt in SqlPlus. You can put this into glogin.sql:
set sqlprompt _user”@”_connect_identifier>

Comments (4)

sqlcmd presentation at next Chicago Sql Server User Group meeting

I will do a talk on sqlcmd basics in the next Chicago Sql Server User group meeting. The meeting will be held at Microsoft’s downtown Chicago office on 12/06/2005 from 5:30pm to 8:00pm. More details at here.

I will post scripts and slides here when I am done editing.

Hope to see you there.

Comments

Xiamen Pictures




Xiamen Botanic Garden

Originally uploaded by haidong.

Last year I went back to my college town, Xiamen, China, for our 10 year graduation reunion. I had my undergraduate education there from 1990 to 1994.

Xiamen is absolutely beautiful. I hope you like the pictures. More pictures of Xiamen can be found here.

Comments (2)

Good Chinese Restaurants in Chicago

After living in the US for more than 10 years now, I feel that I am also looking forward to Thanksgiving and Christmas holidays. I am not religious, but I like the joyful, harmnious, and just plainly nice spirit these holidays bring. The Chinese equivalent version would be the lunar New Year holiday.

On Thanksgiving and Christmas Eve/Day, there is usually a feast for the whole family and people eat a lot. Therefore I thought it is a good time for me to share my favorite Chinese restaurants in Chicago with you.

As you can see from my first post, I grown up in a small rural village in Northern China. Nobody had refrigerators at the time, even for city folks. So to preserve food longer, we pickle vegetables and stir-fry meat, usually pork, with a lot of salt. Having pork in a meal was heaven on earth to me at the time. So I like salty, hot, and spicy food. I actually eat and enjoy the red, dried chili pepper that people use to cook a good Kong Pao chicken. However, the places I recommend all have many choices of different dishes. So don’t worry if you have mild taste. All places below offer authentic Chinese food, in my view.

1. Ed’s Potsticker House
3139 S Halsted
Chicago
312-326-6898
This place is located outside the center of Chinatown on Halsted. It serves a lot of North and Northeast Chinese dishes.

2. Mandarin Chef/Lao Sze Chuan
2172 S Archer Ave
Chicago
312 326 5040
Located in Chinatown, across the street from Walgreens, this place specialize in SiChuan cooking. It can be pretty hot and spicy. It also has one in Downers Grove.

3. Spring World
2109 A.S. China Place, Chicago, IL 60616
312.326.9966
http://www.springworldrestaurant.com/
Again, located in Chinatown, not too far from the square where they have statues of the 12 Chinese zodiac animals, this place specializes in Southwest China cooking, YunNan and SiChuan style.

4. Dragon King
Dragon King Restaurant
2138 S. Archer Ave.
312-881-0168
Again, located in Chinatown, not too far from the square where they have statues of the 12 Chinese zodiac animals, this place specializes in North and Northeast Chinese dishes. One particular thing I like is called Lao Hu Tsai. Consider it as a vegetarian salad with a punch.

Comments (4)

Overcome Computer and Web Addiction

Danny has a great post about TV watching. As always, his writing is great. I like the structure and flow of his sentences. They are layered nicely, with great humor here and there to boot.

My yearly cable TV / broadcast TV consumption is probably less than 10 hours. We got cable TV for free because we live in a condo building. Watching Yao Ming playing basketball takes a big chunk out of it. I do use my Samsung TV set to watch DVDs from Netflix, though. I probably spend on average about 3 hours per month on DVD watching, if that.

On the other hand, I do spend a lot of time on the web. I had my book projects in the summer. I now write my own blogs. With SQL Server 2005 just released recently, I plan to write more technical articles for SqlServerCentral.com. I need to work on a presentation I will give to a user group in December. And I do volunteer work for PASS, currently helping out with the SIG web site.

I think I need to plan better and have more discipline in my web surfing. Like TV addiction, I believe computer/web addiction is not good either, although I would say the later is the less of two evils. Many times I read articles, news items, and blogs and follow links on them that I don’t even remember why I end up where I am and what my original goal is.

So, dear reader, what tools, tricks, discipline do you apply to overcome computer/web addiction?

Hey Danny, if you are reading this, are you in Chicago during Thanksgiving? Do you want to do a meetup?

Comments (7)

Muzzy Is Great

I’ve heard from somebody that Muzzy, the BBC foreign language program, is great. She bought it for her grandson for German learning. Unfortunately, at the time, there was no Chinese Muzzy program.

Due to popular request, Muzzy finally got a Chinese program. I got it 2 weeks ago and it has been great. My son loves it and is learning.

I am a native Chinese speaker. Mom is a native Swedish speaker. So we speak English at home. Due to the lack of good Chinese program within close distance of where we live (10-20 minutes drive), we enrolled him into a bi-lingual Japanese Montessori program. Chinese and Japanese are somewhat close.

He loves the Japanese program. Yoko sensei is absolutely wonderful. I don’t know Japanese myself but I think Benjamin is pretty good at it. Yoko, please let me know if that is not the case;)

The good thing about Muzzy is that it is age appropriate and engaging. It tells a story of a few characters in a fictitious kingdom. Muzzy is an alien that is kind and good natured. The gardener of the kingdom falls in love with the princess, who is also courted by the evil butler(?) of the royal family. The story sort of revolved around that. It is full of repitition of important words and funny sketches to get the kids engaged. My son is learning but don’t even know it;) It also helps that the program has a lot of songs to help along.

I highly recommend it if you want your child to learn a second language. Other than Chinese, I believe they have German, Italian, Spanish. Rick, if you read this, they have it available in French;)

Comments (5)

Thoughts on Blog Writing

Ken talks about his experiment on blog writting and posting. I liked the way he shared his experience, the thought process behind it, and how he drew his conclusions. And kudos to Louis’ comments, especially on the personal touch to blogs.

It seems that some blogs are like oven-baked bread. The raw materials, in the case of bread, dough, yeast, etc., get stale and don’t taste as nice if you don’t bake it at the right time. Blogs come out of your thoughts. When it is ready and there, and you write it and post it later, or schedule them, they do not have the same convictions and passions associated with them when the ideas first come to you.

On the other hand, I can also see other blogs are like wine. It works best if you let it age in your brain for a while. No pun intended;) Maybe for those, you can schedule or post in batch? Still, I think it’s best if you blog about it when you are ready.

I, too, have 2 blogs. I post only SQL Server stuff on SqlServerCentral’s blog. I also maintain my own personal blog here, which has the other stuff like MySql, Linux, and whatever things I can think of, in addition to SQL Server material. The reason I post at SqlServerCentral is I think they have a bigger audience. I cross post the same material at my personal blog mainly for control and backup reasons. I’ll keep on doing like this and see how it works.

One thing I struggled initially was when to post a comment and when to blog about it. The criteria I take now is that if it is going to be long and add some value, I will write a blog about it, much like Larry Osterman’s tendency to riff on Raymond Chen’s blogs;) Otherwise, I will leave a comment.

Ken is right. Writing blog takes time. Blog is personal; so I guess it is ok to have off-the-cuff thoughts and comments because that is human. But that does not equal sloppiness. It takes time to do anything right. A Chinese blogger, flypig, has a great post on this;)

Comments

Some of my book writing experience

Louis wrote his pain in book writing. I can feel his pain:) It reminded me of my experience during the writing of our SSIS book. Fellow co-authors Andy Leonard and Kathi Kellenberger also have some interesting blogs on their experience.

Initially, I found 2 things very frustrating. They are all related to screen capturing:

1. It took a while to learn and get used to various macros embedded with the Word file we used. I had to ask around my fellow co-authors how to do certain things, like inserting screen shots, how to add footers for them, etc. Once I got that figured out, it was all right. Thanks Andy for sharing.

2. Another thing is to get the theme of the display right. A lot of publishers have their own standards in capturing screen shots, so they have a consistent look and appear nice on paper. Once again, after it was done and verified by the publisher, it was all right. One tip I have is to save your default display setting as a theme file. And save publisher preferred theme as another file. You can then easily toggle between those 2.

When it comes to actual writing, I didn’t use Word. I wrote everything in VIM, a clone and enhanced version of VI. I would write formatting notes to a section of text if it is supposed to format differently in Word. For example, I would wrote (Header 1) Package Meta Data Storage for a header. When inserting a screen shot, I would write (Screen Shot 5 here). When I am ready to format the document, I would copy and paste everything in Word. I then would look for notes I wrote for myself to get formatting done correctly in one shot. I found this worked pretty well for me and my productivity increased.

For screen shot capturing, I used SnagIt. SnagIt has auto capturing and auto number files, which is real handy. It pays to get that working, because you will save time later on.

Hey Louis, keep me in mind in your next book writing gig:) I’d be glad to co-write a few chapters.

Comments (4)

Sql Server 2005 Named Instance Stops Default Sql Server 2000 Default Instance

Last night I did some testing and installation of Sql Server 2005 and Sql Server 2000. I installed the RTM version of Sql Server 2000 as the default instance first. I then installed RTM version of Sql Server 2005. Afterwards, I noticed that I couldn’t connect to my Sql Server 2000 instance any more. I am running Windows XP SP2 on my laptop. I had to manually start the default instance.

So keep this in mind when you are doing testing and installation, especially in production environment.

Comments

Find out uptime of server and MySql database

This site had been unstable for the last couple of weeks, due to my hosting company’s issues with servers. My Apache and MySql database have both been moved to a different server. Hopefully things will be stable from now on.

During the troubleshooting time, I used a few commands to find out the uptime of both server and MySql database. I thought these would be helpful to other people so here they are.

To find out the uptime of your Linux server, any one of the following commands will do:
w
uptime
top

To find out the uptime of your mysql demon, log into the server using mysql command line, then issue the following command:
\s

I am sure there is a way to find out how long Apache has been running, but I just don’t know. Can anybody enlighten me? Thanks.

Comments (3)

· « Previous entries