I was reading through some of Tanel Poder's older blog posts and came across one he did entitled: Running SQL scripts from remote locations using HTTP. Wow! How many times could I have used this before now?
I've used SQL*Plus forever but just never realized that I could execute a script stored on my web server like this. I won't repeat Tanel's details here, but go take a look at this post to see a few examples.
This will be something I implement and am sure it will be really helpful. I love it when I learn something new! Thanks Tanel!
Friday, May 30, 2008
Hats
I was just thinking about the analogy that is often used about someone wearing a lot of different hats. As far as actual hats go, it's kinda funny...I love hats, but I don't really wear them that often. I have quite a collection of different hats: baseball hats with lots of different logos, floppy sun hats, visors and I've even owned a cowboy hat or two in days gone by.
But, the idea of wearing hats as an indicator of the different roles a person fulfills is what I've been pondering. I wear a lot of hats. In my business life, I'm a teacher, a developer, a DBA, a consultant, a researcher, a speaker, a writer, a student, a designer, a teammate, a manager, and on and on. In my personal life, I'm a daughter, a grand-daughter, a sister, an aunt, a partner, a mother, a friend, and on and on. A lot of adjectives come to mind too that I suppose would be hats too: perfectionist, seeker, wanderer, peace-maker, and on and on.
So, like I said, I wear a lot of hats. Some days it seems all I do is switch hats. Sometimes it gets tiring. At the end of the day, I occasionally feel as if I haven't gotten much accomplished because it seems like I spent most of my time shifting gears ... and switching hats.
But, I think I really like having so many hats to wear. Imagine if you only had one hat, and you wore it all the time. It'd get dirty and worn and might not even fit so well after a time...but if it's your only hat, you'd have to keep wearing it.
So, even on days when it seems all I do is change hats, I think I'll look back at the end of the day and be glad for it. If variety is the spice of life, and I've got lots of hats, then my life should be quite interesting, and spicy, indeed. And speaking of interesting....


What kinds of hats do you wear?
But, the idea of wearing hats as an indicator of the different roles a person fulfills is what I've been pondering. I wear a lot of hats. In my business life, I'm a teacher, a developer, a DBA, a consultant, a researcher, a speaker, a writer, a student, a designer, a teammate, a manager, and on and on. In my personal life, I'm a daughter, a grand-daughter, a sister, an aunt, a partner, a mother, a friend, and on and on. A lot of adjectives come to mind too that I suppose would be hats too: perfectionist, seeker, wanderer, peace-maker, and on and on.
So, like I said, I wear a lot of hats. Some days it seems all I do is switch hats. Sometimes it gets tiring. At the end of the day, I occasionally feel as if I haven't gotten much accomplished because it seems like I spent most of my time shifting gears ... and switching hats.
But, I think I really like having so many hats to wear. Imagine if you only had one hat, and you wore it all the time. It'd get dirty and worn and might not even fit so well after a time...but if it's your only hat, you'd have to keep wearing it.
So, even on days when it seems all I do is change hats, I think I'll look back at the end of the day and be glad for it. If variety is the spice of life, and I've got lots of hats, then my life should be quite interesting, and spicy, indeed. And speaking of interesting....


