[20160722]对象C_OBJ#_INTCOL#有坏块.txt

[20160722]对象C_OBJ#_INTCOL#有坏块.txt

--前几天看到的帖子,一直没时间测试,链接如下:
http://www.itpub.net/thread-2063836-1-1.html

--我以前按照eygle的链接http://www.eygle.com/archives/2012/05/event_38003_c_obj_intcol.html做过测试,测试在11.2.0.2下做的。
--通过设置alter system set event='38003 trace name context forever, level 10' scope=spfile;
--来Truncate该对象。当时做完了,直方图没建立,导致登录后运行sql很慢,或者报错。
--设置optimizer_mode=rule,重新分析系统表以及应用表以后才正常。

--今天在11.2.0.4下再测试看看:

1.环境与介绍C_OBJ#_INTCOL#:

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

CREATE CLUSTER SYS.C_OBJ#_INTCOL#
(
  OBJ#                            NUMBER,
  INTCOL#                         NUMBER
)
TABLESPACE SYSTEM
PCTUSED    40
PCTFREE    5
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          2M
            NEXT             200K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            FREELISTS        1
            FREELIST GROUPS  1
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
INDEX
NOROWDEPENDENCIES
NOPARALLEL;

--
-- I_OBJ#_INTCOL#  (Index)
--
CREATE INDEX SYS.I_OBJ#_INTCOL# ON CLUSTER SYS.C_OBJ#_INTCOL#
TABLESPACE SYSTEM
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            NEXT             1M
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            FREELISTS        1
            FREELIST GROUPS  1
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

--
-- HISTGRM$  (Table)
--
CREATE TABLE SYS.HISTGRM$
(
  OBJ#      NUMBER,
  COL#      NUMBER,
  ROW#      NUMBER,
  BUCKET    NUMBER,
  ENDPOINT  NUMBER,
  INTCOL#   NUMBER,
  EPVALUE   VARCHAR2(1000 BYTE),
  SPARE1    NUMBER,
  SPARE2    NUMBER
)
CLUSTER SYS.C_OBJ#_INTCOL#(OBJ#, INTCOL#);

--
-- I_H_OBJ#_COL#  (Index)
--
--  Dependencies:
--   HISTGRM$ (Table)
--
CREATE INDEX SYS.I_H_OBJ#_COL# ON SYS.HISTGRM$
(OBJ#, COL#)
TABLESPACE SYSTEM
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            NEXT             1M
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            FREELISTS        1
            FREELIST GROUPS  1
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

--从对象看SYS.C_OBJ#_INTCOL#是一个cluster,里面仅仅一个表SYS.HISTGRM$。SYS.HISTGRM$里面实际上就是字段直方图的信息。

2.建立测试表:
create table emp3 as select * from emp;
alter table emp3 move tablespace users;
execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false);

SCOTT@book> select * from dba_objects where object_name='EMP3';
OWNER  OBJECT_NAME SUBOBJECT_  OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED             LAST_DDL_TIME       TIMESTAMP           STATUS  T G S  NAMESPACE EDITION_NAME
------ ----------- ---------- ---------- -------------- ----------- ------------------- ------------------- ------------------- ------- - - - ---------- ------------
SCOTT  EMP3                        95323          95371 TABLE       2016-07-20 10:00:44 2016-07-22 09:26:31 2016-07-20:10:01:00 VALID   N N N          1

SYS@book> select * from SYS.HISTGRM$ where  obj# in ( 95323, 95371) and col#=1;
      OBJ#       COL#       ROW#     BUCKET   ENDPOINT    INTCOL# EPVALUE SPARE1 SPARE2
---------- ---------- ---------- ---------- ---------- ---------- ------- ------ -------
     95323          1          0          1       7369          1
     95323          1          0          2       7499          1
     95323          1          0          3       7521          1
     95323          1          0          4       7566          1
     95323          1          0          5       7654          1
     95323          1          0          6       7698          1
     95323          1          0          7       7782          1
     95323          1          0          8       7788          1
     95323          1          0          9       7839          1
     95323          1          0         10       7844          1
     95323          1          0         11       7876          1
     95323          1          0         12       7900          1
     95323          1          0         13       7902          1
     95323          1          0         14       7934          1
14 rows selected.

--说明OBJ#=dba_objects.object_id.

