dg.ksh 409 B

123456789101112131415161718192021
  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 # 0;SIP|SBY
  10. then
  11. echo -e "Single Instance Primary OR Standby"
  12. else
  13. echo -e "Primary with Standby"
  14. fi