SQL> create tablespace rm_tbs datafile 'f1.dbf' size 10m;

Tablespace created.

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

[oracle@VSZ-ORCLE-jftest ~]$ rm /home/oracle/product/10g/dbs/f1.dbf

[oracle@VSZ-ORCLE-jftest ~]$ exit

exit

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

 13  /home/oracle/product/10g/dbs/f1.dbf

13 rows selected.

SQL> alter tablespace rm_tbs add datafile 'f2.dbf' size 10m;

Tablespace altered.

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

13 /home/oracle/product/10g/dbs/f1.dbf

14 /home/oracle/product/10g/dbs/f2.dbf

14 rows selected.

SQL> shutdown immediate

ORA-03113: end-of-file on communication channel

[oracle@VSZ-ORCLE-jftest ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jul 25 09:37:29 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 2147483648 bytes

Fixed Size                  2097656 bytes

Variable Size             654315016 bytes

Database Buffers         1476395008 bytes

Redo Buffers               14675968 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 13 - see DBWR trace file

ORA-01110: data file 13: '/home/oracle/product/10g/dbs/f1.dbf'

SQL>       

SQL> select file#||' '||name||' '||bytes from v$datafile;

11 /home/oracle/product/10g/dbs/datafile2.dbf 10485760

12 /home/oracle/product/10g/dbs/system_audit_01.dbf 104857600

13 /home/oracle/product/10g/dbs/f1.dbf 10485760

14 /home/oracle/product/10g/dbs/f2.dbf 10485760

Database mounted.

ORA-01122: database file 13 failed verification check

ORA-01110: data file 13: '/home/oracle/product/10g/dbs/f1.dbf'

ORA-01204: file number is 14 rather than 13 - wrong file

############################## bbed --rdba_kcbh

BBED> map /v

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                                     Dba:0x03400001     --正确数据

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

BBED> p kcvfhbfh

struct kcvfhbfh, 20 bytes                   @0      

   ub1 type_kcbh                            @0        0x0b

   ub1 frmt_kcbh                            @1        0xa2

   ub1 spare1_kcbh                          @2        0x00

   ub1 spare2_kcbh                          @3        0x00

   ub4 rdba_kcbh                            @4        0x03800001   --错误数据:

ub4 bas_kcbh                             @8        0x00000000

   ub2 wrp_kcbh                             @12       0x0000

   ub1 seq_kcbh                             @14       0x01

   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)

   ub2 chkval_kcbh                          @16       0xd060

   ub2 spare3_kcbh                          @18       0x0000

BBED> sum apply

Check value for File 13, Block 1:

current = 0xd0a0, required = 0xd0a0

############################## bbed --kcvfhrfn

BBED> show

FILE#           13

        BLOCK#          1

        OFFSET          368

        DBA             0x03400001 (54525953 13,1)

        FILENAME        /home/oracle/product/10g/dbs/f1.dbf

        BIFILE          bifile.bbd

        LISTFILE        /home/oracle/hjbbed/bbedlist

        BLOCKSIZE       8192

MODE            Edit

        EDIT            Unrecoverable

        IBASE           Dec

        OBASE           Dec

        WIDTH           80

        COUNT           512

        LOGFILE         log.bbd

        SPOOL           No

BBED> dump

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:  368 to  879           Dba:0x03400001

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

 0e000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 00000000 00000000 00000000 00000000 3892b92a 01000000 00000000 00000000

BBED> modify /x 0d

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:  368 to  879           Dba:0x03400001

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

 0d000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 00000000 00000000 00000000 00000000 3892b92a 01000000 00000000 00000000

BBED> sum apply

Check value for File 13, Block 1:

current = 0xd0a3, required = 0xd0a3

############################## bbed --kccfhfno

BBED> p kcvfhhdr

struct kcvfhhdr, 76 bytes                   @20     

   ub4 kccfhswv                             @20       0x00000000

   ub4 kccfhcvn                             @24       0x0a200500

   ub4 kccfhdbi                             @28       0x07e116ae

   text kccfhdbn[0]                         @32      T

   text kccfhdbn[1]                         @33      E

   text kccfhdbn[2]                         @34      X

   text kccfhdbn[3]                         @35      T

text kccfhdbn[4]                         @36      

   text kccfhdbn[5]                         @37      

   text kccfhdbn[6]                         @38      

   text kccfhdbn[7]                         @39      

   ub4 kccfhcsq                             @40       0x000091ad

   ub4 kccfhfsz                             @44       0x00000500

   s_blkz kccfhbsz                          @48       0x00

   ub2 kccfhfno                             @52       0x000e

