shutdown immediate
startup mount;
alter database archivelog;
alter system set log_archive_dest_1='location=1';
alter database open;
archive log list;
alter system switch logfile;
select name from v$archived_log;
rman target / nocatalog log /oracle/rman/rman_log/rman_full_JDE_${date_format}.log <<EOF
run
{allocate channel c1 type disk;
allocate channel c2 type disk;
crosscheck archivelog all;
delete expired archivelog all;
crosscheck backup;
delete expired backup;
backup database format '/oracle/rman/databak/full_db_%d_%T_%s_%p.bak';
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup archivelog all format '/oracle/rman/archive_bak/arch_%d_%T_%s_%p.bak';
backup current controlfile format '/oracle/rman/archive_bak/ctl_%d_%T_%s_%p.bak';
release channel c1;
release channel c2;
}
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30491527/viewspace-2128109/
,如需转载,请注明出处,否则将追究法律责任。