溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

kingsql中如何使用BBED修改Oracle數(shù)據(jù)文件頭推進(jìn)SCN

發(fā)布時間:2021-11-09 10:57:01 來源:億速云 閱讀:160 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章將為大家詳細(xì)講解有關(guān)kingsql中如何使用BBED修改Oracle數(shù)據(jù)文件頭推進(jìn)SCN,小編覺得挺實(shí)用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

請看報(bào)大錯:

SQL> startup;

ORACLE instance started.

Total System Global Area 1603411968 bytes

Fixed Size                  2228784 bytes

Variable Size             989859280 bytes

Database Buffers          603979776 bytes

Redo Buffers                7344128 bytes

Database mounted.

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: '/u01/app/oracle/oradata/oggdb2/system01.dbf'

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: '/u01/app/oracle/oradata/oggdb2/system01.dbf'

現(xiàn)在開始修復(fù)數(shù)據(jù)吧!

SQL>  select name,checkpoint_change# from v$datafile;

NAME                                                         CHECKPOINT_CHANGE#

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

/u01/app/oracle/oradata/oggdb2/system01.dbf                          2147548266

/u01/app/oracle/oradata/oggdb2/sysaux01.dbf                          2147548266

/u01/app/oracle/oradata/oggdb2/undotbs01.dbf                         2147548266

/u01/app/oracle/oradata/oggdb2/users01.dbf                           2147548266

/u01/app/oracle/oradata/oggdb2/example01.dbf                         2147548266

/u01/app/oracle/oradata/oggdb2/gguser.dbf                            2147548266

/u01/app/oracle/oradata/oggdb2/p2pdata01.dbf                         2147548266

7 rows selected.

SQL> select name,checkpoint_change# from v$datafile_header;

NAME                                                         CHECKPOINT_CHANGE#

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

/u01/app/oracle/oradata/oggdb2/system01.dbf                          2147546874

/u01/app/oracle/oradata/oggdb2/sysaux01.dbf                          2147548266

/u01/app/oracle/oradata/oggdb2/undotbs01.dbf                         2147548266

/u01/app/oracle/oradata/oggdb2/users01.dbf                           2147548266

/u01/app/oracle/oradata/oggdb2/example01.dbf                         2147548266

/u01/app/oracle/oradata/oggdb2/gguser.dbf                            2147548266

/u01/app/oracle/oradata/oggdb2/p2pdata01.dbf                         2147548266

修復(fù)過程:

1.修改舊數(shù)據(jù)文件頭scn的值

BBED> dump offset 484

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  484 to  983           Dba:0x00400001

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

 8e4a0180 00000000 243e333b 01000000 94000000 02000000 10000000 02000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 0d000d00 0d000100 00000000 00000000 00000000 02004000 32270f00 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 02ace702 c1770dd9 007b503c cfdee590 34000000 

 00000000 00000000 00000000 00012997 2a000000 38020000 00000000 c08c5ef2 

 05fe25a5 9d6b999e 14265f03 1ef30600 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

BBED> m /x 654f0180 offset 484

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  484 to  983           Dba:0x00400001

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

 654f0180 00000000 243e333b 01000000 94000000 02000000 10000000 02000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 0d000d00 0d000100 00000000 00000000 00000000 02004000 32270f00 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 02ace702 c1770dd9 007b503c cfdee590 34000000 

 00000000 00000000 00000000 00012997 2a000000 38020000 00000000 c08c5ef2 

 05fe25a5 9d6b999e 14265f03 1ef30600 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

2.查看并修正數(shù)據(jù)文件頭chckpoint_time的值

本文固定鏈接 http://blog.itpub.net/28389881/viewspace-2221607/

BBED> dump offset 492

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  492 to  991           Dba:0x00400001

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

 243e333b 01000000 94000000 02000000 10000000 02000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 0d000d00 0d000100 

 00000000 00000000 00000000 02004000 32270f00 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 02ace702 c1770dd9 007b503c cfdee590 34000000 00000000 00000000 

 00000000 00012997 2a000000 38020000 00000000 c08c5ef2 05fe25a5 9d6b999e 

 14265f03 1ef30600 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

BBED> m /x be42333b offset 492

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  492 to  991           Dba:0x00400001

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

 be42333b 01000000 94000000 02000000 10000000 02000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 0d000d00 0d000100 

 00000000 00000000 00000000 02004000 32270f00 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 02ace702 c1770dd9 007b503c cfdee590 34000000 00000000 00000000 

 00000000 00012997 2a000000 38020000 00000000 c08c5ef2 05fe25a5 9d6b999e 

 14265f03 1ef30600 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

3.修改舊數(shù)據(jù)文件頭中檢查點(diǎn)計(jì)數(shù)器(kcvfhcpc)

BBED> dump offset 140 

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  140 to  639           Dba:0x00400001

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

 28010000 223e333b 27010000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 06005359 5354454d 00000000 00000000 00000000 00000000 00000000 

 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 0a000a00 5c776c2d 01000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 654f0180 00000000 

 be42333b 01000000 94000000 02000000 10000000 02000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

BBED> m /x 2a010000 offset 140

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  140 to  639           Dba:0x00400001

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

 2a010000 223e333b 27010000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 06005359 5354454d 00000000 00000000 00000000 00000000 00000000 

 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 0a000a00 5c776c2d 01000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 654f0180 00000000 

 be42333b 01000000 94000000 02000000 10000000 02000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

4.修改舊數(shù)據(jù)文件頭中控制文件備份的計(jì)數(shù)器(kcvfhccc)的值

BBED> dump offset 148 

File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  148 to  647           Dba:0x00400001

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

 5c537c9d 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 06005359 

 5354454d 00000000 00000000 00000000 00000000 00000000 00000000 01000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 0a000a00 5c776c2d 01000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 654f0180 00000000 be42333b 01000000 

 94000000 02000000 10000000 02000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

BBED> m /x 29010000 offset 148

 File: /u01/app/oracle/oradata/oggdb2/system01.dbf (1)

 Block: 1                Offsets:  148 to  647           Dba:0x00400001

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

 29010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 06005359 

 5354454d 00000000 00000000 00000000 00000000 00000000 00000000 01000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 0a000a00 5c776c2d 01000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 654f0180 00000000 be42333b 01000000 

 94000000 02000000 10000000 02000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

5.重新生成sum

BBED> sum apply

Check value for File 1, Block 1:

current = 0xec9b, required = 0xec9b

6.查詢各個數(shù)據(jù)文件頭scn

SQL> select file#,checkpoint_change#,name from v$datafile_header;

     FILE# CHECKPOINT_CHANGE# NAME

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

         1         2147548266 /u01/app/oracle/oradata/oggdb2/system01.dbf

         2         2147548266 /u01/app/oracle/oradata/oggdb2/sysaux01.dbf

         3         2147548266 /u01/app/oracle/oradata/oggdb2/undotbs01.dbf

         4         2147548266 /u01/app/oracle/oradata/oggdb2/users01.dbf

         5         2147548266 /u01/app/oracle/oradata/oggdb2/example01.dbf

         6         2147548266 /u01/app/oracle/oradata/oggdb2/gguser.dbf

         7         2147548266 /u01/app/oracle/oradata/oggdb2/p2pdata01.dbf

7 rows selected.

7 rows selected.

SQL> alter database open;

Database altered.

至此數(shù)據(jù)庫成功啟動咯~

關(guān)于“kingsql中如何使用BBED修改Oracle數(shù)據(jù)文件頭推進(jìn)SCN”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI