6 Maintaining the Control File Objectives Explaining the

6 Maintaining the Control File

Objectives • Explaining the uses of the control file • Examining the contents of the control file • Obtaining the control file information • Multiplexing the control file 6 -2

Using the Control File • Small, binary file • Required: Control files • at mount • to operate Data files Redo log files Database 6 -3 • Linked to a single database • Multiplex it • Loss requires recovery • Max 8 allowed

The Contents of the Control File Database name and identifier Database creation date Data file location Redo log file location Tablespace information Current log sequence number Checkpoint information Log history Backup information 6 -4

Multiplexing the Control File control_files=(/DISK 1/control 01. con, /DISK 2/control 02. con) 6 -5 Disk 1 Disk 2 control 01. control 02. con

Guidelines for Control Files • You should: • multiplex the control files • include full path name in CONTROL_FILES • backup control file after db structure changes • Control files: • are sized by CREATE DATABASE command • have a reusable section 6 -6

Backing Up Control Files • Alter database backup controlfile to <filename> • Alter database backup controlfile to trace (creates a script that allows you to recreate the Control file; goes into user_dump_dest) • To multiplex: • shutdown database • modify parameter file to add a new control file • make a copy of current control file • startup 6 -7

Parameters Affecting the Size of the Control File The size of the control file is influenced by the following parameters: • MAXLOGFILES • MAXLOGMEMBERS • MAXLOGHISTORY • MAXDATAFILES • MAXINSTANCES 6 -8

Obtaining Information • V$CONTROLFILE - NAME • V$PARAMETER - NAME ( control_file) - VALUE • V$CONTROLFILE_RECORD_SECTION - TYPE - RECORDS_SIZE - RECORDS_TOTAL - RECORDS_USED 6 -9

Obtaining Information (cont. ) Select type, record_size, records_total, records_used From v$controlfile_record_section Where type = ‘DATAFILE’; 6 -10

Summary In this lesson, you should have learned: • the need for control files • the contents of control files • when it is needed • how to multiplex • backup when database structure changes 6 -11
- Slides: 11