【BBED】 sys.bootstrap$ 对象的恢复

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介: 【BBED】 sys.bootstrap$ 对象的恢复   1.1  BLOG文档结构图     1.

BBEDsys.bootstrap$ 对象的恢复

 

1.1  BLOG文档结构图

 

wps2B1A.tmp 

1.2  前言部分

 

1.2.1  导读和注意事项

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① sys.bootstrap$的知识

sys.bootstrap$块损坏的修复过程

BBED copy命令的使用

 

  Tips:

       ① 若文章代码格式有错乱,推荐使用QQ、搜狗或360浏览器,也可以下载pdf格式的文档来查看,pdf文档下载地址:http://yunpan.cn/cdEQedhCs2kFz (提取码:ed9b 

       ② 本篇BLOG中命令的输出部分需要特别关注的地方我都用灰色背景和粉红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33thread 2的最大归档日志号为43是需要特别关注的地方;而命令一般使用黄色背景和红色字体注;对代码或代码输出部分的注释一般采用蓝色字体表示

 

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

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

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

 

 

 

[ZFXXDB1:root]:/>lsvg -o

T_XDESK_APP1_vg

rootvg

[ZFXXDB1:root]:/>

00:27:22 SQL> alter tablespace idxtbs read write;

 

 

====》2097152*512/1024/1024/1024=1G 

 

 

 

本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。

 

 

1.2.2  相关参考文章链接

 

【推荐】 【BBED】编译及基本命令(1)http://blog.itpub.net/26736162/viewspace-2075216/

【推荐】 【BBED】丢失归档文件情况下的恢复:http://blog.itpub.net/26736162/viewspace-2079337/

 

1.2.3  本文简介

本文的实验过程主要是为了学习BBED

 

 

1.3  相关知识点扫盲(摘自网络)

wps2B2B.tmp 

wps2B2C.tmp 

 

11g下变成了521522523 3个块。

wps2B3D.tmp 

 

其他相关知识:http://www.cnblogs.com/springside-example/archive/2011/10/31/2529621.html

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

 

 

第二章 实验部分

2.1  实验环境介绍

项目

db

db 类型

单实例

db version

11.2.0.4.0

db 存储

FS

主机IP地址/hosts配置

192.168.59.129

OS版本及kernel版本

AIX 7.1 64位

归档模式

Archive Mode

ORACLE_SID

oralhr

 

 

2.2  实验目标

破坏sys.bootstrap$对象占用的4个块,然后利用BBEDcopy从其他相同版本的文件中copy4个块来恢复该对象。

 

2.3  实验过程

2.3.1  冷备system文件

[ZFXDESKDB2:oracle]:/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 14 16:10:07 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

 

SYS@oralhr> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SYS@oralhr> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

[ZFXDESKDB2:oracle]:/oracle>cp /oracle/app/oracle/datafile/oralhr/system01.dbf /oracle/app/oracle/datafile/oralhr/system01.dbf_bk

[ZFXDESKDB2:oracle]:/oracle>

[ZFXDESKDB2:oracle]:/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 14 16:34:04 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to an idle instance.

 

SYS@oralhr> startup

ORACLE instance started.

 

Total System Global Area 3089920000 bytes

Fixed Size                  2250360 bytes

Variable Size             721422728 bytes

Database Buffers         2348810240 bytes

Redo Buffers               17436672 bytes

Database mounted.

Database opened.

SYS@oralhr> SELECT dbms_rowid.rowid_relative_fno(rowid) rel_fno,

  2         dbms_rowid.rowid_block_number(rowid) blockno,

  3                      count(1)

  4    FROM sys.bootstrap$ d

  5   group by dbms_rowid.rowid_relative_fno(rowid) ,

  6            dbms_rowid.rowid_block_number(rowid) ;

 

   REL_FNO    BLOCKNO   COUNT(1)

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

         1        523         12

         1        521         26

         1        522         22

 

====》 11g块号有所变化

 

