IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> 实战oracle 12c 处理索引坏块一例 -> 正文阅读

[大数据]实战oracle 12c 处理索引坏块一例

alert日志报错信息:

[oracle@hd04 trace]$ cat alert_db12c.log |grep "corrupt" -A 2 -B 2|more
Hex dump of (file 11, block 704337) in trace file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_p006_20208.trc
Reading datafile '/app/oracle/oradata/orcl/db12cpdb/undotbs01.dbf' for corruption at rdba: 0x024abf51 (file 11, block 704337)
2019-08-22T15:30:39.594783+08:00
Hex dump of (file 3, block 97921) in trace file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_p004_20204.trc
Reading datafile '/app/oracle/oradata/orcl/sysaux01.dbf' for corruption at rdba: 0x00c17e81 (file 3, block 97921)
Reread (file 3, block 97921) found same corrupt data (logically corrupt)
2019-08-22T15:30:39.614714+08:00
Reread (file 11, block 704337) found same corrupt data (logically corrupt)
2019-08-22T15:30:39.637609+08:00
*****************************************************************
--
2019-08-22T15:30:48.232309+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_p003_20202.trc  (incident=146194) (PDBNAME=CDB$ROOT):
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
ORA-10564: tablespace SYSAUX
--
2019-08-22T15:30:49.761279+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_p003_20202.trc:
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
ORA-10564: tablespace SYSAUX
--
2019-08-22T15:30:54.735880+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_ora_20194.trc  (incident=146162) (PDBNAME=CDB$ROOT):
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
ORA-10564: tablespace SYSAUX
--
2019-08-22T15:30:56.296743+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_ora_20194.trc:
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
ORA-10564: tablespace SYSAUX
--
Hex dump of (file 3, block 97921) in trace file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_ora_20194.trc
Reading datafile '/app/oracle/oradata/orcl/sysaux01.dbf' for corruption at rdba: 0x00c17e81 (file 3, block 97921)
Reread (file 3, block 97921) found same corrupt data (logically corrupt)
*****************************************************************
An internal routine has requested a dump of selected redo.
--
2019-08-22T15:35:00.962427+08:00
Completed redo application of 0.96MB
Reading datafile '/app/oracle/oradata/orcl/sysaux01.dbf' for corruption at rdba: 0x00c17e81 (file 3, block 97921)
Reread (file 3, block 97921) found same corrupt data (logically corrupt)
*****************************************************************

1.查询Oracle坏块方法
set lines 120

select * from v$database_block_corruption;

[oracle@hd04 trace]$ sqlplus / as sysdba'
SQL*Plus: Release 12.2.0.1.0 Production on Sat Sep 18 14:45:29 2021
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select * from v$database_block_corruption;
     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO     CON_ID
---------- ---------- ---------- ------------------ --------- ----------
         3      60630          1          115606079 CORRUPT            1
SQL>

2.分析Oracle坏块对应的对象内容

执行如下命令:

set pagesize 2000
set linesize 250
col OWNER for a15
col SEGMENT_NAME for a25
col PARTITION_NAME for a25
SELECT e.owner,
       e.segment_type,
       e.segment_name,
       e.partition_name,
       c.file#,
       greatest(e.block_id, c.block#) corr_start_block#,
       least(e.block_id + e.blocks - 1, c.block# + c.blocks - 1) corr_end_block#,
       least(e.block_id + e.blocks - 1, c.block# + c.blocks - 1) -
       greatest(e.block_id, c.block#) + 1 blocks_corrupted,
       null description
  FROM dba_extents e, v$database_block_corruption c
 WHERE e.file_id = c.file#
   AND e.block_id <= c.block# + c.blocks - 1
   AND e.block_id + e.blocks - 1 >= c.block#
UNION
SELECT s.owner,
       s.segment_type,
       s.segment_name,
       s.partition_name,
       c.file#,
       header_block corr_start_block#,
       header_block corr_end_block#,
       1 blocks_corrupted,
       'Segment Header' description
  FROM dba_segments s, v$database_block_corruption c
 WHERE s.header_file = c.file#
   AND s.header_block between c.block# and c.block# + c.blocks - 1
UNION
SELECT null owner,
       null segment_type,
       null segment_name,
       null partition_name,
       c.file#,
       greatest(f.block_id, c.block#) corr_start_block#,
       least(f.block_id + f.blocks - 1, c.block# + c.blocks - 1) corr_end_block#,
       least(f.block_id + f.blocks - 1, c.block# + c.blocks - 1) -
       greatest(f.block_id, c.block#) + 1 blocks_corrupted,
       'Free Block' description
  FROM dba_free_space f, v$database_block_corruption c
 WHERE f.file_id = c.file#
   AND f.block_id <= c.block# + c.blocks - 1
   AND f.block_id + f.blocks - 1 >= c.block#
 order by file#, corr_start_block#;

结果:

3.查看创建索引语句。

查看创建索引语句:
set linesize 200
set pagesize 200
set long 999999
select dbms_metadata.get_ddl('INDEX','SMON_SCN_TIME_TIM_IDX') from dual;

?

?4.重建索引

mark一下,不建议使用rebuild online选项。

alter index "SYS"."SMON_SCN_TIME_TIM_IDX" rebuild ;

analyze index "SYS"."SMON_SCN_TIME_TIM_IDX" validate structure;

select * from v$database_block_corruption; 

?

5.再次查看alert 日志,不再报错。

2021-09-18T14:59:56.023510+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_smon_17951.trc  (incident=587538) (PDBNAME=CDB$ROOT):
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
2021-09-18T14:59:56.031705+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_smon_17951.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
2021-09-18T15:04:29.724393+08:00
--
2021-09-18T15:05:06.491927+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_smon_17951.trc  (incident=587539) (PDBNAME=CDB$ROOT):
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
2021-09-18T15:05:06.495228+08:00
Errors in file /app/oracle/diag/rdbms/orcl/db12c/trace/db12c_smon_17951.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 3, block # 60630)
ORA-01110: data file 3: '/app/oracle/oradata/orcl/sysaux01.dbf'
2021-09-18T15:05:28.860120+08:00
[oracle@hd04 trace]$ date

Sat Sep 18 15:24:34 CST 2021

[oracle@hd04 trace]$ 

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2021-09-20 15:51:25  更:2021-09-20 15:53:51 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/23 23:20:48-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码