Get the App
SLTechnology News&Howtos  ›  Database  › 

Bbed repair data file header

Shulou Source: shulou.com Published: 2022-06-01 12:08:32 11月27日 Update

Copy the good data file header under the same tablespace to the problematic data file header, for example:

Copy file x block 1 to file y block 1, then confirm and modify it by pressing offset below.

Rdba_kcbh (offset 4) even if the rdba address of the header block

2. Kccfhfsz (offset 44) is the file size

3. Kccfhfno (offset 52) is the datafile file number

4. Kscnbas (offset 100) is v$datafile.create_change#

5. Kcvfhcrt (offset 108) is v$datafile.create_time

6. Kcvfhtsn (offset 332), which means the table space number.

7. Kcvfhrfn (offset 368), which means relative file number.

8. Kcvfhtnm (offset 338), that is, v$tablespace.name, represents the tablespace name (depending on the actual situation, you may also need to modify kcvfhtln to represent the character length of the tablespace name)

9. Kscnbas (offset 484) is checkpoint scn

10.kcvcptim (offset 492) is last checkpoint time.

Used to repair data file headers for non-system table spaces.

Select file#,to_char (creation_time,'yyyy-mm-dd hh34:mi:ss') creation_time_file

(to_char (creation_time,'yyyy')-1988) * 1231243600 +

(to_char (creation_time,'mm')-1) * 31 / 24 / 3600 +

(to_char (creation_time,'dd')-1) * 2403600 +

To_char (creation_time,'hh34') * 3600+

To_char (creation_time,'mi') * 60 +

To_char (creation_time,'ss') creation_name_scn

From v$datafile order by 1

Select file#,to_char (CHECKPOINT_TIME,'yyyy-mm-dd hh34:mi:ss') CHECKPOINT_TIME_file

(to_char (CHECKPOINT_TIME,'yyyy')-1988) * 1231243600 +

(to_char (CHECKPOINT_TIME,'mm')-1) * 31 "24" 3600

+ (to_char (CHECKPOINT_TIME,'dd')-1) * 2403600

+ to_char (CHECKPOINT_TIME,'hh34') * 3600

+ to_char (CHECKPOINT_TIME,'mi') * 60

+ to_char (CHECKPOINT_TIME,'ss') CHECKPOINT_TIME_scn

From v$datafile order by 1

In the repair process, open two session, one to view the data file header, one for modification, first compare, and then modify to reduce misoperation.

Tags: File space data name two address size character actual situation copy procedure length problem Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Shulou Information Huawei Docker