DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 11

Thread: Script to check tnsnames.ora syntax

Threaded View

  1. #4
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Talking Thanks!

    Thanks gandolf, it did help alot.

    Also I found these "partial address" lines which I had never seen before in any other installation; obviously they produced error, but I'm not sure if they are required (or used) by some obscure application out there -- any clues?

    Code:
    on_unix1 = (ADDRESS=(PROTOCOL=TCP)(HOST=UNIX1)(PORT=1575))
    on_hpux3 = (address=(protocol=tcp)(host=hpux3)(port=1575))


    PS: I tweeked a bit gandolf's script:
    Code:
    #!/usr/bin/bash
    
    export CONNSTRINGS=`sort -u $TNS_ADMIN/tnsnames.ora | grep -v "^ " | grep -v "^#" | grep -v "^(" | grep -v "^)" | sed "s/ =//g" | grep -v "^$"`
    
    echo "${CONNSTRINGS}" | while read line
    do
      dbsv=`echo $line|cut -d' ' -f1`
      addr=`echo $line|cut -d' ' -f2-`
      echo "#####+--- Checking: $dbsv ---+#####"
      tnsping $addr
    done
    
    exit 0
    Last edited by LKBrwn_DBA; 07-31-2008 at 08:31 AM.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width