Search Oracle Blogs
Tuesday, January 30, 2007
Autobackup of SPFILE and CONTROLFILE
Even if you do not use
RMAN to take backups of your database, you might find it useful to
take snapshots of your SPFILE and CONTROLFILE automatically. You can
configure Recovery Manager (RMAN) to automatically create copies of
CONTROLFILE and SPFILE when you make changes to database such as:
If you use RMAN for backups it will create copy of SPFILE or CONTROLFILE also after each backup operation.
I've tested it on Oracle 10g (10.2) but it should work in Oracle since version 8i. Next time i'll write how to restore SPFILE or CONTROLFILE from these backup.
Cheers, Paweł
Update: How to restore CONTROLFILE and SPFILE from RMAN autobackups
- adding/dropping a new tablespace or datafile
- altering the state of a tablespace or datafile (online/offline/read only)
- adding a new online redo log,
- renaming a file
- adding a new redo thread
- and many more...
RMAN target=/or
RMAN target=sys/password@dbset directory and format of backup files:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\Backup\%F';In name of autbackup file you have to use %F. It will be expanded to C-XXXXXXXXX-YYYYMMDD-NN, where:
- XXXXXXXXX – database id
- YYYYMMDD – day, when backuped
- NN – change number during day, starts with 00, and represented in hexadecimal
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;Now autobackups are active, and every time you change database structure controlfile will be automatically backed up.
If you use RMAN for backups it will create copy of SPFILE or CONTROLFILE also after each backup operation.
I've tested it on Oracle 10g (10.2) but it should work in Oracle since version 8i. Next time i'll write how to restore SPFILE or CONTROLFILE from these backup.
Cheers, Paweł
Update: How to restore CONTROLFILE and SPFILE from RMAN autobackups
Subscribe to:
Post Comments (Atom)
4 comments:
you said: "it will create copy of SPFILE"
but where is it?
In the directory you have configured using CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ...
/Pawel
My RMAN configure:
configure controlfile autobackup format for device type disk to 'c:\backup\controlfile\%F'
but in this directory after i run backup database statement, there is only controlfile.
The file that was created contain backup of control file and spfile.
Check this using RMAN:
restore spfile to 'C:\newlocation\spfile_copy.ora' from autobackup;
/Pawel
Post a Comment