Wednesday, June 29, 2005

I love it...

OK, a break from Oracle and political talk....

I got this link and looked at it. I love this video.... it gives such hope to us older men who wish we could dance....

I have to admit that I sat and watched it three or four times, I was somehow mezmorized by it. Don't know why (I'm weird that way sometimes). Anyway, I like the tune too, so it's all good.


Have a great 4th everyone.....!!!

America Rules! :-D

Friday, June 24, 2005

He's served his country.... One solders thoughts...

While traveling in Oregon I met a young man while sitting at the pool with my family. He was up here, fishing with his father. As it turns out, he is 5.5 years into his 6 year commitment with the US Air Force. We had a long talk about Iraq and Afghanistan and the overall terror issues. I want to share some things he said to me:

1. He hates war. He said that anyone who likes war is crazy. I agree with him.

2. He says that he is not convinced that there are not WMD's in Iraq still. He says that they are constantly finding buried stuff. He says you would be amazed at what they buried, including airplanes.... He's also pretty sure that a lot of stuff got out of the country and moved it to places like Iran and Syria.

3. He feels like we might have been able to do a bit more negotiation before we went into Iraq, he feels like Afghanistan was done just right though. However, he also stated (as I have earlier in this blog) that there is clear moral justification for this war. He thinks everyone should see the pictures of the many people killed by Sadam. I have a link to such pictures earlier in this blog. If you think this is not a moral war, go look at them.

4. He is totally disgusted with the press. He states that the press has clearly not done a fair job reporting this war. He says that they do not show the good things that have happened, they have not shown the positive results of this war. He feels like the press have made this war worse, because they have kept the military from doing things (life effectively sweeping cities) that really needed to be done. Thus, the insurgency remains strong. I agree with him, the press is not doing our country any favors.

5. He feels like the Iraqi people will get sick of the insurgents, and when they do and they start standing up for themselves and policing their own people. It is then when things will really start to get better.

6. One other thought of his.... if you didn't vote, then you don't have any room to disagree about anything.

This young man has done his time, and served our country well. I salute him. He also told me one other very chilling thing..... he didn't ask me to keep it to myself, so I'll share it here. I've not heard about this in the press, but I have no reason not to believe him. I'm told by this young man that there was a terrorist cell of 3 men broken up at NORAD. Now *that* is scary. I've looked for any news reports on this incident and I can't find any. So I don't know if it was hushed up, or if I was being fed a line. Still, I thought I'd share it with you just the same.

Salutes to the men and women in uniform!

Wednesday, June 22, 2005

Hello from Oregon...

I'm writing to you from the edge of the Columbia River on the Oregon side. It's a cloudy morning, typical of this place. Oh how I do love the Pacific Northwest. I'm here with my wife and daughter attending some family related stuff for my wife. Still... I can't seem to stop working either. However, sitting here from the balcony of my room, the view is just stunning and it's just unbelievable that I can sit here, wireless, work on my porch and enjoy this view. I can even ignore the fact that my wireless is soooo slow and that my battery is about to give out on me.

Perhaps the best part of this for me is that I have not one but TWO mainlines running right past me. There are two mainline tracks that run along this part of the Columbia, and there are trains running through here just all the time. I love trains, the sound, the feel, the power, the smell are all just so cool! Couple trains and the beauty of the North West and why would anyone want to live anywhere else?

A very long auto train just passed by on it's way to somewhere... (I need to look up the configuration of these tracks to see where they lead too). I love the rumbling sound as they pass by and the clackity-clack of the cars. We are taking the Empire Builder back to Chicago on Saturday, can't wait for that. The Empire Builder is one of Amtrak's long distance trains from Seattle/Portland to Chicago. It's a 2.5 day ride and it's bound to be beautiful. It's the first time I've ridden her (I've done several other Amtrak long distance train trips before) so I'm looking forward to the experience. I have taken each of my kids on a train trip over the years, it's a tradition that my father started with me, and I wanted to keep it up. Of course, it doesn't have anything to do with the fact that *I* just love trains!

Next week I go and take possession of my new airplane. Can't wait for that. More later! Hope everyone has a great day!

Thursday, June 16, 2005

Zoomie zoom zoom

Ok, so I said in my last blog entry that I had exciting news. This news is that, pending a few more hurdles (like title checks, inspections and so on) I'm the proud father of a bouncing baby 1976 Cessna 150. Wooo Hooo....

I've been flying since I was a kid. My dad and I would toodle around in his Bonanza all over creation. I got my certificate many years ago, but put flying on the shelf as I had other priorities such as raising kids, being a DBA, Karate and other goodies. Not to long ago, I decided it was time to brush the dust off my certificate, get myself a medical and a BFR, get current again and then buy me an airplane.

I found this 150 sitting in Florida and liked the looks of it. It's just an interim airplane, my goal is a Cherokee 6 or a Bonanza in the next year or two, but I wanted this one to go putter around in for now. So, I'll be flying down south in a couple of weeks to look it over and pay for the thing.

