All scripts of the oracle backup plan are evenly stored in/dsk3/bk/scripts.
① [Oracle @ sia scripts] $ cat connect. rcv (connect to the rman script) connect target sys/oracle @ prod; ② [oracle @ sia scripts] $ cat del_obso.rcv (delete logs with expired status and obsolete files) run {configure retention policy to redundancy 3; crosscheck archivelog all; delete noprompt expired archivelog all; delete noprompt obsolete;} ③ [oracle @ sia scripts] $ cat bkarch. rcv (backup archiving log) run {SQL 'alter system archive log exist'; backup as compressed backupsetformat = '/dsk3/backup/arch _ % d _ % U. bak 'archivelog all delete input;} ④ [oracle @ sia scripts] $ cat bkctl. rcv (backup control file) run {backup as compressed backupsetcurrent controlfile reuseformat = '/dsk3/backup/bkctl. bak ';} ⑤ [oracle @ sia scripts] $ cat inc0.rcv (0-level Incremental Backup difference) @/dsk3/bk/scripts/connect. rcv @/dsk3/bk/scripts/bkarch. rcvrun {allocate channel has device type disk; allocate channel ch2 device type disk; set limit channel has readrate = 10240; set limit channel has kbytes = 4096000; set limit channel ch2 readrate = 10240; set limit channel ch2 kbytes = 4096000; backup as compressed backupsetincremental level 0 databaseformat = '/dsk3/backup/inc0 _ % d _ % U. bak'; release channel consumer; release channel ch2 ;}/ dsk3/bk/scripts/del_obso.rcv @/dsk3/bk/scripts/bkctl. rcvexit; ⑥ [oracle @ sia scripts] $ cat inc1.rcv (level 1 incremental differential backup)/dsk3/bk/scripts/connect. rcv @/dsk3/bk/scripts/bkarch. rcvrun {allocate channel has device type disk; allocate channel ch2 device type disk; set limit channel has readrate = 10240; set limit channel has kbytes = 4096000; set limit channel ch2 readrate = 10240; set limit channel ch2 kbytes = 4096000; backup as compressed backupsetincremental level 1 databaseformat = '/dsk3/backup/inc1 _ % d _ % U. bak'; release channel consumer; release channel ch2 ;}/ dsk3/bk/scripts/del_obso.rcv @/dsk3/bk/scripts/bkctl. rcvexit; 7 [oracle @ sia scripts] $ cat inc1_c.rcv (level 1 Cumulative Incremental Backup) @/dsk3/bk/scripts/connect. rcv @/dsk3/bk/scripts/bkarch. rcvrun {allocate channel has device type disk; allocate channel ch2 device type disk; set limit channel has readrate = 10240; set limit channel has kbytes = 4096000; set limit channel ch2 readrate = 10240; set limit channel ch2 kbytes = 4096000; backup as compressed backupsetincremental level 1 cumulative databaseformat = '/dsk3/backup/inc1_c _ % d _ % U. bak'; release channel consumer; release channel ch2 ;}/ dsk3/bk/scripts/del_obso.rcv @/dsk3/bk/scripts/bkctl. rcvexit; export [oracle @ sia scripts] $ cat inc0.shnohup $ ORACLE_HOME/bin/rman prepare file =/dsk3/bk/scripts/inc0.rcv log =/dsk3/bk/scripts/inc0.log append & [oracle @ sia scripts] $ cat inc1.shnohup $ ORACLE_HOME/bin/rman partition file =/dsk3/bk/scripts/inc1.rcv log =/dsk3/bk/scripts/inc1.log append & [oracle @ sia scripts] $ cat inc1_c.shnohup $ ORACLE_HOME/bin/rman partition file =/dsk3/bk/scripts/inc1_c.rcv log =/dsk3/bk/scripts/inc1_c.log append & volumes [oracle @ sia scripts] $ crontab-l30 1 ** 0/dsk3/bk/scripts/inc0.sh30 1 ** 1/dsk3/bk/scripts/inc1.sh30 1 ** 2/dsk3/bk/scripts/inc1.sh30 1 ** 3/dsk3/bk/scripts/inc1_c.sh30 1 ** 4/dsk3/bk/scripts/inc1.sh30 1 ** 5/dsk3/bk/scripts/inc1_c.sh30 1 ** 6/ dsk3/bk/scripts/inc1.sh
------------------------------- Gorgeous split line -------------------------------- backup every hour, 0 1 Level 1
[oracle@sia scripts]$ cat connect.rcvconnect target sys/oracle@prod;[oracle@sia scripts]$ cat hourinc0.rcv@@/dsk3/bk/scripts/connect.rcvrun{backup as compressed backupsetincremental level 0 databaseformat='/dsk2/backup/inc0_%d_%U.bak';}exit;[oracle@sia scripts]$ cat hourinc1.rcv@@/dsk3/bk/scripts/connect.rcvrun{backup as compressed backupsetincremental level 1 databaseformat='/dsk2/backup/inc1_%d_%U.bak';}exit;[oracle@sia scripts]$ cat hourinc0.sh nohup $ORACLE_HOME/bin/rman cmdfile=/dsk3/bk/scripts/hourinc0.rcv log=/dsk3/bk/scripts/hourinc0.log append &[oracle@sia scripts]$ cat hourinc1.sh nohup $ORACLE_HOME/bin/rman cmdfile=/dsk3/bk/scripts/hourinc1.rcv log=/dsk3/bk/scripts/hourinc1.log append &[oracle@sia scripts]$ crontab -l* */1 * * * /dsk3/bk/scripts/hourinc0.sh*/15 */1 * * * /dsk3/bk/scripts/hourinc1.sh*/30 */1 * * * /dsk3/bk/scripts/hourinc1.sh*/45 */1 * * * /dsk3/bk/scripts/hourinc1.sh