THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Post AUSOUG – Day 2

I decided to do Rottsnest Island after all. I stood beside the captain on the cruise over there, so I could both see on both sides of the ship AND hear his “little bit of commentary”. If you were outside, you did not hear and if you were inside, you could only see one side of the ship. Ended up being a bonus as I could ask him different questions about some of the sites.

The captain pointed out a few of the yacht clubs, restaurants, and home between Perth and Freemantle. Perth is actually NOT on the ocean, but inland slightly on the Swan river (and one other). There was a section of homes known as “millionaire alley” as they were at one time either the most expensive homes in the world, or the most in all of Australia, I forget. There were gorgeous homes along the shoreline the entire trip. One house was recently built for $50M.

I “hired a bike” once I got to Rottsnest as the island is really too big to do by foot, unless I just plan on staying near the jetty or shopping mall. Single speeds were $20 and Multiple Speed bikes were $25. I asked and they recommended the multi-speed biked. So off I went, with a broken helmet ( Helmets are mandatory and you have to have one on by law, but it does not have to be effective…NONE of them had a hard shell coating and all were down to the styrofoam), riding around.

Read the rest of this entry . . .

AUSOUG – Post-Perth Sightseeing!

Man you can tell I’m a geek when my first inclination is to title this “Site Seeing”!

Boy was it hot today. 34C! I nearly melted–not used to the big temperature difference. When I left Ottawa it was snowing. Today was my first “off” day where I could spend time dong the tourist thing. I was going to go to Rottsnest Island, but did not get up and get going early enough.

Instead I took the “Blue CATS” to “Woolys”. “Woolys” is the nickname for Woolworths, where you get groceries for the same price as in the suburbs. They also have a liquor store in them, so you can get all your essentials at one place. “Blue CATS” is the blue route for the “CATS”, the Central Authority Transit System, I think. I know they told me about 5 times, but that was at the end of two days of technical sessions and things were not registering by them. The CATS are free buses operating in the “downtown core” of Perth (or at least the central area, which I think is downtown). There are three routes, Blue, Red and Yellow. They run about every 10 minutes. The other really cool thing is the regular buses are also free in the central area. Once you are outside the central area, you have to pay.

About 10 minutes from the Pier is the Perth Zoo, where I spent the day. I especially enjoyed the Australian animals on the “Bush Walk” part of the tour. I’m glad I did it first as by the end of the day I was getting pretty tired my feet were sore. The other thing was, because it was so hot, most of the animals were just hiding out and resting in the little bit of shade they could find. The Koala bears moved slightly . . . but they normally sleep about 20 hours/day anyhow!

I did get to see all kinds of Australian water fowl, a HUGE crocodile (man those things are scary!), sleeping kangaroos, giraffes, lots and lots of monkeys (they were the only real active animal), the nocturnal animal exhibit (along with ghost bats flying around), rhinoceros, galapogos turtles, koalas, a sun bear, a red panda, and most other stuff I have since forgotten.

I’m not sure what I will be doing tomorrow . . . because at this point, my feet are “knackered.”

AUSOUG – Day 2

Today was a much better day than yesterday. I managed to get more than eight hours sleep and felt very rested when I woke up. Plus, my bags finally arrived at the hotel while I was sleeping, which was especially fortuitous as my “EASY buttons” were in the suitcase. Last year I asked Connor McDonald if they had Staples in Australia. His reply was “Yes, and we have paper clips too!” So I brought him the famous (at least in our office) “EASY button” from Staples.

I thoroughly enjoyed Penny Cookson’s session on Oracle 11g Performance Tuning: Making Oracle Boring. It was very informative, yet easy to follow and understand. I followed that session with Megh Thakkar’s session on Oracle Partitioning for Data Warehouses.

This afternoon I attended Duncan Mills’s session on ADF task Flow and Connor’s session “Once around the Block”. Plus John Garmany’s session “Oracle Streams OR Logical Standby, which is right for you.”

AUSOUG: Day One

It is now evening after the first day at the AUSOUG Conference in Perth, Australia. This is my first time attending AUSOUG, and I have found it much smaller and more personal than others I have attended. The food has been excellent, and more importantly (because I really needed it) there was lots of coffee out when I got there and for several hours after.

I was fortunate to present right after the opening session, so I could relax and enjoy the rest of my day. There were some interesting questions and audience participation near the end of my presentation (on LDAP and Oracle Application Server), most notably dealing with the issue of having a set of employees in one group and “moving the entire group of employees” within the LDAP Directory.

The exhibition hall was open all day, so I went there between sessions. No matter how many times I tell myself that I don’t need more stuff, I always find things at the exhibit hall that I want. Today, I picked up a red Red Hat hat.

Read the rest of this entry . . .