I do love flying, and I look forward to getting my boys involved. Right now, I just have my private certificate, but I'm going to start looking into my instrument ticket now... The plane is IFR certified, and having your own airplane is much cheaper than renting. I checked the rental prices on 150's here in the Chicago areas and they are like 100/hr wet, can you believe that?!?!

So, back in the air with me!!

Tuesday, June 14, 2005

Greetings from Dallas!!

On the road again....

This Willie Nelson song seems so appropriate today as I am on the road and I'm in the south. I'm in the big "D" to be exact, Dallas, Texas, for the Oracle Applications User Group meeting they are having here. Lots of traveling this month.... I'm off to Seattle next week with my wife and youngest to see some of my wife's family. I do like Seattle.... Lived there for two years. It's beautiful!!

I like the south (love would be a strong word because of the heat and humidity which I have a strong distaste for). I'm originally from Oklahoma, so I'm not all that far from home down here. I must admit though that the west in particular captures my heart with the mountains, which are woefully lacking here in the Midwest. Chicago may be a great city, big and all that, but no mountains.

I'm presenting on 10046 trace files today. It's a new topic for me at conferences, but an interesting one for sure. I'm demonstrating them in concert with external tables (see my earlier post on those things) and trying to show the crowd whats in there and giving them some ideas on how to mine it.

I'm staying at the Gaylord Texan, the conference hotel. Nice place.

I've got another very non-political post coming up (I'm sure you all will cheer that), probably tomorrow or the next day. A very exciting event in my life has occurred and I can't wait to tell you about it!!

So, come back soon, Ya'all!


Friday, June 10, 2005

ORA_ROWSCN.... New 10g pseudo Column

If you have written code for the web that involves select for update, no doubt you have run into problems where the web session somehow disappeared, and the database didn't realize it. The result is that the record remained locked until you killed the session. I've been involved with several clients now where this is a common problem, so common that they have an automated routine to "clean up" these zombie sessions.

So what do you do if you are writing code, and you don't want to use that pesky FOR UPDATE syntax? Oracle Database 10g offers ORA_ROWSCN!! ORA_ROWSCN provides an answer to consistency, without needing to lock a row. ORA_ROWSCN is a new pseudo column available in Oracle Database 10g. It provides the SCN associated with each individual row in a table when it was read. One thing to note, by default Oracle will not track SCN's at the row level in a table, so you need to enable row level dependency tracking by using the ROWDEPENDENCIES keyword in the CREATE TABLE command. We have noticed no additional performance issues with this feature enabled. Still, it's always a good idea to test things before you just start using them in production! :-)

Here is an example. In an HTMLDB application (but this technique can be used in any kind of 10g application), we want to read in a record from the database and offer the potential to edit the record. We don't want to lock it at this point for a number of reasons (for example, our user might just leave the record up on his/her web browser for an hour). So, we use something like this PL/SQL code when we load our page for the first time:

select, a.adr_id, a.address, a.ora_rowscn,
into :P4710_EDIT_NAME,
from addresses a, place b
where b.place_id=v('P4710_PLACE')
and a.adr_identifier=b.adr_identifier
and a.adr_sequence=b.adr_sequence;

Note in this code that we load in the ORA_ROWSCN values for both the tables/rows we are reading. Now, we make changes to this data, and we get ready to update it. How do we know, though, that someone else has not changed the data?

We could requery the record just before we write it and make sure the data is still the same, but then we really need to use the FOR UPDATE clause again, and we want to avoid that. If we don't use the FOR UPDATE clause, someone could still change the data between the query and the update.

The solution is to use ORA_ROWSCN in your update clause to ensure that the row has not changed since the last time you read it. Here is an example (again, a PL/SQL code block from HTMLDB):

-- Declare the exception
htmldb_record_changed EXCEPTION;
-- Update the HSD-unit_codes table
update addresses
set address=v(':P4710_EDIT_ADDR')
where adr_identifier=v('P4710_ADR_IDENTIFIER')

-- See above where we compare the ROWSCN list value to the
-- current ORA_ROWSCN of the table?

-- Note that SQL%ROWCOUNT=0 if we didn’t update a row.
-- This means that the update failed.

-- We clear the cache of the page.
-- This raises the error to the user that the record was already
-- changed.
raise_application_error(-20000, 'Record has already been changed by another user.');
-- I set this to allow a display message to be printed on
-- the refresh.
end if;

Note in the WHERE clause that I check the recorded ORA_ROWSCN against the current value of ORA_ROWSCN for that table. If the record has changed since I read it, then ORA_ROWSCN for the row will be different than the one we stored when we did the earlier select, and then an exception will be raised.

I've found this to be much easier to use that HTMLDB's automated row processing myself. What do you think?


6/11/2005 Note: I edited this blog to fix an entry that was in error. It indicated that the ROWDEPENDENCIES keyword could be used with the alter table command. In a comment, Tom Kyte has pointed out this is not the case, so I've made that correction here.

