20 May, 2013

BACKUP CURRENT CONTROLFILE creates a Snapshot Controlfile

A short post today.

Recently, there was a discussion on forums about when a Snapshot controlfile is created.  It is known that the snapshot controlfile is created to re-synchronise with the Catalog.

But in my test database environment, I don't use a Catalog.  I only use the controlfile (and backups of it).

One poser said that he ran BACKUP DATABASE followed by BACKUP CURRENT CONTROLFILE. He asked if the same snapshot controlfile was used [through the two commands].  I pointed out that since they were two *separate* BACKUP calls, Oracle would create a separate Snapshot Controlfile for the second BACKUP command.

Here is a simple demo (note : I don't use a Catalog)

First the current state of the directory ($ORACLE_HOME/dbs in my case) where the Snapshot Controlfile would be created :

[oracle@localhost dbs]$ pwd
[oracle@localhost dbs]$ date
Mon May 20 08:17:46 PDT 2013
[oracle@localhost dbs]$ ls -ltr|tail -3
-rw-r----- 1 oracle oracle 1536 Oct  2  2010 orapworcl
-rw-rw---- 1 oracle oracle 1544 May 20 08:16 hc_orcl.dat
-rw-r----- 1 oracle oracle 3584 May 20 08:16 spfileorcl.ora
There is no snapshot currently present.


[oracle@localhost dbs]$ rman target /

Recovery Manager: Release - Production on Mon May 20 08:17:53 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1229390655)

RMAN> backup current controlfile;

Starting backup at 20-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=69 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 20-MAY-13
channel ORA_DISK_1: finished piece 1 at 20-MAY-13
piece handle=/home/oracle/app/oracle/flash_recovery_area/ORCL/backupset/2013_05_20/o1_mf_ncnnf_TAG20130520T081800_8snhob80_.bkp tag=TAG20130520T081800 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-MAY-13

RMAN> quit

Recovery Manager complete.
The controlfile backup got written to the FRA.

 Is there a snapshot controlfile ?

[oracle@localhost dbs]$ ls -ltr|tail -3
-rw-rw---- 1 oracle oracle    1544 May 20 08:16 hc_orcl.dat
-rw-r----- 1 oracle oracle    3584 May 20 08:16 spfileorcl.ora
-rw-rw---- 1 oracle oracle 9748480 May 20 08:18 snapcf_orcl.f
[oracle@localhost dbs]$ 
Yes, a snapshot controlfile did get created !