Document Type | Technical Information
Cateogry | Monitoring/Inspection
Applicable Product Versions | 6FS07, 6FS07PS, 7FS02, 7FS02PS
Document Number | TMOTI065
Overview
Guide on a method used in the field to find dump targets using DBA values
- Content: Since the DBA value is a 32-bit integer, calculation is necessary to find the dump target in the field. This guide covers a relatively simple method that can be used on-site.
- Environment: bash shell environment / environments available for Windows calculator
Method
Structure of DBA
DBA stores the Data Block Address as a 32-bit number
- Upper 10 bits: store the Datafile number
- Lower 22 bits: store the block number within the Datafile
- Therefore, to perform a Data Block dump by looking at the DBA, it is necessary to convert the upper 10 bits and lower 22 bits into decimal numbers.
Available DBA Calculation Methods at Site
DBA stores the Data Block Address as a 32-bit number
- Upper 10 bits: store the Datafile number
- Lower 22 bits: store the block number within the Datafile
Example case of finding block dump target using DBA
- This is the case when you want to find out what the dba information is from a callstack or log.
- In this case, you want to get the block dump of shdrdba=2805990134 shown in the callstack.
Thread 19 (Thread 0x2b5abe847700 (LWP 44731)):
#0 0x00000000018c99a8 in spin_lock_internal (lock=0x2aab4a6215b0, level_check=level_check@entry=SPIN_LEVEL_CHECK_MIN)
at /home/chef/workspace/Build_centos_7-2/tibero6/src/tbsvr/spinlock/spinlock.c:652
#1 0x00000000019a02c1 in tc_sgmtstat_local_add_stat_value (sgmt_id=4294967295, stat_type=stat_type@entry=TC_SGMTSTAT_LOGICALRD, inc_value=inc_value@entry=1)
at /home/chef/workspace/Build_centos_7-2/tibero6/src/tbsvr/tc/tc_stat.c:737
#2 0x0000000001c78d68 in txblk_get_cdba_lvl_splitcnt (buf=buf@entry=0x2abb3ed174e0, key=key@entry=0x2b5abe845dd0, lvl=lvl@entry=0x2b5abe845c00 "\003", splitcnt=splitcnt@entry=0x2b5abe845c10 "\004\210\251\215\002", prefetch_cnt=prefetch_cnt@entry=0x2b5abe845c40 "")
at /home/chef/workspace/Build_centos_7-2/tibero6/src/tbsvr/tx/tx_cr.c:492
#3 0x0000000001a7ebb4 in td_isgmt_get_buf_in_lvl_internal (ts_id=<optimized out>, shdrdba=2805990134, key=key@entry=0x2b5abe845dd0, lvl=lvl@entry=0 '\000', lock=lock@entry=BL_EXL, use=use@entry=BU_RB, sgmt_id=sgmt_id@entry=4294967295, bufpool=bufpool@entry=0 '\000', rio=rio@entry=0x0)
at /home/chef/workspace/Build_centos_7-2/tibero6/src/tbsvr/td/td_isgmt.c:400
Calculation Method - Overview
- Using bit shift operators, you can easily obtain the decimal value of the upper 10 bits, and by subtracting this value from the original value, you can get the lower
22 bits (block number).
- DBA >> 22 result: file#
- DBA - ( (DBA >> 22) << 22) : block number
Calculation Method - Using Shell
- Use shell as below (example with 2805990134)
- You will get file# 669 and Block# 758
# When executed in order
#1. By right shifting 22 bits, the lower 22 bits are removed and only the upper 10 bits remain as a decimal number. This gives the file #
tibero@TDB:/home/tibero$ echo $((2805990134 22))
669
#2. Take the value obtained in #1 and left shift by 22 bits to fill the lower 22 bits with zeros, obtaining a decimal number
tibero@TDB:/home/tibero$ echo $((669 22))
669
tibero@TDB:/mnt/e$ echo $(($DBA - (($DBA 22) Calculation Method - Using Windows Calculator
- You can perform the operations using the Programmer mode of the Windows calculator.
- Change to Programmer mode from the menu
- Enter the DBA value, then press the >> key and input 22 to get the file number.
- Save the file# separately in a notepad or elsewhere and perform << 22 again.
- Subtract the above value from the original DBA value to get the block number.
- Using this method, you will get file# 669 Block# 758.
Performing Block Dump Using Calculated Values
The block dump command can be executed in two forms, and note that there is a difference between them.
- ALTER SYSTEM DUMP DATAFILE <file_name> BLOCK <block number>
You need to find the filename by running select file_name from v$datafile where file#=<file#>.
- ALTER SYSTEM DUMP DATAFILE <file#> BLOCK <block number>
This dumps based on blocks loaded in cache, so the result may differ from the above.