dd.ksh 489 B

123456789101112131415161718192021
  1. #!/bin/ksh
  2. function is_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. is_guarded
  10. retval=$?
  11. # echo "is_guarded returned ---${retval}---"
  12. # echo "${retval}:$database_role"
  13. if [ ${retval} -eq 0 ]; then
  14. echo -e "BACKUP HERE"
  15. else
  16. echo -e "No Backup here......."
  17. fi