# Alert when database connection fails

**URL:** <https://forum.inductiveautomation.com/t/alert-when-database-connection-fails/28492>\
**Category:** Ignition\
**Created:** [September 24, 2019, 4:29am UTC](https://forum.inductiveautomation.com/t/alert-when-database-connection-fails/28492 "2019-09-24T04:29:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [September 24, 2019, 4:29am UTC](https://forum.inductiveautomation.com/t/alert-when-database-connection-fails/28492/1 "2019-09-24T04:29:21Z")

</div>

Hi all,

A client this week had a MSSQL database reach its size limit and stop logging. This was corrected, and initially we thought that we hadn’t lost any data because the tag history was set up through a tag splitter to also log to a remote SQL database. As it turns out, the remote database had suffered a failure two days before due to a completely unrelated networking problem.

The client has noted that their historical data redundancy measures were ineffective because they were not alerted to the failure of one of the databases until the other also failed, and wish to correct this.

How can I generate an alarm/set a tag value based on the connection status of a database connection?

As an aside - it was only the master server that had the connectivity issue - the backup server could connect fine, but because the master server was communicating fine with the backup server, the backup server was in standby and didn’t log any data to the remote database either.

Using Ignition 7.9.9

---

<div class="post-metadata">

**Author:** ![pascal](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pascal](https://forum.inductiveautomation.com/u/pascal)\
**Post date:** [September 24, 2019, 7:36am UTC](https://forum.inductiveautomation.com/t/alert-when-database-connection-fails/28492/2 "2019-09-24T07:36:28Z")

</div>

Hi,

In the Tag Browser under System/Database you can find tags related to your databases connections.  
One of them is Available and I believe it gives you the current state of the database conneciton.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b54758b75a57209e7873b7c4edddb685c5bac707.png)

You could set an alarm when this tag goes to false.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [September 24, 2019, 10:12pm UTC](https://forum.inductiveautomation.com/t/alert-when-database-connection-fails/28492/3 "2019-09-24T22:12:06Z")

</div>

Thanks, that’s what I was looking for!
