Using MySQL Meta Data Effectively at ODTUG Kaleidoscope 2010

Since Oracle owns MySQL through its acquisition of Sun, more Oracle conferences are providing MySQL content. This past Oracle Development Tools User Group (ODTUG) Kaleidoscope 2010 conference from June 27 through July 1 had a whole dedicated track for MySQL.

Using MySQL Meta Data Effectively - title slide thumbnail

I was fortunate enough to have the opportunity to speak on MySQL metadata, titled “Using MySQL Meta Data Effectively“. Here’s the abstract:

This presentation discusses what MySQL meta data is available including the ‘mysql’ meta schema, the INFORMATION_SCHEMA (I_S) tables first introduced in MySQL 5.0 and extended in MySQL 5.1, storage engine specific INFORMATION_SCHEMA tables, as well as techniques for writing your own INFORMATION_SCHEMA plug-ins. MySQL also provides a number of SHOW commands that provide easily formatted presentation of MySQL meta data. Dossy Shiobara will also discuss some of the limitations and performance implications of the INFORMATION_SCHEMA.

Paper first page thumbnail

You can download the materials from my session here:

Can mind maps help me?

I guess I’ll let a picture do the talking …

Can mind maps help me?

Am I missing anything?

Ah, brain, you cruel mistress

So, I had grandiose plans of trying to post updates to the blog at least three times a week, every week, for the month of May. Uh, the last update before this one was April 28th. Basically, I blogged more the last week of April than I have the whole month of May, so far. What the heck happened?

I just don’t get it. It’s like my brain is sabotaging my plans! Why is it so hard for me to write things down? I have the same problem with writing documentation at work: I tend to think I write very well, but I just can’t commit words to paper, or in this case, an editing buffer. Tons of words, sentences, ideas, etc., flow through my brain at an incredible pace, but nothing wants to come out. I sit with my hands resting on the keyboard, but every time I move my fingers to type something, my brain stops me and I feel like what would have come out wasn’t the right thing to say.

***

Got a bit of the man-cave (the garage) cleaned up with the help of my Dad, and set up the bench grinder that my wife got me for Father’s day last year. Now I can sharpen all sorts of things, and buff and polish others, with ease — sure, the Dremel “does the job” but this just makes things so much easier and better. The table saw and miter saw are also stored in a better place that makes them easier to take out and use, and my Dad ran a new outlet to the post between the two cave openings (garage doors). All very useful things for DIY projects.

***

On May 7 and 8, I attended PICC’10 in New Brunswick, NJ. It was a really great, fun, two-day conference for IT professionals, primarily focused at system administrators.

The next conference I’m planning to attend is ODTUG Kaleidoscope 2010, June 27 to July 1, down in Washington, DC. I’ll probably only be there for two of the days. If you’re going to be there and want to meet up, let me know!

***

I set up a VMware guest with CentOS 5.4 x86_64 with EPEL 5, as my development sandbox for work, since that’s what they deploy on. It’s actually quite nice, not nearly as bad as I remember Redhat-based distributions being in the past.

***

I’ve set up a copy of CrowdFusion on my laptop, and plan to start working on a few plugins. I’m tired of dealing with crappy CMS‘es like Drupal or Joomla! but CrowdFusion is still quite “beta” in some ways. I figure if I can contribute here and there, the sooner I could propose it seriously in RFP responses and the happier I’d be. I’ll say this: as “beta” as it might be, CrowdFusion 2.0 is already better than Drupal or Joomla! at its core. Once a suitable collection of plugins are developed and tested, and a theme gallery is available and populated with attractive themes, there’ll be no reason to use anything else.

Installing Oracle 11g R2 on Solaris 10 with EMC PowerPath

For anyone who has the misfortune of having to install a multi-node RAC cluster of Oracle 11g R2 on Solaris 10 (in my case, SPARC 64-bit) with an EMC PowerPath, hopefully these notes I’ve collected will come in useful. I certainly suffered plenty trying to get this install to work and web searches didn’t turn up very many useful results at the time.

Make sure you set tunable limits correctly.

Previously, you would edit /etc/system to change tunable parameters then reboot the system, but starting in Solaris 10, there’s a new “projects” system where tunables can be configured. For my installation, the cluster nodes had 16GB of RAM each, so I used these settings (as root):

$ projmod -U oracle -sK "process.max-file-descriptor=(priv,4096,deny)" user.oracle
$ projmod -U oracle -sK "project.max-msg-ids=(priv,256,deny)" user.oracle
$ projmod -U oracle -sK "project.max-sem-ids=(priv,256,deny)" user.oracle
$ projmod -U oracle -sK "project.max-shm-ids=(priv,256,deny)" user.oracle
$ projmod -U oracle -sK "project.max-shm-memory=(priv,16GB,deny)" user.oracle

You can check these settings by inspecting /etc/project and looking for the user.oracle entry.

Also, when running in a RAC configuration, some Oracle processes like crsd run as root, so these will be necessary as well:

