#!/bin/ksh function is_not_guarded { return `${ORACLE_HOME}/bin/sqlplus -S / "as sysdba" <<-EOF set pagesize 0 feedback off verify off heading off termout off echo off select count(1) from sys.v\\$archive_dest where status = 'VALID' and target = 'STANDBY'; EOF` } if is_not_guarded # 0;SIP|SBY then echo -e "Single Instance Primary OR Standby" else echo -e "Primary with Standby" fi