Overview
Backup mode allows you to put the database in “frozen” state, so you can simply copy the datafiles using OS commands: cp or copy. These copies can be used for a restore later. Now, putting the database IN backup mode isn't very good because:
- The archivelog generation will increase: That is due to the fact that Oracle will NOT generate a change vector for the FIRST time a block changes. So expect higher archivelog generation for the first couple minutes.
- To restore a backup, you will need the redologs as well. So not the best idea when you can simply put the database in archivelog mode and do online RMAN backup.
The backup mode can be enabled on:
- Datafile
- Tablespace
- Database
We can check if a datafile is in backup mode as follows:
- backup mode
SQL> select * from v$backup; FILE# STATUS CHANGE# TIME CON_ID ---------- ------------------ ---------- --------- ---------- 1 ACTIVE 77772650 14-DEC-19 0 3 ACTIVE 77772650 14-DEC-19 0 4 ACTIVE 77772650 14-DEC-19 0 5 ACTIVE 77772650 14-DEC-19 0 7 ACTIVE 77772650 14-DEC-19 0
The commands are pretty straight forward to be honest:
Enable Backup Mode
Disable Backup Mode
- | Disable Backup
SQL> alter database end backup; Database altered. FILE# STATUS CHANGE# TIME CON_ID ----- ------------------------------ ---------- --------- ---------- 1 NOT ACTIVE 77772650 14-DEC-19 0 3 NOT ACTIVE 77772650 14-DEC-19 0 4 NOT ACTIVE 77772650 14-DEC-19 0 5 NOT ACTIVE 77772650 14-DEC-19 0 7 NOT ACTIVE 77772650 14-DEC-19 0