ddd.ksh 606 B

12345678910111213141516171819202122232425262728
  1. #!/bin/ksh
  2. function is_not_guarded
  3. {
  4. return `${ORACLE_HOME}/bin/sqlplus -S / "as sysdba" <<-EOF
  5. set pagesize 0 feedback off verify off heading off termout off echo off
  6. select count(1) from sys.v\\$archive_dest where status = 'VALID' and target = 'STANDBY';
  7. EOF`
  8. }
  9. if is_not_guarded
  10. then
  11. echo "Is NOT Guarded - BACKUP HERE"
  12. else
  13. echo "Is Guarded - NO BACKUP HERE"
  14. fi
  15. #
  16. # retval=$?
  17. # echo "is_guarded returned ---${retval}---"
  18. # echo "${retval}:$database_role"
  19. #
  20. # if [ ${retval} -eq 0 ]; then
  21. # echo -e "BACKUP HERE"
  22. # else
  23. # echo -e "No Backup here......."
  24. # fi
  25. #