Archive for the ‘Non-Oracle’ Category.

Oracle Band-Aids

Recently I’ve been thinking about how often we DON’T fix problems. I mean, we usually make the situation better and often in very short order. But a lot of the time we don’t really fix “the problem”. We just do something to cover it up, or make it less painful. I call it putting Band-Aids on the problem.

The Band-Aid metaphor works on several levels.

  1. Band-Aids don’t actually fix the problem, they just cover it up.
  2. They aren’t meant to be permanent.
  3. And they don’t keep you from stabbing yourself again in another spot.
  4. But they do make it less painful.
  5. And they keep out germs so they keep some problems from getting worse.
  6. And they are cheap (all those boxes in the picture cost less than $20 combined).

There are all kinds of special purpose Band-Aids for special applications. Like the ones that have antibiotics, butterfly bandages for closing big cuts, etc… When it comes to Oracle, my personal favorite Band-Aid is memory. Additional memory covers up a lot of sins. One of the primary design goals of the original Oracle database was to eliminate disk access. This remains a key objective today. You can think of the database as a very sophisticated disk cache. The goal for a lot of systems is to never do real time disk access (with the exception of commit processing). So it stands to reason that memory is a key component (maybe “the” key component) of most Oracle systems. And it’s relatively cheap. There is often a surplus of memory already installed that is just not being used as effectively as it could be. But even if it’s necessary to add an additional memory module to a server, this option is generally very inexpensive when compared to other potential “hardware upgrades”.

Don’t get me wrong, there are a lot of valid reasons for using Band-Aids with Oracle. I know some people that seem adamantly against applying short term fixes instead of addressing the underlying problem. But it seems to me that in certain circumstances (which seem to occur fairly often actually) Oracle Band-Aids are an appropriate response. A few of my favorites reasons for applying them are:

  1. Buying time to figure out what’s really going on and how to fix it
  2. Buying time until the system is decommissioned or a new version is rolled out
  3. Buying time until the developers can get the real fix through change control (and as we all know, sometimes this takes a while)
  4. Just decreasing the pain because it’s a packaged app that we can’t change

I do think we should be vigilant about not overdoing it though. Otherwise our databases end up like the guy in the picture below. Pretty messy and sometimes hard to even figure out what the original intent was.

Along the same lines, keep in mind that Band-Aids often leave a lot of left over trash:

Anyway, that’s my rambling for today.  Just for fun, here are a few more pictures of some unusual Band-Aids.

Feel free to let me know what you think about applying Band-Aids to Oracle systems. And what your favorite (or least favorite) Oracle Band-Aids are.

Shopping Trip

This evening I went to the grocery store with my wife, Jill. It was an interesting trip. I have to admit that I took a sneak peek at the shopping list before I agreed to go, and seeing that there were only 7 items on the list, I figured I could earn some extra points without spending too much time. Sneaky, I know, but I am a little weird about optimizing my time. By way of example, one of the main reasons I have a pony tail is because I once calculated how much time it took to get a haircut every month. The calculation went something like this:

Haircut Calculation
Time Primary Action Snide Comment
0.50 Commute to the barber shop Everything is a half hour away in Dallas
0.25 Wait for an open barber chair Not totally wasted because you could read the 6 year old copies of Field and Stream or the 10 year old copies of Lowrider Magazine - just in case I ever decide to go fishing in my newly restored 57 Chevy
0.75 Actually getting my haircut Takes a little extra time because of barbers need to give advice on everything from re-wiring a house to colonoscopy
0.25 Paying up Again takes a little extra time to listen to advice on tattoo removal (not that I have any tattoos, much less any tattoos that need to be removed, but it just seems rude not to act interested, especially to a guy that’s basically in charge of you public image)
0.50 Commute back to wherever Can take longer if it’s raining because nobody can drive in the rain in Dallas

So that’s a total of 2.75 hours per haircut. Multiply that by 12 times a year and that comes out to 33 hours per year. So that’s almost a whole work week. That just seemed like too much time to commit to such an unrewarding task, so I quit getting my hair cut.

But I digress.

