In this post, we will learn how to take rman backup with archivelog step-by-step guide.
Table of Contents
What is backup database plus Archivelog?
The backup database plus archivelog command will create a database backup with archivelogs using the RMAN utility.
RMAN Backup with Archivelog
RMAN>backup database plue archivelog;
Or you can use the below script for the same task.
RMAN> run {
2> allocate channel c1 type disk;
3> backup database;
4> backup archivelog all;
5> }
Output from the above query:
Auto delete archivelog after backup
Here is the command that helps us delete archives automatically from the physical disk location after the backup, run carefully. “ORACLE RMAN TUTORIAL“
RMAN> backup archivelog all delete input;
Create the last two days’ archives backup only
If you want to create only the last two days’ archives backup then use the below commands.
RMAN> BACKUP ARCHIVELOG FROM TIME 'SYSDATE-2' UNTIL TIME 'SYSDATE';
Or you can use the below time base command.
RMAN> run {
allocate channel c1 type disk;
set until time "to_date('2022-06-25 01:30:00','YYYY-MM-DD HH24:MI:SS')";
backup archivelog all;
}
Archivelog backup between two sequence numbers
Using the below command you can create the archivelog backup between two sequence numbers in the RAC environment or non-RAC environment also.
Suppose we want to create an archivelog backup sequence number from 565 to 600.
Standalone Environment
RMAN> backup archivelog from sequence 565 until sequence 600;
RAC environment
For the RAC environment, we need to add thread numbers like 1 for node 1 and 2 for node 2.
RMAN> backup format archivelog from sequence 565 until sequence 600 thread 2;
Or you can use the below command.
- Switchover steps in Oracle 11G, 12c, 19c
- RMAN Backup with Archivelog
- Oracle RMAN
- How to Restore Database until time
- Convert Physical Standby To Snapshot Standby Database