3.破坏块看看:
SYS@book> select rowid,a.* from SYS.HISTGRM$ a where  obj#=95323 and col#=1 and rownum<=3;
ROWID                    OBJ#       COL#       ROW#     BUCKET   ENDPOINT    INTCOL# EPVALUE SPARE1 SPARE2
------------------ ---------- ---------- ---------- ---------- ---------- ---------- ------- ------ ------
AAAAG8AABAAASuVAAO      95323          1          0          1       7369          1
AAAAG8AABAAASuVAAP      95323          1          0          2       7499          1
AAAAG8AABAAASuVAAQ      95323          1          0          3       7521          1

SYS@book> @ &r/rowid AAAAG8AABAAASuVAAO
    OBJECT       FILE      BLOCK        ROW DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- ----------------------------------------
       444          1      76693         14 1,76693              alter system dump datafile 1 block 76693

--//通过bbed破坏。
BBED> set dba  1,76693
        DBA             0x00412b95 (4270997 1,76693)

BBED> corrupt
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
Block marked media corrupt.

SYS@book> alter system flush buffer_cache;
System altered.

SYS@book> select rowid,a.* from SYS.HISTGRM$ a where  obj#=95323 and col#=1 and rownum<=3;
select rowid,a.* from SYS.HISTGRM$ a where  obj#=95323 and col#=1 and rownum<=3
                          *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'

--我的测试可能直方图信息已经加载到共享池,无法清除,重启数据看看:

SCOTT@book> select * from emp3 where empno=7369;
select * from emp3 where empno=7369
              *
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'

--可以看出sql语句分析,递归调用直方图信息,结果因为存在坏块1,76693,报错。
SCOTT@book> select /*+ rule */ * from emp3 where empno=7369;
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ----------
      7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800         20

--加入提示rule,可以执行。

4.首先看看这个块的内容,如果已经乱了,就无法看到里面的信息:

BBED> set dba 1,76693
        DBA             0x00412b95 (4270997 1,76693)

BBED> p kdbt
struct kdbt[0], 4 bytes                     @106
   sb2 kdbtoffs                             @106      0
   sb2 kdbtnrow                             @108      1
struct kdbt[1], 4 bytes                     @110
   sb2 kdbtoffs                             @110      1
   sb2 kdbtnrow                             @112      28

--//看kdbt可以确定有两张表。可以从kdbtoffs确定记录的范围。

BBED> p kdbr
sb2 kdbr[0]                                 @114      7871
sb2 kdbr[1]                                 @116      7855
sb2 kdbr[2]                                 @118      7839
sb2 kdbr[3]                                 @120      7823
sb2 kdbr[4]                                 @122      7807
sb2 kdbr[5]                                 @124      7791
sb2 kdbr[6]                                 @126      7775
sb2 kdbr[7]                                 @128      7759
sb2 kdbr[8]                                 @130      7743
sb2 kdbr[9]                                 @132      7727
sb2 kdbr[10]                                @134      7711
sb2 kdbr[11]                                @136      7695
sb2 kdbr[12]                                @138      7680
sb2 kdbr[13]                                @140      7664
sb2 kdbr[14]                                @142      7648
sb2 kdbr[15]                                @144      7632
sb2 kdbr[16]                                @146      7616
sb2 kdbr[17]                                @148      7600
sb2 kdbr[18]                                @150      7584
sb2 kdbr[19]                                @152      7568
sb2 kdbr[20]                                @154      7552
sb2 kdbr[21]                                @156      7536
sb2 kdbr[22]                                @158      7520
sb2 kdbr[23]                                @160      7504
sb2 kdbr[24]                                @162      7488
sb2 kdbr[25]                                @164      7472
sb2 kdbr[26]                                @166      7457
sb2 kdbr[27]                                @168      7441
sb2 kdbr[28]                                @170      7425

BBED> x /rnn *kdbr[0]
rowdata[446]                                @7963
------------
flag@7963: 0xac (KDRHFL, KDRHFF, KDRHFH, KDRHFK)
lock@7964: 0x00
cols@7965:    2
kref@7966:   28
mref@7968:   14
hrid@7970:0x00412b95.0
nrid@7976:0x00412b95.0

col    0[4] @7982: 95323
col    1[2] @7987: 1
--//对应的就是OBJ#,INTCOL#。也就是OBJ#对应dba_objects.objects_id,在这里就是scott.emp3表。