Back to the shopping trip. Like I said, the list had 7 items on it, so I expected a quick trip. Well we get into the store and Jill asks me to get a shopping cart. I’m thinking a little hand basket thingy would be fine, because I’ve seen the list! But I don’t want to tell her that (I’m still being sneaky), so I get the shopping cart. And we proceed down the first isle, stopping every two feet or so to put something in the basket. By the end of the first isle we have at least double the number of items on the list, and by the way, nothing has been marked off the list yet. Just to give you an example, we ended up with 4 bags of chips (Lays Bar-B-Que, Tostitos Scoops, Fritos, and Sun Chips). We’d have had one more (because part of my family likes the Scoop Tostitos and another contingent likes the flat Tostitos) but we had to draw the line somewhere. It wasn’t all my wife’s doing either. We were both throwing stuff into the cart like we were expecting a hurricane to cut off food supplies for the next several weeks. By the time we got out of the store we had 17 bags of groceries. They were the small plastic kind (which I don’t really like - I always say paper when they ask - but I digress again).

I found the whole thing quite amusing, although I don’t think Jill really did.  I asked if I could check the list while we were checking out, just to make sure we hadn’t missed anything. She didn’t really appreciate my humor. (we did forget one of the things on the list by the way)

Anyway, the experience reminded me that trying to get too clever can often backfire. It also reminded me that I am predisposed to make that particular mistake. Implementing a tricky solution to a problem, while it may be intellectually stimulating,  is often not the best approach. The experience reminded of a talk I did a couple of years ago (Creative Problem Solving for Oracle Systems) where I talked about several tendencies that all of us have (to a greater or lesser extent). And how those tendencies can interfere with our ability to solve problems. One of the points of the talk was that being aware of your tendencies can help you avoid pitfalls.

Like Clint Eastwood said, “A Man’s Gotta Know His Limitations”.

Oracle Performance For Developers …

This week I attended the Hotsos Symposium - It was great as usual. There are more smart guys at this event every year than you can shake a stick at. In fact, I often learn as much from the attendees as I do from the presenters.  Here’s a fancy link to the presentation I gave:

Note: I struggled a bit with how to label myself, since I don’t really have an official title. I thought about calling myself a “Senior Oracle Specialist”, but that sounded a little too puffed up. Especially the “Specialist” part. So then I thought maybe “Senior Oracle Guy” would be a little more down to earth. That was better, but it sounded a little too old, like a Senior Citizen. And since I am still in my late 40’s (OK very late 40’s) I am still quite a ways from being a “Senior” I think. Then I thought maybe I should go with something more generic like “Nice Guy and All Around Prince of a Fellow”, but that seemed a little too uninformative (and beside, my former partner used to have that on his business cards). So I decided to go back to the “Oracle guy” idea and considered using something like “Very Experienced Oracle Guy”. That sounded OK, but “Very Experienced” is really just code for old. So I was back to that, how to say old, but not too old. “Oldish” - that’s what I ended up with, mainly because I ran out of time to think about it any more (probably a good thing).

I was originally scheduled to deliver my talk on Tuesday afternoon. But when I checked in on Monday morning, Becky Goodman asked me if I would mind swapping time slots with Stephan Haisley, who had a “conflict”. His slot was first thing in the morning on Wednesday. So I said sure. Only later did I find out that the conflict was related to the Tuesday night party, which has a tendency to stretch into the wee hours of the morning. Stephan’s a smart guy and he was thinking ahead. He realized that he probably wouldn’t be at his best, first thing on Wednesday morning. As Clint Eastwood said, “A man’s gotta know his limitations”.

Anyway, the talk went pretty well but I did have one embarrassing moment. I’ve been doing Oracle stuff for a long time, so I often run into people that I haven’t seen for a while (sometimes a very long while). I’m pretty good with faces and places, but names sometimes escape me. Isn’t it odd how our brains work? I can remember minute details about some arcane unix command that I haven’t used in 10 years, but a guy’s name that I worked closely with for half a decade can escape me. How does that happen?

