完备脚本:
#!/bin/bash
export ORACLE_SID=db3
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=/u01/oracle/product/11.2.0/dbhome_1
$ORACLE_HOME/bin/rman target / << EOF
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
crosscheck archivelog all;
backup as compressed backupset database format '/dbbackup/full_dbbackup_%T_%d_%U';
sql 'alter system archive log current';
backup as compressed backupset filesperset 10 format '/dbbackup/Arch_%d_%T_%s.bak' archivelog all;
delete noprompt obsolete;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
EOF
差异备份脚本
#!/bin/bash
export ORACLE_SID=sqmesdb3
expor