Rebuilding Indexes Every Sunday Afternoon !! October 28, 2009Posted by Richard Foote in Index Rebuild, Oracle Indexes, Richard's Musings.
I just had to share this amusing article on “Scheduling Oracle Index Rebuilding“.
Regular readers of this blog can no doubt pick the various inaccuracies and strawman arguments with this article. It’s was nice however to reminisce and take a stroll down memory lane back to the 80’s and 90’s when many DBAs indeed did spend every Sunday afternoon rebuilding indexes and the such during so-called maintainance windows.
However, if you’re like me and now work on sites where there is no such Sunday maintainance window because your users actually require and demand 24 x 7 access to their applications, because organisations still want to sell their products and services online during Sunday afternoons, because governments still want border control applications functioning on Sunday afternoons, because consumers still want access to their bank savings on Sunday afternoons, because police still need to access critical information about possible criminal activities on Sunday afternoons, because airlines still want to fly aircraft on Sunday afternoons, etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. ……..
then perhaps the article may not be that useful to you afterall.
Of course, maybe you do have a maintainance window of some description but then have that other really annoying problem associated with modern databases, of them being big, really really big and so more difficult to maintain. Back in the 80’s and 90’s, databases were relatively small by todays standards and it was conceivable for indexes to be rebuilt with little or no thought. There was generally little point, but at least you could get away with it. However, if you’re like me and you have databases with indexes that total in the many terabytes, it just isn’t feasible or practical to rebuild all such indexes, even if you wanted to.
No. If you do have a maintainance window, you may want to make sure the valuable time is spent well, on activities that actually make a difference.
Of course you may also look after databases like I do where the percentage of indexes that actually benefit from a rebuild is not around 30% as suggested by the article but significantly below 1%. Therefore rebuilding 99+% of indexes for no practical gain or purpose may not be considered a “wise” use of maintainance opportunities.
One thing this article did make me ponder though is the number of database sites out there where the DBAs demand and force their businesses and associated end-users into having forced downtimes, into having their applications and business processes impacted and made unavailable (say) every Sunday morning, not because it’s actually necessary or because there’s a business or technical benefit but just because their DBAs say or think they still need to follow the processes and maintainance activities of the 80’s and 90’s. Interesting question that …
One last point I would make with this article (which BTW will change and be modified in the future, I can guarantee that, just save a copy and see). Why would you bother with validating the structure of all indexes if you plan to rebuild them all anyways ? And who is the more inept ? Someone in the Netherlands who attempts to run a script that attempts to validate structure of all indexes or someone who writes a script to validate structure indexes with an ALTER INDEX command ;)
Personally, I spend every Sunday afternoon relaxing and enjoying the weekend, playing sport, perhaps doing a bit of gardening and on a lovely sunny day, just sitting back with family and friends enjoying a barbecue and a few cold beers.
Meanwhile, all my database applications just run on happily along with no impact on business activities at all …
Oracle OpenWorld – Day 5 Hightlights October 16, 2009Posted by Richard Foote in Oracle OpenWorld, Richard's Musings.
Started the day desperate again for a coffee at the OTN lounge.
I was looking forward to catching Kevin Closson at the Unconference but unfortunately the session was cancelled at the last minute. So spent some time having a nice chat with Chris Muir and Tim Hall who I had the pleasure to meet when I attended the ODOUG conference in Monterey earlier in the year.
I then attended an excellent roundtable discussion forum with the Oracle folks who write and manage the Oracle Cost Based Optimizer. Some excellent questions (including mine on the use of AUTO with method_opt ;) ), although I wasn’t totally convinced with the answer given. However, I had to clap and clap rather loudly when they made special mention of not setting the OPTIMIZER_INDEX_COST_ADJ paramater and recommending rather strongly not to touch this parameter at all. Something I’ve been suggesting for quite some time. I also got some encouraging feedback on resolving a couple of key issues I have with statistics gathering:
1) A better way of collecting the clustering factor statistics for indexes so that Oracle can remember more than just the last block it visited
2) The ability to collected extended statistics that span more than one table
Both are being actively looked at. However, the highlight for me was the fact they were playing “The Best Of Bowie” album after the presentation, just for me !!
Also had the pleasure of meeting Christian Antognini in person who’s writings I greatly respect.
My final session of the day and of the conference was a round table discussion with the Oracle Real-World Performance folks, including Graham Wood who I had the pleasure to meet earlier in the conference and Greg Rahn who I also met today for the first time. Again, a very good session with some very good questions and answers, especially the question of when should one rebuild an index and the answer that one should only do so in special cases. The fact that these guys promote this best practice in a large public forum such as this (although I was picked out by the panel from the audience that perhaps I should be up there answering this question !!), can only help in getting the message out there.
And so it ends. I had a fantastic time here at Oracle OpenWorld, met some fantastic people and made still more Oracle friends, but I’m now really looking forward to getting home after over 3 weeks on the road.
Oracle Openworld – Day 4 Highlights October 16, 2009Posted by Richard Foote in Oracle OpenWorld, Richard's Musings.
add a comment
I set out to reduce my pace today with only limited success.
My first session was to attended Alex Gorbachev and Paul Vallee’s Unconference session on how to make DBAs highly available. Interesting discussion on some of the various challenges confronting DBAs, such as controlling the balance between the need for stability and availability vs. the need of some organisations for constant change requirements and the importance of delivering such change as quickly as possible. Also, whether the procedures and processes for managing and controlling change management, including industry and governmental governance requirements are a help and a good thing or a hindrance and a threat in just getting the job done. The answer IMHO is that it depends on how such guidelines are implement and policed. It’s somehow comforting to know that other DBAs face similar issues and concerns as your own.
I then attended an excellent presentation on the new features associated with Data Guard in 11g Release 2 (except for the section where an Apple customer described his experiences with Data Guard, during which I simply couldn’t understand a single word he said). This is certainly all of great interest for us at work with the ability of being able to configure a read-only database farm having obvious business potential. However, I was particularly impressed by the ability of Oracle when confronted with a block corruption to automatically fix the corruption by copying a healthy version of the block from a standby database (or indeed the Primary database if the corruption appears on the Standby side). The key word here is automatically and without a single error message being raised, except for a message written to the alert log. Impressive stuff.
The lunch today was simply superb, absolutely the nicest lunch I can ever enjoy having. Please note these comments are addressed specifically to Chris Muir who missed out on lunch and was hungry all afternoon as a result :)
Then spend some time in the OTN lounge, catching up with a number of folks, including Cary Millsap. Looks like I might very well be presenting at the Hostsos Symposium next year if I can get enough free time organised.
Watched Larry’s Keynote address from the OTN lounge. I had a press pass that enabled me to watch the keynote up close but the free beers on offer at the OTN lounge convinced me this is the place to be ;) There wasn’t a lot new announced that I didn’t already know, although the 10 million dollar Exadata challenge to IBM is typical Ellison. However the highlight for me was the speech by Arnold Schwarzenegger during the keynote, very funny.
After missing out on all the prize draws yet again (I never, ever win these sorts of things, ever), I despondently made my way back to the hotel. Had a lovely dinner with my family who are over doing all the sightseeing things while I’m at the conference beforing making my way to the Oracle Appreciation Event on Treasure Island. Popped into the Aerosmith concert for 5 minutes, tick, seen them now and then over to see dear old Roger Daltrey who performed a really good set of mainly Who classics. Oracle certainly know how to put on an excellent show. However for me, the highlight was actually the coach ride to and from the event with the stunning views of the San Francisco lights as we crossed the Bay Bridge.
sadly, it all comes to an end tomorrow …
Oracle OpenWorld 2009 – Day 3 Highlights October 15, 2009Posted by Richard Foote in Oracle OpenWorld, Richard's Musings.
The first thing to note about day 3 is that it’s wet. I mean really really wet and really windy as well. Considering my home town of Canberra has been in drought now for many years with water restrictions in place, I haven’t seen this much rain for a very long time. That said, I believe it’s been raining quite a bit in Canberra since I’ve been traveling so perhaps things are beginning to change for the better at last.
Started the day by attending Dan Morgan’s Unconference session on 11g Rel 2 new features that don’t feature in the marketing material. Some good stuff is in there, with basic little things such as being able to now easily alter database links for example having the potential to make life a little easier.
I then presented my own Unconference Q & A session on Oracle indexes. The turn out was actually quite good and there were some really good discussions including Index Skip Scans, Locally Partitioned Indexes, dangers of Bitmap indexes, coalecing rather than rebuilding and how different it is to drop an index once it’s been created. Thank you to everyone who attended and for making the session a successful exercise, including Jonathan Lewis who started the ball rolling with the first question and some excellent comments and Tim Hall who managed to ask the first David Bowie related question :)
The heavy rain meant I didn’t have the patience or a strong enough umbrella to wander too far from the main Moscone complex, but I managed to catch a nice presentation by Karen Morton on how to effectively collect database statistics. She presented really well and I really it although perhaps didn’t highlight enough the perils of some of the auto statistics options, especially with regard to method_opt.
I then listened in to Dan Norris in the OTN lounge on the new Exadata V2 offering. Certainly the columnar compression capabilities sound interesting. Of course I also heard that everything runs so fast that you might not need indexes on such a powerful beast, so perhaps my days on covering indexes on this blog are numbered ;)
I next had a look around at the other exhibition hall, practicing my golfing skills and picking up yet more t-shirts and yoyos that light up in funny ways. I’m a bit concerned that my luggage just won’t be able to hold all this stuff I’ve picked up !!
I have an interest in the Total Recall capabilities of 11g (and it’s lack of capabilities) and so attended a presentation on the improvements of Total Recall and flashback archive in 11g Rel 2. It looks like most of my issues with subsequent DDL changes on flashback archive enabled tables now being supported one way or the other. However, I still have concerns with the potential “corruptability” of the archived historical data and the subsequent recoverability implications. It would also be a nice improvement if “who” made a particular change was more readily available without having to purchase yet more expensive database options or have to modify the table structure.
The final presentation of the day was Tom Kyte’s Top 11 new 11g Release 2 New features. His top 11 was basically:
– Do It Yourself Parallelism (with new dbms_parallel_execute feature)
– Analytics Functions (new ones such as LISTAGG and NTH_VALUE)
– Execute on a directory (and the preprocessor capabilities)
– Recursive Subquery Factory (self referencing WITH clause capabilities)
– Improved Time Travel (Total Recall improvements as mentioned above)
– You’ve got mail (new file watchers capabilities that can automatically invoke some code when a file arrives in a directory)
– Deferred Segment Creation (only allocated storage when the first row is inserted, not when segment is created)
– Flash Cache (write blocks back to disk AND an SSD like device so that subsequent reads from the SSD are faster)
– Parallel Improvements (such as better control of parallel process executions and memory parallel execution capabilities)
and both number 10 and 11 best feature, the killer one …
– Edition Based Redefinition (ability to have different versions of the same stored code running at the same time within the database)
As usual, Tom covered this topics with nice examples, in a very clear and concise manner.
On the way back to the hotel, I popped into the Blogger get-together function and had a few drinks and had the opportunity to meet and chat with a number of fellow Oracle bloggers. Thanks to the Alex Gorbachev and Justin and the OTN team for putting the event together.
Aussie Oracle Bloggers, although one of us an Aussie no more ;)
It’s been a looong day …
Oracle OpenWorld 2009 – Day 2 Highlights October 14, 2009Posted by Richard Foote in Oracle OpenWorld, Richard's Musings.
It’s been a busy day today.
The effects of drinking perhaps one too many margaritas at the Oracle ACE dinner last night meant I was in desperate need of my morning coffee to start the day. Thank goodness for the OTN lounge :)
There were a number of announcements today but perhaps the main one from my perspective is the announcement of Oracle’s Enterprise Application Documents offering, an issue we’ve been battling for a long time.
I attended the Jonathan Lewis Unconference presentation on how to be an Oracle expert. It was all really quite interesting and raised a number of points that made one ponder. He asked for example what was the Oracle release that introduced the most significant change. See if you can come up with the same answer he gave (which after thinking about it is probably correct).
Later attended a general presentation that covered both 11g Release 2 and the new OLTP Database Machine Version 2. Usual marketing hype, much of which was already covered during the launch presentations. Discussed features such as RAC One, tiered storage partitioning options and advanced compression which are all certainly on my list of things to investigate.
Caught up with Gareth Llewellyn who mentioned the new OJAM Red Room website that has lots of Oracle information and OpenWorld insights, with an Aussie / NZ emphasis.
After lunch, spent some time in the exhibition hall, stocking up on t-shirts, assorted pens and rubber ducks :)
Attended Jonathan Lewis’s other presentation on hints on hints. Again excellent, picking up a number of useful little tips, especially the full potential of the qb_name hint. I think he summarised things nicely when he recommended:
1) Don’t use them
2) If you ignore recommendation 1, then be very very careful and precise when using hints
He also explained very nicely the myth that hints can be “ignored” by the CBO when he asked a poor soul from the audience to take off a jacket which he wasn’t wearing. He obviously didn’t perform what was asked of him as it wasn’t possible but did he actually ignore the request …
Later had a nice chat with Jonathan in the OTN lounge, exchanging thoughts mutual acquaintances we unfortunately know and the beauty and magic of Oxford City.
Finally attended the Battle of the DBAs Version 2 presentation which attempted to demo the potential productivity improvements when using the new EM capabilities and features. I don’t think they quite pulled it off but certainly highlighted that EM has some very nice features.
My mission tomorrow is to find out why they’re serving at the conference Seattle’s finest coffee here in San Francisco :)
Oracle OpenWorld 2009 – So It Begins … October 12, 2009Posted by Richard Foote in Oracle OpenWorld, Richard's Musings.
add a comment
Wow, I’ve had one hell of a 2 week period !!
I’ve been travelling around the southern part of England with my son, as part of a school football tour, with 22 other teenage boys. It’s been a lot of fun but it’s also been extremely tiring, getting up early each morning, packing in as much as possible into each day, living in youth hostels with a room full of snorers, attempting to sleep on lumpy bunk beds, while making sure 20 odd teenagers don’t do what teenagers do naturally which is getting into trouble. On the whole we succeeded, losing just the one boy for just the one afternoon !!
Highlights included watching two English football matches (Tottenham vs. Burnley and the mighty Crystal Palace vs. Blackpool) and just walking around and enjoying the sights of wonderful places such as Oxford, Bath and London. Lowlight (other than losing that one boy for a while) was getting caught trying to sneak into a public toilet without paying the 50 pence fee only to be caught on CCTV and making the mistake of going into the ladies rather than the mens !!
Rather than go home and recover from the trip, I’ve now made my way across the Atlantic to enjoy Oracle OpenWorld here in foggy San Francisco.
Being a Sunday morning, it was a bit of a struggle and somewhat unnatural to get up early but Tom Kyte was doing the first keynote talk so I made the effort to attend. It was as usual with Tom an entertaining and interesting little discussion on what we as developers (and DBAs for that matter) still do oh so wrong. It covered topics such as how we often don’t know how to ask for help and ask questions properly anymore, how we try and make what should be simple as complex as possible (a real theme at my work at the moment), how we try to ignore and pretend mistakes never occur (don’t mention WHEN OTHERS SET NULL with Tom around), how we even fail to back things up properly and finished up on how best practices can often be abused and misinterpreted if we don’t fully understand the reasons and circumstances when something really is a best practice. All good stuff which is always worth reinforcing.
I had a little chat with Tom afterwards and found out to my joy that Tom is also a great fan of “Flight of the Concords” :)
I was then interviewed and filmed by Gareth Llewellyn and the gang from Australia Oracle Marketing on being at Openworld and the such and it all went rather well only to be told afterwards that they forgot to turn on the mike and would I mind being interviewed and asked the questions again !! I thought it was all so funny that I found it really hard not to giggle and laugh during take 2 of the interview. I’ll post the link once it gets uploaded to youtube or wherever. Here it is.
Later in the day I met up with a whole bunch of my Oracle mates, which of course is one of the main reasons for attending conferences such as this. One of them was Alex Gorbachev who also conducted a little interview with me :) I think it’s going to be one of those conferences.
Tonight, I’m off to attend the Oracle ACE dinner and catch up with more folk. If I don’t drink too much, I’ll try and answer some of the questions that have been slowly mounting while I’ve been away. Don’t like my chances though …
I’ll post a little list of highlights each day during the conference.