I’ve gotten used to it, but occasionally something even more bizarre happens. Like getting a couple of bits of memory cross wired. This actually happens more often than you would think. Try this on a friend. Get them to say “Silk” five times as quickly as they can.  Like … “Silk, Silk, Silk, Silk, Silk” …  Then immediately ask them what cows drink. Almost without fail they will say “Milk”. Of course they know that cows don’t drink milk. They know that cows drink water. But for some reason the word “Milk” just comes rolling off their tongue. Why? Because the word “Milk” sounds almost the same as the word “Silk” and you’ve just made them access the part of their brain that stores the word “Silk” several times in a row. In addition, you have asked them a question with a word (cow) that is very closely associated with the word “Milk”. And finally, milk is a liquid that people drink. So there are 3 very strong associations in your brain, even though you know that it is not the correct answer to the question.

So what’s the point, well  … The first day of the Symposium, I ran into a guy that I have known for several years and that I had in fact shared office space with just a couple of years ago. His name is Jeff Holt and he co-wrote a book with a guy named Cary Millsap called Optimizing Oracle Performance. So I see Jeff, walk over with a big grin on my face, shake hands with him and say “Hi Kevin!”.

And he just looks at me like I’m crazy (which he does pretty well, by the way). And I realize what I’ve done and say “I’m sorry Jeff, I do know what your name is”. And he looks somewhat dubious but accepts my apology. The thing is, I have done this to Jeff several times in the past. I explained to Jeff that there is a perfectly reasonable explanation for me calling him by the wrong name. I used to work with a guy named Kevin Holt and for some inexplicable reason, Kevin’s name always comes out when I think about Jeff. Maybe it’s because my brain stores data by last_name and the cells holding the first names have become damaged in some way, maybe I’ve used the name “Kevin Holt” a lot more than the name “Jeff Holt”, maybe my brain was more impressionable when I was younger and so the earlier memory is stronger. I’m not sure. Anyway, I pretty much just wrote it off as one of those questions for which there is no answer.

But I digress, back to the embarrassing moment during my presentation: So the talk is going along well and I get to this page where I reference Cary and Jeff’s book and I look at the big overhead and the reference looks like this:

Cary Millsap & Kevin Holt. Optimizing Oracle Performance
O’Reilly, 2003.

Of course to me it looked like this:

Cary Millsap & Kevin Holt. Optimizing Oracle Performance
O’Reilly, 2003.

Yes that’s right. Not only did I call him by the wrong name when I ran into him, but I actually typed it wrong on my presentation. To make matters worse, Cary Millsap is in the audience with a puzzled look on his face. So I have to apologize to him while the rest of the audience looks on. Then as soon as the talk is over, I fix the presentation materials and resubmit them (hopefully wiping out any trace of my cross wired brain). This whole experience gets me really thinking about how my brain is working and why it continues to make this repeated error. It seems unlikely that just knowing two guys with the same last name would cause such a problem. I know lot’s of people with the same last name, and I don’t get their first names mixed up.

So I start racking my brain to see if I can come up with any other explanation. What other associations do I have with the name “Kevin”? Well for starters, my only brother’s name is Kevin. We were born only a year apart so when I was a kid, almost every time I heard my name it was closely followed by his name (usually it was at the top of some adult’s lungs due to some trouble we were stirring up). In fact, the old folks often couldn’t be bothered  to keep us straight, so even when we weren’t together (which was rare) they often just combined our names (Kervin was the most common version - Kevrry was a lot less common - for obvious reasons). So anyway, I do have a very strong association between my name and my brother’s name. Then it occurred to me that my first name sounds just like Cary Millsap’s first name. Hmmmm. Cary and Jeff are closely associated (at least in my mind) as I mentioned before. They co-authored the book and have worked together at the same company (first Hotsos and then Method-R) for the last decade or so. I’ve known Cary a long time, but only met Jeff 4 or 5 years ago. So I’ve only ever known Jeff to be associated with Cary. You probably can see where this is heading. I believe my brain does something like this old school fill in the blank problem:

__________________________________________________________________________________________

Fill in the Blank with the Word that Connects the Other Two Words

Cary (which sounds like Kerry)  ____________   Holt

__________________________________________________________________________________________

It’s like a little pattern matching or free association thing. My brain just wants to put the word “Kevin” in that spot as the link between the other two words.

