Sample RMAN Script for level 0 back up.
#rman_level_0_backup.txt script file
run { crosscheck backup; crosscheck archivelog all; crosscheck copy; crosscheck backup of database; crosscheck backup of controlfile; delete noprompt obsolete; delete noprompt expired archivelog all; delete noprompt expired backup of database; delete noprompt expired backup of controlfile; } run { allocate channel ch1 device type disk format 'C:\oracle\backup\RMAN_BACKUPS_LEVEL_0\DB_%d_%u_%s_%p'; #allocate channel ch2 device type disk format 'G:\oracle\backup\RMAN_BACKUPS_LEVEL_0\DB_%d_%u_%s_%p'; backup incremental level 0 tag = 'full online backup (level 0)' (database filesperset 1 include current controlfile); sql 'alter system switch logfile'; sql 'alter system archive log current'; backup filesperset 1 archivelog all tag = 'archivelog backup'; release channel ch1; #release channel ch2; } exit
And to run the script above using RMAN create .cmd file ( RMAN_LEVEL_0_BACKUP.cmd) containing the below script
rman target sys/password@net-service-name cmdfile=c:\RMAN_SCRIPTS\rman_level_0_backup.txt
meda Edited answer 29/01/2022