Many times we need to dump Oracle's data blocks to study its content, and Oracle provides a good way to do this, and we'll explain it in the following example:
[Oracle@jumper udump]$ Sqlplus "/As SYSDBA" Sql*plus:release 9.2.0.3.0-production on Tue Aug to 17:01:27 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to:oracle9i Enterprise Edition release 9.2.0.3.0-productionwith The partitioning, OLAP and Oracle Data Mining Optionsjserver release 9.2.0.3.0-productionsql> select Rowid,deptno,dname,loc from Scott.dept; ROWID DEPTNO dname LOC-------------------------------------------------------aaadz7aabaaagk6aaa ACCOUNTING NEW Yorkaaadz7aabaaagk6aab dallasaaadz7aabaaagk6aac SALES Chicagoaaadz7aabaaagk6aad OPERATIONS bostonsql& Gt Select File_id,block_id,blocks from dba_extents where segment_name= ' DEPT '; file_id block_id BLOCKS------------------------------1 25273 8sql> alter system dump DATAFILE 1 Block min 25273 bloc K Max 25274; System altered. Sql>! [Oracle@jumper udump]$ ls-ltotal 4-rw-r-----1 Oracle DBA 3142 Aug to 17:04 hsjf_ora_13674.trc[oracle@jumper udump]$ more Hsjf_Ora_13674.trc/opt/oracle/admin/hsjf/udump/hsjf_ora_13674.trcoracle9i Enterprise Edition Release 9.2.0.3.0- Productionwith the partitioning, OLAP and Oracle Data Mining optionsjserver Release 9.2.0.3.0-productionoracle_home =/O Pt/oracle/product/9.2.0system name:linuxnode name:jumper.hurray.com.cnrelease:2.4.18-14version: #1 Wed Sep 4 13:35:50 EDT 2002machine:i686instance Name:hsjfredo thread mounted by this instance:1oracle process Number:9unix process pid:1 3674, image:oracle@jumper.hurray.com.cn (TNS v1-v3) * * * 2004-08-31 17:04:27.820*** session ID: (8.3523) 2004-08-31 17:04:27.819start dump data blocks tsn:0 file#: 1 minblk 25273 maxblk 25274buffer tsn:0 rdba:0x004062b9 (1/25273) scn:0 x0000.0057c70d seq:0x01 flg:0x04 tail:0xc70d1001frmt:0x02 chkval:0x12e3 type:0x10=data SEGMENT header-unlimited Ex Tent Control Header-----------------------------------------------------------------Extent header:: spare1:0 spare2 : 0 #extents: 1 #blocks: 7 last map 0x00000000 #maps:0 offset:4128 highwater:: 0X004062BB ext#: 0 blk#: 1 ext size:7 #blocks in seg. HDR ' s freelists:1 #blocks below:1 mapblk 0x00000000 offset:0 unlocked Map Header:: Next 0x00000000 #extents: 1 obj#: 13 947 flag:0x40000000 Extent Map-----------------------------------------------------------------0x004062ba length:7 NFL = 1, NFB = 1 Typ = 1 NXF = 0 ccnt = 1 SEG LST:: flg:used lhd:0x004062ba ltl:0x004062ba buffer tsn:0 rdba:0x004062 BA (1/25274) scn:0x0000.0131909b seq:0x07 flg:0x04 tail:0x909b0607frmt:0x02 chkval:0xa8e7 Type:0x06=trans dataBlock Header dump:0x004062ba Object ID on block? Y seg/obj:0x367b csc:0x00.131909a itc:2 flg:o typ:1-DATA fsl:0 fnx:0x0 ver:0x01 Itl Xid Uba Flag Lck scn/fsc0x01 0X0001.02A.000003F3 0x0080000b.0188.08 C---0 scn 0x0000.0057c70e0x02 0x0000.000.00000000 0x00000000.0000.00----0 FSC 0 x0000.00000000 Data_block_dump,data header at 0XADB505C===============TSIZ:0X1FA0HSIZ:0X1APBL:0X0ADB505CBDBA: 0X004062BA 76543210flag=--------Ntab=1nrow=4frre=-1fsbo=0x1afseo=0x1f44avsp=0x1f2atosp=0x1f2a0xe:pti[0] nrow=4 offs=00x12:pri[0] offs= 0X1F860X14:PRI[1] offs=0x1f700x16:pri[2] offs=0x1f5c0x18:pri[3] Offs=0x1f44block_row_dump:tab 0, row 0, @0x1f86tl:26 FB:--h-fl--lb:0x0 cc:3col 0: [2] C1 0bcol 1: [A] 2 4f 4e 4e 47col: [8] 4e (4f) 4btab 0, Row 1, @0x1f70tl:22 fb:--h-fl--lb:0x0 cc:3col 0: [2] C1 15col 1: [8] (48col 2: [6] 44 41 4 C 4c 53tab 0, Row 2, @0x1f5ctl:20 fb:--h-fl--lb:0x0 cc:3col 0: [2] C1 1fcol 1: [5] 4c 53col 2: [7] 43 4ftab 0, Row 3, @0x1f44tl:24 fb:--h-fl--lb:0x0 cc:3col 0: [2] C1 29col 1: [Ten] 4f 50 45 52 41 54 49 4 F 4e 53col 2: [6] 4f 4f 4eend_of_block_dumpend dump data blocks tsn:0 file#: 1 minblk 25273 maxblk 25274
One question that many people often ask is, how is rdba converted?
RDBA:0X004062BA (1/25274)
Let's use this example to introduce.
RDBA has changed from Oracle6->oracle7->oracle8 three times:
In Oracle6, the RDBA is represented by a 6-bit 2-digit number, which means that the data block can only have 2^6=64 data files (remove all 0 and 1, which can actually represent only 62 files)
In Oracle7, the file number in RDBA is increased to 10 bits, and for backward compatibility, 4 bits are taken from the high position of the block number as the high level of the file number. This rowid from 6->7 does not need to be changed.
In Oracle8, the file number is still represented in 10 digits, but no replacement is needed, and the relative file number (rfile#) is introduced for backward compatibility, so there is no need to change from Oracle7 to Oracle8,rowid.
Examples are as follows:
In Oracle6: For example: File 8, block 5,689,226 bit block number ==56892 vv vvvvvvvv vvvvvvvv vvvvvvvv00100000 00000000 11011110 00111100 ^^ ^^ ^^ 6 Bit file number ==8 in Oracle7: For example: File 255, block 56892 11111100 11000000, 11011110 00111100 F c C 0 D E 3 C \_____/\___/\_______________ ________/ | | | | | block = 0xde3c = 56892 \_____________ | V v 0011 111111 = 0xFF = 255-note that the high and low places to be replaced to get the correct file# in Oracle8: for example: File 255, block 56892 11111100 11000000 11011110 001 11100 F c C 0 D E 3 C \_____/\___/\_______________________/| | | block = 0xde3c = 56892 \_____________ | \ v V 0011 1111 0011 = 03F3 = 1011-This is the relative file number
For the example in our test:
RDBA:0X004062BA (1/25274)
which is: 0000 0000 0100 0000 0110 0010 1011 1010
Top 10 for rfile#: 0000 0000 01 = 1
The latter 22 digits are block#:00 0000 0110 0010 1011 1010 = 25274
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service