You will find here what you need to known before beginning with Rman. We will each time begin with simple things, and if you want more information, I'll provide a link if possible…
Creating incremental backup with rman
Restoring a full database to another host
Finding internal nummer identifier of datafile
Introduction
I'll explain in this section, how you can do an hot backup of your oracle database. I means without putting it offline, really usefull with all the actual SLA that need to have a high level of uptime.
Rman stands for :
Recovery manager
It is an utility integrated with Oracle database, like Dataguard or Oracle Enterprise Manager.
We will now configure our rman configuration, which means :
- where to backup
- how to backup
- …
To enter in the rman prompt, and enter a command, simply do :
$ rman target /
with oracle user on linux/unix system.
If you got more than one database, you will be connected with the database that you set in your environment. So, look at this variable :
ORACLE_SID
If you don't add the words :
target /
to the rman command, you can always join the database of your ORACLE_SID. So, enter :
$ rman
and then join the database with :
RMAN> connect target /
That's it, you are now in rman, to view the current setting of rman, let's simply do this :
RMAN> show all;
You will see probably something like this :
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/opt/oracle/backup-rman/cf-%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/10.2/dbs/snapcf_db.f'; # default
But most important things, before doing any online backup of the database, you have to first put the database in archivelog mode, it will probably the case if you have a production database.
You need to do the following command with sysdba privilege.
Archive log mode
To put a database in archivelog mode, it first need to be in mount state, we cannot put a database in archivelog when it is operating online !
So, first check in which mode are open the database :
SQL> select status from v$instance;
And according to what you receive at your screen, follow the indication below :
If the database is online, you got probably something like that :
SQL> select status from v$instance;
STATUS
------------
OPEN
If you are in this case, you first need to shutdown the database :
SQL>shutdown;
and then startup the database in mount mode :
SQL> startup mount;
and you can now put the database in archivelog mode :
SQL> alter database archivelog;
and get back the database in open mode, to be available for use by others :
SQL> alter database open;