Monday, August 25, 2008

Oracle Control File Contents

An Oracle control file contains information about the associated database that is required for access by an instance, both at startup and during normal operation. Control file information can be modified only by Oracle; no database administrator or user can edit a control file.

Among other things, a control file contains information such as:

The database name

The timestamp of database creation

The names and locations of associated datafiles and redo log files

Tablespace information

Datafile offline ranges

The log history

Archived log information

Backup set and backup piece information

Backup datafile and redo log information

Datafile copy information

The current log sequence number

Checkpoint information

The database name and timestamp originate at database creation. The database name is taken from either the name specified by the DB_NAME initialization parameter or the name used in the CREATE DATABASE statement.

Each time that a datafile or a redo log file is added to, renamed in, or dropped from the database, the control file is updated to reflect this physical structure change. These changes are recorded so that:

Oracle can identify the datafiles and redo log files to open during database startup

Oracle can identify files that are required or available in case database recovery is necessary

Therefore, if you make a change to the physical structure of your database (using ALTER DATABASE statements), then you should immediately make a backup of your control file.

Control files also record information about checkpoints. Every three seconds, the checkpoint process (CKPT) records information in the control file about the checkpoint position in the redo log. This information is used during database recovery to tell Oracle that all redo entries recorded before this point in the redo log group are not necessary for database recovery; they were already written to the datafiles.

V$CONTROLFILE displays the names of the control files.

select * from V$CONTROLFILE;

STATUS

NAME

IS_RECOVERY_DEST_FILE

BLOCK_SIZE

FILE_SIZE_BLKS

/fs/u03/oracle_data/mydb/control01.ctl

NO

16384

2886

/fs/u03/oracle_data/ mydb/control02.ctl

NO

16384

2886

/fs/u03/oracle_data/ mydb/control03.ctl

NO

16384

2886

V$CONTROLFILE_RECORD_SECTION displays information about the control file record sections.

select * from V$CONTROLFILE_RECORD_SECTION;

TYPE

RECORD_

SIZE

RECORDS_

TOTAL

RECORDS_

USED

FIRST_

INDEX

LAST_

INDEX

LAST_

RECID

DATABASE

316

1

1

0

0

0

CKPT PROGRESS

8180

4

0

0

0

0

REDO THREAD

256

1

1

0

0

0

REDO LOG

72

20

15

0

0

128

DATAFILE

428

798

512

0

0

2166

FILENAME

524

2809

554

0

0

0

TABLESPACE

68

300

124

0

0

159

TEMPORARY FILENAME

56

300

38

0

0

95

RMAN CONFIGURATION

1108

50

2

0

0

6

LOG HISTORY

56

20450

20450

5005

5004

376730

OFFLINE RANGE

200

584

0

0

0

0

ARCHIVED LOG

584

20309

20309

17993

17992

376739

BACKUP SET

40

4090

4090

3525

3524

192073

BACKUP PIECE

736

3734

3734

627

626

192073

BACKUP DATAFILE

116

5076

5076

3352

3351

275904

BACKUP REDOLOG

76

14636

14636

11204

11203

329751

DATAFILE COPY

660

619

260

1

260

260

BACKUP CORRUPTION

44

371

0

0

0

0

COPY CORRUPTION

40

409

0

0

0

0

DELETED OBJECT

20

65535

65535

9906

9905

794594

PROXY COPY

852

652

0

0

0

0

BACKUP SPFILE

36

454

136

1

136

136

DATABASE INCARNATION

56

292

1

1

1

1

FLASHBACK LOG

84

2048

0

0

0

0

RECOVERY DESTINATION

180

1

0

0

0

0

INSTANCE SPACE RESERVATION

28

1055

1

0

0

0

REMOVABLE RECOVERY FILES

32

1000

0

0

0

0

RMAN STATUS

116

1128

1128

538

537

17880

THREAD INSTANCE NAME MAPPING

80

1

1

0

0

0

MTTR

100

1

1

0

0

0

DATAFILE HISTORY

568

57

0

0

0

0

STANDBY DATABASE MATRIX

400

10

10

0

0

0

GUARANTEED RESTORE POINT

212

2048

0

0

0

0

RESTORE POINT

212

2083

0

0

0

0

Oracle dynamic performance views

No comments:

Post a Comment