SYS@oralhr>

SYS@oralhr> set line 9999 pagesize 9999

SYS@oralhr> col name format a80

SYS@oralhr> select file#||' '||name||' '||bytes name from v$datafile;

 

NAME

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

1 /oracle/app/oracle/datafile/oralhr/system01.dbf 786432000

2 /oracle/app/oracle/datafile/oralhr/sysaux01.dbf 576716800

3 /oracle/app/oracle/datafile/oralhr/undotbs01.dbf 78643200

4 /oracle/app/oracle/datafile/oralhr/users01.dbf 310640640

 

SYS@oralhr>

 

2.3.2  模拟故障

[ZFXDESKDB2:oracle]:/home/oracle>l

total 208

-rwxrwxrwx    1 oracle   dba              57 Apr 05 17:01 bbed.par

-rwxrwxrwx    1 oracle   dba           52224 Apr 14 15:55 bifile.bbd

-rwxrwxrwx    1 oracle   asmadmin       5715 Apr 06 15:34 ctl.sql

-rwxrwxrwx    1 oracle   dba             302 Apr 14 10:32 file.txt

drwxrwxrwx    8 oracle   dba            4096 Apr 13 17:16 gdul

-rwxrwxrwx    1 oracle   dba           21008 Apr 14 16:35 log.bbd

drwxrwxrwx    4 oracle   dba             256 Apr 12 15:52 oracle_bk

drwxrwxrwx    4 oracle   dba             256 Apr 05 16:54 rman_bak

-rwxrwxrwx    1 oracle   dba             757 Apr 11 10:02 rman_bk_db_archive_lhr.sh

-rwxrwxrwx    1 oracle   dba            1023 Apr 08 11:25 rman_bk_db_lhr.sh

[ZFXDESKDB2:oracle]:/home/oracle>cat file.txt

1 /oracle/app/oracle/datafile/oralhr/system01.dbf 786432000

2 /oracle/app/oracle/datafile/oralhr/sysaux01.dbf 566231040

3 /oracle/app/oracle/datafile/oralhr/undotbs01.dbf 78643200

4 /oracle/app/oracle/datafile/oralhr/users01.dbf 310640640

5 /oracle/app/oracle/datafile/oralhr/system01.dbf_bk 786432000

[ZFXDESKDB2:oracle]:/home/oracle>bbed PASSWORD=blockedit  mode=edit blocksize=8192 listfile=/home/oracle/file.txt

 

BBED: Release 2.0.0.0.0 - Limited Production on Thu Apr 14 16:36:00 2016

 

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

 

************* !!! For Oracle Internal Use only !!! ***************

 

BBED> info

File#  Name                                                        Size(blks)

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

     1  /oracle/app/oracle/datafile/oralhr/system01.dbf                  96000

     2  /oracle/app/oracle/datafile/oralhr/sysaux01.dbf                  69120

     3  /oracle/app/oracle/datafile/oralhr/undotbs01.dbf                  9600

     4  /oracle/app/oracle/datafile/oralhr/users01.dbf                   37920

     5  /oracle/app/oracle/datafile/oralhr/system01.dbf_bk               96000

BBED> set count 128

        COUNT           128

 

BBED> copy file 1 block 111 to  file 1 block 377

Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 377              Offsets:    0 to  127           Dba:0x00400179

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

1ea20000 0040006f 000000e2 00000104 fa4c0000 00000001 03450080 00000000

00000000 0000f800 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

<32 bytes="" per="" line="">

 

BBED> copy file 1 block 111 to  file 1 block 378

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 378              Offsets:    0 to  127           Dba:0x0040017a

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

1ea20000 0040006f 000000e2 00000104 fa4c0000 00000001 03450080 00000000

00000000 0000f800 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

<32 bytes="" per="" line="">

 

BBED> copy file 1 block 111 to  file 1 block 379

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 379              Offsets:    0 to  127           Dba:0x0040017b

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

