I am trying to figure out the best way to shut down our database during a power outage. Obviously, if I am onsite this is not an issue. However, this is not often the case. I can have software that will shut down my computer but is there a way to write a script that is aware that the power source has changed so that is would automatically disconnect the server and shut it down? I do have a battery back up system so I can keep things running for a couple of hours. Be good to know how others have thought to handle this.