$ projmod -sK "project.max-shm-ids=(priv,256,deny)" system
$ projmod -sK "project.max-shm-memory=(priv,16GB,deny)" system

This appears to be a catch-all way of ensuring these settings are in use for all users:

$ projmod -sK "project.max-shm-ids=(priv,256,deny)" default
$ projmod -sK "project.max-shm-memory=(priv,16GB,deny)" default

Failing to set these settings for system and default seems to result in Oracle “ORA-01102: cannot mount database in EXCLUSIVE mode” errors when trying to start a database instance.

NB: There may be circumstances when you still need to configure these tunables in /etc/system. For more information, see Oracle Metalink 435464.1 ENABLING SOLARIS PROJECT SETTINGS FOR CRS.

Failure to create the DATA diskgroup using ASM

I wasted a good 6 hours trying to understand why I kept getting the following error during the 11g R2 grid package install:

ORA-15020: discovered duplicate ASM disk "DATA_0000"

Turns out, I had only set the permissions on /dev/rdsk/emcpower* correctly on one of the nodes in the cluster. The permissions need to be correct on all nodes in the cluster, as the installer operates on all cluster nodes as part of the install – duh! Beware of this gotcha, it can be very frustrating.

WARNING: oradism did not start up correctly.

In diag/rdbms/*/$ORACLE_SID/trace, in the alert_${ORACLE_SID}.log, you may find this message:

WARNING: oradism did not start up correctly.
  Dynamic ISM can not be locked.
----------------------------------------
oradism creation failed for unknown reasons 0 8 105

This is apparently a bug described in Oracle Metalink 374367.1. By default, the Oracle installer installs the file with ownership oracle:oinstall and mode 0750. It needs to be suid root, sgid dba. The solution is to perform the following steps (as root):

$ cd $ORACLE_HOME/bin
$ chown root:dba oradism
$ chmod 6550 oradism

Then, restart the database.

Back up the Enterprise Manager encryption key!

The Enterprise Manager runs on port 1158, using HTTPS. The encryption key is located here:

$ORACLE_HOME/*/sysman/config/emkey.ora

Back this key up, because without it, the Enterprise Manager data can’t be accessed.

ERROR: NMO not setuid-root (Unix-only)

When using Enterprise Manager, you might get the following error message:

ERROR: NMO not setuid-root (Unix-only)

This occurs because the NMO binaries need to be setuid-root, as the error explains. Use these steps to correct the problem:

$ cd $ORACLE_HOME/bin
$ chown root nmb nmhs nmo
$ chmod 6750 nmb nmhs nmo

Have you installed a multi-node RAC cluster using Oracle 11g R2 on Solaris 10? Did you discover any gotchas that prevented a successful installation “out of the box”? Please, share them in the comments below so that others can benefit from our pain!

Make sure all your friends show up in your News Feed

I keep forgetting where this setting is, so I’m going to blog it here so I can find it when I search for it.

If you want to make sure all your friends status updates show up in your Facebook News Feed, you need to make sure you’ve set your threshold high enough. You get to this setting by going to the bottom of your News Feed page and clicking on the Edit Options link:

Facebook News Feed Edit Options link

In the dialog that pops up, there’s a Number of Friends section that controls how many friends’ updates will be included on your News Feed. Set this number to something larger than the number of friends you have, to ensure that all of their updates will be included.

Number of Friends configuration

There you go. If you have more friends than the number that is currently showing, you won’t see all your friends’ updates.

Google Chrome for Mac finally in beta

Google Chrome Logo

I’ve been using nightly development builds of Google Chrome for Mac, Google’s shiny new web browser, for a while now. A few days ago, it was officially labeled beta for Mac. Until now, I wasn’t using it regularly, but I decided I should try using it full-time for a few days to see how it wears.

I’ve got 12+ tabs open and it’s still fast, smooth and stable. Granted, on the Mac there’s no extensions/add-on feature … it’ll be interesting to see how stable things remain once those are introduced. The browser’s rendering of most pages seems identical to Firefox, except for a few that I’ve stumbled across. Overall, it’s a very usable browser and should have a great future ahead of it.

Of course, there’s still a few bumps and warts that I hope they’ll address soon:

  • Needs to be more customizable. For me, this could be as simple as providing an about:config interface like Firefox. Let me easily tweak and turn the various knobs that control stuff under the hood. My biggest gripe is not being able to completely remove the “close tab” button on the tabs. In trying to switch tabs, I’m constantly accidentally clicking the “x” which closes the tab. Sure, Cmd-Shift-T re-opens the tab, but that’s a nuisance that could easily be avoided by removing the “close tab” bit like I have done in Firefox.
  • Smart keywords. I pretty much live in my web browser and the Address Bar is my command-line interface to the web. I have smart keywords defined for all manners of things, and switching to Chrome that lacks them is very painful. I’d say that this is a must-have feature before I would switch completely.
  • Third-party add-ons and extensions. I can live without most of the niceties that add-ons bring, but there are a few that I would hate to do without:
    • It’s All Text! Edit any TEXTAREA in an external editor. For the average web user, this probably wouldn’t be that useful, but for me, it makes editing code blocks and other large text in web-based CMS‘es tolerable.
    • Greasemonkey. There’s nothing like the ability to “fix” a “broken” website, removing annoying “features” or adding a missing one. While I could probably get by without Greasemonkey, I don’t know if I’d really want to.

