DBPedias

All your database knowledge are belong to you

Oracle

Wait Events - control file single write

control file single write

This wait is signaled while the control file's shared information is written to disk. This is an atomic operation protected by an enqueue (CF), so that only one session at a time can write to the entire database.

Control file is used as a single point of synchronization in the database. The control file is updated whenever there is a structural change in the database, such as, adding a tablespace or a data file, recovery related operations like checkpoint and log switching, and the regular database maintenance operations like startup and shutdown. Few operations like adding a data file or tablespace will require the controlfile transaction CF enqueue in exclusive mode. During that time the other processes, which require the enqueue at the same or higher level will wait until 15 minutes and retry the operation. The timeout can be defined by the parameter _controlfile_enqueue_timeout, which defaults to 900 seconds.

Contention for CF enqueue may affect the database operations in the RAC environment, as the enqueue is deadlock sensitive. The following list gives the common operations which require the CF enqueue and respective modes required.

Operation

Mode held

switching logfiles

exclusive

updating checkpoint information for datafiles

exclusive

opening a logfile for redo reading during recovery

shared

Getting information to perform archiving

shared

performing crash recovery

exclusive

performing instance recovery

exclusive

performing media recovery

exclusive

creating a database

exclusive

mounting a database

shared

Closing a database

shared

Adding a logfile or logfile member

exclusive

dropping a logfile or logfile member

exclusive

checking information about logfile group members

shared

Adding /dropping a new datafiles

exclusive

beginning/ending a hot backup

exclusive

checking to see, after a crash, whether datafiles are in hot backup mode(first shared, then exclusive)

shared

executing a ALTER DATABASE BACKUP CONTROLFILE TO TRACE

shared

opening the database (controlfile)exclusive by first instance to open, shared by subsequent instances.

exclusive

renaming datafiles or logfiles

exclusive

marking a controlfile as valid and mountable

exclusive

handling an error encountered in the controlfile

exclusive

validating data dictionary entries against matching controlfile records for file entries

exclusive

updating controlfile format after a software upgrade

exclusive

scanning for log file info by log sequence #

shared

finding the highest in use entry of a particular controlfile record type

shared

getting information about the number of log entries and their lowest/highest sequence number and log file numbers

shared

looking up a controlfile record matching a given filename

shared

Making a backup controlfile

exclusive

dumping the contents of the controlfile during debugging

shared

dumping contents of a current redo logfile during debugging

shared

dumping contents of redo log header

shared

dumping contents of datafile headers

shared

In general, contention at CF enqueue may be an indication of slower IO subsystem/device. Excessive waits and timeouts for this enqueue sometimes terminate the instance with ORA600 [2103] especially when it has waited for the background process for checkpoint. Another reason for contention for this enqueue is the number of data files. With fewer data files, the checkpoint process has less workload. Having more db_writers or enabling the asynchronous IO will be of some use to reduce the number of waits for this enqueue. Wait Time:

The wait time is the elapsed time of the write.

Parameter

Description

file#

This identifies the control file to which the session is currently writing.

block#

Block number in the control file where the write begins. The block size is the as the physical block size of the port (usually 512 bytes, some UNIX ports have 1 or 2 Kilobytes).

blocks

The number of blocks that the session is trying to read.