归档

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;
}

posted @ 2018-10-08 10:27  bonda  阅读(160)  评论(0编辑  收藏  举报