AUSOUG: Getting There is Half the Fun… NOT!

For some reason, the advertising slogan, “Getting there is half the fun,” keeps going through my mind. Well, I certainly would not describe my trip to Perth, Australia as “fun”. Five different plane boardings (only once onto the same plane); four times standing in line to get boarding cards; problem with travel visa (I missed putting both of my middle names on the forms); lost luggage; and canine inspection of luggage and confiscation of my apples. (At least I declared that yes, I did have fruit with me . . . but by not throwing it out before the dogs found it, I got to go to the end of an extra line to discuss the issue.)

My original flight from Chicago to Los Angeles was delayed nearly two hours. The plane I switched to had only three of its six lavatories working, and none of the overhead lights in my section working.

I’m pretty tired. And, I’m presenting at the AUSOUG National Conference Series 2007 at 10:30 tomorrow morning. I’m sooooo glad that, since I packed too many clothes to fit in my suitcase, I had to pack one outfit in my carry-on bag. I am also grateful to Qantas for providing an amenity bag with lightweight T-shirt and shorts . . . so I have pajamas, too.

All in all, it was a long, grueling trip. On the plus side, I did meet some wonderful people — Andrew and Sumit, who sat on either side of me on the longest flight, were especially kind and helpful and pleasant to sit and chat with. And in Melbourne, where I had the most problems with making it through a zillion line-ups (immigration/lost luggage/special services for ticket problems), countless people offered to let me ahead of them so I would be able to catch the final flight out at 12:15. A big “thank you” to all of them!

Are you tired of weak, crappy coffee?

I am an ex-tea tottler. Several months ago, I started to once again drink that elixir of the Database Gods. Now that I am beginning to drink coffee again, I can really appreciate Jon Emmons’s humor in naming his blog site www.lifeaftercoffee.com. Truly, a DBAs work life does NOT begin until after coffee.

Unfortunately, it had been years since I actually brewed a pot of coffee. What was I going to do? Like many people using a new technology, I wanted to make some but had no idea of where to begin. Luckily, our company had a BIG sign posted next to the coffee machine, “Are you tired of weak, crappy coffee?”, with detailed instructions.

I don’t think I am giving away too many Pythian secrets here, but not only did it explain to only put a portion of the potential water reserve so the coffee would be stronger. It also gave warnings of potential problems. One problem was that putting the coffee grinds and water in before turning the unit off would cause a burst of steam to cause the grinds to be blown all over and ruin the pot of coffee. Pure Genius!

Instructions

The instructions were so humorous because I see them as exemplifying the work ethic at Pythian. And that is, documentation and sharing of information. When we do work for a client, we carefully document all the steps taken, and any problems encountered and workarounds we discovered. The information is then put into a shared repository for all the DBAs to access and use in similar situations.

Most recently markings were added to the actual coffee pot to indicate MINIMUM and MAXIMUM levels. As a DBA, I am very familiar with thresholds. If something like free space reaches a MININUM, then I react by adding additional space. When the coffee pot reaches the minimum, there is an indication that it is time to make a new pot. The MAXIMUM indicator assists us to ensure that we do not go over our limits (for water).

The Coffee Pot

So sharing the secret to making a perfect cup of coffee or cloning a database with RMAN are handled the same way around here. Freely, in the spirit of teamwork and making each others’ lives easier for both us and our clients.

Oracle’s Little-Known Multi-Table Insert

We are assisting one of our clients with a data conversion project and have used a feature that I was surprised so few people knew about. It is the multi-table insert.

Have you ever wanted to select a set of data and then insert different portions of it into different tables? How did you do it? If you are like many developers, you may have opened a cursor loop to select the data, and based on different conditions, used the data in different insert statements.

Let’s assume we are re-architecting our data, and that we have the classic emp and dept tables. We want to put into an exception table for further investigation, any employee whose commission is greater than their salary. In addition, any departments that have no employees should also be placed in exception tables. The old way of doing this might have looked like:

DECLARE
   emp_count number;
BEGIN
FOR dept_rec in ( select dept_id, dept_name from dept ) LOOP
    emp_count := 0;
    FOR emp_rec in ( select emp_id id, emp_name name, sal, comm where dept_id = dept_rec.dept_id ) LOOP
        emp_count := emp_count + 1;
        IF comm > sal THEN
           insert into emp_exception
           values ( emp_rec.id, emp_rec.name, emp_rec.sal, emp_rec.comm, emp_rec.dept_id, 'comm greater than sal');
        ELSE
           insert into new_emp
            values ( emp_rec.id, emp_rec.name, emp_rec.dept_id, emp_rec.sal, emp_rec.comm);
        END IF;
    END LOOP;
    IF emp_count = 0 THEN
       insert into dept_exception
       values ( dept_rec.dept_id, dept_rec.dept_name, 'No employees');
    ELSE
       insert into new_dept
       values ( dept_rec.dept_id, dept_rec.dept_name);
    END IF;
