문제

I have 5 federated tables. Each table is connected to another database. Now I do some stuff in a loop and the first thing I do in the loop is some stuff with the federated table. Because the database to which the federated table is linked is not always online I have a error handler which catches the error when the database is offline.

Unfortunately when the database is offline the query (a simple select query) takes about 5 seconds before it returns a error that the database is not online. If the database is then online I skip the rest of the code in the loop.

Now my problem is is that that routine needs to be executed every 5 seconds and needs to be finished in 5 seconds. However when the databases are offline to which the federated table is linked then it the failed attemps to connect to the database takes up: 5 db's * 5 sec = 25 seconds

So my question is it possible to check very fast in SQL if the database to which the federated table is linked to is online?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top