BBED> x /rnnnncnn *kdbr[15]
rowdata[207]                                @7724
------------
flag@7724: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
lock@7725: 0x02
cols@7726:    4

col    0[2] @7728: 1
col    1[1] @7731: 0
col    2[2] @7733: 1
col    3[3] @7736: 7369

SYS@book> select obj#,col#,segcol#,name,intcol# from sys.col$  where obj# in (select object_id from dba_objects where object_name='HISTGRM$');
      OBJ#       COL#    SEGCOL# NAME                    INTCOL#
---------- ---------- ---------- -------------------- ----------
       446          1          1 OBJ#                          1
       446          2          3 COL#                          2
       446          3          4 ROW#                          3
       446          4          5 BUCKET                        4
       446          5          6 ENDPOINT                      5
       446          6          2 INTCOL#                       6
       446          7          7 EPVALUE                       7
       446          8          8 SPARE1                        8
       446          9          9 SPARE2                        9
9 rows selected.

--//注意列定义的顺序,cluster的定义是OBJ#,INTCOL#,也就是表HISTGRM$的第1,6字段。它实际在段中是第1,2字段。
--//COL# 不等于0的列显示。select * from t;
--//SEGCOL# 表示在段内存储的顺序。
--//INTCOL# 表示创建表时各列的定义顺序的顺序。

--重新分析报错。
SCOTT@book> execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false)
BEGIN sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false); END;

*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 24281
ORA-06512: at "SYS.DBMS_STATS", line 24332
ORA-06512: at line 1

SCOTT@book> execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 1 ',Cascade => True ,No_Invalidate => false)
BEGIN sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 1 ',Cascade => True ,No_Invalidate => false); END;

*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 24281
ORA-06512: at "SYS.DBMS_STATS", line 24332
ORA-06512: at line 1

--可以测试事件绕过坏块扫描。alter session set events '10231 trace name context forever,level 10' ;

SCOTT@book> alter session set events '10231 trace name context forever,level 10' ;
Session altered.

SCOTT@book> select   * from emp3 where empno=7369;
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ----------
      7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800         20

SCOTT@book> execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 1 ',Cascade => True ,No_Invalidate => false)
PL/SQL procedure successfully completed.
--可以删除直方图。但是重新建立依旧报错。
SCOTT@book> execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false)
BEGIN sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false); END;
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 24281
ORA-06512: at "SYS.DBMS_STATS", line 24332
ORA-06512: at line 1

SYS@book> select /*+ full(a) */ count(*) from SYS.HISTGRM$ a;
select /*+ full(a) */ count(*) from SYS.HISTGRM$ a
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 76693)
ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'

--依旧要访问这个块。

5.首先建立这个表的备份:

SYS@book>  alter session set events '10231 trace name context forever,level 10' ;
Session altered.

SYS@book> select /*+ full(a) */ count(*) from SYS.HISTGRM$ a;
  COUNT(*)
----------
     55096

SYS@book> create table scott.HISTGRM tablespace users as select * from SYS.HISTGRM$;
Table created.

SYS@book> select /*+ full(a) */ count(*) from Scott.HISTGRM a;
  COUNT(*)
----------
     55096

SYS@book> truncate cluster SYS.C_OBJ#_INTCOL#;
truncate cluster SYS.C_OBJ#_INTCOL#
                     *
ERROR at line 1:
ORA-00701: object necessary for warmstarting database cannot be altered

SYS@book> truncate table SYS.HISTGRM$;
truncate table SYS.HISTGRM$
                   *
ERROR at line 1:
ORA-00701: object necessary for warmstarting database cannot be altered

--可以发现这个对象无法truncate。

$ oerr ora 701
00701, 00000, "object necessary for warmstarting database cannot be altered"
// *Cause:  Attempt to alter or drop a database object (table, cluster, or
//          index) which are needed for warmstarting the database.
// *Action: None.

6.设置 38003 事件,可以将对象 C_OBJ#_INTCOL# 从启动依赖中暂时剥离出来:

alter system set event='38003 trace name context forever, level 10' scope=spfile;

$ oerr ora 38003
38003, 00000, "CBO Disable column stats for the dictionary objects in recursive SQL"
// *Cause:
// *Action:

--//从提示看实际上就是关闭CBO递归执行。

