RMAN Incremental Level 0 Database Backup Scripts in Oracle
In this article, we are going to prepare a script for RMAN Incremental Level 0 (L0) database backup which includes backup of datafiles (L0), control files, spfile along with archives.
RMAN incremental backups back up only datafile blocks that have changed since a specified previous backup. You can make incremental backups of databases, individual tablespaces, or datafiles. A level 0 incremental backup, which is the base for subsequent incremental backups, copies all blocks containing data, backing the datafiles up into a backup set just as a full database backup.
Generally, we do take backup of the database every day as scheduled and business continuity either FULL or INCREMENTAL but sometimes also we do take backup manually whenever require like prior to schedule activities, migration/restore purpose, before the upgrade, etc. In this demonstration, we will prepare RMAN Incremental Level 0 (L0) scripts which will create a backup in a specified location (local directory) on the database server and also in Flash Recovery Area (FRA).
OPTION 01: Incremental LEVEL 0 (L0) command to take database backup using RMAN utility in a specified location (local directory) on the database server, click here for the complete output of the command.
RMAN> run
{
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK FORMAT '/oradata/backup/LABDBDUP/labdbdup_%U';
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK FORMAT '/oradata/backup/LABDBDUP/labdbdup_%U';
BACKUP tag 'INCR0_DB' INCREMENTAL LEVEL=0 DATABASE PLUS ARCHIVELOG;
BACKUP CURRENT CONTROLFILE TAG 'INCR0_CTL' FORMAT '/oradata/backup/LABDBDUP/labdbdupCTL_%U';
BACKUP SPFILE TAG 'INCR0_SPFILE' FORMAT '/oradata/backup/LABDBDUP/labdbdupSPF_%U';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
}
$ cd /oradata/backup/LABDBDUP/
$ ls -lrt
OPTION 02: Incremental LEVEL 0 (L0) command to take database backup using RMAN utility in Flash Recovery Area (FRA) on the database server, click here for the complete output of the command.
RMAN> run
{
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK;
BACKUP tag 'INCR0_DB' INCREMENTAL LEVEL=0 DATABASE PLUS ARCHIVELOG;
BACKUP CURRENT CONTROLFILE TAG 'INCR0_CTL';
BACKUP SPFILE TAG 'INCR0_SPFILE';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
}
cd /oradata/LABDBDUP/FRA/LABDBDUP/autobackup/2021_09_27/
$ ls -lrt
We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.
Hope so you like this script!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.
Related Articles
- Solution for ORA-01516: nonexistent log file, data file, or temporary file in Oracle
- Solution for RMAN-05541: no archived logs found in target database in Oracle
- Steps to Clone Oracle Database from Windows to Oracle Linux
- Clone PDB to another CDB using RMAN Active Duplicate in Oracle on New Host
- RMAN Incremental Level 1 Differential and Cumulative Database Backup Scripts in Oracle
As specified in Option 2, I am using FRA location yet backup is going to $ORACLE_HOME/dbs.
How to rectify it.
Hi….
Please share the output of below in an email:
1. Generate pfile
2. Complete log/output of RMAN script