Friday, May 8, 2009

Difference Controlfile and Backup Controlfile

Operations during backup controlfile.
--------------------------------------------------------------------------------
1) Enqueue control file resource is held on controlfile so that no changes happen.
2) Checkpoint and SCN is till the time of backup.
3) Copy of Controlfile.

There are mutilple ways to perform backup activity of controlfile.
1) Shutdown database and O/S Copy controlfile in different location.
2) Alter database backup controlfile to trace -- Create a text file.
3) Alter database backup controlfile to '######################';

When Database is offline(normal/Immediate), controlfile backup will be consistent and stop scn will be checkpoint scn.
When Database is offline(abort), controlfile backup will be consistent and stop scn will be set to infinity.
When Database is online , if we take backup of controlfile , controlfile will be consistent till that point in time and stop scn will be infinity.

How does Oracle know, wheather controlfile was backup controlfile.
1) Checkpoint is older then checkpoint value on datafile, if controlfile backup was older than datafile backup.
2) Filetype of backup controlfile is 4 , whereas filetype of controlfile is 1.


Dump of header of controlfiles. Online Controlfile
------------------------------------------------------------
Compatibility Vsn = 169869312=0xa200000
Db ID=1418608916=0x548e4114, Db Name='PRASAD1'
Activation ID=0=0x0
Control Seq=212=0xd4, File size=920=0x398
File Number=0, Blksiz=16384, File Type=1 CONTROL

Backup Controlfile
-------------------------------------------------------------
Compatibility Vsn = 169869312=0xa200000
Db ID=1418608916=0x548e4114, Db Name='PRASAD1'
Activation ID=0=0x0
Control Seq=215=0xd7, File size=920=0x398
File Number=0, Blksiz=16384, File Type=4 BACKUP CONTROL

Just for Info:
---------------------------------------------
FileType=1 === > CONTROLFILE
FileType=2 === > LOGFILE
FileType=3 === > DATAFILE
FileType=4 === > BACKUP CONTROLFILE
FileType=4 === > Futuristic use
FileType=6 === > TEMPFILE

No comments:

Post a Comment