How to tell/find if the instance is Primary/Standby?

By querying v$database one can tell if the host is primary or standby For primary testdb> select database_role from v$database; DATABASE_ROLE —————- PRIMARY For Standby – Note you may need to connect to as sys as sysdba if the instance is in mount state testd> select database_role from v$database; DATABASE_ROLE —————- PHYSICAL STANDBY OR On…

Script to delete arch logs from the Standby database host after applied

#!/usr/bin/ksh ################################################################################################################## # # This script is to delete the arch logs for the standby database after it has applied the logs to the instance. # ################################################################################################################## script=`basename $0` export ORACLE_SID=$1 dir=/oracle/EPW/${ORACLE_SID}/temp/arch tmpf=$dir/.$script.tmp logcount=50 function GetAppliedLogfileSequenceNumber { sqlplus -S /nolog <<EOF > $tmpf connect / as sysdba set head off set pages 0 select max(sequence#)…