To take online backups using RMAN the database must be running in ARCHIVELOG mode.
To take Full Database backup using RMAN do the following
Assuming that the database is already running. Start RMAN by typing the following command
$ export ORACLE_SID=test
$ rman target system/manager nocatalog
Then RMAN will get connected to the database and it will show the following messages
Now to take Full database backup give the following command.
rman> backup database tag 'MyOnlineFullDBBackup';
The above command will take full database backup and it will store the backup in the directory mentioned in the DB_RECOVERY_FILE_DEST parameter
You can specify TAG option to identify the backup. It is optional and if you want you can leave it. If you do not explicitly specify a tag with the TAG parameter of the BACKUP command, then RMAN implicitly creates a default tag for backups .
The default format of the tag is TAGYYYYMMDDTHHMMSS,
YYYY = year
MM = month
DD = day
HH = hour (24-hour format)
MM = minutes
SS = seconds
In this article we have learnt how to take backup of full database. By default RMAN takes the backup as BACKUPSETS i.e. it combines of multiple datafiles into one backupset.
And in backupset RMAN just backups the occupied blocks of each datafile leaving aside empty blocks.
For example, if you have a datafile 'users.dbf' of size 500M and in this file the data is only upto 300M and 200M is empty, then when you take the backup of this file as backupset, RMAN will only copy 300M leaving aside empty blocks. Thus in this way the backup size will be small and it will take less time also.
You can also take the backup of archive log files along with the full database by giving the following command
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
The above command backs up the database, switches the online redo logs, and includes archived logs in the backup
Instead of creating backupsets you can also ask RMAN to take IMAGE backups. Image backups means copy the datafile as it is. Follow the link for more information How to take image backups in RMAN
Similarly you can also take partial backups of particular tablespaces or particular datafiles. How to take online backup of particular tablespaces or datafiles