|
-
OK.
Here's the script I'm going to run (via cron/sh) that determines if I need to flush. It's hard coded to 10 logs (1 gig)
set serveroutput on
set feedback off
declare
rman_channels_open number;
num_logs number;
flush_logs varchar2(10);
begin
select count(*)
into rman_channels_open
from v$session
where program like 'rman%'
and client_info like 'rman channel%';
if rman_channels_open = 0 then
begin
select count(*)
into num_logs
from v$archived_log
where status = 'A';
if num_logs > 10 then
flush_logs := 'FLUSH'; --flush
else
flush_logs := 'CYCLE'; --not enough logs, flush next cycle
end if;
end;
else
flush_logs := 'RUNNING'; --flush or backup already running
end if;
dbms_output.put_line(flush_logs);
end;
/
exit;
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|