In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
With the promotion of the new version of the database, ASM will certainly be paid more and more attention. Before 11g comes out, what can be done is very limited. If you want a file in copyASM to come out, you can only use DD and exec dbms_file_transfer.copy_file (). If the block is broken, you can only use DD to find the corresponding file DD, and then do BBED analysis. AMDU is available in 11G, and this can be used on 10G. Let's learn about its usage and compare it with DD to play the role of throwing bricks.
AMDU is an asm file extraction tool that comes with oracle 11g. It can also be used by oracle 10g. For more information, please see oraclemetalink 553639.1:
Download:
Unzipamdu_X86-64.zip
ExportLD_LIBRARY_PATH=./
Extract spfile
SQL > selectname,file_number,alias_index,file_incarnation from v$asm_alias where name like'%spfile%' NAME FILE_NUMBER ALIAS_INDEX FILE_INCARNATIONspfile.266.866828907 266 477 866828907spfiledb.ora 266 227 866828907 [grid@mysql-1] $amdu-diskstring'/ dev/raw/raw*'-extract data.266 [grid @ mysql-1] $strings DATA_266.f db1.__db_cache_size=134217728db2.__db_cache_size=146800640db1.__java_pool_size=4194304db2.__java_pool_size=4194304db1.__large_pool_size=8388608db2.__large_pool_size=8388608db2.__oracle_base='/opt/oracle' # ORACLE_BASEset from environment. ..
There seems to be no problem with extraction. If you are interested, you can continue to track the extraction process of amdu:
Strace-o amdu.log amdu-diskstring'/dev/raw/raw*'-extract data.266
We also use DD to demonstrate here:
SQL > SELECT a.GROUP_KFFXP, a.DISKPRONKFFXP, v$asm_alias cWHERE a.number_kffxp. AUTHUBUBING KFFXP, b.pathjold c. Name FROM x$kffxp a, v$asm_disk b, v$asm_alias cWHERE a.number_kffxp = c.file_numberAND a.GROUP_KFFXP = b.group_numberAND a.disk_kffxp = b.disk_numberAND b.group_number=1AND c.name LIKE'%spfile%' GROUP_KFFXP DISK_KFFXP AU_KFFXP PATH NAME1 0 208 / dev/raw/raw4 spfiledb.ora1 0 208 / dev/raw/raw4 spfile.266.866828907
Determine the block size:
SQL > selectname,block_size,allocation_unit_size,state,type from vanguard diskgroupterNAME BLOCK_SIZE ALLOCATION_UNIT_SIZE STATE TYPEDATA 4096 4194304 CONNECTED EXTERNARCH 4096 0 DISMOUNTED
Here the block_size is 4K and the autopsy size is 4m.
Dd if=/dev/raw/raw4 bs=4096 count=1skip=212992 of=spfile.ora description: skip=208* 1024 [grid @ mysql-1 ~] $strings spfile.oradb1.__db_cache_size=134217728db2.__db_cache_size=150994944... .db1.thread = 1db2.thread 4db1.undobread tablespaceways UNDOTBS1db2.undobread tablespacewings UNDOTBS4'
Extract files:
SQL > select file#,name,bytes/1024/1024 from v$datafile wherename like'% users%' FILE# NAME BYTES/1024/10244 + DATA/db/users01.dbf 2728.755 + DATA/db/datafile/users.274.896306467 100#amdu-diskstring'/ dev/raw/raw*'-extract data.274#cat report.txt* * EXTRACTING FILE DATA.274 * * Creating file: DATA_274.f Extraction wrote: 104865792 bytes Stripe size: 4194304 bytes Stripe columns: 1 Mirror copies: 1 Block size: 8192 bytes File size: 12801 blocks File type: 2 Extent size # 1: 4294967295 extentsof 1 AUs Extent size # 2:0 extentsof 1 AUs Extent size # 3: 0 extentsof 1 AUs Extent size # 4: 4294967295 extentsof 1 AUs Creation time: 2015/11/2022:01:07.797000 Modified time: 2015/12/1820:00: 00.000000 Dataextents in file: 26 Dataextents found: 26 Blocks not found: 0 blocks
Dbv verification
[grid@mysql-1] $dbv file=DATA_274.fblocksize=8192DBVERIFY: Release11.2.0.4.0-Production on Fri Dec 18 22:28:15 2015 Copyright (c) 1982 grid@mysql-1 2011, Oracle and/or its affiliates. Allrights reserved. DBVERIFY-Verification starting: FILE = / home/grid/amdu_2015_12_18_22_21_11/DATA_274.f DBVERIFY-Verification complete Total PagesExamined: 12800Total PagesProcessed (Data): 252Total PagesFailing (Data): 0Total PagesProcessed (Index): 0Total PagesFailing (Index): 0Total PagesProcessed (Other): 131Total PagesProcessed (Seg): 0Total PagesFailing (Seg): 0Total PagesEmpty: 12417Total Pages MarkedCorrupt: 0Total PagesInflux: 0Total Pages Encrypted : 0Highest blockSCN: 4075933 (0.4075933)
Compare this with the x$ view:
SELECTa.GROUP_KFFXP, a.DISK_KFFXP, a.AU_KFFXP, b.pathjig c. Name FROM x$kffxp a, v$asm_disk b, v$asm_alias cWHEREa.number_kffxp = c.file_numberANDa.GROUP_KFFXP = b.group_numberAND a.diskfukffxp = b.disk_numberANDb.group_number=1AND c.name LIKE'% USERS.274%'
The results are not shown one by one, with a total of 26 AU, 4m each, exactly 100m 4m 104m. In addition, it can also be seen that the data files here have been broken up.
Here, we use DD,DD to extract these blocks, and then merge them. The process is as follows:
1 remove the corresponding block
SQL > select'dd if=' | | b.path | | 'bs=4194304 count=1 skip=' | | au_kffxp | |' of=users_' | | XNUM_KFFXP | | '.dbf' FROM x$kffxp V$asm_alias cWHERE a.number_kffxp = c.file_numberAND a.GROUP_KFFXP = b.group_numberAND a.disk_kffxp = b.disk_numberAND b.group_number=1AND c.name LIKE'% USERS.274%'order by XNUM_KFFXPddif=/dev/raw/raw4 bs=4194304 count=1 skip=392 of=users_0.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=571 of=users_1.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=384 of=users_2.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=393 of=users_3.dbfddif=/dev/raw/raw2 Bs=4194304 count=1 skip=572 of=users_4.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=385 of=users_5.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=573 of=users_6.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=394 of=users_7.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=574 of=users_8.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=386 of=users_9.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=575 of=users_10.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=395 of=users_11.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=387 of=users_12.dbfddif= / dev/raw/raw2 bs=4194304 count=1 skip=704 of=users_13.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=396 of=users_14.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=705 of=users_15.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=388 of=users_16.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=706 of=users_17.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=397 of=users_18.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=389 of=users_19.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=707 of=users_20.dbfddif=/dev/raw/raw4 bs=4194304 count=1 Skip=398 of=users_21.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=708 of=users_22.dbfddif=/dev/raw/raw3 bs=4194304 count=1 skip=390 of=users_23.dbfddif=/dev/raw/raw2 bs=4194304 count=1 skip=709 of=users_24.dbfddif=/dev/raw/raw4 bs=4194304 count=1 skip=399 of=users_25.dbf
2 execute the above results and export
3 merging
SQL > SELECT'ddif=uses_' | | XNUM_KFFXP | | '.dbf bs=4194304 count=1seek=' | | XNUM_KFFXP | |' of=users.274.dbf' FROM x$kffxp a, v$asm_disk b V$asm_alias cWHERE a.number_kffxp = c.file_numberAND a.GROUP_KFFXP = b.group_numberAND a.disk_kffxp = b.disk_numberAND b.group_number=1AND c.name LIKE'%USERS.274%'orderby XNUM_KFFXPdd if=users_0.dbf bs=4194304 count=1 seek=0of=users.274.dbfdd if=users_1.dbf bs=4194304 count=1 seek=1of=users.274.dbfdd if=users_2.dbf bs=4194304 count=1 seek=2of=users.274.dbfdd if=users_3.dbf bs=4194304 count=1 seek=3of=users.274.dbfdd if=users_4.dbf bs=4194304 count=1 seek=4of=users.274.dbfdd if=users_5 .dbf bs=4194304 count=1seek= 5of=users.274.dbfdd if=users_6.dbf bs=4194304 count=1seek= 6of=users.274.dbfdd if=users_7.dbf bs=4194304 count=1seek= 7of=users.274.dbfdd if=users_8.dbf bs=4194304 count=1seek= 8of=users.274.dbfdd if=users_9.dbf bs=4194304 count=1seek= 9of=users.274.dbfdd if=users_10.dbf bs=4194304 count=1seek=10 of=users.274.dbfdd if=users_11.dbf bs=4194304 count=1seek=11 of=users.274.dbfdd if=users_12.dbf bs=4194304 count=1seek=12 of=users.274.dbfdd if=users_13.dbf bs=4194304 count=1seek=13 of=users.274.dbfdd if=users_14.dbf bs=4194304 count=1seek=14 of=users.274.dbfdd if=users_15 .dbf bs=4194304 count=1seek=15 of=users.274.dbfdd if=users_16.dbf bs=4194304 count=1seek=16 of=users.274.dbfdd if=users_17.dbf bs=4194304 count=1seek=17 of=users.274.dbfdd if=users_18.dbf bs=4194304 count=1seek=18 of=users.274.dbfdd if=users_19.dbf bs=4194304 count=1seek=19 of=users.274.dbfdd if=users_20.dbf bs=4194304 count=1seek=20 of=users.274.dbfdd if=users_21.dbf bs=4194304 count=1seek=21 of=users.274.dbfdd if=users_22.dbf bs=4194304 count=1seek=22 of=users.274.dbfdd if=users_23.dbf bs=4194304 count=1seek=23 of=users.274.dbfdd if=users_24.dbf bs=4194304 count=1seek=24 of=users.274.dbfdd if=users_25.dbf bs=4194304 count=1seek=25 of=users.274.dbf
4 comparison and verification
[grid@mysql-1amdu_2015_12_21_13_39_36] $dbv file=DATA_274.f DBVERIFY: Release 11.2.0.4.0-Production onMon Dec 21 13:41:09 2015Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.DBVERIFY- Verification starting: FILE = / home/grid/users/amdu_2015_12_21_13_39_36/DATA_274.fDBVERIFY- Verification completeTotalPages Examined: 12800TotalPages Processed (Data): 252TotalPages Failing (Data): 0TotalPages Processed (Index): 0TotalPages Failing (Index): 0TotalPages Processed (Other): 131TotalPages Processed (Seg): 0TotalPages Failing (Seg): 0TotalPages Empty: 12417TotalPages Marked Corrupt: 0TotalPages Influx: 0TotalPages Encrypted : 0Highestblock SCN: 4075933 (0.4075933) [grid@mysql-1amdu_2015_12_21_13_39_36] $dbv file=users.274.dbfDBVERIFY:Release 11.2.0.4.0-Production on Mon Dec 21 13:41:17 2015Copyright (c) 1982 2011, Oracle and/or its affiliates. All rights reserved.DBVERIFY- Verification starting: FILE = / home/grid/users/amdu_2015_12_21_13_39_36/users.274.dbfDBVERIFY- Verification completeTotalPages Examined: 12800TotalPages Processed (Data): 252TotalPages Failing (Data): 0TotalPages Processed (Index): 0TotalPages Failing (Index): 0TotalPages Processed (Other): 131TotalPages Processed (Seg): 0TotalPages Failing (Seg): 0TotalPages Empty: 12417TotalPages Marked Corrupt: 0TotalPages Influx: 0TotalPages Encrypted : 0Highestblock SCN: 4075933 (0.4075933)
Both of them can be verified by dbv.
Attached: brief description of x$kffxp:
GROUP_KFFXP: disk group number NUMBER_KFFXP: file number PXN_KFFXP: physical area code XNUM_KFFXP: logical area code LXN_KFFXP: 0=primary, 1=first mirror, 2=secondmirrorDISK_KFFXP: disk number AU_KFFXP:AU number
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.