What kinds of hats do you wear?
Thursday, May 29, 2008
"dual"-ing for resources
Oracle 9.2.0.6 on AIX
Application module running in 12 concurrent streams (12 CPU box)
Total response time (%R) = 18 minutes 55 seconds
Total executions of "SELECT ... FROM dual" = 1,087,770
Total logical I/O's = 3,263,033
Contribution to R = 32.9%
Actual code:
I believe this is the most inefficient way I've ever seen to determine the next business day (not counting holidays) when an account will become n days delinquent. Admittedly, this code gets better (performance wise) in v10 with the addition of FAST DUAL, but still... There's only one SELECT (on the holiday table, UTRHLDY) that appears to be needed at all. Why use DUAL to calculate and format dates? Ever hear of variable assignment?
I suppose you've gotta laugh, huh? This may be one for the Oracle WTF!
Application module running in 12 concurrent streams (12 CPU box)
Total response time (%R) = 18 minutes 55 seconds
Total executions of "SELECT ... FROM dual" = 1,087,770
Total logical I/O's = 3,263,033
Contribution to R = 32.9%
Actual code:
PROCEDURE next_delq_date
(DUE_DATE IN VARCHAR2,
DELQ_DAYS IN NUMBER,
ACTION_DATE IN OUT VARCHAR2)
IS
DAY_NUM NUMBER;
HOLIDAY_DATE VARCHAR2(11);
BEGIN
BEGIN
ACTION_DATE := DUE_DATE;
FOR DAYS_COUNT IN 1..DELQ_DAYS LOOP
SELECT TO_CHAR(TO_DATE
(ACTION_DATE,'DD-MON-YYYY')+1, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
SELECT TO_CHAR(TO_DATE
(ACTION_DATE,'DD-MON-YYYY'),'D')
INTO DAY_NUM
FROM DUAL;
IF DAY_NUM = 1 THEN
SELECT TO_CHAR(TO_DATE
(ACTION_DATE,'DD-MON-YYYY')+1, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
END IF;
IF DAY_NUM = 7 THEN
SELECT TO_CHAR(TO_DATE
(ACTION_DATE,'DD-MON-YYYY')+2, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
END IF;
LOOP
HOLIDAY_DATE := NULL;
BEGIN
SELECT TO_CHAR(UTRHLDY_DATE,'DD-MON-YYYY')
INTO HOLIDAY_DATE FROM UTRHLDY
WHERE UTRHLDY_DATE = to_date(ACTION_DATE,'DD-MON-YYYY')
AND ROWNUM < 2;
EXCEPTION WHEN NO_DATA_FOUND THEN
HOLIDAY_DATE := NULL;
END;
IF HOLIDAY_DATE IS NULL THEN
EXIT;
END IF;
IF HOLIDAY_DATE IS NOT NULL THEN
SELECT TO_CHAR(TO_DATE(ACTION_DATE,'DD-MON-YYYY')+1, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
SELECT TO_CHAR(TO_DATE(ACTION_DATE,'DD-MON-YYYY'),'D')
INTO DAY_NUM FROM DUAL;
IF DAY_NUM = 1 THEN
SELECT TO_CHAR(TO_DATE(ACTION_DATE,'DD-MON-YYYY')+1, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
END IF;
IF DAY_NUM = 7 THEN
SELECT TO_CHAR(TO_DATE(ACTION_DATE,'DD-MON-YYYY')+2, 'DD-MON-YYYY')
INTO ACTION_DATE FROM DUAL;
END IF;
END IF;
END LOOP;
END LOOP;
END;
END;
I believe this is the most inefficient way I've ever seen to determine the next business day (not counting holidays) when an account will become n days delinquent. Admittedly, this code gets better (performance wise) in v10 with the addition of FAST DUAL, but still... There's only one SELECT (on the holiday table, UTRHLDY) that appears to be needed at all. Why use DUAL to calculate and format dates? Ever hear of variable assignment?
I suppose you've gotta laugh, huh? This may be one for the Oracle WTF!
Wednesday, May 28, 2008
Mistakes

I've often learned more from my mistakes than my successes. And, I've also felt more pride in myself when I've persevered through several failed attempts when I finally got it right.
So many times I see people unwilling to try something outside their comfort zone (myself included), because they're afraid of failure. When I'm on customer site, I'll often see people afraid to try new things (code changes, adding an index, etc.) even when they have proof provided to them of how doing something different can/will improve things. They're afraid to try even when the odds look very much in their favor.
Why do we fear the attempt so much? Do we think we'll lose our jobs, our good reputation, or even our anonymity? Do we just want to fly under the radar and do enough to get by and not call attention to ourselves, neither good nor bad?
I'm not suggesting to run willy-nilly making unthinking mistakes when it counts over and over. Make mistakes when you test. Make mistakes as you invent. Make mistakes on the way to the finish line. Taking time to do it right the first time includes the time it takes to make mistakes. Mistakes now are less costly than mistakes that are found later. There may well be things that are "mistakes", like a performance problem with a piece of code that didn't show up until it got used under heavy load. But, if you've done your job upfront, you'll have included a way to diagnose those issues quickly if/when they do occur (i.e. code instrumentation). If you've done that, you've built in your safety net for "if" something does go wrong.
I was reminded by this quote that it's not bad to make a mistake. Mistakes help bridge the gap between inexperience and wisdom. I often feel like I'm on a v-e-r-y long bridge, but the journey, and the view, are certainly beautiful.
Tuesday, May 27, 2008
Meerkat Motto

Meerkat Motto
Respect the Elders,
Teach the Young,
Cooperate with the Family.
Play when you can,
Work when you should,
Rest In Between.
Share your Affection,
Voice your Feelings,
Leave your Mark.
Wise advise if you ask me.
Monday, May 26, 2008
Ticket to Ride

My neighbor got me hooked on a game called Ticket to Ride. It's a board game that also has an online version as well as a version you can play with just cards. Anyway, when I want to "not think", I play TTR. It is made by a company called Days of Wonder. Here's the description of the game from their site:
Ticket to Ride is a cross-country train adventure in which players collect and play matching train cards to claim railway routes connecting cities throughout North America. The longer the routes, the more points they earn. Additional points come to those who can fulfill their Destination Tickets by connecting two distant cities, and to the player who builds the longest continuous railway.
I don't know why, but I fell in love with this game. There is some strategy to it but it's not very complex. It's just simple, fairly mindless fun. I play online mostly because it's easier to find people to play with that way. Even at 2am here, I can find somebody logged in and ready to play from half-way around the globe where it's late afternoon. You gotta love how small the internet makes the world!
Anyway, here's my latest game board after I won:

I'm the green trains. I made it from Vancouver all the way across the country to New York, then down to Atlanta and finally Charleston.
Gee...if I'd flown all that way, it would've taken me the better part of today to get there. As it is, I just spent 20 minutes crossing the country and never left my chair in front of my trusty MacBook Pro.
Now, if somebody would just figure out how to make real travel that easy, I'd be really happy!
Sunday, May 25, 2008
Complex, simple, huh?
Which one is ON?
This?

Or this?

I know the second one is ON. But to tell the truth, I'm not really sure if the first one is ON or OFF. Anyone care to enlighten me?
Neither one is as simple as it should be. I think the second one is certainly more clear as to the object's state. But if you're going to simplify, why not just go all the way and put the word ON on the right?
This?

Or this?

I know the second one is ON. But to tell the truth, I'm not really sure if the first one is ON or OFF. Anyone care to enlighten me?
Neither one is as simple as it should be. I think the second one is certainly more clear as to the object's state. But if you're going to simplify, why not just go all the way and put the word ON on the right?
Subscribe to:
Posts (Atom)