SYS@book> alter system set event='38003 trace name context forever, level 10' scope=spfile;
System altered.

--//重启数据库。
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.

SYS@book> startup RESTRICT
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
Database mounted.
Database opened.

--//alter system enable restricted session;

SYS@book> show parameter event
NAME          TYPE   VALUE
------------- ------ ------------------------------------------
event         string 38003 trace name context forever, level 10
xml_db_events string enable

SYS@book> truncate table SYS.HISTGRM$;
truncate table SYS.HISTGRM$
                   *
ERROR at line 1:
ORA-03292: Table to be truncated is part of a cluster

--//在cluster的表不能执行truncate。
$ oerr ora 3292
03292, 00000, "Table to be truncated is part of a cluster"
//  *Cause:  The table being truncated is a member of a cluster.
//  *Action: Either use TRUNCATE CLUSTER or DROP TABLE

SYS@book> truncate cluster SYS.C_OBJ#_INTCOL#;
Cluster truncated.

SYS@book> insert into SYS.HISTGRM$ select * from scott.HISTGRM order by OBJ#, INTCOL# ;
55096 rows created.

SYS@book> commit ;
Commit complete.

SYS@book> alter system reset event  scope=spfile sid='*';
System altered.

--//再次重启看看。
$ dbv file=/mnt/ramdisk/book/system01.dbf
DBVERIFY: Release 11.2.0.4.0 - Production on Fri Jul 22 10:41:05 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
DBVERIFY - Verification starting : FILE = /mnt/ramdisk/book/system01.dbf
DBVERIFY - Verification complete
Total Pages Examined         : 99840
Total Pages Processed (Data) : 66606
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 14368
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 3592
Total Pages Processed (Seg)  : 1
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 15274
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 359730318 (3.359730318)

SCOTT@book> execute sys.dbms_stats.gather_table_stats ( OwnName => nvl('',user),TabName => 'emp3',Estimate_Percent => NULL,Method_Opt => 'FOR ALL COLUMNS SIZE 254 ',Cascade => True ,No_Invalidate => false)
PL/SQL procedure successfully completed.

SYS@book> select rowid,a.* from SYS.HISTGRM$ a where  obj#=95323 and col#=1 and rownum<=3;
ROWID                    OBJ#       COL#       ROW#     BUCKET   ENDPOINT    INTCOL# EPVALUE SPARE1  SPARE2
------------------ ---------- ---------- ---------- ---------- ---------- ---------- ------- ------- -------
AAAXSVAABAAAXgkAAA      95323          1          0          1       7369          1
AAAXSVAABAAAXgkAAB      95323          1          0          2       7499          1
AAAXSVAABAAAXgkAAC      95323          1          0          3       7521          1

--//上次我的truncate时没有备份,导致toad无法登录,或者报错,再或者很慢。几乎无法使用,必须设置optimizer_mode=rule,分析系统
--//以及应用表才正常。

SYS@book> select * from dba_objects where object_name in ('HISTGRM$','C_OBJ#_INTCOL#') and owner='SYS';
OWNER  OBJECT_NAME          SUBOBJECT_  OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE         CREATED             LAST_DDL_TIME       TIMESTAMP           STATUS  T G S  NAMESPACE EDITION_NAME
------ -------------------- ---------- ---------- -------------- ------------------- ------------------- ------------------- ------------------- ------- - - - ---------- ------------------------------
SYS    C_OBJ#_INTCOL#                         444          95381 CLUSTER             2013-08-24 11:37:43 2013-08-24 11:37:43 2013-08-24:11:37:43 VALID   N N N          5
SYS    HISTGRM$                               446          95381 TABLE               2013-08-24 11:37:43 2013-08-24 11:37:43 2013-08-24:11:37:43 VALID   N N N          1

--DATA_OBJECT_ID已经变化。

SYS@book> show parameter event
NAME          TYPE    VALUE
------------- ------- --------
event         string
xml_db_events string  enable

--简单总结一下:
1.确定坏块内容,尽可能备份SYS.HISTGRM$,通过10231事件。alter session set events '10231 trace name context forever,level 10' ;
2.设置38003 事件,truncate cluster,然后插入好的记录,重置event。检查测试数据库是否正常。

时间: 2024-09-20 20:27:48

[20160722]对象C_OBJ#_INTCOL#有坏块.txt的相关文章