Thursday, June 09, 2005

Expectations... Friends... Thoughts

Expectations are funny things. If you are an Oracle DBA author, people expect you to post Oracle related things on your blog all the time. Silly that, even if my blog sub-title clearly says that this is about my life... Also, don't expect that I'm going to be serious all the time either.

I have tried to interject some Oracle related stuff, and I will have another post on something Oracle related soon, promise!! :-) More personal stuff is coming, so feel free to leave if that doesn't interest you. I won't be offended.

In spite of my second-degree black belt, I'm not that combative really, and I think that anybody who really knows me knows that about me. In fact, I'm the anti-combatant, I'm all about discussing the merits of whatever the thing is (unless, of course, it happens to be the business end of a weapon, then I'm combative!) .

I'm a pretty faithful friend folks... but I choose my friends carefully. There is little I would not do for my true friends, there is little I would not trust a true friend with. There is nothing better than a true friend.

I pretty much respect other peoples point of view. I will admit frustration (even irritation and on occasion disgust) though with people who are so polarized that they can't discuss anything without loud rhetoric, emotion and mud slinging (and I hate it even worse when I allow myself to be drawn into those kinds of discussions).

I'll even admit that blatant partisianship (on either side) just makes me want to yell at someone or break a board or two or five. I will respect your point of view all day long if you will just provide a fact or two or at least a decent moral argument. That's all I ask. Heck, I'm happy to allow Multiple anonymous posts if they are insightful and smart, even if I don't agree with them.

If I provide facts you disagree with, don't just tell me that I'm crazy, or that I don't know what I'm talking about... At least provide some input of value, of worth and meaning and leave the drivel for the two year olds (ok, that's getting a bit combative!). I freely admit that I can be wrong, I have been wrong and I will be wrong in the future I'm sure. It happens, I'm human.

Just don't come here to be rude, this is not the blog for that. I'm not here to offend, and if I have I apologize. Really. If you are offended by something I say, send me an email or post a comment here, that is not my intent.

I do have an opinion, and will freely express it even if it's not popular. If you are offended by differing opinions, then it would be best if you didn't come here, it's that simple.

So....Let's not go to Camelot.... it is a silly place!


Tuesday, June 07, 2005

How do you tell a good DBA?

I've seen many a DBA in my years it seems. I've done technical interviews over the phone and in person. I've been introduced to the DBA staff at many a client site, moving from cube to cube trying to remember names and faces (I'm terrible at names). As a consultant, it seems to me that it's very important to quickly size up the DBA's you will be working with. So, I ask the question, how do you tell a good DBA?

Now, as a consultant, I can't go around giving formal technical interviews. I am not sure this would go over that well....

Me: Hello Mr. X, I have to work with your group and I need to figure out who the good DBA's are and who the idiots are.

Not making friends there.... I kind of pondered on this, and I think I have a subjective set of criteria I use to make some rather rapid decisions. It's not perfect, but it works a good deal of the time:

1. How many books do they have, how worn are they, and WHAT books do they have?

No books, bad news. You are in a managers office.

If the cube is filled with a bunch of 10 year old C books on the book shelves that are dog-eared, but few if any Oracle books, I'm in trouble.

If the cube is filled with a bunch of new Oracle books on bookshelves that look like they have never been touched, you are probably in trouble.

If the cube is filled with only a few, well worn, carefully chosen titles on the bookshelf, you are probably in very good company (but beware, you might have a neat freek on your hands).

If the cube is filled with only a few, well worn, carefully chosen titles scattered all over the place, with paper hanging out of them, dog eared and well used, hey, this is a DBA I can work with!

If the cube is filled with only a few, well worn, carefully chosen titles scattered all over the place, with paper hanging out of them, dog eared and well used, and there are stacks of printed metalink notes, even better!

2. What does the DBA talk about when you meet him?
Ok, if the DBA spends more than 2 minutes talking hobbies or his last vacation.... all wonderful topics, when you sit down to talk, be worried.

If, after a couple of minutes the DBA says, "Hey my hit ratio is 98.9%, how do I make it 99%"... You might have a problem.

If, after a couple of minutes the DBA says, Hey, here is a document on all of our instances, he's probably a good DBA.

If, after a couple of minutes the DBA is demonstrating the HTMLDB application he made that interfaces with the Oracle SGA to produce performance reports without interfering with Oracle itself..... it's time to be scared of this DBA. :-)

3. What is the DBA's response to your request for access

If the DBA's response is: OK, I'll fill out the paperwork and it will take a week....

Well that just simply means you are working at a fortune 5000 company that will be going bankrupt in the next 10 years or so.

If the DBA's response is: Ok, normally it takes a week but I'll take it down and handle it myself so it's done today. This is a *good* DBA most likely, or he knows he's going to be able to shovel off his work on you. One of the two is probably true.

Just a few thoughts....

Subscribe in a reader