Feeling Fragile…

I took a bit of a beating at Karate last night, so I’m feeling a little fragile this morning.

Monday night was tough. One of the instructors took me aside and worked with me one-on-one for the whole lesson. I just went up an down the hall constantly doing combinations and the six katas I need for my next grading. I thought I was going to puke, but I survived. Whatever doesn’t kill you makes you stronger… Or so I thought.

Last night we did quite alot of partner work, then switched to lineups. For those who don’t know, a lineup is where you stand at the front of the class while a bunch of people take it in turns to attack you with a single technique, which you must block and counter attack. After a few rounds the speed gradually builds up to a point where it’s a little frenzied. Finally, when the class was finished I did some sparring with one of the instructors. Once again, this started quite light and ended up with the pair of us lying on the floor, still trying to punch and kick each other πŸ™‚

When I got home I took stock of my injuries, which included:

  • A sore right elbow, caused by one of my punches being blocked on the elbow joint. Ouch!
  • A very painful right shoulder, caused by a stray punch that was meant to hit my head, but fortunately hit my shoulder instead. It hurts to raise my arm above shoulder height.
  • Swollen right hand, where I managed to punch somebodies elbow. I best avoid punching with that hand for a coupe of weeks.
  • A miriad of bruises on my forearms and shins from blocking punches and kicks.
  • A big green bruise on my chest, presumably where I got hit, although I really can’t remember it…

For the rest of the night I lay on my bed moving an ice pack from one bit of my body to the next. The only real problem is the shoulder, which feels like it’s going to take a few days to fix. Unfortunately, I have to go swimming at lunchtime, teach Ashtanga Yoga tonight and of course, go to Karate tomorrow…

What’s more, one of my friends is going to India for a little over two weeks, so starting next week I’ve got to teach his Hatha and Astanga Yoga classes while he’s away. I can just see their faces now when I turn up all battered and bruised with the odd joint that won’t move. Not exactly what you expect a Yoga teacher to look like πŸ™‚

It’s going to be a long couple of weeks… πŸ™‚

Cheers

Tim…

Loading LOB Data Using SQL*Loader…

In a recent post I discussed the use of BLOBs and External Tables. As a result of that I thought I better take a look at how SQL*Loader copes with LOBs, so I wrote Loading LOB Data Using SQL*Loader. SQL*Loader has a number of methods for loading LOBs, but I focussed on the one that most closely matches the method used by external tables.

Cheers

Tim…

A Tale of 4 Schedulers…

A long time ago in a galaxy far, far away, there was only one Oracle scheduler. It was managed using the DBMS_JOB package and the job information was stored in a single table.

SELECT table_name
FROM   dba_tables
WHERE  owner = 'SYS'
AND    table_name LIKE 'JOB$%'
ORDER BY table_name;

TABLE_NAME
------------------------------
JOB$

1 row selected.

SQL>

Information about scheduled jobs was available from the “DBA_JOBS%” views.

SELECT view_name
FROM   dba_views
WHERE  owner = 'SYS'
AND    view_name LIKE 'DBA_JOBS%'
ORDER BY view_name;

VIEW_NAME
------------------------------
DBA_JOBS
DBA_JOBS_RUNNING

2 rows selected.

SQL>

Oracle 10g introduced a new scheduler that was managed using the DBMS_SCHEDULER package, whose job information was stored in the “SCHEDULER$%” tables.

SELECT table_name
FROM   dba_tables
WHERE  owner = 'SYS'
AND    table_name LIKE 'SCHEDULER$%'
ORDER BY table_name;

TABLE_NAME
------------------------------
SCHEDULER$_CHAIN
.
.
.
SCHEDULER$_WINGRP_MEMBER

22 rows selected.

SQL>

Information about scheduled jobs for this new scheduler was available from the “DBA_SCHEDULER%” views.

SELECT view_name
FROM   dba_views
WHERE  owner = 'SYS'
AND    view_name LIKE 'DBA_SCHEDULER%'
ORDER BY view_name;

VIEW_NAME
------------------------------
DBA_SCHEDULER_CHAINS
.
.
.
DBA_SCHEDULER_WINGROUP_MEMBERS

19 rows selected.

SQL>

In addition to the two internal schedulers, the OEM 10g DBConsole had its own scheduler, which stored job information in the “MGMT_JOB%” tables.

