Welcome to oracle virtual classroom where we simplify your understanding of all thing Oracle Software related. We hope you would join us on this journey as we proceed. Today we will be starting off with how to back up your control file using RMAN (oracle's recovery manager). What is a control file in the first place and why do we need to back it up?
Well for starters the control file in an oracle database stores the status of the physical structure of the database.
The control file is a critical aspect of the database, without it the database will not continue its operations and that is the last thing you want to happen to your database.
So here is how your would use rman controfile backup to make a copy of your control file in case your end up with a corrupt file, you will be able to restore your database.
First off connect to RMAN via the command line
- $ rman
RMAN> connect target user/password
RMAN> connect catalog user/password - To back up the whole database:
RMAN> backup database; * if you want back up the database to a specific file use: RMAN> BACKUP DATABASET FORMAT ‘/backup/oracle/%d-%T-%s-%P’;
Notice that the formatting of this information varies by platform.
%d The name of the database.
%D The current day of the month (in format DD)
%M The month (format MM)
%Y The year (YYYY)
%T The year, month, and day (YYYYMMDD)
%F Combination of DBID, day, month, year, and sequence
%p The piece number within the backup set.
%s The backup set number.
%t The backup set time stamp, which is a 4-byte value
RMAN> backup controlfile;
You can also set the database to backup the file automatically that way you need to constantly worry about the file and here is how you would do that
Configuring RMAN to Automatically Backup the Control File and SPFILE
Simply setCONFIGURE CONTROLFILE AUTOBACKUP
to ON
, then RMAN automatically creates a control file and an SPFILE backup after you run the BACKUP
or COPY
commands.
0 comments:
Post a Comment