-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patharchive_log_status.sql
More file actions
31 lines (24 loc) · 1.07 KB
/
archive_log_status.sql
File metadata and controls
31 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- ======================================================
-- GPI - Gunther Pippèrr
-- Desc : Check the status of the archive logs
-- ======================================================
-- archive_log_status.sql
-- see https://blog.dbi-services.com/archivelog-deletion-policy-for-standby-database-in-oracle-data-guard/
set verify off
set linesize 130 pagesize 300
set serveroutput on size 1000000
prompt ... Check if archivelogs are need for recovery or can be deleted
select applied
, deleted
, decode(rectype,11,'YES','NO') as reclaimable
, count(*)
, min(sequence#)
, max(sequence#)
from v$archived_log left outer join sys.x$kccagf using(recid)
where is_recovery_dest_file='YES' and name is not null
group by applied,deleted,decode(rectype,11,'YES','NO') order by 5
/
prompt ...
prompt ... reclaimable = YES means that this archivelog can be deleted and is not nesseary anymore for the recovery, maybe still backuped
prompt ... set with RMAN "CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;" to trigger check of archivelogs
prompt ...