By the way, there have been lots of studies done over the years about how our brains store memories, how we retrieve them, how we forget things, etc… Some of those studies have indicated that most long term memory is semantic based while short term memory is more acoustic based. So most people would tend to mix up words that sound alike (like milk and silk) in short term memory while mixing up words that mean the same thing (like auto and car) in long term memories. Of course there are other studies that prove we all have some long term acoustic memory (being able to identify specific accents for example). The fact that I am a long time musician and that I play mostly by ear is probably a contributing factor as well. I am said to have a “good ear” which means that I can reproduce music pretty accurately after a very short exposure to it. So I think all that extra exercise my brain has done has made me more likely to store long term memories with an acoustic or “sound alike” kind of memory organization. By the way, if you are interested in this kind of stuff, there is an excerpt from a survey of the literature which discusses several of these studies here: Human Memory by Elizabeth Loftus.

So that’s my story and my rationalization for why it happened. And for what ever it’s worth, I’m sorry Kevin, err… I mean Jeff! -  I guess my brain just has a mind of it’s own.

Oracle Fudge

One of my favorite holiday treats was my MeeMaw’s fudge brownies. Note: I did a brief poll (only 5 people so not statistically significant) but nevertheless, 100% of the people I surveyed had a grandparent that they called either MeeMaw or PopPa. And 40% had both a MeeMaw and a PopPa. Of course all 5 of the pollees were native Texans. Anyway, here’s what my MeeMaw’s fudge brownies looked like.

Oracle has a long history of baking fudge as well.

So here’s a little Oracle Fudge for you!

11gR1 has 4 parameters with the word fudge in them.

_nested_loop_fudge
_parallelism_cost_fudge_factor
_px_broadcast_fudge_factor
_query_rewrite_fudge

These four “fudge” parameters have been around with the same default values since at least 8.1.7. Maybe the elves will fix these in version 12.

And in keeping with the holiday theme, I’m reminded of the song “My Favorite Things” (often sung at Christmas) that goes:

“blah, blah, blah, blah, blah, blah,
These are a few of my favorite things”
(think Julie Andrews in Sound of Music)

Anyway, here’s a few of my favorite parameters (and my interpretation of what they mean):

