Sample Baseball Database for Learning, Testing, and Demo

I came across this from a blog I follow. Dbt even provided a nifty script to figure out the most recent world series win, loss and appearance for every team in the league. I first heard about this database probably a year ago.

Anyway, I thought this really is a great database for my baseball-loving friends
to use as a tool for learning, testing, and demo sql. Here is the link to the download.

As for me, I know almost nothing about baseball. I do know what a home run is;) But I have no idea of what an inning is, which, by the way, is an interesting word.

Pointers on WordPress customization please

I’ve had my blog for a couple of weeks by now. It was hosted by MidPhase. I used it because it had good reviews and a colleague recommended it. Based on my experience so far, I am not too happy with it. I will leave that for another post.

Anyway, I am actually pretty happy with WordPress so far. The installation and initial configuration was not bad. I’ve downloaded a few themes to play with. I’ve settled on this Almost Spring theme from Becca. I did some tweaking myself, mainly on sidebar.php and style.css files. I am a newbie in both PHP and CSS.

I also studied some other people’s blogs for ideas and inspirations, mainly from Chris Hedgate and Danny Howard. That is a big help for me. Thanks guys.

I want advice on 2 issues below:
1. I thought it would be neat to create a table that stores all books that I have read. I can use that to create a WordPress page for those books. Do you know if there is a plugin just for that? I know there is a plugin for you to create tables in MySql. That is no big deal, as I can do that easily using mysql command line. The challenge for me is to write the PHP code and integrate that on the sidebar.

BTW, thanks Danny for this post, I’ve read the book. Wow, it really changed my thinking on a lot of things after reading it.

2. What tools do you use for trackbacks and ego search? I’ve used, but it would be nice to have a tool or plugin to do that work.

If you have some other cool tips and pointers that you can share, that will be greatly appreciated.

Fix Page 404 Error in WordPress

1. You use WordPress;
2. You have permalink turned on;
3. You just wrote a page using WordPress but when you view the page, you get 404 page not found error;

1. Go to Options->Permalinks;
2. Click Update Permalink Structure. If your .htaccess cannot be updated through the web interface (very likely), copy the text and replace what you currently have in that file. Say a silent prayer;) and hopefully it will work.

End If

Server consolidation and virtualization with Sql Server 2005

We had a PASS volunteer SIG (Special Interest Group) teleconference today. One item discussed was server consolidation. Microsoft is interested in this area and is seeking input.

During the earlier discussion we had, Bill Wunder and Lynda Rab brought up good points like login transfer, collations, tempdb issues, job management and maintenance, resource allocation, and security management, etc. I will not steal their thunder by repeating what they’ve covered. Here is some of my thoughts after our brief discussion on it over the phone. I sent them to the group but thought I would share that with you, my dear reader:)

1. It will be interesting to compare the scenario of one default instance hosting all databases versus multiple instances hosting their own databases. I guess multiple instances can solve tempdb and collation problems.

For consolidation, the server got to be 64-bit. To avoid a rogue database highjack the whole machine, therefore defeating the purpose of consolidation and increasing risk, it will be interesting to set Max memory for each instance. Or, set a fixed memory size for each instance, depending on what databases each instance has and the total server memory.

In addition, it will be interesting to set CPU affinity. So CPUs are also isolated for each instance. On top of that, each instance will have its own hard disk spindles or SAN LUNs. That will be one way to make sure that one database won’t hog the whole machine.

Having multiple instances also gives one the flexibility to selectively stop and restart one particular instance. Hmmm, now I wonder what kind of machine (CPU, Memory, Storage, Licensing of Sql Server software) we will need to pull this off. In some cases, it may not even be cost-effective. I guess it all depends on how many servers one has and the nature of the applications. The size, cooling, and other infrastructure of your data center also play a role here.

2. I am also intrigued by virtualization. I’d like to know when and how it can be used in a production environment. I’ve been using Virtual PC and installed WinXP and Windows 2003 as guest operating system on top of it. They are all great for experimenting with various test cases and just messing around. It seems to me that virtualization is best suited for testing and learning, not for real production though. I’d like to hear your thoughts and experience on this.

Change SQLCMD default editor

In SQLCMD, if you type ed, it will invoke a text editor and put the last command you run in the editor buffer. The default editor is Edit, a command line editor of DOS.

This behavior is very similar to Oracle Sql Plus, by the way. The difference is that in Sql Plus, you can use / to run the command after you finished editing, whereas in SQLCMD you still need to type go for it, well, to go;)

Anyway, the really neat thing is you can change the default editor to whatever you like. I know many DBAs / developers have their own preferred editors, like Edit Plus, TextPad, or even plain old Notepad. This is exciting because if you work in your favorite editor, you feel you are in control and your productivity increases. For me, I have changed the default editor to VIM, a clone of VI. VI is my favorite editor.

This is how you do it:
1. Open a DOS prompt;
2. Type set sqlcmdeditor=vim, or notepad or whatever;
3. Go to sqlcmd, enter and execute a sql statement, then type ed;
4. Viola, your editor of choice opens. Edit away, after you are done, save and close;

I am very happy to find this feature. It is a real productivity enhancer.