[20180306]資料塊檢查和.txt
[20180306]資料塊檢查和.txt
--//如果資料塊檢查和不對,資料庫無法讀取相應塊,會報錯.
--//檢查和位於塊偏移16位元組處.
ub1 flg_kcbh @15
ub2 chkval_kcbh @16
--//實際上如果設定flg_kcbh,chkval_kcbh=0,一般資料塊是可以跳過的.測試看看.
--//注意:要關閉dg,不然會自動修復.
1.環境:
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> create table deptx tablespace tea as select * from dept;
Table created.
SCOTT@book> select rowid,deptx.* from deptx;
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAWGWAAGAAAACBAAA 10 ACCOUNTING NEW YORK
AAAWGWAAGAAAACBAAB 20 RESEARCH DALLAS
AAAWGWAAGAAAACBAAC 30 SALES CHICAGO
AAAWGWAAGAAAACBAAD 40 OPERATIONS BOSTON
SCOTT@book> @ &r/rowid AAAWGWAAGAAAACBAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
90518 6 129 0 0x1800081 6,129 alter system dump datafile 6 block 129 ;
SCOTT@book> alter system checkpoint ;
System altered.
SCOTT@book> alter system flush buffer_cache;
System altered.
2.使用bbed修改塊6,129.
SCOTT@book> @ &r/bbvi 6 129
BVI_COMMAND
----------------------------------------------------------------------------------------------------
bvi -b 1056768 -s 8192 /mnt/ramdisk/book/tea01.dbf
--//使用bvi修改ACCOUNTING為A12OUNTING.
BBED> set dba 6,129
DBA 0x01800081 (25165953 6,129)
BBED> x /rncc *kdbr[0]
rowdata[66] @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x00
cols@8164: 3
col 0[2] @8165: 10
col 1[10] @8168: A12OUNTING
col 2[8] @8179: NEW YORK
BBED> sum
Check value for File 6, Block 129:
current = 0x49c5, required = 0x38b7
--//可以發現現在已經不一致.
SCOTT@book> select rowid,deptx.* from deptx;
select rowid,deptx.* from deptx
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 6, block # 129)
ORA-01110: data file 6: '/mnt/ramdisk/book/tea01.dbf'
--//報ORA-01578錯誤.
3.清除flg_kcbh,chkval_kcbh看看.
SCOTT@book> alter system flush buffer_cache;
System altered.
BBED> assign kcbh.chkval_kcbh=0x0
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub2 chkval_kcbh @16 0x0000
BBED> assign kcbh.flg_kcbh=0x0
ub1 flg_kcbh @15 0x00 (NONE)
BBED> sum
Check value for File 6, Block 129:
current = 0x0000, required = 0x0000
--//這樣就ok了.
SCOTT@book> select rowid,deptx.* from deptx;
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAWGWAAGAAAACBAAA 10 A12OUNTING NEW YORK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AAAWGWAAGAAAACBAAB 20 RESEARCH DALLAS
AAAWGWAAGAAAACBAAC 30 SALES CHICAGO
AAAWGWAAGAAAACBAAD 40 OPERATIONS BOSTON
--//注意看下劃線,以後沒有bbed,對於一般的資料塊可以直接設定塊偏移量15,16,17位元組為0x0,就ok了.
--//但是對系統表空間是無效的(沒測試).預設資料庫的引數_db_always_check_system_ts=true.
SYS@book> @ &r/hide _db_always_check_system_ts
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE
-------------------------- ------------------------------------------------------------- ------------- ------------- ------------
_db_always_check_system_ts Always perform block check and checksum for System tablespace TRUE TRUE TRUE
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2151524/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20180306]資料塊檢查和2.txt
- [20180306]關於DEFERRED ROLLBACK.txt
- [20180306]關於DEFERRED ROLLBACK2.txt
- [20210128]拼接資料塊.txt
- [20210318]bbed讀取資料塊.txt
- [20210831]bbed讀取資料塊6.txt
- [20210323]bbed讀取資料塊5.txt
- [20210318]bbed讀取資料塊2.txt
- [20210319]bbed讀取資料塊3.txt
- OceanBase 原始碼解讀(十二):宏塊的垃圾回收和壞塊檢查原始碼
- MySQL資料庫健康檢查--MySQL巡檢MySql資料庫
- Oracle 檢查當前資料庫CPU和PSU補丁資訊Oracle資料庫
- [20210418]查詢v$檢視問題.txt
- MSSQL資料庫健康檢查--SQL Server巡檢SQL資料庫Server
- [20210930]bbed讀取資料塊7 fffext.sh.txt
- [20210906]bbed讀取資料塊(bbed-wrap.sh).txt
- [20200402]增量檢查點時間間隔.txt
- OceanBase儲存層程式碼解讀(四):宏塊的垃圾回收和壞塊檢查
- 檢視 Laravel 查詢資料語句Laravel
- 區塊鏈和資料庫區塊鏈資料庫
- [20220223]bbed讀取資料塊mssm與assm 2.txtSSM
- [20181203]改變檔案大小與檢查點.txt
- Oracle完全檢查點和增量檢查點詳解Oracle
- 【PDB】Oracle資料庫如何檢查和設定pdb最大儲存大小Oracle資料庫
- [20210401]使用bbed讀取資料塊恢復注意6.txt
- android 檢視資料庫和shaedpreference資料框架Android資料庫框架
- Oracle OCP(14):使用子查詢檢索資料Oracle
- 快速檢查資料庫一致性資料庫
- 如何使用命令列工具檢查資料庫?命令列資料庫
- [20230214]資料庫連線訪問asm相關檢視.txt資料庫ASM
- [20190124]bbed恢復資料遇到延遲塊清除的問題.txt
- Win10系統怎麼檢查和刪除PowerPoint文件個人資訊資料Win10
- [20190312]關於增量檢查點的疑問(補充).txt
- 健康檢查,檢查啥,怎麼檢查?
- 檢查和收集 Linux 硬體資訊的 7 個命令Linux
- 系統表和資料字典檢視
- 如何檢視和分析Excel表格資料Excel
- 區塊鏈和大資料的關係區塊鏈大資料