Oracle by Example brandingPerform and Schedule Backups

section 0Before You Begin

Select the Oracle Database release:

This 15-minute tutorial shows you how to perform different types of backups using RMAN.

What Do You Need?

  • Oracle Database 18c19c

section 1Perform a Whole Database Backup

You can use RMAN to perform a whole backup of your database. A whole backup includes the complete contents of all data files of the database, plus the control file, archived redo log files, and server parameter file. You can perform a complete recovery with the files from a whole backup.

  1. Invoke RMAN and connect to the target database as the SYSBACKUP user.
    $ rman target sysbackup
    
    Recovery Manager: Release 18.0.0.0.0 - Production on 
    Fri Mar 29 00:57:29 2019 Version 18.3.0.0.0 Copyright (c) 1982, 2018, Oracle and/or its affiliates.
    All rights reserved. target database Password: enter password connected to target database: ORCL (DBID=1530541453) RMAN>
    Recovery Manager: Release 19.0.0.0.0 - Production on
    Fri May 29 00:57:29 2019 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates.
    All rights reserved. target database Password: enter password connected to target database: ORCL (DBID=1530541453) RMAN>
  2. Execute the following command to back up the database files, including the archive redo log files.
    RMAN> backup database plus archivelog;
    
    Click the output.txt to view the full output.

section 2Display Backup Information Stored in the RMAN Repository

  1. Enter the following command to display backup information stored in the RMAN repository.
    RMAN> list backup summary;
    
    Click the output.txt to view the full output.
  2. Execute the following command to view detailed information stored in the RMAN repository about the backup of a specific datafile.
    RMAN> list backup of datafile 3;
    Click the output.txt to view the full output.

section 3Validate Backups

  1. Execute the VALIDATE DATAFILE command to validate the backup for a specific datafile. The VALIDATE command determines whether the backup exists.
    RMAN> validate datafile 1;
    
    Click the output.txt to view the full output.
  2. Execute the RESTORE TABLESPACE VALIDATE command to validate that the datafiles for the specified tablespace can be restored.
    RMAN> restore tablespace users validate;
    
    Starting restore at 29-MAR-19
    using channel ORA_DISK_1
    
    channel ORA_DISK_1: starting validation of datafile backup set
    channel ORA_DISK_1: reading from backup piece /scratch/u01/app/oracle/recovery_area/ORCL/backupset/2019_03_29/o1_mf_nnndf_TAG20190329T005838_g9vn1gb9_.bkp
    channel ORA_DISK_1: piece handle=/scratch/u01/app/oracle/recovery_area/ORCL/backupset/2019_03_29/o1_mf_nnndf_TAG20190329T005838_g9vn1gb9_.bkp tag=TAG20190329T005838
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: validation complete, elapsed time: 00:00:03
    Finished restore at 29-MAR-19
    
    RMAN>