END LOOP;
COMMIT;
END:
/

Using outer joins, the select can be converted to, and the code changed to:

DECLARE
   emp_count number;
BEGIN
FOR rec in ( select dept.dept_id, dept_name, emp_id id, emp_name name, sal, comm
               from dept , emp
              where dept.dept_id = emp.dept_id(+)) LOOP

    IF rec.id is NULL THEN
       insert into dept_exception
       values ( dept_rec.dept_id, dept_rec.dept_name, 'No employees');
    ELSE
       insert into new_dept
       values ( rec.dept_id, rec.dept_name);
        IF rec.comm > rec.sal THEN
           insert into emp_exception
           values ( rec.id, rec.name, rec.sal, rec.comm, rec.dept_id, 'comm greater than sal');
        ELSE
           insert into new_emp
            values ( rec.id, rec.name, rec.dept_id, rec.sal, rec.comm);
        END IF;
END LOOP;
COMMIT;
END:
/

Okay. I admit the sample code so far is a bit contrived, but I needed something easy and simple to show the logical progression to the multi-table insert. I have broken down the PL/SQL loop into two insert statements. The first replaces the above logic and the second will load the department records, as I want to load only one department record for each department.

INSERT
   when ( id is null )
       insert into dept_exception
       values ( dept_rec.dept_id, dept_rec.dept_name, 'No employees')
   when ( comm > sal )
       insert into emp_exception
       values ( rec.id, rec.name, rec.sal, rec.comm, rec.dept_id, 'comm greater than sal')
   when ( first_dept = 'Y')
       insert into new_dept
       values ( dept_id, dept_name)
   when ( nvl(sal,0) >= nvl(comm,0) )
           insert into new_emp
           values ( id, name, dept_id, sal, comm)
SELECT dept.dept_id, dept_name, emp_id id, emp_name name, sal, comm
               from dept , emp
              where dept.dept_id = emp.dept_id(+);

INSERT into new_dept
  SELECT dept_id, dept_name from dept
  MINUS
  SELECT dept_id, dept_name from new_dept;

I then tested this with the /*+ APPEND */ hint and set autotrace on. It shows that this also works with NOLOGGING tables and that the amount of redo is considerably reduced (as expected with NOLOGGING). I then created the test tables with CLOBS and confirmed that the multi-table insert also worked with tables with CLOBs.

Collaborate 2007 – last day …again !

I just attended a sesion on “Be a Model Citizen”. A very interesting talk on simplifying the Zachman model and how it relates to the physical / logical / conceptual modelling that many of us DBAs have done in the past. Well … at least logical and physical.

Closing session is a “Great Tools Debate”, being chaired by Michael Abbey.

And then I get to enjoy the city while waiting for my red-eye flight home!

Collaborate 2007 – Last Day

The big bash last night was a beach party around the pool at Manderlay Bay. It was a little chilly for a beach party. And the line-ups for drinks were very very very very very long in the beginning of the party. But I found the Marguerita stand that the nice folks at Quest Software were running. Took a while for people to find it, so they had no line up…and they had much better margueritas than the regular lines! Bonus!

Sadly it was really really difficult to find a Canadian flag in Las Vegas so the plan to meet near the Canadian flag at the party was a bit of a bust. Peter managed to get one..but it was so late in the night most people missed it :-(

Christo is presenting this morning his session on Memory. Hope he did not stay up too late!!!

Collaborate 2007 – Day 3

After attending John King’s XML Publisher presentation, Peter Koletzke and I took a “short cut” outside to get to the hotel lobby from the conference area. It is only about a 10 mile walk from the Conference rooms to the hotels. EVERYthing is bigger in Vegas! I was surprised when Peter told me it was his first time in THREE DAYS that he was outside. I guess a lot of people are either staying in the hotels here, or taking the tunnel between hotels. The hotels are set up like mini-mazes and the casinos are almost totally unavoidable. So far I have avoided all gambling temptation….other than the free slot machines in the vendor hall.

This morning I attended Tony Jambu’s session on Cryptography and Digital Signatures. Although I am used to working with VPN and ssh and generating and using public/private keys, I never really had the overview of the principles of security before. The entire concept of A.P.A.I.N was quite interesting.

My recent session was Tim Quinlan’s session on Implementing and Managing Logical Standby databases. I have been using physical standby databases for many years and have not yet had the opportunity to do a lot of work on logical standby databases.

Well….I am off for lunch.

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @sheeri: #confoo talk "Bending Queries to your Will with EXPLAIN" slides http://bit.ly/explainslides & handout
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more