############################## bbed --kscnbas  


BBED> modify /x 0d

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

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:   52 to  563           Dba:0x03400001

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

 0d000300 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 

 BBED> p kcvfhcrs

struct kcvfhcrs, 8 bytes                    @100    

   ub4 kscnbas                              @100      0x01addf00

   ub2 kscnwrp                              @104      0x0000

BBED>   set offset 100

        OFFSET          100

BBED> dump

File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:  100 to  611           Dba:0x03400001

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

 00dfad01 00000000 378ee432 b01a642f a9ec0500 00000000 00000000 00000000

 00000000 00000400 02000000 00000000 01000000 00000000 00000000 00000000

BBED> modify /x cc 

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:  100 to  611           Dba:0x03400001

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

 ccdfad01 00000000 378ee432 b01a642f a9ec0500 00000000 00000000 00000000

 

BBED> sum apply

############################## bbed --kscnbas


 

SQL> alter database datafile 13 online;

alter database datafile 13 online

*

ERROR at line 1:

ORA-01122: database file 13 failed verification check

ORA-01110: data file 13: '/home/oracle/product/10g/dbs/f1.dbf'

ORA-01202: wrong incarnation of this file - wrong creation time

############################## bbed --kcvfhcrt

BBED> p kcvfhcrt

ub4 kcvfhcrt                                @108      0x32e48e37

BBED> set offset 108

        OFFSET          108

BBED> dump

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

Block: 1                Offsets:  108 to  619           Dba:0x03400001

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

 378ee432 b01a642f a9ec0500 00000000 00000000 00000000 00000000 00000400

 02000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000

BBED> modify /x 8d

 File: /home/oracle/product/10g/dbs/f1.dbf (13)

 Block: 1                Offsets:  109 to  620           Dba:0x03400001

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

 8de432b0 1a642fa9 ec050000 00000000 00000000 00000000 00000000 00040002

 00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000

 BBED> sum apply

Check value for File 13, Block 1:

current = 0xd2b3, required = 0xd2b3

SQL> select file#,to_char(creation_time,'yyyymmdd hh24miss') from v$datafile;

12 20140709 153030

        13 20140725 093536

        14 20140725 093655

SQL>  alter database datafile 13 online;

    alter database datafile 13 online

ERROR at line 1:

ORA-01113: file 13 needs media recovery if it was restored from backup, or END 【不重新启动server可能没这个问题】

BACKUP if it was not

ORA-01110: data file 13: '/home/oracle/product/10g/dbs/f1.dbf'

SQL> recover datafile 13;

Media recovery complete.

SQL> alter database datafile 13 online;

Database altered.

--时间信息换算例如以下:

SELECT TO_NUMBER('32e48e37','XXXXXXXX')  from dual

853839415  --十进制

26 06 24 09 36 55--差异天数

时间原来这样算

select 26*12*31*24*60*60 --年

       +6*31*24*60*60+   --月

       24*24*60*60+      --天

       9*60*60+          --小时

       36*60             --分钟

       +55 from dual    --s

20140725 093536

26 06 24 09 35 36--差异天数

select 26*12*31*24*60*60 --年

       +6*31*24*60*60+   --月

       24*24*60*60+      --天

       9*60*60+          --小时

       35*60             --分钟

       +36 from dual    --s

853839336

select to_char(853839336,'XXXXXXXX') from dual          -- 32E48DE8  文件13创建时间

select to_char(853839415,'XXXXXXXX') from dual          -- 32E48E37

SELECT TO_NUMBER('32E48DE8','XXXXXXXX')  from dual

853839336

---

01addf00

SELECT TO_NUMBER('01addf00','XXXXXXXX')  from dual

--28172032

select to_char(28172032,'XXXXXXXX') from dual

--1ADDF00

select to_char(28171980,'XXXXXXXX') from dual

-- 1ADDECC

--这个实验告诉我们,实验要自己做。做了才知道哪一步非常重要..

其它

须要调整的是:

ub4 rdba_kcbh                         @4      ---data block address

ub2 kccfhfno                          @52     ---file number

ub4 kscnbas                           @100    ---scn bas

ub4 kcvfhcrt                           @108    ---file create time

ub4 kcvfhrfn                           @368    ---reference file number

