Backing up Oracle Database using RMAN in background :HOT Backup( Database in Archive log mode) :1. Create a RCV file for backup.
[cognos@rac1 ~]$ vi compressed_bkp_20_OCT_12.rcv
contents inside this file :run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
allocate channel t5 type disk;
sql 'alter system archive log current';
backup as compressed backupset database plus archivelog delete input format
'/backup/BKPSETS_20OCT12_%U' filesperset 8;
backup as compressed backupset format '/backup/BKPSETS_20OCT12_CONTROLFILE_%U'
current controlfile;
release channel t1;
release channel t2;
release channel t3;
release channel t4;
release channel t5;
}
2. create a new file backup.
[cognos@rac1 ~]$ vi rman_hotbackup.sh
contents inside this file
cd
. ./.bash_profile
rman target / cmdfile=compressed_bkp_20_OCT_12.rcv log=backup_20_OCT_12.log << EOF
exit
3. Run this file from oracle user prompt to start backup
[cognos@rac1 ~]$ sh rman_hotbackup.sh >> rman_hotbackup.txt &
COLD Backup( Database in NOArchive log mode) :1. create a RCV file for backup.
[cognos@rac1 ~]$ vi compressed_bkp_20_OCT_12.rcv
contents inside this file :-
run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
allocate channel t5 type disk;
backup as compressed backupset database format '/backup/BKPSETS_20OCT12_%U'
filesperset 8;
backup as compressed backupset format '/backup/BKPSETS_20OCT12_CONTROLFILE_%U'
current controlfile;
release channel t1;
release channel t2;
release channel t3;
release channel t4;
release channel t5;
}
2. create a new file backup.
[cognos@rac1 ~]$ vi rman_coldbackup.sh
contents inside this file
cd
. ./.bash_profile
rman target / cmdfile=compressed_bkp_20_OCT_12.rcv log=backup_20_OCT_12.log << EOF
exit
3. Run this file from oracle user prompt to start backup
[cognos@rac1 ~]$ sh rman_coldbackup.sh >> rman_coldbackup.txt &
NOTE :-- For taking Cold backup(Consistent backup) through RMAN database must be in
MOUNT mode.
Backup of only Archive logs through RMAN :1. Backup all Archive logs :[cognos@rac1 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Oct 20 18:35:40 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1318569746)
RMAN> run
{
allocate channel t1 type disk;
allocate channel t2 type disk;