Before 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
Perform
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.
- 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> - 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.
Display
Backup Information Stored in the RMAN Repository
- 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. - 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.
Validate
Backups
- Execute the
VALIDATE DATAFILEcommand to validate the backup for a specific datafile. TheVALIDATEcommand determines whether the backup exists.RMAN> validate datafile 1;Click the output.txt to view the full output. - Execute the
RESTORE TABLESPACE VALIDATEcommand 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>
Perform
and Schedule Backups