db_cache_advice - If you turn this one on, Oracle will tell you what to do with your money.
db_cache_size - And this one will tell you how much money you have.
db_ultra_safe - Oddly enough, this one defaults to OFF. Seems like you’d want your database to be “Ultra Safe”.
ifile - Looks like someone from Apple slipped this one in (you know - iPod, iPhone, iMac, etc…).
large_pool_size - Just how big is your pool?
skip_unusable_indexes - Defaults to TRUE. I guess if you want, you can tell Oracle to use those unusable indexes.
_addm_skiprules - Yeah, rules suck!
_ash_size - Do these pants make my butt look big?
_backup_max_gap_size - How big does the doorway have to be to get your butt through it?
_asm_disk_repair_time - Uh oh, time to repair those disks.
_avoid_prepare - Why get ready ahead of time.
_awr_disabled_flush_tables - Not sure but it sounds stinky.
_awr_sql_child_limit - Population control?
_bloom_pruning_enabled - Trim the roses!
_bwr_for_flushed_pi - Not sure what this one does, but flushing pie seems like such a waste.
_cvw_enable_weak_checking - I’d prefer strong checking please! Get that weak stuff out of here!
_db_aging_cool_count - I used to be cool, I think.
_db_aging_hot_criteria - ???
_db_block_bad_write_check - I hope our database is not writing bad checks!
_db_block_check_for_debug - I think a developer from Chicago named this one (and it should be: _db_block_check_for_the_bug).
_db_cache_crx_check - I don’t know what a crx check is, but cashing any kind of check should be good, right?
_db_large_dirty_queue - Just like in the laundry room at home.
_db_row_overlap_checking - Do your rows overlap? Perhaps we should check that.
_disable_fast_aggregation - Why would anyone use this, “No thanks, I want really slow aggregation”
_dtree_pruning_enabled - Trim D-Tree too while yer at it!
_extended_pruning_enabled - Cut ‘em way back!
_disable_recoverable_recovery - Hmmmm???? I guess if you don’t want your recovery to be recoverable you can set this one.
_dummy_instance - I’ve thought this many times (it’s basically the same as the _stupid_database parameter).
_dispatcher_rate_scale - How much are we paying that dispatcher anyway?
_fairness_threshold - My queries should always run faster than everyone else’s, I think that’s fair.
_flashback_fuzzy_barrier - Fuzzy Wuzzy was a bear, Fuzzy Wuzzy had no hair, Fuzzy Wuzzy wasn’t very fuzzy was he.
_gc_defer_time - I’ve wanted to do this many times in the past.
_ges_dd_debug - Sounds like a speech impediment, b,b,but maybe not.
_hard_protection - Well if it was easy, everyone would be doing it.
_imr_avoid_double_voting - They needed this in Florida during the 2004 election.
_in_memory_undo - Same as the _forget parameter.
_kdli_STOP_dba - Keep the DBA from messing up the system.
_kdli_delay_flushes - Don’t flush until a specified threshold is reached.
_kdlwp_flush_threshold - The amount of poo that triggers flushing (see _kdli_delay_flushes).
_kdli_memory_protect - Same as the _dont_forget parameter (i.e. the opposite of the _forget parameter).
_kdli_squeeze - One of my favorite bands.
_kebm_nstrikes - The number of strikes before you are out (defaults to 3 - no joke).
_kebm_suspension_time - How long before convicted felons can return to playing football.
_kill_enqueue_blocker - What the defensive linemen try to do on every play.
_kill_java_threads_on_eoc - I always turn this one on, because anything that kills java threads is OK in my book.
_kfm_disable_set_fence - Good fences make good neighbors.
_kse_signature_limit - The cash advance limit on your credit card.
_kse_snap_ring_size
_ksi_clientlocks_enabled - Can be used on clients when they won’t follow your advice.
_lm_better_ddvictim - Not sure what this one does, but it has the word victim in it, scary!
_lm_master_weight - Set this to get control of your diet.
_lm_tx_delta - Ah the Texas delta, I think it’s some where near Galveston.
_max_exponential_sleep - The older I get, the longer the naps.
_memory_sanity_check - Do I seem crazy to you?
_mv_generalized_oj_refresh_opt - In general, orange juice is refreshing!
_olapi_memory_operation_history_retention - Same as the _dont_forget parameter (see _kdli_memory_protect).
_olap_wrap_errors - When you cut the wrapping paper too short and it won’t go around the present and you have to cut a little strip to cover the gap.
_optimizer_ignore_hints - No matter what you hear in there, no matter how cruelly I beg you, no matter how terribly I may scream, don’t open that door.
_optimizer_random_plan - This one is self evident and has defaulted to TRUE since the CBO first came out.
_optimizer_squ_bottomup - Bottoms Up!
_parallel_fake_class_pct - “The higher you hold your pinky, the fancier you are.” - Patrick from Sponge Bob.
_parallel_syspls_obey_force - The parameter that allows you to get the sysadmins (syspls) to do what you tell them.
_pct_refresh_double_count_prevented - This would have been useful in Florida during the 2004 election.
_pdml_gim_staggered - Gim must have had too much to drink.
_pred_move_around - If your dad was in the air force and you moved from base to base while growing up, setting this parameter will make you feel right at home.
_px_no_stealing - This parameter is set to TRUE by default and it’s actually against the law to change it.
_px_nss_planb - Use this parameter if plan A doesn’t work.
_shrunk_aggs_enabled - I don’t like shrunk aggs, I like the big-uns, wif bacun!
_spin_count - Have you ever seen fans at a baseball game put their heads on the end of a bat and turn circles and then run? You get the idea.
_two_pass_reverse_polish_enabled - I don’t think this one is politically correct.
_use_best_fit - One size fits all does not fit all.
_write_clones - Send a letter to your siblings.
_ultrafast_latch_statistics - Anything that is ultrafast has got to be fantastic!
_xsolapi_densify_cubes - Densify??? I think they made that word up.
_xsolapi_optimize_suppression - Allows us to to keep the common man down as effectively as possible.
_xsolapi_stringify_order_levels - Stringify??? I think they made that word up too!
_xsolapi_use_models - It will make our advertising look better!