Have you tried out Google Chrome, yet? I’d like to know what you think … let me know in the comments below.

Using a Cisco/Linksys WUSB600N on MacOS X 10.6

After getting totally fed up with the poor Wi-Fi range on my MacBook Pro, I picked up an external Cisco/Linksys WUSB600N. Of course, Linksys doesn’t provide Mac drivers for this product, but it’s a Ralink 2870 and Ralink provides drivers for MacOS X in their support section. I downloaded the RTUSB D2870-2.0.0.0 UI-2.0.0.0_2009_10_02.dmg driver (5.2 MB).

There is a driver inside USBWireless-10.6 for Snow Leopard, and it will complain during installation that the RT2870USBWirelessDriver.kext failed to install. This is expected, just ignore it, the installation will complete successfully.

At the time of this writing, the WUSB600N v2 isn’t included in the Info.plist for the kext, so I had to edit /System/Library/Extensions/RT2870USBWirelessDriver.kext/Contents/Info.plist in a text editor and add the appropriate bits. Search for “Linksys – RT2870 – 2″ and duplicate the <key> and <dict> elements, renaming the key to “Linksys – RT2870 – 3″ and the idProduct integer from “113″ to “121″. Here’s what it should look like after the changes:

        <key>Linksys - RT2870 - 3</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.Ralink.driver.RT2870USBWirelessDriver</string>
            <key>IOClass</key>
            <string>RT2870USBWirelessDriver</string>
            <key>IOProviderClass</key>
            <string>IOUSBDevice</string>
            <key>idProduct</key>
            <integer>121</integer>
            <key>idVendor</key>
            <integer>5943</integer>
        </dict>

After making this change, unload/reload the kext or reboot your machine, and then plug in your WUSB600N and you should get a window popping up telling you that a new network device has been detected.

I hope this helps someone, as I was totally disappointed when I learned that Linksys wasn’t supporting this device on Mac “out of the box.”

Getting ActiveState’s “teacup” working on MacOS X

ActiveState has created a Tcl Extension Archive tool called teacup which simplifies the installation of binary extensions to Tcl. It’s included with ActiveTcl, but if you’re using Tcl from MacPorts and want to use teacup, it’s fairly easy:

1. Download teacup for MacOS X

The teacup binary can be downloaded from this location:

Here is a direct link to the latest teacup binary. The file is named file.exe — simply rename that to teacup and put it in /usr/local/bin or another convenient place in your $PATH.

2. Create the installation repository

You will need an installation repository where teacup can store its data locally. The default location is /Library/Tcl/teapot and you can create it like this:

$ sudo teacup create
Repository @ /Library/Tcl/teapot
    Created

3. Patch MacPorts tclsh to handle teapot repositories

$ sudo teacup setup /opt/local/bin/tclsh
Looking at tcl shell /opt/local/bin/tclsh ...
  Already able to handle Tcl Modules.
  Already has the platform packages.
  Patching: Adding code to handle teapot repositories ...
Done

4. Link teacup to MacPorts tclsh

$ sudo teacup link make /Library/Tcl/teapot /opt/local/bin/tclsh
Ok

That’s it! You’re done. You should now be able to list available packages within TEA using teacup list and install them using sudo teacup install "packagename".

I’ve tested this on MacOS X 10.6.1 Snow Leopard with Tcl 8.5.7 from MacPorts.

Tags: , , , ,

D. J. Bernstein is legendary

I’ve been using djbdns and qmail for many years, specifically because after reviewing its code and comparing it to other possible alternatives, I objectively decided that these two pieces of software are superior in all aspects.

Lots of people have cast aspersions on D. J. Bernstein and his software, usually with emotional and irrational claims. Of course, most of these people can’t even read code well enough to understand what it does or how it does it. However, when you encounter the opinions of actual programmers, we all tend to share a similar but different opinion.

Today, Aaron Swartz put this into words better than I could: D. J. Bernstein is the greatest programmer in the history of the world. The money quote:

[...] djb’s programs do not work like most programs, for the simple reason that the way most programs work is wrong.

Amen.

Tags: (), , ,

Fixing a Troy-Bilt TB70SS weed whacker

troy-bilt-tb70ss.png

My friend Keith has a Troy-Bilt TB70SS weed whacker that stopped working the other day. Not being one to pass on a good opportunity to do a DIY repair, I took it apart and discovered that the piston arm had broken and the reed spring had gotten mangled.

The best source for parts that I’ve found is, surprisingly, the Home Depot Power Equipment Parts site. They have the exploded parts view in PDF form, which makes ordering really simple.

I wonder if there’s pictures or videos online showing folks how to take apart and re-assemble these things — it’s really pretty simple and can be a lot of fun to repair your own things.

Tags: , , ,