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?
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...)
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.
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
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