Thursday, April 30, 2009

COLLABORATE 09: What's Your Latest Schedule?

Goodness, there are quite a few classes to choose from. I don't even want to know what it's like deciding at OOW.

Here's my updated schedule:



Yes, I'm still too lazy to type it all up and make it pretty.

Tuesday, April 28, 2009

COLLABORATE 09: What's Your Schedule?

Just in case you didn't know yet, I'm attending COLLABORATE 09 in Orlando, FL next week. I scored the coveted (?) media credentials as a blogger.

As long as I keep seeing "Beginner" in the "RAC Attack" hands on session, I'll be there. Naturally the site doesn't mention who is putting on the event, but I've been able to glean that at a minimum, Dan Norris and Jeremy Schneider will be there.

Others from the University Seminar list, full and half day classes on Sunday and Thursday, that interest me are:

U1: Data Modeling Made Easy
U9: Ask Tom Kyte Live!
U10: Securing Oracle

Those are all full day courses (Sunday).

On the speaker front, I plan on catching the keynote by Charles Phillips and can hopefully catch Tom Kyte as well. Though it might do me some good to hear people I am not familiar with. Will probably be a last minute decision.

I was going to link up my schedule but there doesn't seem to be a way to (easily) publish it. So I took a screen grab of it.

Yes, I've asked about 37 times already...but who is going to COLLABORATE 09? I owe one-to-many beers to at least one-to-many people.

Update

I was just looking through my OraNA feed and found that Todd Sheetz is going as well. I don't know him...but I'll have to find him, anyone with a last name like that HAS to have a great sense of humor.

Monday, April 27, 2009

Software Development: Pros vs. Hacks

I've been mulling over this one for quite some time.

I'm looking to define the difference between a Software Professional and a Software Hack. Hack, defined by urbandictionary.com
A temporary, jury-rigged solution, especially in the fields of computer programming and engineering: the technical equivalent of chewing gum and duct tape. Compare to kludge.
That's definition number two, not to be confused with "hacker," the first definition:
To program a computer in a clever, virtuosic, and wizardly manner. Ordinary computer jockeys merely write programs; hacking is the domain of digital poets. Hacking is a subtle and arguably mystical art...
That last one I would more readily attribute to a Professional, though when you start talking mystical I think overly complicated.

My definition of Hack is pretty much the same. Someone who knows enough to get the job done functionally, but fails to take into account the bigger picture.

For example, your requirement is to store credit card numbers. The design phase, for a Professional, would include questions like:
1. Should we store this encrypted?
2. Who/what will be able to "see" this number?
3. What built-in options are available to help secure it?
4. Will it propagate to another system?

That's for starters anyway.

For a Hack, it would be:
1. Do we store it in a VARCHAR2 or NUMBER field?

And then?

And then it ends. Coding begins.

Hacks say things like:
"We'll get to that later."

"We don't have time for that right now."

