During Oracle RMAN database backup, database must be in archivelog mode for RMAN backup. If you want to take database backup using RMAN in noarchivelog mode then you must put the database in mount state.
There are different ways of taking offline backup during which database will not be available for normal use. This type of backup is ideally called as consistent backup.
The main benefit of consistent backup is that database does not require recovery after it is restored. All committed changes are written to the datafiles during shutdown, so the datafiles are in a transaction-consistent state.
When you restore database from consistent backup you can open database immediately. Below are the Oracle RMAN Database Backup Script in Noarchivelog Mode.
Steps to Backup a Database in Noarchivelog Mode
STEP 1: Check current Oracle database size
select
( select sum(bytes)/1024/1024/1024 data_size from dba_data_files ) +
( select nvl(sum(bytes),0)/1024/1024/1024 temp_size from dba_temp_files ) +
( select sum(bytes)/1024/1024/1024 redo_size from sys.v_$log ) +
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/1024 controlfile_size from v$controlfile) "Size in GB"
from
dual;
STEP 2: Shutdown database and open in Mount state
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
Step 3: Make a shell script to take the backup.
You can use below shell script to take the backup. Please make changes accordingly and modify values mentioned below.
- Change backup location. Replace backup location in place of /u01/BKP_UMT_3087659/
- Change log file name, replace umt_3087659.log with desired name.
- For faster operation, please allocate channels based on the database size.
- Release allocated channels.
[oracle@orahow BKP_308765]$ vi backupumt.sh
rman target / log=/u01/BKP_UMT_3087659 /umt_308765.log << EOF
run {
ALLOCATE CHANNEL t1 DEVICE TYPE DISK FORMAT '/u01/BKP_UMT_3087659/UMT_%U.dbf';
ALLOCATE CHANNEL t2 DEVICE TYPE DISK FORMAT '/u01/BKP_UMT_3087659/UMT_%U.dbf';
BACKUP AS COMPRESSED BACKUPSET DATABASE;
BACKUP CURRENT CONTROLFILE FORMAT '/u01/BKP_UMT_3087659/UMT_cntrl_%s_%p_%t.ctrl';
backup spfile;
RELEASE CHANNEL t1;
RELEASE CHANNEL t2;
}
STEP 4: Run the backup script and monitor the log file.
[oracle@orahow BKP_308765]$ nohup sh backupumt.sh &
Check RMAN Backup Status:
Please modify the script based on your requirement. This is the script for smaller database backup in noarchivelog mode. For larger database allocate channels accordingly.