Logo ← PostgreSQL Blog

Rman Backup Oracle 19c

# su oracle $ . oraenv ORACLE_SID = [oracle] ? ccbs The Oracle base has been set to /u01/app/oracle $ sqlplus / as sysdba SQL> SHUTDOWN…

Mastering RMAN Backups in Oracle 19c: A Comprehensive Guide

Oracle Recovery Manager (RMAN) is a powerful tool that offers backup and recovery capabilities for Oracle databases. In Oracle 19c, RMAN continues to be an essential component for database administrators to ensure data protection and availability. In this article, we’ll delve into the intricacies of RMAN backups in Oracle 19c and explore the commands for performing various types of backups.

Setting the Environment

Before executing RMAN commands, it’s crucial to set the Oracle environment variables and initialize the environment. Here’s how you can do it:

# Switch to the oracle user
$ su oracle
# Initialize the Oracle environment
$ . oraenv
ORACLE_SID = [oracle] ? ccbs
The Oracle base has been set to /u01/app/oracle

Performing RMAN Backups

Once the environment is set up, you can proceed with executing RMAN commands for backups. Below are the RMAN commands to perform different types of backups:

# Start SQL*Plus as sysdba
$ sqlplus / as sysdba
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP MOUNT
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
SQL> ARCHIVE LOG LIST
SQL> exit
# Start RMAN and perform backups
$ rman target /
RMAN> backup database format '/backup/full/%d_%t_%s.rman';
RMAN> backup pluggable database cbs2 format '/backup/cbs1/%d_%t_%s.rman';
RMAN> backup tablespace system, users format '/backup/tablespace/%d_%t_%s.rman';
RMAN> BACKUP ARCHIVELOG ALL format '/backup/archive/%d_%t_%s.rman';
RMAN> BACKUP CURRENT CONTROLFILE format '/backup/controlfile/%d_%t_%s.rman';
RMAN> BACKUP ARCHIVELOG FROM TIME='SYSDATE-7' format '/backup/archive/son7/%d_%t_%s.rman';
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP format FOR DEVICE TYPE DISK TO '/backup/controlfile/auto/cf_%F.rman';
RMAN> BACKUP DATABASE format '/backup/ileri/dbf_%d_%t_%s.rman' TAG='DBF_CCEBI_20080620_1345';
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE format '/backup/ileri/dbf_%d_%t_%s.rman' TAG='kemal';

Key Takeaways

  • Database Backup: backup database command backs up the entire database.
  • Pluggable Database Backup: backup pluggable database command backs up a specific pluggable database.
  • Tablespace Backup: backup tablespace command backs up specific tablespaces like SYSTEM and USERS.
  • Archive Log Backup: BACKUP ARCHIVELOG ALL backs up all archived logs.
  • Controlfile Backup: BACKUP CURRENT CONTROLFILE backs up the current control file.
  • Point-in-Time Recovery: BACKUP ARCHIVELOG FROM TIME='SYSDATE-7' backs up archived logs from the last 7 days.
  • Controlfile Autobackup: CONFIGURE CONTROLFILE AUTOBACKUP configures RMAN to automatically back up the control file.

Conclusion

RMAN provides a comprehensive set of commands to perform various types of backups in Oracle 19c. Understanding these commands and incorporating them into your backup strategy is crucial for ensuring data protection and availability.

By mastering RMAN backups, you can leverage the full potential of Oracle 19c’s backup and recovery capabilities, thereby safeguarding your valuable data against potential disasters.

Happy backing up!