-
What Is RMAN in Oracle 19c?
-
Why Use Automated Backups in Oracle 19c?
-
Prerequisite: Verify and Enable ARCHIVELOG Mode
-
Method 1: Full Database Backup Script Example
-
Method 2: Incremental Backup Script Example
-
How to Back Up Oracle Databases With Vinchin Backup & Recovery?
-
Rman Backup Script Oracle 19c FAQs
-
Conclusion
Automating database backups is a top priority for any operations administrator managing Oracle 19c environments. Reliable backups protect against data loss from hardware failure, human error, or cyber threats. Oracle’s Recovery Manager (RMAN) is a powerful tool that helps you automate these critical tasks with precision and flexibility.
In this guide, you’ll learn what RMAN does in Oracle 19c, why automated backups are essential for business continuity, and how to create robust full and incremental backup scripts. We’ll walk through script examples step by step—from basic setup to advanced scheduling—so you can build a dependable backup routine tailored to your needs.
What Is RMAN in Oracle 19c?
RMAN stands for Recovery Manager. It is Oracle’s built-in utility designed specifically for backing up and restoring databases. Unlike manual file copies or ad-hoc tools, RMAN works directly with the database engine to ensure consistent backups—even when the database is open and active.
You can use RMAN interactively from the command line or automate it using scripts scheduled by system tools like cron. RMAN supports both local control file management (NOCATALOG mode) and external recovery catalogs (CATALOG mode), giving you options based on your environment size and complexity.
With features like block-level incremental backups, automatic corruption detection, archived redo log management, retention policies, and integration with tape libraries or disk storage systems (depending on configuration), RMAN forms the backbone of modern Oracle data protection strategies.
Why Use Automated Backups in Oracle 19c?
Manual backups are risky—they depend on people remembering every step at the right time. Automation removes that risk by ensuring regular execution according to your schedule. This consistency helps meet strict Recovery Point Objectives (RPOs) and Recovery Time Objectives (RTOs).
Automated RMAN scripts also enforce retention policies so old backups do not consume valuable storage space indefinitely. They capture all necessary files—including data files, control files, SPFILEs (server parameter files), and archived redo logs—making point-in-time recovery possible after unexpected failures.
A missed backup window could mean hours—or days—of lost work if disaster strikes. That’s why most organizations rely on scheduled jobs rather than manual intervention.
Prerequisite: Verify and Enable ARCHIVELOG Mode
Before running any online backup with RMAN in Oracle 19c, your database must be in ARCHIVELOG mode. This setting allows Oracle to archive filled redo logs before overwriting them—making point-in-time recovery possible even during heavy transaction loads.
To check if ARCHIVELOG mode is enabled:
1. Connect as SYSDBA using SQL*Plus:
sqlplus / as sysdba
2. Run:
ARCHIVE LOG LIST
If you see “Database log mode: Archive Mode,” you’re ready for online backups.
If not enabled:
Shut down the database:
SHUTDOWN IMMEDIATE
Start in mount mode:
STARTUP MOUNT
Enable archiving:
ALTER DATABASE ARCHIVELOG;
Open the database:
ALTER DATABASE OPEN;
Plan this change during a maintenance window since it requires downtime.
Method 1: Full Database Backup Script Example
A full database backup captures everything needed for complete restoration—data files, control files, SPFILEs, plus all archived redo logs generated during the process. This type of backup serves as the foundation for any reliable recovery plan.
Creating a Full Backup Command File
First, write an RMAN command file—for example named backup_level0.rman:
RUN {
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK;
BACKUP TAG 'INCR0_DB' AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG DELETE INPUT;
BACKUP CURRENT CONTROLFILE TAG 'INCR0_CTL';
BACKUP SPFILE TAG 'INCR0_SPFILE';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
}This script allocates two channels for parallelism—speeding up large databases—and performs an incremental level 0 backup (which acts as a full baseline). It includes all archived logs generated during the operation using PLUS ARCHIVELOG DELETE INPUT, which saves disk space by removing logs after they are safely backed up.
Building a Shell Script Wrapper
Next create a shell script—for example backup_rman.sh—to set environment variables correctly before calling RMAN:
#!/bin/bash
export ORACLE_SID=your_sid
export ORACLE_HOME=/path/to/oracle/home
export PATH=$PATH:$ORACLE_HOME/bin
LOG_DIR="/path/to/logs"
mkdir -p ${LOG_DIR}
rman target / log=${LOG_DIR}/rman_level0_$(date '+%Y%m%d_%H%M%S').log cmdfile=/path/to/backup_level0.rman
if [ $? -eq 0 ]; then
echo "Backup completed successfully at $(date)" >> ${LOG_DIR}/backup_summary.log
else
echo "Backup failed at $(date). Check rman log." >> ${LOG_DIR}/backup_summary.log
exit 1
fiReplace your_sid, paths to ORACLE_HOME, command file locations (cmdfile=...), and log directories as appropriate for your server layout.
This wrapper ensures proper logging of each run’s outcome—a best practice that makes troubleshooting easier later on.
Scheduling Regular Backups with Cron
To automate weekly full backups every Sunday at 2 AM:
0 2 * * 0 /path/to/backup_rman.sh
Add this line using crontab -e under your oracle user account so it runs unattended each week without manual intervention.
Method 2: Incremental Backup Script Example
Incremental backups save only changed blocks since previous backups—reducing both time spent backing up daily activity and total storage required over weeks or months compared to repeated fulls alone.
Most organizations combine weekly level 0 fulls with daily level 1 incrementals—a proven strategy balancing speed with safety.
Understanding Incremental Backup Strategies
RMAN supports two types of incremental level 1 backups:
Differential (default): Backs up blocks changed since last level 1 or level 0.
Cumulative: Backs up all blocks changed since last level 0 only; use keyword CUMULATIVE in your script if desired.
Choose differential when minimizing daily runtime matters most; choose cumulative when simplifying restores is more important.
Creating an Incremental Level 1 Command File
Write another command file called backup_level1.rman:
RUN {
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK;
BACKUP TAG 'INCR_L1_DB' AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 DATABASE PLUS ARCHIVELOG DELETE INPUT;
BACKUP CURRENT CONTROLFILE TAG 'INCR_L1_CTL';
BACKUP SPFILE TAG 'INCR_L1_SPFILE';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
}This script assumes a valid recent level 0 exists; otherwise restores may fail.
Modifying Your Shell Script For Daily Runs
Update your shell wrapper so it points to this new command file:
#!/bin/bash
export ORACLE_SID=your_sid
export ORACLE_HOME=/path/to/oracle/home
export PATH=$PATH:$ORACLE_HOME/bin
LOG_DIR="/path/to/logs"
mkdir -p ${LOG_DIR}
rman target / log=${LOG_DIR}/rman_level1_$(date '+%Y%m%d_%H%M%S').log cmdfile=/path/to/backup_level1.rman
if [ $? -eq 0 ]; then
echo "Incremental backup completed successfully at $(date)" >> ${LOG_DIR}/backup_summary.log
else
echo "Incremental backup failed at $(date). Check rman log." >> ${ LOG_DIR }/backup_summary.log
exit 1
fiAgain adjust paths as needed.
Scheduling Daily Incrementals With Cron
To run Monday through Saturday at 2 AM:
0 2 * * 1–6 /path/to/backup_rman.sh
Place this entry alongside your weekly job so both schedules operate together seamlessly.
How to Back Up Oracle Databases With Vinchin Backup & Recovery?
For organizations seeking streamlined enterprise-grade protection beyond scripting alone, Vinchin Backup & Recovery delivers comprehensive support for today’s leading databases—including first-class compatibility with Oracle 19c alongside MySQL, SQL Server, MariaDB, PostgreSQL, PostgresPro, and TiDB environments. Its feature set covers advanced source-side compression and incremental backup capabilities tailored specifically for Oracle workloads—as well as batch database backup operations, multi-level data compression options, and flexible retention policies—to optimize storage usage while maintaining compliance standards across diverse infrastructures. These powerful functions collectively enable faster job completion times while safeguarding critical business information throughout its lifecycle.
The intuitive web console makes managing complex tasks simple:
Step 1. Select the Oracle database to back up;

Step 2. Choose the desired backup storage location;

Step 3. Define custom strategies such as scheduling frequency or retention rules;

Step 4. Submit the job—all via just a few clicks from any browser interface.

Vinchin Backup & Recovery enjoys global recognition among enterprise users thanks to its robust security architecture and high customer satisfaction ratings worldwide. Try every feature free for 60 days—click below to download now!
Rman Backup Script Oracle 19c FAQs
Q1: How do I check if my current archive destination has enough free space?
A1: Query V$RECOVERY_FILE_DEST view or use OS commands like df -h on Unix/Linux systems where archive logs are stored.
Q2: Can I automate running different scripts across multiple SIDs?
A2: Yes; loop through SIDs in bash—for sid in SIDLIST; do export ORACLE_SID=sid && ./your_script.sh; done—with correct environment variables set per iteration.
Q3: How do I configure automatic deletion of obsolete archives?
A3: Set retention policy via CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF n DAYS then schedule DELETE OBSOLETE command regularly.
Conclusion
Automating regular Oracle 19c backups using robust RMAN scripts protects business-critical data against loss or corruption. For streamlined management, Vinchin delivers advanced yet easy-to-use solutions trusted worldwide. Try Vinchin free today—and safeguard every byte of your organization’s information assets!
Share on: