热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

RMAN深入解析之--BlockRecover恢复坏块-mysql教程

RMAN深入解析之--BlockRecover恢复坏块案例环境:操作系统:RedHatEL5Oracle:Oracle11gR2案例描述:通过块介质恢复(BlockMediaRecover:BMR)执行块级别的恢复操作来修复Oracle数据库上的逻辑或物理上损坏的数据块。1、模拟数据块被破坏10:26:48

RMAN深入解析之--BlockRecover恢复坏块 案例环境: 操作系统:RedHat EL5 Oracle: Oracle 11gR2 案例描述: 通过块介质恢复(Block Media Recover:BMR)执行块级别的恢复操作来修复Oracle数据库上的逻辑或物理上损坏的数据块。 1、模拟数据块被破坏 10:26:48

RMAN深入解析之--BlockRecover恢复坏块

案例环境:

操作系统:RedHat EL5

Oracle: Oracle 11gR2


案例描述:

通过块介质恢复(Block Media Recover:BMR)执行块级别的恢复操作来修复Oracle数据库上的逻辑或物理上损坏的数据块。

1、模拟数据块被破坏

10:26:48 SYS@ prod>conn scott/tiger
Connected.
10:26:51 SCOTT@ prod>select * from tab;
TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
EMP1                           TABLE
SALGRADE                       TABLE
Elapsed: 00:00:00.10
10:26:55 SCOTT@ prod>
10:27:37 SYS@ prod>desc dba_segments
 Name                                                              Null?    Type  
 ----------------------------------------------------------------- -------- -------------
 OWNER                                                                      VARCHAR2(30)
 SEGMENT_NAME                                                               VARCHAR2(81)
 PARTITION_NAME                                                             VARCHAR2(30)
 SEGMENT_TYPE                                                               VARCHAR2(18)
 SEGMENT_SUBTYPE                                                            VARCHAR2(10)
 TABLESPACE_NAME                                                            VARCHAR2(30)
 HEADER_FILE                                                                NUMBER
 HEADER_BLOCK                                                               NUMBER
 BYTES                                                                      NUMBER
 BLOCKS                                                                     NUMBER
 EXTENTS                                                                    NUMBER
 INITIAL_EXTENT                                                             NUMBER
 NEXT_EXTENT                                                                NUMBER
 MIN_EXTENTS                                                                NUMBER
 MAX_EXTENTS                                                                NUMBER
 MAX_SIZE                                                                   NUMBER
 RETENTION                                                                  VARCHAR2(7)
 MINRETENTION                                                               NUMBER
 PCT_INCREASE                                                               NUMBER
 FREELISTS                                                                  NUMBER
 FREELIST_GROUPS                                                            NUMBER
 RELATIVE_FNO                                                               NUMBER
 BUFFER_POOL                                                                VARCHAR2(7)
 FLASH_CACHE                                                                VARCHAR2(7)
 CELL_FLASH_CACHE                                                           VARCHAR2(7)
10:27:41 SYS@ prod>col segment_name for a20       
10:27:59 SYS@ prod>select owner,segment_name,SEGMENT_TYPE,HEADER_BLOCK from dba_segments      
10:29:06   2   where owner='SCOTT' and segment_name='EMP1';
OWNER                          SEGMENT_NAME         SEGMENT_TYPE       HEADER_BLOCK
------------------------------ -------------------- ------------------ ------------
SCOTT                          EMP1                 TABLE                       170

通过以上查询,可以知道EMP1 table的segment header block为170;利用Uedit32,打开数据文件(users01.dbf)进行编辑破坏!


以下是计算block 170和block 171在Uedit32编辑中的offset:

10:29:24 SYS@ prod>select to_char(170*8*1024, 'xxxxxxxxxxxxxxxxxxxxx') from dual;

