dg.sh
export ORACLE_SID=$1
sqlplus -S / as sysdba <<EOF
show parameter name
set linesize 1000;
col DEST_NAME format a20;
col RECOVERY_MODE format a20;
select dest_name,status,type,recovery_mode,SYNCHRONIZATION_STATUS,ERROR from v\$archive_dest_status where "DEST_ID" = 2;
select t."STATUS", t."GAP_STATUS",t."ARCHIVED_SEQ#",t."APPLIED_SEQ#" from v\$archive_dest_status t where t."DEST_ID" = 2;
select distinct thread#,max(sequence#) over(partition by thread#) a from v\$archived_log;
EOF
for i in `ps -ef|grep pmon|grep oracle|grep -v grep|awk -F '_' '{print $3}'`
do
./dg.sh $i
done