Today I started with an Oracle Administration course and just finished the “Database Architecture” part. Well, not really new stuff for me. They told me think like: What’s the SGA, PGA (they didn’t say anything about the UGA), background, server and user processes, what’s the diffrence between database, instance and server and a little overview of which work the processes perform. All in all a course which go to less in detail of the components for me. All the stuff they told me I already know and with know I mean: I know it in much more detail! But to be fair, I’m sure that it’s not a bad course for people who starting to be a DBA. And that was just the first session of the course, so we”ll see if the others are more interesting for me!
Today following question came up: Would the JDBC driver of Oracle regonize it, when you set the setMaxRows and perform a SELECT using the FOR UPDATE clause. Example: You’ve a table with 40 rows. Now you call setMaxRows(20) so that you only would get the first 20 rows and perform the select without any where clause (I know, not really a pretty solution: Instead of using rownum, you would select all rows and just stop fetching at the 21th row, but however). Would you now lock all 40 rows or just 20. Well, the answer is (I’ve expected it): You get a row lock on the entry table, not only the first 20 lines. With rownum in the where clause it is now problem. You just lock the selected 20 rows and the other 20 are available for other transactions. So developers: Use the rownum pseudo column instead of the setMaxRows function specially if you perform a select… for update!
But the nicest thing on this little test: I wrote my first Java code since 4 years! 🙂
Oh damn, I just get through a presentation of Steven Feuerstein and found out, that PL/SQL supports object-oriented programming. I’m sure, now you think: Why does this stupid guy mean “oh damn…”. Because this “feature” is available since 8i and got strong on 9i. And now they already released 11g! So I didn’t know this possibility several years ago! Well but now I know it and I find it pretty cool, because PL/SQL gets more and more powerful (there are also supported functions for file I/O, HTTP, XML and many many more). Also external or java stored procedures were a big step forward. I just can recur me: Pretty cool!
What do you usually do on a Friday night? Go out with your friends, finish some work, or just watch TV and then go to bed? Well, today I spent my Friday night in the office (like real DBA’s). Why? Well, our unix admin change the configuration of the servers and of course the DBA also has to check afterwards, if everything is right with the databases. And it was a good decision to came. Actually all database were down except of one. And it was a good chance to patch one of them. Well, now it’s 12:09 AM (on a Saturday morning), the unix admin is still working, but I’ll now drive home and go to bed.
Oracle 11g is already available and I just finished reading the “New features guide” of Oracle 11g. There are some really nice features in it: Flashback Transactions, CONTINUE-Clause in PL/SQL, Data Revovery Advisor, SQL Test Case Builder, Automatic Health Monitor, SQL Performance Analyzer just to name some few. I’m really excited if all this features work as Oracle promises, but I’ll finally see, when I’ve installed the database on my test system.
I’ve to get a little MySql database running on a local test system and import a “dump” file of a database to verify, if the file is valid. Sounds easy, but first you have to find out, how you get the dump file into the database. For that you must know, that MySql doesn’t write a “normal” dump file as default, but a simple SQL-file including all the statements to get the status from the database back. Ok, also not very hard. Then you import the file, but not with @ like in Sql*Plus. The correct syntax is ‘source <sourcefile>;’. While executing this you get pissed on with “value bigger than max_allowed_packet”. You spend 1 hour to get yourself throw the documentation, found 4 ways to set this damn variable but – just one way works. Ok, you throw away the database, recreate it, set the variable and get sure that it is set and before you reexecute the file you would like to spool the result. But, MySql doesn’t know “spool” like Sql*Plus. No it doesn’t know anything like that as I saw on spending some minutes on the documentation and Google. The only thing you have is a .mysql_history file, but it also didn’t protocol the echo from the database, no just the commands you typed in. Ok, well no spooling, you have the shell open and will some critical error. So restart the import from the file and see: Same max_allowed_packet error again though the variable is set to the highest value. I’m really pissed on MySql at the moment. Sure I know, if I would know it better, it would not be a problem, but my Dad has his birthday today and it’s already 6:30 PM. I don’t want to spent more time on it in the office!
Just listen to a pod cast of Tom Kyte explaining what’s new in 11g database. Sounds intresting, but unfortunately it’s just the first part of it and the second one isn’t published till yet! But you should check it out!
How would you repair the cable of a multimeter which is broken at the inner part of the grip? Well, a Friend of myself is doing it this way: Take the bigges rubber mallet you can find, smash the grip of the cable to get out the pin and dismantle the the calbe. Then take a soldering iron and tin-solder and try to fix the cable on the pin. After a couple of attempts you made it, then put back the pin into the grip and see, that the grip doesn’t hold anymore. So what you do to finish the repair? You take the soldering iron and move it around the pin on the plastic and – surprise – it’s repaired. And the worst case repair, if you wouldn’t get the cable onto the pin: You put as many tin-solder on it as possible and cut of the rest to get the pin back to the grip.
Well, it isn’t the smartest solution, BUT it works! 😀
After my predecessor destroid the second monitor of my workplace, it took me three months to get a new one (no one was available because of the inters in the office). Now finally I’ve a nice big Sun monitor with 21 inch where I could always see my monitoring tools of the database 🙂
Finally I did it. At this day I’ll also be a blogger. But now, because it’s late and tomorrow I have to throw a big… ok a middle party, I’ll go to bed. Good night world!