TO_CHAR(170*8*1024,'XX

----------------------

154000


10:30:27 SYS@ prod>select to_char(171*8*1024, 'xxxxxxxxxxxxxxxxxxxxx') from dual;

TO_CHAR(171*8*1024,'XX

----------------------

156000

以下是Uedit32编辑users01.dbf图片:

wKiom1PE2QPyNrhYAAlanMynL8w838.jpg

通过转储数据块验证:

10:30:37 SYS@ prod>alter system dump datafile 4 block 170;

System altered.


[oracle@rh6 ~]$ ls -lt /u01/app/oracle/diag/rdbms/prod/prod/trace/|more

total 14300

-rw-r----- 1 oracle oinstall    4492 Jul 15 11:34 prod_ora_2883.trc
-rw-r----- 1 oracle oinstall      69 Jul 15 11:34 prod_ora_2883.trm
-rw-r----- 1 oracle oinstall  557756 Jul 15 10:17 alert_prod.log
-rw-r----- 1 oracle oinstall     947 Jul 15 10:17 prod_ckpt_2541.trc
-rw-r----- 1 oracle oinstall      59 Jul 15 10:17 prod_ckpt_2541.trm
-rw-r----- 1 oracle oinstall    1783 Jul 15 10:12 prod_j000_2588.trc
-rw-r----- 1 oracle oinstall      80 Jul 15 10:12 prod_j000_2588.trm

查看转储文件:

[oracle@rh6 ~]$ cat /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_2883.trc|more

Trace file /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_2883.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1
System name:    Linux
Node name:      rh6
Release:        2.6.32-358.el6.x86_64
Version:        #1 SMP Tue Jan 29 11:47:41 EST 2013
Machine:        x86_64
Instance name: prod
Redo thread mounted by this instance: 1
Oracle process number: 26
Unix process pid: 2883, image: oracle@rh6 (TNS V1-V3)
*** 2014-07-15 11:34:50.092
*** SESSION ID:(37.32) 2014-07-15 11:34:50.092
*** CLIENT ID:() 2014-07-15 11:34:50.092
*** SERVICE NAME:(SYS$USERS) 2014-07-15 11:34:50.092
*** MODULE NAME:(sqlplus@rh6 (TNS V1-V3)) 2014-07-15 11:34:50.092
*** ACTION NAME:() 2014-07-15 11:34:50.092
 
Start dump data blocks tsn: 4 file#:4 minblk 170 maxblk 170
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4, rdba=16777386
Block dump from disk:
buffer tsn: 4 rdba: 0x010000aa (4/170)
scn: 0x0000.001f891c seq: 0x02 flg: 0x04 tail: 0x891c2302
frmt: 0x02 chkval: 0x8eee type: 0x23=PAGETABLE SEGMENT HEADER
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x00007F7DFC5C7A00 to 0x00007F7DFC5C9A00

7F7DFC5C7A00 0000A223 010000AA 001F891C 04020000 [#...............]

---此行内容与Uedit32打开内容一致

7F7DFC5C7A10 00008EEE 00000000 00000000 00000000  [................]
7F7DFC5C7A20 00000000 00000001 00000008 00000A9C  [................]
7F7DFC5C7A30 00000000 00000008 00000008 010000B0  [................]
7F7DFC5C7A40 00000000 00000000 00000000 00000008  [................]
7F7DFC5C7A50 00000000 00000000 00000000 00000000  [................]
7F7DFC5C7A60 00000008 00000008 010000B0 00000000  [................]
7F7DFC5C7A70 00000000 00000000 00000008 010000A8  [................]
7F7DFC5C7A80 010000A8 00000000 00000000 00000000  [................]
7F7DFC5C7A90 00000000 00000000 00000000 00000000  [................]
        Repeat 3 times
7F7DFC5C7AD0 00000001 00002000 00000000 00001434  [..... ......4...]
7F7DFC5C7AE0 00000000 010000A9 00000001 010000A8  [................]
7F7DFC5C7AF0 010000A9 00000000 00000000 00000000  [................]
7F7DFC5C7B00 00000000 00000000 00000001 00000000  [................]
7F7DFC5C7B10 0001257B 10000000 010000A8 00000008  [{%..............]
7F7DFC5C7B20 00000000 00000000 00000000 00000000  [................]
        Repeat 152 times
7F7DFC5C84B0 010000A8 010000AB 00000000 00000000  [................]
7F7DFC5C84C0 00000000 00000000 00000000 00000000  [................]
        Repeat 151 times
7F7DFC5C8E40 00000000 00000000 010000A9 00000000  [................]
7F7DFC5C8E50 00000000 00000000 00000000 00000000  [................]
        Repeat 185 times
7F7DFC5C99F0 00000000 00000000 00000000 891C2302  [.............#..]
  Extent Control Header
  -----------------------------------------------------------------
  Extent Header:: spare1: 0      spare2: 0      #extents: 1      #blocks: 8     
                  last map  0x00000000  #maps: 0      offset: 2716  
      Highwater::  0x010000b0  ext#: 0      blk#: 8      ext size: 8     
  #blocks in seg. hdr's freelists: 0     
  #blocks below: 8     
  mapblk  0x00000000  offset: 0     
                   Unlocked
  --------------------------------------------------------
  Low HighWater Mark : 
      Highwater::  0x010000b0  ext#: 0      blk#: 8      ext size: 8     
  #blocks in seg. hdr's freelists: 0     
  #blocks below: 8     
  mapblk  0x00000000  offset: 0     
  Level 1 BMB for High HWM block: 0x010000a8
  Level 1 BMB for Low HWM block: 0x010000a8
  --------------------------------------------------------
  Segment Type: 1 nl2: 1      blksz: 8192   fbsz: 0      
  L2 Array start offset:  0x00001434
  First Level 3 BMB:  0x00000000
  L2 Hint for inserts:  0x010000a9
  Last Level 1 BMB:  0x010000a8
  Last Level II BMB:  0x010000a9
  Last Level III BMB:  0x00000000
     Map Header:: next  0x00000000  #extents: 1    obj#: 75131  flag: 0x10000000
  Inc # 0 
  Extent Map
  -----------------------------------------------------------------
   0x010000a8  length: 8     
  
  Auxillary Map
  --------------------------------------------------------
   Extent 0     :  L1 dba:  0x010000a8 Data dba:  0x010000ab
  --------------------------------------------------------
  
   Second Level Bitmap block DBAs 
   --------------------------------------------------------
   DBA 1:   0x010000a9
  
End dump data blocks tsn: 4 file#: 4 minblk 170 maxblk 170

2、将Uedit32(通过16进制编辑功能)编辑过的数据文件上传到数据库

13:59:58 SYS@ prod>alter system flush buffer_cache;

System altered.

读取数据出错:

14:00:05 SYS@ prod>select * from scott.emp1;
select * from scott.emp1
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 170)
ORA-01110: data file 4: '/u01/app/oracle/oradata/prod/users01.dbf'

验证数据文件:

[oracle@rh6 ~]$ dbv file=/u01/app/oracle/oradata/prod/users01.dbf blocksize=8192

DBVERIFY: Release 11.2.0.1.0 - Production on Tue Jul 15 13:59:41 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/prod/users01.dbf
Page 170 is marked corrupt
Corrupt block relative dba: 0x010000aa (file 4, block 170)
Bad check value found during dbv: 
Data in bad block:
 type: 35 format: 2 rdba: 0x010000aa
 last change scn: 0x0000.001f891c seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x891c2302
 check value in block header: 0x8eee
 computed block checksum: 0x2020
Page 171 is marked corrupt
Corrupt block relative dba: 0x010000ab (file 4, block 171)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020ab
 last change scn: 0x2020.201f890b seq: 0x2 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x890b0602
 check value in block header: 0xcf8b
 computed block checksum: 0x2e00
Page 172 is marked corrupt
Corrupt block relative dba: 0x010000ac (file 4, block 172)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020ac
 last change scn: 0x2020.201f891c seq: 0x3 flg: 0x06
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x891c0603
 check value in block header: 0xa5b1
 computed block checksum: 0x0
Page 173 is marked corrupt
Corrupt block relative dba: 0x010000ad (file 4, block 173)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020ad
 last change scn: 0x2020.201f891c seq: 0x1 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x891c0601
 check value in block header: 0xf6ab
 computed block checksum: 0x2020
Page 174 is marked corrupt
Corrupt block relative dba: 0x010000ae (file 4, block 174)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020ae
 last change scn: 0x2020.201f891c seq: 0x1 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x891c0601
 check value in block header: 0xcef0
 computed block checksum: 0x20
Page 175 is marked corrupt
Corrupt block relative dba: 0x010000af (file 4, block 175)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020af
 last change scn: 0x2020.201f891c seq: 0x1 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x891c0601
 check value in block header: 0x146a
 computed block checksum: 0x0
Page 176 is marked corrupt
Corrupt block relative dba: 0x010000b0 (file 4, block 176)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x012020b0
 last change scn: 0x2020.201e6219 seq: 0x1 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x62190601
 check value in block header: 0x2185
 computed block checksum: 0x2020

DBVERIFY - Verification complete

Total Pages Examined : 12800

Total Pages Processed (Data) : 757

Total Pages Failing (Data) : 0

Total Pages Processed (Index): 2

Total Pages Failing (Index): 0

Total Pages Processed (Other): 12024

Total Pages Processed (Seg) : 0

Total Pages Failing (Seg) : 0

Total Pages Empty : 10

Total Pages Marked Corrupt : 7

Total Pages Influx : 0

Total Pages Encrypted : 0

Highest block SCN : 2066716 (0.2066716)

从以上验证结果看:总共有7个数据块(170-176)被破坏!


3、利用RMAN进行修复

[oracle@rh6 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jul 15 14:02:16 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD (DBID=239333010)

RMAN> list backup of database;

using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
17      Full    1.13G      DISK        00:01:21     03-JUL-14      
        BP Key: 17   Status: AVAILABLE  Compressed: NO  Tag: TAG20140703T171545
        Piece Name: /u01/app/oracle/product/11.2.0/db_1/dbs/0lpcfu61_1_1
  List of Datafiles in backup set 17
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/system01.dbf
  2       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  3       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/undotbs1.dbf
  4       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/users01.dbf
  5       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/example01.dbf
  6       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/tbs1.dbf
  7       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/undotbs2.dbf
  8       Full 2066885    03-JUL-14 /u01/app/oracle/oradata/prod/perftbs01.dbf


RMAN> blockrecover datafile 4 block 170,171,172,173,174,175,176;

Starting recover at 15-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: restoring block(s)
channel ORA_DISK_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00004
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/db_1/dbs/0lpcfu61_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/0lpcfu61_1_1 tag=TAG20140703T171545
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01
starting media recovery
media recovery complete, elapsed time: 00:00:07
Finished recover at 15-JUL-14

恢复完成,验证:

RMAN> backup validate database;

Starting backup at 15-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/prod/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/prod/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/prod/perftbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/prod/users01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/prod/example01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/prod/undotbs2.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/prod/tbs1.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/prod/undotbs1.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1    OK     0              13407        99852           2117516   
  File Name: /u01/app/oracle/oradata/prod/system01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              67302           
  Index      0              15344           
  Other      0              3787            
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    OK     0              17342        66627           2117514   
  File Name: /u01/app/oracle/oradata/prod/sysaux01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              11719           
  Index      0              7882            
  Other      0              29617           
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3    OK     0              1            128             2056342   
  File Name: /u01/app/oracle/oradata/prod/undotbs1.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0               
  Index      0              0               
  Other      0              127             
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4    OK     0              11873        12800           2066716   
  File Name: /u01/app/oracle/oradata/prod/users01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              763             
  Index      0              2               
  Other      0              162             
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
5    OK     0              1680         12804           1715036   
  File Name: /u01/app/oracle/oradata/prod/example01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              3987            
  Index      0              1132            
  Other      0              6001            
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6    OK     0              2            1281            2051631   
  File Name: /u01/app/oracle/oradata/prod/tbs1.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              1               
  Index      0              0               
  Other      0              1277            
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
7    OK     0              8833         12800           2117516   
  File Name: /u01/app/oracle/oradata/prod/undotbs2.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0               
  Index      0              0               
  Other      0              3967            
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
8    OK     0              23967        25600           2006072   
  File Name: /u01/app/oracle/oradata/prod/perftbs01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              867             
  Index      0              261             
  Other      0              505             
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE       OK     0              2               
Control File OK     0              594             
Finished backup at 15-JUL-14
[oracle@rh6 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 15 14:16:27 2014
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
14:16:27 SYS@ prod>select count(*) from scott.emp1;
  COUNT(*)
----------
        28
Elapsed: 00:00:00.02
14:16:35 SYS@ prod>select * from scott.emp1;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
28 rows selected.
Elapsed: 00:00:00.07

读取数据成功!


[oracle@rh6 ~]$ dbv file=/u01/app/oracle/oradata/prod/users01.dbf blocksize=8192

DBVERIFY: Release 11.2.0.1.0 - Production on Tue Jul 15 14:17:22 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/prod/users01.dbf
DBVERIFY - Verification complete
Total Pages Examined         : 12800
Total Pages Processed (Data) : 763
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 2
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 12025
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 10
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 2066716 (0.2066716)
[oracle@rh6 ~]$

4、查看告警日志信息


告警日志:

dbv校验生成的日志

Reading datafile '/u01/app/oracle/oradata/prod/users01.dbf' for corruption at rdba: 0x010000aa (file 4, block 170)
Reread (file 4, block 170) found same corrupt data
Corrupt Block Found
         TSN = 4, TSNAME = USERS
         RFN = 4, BLK = 170, RDBA = 16777386
         OBJN = -1, OBJD = 75131, OBJECT = USERS, SUBOBJECT = 
         SEGMENT OWNER = , SEGMENT TYPE = Temporary Segment
Tue Jul 15 14:00:25 2014
Trace dumping is performing id=[cdmp_20140715140025]
Tue Jul 15 14:00:25 2014
Errors in file /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_m000_8954.trc  (incident=121488):
ORA-01578: ORACLE data block corrupted (file # 4, block # 170)
ORA-01110: data file 4: '/u01/app/oracle/oradata/prod/users01.dbf'
Hex dump of (file 4, block 176) in trace file /u01/app/oracle/diag/rdbms/prod/prod/incident/incdir_121443/prod_m000_8954_i121443_a.trc
Corrupt block relative dba: 0x010000b0 (file 4, block 176)
Bad header found during validation
Data in bad block:
 type: 6 format: 2 rdba: 0x012020b0
 last change scn: 0x2020.201e6219 seq: 0x1 flg: 0x04
 spare1: 0x20 spare2: 0x20 spare3: 0x2020
 consistency value in tail: 0x62190601
 check value in block header: 0x2185
 computed block checksum: 0x2020
Reread of blocknum=176, file=/u01/app/        
推荐阅读
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 推荐一个ASP的内容管理框架(ASP Nuke)的优势和适用场景
    本文推荐了一个ASP的内容管理框架ASP Nuke,并介绍了其主要功能和特点。ASP Nuke支持文章新闻管理、投票、论坛等主要内容,并可以自定义模块。最新版本为0.8,虽然目前仍处于Alpha状态,但作者表示会继续更新完善。文章还分析了使用ASP的原因,包括ASP相对较小、易于部署和较简单等优势,适用于建立门户、网站的组织和小公司等场景。 ... [详细]
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • 本文介绍了如何在MySQL中将零值替换为先前的非零值的方法,包括使用内联查询和更新查询。同时还提供了选择正确值的方法。 ... [详细]
  • 本文介绍了如何使用Power Design(PD)和SQL Server进行数据库反向工程的方法。通过创建数据源、选择要反向工程的数据表,PD可以生成物理模型,进而生成所需的概念模型。该方法适用于SQL Server数据库,对于其他数据库是否适用尚不确定。详细步骤和操作说明可参考本文内容。 ... [详细]
  • 在数据分析工作中,我们通常会遇到这样的问题,一个业务部门由若干业务组构成,需要筛选出每个业务组里业绩前N名的业务员。这其实是一个分组排序的 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • Oracle Database 10g许可授予信息及高级功能详解
    本文介绍了Oracle Database 10g许可授予信息及其中的高级功能,包括数据库优化数据包、SQL访问指导、SQL优化指导、SQL优化集和重组对象。同时提供了详细说明,指导用户在Oracle Database 10g中如何使用这些功能。 ... [详细]
  • 本文介绍了adg架构设置在企业数据治理中的应用。随着信息技术的发展,企业IT系统的快速发展使得数据成为企业业务增长的新动力,但同时也带来了数据冗余、数据难发现、效率低下、资源消耗等问题。本文讨论了企业面临的几类尖锐问题,并提出了解决方案,包括确保库表结构与系统测试版本一致、避免数据冗余、快速定位问题等。此外,本文还探讨了adg架构在大版本升级、上云服务和微服务治理方面的应用。通过本文的介绍,读者可以了解到adg架构设置的重要性及其在企业数据治理中的应用。 ... [详细]
  • 在说Hibernate映射前,我们先来了解下对象关系映射ORM。ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现。这样开发人员就可以把对数据库的操作转化为对 ... [详细]
  • 本文介绍了使用postman进行接口测试的方法,以测试用户管理模块为例。首先需要下载并安装postman,然后创建基本的请求并填写用户名密码进行登录测试。接下来可以进行用户查询和新增的测试。在新增时,可以进行异常测试,包括用户名超长和输入特殊字符的情况。通过测试发现后台没有对参数长度和特殊字符进行检查和过滤。 ... [详细]
  • 本文详细介绍了MysqlDump和mysqldump进行全库备份的相关知识,包括备份命令的使用方法、my.cnf配置文件的设置、binlog日志的位置指定、增量恢复的方式以及适用于innodb引擎和myisam引擎的备份方法。对于需要进行数据库备份的用户来说,本文提供了一些有价值的参考内容。 ... [详细]
  • 使用Ubuntu中的Python获取浏览器历史记录原文: ... [详细]
  • 本文由编程笔记小编整理,介绍了PHP中的MySQL函数库及其常用函数,包括mysql_connect、mysql_error、mysql_select_db、mysql_query、mysql_affected_row、mysql_close等。希望对读者有一定的参考价值。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
author-avatar
skylong
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有