oracle data file header replace(測)的更多相关文章

  1. 改动file header (測)

    --改动file header ------------------------------------------------------------------------- cd $ORACLE ...

  2. Oracle bbed 实用示例-----File Header Reset

    一.查看当前环境 1.1 当前控制文件中的SCN号 [oracle@ora10 ~]$ sqlplus /nolog SQL :: Copyright (c) , , Oracle. All righ ...

  3. ORA-01578 ORACLE data block corrupted (file # 29, block # 2889087)

    BW数据库后台报错如下:F:\oracle\SBP\saptrace\diag\rdbms\sbp\sbp\trace ORA-01578: ORACLE data block corrupted ( ...

  4. 【Oracle】IMP-00010: not a valid export file, header failed verification

    别人给了一个Oracle文件,结果在导入的时候发现有问题,报错如下: IMP-00010: not a valid export file, header failed verification 在网 ...

  5. ORA-01146: cannot start online backup - file 1 is already in backup ORA-01110: data file 1: 'C:\ORACLE\ORADATA\ORCL8\SYSTEM01.DBF'

    问题: Error: [1146] ORA-01146: cannot start online backup - file 1 is already in backup ORA-01110: dat ...

  6. 【Oracle】ORA-01157: cannot identify/lock data file 201 - see DBWR trace file

    今天数据库在查询数据的时候显示了这个错误: ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: ...

  7. ORA-01578: ORACLE data block corrupted (file # 3, block # 1675)

    警告日志中发现如下报错信息: ORA-01578: ORACLE data block corrupted (file # 3, block # 1675)ORA-01110: data file 3 ...

  8. oracle 导入报错:field in data file exceeds maximum length

    今天用sqlldr导入数据时候报错: " Record 1: Rejected - Error on table ks_test, column khname.Field in data f ...

  9. 转 使用隐含Trace参数诊断Oracle Data Pump故障

    http://blog.itpub.net/17203031/viewspace-772718/ Data Pump数据泵是Oracle从10g开始推出的,用于取代传统exp/imp工具的数据备份还原 ...

随机推荐

  1. log4j 输入不同日志文件

    log4j的强大功能无可置疑,但实际应用中免不了遇到某个功能需要输出独立的日志文件的情况,怎样才能把所需的内容从原有日志中分离,形成单独的日志文件呢?其实只要在现有的log4j基础上稍加配置即可轻松实 ...

  2. Codeforces 811 A. Vladik and Courtesy

    A. Vladik and Courtesy   time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

  3. CF 834B The Festive Evening【差分+字符串处理】

    B. The Festive Evening time limit per test1 second memory limit per test256 megabytes inputstandard ...

  4. 洛谷P1095 绝地武士的逃离

    好吧原题是守望者的逃离,我强行改了一波题面,因为信仰=-=(? May the force be with us. 绝地跑步速度为17m/s,但无法逃离荒岛.绝地的原力恢复速度为4点/s,只有处在原地 ...

  5. 区间DP【p2858】[USACO06FEB]奶牛零食Treats for the Cows

    Description 约翰经常给产奶量高的奶牛发特殊津贴,于是很快奶牛们拥有了大笔不知该怎么花的钱.为此,约翰购置了N(1≤N≤2000)份美味的零食来卖给奶牛们.每天约翰售出一份零食.当然约翰希望 ...

  6. ASP.NET Core 2.2 基础知识(四) URL重写中间件

    说到URL重写就不得不提URL重定向. URL重定向 URL重定向是客户端操作,指示客户端访问另一个地址的资源.这需要往返服务器,并且当客户端对资源发出请求时,返回客户端的重定向URL会出现在浏览器的 ...

  7. 【莫比乌斯反演】BZOJ2920-YY的GCD

    [题目大意] 给定N, M,求1<=x<=N, 1<=y<=M且gcd(x, y)为质数的(x, y)有多少对. [思路] 太神了这道题……蒟蒻只能放放题解:戳,明早再过来看看 ...

  8. Java多线程——ReentrantLock源码阅读

    上一章<AQS源码阅读>讲了AQS框架,这次讲讲它的应用类(注意不是子类实现,待会细讲). ReentrantLock,顾名思义重入锁,但什么是重入,这个锁到底是怎样的,我们来看看类的注解 ...

  9. 一个强大的UI node 抽象

    基于cocos2d -x的一个强大的 界面对象的基类 ---@type uinode ui 对象的抽象 --@usage -- 界面打开的执行流程 -- 带*的是可选重写的函数,不带*的为必须实现的 ...

  10. HDU 1402 A * B Problem Plus (FFT求高精度乘法)

    A * B Problem Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...