run{
shutdown immediate;
startup mount;
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup database format '/oraback/rmanbak/backup/%d_%s_%p.bak';
release channel ch1;
release channel ch2;
alter database open;
}
RMAN热备份、非一致性备份脚本
简化版:
run{allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
sql 'alter system switch logfile';
backup database format '/oraback/rmanbak/backup/hot_bak/%d_%s_%p_hot.bak';
release channel ch1;
release channel ch2;
}
连归档一块备份版:
run{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
sql 'alter system switch logfile';
backup database format '/home/oracle/rman_bak/hot_bak/%d_%s_%p_hot.bak'
include current controlfile plus archivelog delete input ;
release channel ch1;
release channel ch2;
}
RMAN热备份、非一致性备份脚本(压缩)
run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;sql 'alter system switch logfile';
backup as compressed backupset database format format '/oraback/rmanbak/backup/%d_%s_%p_%T.db'; --压缩备份
backup as compressed backupset archivelog all format '/oraback/rmanbak/backup/%d_%s_%p_%T.arc' delete input; --压缩备份
backup current controlfile format '/oraback/rmanbak/backup/ctl_%d_%s_%p_%T.bak' delete input;
release channel ch1;
release channel ch2;
}