#!/bin/sh C:/grep/grep.exe -S "(SERVICE_NAME =" tnsnames.ora > service.ora rm -r new.ora echo "#!/bin/sh" > tns_ping.sh C:/cygwin/bin/sed.exe 's/(SERVICE_NAME \=/tnsping.exe /' service.ora>>tns_ping.sh vi tns_ping.sh
If you find There is a way to pipe the 2 commands let me know but for now this little shell script works Martin ___________________________________________ Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Sat, 28 Jul 2012 13:45:18 +1200 > Subject: Script to test connecting to Oracle DBs > From: newbie01.p...@gmail.com > To: beginners@perl.org; dbi-us...@perl.org > > Hi all, > > I am looking for a Perl script or something similar that I can use to test > connection from a client PC to several databases on a server. > > Does anyone know of any such script lying around somewhere :(- > > Currently, am testing connection from a client PC to an Oracle DB using > Oracle's sqlplus. All is well and good until I have to test connection to > multiple databases on the server. > > So I am hoping to use a Perl script that I can use which will parse some > sort of config file that contains hostname.tns_alias combination and then > test connection to the Oracle DB and run a simple SQL like SELECT COUNT(1) > from USER_TABLES, if I get an error, that means there is an issue > connection to that database, otherwise all is good. > > At the moment, easiest I can think of using Perl's system command to run > sqlplus. Or is it better to look at using DBI? Would be very much > appreciated if someone can provide me a simple DBI script to start with if > that is the best approach to use. > > Any suggestion/advice much appreciated. Thanks in advance.