One .1  BLOG Document structure chart

 

wps2B1A.tmp 

One .2   Preface

 

One .2.1   Guidance and notes

Technology enthusiasts , After reading this article , You can master the following skills , You can also learn something else you don't know ,~O(∩_∩)O~:

① sys.bootstrap$ Knowledge

② sys.bootstrap$ Repair process of block damage

③ BBED copy Use of commands

 

  Tips:

       ① If the article code format is wrong , Recommended QQ、 Sogou or 360 browser , You can also download pdf Format to view ,pdf Document download address :http://yunpan.cn/cdEQedhCs2kFz ( Extraction code :ed9b) 

       ②  This article BLOG I use gray background and pink font to show the output part of the command that needs special attention , For example, in the following example ,thread 1 The maximum archive log number for is 33,thread 2 The maximum archive log number for is 43 It's something that needs special attention ; Commands are usually marked with yellow background and red font ; Comments on the code or the output part of the code are generally in blue font .

 

  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 

 

 

 

If there are any mistakes or imperfections in this article, please correct them ,ITPUB Message or QQ All can , Your criticism is the biggest motivation of my writing .

 

 

One .2.2   Links to related reference articles

 

【 recommend 】 【BBED】 Compilation and basic commands (1):http://blog.itpub.net/26736162/viewspace-2075216/

【 recommend 】 【BBED】 Recovery in the case of Lost Archives :http://blog.itpub.net/26736162/viewspace-2079337/

 

One .2.3   Brief introduction

The experimental process of this paper is mainly for learning BBED.

 

 

One .3   Related knowledge points literacy ( From the Internet )

wps2B2B.tmp 

wps2B2C.tmp 

 

11g It turns into 521、522、523  this 3 Block .

wps2B3D.tmp 

 

Other relevant knowledge :http://www.cnblogs.com/springside-example/archive/2011/10/31/2529621.html

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

 

 

Chapter two   Experimental part

Two .1   Introduction to the experimental environment

project

db

db  type

Single instance

db version

11.2.0.4.0

db  Storage

FS

host IP Address /hosts To configure

192.168.59.129

OS Version and kernel edition

AIX 7.1 64 position

Archiving mode

Archive Mode

ORACLE_SID

oralhr

 

 

Two .2   The goal of the experiment

damage sys.bootstrap$ Object occupied 4 Block , And then use it BBED Of copy From other files of the same version copy this 4 Block to recover the object .

 

Two .3   Experimental process

Two .3.1   Cold standby system file

[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 The block number has changed

 

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>

 

Two .3.2   Analog fault

[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>

 

Restart the database :

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 No prompt , But there are hints in the alarm log ,11g There's a direct hint , Alarm log :

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

 

Two .3.3   Fault recovery


From other libraries of the same version copy 1 No. , We have cold backup , Add directly to BBED To restore .

[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>

 

 

Try to start the database :

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 

 

 

 

Two .4   Summary of the experiment

11g Next sys.bootstrap$ The block occupied by the object becomes 520、521、522、523 this 4 Block ,10g for 377、378、379、380 this 4 Block , however 11g It's broken when it's tested 520、521、522、523 or 378、379、380 You can do this experiment , Among them, destruction 520 It's a mistake :

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