July 02, 2008
A virtual Sun
Why you may ask. The answer is simple. It gives me a private development environment that I can mess with without causing high blood pressure to others on the team.
The main hurdle came in getting the right combination and online guides (which were aplenty) on Solaris and Oracle 10g on Solaris installations did not give this crucial piece of information. Imagine when I found the solution (took < 60 seconds to implement) how overjoyed I might have been!
More on the solution in the next post. Sorry to end like a typical Hindi soap opera.
June 18, 2008
The Oracle DBA's arsenal
Well, that's a thing of the past! It's now much easier and efficient to work on Windows doing the kind of wizardry that Oracle DBA's from the Unix/Linux world perform thanks to a ton of free software available. The tools that I commonly employ are:
Operating System:
- SysInternals Process Explorer and PS Tools
- Most notable amongst the suite is CONTIG which allows one to defragment datafiles.
- GNU Core Utilities
- All the utilities ported to Window
- Grep, Sed, Gawk (ported to Windows)
- JBSQL - a light SQL*Plus replacement, very lean and very fast though development has been stopped. I personally enjoy working with it very much as SQL Developer though powerful, does not allow one to work speedily
- Senora - An Oracle shell replacement in Perl
- DBEdit2 - I use this one sometimes when I work on migration projects and have to connect to different types of RDBMS's
- HammerOra - an all-time favourite for performing benchmarks and scalability tests
- ORASRP (Oracle Session Resource Profiler) - Amazingly fast tool for making sense of the extended SQL trace files. Again, a must have
June 15, 2008
first fifty blocks...2
Apart from changes in the SCN (system change number), one also sees that the RDBA (Relative Data Block Address) changes when a table is created in the tablespace. This is accompanied by changes in Memory addresses. Also initially when the blocks are not used they do not receive a File ID (compare the bold File/Block values in the table in the previous post) and are marked as 'unknown' type. Disturbingly, one sees the dreaded word 'CORRUPT'. When the table is created these block id's are associated with the File ID and receive valid RDBAs and different memory addresses.
June 12, 2008
first fifty blocks...1
buffer tsn: 6 rdba: 0x00000009 (0/9)
scn: 0x0000.00000000 seq: 0x01 flg: 0x05 tail: 0x00000001
frmt: 0x02 chkval: 0xa709 type: 0x00=unknown
Hex dump of corrupt header 4 = CORRUPT
Dump of memory from 0x06FD2200 to 0x06FD2214
So when there is no data the rdba does not specify the file ID while the block ID is specified.
Next I populated this tablespace with some data and compared both files with WinMerge.
The same block id is now present at a different rdba.
buffer tsn: 6 rdba: 0x02c00009 (11/9)
scn: 0x0000.003ac39c seq: 0x02 flg: 0x00 tail: 0xc39c2002
frmt: 0x02 chkval: 0x0000 type: 0x20=FIRST LEVEL BITMAP BLOCK
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04B12200 to 0x04B14200
Now we also have a SCN and a new type. Memory addresses have also now changed. This I need to look into further. What I found most unusual is marking blocks as CORRUPT (enough to give someone a heart attack!).
Managed to get the before and after view in a tabular format.
Empty Tablespace | Non Empty TableSpace |
| buffer tsn: 6 rdba: 0x02c00002 (11/2) | buffer tsn: 6 rdba: 0x02c00002 (11/2) |
first fifty blocks
SQL > ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME FILE_HDRS LEVEL 10';
This gives you details from the initial blocks of the data file. Subsequent blocks could be dumped using the command:
SQL > ALTER SYSTEM DUMP DATAFILE 4 BLOCK MIN 2 BLOCK MAX 50;
Once I had the above file ready, I used grep to filter out the information that I was interested in.
grep -i -a -A 2 -B 2 frmt /oracle/admin/my10gdb/udump/tracefilename.trc
This is what I get out of doing this:
buffer tsn: 4 rdba: 0x01000002 (4/2)
scn: 0x0000.00093217 seq: 0x02 flg: 0x04 tail: 0x32171d02
frmt: 0x02 chkval: 0x959c type: 0x1d=KTFB Bitmapped File Space Header
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04BF2200 to 0x04BF4200
--
buffer tsn: 4 rdba: 0x01000003 (4/3)
scn: 0x0000.00093217 seq: 0x01 flg: 0x04 tail: 0x32171e01
frmt: 0x02 chkval: 0xbee7 type: 0x1e=KTFB Bitmapped File Space Bitmap
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04BF2200 to 0x04BF4200
.....
--
buffer tsn: 4 rdba: 0x01000009 (4/9)
scn: 0x0000.0006e954 seq: 0x02 flg: 0x04 tail: 0xe9542002
frmt: 0x02 chkval: 0x78dc type: 0x20=FIRST LEVEL BITMAP BLOCK
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04BF2200 to 0x04BF4200
--
...further down...
buffer tsn: 4 rdba: 0x0100000b (4/11)
scn: 0x0000.0006e954 seq: 0x02 flg: 0x04 tail: 0xe9542302
frmt: 0x02 chkval: 0x1529 type: 0x23=PAGETABLE SEGMENT HEADER
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04BF2200 to 0x04BF4200
--
buffer tsn: 4 rdba: 0x0100000c (4/12)
scn: 0x0000.0006e954 seq: 0x01 flg: 0x04 tail: 0xe9540601
frmt: 0x02 chkval: 0x17a9 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x04BF2200 to 0x04BF4200
--
Now I have my hands full on trying to make head or tail out of this information. One interesting stuff I noticed yesterday. If the data file does not contain any tables, the blocks following the bitmaps are marked as CORRUPT!
June 11, 2008
welcome to scattered reads
And, yes hopefully the site will invite enough attention to befit the title (from all over the globe).