合 Oracle异常恢复BBED系列
Tags: Oracle编译恢复BBEDORA-08102sys.bootstrap$
使用BBED修复sys.bootstrap$ 对象
前言部分
导读和注意事项
各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:
① sys.bootstrap$的知识
② sys.bootstrap$块损坏的修复过程
③ BBED copy命令的使用
本文简介
本文的实验过程主要是为了学习BBED。
相关知识点扫盲(摘自网络)
11g下变成了521、522、523 这3个块。
实验环境介绍
项目 | 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 |
实验目标
破坏sys.bootstrap$对象占用的4个块,然后利用BBED的copy从其他相同版本的文件中copy这4个块来恢复该对象。
实验过程
冷备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>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>
模拟故障
total 208
-rwxrwxrwx 1 oracle dba 57 Apr 05 17:01 bbed.par