前一篇寫了asm里dd出文件,這篇里只dd出塊,主要是針對文件大的情況。
創(chuàng)新互聯(lián)長期為上千多家客戶提供的網(wǎng)站建設(shè)服務(wù),團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為橋西企業(yè)提供專業(yè)的成都網(wǎng)站建設(shè)、網(wǎng)站制作,橋西網(wǎng)站改版等技術(shù)服務(wù)。擁有10年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。以scott模式為例:
修改前的表信息
SQL>select * from emp where mgr=7566 and empno=7788 7788 SCOTT ANALYST 7566 1987/4/19 3000.00 201 AU計算:
SQL> selectextent_Id,block_id,blocks,file_id 2 fromdba_extents where segment_name='EMP' SQL> / EXTENT_ID BLOCK_ID BLOCKS FILE_ID -------------------- ---------- ---------- 0 144 8 5SQL> selectname from v$datafile where file#=5; NAME -------------------------------------------------------------- +DATA/db/datafile/users.276.899048797 SQL> selectname,group_number,file_number from v$asm_alias where name like '%USERS%' andfile_number=276; NAME GROUP_NUMBER FILE_NUMBER ---------------------------------------------------------------------------------- ----------- USERS.276.899048797 1 276 SQL> selectdisk_kffxp,au_kffxp,xnum_kffxp from x$kffxp where group_kffxp=1 andnumber_kffxp=276; DISK_KFFXP AU_KFFXP XNUM_KFFXP ---------- ---------- ---------- 1 426 0 0 289 1這里計算一下,其block_id為144,塊大小為8KB,那么其位置為144*8/1024=1.125M,加上塊頭8*8/1024=0.0625M,一共不超過4M;應(yīng)當(dāng)在第一個AU上(AU大小為4M),第二塊盤的第426個AU上,取第二個盤路徑:
SQL> selectdisk_number,path from v$asm_disk where disk_number=1; DISK_NUMBERPATH ------------------------------------------------------------------------------------------- 1 /dev/raw/raw2取出該表的大和最小data_object_id,然后dd.
SQL> select dbms_rowid.rowid_relative_fno(rowid)rel_fno, max(dbms_rowid.rowid_block_number(rowid))max_block, min(dbms_rowid.rowid_block_number(rowid))min_block from emp group by dbms_rowid.rowid_relative_fno(rowid); REL_FNO MAX_BLOCK MIN_BLOCK -------------------- ---------- 5 149 149 [oracle@mysql-1]$ddif=/dev/raw/raw2 bs=1024 count=8 skip=1746088 of=emp.dd說明一下:skip=426*4*1024+149*8
檢查一下:
[oracle@mysql-1~]$ strings emp.dd MILLER CLERK FORD ANALYST JAMES CLERK ADAMS CLERK TURNER SALESMAN KING PRESIDENT SCOTT ANALYST SMITH CLERK從上可以看出,是emp的內(nèi)容。
2 bbed修改內(nèi)容
11g里首先要安裝bbed,安裝過程記錄一下:
copy oracle 10g的sbbdpt.o,ssbbded.o到$ORACLE_HOME/rdbms/lib下 copybbedus.msb 到$ORACLE_HOME/mesg下 cd$ORACLE_HOME/rdbms/lib make -fins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed cp bbed$ORACLE_HOME/bin[oracle@mysql-1~]$ bbed BBED> set filename'/home/oracle/emp.dd'; FILENAME /home/oracle/emp.dd#用bbed校驗下塊。 BBED> verify DBVERIFY - Verification starting FILE = /home/oracle/emp.dd BLOCK = 0 Block 0 is corrupt Corrupt block relative dba: 0x01400000(file 0, block 0) Bad header found during verification Data in bad block: type: 6 format: 2 rdba: 0x01400095 lastchange scn: 0x0000.0004dec0 seq: 0x1 flg: 0x06 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x00000000 check value in block header: 0x89af computed block checksum: 0xd6b DBVERIFY - Verification complete Total Blocks Examined : 1 Total Blocks Processed (Data) : 0 Total Blocks Failing (Data) : 0 Total Blocks Processed (Index): 0 Total Blocks Failing (Index): 0 Total Blocks Empty : 0 Total Blocks Marked Corrupt : 1 Total Blocks Influx : 0 Message 531 not found; product=RDBMS; facility=BBED用bbed查看dd出文件內(nèi)容
BBED> set blocksize 8192 BLOCKSIZE 8192 BBED> p kdbr BBED> find /c SCOTT File: /home/oracle/emp.dd (0) Block: 1 Offsets: 7864 to 8191 Dba:0x00000000 ------------------------------------------------------------------------ 53434f54 5407414e 414c5953 5403c24c 430777bb04130101 0102c21f ff02c115 BBED> dump /v File: /home/oracle/emp.dd (0) Block: 1 Offsets: 7864 to 8191 Dba:0x00000000 ------------------------------------------------------- 53434f54 5407414e 414c5953 5403c24c lSCOTT.ANALYST..L 430777bb 04130101 0102c21f ff02c115 lC.w............. 2c010803 c24e5305 434c4152 4b074d41 l,....NS.CLARK.MA 4e414745 5203c24f 280777b5 06090101 lNAGER..O(.w..... 0103c219 33ff02c1 0b2c0108 03c24d63 l....3....,....Mc用bbed修改:
set mode edit set blocksize 8192 find /c SCOTT m /c SNOWH BBED> dump /v File: /home/oracle/emp.dd (0) Block: 1 Offsets: 7864 to 8191 Dba:0x00000000 ------------------------------------------------------- 534e4f57 4807414e 414c5953 5403c24c lSNOWH.ANALYST..L BBED> sum Check value for File 0, Block 1: current = 0x89af, required = 0x87b3 BBED> sum apply Check value for File 0, Block 1: current = 0x87b3, required = 0x87b3關(guān)庫,導(dǎo)入修改后數(shù)據(jù):
[oracle@mysql-1~]$ srvctl stop database -d db [oracle@mysql-1~]$dd of=/dev/raw/raw2 bs=1024 count=8 seek=1746088 if=emp.dd 8+0 records in 8+0 records out 8192 bytes (8.2 kB) copied, 0.00208818 s,3.9 MB/s查詢表信息:
[oracle@mysql-1~]$ srvctl start database -d dbSQL> select* from emp where mgr=7566 and empno=7788 2 ; EMPNOENAME JOB MGR HIREDATE SAL COMM DEPTNO --------------- --------- ----- ----------- --------- --------- ------ 7788 SNOWH ANALYST 7566 1987/4/19 3000.00 20OVER
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
當(dāng)前名稱:oracleasmdd所出要的塊-創(chuàng)新互聯(lián)
文章源于:http://www.rwnh.cn/article46/ceceeg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、軟件開發(fā)、響應(yīng)式網(wǎng)站、搜索引擎優(yōu)化、企業(yè)建站、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容