#!/usr/bin/ksh #set -xv cd $TMP function help { cat < # Show archive info whose number is given apl -s # Show archives which contains this SCN apl -m # Show higher applied up to now, return none if you are a standby db apl -n # Show filename and SCN instead of time apl -r # List number of line apl -d EOF exit } HOSTNAME=`hostname` NUM=30 DAT_FIELDS=" , FIRST_TIME, NEXT_TIME" ADD_FIELDS="to_char(FIRST_TIME,'YYYY-MM-DD HH24:MI:SS') ft , to_char(NEXT_TIME,'YYYY-MM-DD HH24:MI:SS') nt, " while [ -n "$1" ]; do case "$1" in -a ) FIND_ARCH=TRUE ARCH_NUM=$2 WHERE="where SEQUENCE# = $ARCH_NUM" shift ;; -s ) WHERE="where $2 >= first_change# and $2 < next_change# " ; shift ;; -m ) WHERE="where sequence# = (select max(sequence#) from v\$archived_log where applied ='YES') " ;; -d ) WHERE="where dest_id = $2 " shift;; -n ) CHOICE=SHOW_LAST_ARC;; -r ) NUM=$2 ; shift ;; -h ) help ;; * ) echo "unknown parameters $1" help ;; esac shift done S_USER=SYS . $SBIN/scripts/passwd.env . ${GET_PASSWD} SYS $ORACLE_SID if [ "x-$CONNECT_STRING" = "x-" ];then echo "could no get a the password of $S_USER" exit 0 fi ret=`sqlplus -s "$CONNECT_STRING" <