1ea20000 0040006f 000000e2 00000104 fa4c0000 00000001 03450080 00000000

00000000 0000f800 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

<32 bytes="" per="" line="">

 

BBED> copy file 1 block 111 to  file 1 block 380

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 380              Offsets:    0 to  127           Dba:0x0040017c

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

1ea20000 0040006f 000000e2 00000104 fa4c0000 00000001 03450080 00000000

00000000 0000f800 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

<32 bytes="" per="" line="">

 

BBED> sum apply

Check value for File 1, Block 380:

current = 0xfa4c, required = 0xfa4c

 

BBED>

BBED>

 

重启数据库:

SYS@oralhr> startup force

ORACLE instance started.

 

Total System Global Area 3089920000 bytes

Fixed Size                  2250360 bytes

Variable Size             721422728 bytes

Database Buffers         2348810240 bytes

Redo Buffers               17436672 bytes

Database mounted.

ORA-01092: ORACLE instance terminated. Disconnection forced

ORA-00704: bootstrap process failure

ORA-00704: bootstrap process failure

ORA-00604: error occurred at recursive SQL level 1

ORA-01578: ORACLE data block corrupted (file # 1, block # 377)

ORA-01110: data file 1: '/oracle/app/oracle/datafile/oralhr/system01.dbf'

Process ID: 32243962

Session ID: 34 Serial number: 3

 

 

SYS@oralhr>

 

10g不会提示,但告警日志里有提示,11g直接有提示,告警日志:

Errors in file /oracle/app/oracle/diag/rdbms/oralhr/oralhr/trace/oralhr_ora_32243962.trc:

ORA-00704: bootstrap process failure

ORA-00704: bootstrap process failure

ORA-00604: error occurred at recursive SQL level 1

ORA-01578: ORACLE data block corrupted (file # 1, block # 377)

ORA-01110: data file 1: '/oracle/app/oracle/datafile/oralhr/system01.dbf'

Error 704 happened during db open, shutting down database

USER (ospid: 32243962): terminating the instance due to error 704

Instance terminated by USER, pid = 32243962

ORA-1092 signalled during: ALTER DATABASE OPEN...

opiodr aborting process unknown ospid (32243962) as a result of ORA-1092

Thu Apr 14 16:40:03 2016

ORA-1092 : opitsk aborting process

 

2.3.3  故障恢复


从其他的相同版本的库copy 1号文件,我们有冷备份,直接添加进BBED来恢复。

[ZFXDESKDB2:oracle]:/home/oracle>bbed PASSWORD=blockedit  mode=edit blocksize=8192 listfile=/home/oracle/file.txt

 

BBED: Release 2.0.0.0.0 - Limited Production on Thu Apr 14 16:42:59 2016

 

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

 

************* !!! For Oracle Internal Use only !!! ***************

 

BBED> info

File#  Name                                                        Size(blks)

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

     1  /oracle/app/oracle/datafile/oralhr/system01.dbf                  96000

     2  /oracle/app/oracle/datafile/oralhr/sysaux01.dbf                  69120

     3  /oracle/app/oracle/datafile/oralhr/undotbs01.dbf                  9600

     4  /oracle/app/oracle/datafile/oralhr/users01.dbf                   37920

     5  /oracle/app/oracle/datafile/oralhr/system01.dbf_bk               96000

 

BBED> set count 128

        COUNT           128

 

BBED>

BBED>

BBED> copy file 5 block 377 to  file 1 block 377

Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 377              Offsets:    0 to  127           Dba:0x00400179

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

06a20000 00400179 000d00f0 00000104 75380000 02000001 00000029 000d00f0

00000000 00010200 00000000 0004000d 0000040d 00c072f0 009e0200 80000000

000d00e9 01008001 00000001 0009002e 1f291efb 0040017a 00080000 1f780000

1f701f68 1f5f1f56 1f4d1f44 1f3b1f32 1f291eb2 1ea71ec8 1ed31e2e 1e231e9c

 

<32 bytes="" per="" line="">

 

BBED> copy file 5 block 378 to  file 1 block 378

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 378              Offsets:    0 to  127           Dba:0x0040017a

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

06a20000 0040017a 00033b45 00000104 5e150000 02000000 00000029 00033b45

0000af58 00020200 00000000 0003001f 0000000e 00c003f0 00070100 e0000000

00033742 00000000 00000000 00000000 00000000 00000000 00000000 00008001

00000001 023f04a2 04a80006 00000000 0040017b 00000000 06000000 1f600000

 

<32 bytes="" per="" line="">

 

BBED> copy file 5 block 379 to  file 1 block 379

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 379              Offsets:    0 to  127           Dba:0x0040017b

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

06a20000 0040017b 0002fee2 00000106 4c290000 02000000 00000029 0002fed6

00000000 00020200 00000000 00080002 00000048 00c01bb9 00120100 c0000000

0001bf0a 0004001f 000000ff 00c00592 00341200 2002001c 0002fee2 00008001

00000002 02390496 04a10023 00000002 0040017c 0040017a 06000000 1f600000

 

<32 bytes="" per="" line="">

 

BBED> copy file 5 block 380 to  file 1 block 380

File: /oracle/app/oracle/datafile/oralhr/system01.dbf (1)

Block: 380              Offsets:    0 to  127           Dba:0x0040017c

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

06a20000 0040017c 0008ac20 00000106 55390000 02020003 00000029 0008ab88

00000000 1f020200 00000000 000a000d 0000015e 00c0714e 00330100 60010000

0008ab8a 000a0018 00000151 00c0714d 00330900 20420000 0008ac20 00018001

00000002 021f0462 04670005 00000000 0040017d 0040017b 06000000 1f600000

 

<32 bytes="" per="" line="">

 

BBED> sum apply

Check value for File 1, Block 380:

current = 0x5539, required = 0x5539

 

BBED>

BBED>

 

 

尝试启动数据库:

SYS@oralhr> alter database open;

ERROR:

ORA-03114: not connected to ORACLE

 

 

SYS@oralhr> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

[ZFXDESKDB2:oracle]:/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 14 16:44:02 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to an idle instance.

 

SYS@oralhr> startup

ORACLE instance started.

 

Total System Global Area 3089920000 bytes

Fixed Size                  2250360 bytes

Variable Size             721422728 bytes

Database Buffers         2348810240 bytes

Redo Buffers               17436672 bytes

Database mounted.

Database opened.

SYS@oralhr>

wps2B4D.tmp 

 

 

 

2.4  实验总结

11gsys.bootstrap$对象所占用的块变成了5205215225234个块,10g下为3773783793804个块,但是11g测试的时候破坏520521522523378379380都可以完成这个实验,其中破坏520的时候报错:

ORA-01092: ORACLE instance terminated. Disconnection forced

ORA-00704: bootstrap process failure

ORA-01578: ORACLE data block corrupted (file # 1, block # 520)

ORA-01110: data file 1: '/oracle/app/oracle/datafile/oralhr/system01.dbf'

Process ID: 34078884

Session ID: 34 Serial number: 3

 

 

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




About Me

.............................................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在itpub(http://blog.itpub.net/26736162/abstract/1/)、博客园(http://www.cnblogs.com/lhrbest)和个人微信公众号(xiaomaimiaolhr)上有同步更新

● 本文itpub地址:http://blog.itpub.net/26736162/viewspace-2083621/

● 本文博客园地址:http://www.cnblogs.com/lhrbest

● 本文pdf版、个人简介及小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答:http://blog.itpub.net/26736162/viewspace-2134706/

● DBA宝典今日头条号地址:http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

.............................................................................................................................................

● QQ群号:230161599(满)、618766405

● 微信群:可加我微信,我拉大家进群,非诚勿扰

● 联系我请加QQ好友646634621,注明添加缘由

● 于 2016-04-14 10:00~ 2016-04-14 19:00 在魔都完成

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

.............................................................................................................................................

小麦苗的微店https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麦苗出版的数据库类丛书http://blog.itpub.net/26736162/viewspace-2142121/

.............................................................................................................................................

使用微信客户端扫描下面的二维码来关注小麦苗的微信公众号(xiaomaimiaolhr)及QQ群(DBA宝典),学习最实用的数据库技术。

   小麦苗的微信公众号      小麦苗的DBA宝典QQ群1     小麦苗的DBA宝典QQ群2        小麦苗的微店

.............................................................................................................................................


DBA笔试面试讲解群1
DBA笔试面试讲解群2
欢迎与我联系



相关实践学习
通过日志服务实现云资源OSS的安全审计
本实验介绍如何通过日志服务实现云资源OSS的安全审计。
目录
相关文章
|
6天前
|
存储 关系型数据库 分布式数据库
PostgreSQL 18 发布,快来 PolarDB 尝鲜!
PostgreSQL 18 发布,PolarDB for PostgreSQL 全面兼容。新版本支持异步I/O、UUIDv7、虚拟生成列、逻辑复制增强及OAuth认证,显著提升性能与安全。PolarDB-PG 18 支持存算分离架构,融合海量弹性存储与极致计算性能,搭配丰富插件生态,为企业提供高效、稳定、灵活的云数据库解决方案,助力企业数字化转型如虎添翼!
|
17天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1320 7
|
5天前
|
存储 人工智能 Java
AI 超级智能体全栈项目阶段二:Prompt 优化技巧与学术分析 AI 应用开发实现上下文联系多轮对话
本文讲解 Prompt 基本概念与 10 个优化技巧,结合学术分析 AI 应用的需求分析、设计方案,介绍 Spring AI 中 ChatClient 及 Advisors 的使用。
297 129
AI 超级智能体全栈项目阶段二:Prompt 优化技巧与学术分析 AI 应用开发实现上下文联系多轮对话
|
4天前
|
监控 JavaScript Java
基于大模型技术的反欺诈知识问答系统
随着互联网与金融科技发展,网络欺诈频发,构建高效反欺诈平台成为迫切需求。本文基于Java、Vue.js、Spring Boot与MySQL技术,设计实现集欺诈识别、宣传教育、用户互动于一体的反欺诈系统,提升公众防范意识,助力企业合规与用户权益保护。
|
16天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
1392 87
|
4天前
|
JavaScript Java 大数据
基于JavaWeb的销售管理系统设计系统
本系统基于Java、MySQL、Spring Boot与Vue.js技术,构建高效、可扩展的销售管理平台,实现客户、订单、数据可视化等全流程自动化管理,提升企业运营效率与决策能力。
|
5天前
|
人工智能 Java API
AI 超级智能体全栈项目阶段一:AI大模型概述、选型、项目初始化以及基于阿里云灵积模型 Qwen-Plus实现模型接入四种方式(SDK/HTTP/SpringAI/langchain4j)
本文介绍AI大模型的核心概念、分类及开发者学习路径,重点讲解如何选择与接入大模型。项目基于Spring Boot,使用阿里云灵积模型(Qwen-Plus),对比SDK、HTTP、Spring AI和LangChain4j四种接入方式,助力开发者高效构建AI应用。
282 122
AI 超级智能体全栈项目阶段一:AI大模型概述、选型、项目初始化以及基于阿里云灵积模型 Qwen-Plus实现模型接入四种方式(SDK/HTTP/SpringAI/langchain4j)
|
5天前
|
弹性计算 安全 数据安全/隐私保护
2025年阿里云域名备案流程(新手图文详细流程)
本文图文详解阿里云账号注册、服务器租赁、域名购买及备案全流程,涵盖企业实名认证、信息模板创建、域名备案提交与管局审核等关键步骤,助您快速完成网站上线前的准备工作。
232 82
2025年阿里云域名备案流程(新手图文详细流程)