归档
select sum(block_size*blocks)/1021/1024/1024,to_char(COMPLETION_TIME, 'MMDD')
from v$archived_log
where COMPLETION_TIME < to_date(to_char(sysdate, 'DDMONYY'), 'DDMONYY')
and COMPLETION_TIME >
to_date(to_char(sysdate - 7, 'DDMONYY'), 'DDMONYY')
group by to_char(COMPLETION_TIME, 'MMDD')
order by to_char(COMPLETION_TIME, 'MMDD');
run{
allocate channel c1 device type disk;
backup database format '/backup/cwdata/full_%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 '/backup/cwdata/arch_%d_%T_%s_%p.bak';
backup current controlfile format '/backup/cwdata/controlfile_%U';
backup spfile format '/backup/cwdata/spfile_%d_%T_%s_%p.bak';
release channel c1;
}