type tnsnames.ora | find "description" > temp1.tmp
for /f "tokens=1" %%i in (temp1.tmp) do (
echo ********************************** begin check %%i ********************************** >> %result_file%
tnsping %%i > temp2.tmp
if errorlevel 1 set tns_name=%%i && goto fail
sqlplus -s %usr%/%pwd%@%%i @%sql_file% >> %result_file%
echo %%i checked successful!
:fail
echo %tns_name%checked failful!
)
一旦其中一条有误,后面的就无法进行了,请问如何解决?
for /f "tokens=1" %%i in (temp1.tmp) do (
echo ********************************** begin check %%i ********************************** >> %result_file%
tnsping %%i > temp2.tmp
if errorlevel 1 set tns_name=%%i && goto fail
sqlplus -s %usr%/%pwd%@%%i @%sql_file% >> %result_file%
echo %%i checked successful!
:fail
echo %tns_name%checked failful!
)
一旦其中一条有误,后面的就无法进行了,请问如何解决?
