I’ve created a version of a project as a sandbox for new users to play in without harming the actual production database, and I’ve hit a roadblock. The training project connects to a database which is a copy restored from the previous day’s backup of our production database. I have created a stored procedure to check for that backup, and if it exists drop the training database and recreate it from that backup.
The problem is that I can’t find a good way to automate this procedure in a job. The procedure itself runs fine when there are no connections to the training database. But it seems like there is always a “sleeping” connection until I disable the database connection from the Ignition server.
Is there a way to disable and then re-enable that database connection on a regular basis? Or is there just a better way to approach this problem completely?