Here a few that allow you to turn on (or off) special checks:

_disable_acid_check - My acid is just fine thanks.
_disable_cpu_check - Yep, this machine has got at least one.
_disable_health_check - I don’t need no stinking annual checkup!
_disable_image_check - And I really don’t care how I look!

Here’s a few parameters dealing with death:

_px_execution_services_enabled - Apparently we can set up a special service for executions.
_xsolapi_share_executors - And if you have a lot of killing to do, it’s wasteful to not share executors.
_imr_splitbrain_res_wait - Sounds like it would hurt (if not kill).
_ksv_spawn_control_all - Creates zombies.
_cgs_zombie_member_kill_wait - Specifies how long to wait before slaying zombies!
_imr_evicted_member_kill - Boy I hope I don’t get evicted!
_ksu_diag_kill_time - Killing Time!
_ksuitm_dont_kill_dumper - The rumor is that this one was named by an animal rights activist and it was supposed to be “Don’t Kill Thumper”.
_lm_rcvr_hang_kill - Death by hanging!
_ksv_pool_hang_kill_to - If hanging doesn’t work, drown them in the pool!
_hang_detection - Turn this on so we’ll know when anybody is getting hung.

And just in case the 2000+ parameters in 11g aren’t enough, they have a few spares:

_first_spare_parameter
_second_spare_parameter
_third_spare_parameter
_fourth_spare_parameter
_fifth_spare_parameter
_sixth_spare_parameter
_seventh_spare_parameter

 Anyway, that’s it for now. I hope you have a happy holiday and a …

Merry Christmas!

Low Tech Solutions to High Tech Problems

When I got to work today I walked into my co-worker’s (Michael’s) office and saw this:

 

 

Data was scrolling by on the screen in rapid fashion. So I asked him what he was doing and he said he got tired of mashing the inner-butt-n  (that’s the way we say “pressing the the return key” in Texas). Works for me. He could have probably written a custom shell script with proper error checking and whatnot, but why, when the stapler was sitting right there.

I always thought the best programmers were basically lazy. They always seem to find ways to get more done in less time. When I was a young programmer my goal was to write a batch job that would run all month. That way I’d only have to come in on the first to kick it off for the next month. I never quite got there but I had fun trying.

Which reminds me of something that happened at my first programming job. I worked for an oil company that had more money than sense. We had two of everything. We actually had two Cray’s. Anyway, my boss had one of the very first transportable computers, a Grid. The Grids were very futuristic back in 1982. They looked pretty similar to what we have today. So anyway, my boss told me this story after returning from trip with his brand new Grid. He said he was on the airplane and decided to get his new toy out and play with it. So he gets it out of the bag and sets it up on the tray (I guess it was after the flight had taken off due to the electronics restrictions, oh yeah, they didn’t have those then!) - so anyway, he starts getting all the stuff out of the bag and getting organized, and by this time he says everyone within 10 rows is staring at him because no one had ever seen a laptop computer before. And he’s looking around smiling at everyone, thinking yeah this is pretty cool. Then he gets the last part out of the bag, … a power cord.

and he looks at the power cord …

and he looks around the cabin for a place to plug it in …

and he looks at the power cord again …

They didn’t have batteries on those early models. (they didn’t have ethernet jacks either, but they did have a 1200 baud modem BUILT IN!)  So anyway, he sheepishly puts the computer back in the bag and pretends to sleep for the rest of the flight.

Here’s a picture of the Grid computer (notice the wire running out the back <grin>):

My favorite low tech solution though was provided by a friend of mine that got a job right out of college working for an oil company. His first assignment was to fix a bug in an extremely complex reservoir simulation program. Apparently they had been trying to fix the bug for months.  The bug manifested itself by producing a result for one of the calculations that was always off by 1. And they just couldn’t figure out where the error was. They ran test case after test case through it and it was always off by 1. My friend worked on it for a day and then demoed it for them and it worked flawlessly. When asked how he did it, he said “Well, I just went to the end of the program and added 1 to the result”.

 

Your comments are always welcome.