Oracle 视图 V$DATAFILE_HEADER 官方解释,作用,如何使用详细说明

本站中文解释

V$DATAFILE_HEADER是Oracle数据库中的一个视图,它可以提供有关每个表空间数据文件的信息。可以回答的问题包括:每个表空间中有多少数据文件?每个数据文件的位置是什么?数据文件的大小?数据文件的状态是什么?

使用V$DATAFILE_HEADER视图的方法:

1、查询每个表空间中有多少数据文件:

SELECT TABLESPACE_NAME, COUNT(*) FROM V$DATAFILE_HEADER GROUP BY TABLESPACE_NAME;

2、查询每个数据文件的详细信息,包括位置、大小以及状态:

SELECT * FROM V$DATAFILE_HEADER;

官方英文解释

V$DATAFILE_HEADER displays data file information from the data file headers.

Column Datatype Description

FILE#

NUMBER

Data file number (from control file)

STATUS

VARCHAR2(7)

ONLINE | OFFLINE (from control file)

ERROR

VARCHAR2(18)

NULL if the data file header read and validation were successful. If the read failed then the rest of the columns are NULL. If the validation failed then the rest of columns may display invalid data. If there is an error then usually the data file must be restored from a backup before it can be recovered or used.

FORMAT

NUMBER

Indicates the format for the header block. The possible values are 6, 7, 8, 10 or 0.

6 – indicates Oracle Version 6

7 – indicates Oracle Version 7

8 – indicates Oracle Version 8

10 – indicates Oracle Version 10

0 – indicates the format could not be determined (for example, the header could not be read)

RECOVER

VARCHAR2(3)

File needs media recovery (YES | NO)

FUZZY

VARCHAR2(3)

File is fuzzy (YES | NO)

CREATION_CHANGE#

NUMBER

Data file creation change#

CREATION_TIME

DATE

Data file creation timestamp

TABLESPACE_NAME

VARCHAR2(30)

Tablespace name

TS#

NUMBER

Tablespace number

RFILE#

NUMBER

Tablespace relative data file number

RESETLOGS_CHANGE#

NUMBER

Resetlogs change#

RESETLOGS_TIME

DATE

Resetlogs timestamp

CHECKPOINT_CHANGE#

NUMBER

Data file checkpoint change#

CHECKPOINT_TIME

DATE

Data file checkpoint timestamp

CHECKPOINT_COUNT

NUMBER

Data file checkpoint count

BYTES

NUMBER

Current data file size in bytes

BLOCKS

NUMBER

Current data file size in blocks

NAME

VARCHAR2(513)

Data file name

SPACE_HEADER

VARCHAR2(40)

Represents the block address of a space file header block of a locally managed data file

LAST_DEALLOC_CHANGE#

VARCHAR2(16)

Last deallocated SCN

UNDO_OPT_CURRENT_CHANGE#

VARCHAR2(40)

For internal use only

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

IS_SPARSE

VARCHAR2(3)

Indicates whether the file is sparse (YES) or not (NO)

ENCRYPTED

VARCHAR2(3)

After file encryption is completed, this column indicates whether the file is encrypted (YES) or not (NO).

When file encryption is still in progress, this column has a value of NO.


数据运维技术 » Oracle 视图 V$DATAFILE_HEADER 官方解释,作用,如何使用详细说明