SELECT table_name
FROM   dba_tables
WHERE  owner = 'SYSMAN'
AND    table_name LIKE 'MGMT_JOB%'
ORDER BY table_name;

TABLE_NAME
------------------------------
MGMT_JOB
.
.
.
MGMT_JOB_VALUE_PARAMS

44 rows selected.

SQL>

To confuse matters further, the OEM 10g Grid Control repository had a similar scheduler to OEM 10g DBConsole, but with a few extra tables.

SELECT table_name
FROM   dba_tables
WHERE  owner = 'SYSMAN'
AND    table_name LIKE 'MGMT_JOB%'
ORDER BY table_name;

TABLE_NAME
------------------------------
MGMT_JOB
.
.
.
MGMT_JOB_VALUE_PARAMS

53 rows selected.

SQL>

Faced with the choice of four ways to schedule a job, most DBAs called “Tim Hall” decided to pick a single scheduler and keep things simple πŸ™‚

Cheers

Tim…

PS. Don’t even get me started on OS schedulers and the Oracle Applications scheduler… πŸ˜‰

Fearless…

I saw Fearless (Huo Yuan Jia), the new Jet Li film, at the weekend. It’s based on a true story and has some seriously cool fight sequences. I’ve said it before and I’ll say it again, in my opinion Jet Li is the personification of martial arts. He is such a complete practitioner. He has technique, power, speed, flexibility, precision, finesse and grace by the bucket load. This is supposed to be his last martial arts epic, but I hope he keeps producing films with quality fight scenes like those in Hero, Unleashed and this film.

Cheers

Tim…

PS. Take your reading glasses, it’s subtitled πŸ™‚

Happy Birthday to me… (Yesterday…)

It was my 37th birthday yesterday.

On the way to visit my family I hit a pigeon, which wasn’t very nice. There wasn’t anything I could do to avoid it, other than not drive that day… πŸ™

My brother and his wife hired a bouncy castle to keep the kids occupied, which of course meant that all the adults went nuts on it for the whole day, including the grandparents whose ages varied from 65 up to 78. I hope I can still jump around on a bouncy castle when I’m 78 πŸ™‚ There were several tramplings, flying head-butts and body-slam incidents, but everyone survived with only mild bruising πŸ™‚

Cool!

Cheers

Tim…

Is read-only access to production systems safe?

There is an interesting thread on the Dizwell Forum about access to production systems using tools like TOAD. Of course, this begs the question, is there such a thing as “safe” read-only access to production data?

If you are allowing read-only access to tables on a production system, you are also allowing record and table locking. If you don’t believe me, take a look at this:

tim_hall@dev1> CONN sys/????@db10g AS SYSDBA
Connected.
sys@db10g> CREATE USER test_user1 IDENTIFIED BY test_user1 QUOTA UNLIMITED ON USERS;

User created.

sys@db10g> GRANT CONNECT, CREATE TABLE TO test_user1;

Grant succeeded.

sys@db10g> CREATE USER test_user2 IDENTIFIED BY test_user2 QUOTA UNLIMITED ON USERS;

User created.

sys@db10g> GRANT CONNECT TO test_user2;

Grant succeeded.

sys@db10g> CONN test_user1/test_user1@db10g
Connected.
test_user1@db10g> CREATE TABLE test_tab1 (
2    id  NUMBER
3  );

Table created.

test_user1@db10g> INSERT INTO test_tab1 (id) VALUES (1);

1 row created.

test_user1@db10g> GRANT SELECT ON test_tab1 TO test_user2;

Grant succeeded.

test_user1@db10g> CONN test_user2/test_user2@db10g
Connected.
test_user2@db10g> DECLARE
2    l_id  test_user1.test_tab1.id%TYPE;
3  BEGIN
4    SELECT id
5    INTO   l_id
6    FROM   test_user1.test_tab1
7    WHERE  id = 1
8    FOR UPDATE;
9
10    ROLLBACK;
11  END;
12  /

PL/SQL procedure successfully completed.

test_user2@db10g> LOCK TABLE test_user1.test_tab1 IN EXCLUSIVE MODE;

Table(s) Locked.

test_user2@db10g> ROLLBACK;

Rollback complete.

test_user2@db10g>

Looks like the SELECT privilege is not so safe after all πŸ™

Of course, you don’t need direct access to the tables. You could always provide access to the data via APIs, but that’s not what your average TOAD user wants to hear!

Cheers

Tim…