Links
- CV
- Titles
- Topics
- Tickets
- Science
- About Eric
- Book Reviews
- Country Profile
- Modern China
- Contact Eric
- Podcast
- Vision
- Sekai
- John
Archives
RSS
Reflections on a Wandering Life.....
Friday, April 09, 2004
Sitting here in Langfang, so I have a few minutes to get caught up on this... had an interesting situation in the Oracle lab the other day. I was explaining to my students how the online redo long files in Oracle work. I don't want to get too technical, but basically, the redo log files record all changes to the database. When a transaction is committed, the Log Writer process writes the changes to the log files. When the first log group (one or more files) is full, the database performs a checkpoint, all changes are written to the datafiles, and the database does a log switch to the next log group. Well, one of my students got curious about this, and decided to test this. She performed some DML (data manipulation language) activity (such as deleting a row from a table), then viewed the details in Windows where it shows the last time the file has changed. But Windows showed no change. She asked me about this, so I forced a log switch on her database, and Windows showed the change. But when we did DML activity, there was no change. I am not talking about big changes now, but that is not the point. We were only looking for some indication by Windows that the file had been addressed. Nothing. Well, I wanted to find a way to prove that the log file was being written to, so I went to orafaq.com and submitted a question. A DBA responded with a query that does the trick. Here it is:
select
le.leseq "Current log seqence No",
100*cp.cpodr_bno/le.lesiz "Percent Full",
cp.cpodr_bno "Current Block No",
le.lesiz "Size of Log in Blocks"
from
x$kcccp cp,
x$kccle le
where
LE.leseq = CP.cpodr_seq
and bitand(le.leflg, 24)=8
/
If you look at this query for awhile, you can see that it is a query against internal tables that are not normally used. This is probably because none of this has anything to do with what you would actually need to know to run an Oracle database. Just idle curiosity.
After the lab I was talking with some students over a dinner of duck blood stew. Somehow we got into a discussion about all the changes in China. They commented that it wasn't all good, and someone mentioned corruption. I said that much of this was because China seemed to be in a transition state between belief systems. One of the students commented on the loss of religion, and another said that religion was not of any value since it wasn't true. So I said, "Well, if I am working with a complex system, like Oracle. I am not impressed with the computer, or even with the database. I am impressed with the minds that created it. And when I walk outside at night and look at the sky, I am not just impressed with the stars. I want to meet the engineer who put it together. The night sky is not an accident. It is design. End of discussion.
select
le.leseq "Current log seqence No",
100*cp.cpodr_bno/le.lesiz "Percent Full",
cp.cpodr_bno "Current Block No",
le.lesiz "Size of Log in Blocks"
from
x$kcccp cp,
x$kccle le
where
LE.leseq = CP.cpodr_seq
and bitand(le.leflg, 24)=8
/
If you look at this query for awhile, you can see that it is a query against internal tables that are not normally used. This is probably because none of this has anything to do with what you would actually need to know to run an Oracle database. Just idle curiosity.
After the lab I was talking with some students over a dinner of duck blood stew. Somehow we got into a discussion about all the changes in China. They commented that it wasn't all good, and someone mentioned corruption. I said that much of this was because China seemed to be in a transition state between belief systems. One of the students commented on the loss of religion, and another said that religion was not of any value since it wasn't true. So I said, "Well, if I am working with a complex system, like Oracle. I am not impressed with the computer, or even with the database. I am impressed with the minds that created it. And when I walk outside at night and look at the sky, I am not just impressed with the stars. I want to meet the engineer who put it together. The night sky is not an accident. It is design. End of discussion.