[20150601]rman备份出现坏块.txt

[20150601]rman备份出现坏块.txt --昨天看链接: http://www.jydba.net/磁盘损坏造成RMAN备份文件有坏块的恢复案例/ --提到如果备份片存在坏块的恢复案例,他使用的参数,我自己从来没见过. alter system set event='19548 trace name context forever', '19549 trace name context forever' scope=spfile; -- oerr ora 19548,oerr ora

[20140424]oracle的逻辑坏块.txt

[20140424]oracle的逻辑坏块.txt 今天上午本来想做一个11GR2的Automatic block media repair,链接如下:http://blog.itpub.net/267265/viewspace-1148315/ 但是我遇到一个奇怪的问题,检查和的计算问题: SYS@test> @ver BANNER --------------------------------------------------------------------------------

oracle中RMAN备份和检查逻辑坏块

1. RMAN备份时是默认检查物理坏块. 2. 如果要检查逻辑坏块,可以用如下语句: $ rman target / RMAN> backup check logical validate database; 注上述语句,只是检查,不会备份的. 3. 如果要在备份的同时,进行逻辑坏块检查,可以用: $ rman target / RMAN> backup check logical database; 4.如果发现坏逻辑如何处理,下面补充一篇教程. 利用RMAN检测数据库坏块的脚本 虽然我们也

[20150811]模拟坏块处理.txt

[20150811]模拟坏块处理.txt --如果存在备份,修复坏块还是相对简单的.在11g下: select * from V$DATABASE_BLOCK_CORRUPTION; --在rman下执行: blockrecover corruption list; --如果数据块没有使用,没有分配data_object_id而出现坏块,如何恢复呢?一般采用的方法建立新对象的方法,格式化这个数据块. --具体测试如下: 1.建立测试环境: SCOTT@test> @ver1 PORT_STRIN

[20160816]11G dataguard坏块修复.txt

[20160816]11G dataguard坏块修复.txt --11GR2 不仅仅支持在备库在只读的情况下,日志应用(ACTIVE Data Guard),还提供主备库的坏块修复.自己以前也做过相关测试, --我记得上次测试的仅仅是主库数据块损坏,没有测试备库的数据块损坏.补充一些测试: 1.环境: SYS@test> @ ver1 PORT_STRING                    VERSION        BANNER ---------------------------

[20121016]坏块处理以及数据恢复.txt

[20121016]坏块处理以及数据恢复.txt 如果产生坏块,在没有备份的情况下,如何最大程度的恢复信息,减少损失. SQL> select * from v$version ; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produ

如果处理Oracle数据库中的坏块问题

oracle|数据|数据库|问题 Oracle的数据块有固定的格式和结构,分三层: Cache layer.Transaction layer和Data layer.对数据块进行读写操作时,做一致性检查:–Block type–DBA–Scn –Header and tail 发现不一致,标记为坏块. 坏块有两种: 物理坏块和逻辑坏块. 坏块产生的影响:数据字典表.回滚段表.临时段和用户数据表和索引.应用报错:–Ora-1578 –Ora-600 and trace file in bdump

用ORACLE8i修复数据库坏块的三种方法

oracle|数据|数据库 在进行SUN CLUSTER双机切换.意外断电或其它情况下,有时会发生共享盘MOUNT不上的情况,需要使用FSCK对共享盘进行修复.修复完成后,在数据库启动过程中,却又出现"数据块损坏,无法启动数据库"的现象,此时,可以根据不同的数据块损坏类型,检测并修复错误.在此介绍三种使用Oracle8i修复损坏数据块的方法. 一.数据块损坏,错误代码为ORA-01578 ORA-1115 I/O ERROR READING BLOCK 通常后跟ORA-737X错误与操

如何处理Oracle数据库中的坏块问题

oracle|数据|数据库|问题   本文主要介绍如何去处理在Oracle数据库中出现坏块的问题,对于坏块产生在不同的对象上,处理的方法会有所不同,本文将大致对这些方法做一些介绍.因为数据库运行时间长了,由于硬件设备的老化,出现坏块的几率会越来越大,因此,做为一个DBA,怎么去解决数据库出现的坏块问题就成了一个重要的议题了.   一:什么是数据库的坏块   首先我们来大概看一下数据库块的格式和结构 数据库的数据块有固定的格式和结构,分三层:cache layer,transaction laye