Aug 24 2010

How to Make a Long Running Query

-Matt-

Recently a colleague sent me a quick instant message asking if I knew of any way in Oracle to make a query run long enough to test a “cancel query” function he was writing in Java.  He had tried several queries that usually produced the results he was looking for, however there wasn’t enough data in his test environment to reproduce the wait time he needed.  I thought about it for a minute and then proposed the following solution.

Oracle provides the DBMS_LOCK package which allows users to manage their own locks.  One handy subprogram in this package in the SLEEP method, which suspends the current session for the specified number of seconds.  I have used DBMS_LOCK.SLEEP a number of times in the past so I knew this would do the trick. Continue reading


Feb 9 2010

Exploring Mac World – Update

-Matt-
Well, it’s been well over a month since I discussed embarking on my Mac endeavor (http://www.mattoldham.com/2009/12/getting-ready-to-explore-the-world-of-mac/).  I cannot believe it is almost the middle of February, and today is the first day I have not been onsite at my client since before the holidays began.  That also means today is really the first chance I’ve had to come back around and give you an upadte on where I’m at with validating the viability of the Mac for my daily needs.
To start, here are the specs for my test bed:
Mac Mini
Mac OS/X 10.5.8
Processor: 2GHz Intel Core 2 Duo
Memory: 4GB 1067 MHz DDR3
My initial challenge for the Mac was basically to replicate (again, in a viable manner) the various tools and utilities that are critical to my daily grind.  Well, I am honestly surprised to say that aside from a few minor things here and there the Mac stood up to the challenge.  Read on for the specifics…
1. Microsoft Office
As I mentioned before, this is a must have given the obvious email factor, as well as the amount of client documentation we prepare.  I was fortunate to already find Microsoft Office 2008 installed on the Mac Mini, including the Entourage email client.  At this point I have not been able to explore Entourage at all, but that is on the list.  I have heard there are “quirks”, but I cannot validate these claims yet.  It will be very intereting to see how it compares to Outlook.  At this point I’m just happy there is a Microsoft offering.  Wow, did I really just say that?
2. Oracle RDBMS
I was somewhat disappointed to find that OracleXE is not available on MacOSX.  I say somewhat because I have been recently challenged by several of the limitations in XE as it relates to otherwise “enterprise” features Oracle has disabled in XE (e.g. table partitioning, parallel exports, etc).  Fortunately, I was able to get Oracle 10gR2 Enterprise installed with little effort.  I found the following guide bvery helpful:
http://www.pythian.com/news/1937/quick-install-guide-for-oracle-10g-release-2-on-mac-os-x-leopard-intel/
NOTE: One thing I had to do in order to get the installation to work correctly was to edit the ORACLE_HOME value in the /Library/StartupItems/Oracle/Oracle file.  If you are familiar with Oracle in a Unix environment, you know the importance of ORACLE_HOME so this should not come as a surprise.
After installation, I tried creating a local database.  This process was giving me grief until I dioscovered I had to enable the root user on a Mac.  What’s that all about?  Disabling the root user?  Well, the following support note from Apple walked me through the process:
Emabling the root user in MacOSX: http://support.apple.com/kb/HT1528
Once that was done, I had to manually create the /etc/oratab file and set file permissions such that the oracle user could write to it via the Database Configuration Assistant (dbca) utility.  Finally, I had a fully functional Oracle installation.  Life is good…
3. Oracle SQL Developer / Data Modeler – I already said I was a database guy, therefore I need 1) a query tool, and 2) a data modeling tool.  I have already made the move to the two Oracle tools I listed, and I’m not ready to move on.
Both of these items are supported on MacOSX and both installed easily.  Things are looking promising, I must admit.  But the challenge is not over…
4. Core Development Platform (Java, Ant, Subversion)
Not a whole lot to report here either (fortunately and unfortunately).  I found all of these tools already installed on the Mac Mini, to my surprise.  Not because Apple shipped it that way, obviously, but because I inherited the device from another internal development team who was using the tool set.  It’s great to see these packages work, which I am not surprised by, but I am a little disappointed I did not get to install them.  That time will come, though.  It will be interested to symlink all of the respective install directories so I can add other JDK versions and switch out my builds on the fly using environment variables.  That will give me the opportunity I was looking for, I only need the time to dig into it.  Something to look forward to…
In my original post I also mentioned the desire to find a TortoiseSVN-like utility that integrated natively into the file manager.  I honestly did not expect to find one, given my earlier woes while trying to find such a tool for Gnome/Nautilus.  At that time I was surprised to find that the folks at Tigris (http://www.tigris.org) did not offer one.  Well, they didn’t overlook the Mac.  I ran across a native Finder plug-in from Tigris (http://scplugin.tigris.org).  Just what I was looking for.  I did notice that the directories under version control did not automatically appear with correct SVN icons, but I am assuming this is related to a caching issue within the plugin.  We’ll wait and see it it corrects itself.
5. VMWare
As I mentioned before, this is perhaps one of the most critical components I have to get working in order for me to work in the land of Mac.  Not being able to replicate my virtual environment would pretty much be a deal-breaker for me.  I was already aware of VMWare Fusion (http://www.vmware.com/products/fusion/), but I was not clear on the compatibility between Fusion and Workstation (http://www.vmware.com/products/workstation/) (the product I use).  In short, I installed Fusion, opened an existing VM created under VMWorkstation 6.5 on Linux, and it loaded right up with no changes.  Very, very nice.  I can’t say enough good things about VMWare.  Life is really good…
6. UltraEdit
This is still in the works by the guys over at IDM Software, but it’s definitely on the way for MacOSX.  See http://www.ultraedit.com/company/blog/community/what_will_uex_become.html for an update, and be sure to read the comments.  In the meantime, a very viable alternative is found in TextMate (http://macromates.com/).  Couple that along with the Oracle syntax plugin (http://code.google.com/p/oracle-textmate-bundle/) and I can once again write code in comfort.
7. Pidgin
This was alittle misleading, to be honest.  I thougt I had found Pidgin for MacOSC, but I really found a couple of Pidgin alternatives that are recommended by the Pidgin website (http://www.pidgin.im/download/mac/).  After taking a look at them both, I chose to go with Adium (http://adium.im) since it uses the libpurple core library that Pidgin uses and offers “…a more native Mac OS X experience”… uses the same libpurple core that Pidgin uses.  Interestingly, not all of my groups appeared in the list of groups, but all my critical IM protocols are working.  All in all a nice utility.
8. Conky
This is still a gap.  While I saw a number of posts recommending ???, it does not appear to be anywhere near as flexible as Conky.  I will have to do some more digging.  If anyone can point me in the right direction, I would appreciate it.  I really enjoy ConKy hand have come to rely on it and keep it in my peripheral on the side of my desktop as I work.  I typically watch my CPUI activity, top processes, and core component temps as I work.  A screenshot of my Conky config can be seen here (http://www.mattoldham.com/wp-content/uploads/2010/02/my_screen.png)
9. iTunes
It was obviously no surprise to find iTunes already installed and working indiginously in MacOSX.
10. Firefox
Firefox – No problems here.  I am a long time Firefox user, but have recently begun using GoogleChrome as a result of a friend’s convincing blogpost: http://blog.incursiontech.com/matt/2009/12/23/fedora-64-bit-google-chrome-flash-player-64-bit-awesome/  It’s as good as it sounds.

It’s been well over a month since I first discussed embarking on my Mac endeavor.  I cannot believe it is almost the middle of February, and today is the first day I have not been onsite at my client since before the holidays began.  That also means today is really the first chance I’ve had to come back around and give you an update on where I’m at with validating the viability of the Mac for my daily needs.

To start, here are the specs for my test bed:

  • Mac Mini
  • Mac OS/X 10.5.8
  • Processor: 2GHz Intel Core 2 Duo
  • Memory: 4GB 1067 MHz DDR3

My initial challenge for the Mac was basically to replicate (again, in a viable manner) the various tools and utilities that are critical to my daily grind.  Well, I am honestly surprised to say that aside from a few minor things here and there the Mac stood up to the challenge.  Read on for the specifics…

Continue reading


Feb 2 2010

Handy Desktop Background For App Developers

-Matt-

Ever been working with an application window and wondered if it would fit into a particular screen resolution?  I have.  I am continually testing our apps in different browser windows and periodically I check to make sure we are still within the maximum screen resolution as indicated in our requirements documents.  I had been using this nifty little Firefox plugin which did the job for me.  But, I don’t have that capability yet (that I know of) with Google Chrome.  And, what if I happen to be testing a non-browser-based application?  Well, I got tired of wondering and decided to do something about it. Continue reading


Dec 22 2009

Getting ready to explore the world of Mac

-Matt-

Never thought I would be saying that in my lifetime, but here I am nevertheless.  I have been running Linux on my laptop for almost a year now, and I have thoroughly enjoyed the flexibility it has offered me.  I weaned myself off of my old Windows XP VM a while back and have been living my daily development life exclusively in X Windows (Gnome).  My Gnome environment has exposed me to GnomeEdit, Compiz, CairoDock, Conky, and other utilities here and there.  Getting everything set up has been a little challenging, but not near as much as *keeping* it all set up and playing nicely together.

Continue reading


Nov 11 2009

OLAP Friendly OLTP Design

-Matt-

I thought I would post a whitepaper I wrote earlier this year under the auspices of my employer, M. Miller & Associates.  This whitepaper is basically a summary of things I have observed over the course of my career in IT, particularly in regard to database design.  I can assure you that I eat my own dog food when it comes to the things I discuss.  I’m in the trenches every day putting into practice these concepts in order to produce solid, forward thinking designs.  We’ll eventually post this on the company website, but until then I make it available here in hopes it provokes thought and discussion.  Let me know what you think.

OLAP Fiendly OLTP Design – Planning Ahead for the Inevitable Data Warehouse


Sep 11 2009

A Great Development Configuration

-Matt-

My current development environment has to be the best configuration I’ve had to date in my development career.  Here are some of the specifics:

  • HP EliteBook laptop (8730w)
  • 2.4GHz Core 2 Duo 64-bit
  • 6GB Memory
  • openSuse 11.1 64-bit

The move to Linux from Windows has been a huge plus, though not without its own challenges.  But it’s not just the hardware and OS.  Here are the tools that round out a highly productive development environment: Continue reading