【dbv】使用dbv工具檢驗資料檔案是否有壞塊
dbv工具可以用來驗證資料檔案的有效性,在資料庫恢復之前可以使用該命令對備份檔案進行有效性檢查,防止因備份檔案本身的問題導致資料庫無法恢復。
當然,dbv命令也可以對線上的資料檔案進行檢查。
注意,dbv工具只可以對資料檔案進行檢查,無法使用它完成控制檔案和日誌檔案的檢查。
1.dbv命令語法
dbverify ::=
dbv [ USERID=username/password ]
FILE = filename
| { START = block_address | END = block_address }
| BLOCKSIZE = integer
| HIGH_SCN = integer
| LOGFILE = filename
| FEEDBACK = integer
| HELP = { Y | N }
| PARFILE = filename
End of description.
參考自Oracle官方文件
2.檢視幫助文件
從語法定義中我們看到“HELP = { Y | N }”選項,我們可以使用它檢視dbv的幫助資訊。
secooler@secDB /home/oracle$ dbv help=y
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:47:36 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn)
幫助資訊中描述了dbv命令的使用方法,不贅述。
3.體驗dbv工具的效果
1)檢視系統中的資料檔名稱
sys@secooler> col name for a60
sys@secooler> select name from v$datafile;
NAME
------------------------------------------------------------
/oracle/ora11gR2/oradata/secooler/system01.dbf
/oracle/ora11gR2/oradata/secooler/sysaux01.dbf
/oracle/ora11gR2/oradata/secooler/undotbs01.dbf
/oracle/ora11gR2/oradata/secooler/users01.dbf
2)使用dbv工具對users01.dbf進行檢查
(1)使用最簡單的引數
sys@secooler> !dbv file=/oracle/ora11gR2/oradata/secooler/users01.dbf
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:50:59 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - Verification starting : FILE = /oracle/ora11gR2/oradata/secooler/users01.dbf
DBVERIFY - Verification complete
Total Pages Examined : 35520
Total Pages Processed (Data) : 33029
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 20
Total Pages Failing (Index): 0
Total Pages Processed (Other): 402
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 2069
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 9291961 (0.9291961)
在實際使用中重點關注以下資訊:
Total Pages Failing (Data) : 0
Total Pages Failing (Index): 0
Total Pages Failing (Seg) : 0
Total Pages Marked Corrupt : 0
如果以上資訊返回結果不為0,需要重點關注!及時排查原因。
(2)如果指定logfile引數,檢查結果將只記錄在日誌檔案中,螢幕上不顯示
sys@secooler> !dbv file=/oracle/ora11gR2/oradata/secooler/users01.dbf logfile=dbv_users01.log
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:52:20 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
此時可以使用SQL*Plus的edit命令檢視生成的日誌檔案內容。
sys@secooler> ed dbv_users01.log
4.小結
dbv是備份有效性驗證的好幫手,善用之。
Good luck.
secooler
10.03.31
-- The End --
當然,dbv命令也可以對線上的資料檔案進行檢查。
注意,dbv工具只可以對資料檔案進行檢查,無法使用它完成控制檔案和日誌檔案的檢查。
1.dbv命令語法
dbverify ::=
dbv [ USERID=username/password ]
FILE = filename
| { START = block_address | END = block_address }
| BLOCKSIZE = integer
| HIGH_SCN = integer
| LOGFILE = filename
| FEEDBACK = integer
| HELP = { Y | N }
| PARFILE = filename
End of description.
參考自Oracle官方文件
2.檢視幫助文件
從語法定義中我們看到“HELP = { Y | N }”選項,我們可以使用它檢視dbv的幫助資訊。
secooler@secDB /home/oracle$ dbv help=y
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:47:36 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn)
幫助資訊中描述了dbv命令的使用方法,不贅述。
3.體驗dbv工具的效果
1)檢視系統中的資料檔名稱
sys@secooler> col name for a60
sys@secooler> select name from v$datafile;
NAME
------------------------------------------------------------
/oracle/ora11gR2/oradata/secooler/system01.dbf
/oracle/ora11gR2/oradata/secooler/sysaux01.dbf
/oracle/ora11gR2/oradata/secooler/undotbs01.dbf
/oracle/ora11gR2/oradata/secooler/users01.dbf
2)使用dbv工具對users01.dbf進行檢查
(1)使用最簡單的引數
sys@secooler> !dbv file=/oracle/ora11gR2/oradata/secooler/users01.dbf
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:50:59 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - Verification starting : FILE = /oracle/ora11gR2/oradata/secooler/users01.dbf
DBVERIFY - Verification complete
Total Pages Examined : 35520
Total Pages Processed (Data) : 33029
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 20
Total Pages Failing (Index): 0
Total Pages Processed (Other): 402
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 2069
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 9291961 (0.9291961)
在實際使用中重點關注以下資訊:
Total Pages Failing (Data) : 0
Total Pages Failing (Index): 0
Total Pages Failing (Seg) : 0
Total Pages Marked Corrupt : 0
如果以上資訊返回結果不為0,需要重點關注!及時排查原因。
(2)如果指定logfile引數,檢查結果將只記錄在日誌檔案中,螢幕上不顯示
sys@secooler> !dbv file=/oracle/ora11gR2/oradata/secooler/users01.dbf logfile=dbv_users01.log
DBVERIFY: Release 11.2.0.1.0 - Production on Wed Mar 31 19:52:20 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
此時可以使用SQL*Plus的edit命令檢視生成的日誌檔案內容。
sys@secooler> ed dbv_users01.log
4.小結
dbv是備份有效性驗證的好幫手,善用之。
Good luck.
secooler
10.03.31
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29674916/viewspace-2119694/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用dbv和RMAN檢查資料檔案中的壞塊
- 怎樣檢查資料庫壞塊(DBV)資料庫
- Oracle資料壞塊簡介及其恢復(dbv、BMR)Oracle
- DBV工具說明
- Oracle DBV 工具 介紹Oracle
- DBV,Analyze,Rman檢查資料檔案物理和邏輯一致性
- oracle檢查資料庫是否有壞塊的命令Oracle資料庫
- 【exp】快速檢測資料檔案壞塊
- 使用validate驗證資料檢查資料壞塊
- 使用blockrecover 對有壞塊的資料檔案進行恢復BloC
- DBV驗證ASM裡的datafile,出現錯誤ASM
- 使用DBV的命令規則和規則集強化資料庫安全資料庫
- Oracle 11g 通過 RMAN 檢查資料檔案、控制檔案、引數檔案的狀態和是否存在壞塊Oracle
- Database Vault(DBV)和領域管理Database
- oracle實驗記錄 (恢復,備份-含壞塊資料檔案)Oracle
- oracle 普通表空間資料檔案壞塊Oracle
- 小工具檢視MYSQL資料檔案塊和型別MySql型別
- 利用RMAN修復資料檔案中的壞塊
- 資料檔案壞塊的製造和恢復
- 檢查資料塊損壞(Block Corruption)BloC
- oracle資料檔案驗證工具Oracle
- 看國外開發者如何檢驗並恢復損壞的git資料檔案Git
- 磁碟損壞造成RMAN備份檔案有壞塊的恢復案例
- openfiledialog 使用 讀取txt檔案 StreamReader 檢驗資料
- Oracle資料庫壞塊(corruption)-物理壞塊Oracle資料庫
- 資料檔案是否是smallfile型別檔案,其儲存是否達到資料檔案儲存上限,是否是多個資料檔案型別
- 資料庫檔案壞塊損壞導致開啟時報錯的恢復方法資料庫
- Oracle 11.2.0.4.4 ADG 備庫資料檔案壞塊處理Oracle
- 關於表的資料塊驗證 DUMP 工具 使用
- 陣列櫃故障造成控制檔案損壞,資料檔案損壞陣列
- 資料檔案損壞、丟失
- 用 Python 批量檢查 sqlite/db3 檔案是否損壞(qbit)PythonSQLite
- 檢視Windows檔案系統資料塊大小的方法Windows
- 檢查 oracle 壞塊Oracle
- oracle 資料庫中壞塊概念和檢查指令碼Oracle資料庫指令碼
- RMAN學習-資料檔案損壞
- 資料檔案的SCN和資料塊的SCN有何區別
- Python3如何檢查檔案或資料夾是否存在?Python