BTEQ LOGON timeout

Database
Enthusiast

BTEQ LOGON timeout

Hi guys,

What are the workarounds for BTEQ to exit if the DB it's trying to log into is down.

*** WARNING: RDBMS CRASHED OR SESSIONS RESET. RECOVERY IN PROGRESS

In MLOAD or FLOAD, when DB is down, it exits after the LOGON statement. But this not the case for BTEQ...

I'm just trying to check if there are alternatives because if not, our workaround is to run an MLOAD script to test if DB is down.

Then only will proceed to the BTEQ script after verifying that the DB is up. Although there's still that small split second chance that DB status may change in between the MLOAD and the BTEQ.

Can please advise?

Thanks!

3 REPLIES
Junior Supporter

Re: BTEQ LOGON timeout

Hi:

It't the common message for a non reached host: check your connection settings (hosts file) and IP's. Also, check that the DB is up & running (pdestate...)

HTH.

Cheers.

Enthusiast

Re: BTEQ LOGON timeout

Hi Carlos,

Yes, we actually purposely make the DB offline so we can test the error-handling mechanisms of our BTEQ script.

What I want to happen is when BTEQ tries to connect to a down DB, it shouldn't just hang there and keep on retrying until the DB goes back up. I want it to exit just like how MLOAD and FLOAD behaves.

Thanks!

Re: BTEQ LOGON timeout

So, prior to TTU v15.10, maybe 15.0, you can pre-test that the server is listening on the TD port using this shell code

telnet $serv 1025 </dev/null 2>&1 | grep 'Connection to' >/dev/null

if [[ $? -eq 1 ]]

then

  echo "$serv is not listening on port 1025"

  exit 1

fi

Otherwise, fall through to an actual bteq test which confirms cop1-N are working.

In TTU v15.10, bteq has a new exitondelay which you can turn on and set a timeout and exit code.

.set exitondelay on 10

Good luck.