"The business needs this NOW." (i.e. we don't have time for that right now).

"Fixing that is too much trouble." (i.e. we don't have time for that right now).

Which leads me to this question:
How do you prove that the Hack's way is wrong or bad for an organization in the long run? Support costs are higher right? Same goes for basic maintenance. Is there research out there that shows this definitively though? I feel like I know this intuitively, that's it is cheaper to spend (a little) more time in design to try and take into account all that you can.

"We don't have time for that right now."

I understand you have to balance what needs to get done with doing it the right way. I've always understood that. I think I had a good upbringing.

"We don't have time for that right now."

Yes, you do.

Who Makes The Decision?

I believe that the Business drives IT, not the other way around. Yes, we know how to automate things, but rarely do you find someone in IT who knows more than the Business.

With that said:
A Professional will give the Business Option 1 (a hack), Option 2 (a true fix) and Option 3 (a blend of 1 and 2). The Business will then make the decision (since they pay our bills right?) based on the information at hand.

A Hack will give the Business Option 1 (the "fix") and Option 2 (technical jargon that sounds like something but doesn't really do anything). The Business will choose Option 1 because they believe that to be their only choice in the matter.

In summary, Hacks do have a purpose...I just don't know what it is yet.

Friday, April 24, 2009

Have You Ever Referred To Yourself As An Oracle Nerd?

<shameless self promotion>
Now's your chance. For a limited time only you can join the ORACLENERD group on LinkedIn and have the ORACLENERD logo display on your profile!
Recruiters will love you. Future employers will understand your dedication to you craft. Friends will envy you.

Just send $19.95 to...act now and it's only $9.95! Be one of the first callers and...
</shameless self promotion>

Thursday, April 23, 2009

Time Periods

I've written before about populating your TIME dimension in the datawarehouse. What about a simple normalized table in your OLTP environment?

PERIODS table to the rescue.

I didn't invent this of course, I learned it from my first boss. I'm not sure whether he came up with the idea or found it on his own.

Disclaimers aside, the PERIODS table allows you to build dynamic reports without having to resort to hard coding or the like. The concept is simple, there are periods of time (PERIOD_TYPE_CODE) like Day, Week, Month Quarter and Year, and you just map the from date and the thru date.

The tables are defined as follows:
CREATE TABLE period_types
(
periodtypecode VARCHAR2(20)
CONSTRAINT pk_periodtypecode PRIMARY KEY
);


CREATE TABLE periods
(
periodid NUMBER(12)
CONSTRAINT pk_periodid PRIMARY KEY,
date_from DATE,
date_thru DATE,
periodtypecode
CONSTRAINT fk_periodtypecode_periods
REFERENCES period_types( periodtypecode )
);
INSERT statements for PERIOD_TYPES:
INSERT INTO period_types( periodtypecode ) VALUES ( 'DAY' );
INSERT INTO period_types( periodtypecode ) VALUES ( 'WEEK' );
INSERT INTO period_types( periodtypecode ) VALUES ( 'MONTH' );
Now we need to populate the PERIODS table. First up, DAYS:
INSERT INTO periods
( periodid,
date_from,
date_thru,
periodtypecode )
SELECT
periods_seq.nextval,
startdate,
enddate,
'DAY'
FROM
(
SELECT
TO_DATE( '31-DEC-99', 'DD-MON-YY' ) + rownum startdate,
TO_DATE( '31-DEC-99 23:59:59', 'DD-MON-YY HH24:MI:SS' ) + rownum enddate
FROM dual
CONNECT BY level <= 10000
);
This will give you 10,000 records starting on January 1, 2000.

WEEKs
INSERT INTO periods
( periodid,
date_from,
date_thru,
periodtypecode )
SELECT
periods_seq.nextval,
startdate,
enddate + 6,
'WEEK'
FROM
(
SELECT
TO_DATE( '31-DEC-00', 'DD-MON-YY' ) + rownum startdate,
TO_DATE( '31-DEC-00 23:59:59', 'DD-MON-YY HH24:MI:SS' ) + rownum enddate
FROM dual
CONNECT BY level <= 10000
)
WHERE TO_CHAR( startdate, 'D' ) = 1;
To generate the WEEKs data, you could simply use the records created for DAY (like I did with MONTHs below), but I was lazy.

Finally, MONTHs:
INSERT INTO periods
( periodid,
date_from,
date_thru,
periodtypecode )
SELECT
periods_seq.nextval,
date_from,
ADD_MONTHS( date_from, 1 ) - ( 1 / 86400 ),
'MONTH'
FROM periods
WHERE periodtypecode = 'DAY'
AND TO_CHAR( date_from, 'DD' ) = 1;
OK, so how do you use this?

Simple, wherever you have a query that uses time as a driver or component, you simple do WHERE time_column BETWEEN date_from AND date_thru. What that will do is generate a record for every period type that it falls in. So given one record in your driving table, you'll get three records back when joined to the PERIODS table. One for DAY, one for WEEK and one for MONTH. Now your users can look at their data in a couple of different dimensions and best of all, no more hardcoding!

How does this differ from the TIME dimension?

The TIME dimension is a de-normalized table with TRUNC( date_of ) (or a surrogate, but I'm not getting into that debate here) as the key. In that record you will have different views of that time like what month it fell in, what quarter, what year, etc. You'll get one row back given the query above but you'll be able to view all the different time dimensions from there.

Tuesday, April 21, 2009

Where is Tom Kyte?

In Tampa of course for the annual Suncoast Oracle User's Group Technology Day.

Sadly I will miss this year's event due to the fact that, 1, I have no vacation time saved up and 2, I'm going to COLLABORATE 09 in Orlando in a couple of weeks.

This is a great event, so if you are in the Tampa Bay area, go. Did I mention it was free?

COLLABORATE 09: OAUG, IOUG and Quest

I got my paperwork today.

I'm taking the family up on Sunday May 3rd to Orlando.  While I "work" (seriously, why don't I consider this stuff work?  I have to have problems) the family will be living it up at the Walt Disney World complex.

Changing jobs sort of made me push it aside for awhile, but now it's time for work.

I may get the opportunity to interview some OAUG officials:
Raymond Payne - President of OAUG?
Jan Wagner - ?
Patricia Dues - ?

Me thinks I have a bit of homework to do as I don't know any of them.

How about you? Any suggestions? Anyone you would like me to speak to? Do you care? Let me know.

Monday, April 20, 2009

Mentoring

At my previous job, I was very fortunate to be surrounding by some incredibly smart people. Start-ups tend to attract those types on both the business and IT side. Now those of you who work for Oracle or who work for some of the larger companies out there may be surrounded by these types.

I've typically worked at small companies and I think that makes it harder. My first boss I believe would fall into the "incredibly smart" category. It should go without saying that the other people are not smart as well, I'm talking the best of the best. People you could truly learn from. There's always a catch though...what if they don't like to teach or mentor?

My first boss hired me as a reports developer and allowed me a fair amount of room to grow. I felt like it was too slow so I moved on. Looking back on it, I think I made the right decision but I probably didn't go about it the right way.

One of the big reasons I chose to go to Revolution Money was the opportunity to do and learn cutting edge stuff. The goal (of the company) was to match Visa in transaction per second (if I remember correctly that was set around 5 or 6K). They had people who had built high-transaction/high-volume applications all over the place. "All over the place" may be an exaggeration, IT was only 20 or 25 strong at the time. "Relatively speaking," how about that? There was a high percentage of these people.

John Davies
Previously global head of architecture at BNP Paribas and JP Morgan Chase, CTO and co-founder of C24 recently sold to IONA Technologies (Nasdaq: IONA). Author of several Java books published by Wrox, veteran speaker at technical and banking conferences world-wide, expert in high performance/low latency enterprise and global architectures
Edward Katzin
He was the CTO for Madison Tyler LLC a proprietary trading company that is making the most of the capital markets shift towards electronic trading platforms in the United States and abroad.

Edward was Vice President – Technology Strategy with Visa before joining Madison Tyler and was responsible for leading the development of Visa’s technology strategy to address ever evolving challenges specific to ensuring the reliability, security, and cost effective operation of Visa’s systems, network, and application infrastructure.

As a consultant for DiamondCulster (now Diamond Management & Technology Consultants Inc.), Edward was a Principal and Senior Technical Architect responsible for designing and deploying large scale information systems solutions that align the deployment of technology solutions with business strategy and maximize the return on investments in technology.
Miladin Modrakovic [ blog ]

Again, nothing good in his LinkedIn profile so I get to make it all up. I've talked about Miladin before here and here. He's the kind of DBA who you actually believe practices the dark arts. I'm sure I could do what he does given an almost infinite amount of time. He was never afraid to show me his work, i.e. how he arrived at an answer. That's a great trait to have.

Bob Kerner

Bob doesn't have a nice summary of his skills on LinkedIn so I'm going to have to make stuff up. As far as street cred goes, he was the Chief Architect at AOL from 1999 to 2005. Despite what you may think of the company, it is still a force out there. He's also done stuff which I probably should not or can't mention else he'll have to kill me. I have a great amount of respect for this guy. Not only does he know what he's talking about he'll show you exactly how he came to the conclusion. He held a few lunch and learns from XML (schemas) to cryptography (how and why). It's not been often in my career that I've come across someone with so much experience that is as willing as he is to teach. My daily interactions were a constant opportunity to learn something new. Cyclomatic Complexity was from him. He also spoke of Information Theory and Marshalling.

There's my ode to mentors.

I try and do the same for people when the opportunity presents itself. For some reason I tend to focus on those on the business side who show a serious aptitude for data related activities.

So if you have someone in your organization who shows a higher than normal interest, take them under your wing. If you are a newbie, throw yourself at their feet and ask them to help you.

Monday, April 13, 2009

projectEUREKA

An old friend of mine who I worked with on Oracle a few years back has, with some friends, just launched a new website, projectEUREKA
...is a collaboratively edited site for problem solvers/inventors - regardless of problem or field.

We are a bunch of math enthusiasts who decided to create a framework for submitting and solving problems. However, the framework is not limited to math problems, any problem, puzzle, or trivia question can be submitted to project Eureka. Similarly, for people who prepare for various tests project Eureka offers the possibility of grouping multiple problems in a test
It sounded eerily familiar to something Chen Shapira linked up here awhile back, Project Euler.

If you get a chance check it out.

Sunday, April 12, 2009

What is a PL/SQL API?

As a follow-on to yesterday's post on PL/SQL APIs, I decided to describe what I consider to be an API in PL/SQL. Actually, it was an after-thought and then John T went into further details in comments on that post. I felt it was more than a comment should be so...

First, what is an API?

As defined by Wikipedia:
application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.
Easy enough. I think the vast majority of readers understand that.

What is an PL/SQL API?

The way that I would define a PL/SQL API is (preferably) one package that provides the interface to one or more underlying tables. Let's take the EMP table for instance. If I were to define an API for that it would be something like this (pseudocode):
  • Create Employee
  • Update Employee
  • Update Employee Department
  • Update Employee Salary
All other code would call one of these procedures/functions to perform the specific action. No one else would write a direct update on EMP, no matter how small or seemingly trivial. If something outside of the 4 defined actions was needed, then it would be added to the preceding package.

Why use a PL/SQL API?

In all likeliness, the person who is adding the underlying table or tables is going to be the subject matter expert (SME). They should be the ones to define the actions to be performed against that set of tables.

Security is a factor here as well. Would you give INSERT/UPDATE/DELETE to non application users or would you require them to use the PL/SQL API? If I had my way, no one would have any direct DML to any table in the application.

How about support and maintenance? If you make a change to a table you should only have to change in 1 or 2 locations (say the package and a view), not 10, or 20, or 30. If you have it contained in just a couple of locations most minor changes would be relatively easy and quick to complete. If it's spread out across the database, you end up obscuring or hiding many of your data structures.

Finally, to John T's point, there is encapsulation, which hits on a few points noted above. I'm not going to quote the entire page (though it would be appropriate), but I will come close:
...encapsulation is the hiding of the internal mechanisms and data structures of a software component behind a defined interface, in such a way that users of the component (other pieces of software) only need to know what the component does, and cannot make themselves dependent on the details of how it does it. The purpose is to achieve potential for change: the internal mechanisms of the component can be improved without impact on other components, or the component can be replaced with a different one that supports the same public interface.

Encapsulation also protects the integrity of the component, by preventing users from setting the internal data of the component into an invalid or inconsistent state.

Another benefit of encapsulation is that it reduces system complexity and thus increases robustness, by limiting the interdependencies between software components.

...For example, a simple digital alarm clock is a real-world object that a lay person can use and understand. They can understand what the alarm clock does, and how to use it through the provided interface (buttons and screen), without having to understand every part inside of the clock. Similarly, if you replaced the clock with a different model, the lay person could continue to use it in the same way, provided that the interface works the same.
I think that sums it up nicely.

So how about you? PL/SQL APIs?

Saturday, April 11, 2009

PL/SQL APIs

I was once told by a colleague, after sending out a note encouraging them, that they were not convinced of the effectiveness of PL/SQL APIs. I really didn't know what to say. Further, their past experience with them was bad. Huh?

As I went to do a little research on PL/SQL APIs, the first result I got was



What do you do with a response like that? Just submit it to Oracle WTF and be done?

"...not convinced of the effectiveness of PL/SQL APIs..."

Oracle has been selling that for years hasn't it? The Packages and Types Reference manual lists about 218 public packages which obviously doesn't include the internal only ones. Oracle seems to have bought into the PL/SQL API.

Steven Feuerstein wants you to build them. I personally don't like his style, but there is no arguing results. TAPI, or table based API, suggests building a simple API that performs the INSERT, UPDATE and DELETEs for each and every table and then using that TAPI in your APIs up a layer. My friend Daniel McGhan has even built a TAPI generator, tapiGen, which will create all the code for each table.

I'm pretty sure Tom Kyte is a fan as well. Unfortunately his site is down at the moment so I cannot link up to anything in particular. Hasn't he written some of the most predominant books on Oracle, specifically developing applications with Oracle?

I am still stunned that I heard that. I would expect it from Mr. M perhaps, but I think even he would appreciate the advantages of not having to write any SQL.

So how do you respond? What do you say?

Friday, April 10, 2009

The Computer Setup

I get to setup my new computer.

Here's a list of tools I'm installing:

SQLDeveloper, for those moments I wanted to be able to easily download data. Great database navigator as well. I create reports here and in JDeveloper as well.
JDeveloper, though I won't be using Subversion for work, I'm hoping there is a plugin for source control that I can use. Still my favorite editor of choice.
7zip
CubicExplorer, which is a tabbed windows explorer and fairly nice.
WinMerge, always nice to be able to easily compare files.
FastStone Capture - screen grab utility. You can also add arrows and stuff to your captured images.

Firefox was already installed so I imported my JSON file with my standard links (Oracle Documentation, Google Stuff, etc). I needed some FF Add-ons though:
Meebo, which I'm trying out for the first time.
ScribeFire, for the occasional quick post.
Shareaholic, for quickly sending links out.
Delicious, naturally.

Oracle Database was already installed along with BI Publisher, so I didn't have to worry about those. I'm sure I'll have others, but these are the basics.

Wednesday, April 8, 2009

La Revolución ha Muerto

For me anyway. I am moving along.

I will certainly miss all the friends I made and miss the opportunity to work with some very, very smart people. I wish I could have stayed, especially after the announcements yesterday (here, here, here, here, here, here, and here).

Bradd, this is not an April Fool's Joke. ;)

I guess the good news is that it wasn't involuntary. Will be added to the Tampa Timeline.

I start a new job on Friday.

Tuesday, April 7, 2009

Poor Man's Data Vault - Update

It's been a little over a month since I've written anything about it and seeing as how I have not posted anything Oracle related in what seems like years.

A quick reminder, Poor Man's Data Vault, PMDV for short, is a very basic tool to allow you lockdown your production environment. In essence, you are required to "submit" a ticket before any DDL is allowed in your specified schemas. When you "submit" or run a procedure you must supply a ticket number or description. Obviously there is no way to verify (yet) that this is an actual ticket, but it is a start. The ideal in the regard would be to query your ticketing/bug tracking database to validate. Currently we have a pretty sweet integration of Subversion, Fisheye, Bamboo and Jira. If we add the ticket number to the Subversion comments, we can then see (via Fisheye) what code is attached and even better do a diff right in the browser.

So, using Jira would be nice, but it's out of scope at this time.

Here's the final model I came up with:



PMDV_WORK is the driving table. It stores the records on the deployment or fix. PMDV_INVALID_OBJECTS takes a snapshot before, during and after the deployment of objects in an INVALID state. PMDV_CHANGED_OBJECTS will capture all the objects that were affected by the deployment (new and altered).

I'm starting with those 3 (because I forgot what I was going to do with PMDV_PRIVILEGES). I have created those 3 tables and checked them into source control (Google Code). You can find the project here. If you would like to join the "project" (yes, it's in quotes because I haven't done a whole lot but would love to actually finish one. Besides, I need all the help I can get.) drop me a line chet at oraclenerd dot com (does that really work? spelling out the email address I mean).

Sunday, April 5, 2009

Keep it Down

I've tired (for the moment anyway) of adding Part II, III, etc. to the titles. So I'm going with a whole new name.

This is a followup to last week's post, Shut Your Mouth! In the comments Niall Litchfield (love the hair!) left a link to a brilliant article, Unskilled and Unaware of It.

I know I have read that or a summary of it at some point in the last few years.

The summary of the article reads:
People tend to hold overly favorable views of their abilities in many social and intellectual domains. The authors suggest that this overestimation occurs, in part, because people who are unskilled in these domains suffer a dual burden: Not only do these people reach erroneous conclusions and make unfortunate choices, but their incompetence robs them of the metacognitive ability to realize it. Across 4 studies, the authors found that participants scoring in the bottom quartile on tests of humor, grammar, and
logic grossly overestimated their test performance and ability. Although their test scores put them in the 12th percentile, they estimated themselves to be in the 62nd. Several analyses linked this miscalibration to deficits in metacognitive skill, or the capacity to distinguish accuracy from error...
As Niall suggested, try to read it self-critically.

I think I know when I don't know...but I'm sure there have been plenty of occasions where I thought I knew but I really didn't. I'd also like to think that I don't do this any longer, that it was a fancy of youth, but I can't be so sure. Most recently it would have been in the consideration of building out a highly scalable system.

Anyway, have you ever worked with someone so described? If so, how did you go about dealing with it? Did you make an effort to teach or give "negative" feedback so they might learn? I'm thinking every domain (IT, Financial Services, etc) has those that fall into this category? How do you fix it? Can it be fixed?

Thursday, April 2, 2009

Shut Your Mouth!

Those of you who know me, know that I have a tendency to talk a bit. I've been counseled by many (wife, friends, co-workers, etc) to keep my thoughts to myself but I still have a "problem" with it.

I've been known to send out emails late in the night to my CIO...only to do the same exact thing a couple of weeks later at the start of a holiday.

Just a little advice here, if you do decide to do something like this. Don't do it on Friday night where you have all weekend to think about whether or not you should have sent it. Especially don't do it on a Friday night if you have Monday off too.

Starting a blog helped, a little. I could scream out into the nothingness that is the 'tubes. There wasn't as much back and forth as I would like though. It's gotten better over time as more and more people read this blog, but nothing can replace that instant gratification of a healthy discussion.

And healthy are the ones I am talking about. I don't (necessarily) mean that I just talk to talk. I have opinions on just about everything software related. Architecture. Design. Style. Best Practices. Performance. I'm even worse when it comes to databases. I think I have a pretty good grasp of how to model data. I've been creating diagrams since before I became an IT guy. I understand when it is good to normalize and when it is good to denormalize.

I am very passionate about what I do. I love what I do. Every other week I get a paycheck and I'm stunned that someone pays me to do this.

You know what, if they're gonna pay me all this money, I'm not so sure they want me to keep my mouth shut.

The usual caveat: When a decision is made, with or without my input, I will keep my mouth shut about it. Either I accept the decision or I start looking for other work...that's my decision to make. But I won't be that guy who keeps arguing the point long after. At least I try not to be, I ain't perfect.

It also goes without saying that not all people are equal in a discussion. Some have strengths that others do not.

I think a good discussion can lead to better products. There is plenty to be learned through good discussion. A multitude of view points can force you to reconsider your own position; possibly strengthening it for future debate or forcing you to abandon that idea.

How could that ever be bad?

Not everyone feels the same way of course. Not everyone likes these types of discussions. Either they feel that it's not my place to disagree (i.e. I'm not qualified) or they just don't like being challenged. If my boss says stop, I stop. If a peer says stop I'll ask why.

So, do you know how to keep your mouth shut? Any good stories of how it went bad? or good? Please share...there's much to learn from the discussion.

Wednesday, April 1, 2009

April Fools!

Suffering from a bout of writer's block I impulsively decided to post that I had lost my job again. I figured it would be somewhat plausible given my recent past. I think it worked, a little. I realized that I did tag it "funny" but left it on there. Notably, Gary caught it.

I did email Lewis and Dom privately to tell them I was being funny. Bradd caught it himself going so far as to delete his original post.

I started to worry about jinxing myself, you know, the self-fulfilling prophecy sort of stuff? One way or another, it's out of my hands. It was funny to me at least. I think Jake chuckled a little bit but didn't want to acknowledge my small prank.

I was paid back by LC when I got home...he popped out of the bushes and scared me. Followed by another sneak attack shortly there-after.

Happy April Fool's Day!

Not Again...

Seriously...could I have a worse year?

I've been laid off again!

I'm starting to get a complex...
Mr. Justice,

Due to the economic downturn...yada yada yada