Operating System - HP-UX
1822521 Members
2590 Online
109642 Solutions
New Discussion юеВ

database shutdown script after power failure detection

 
Franky Leeuwerck
Frequent Advisor

database shutdown script after power failure detection

Hi there,

I'd like to have my Ingres DBMS shutdown when the Unix machine (11.00) detects a power failure (upsmond).
How can I realize this ?
Second question : is there anyway to simulate the solution ?
5 REPLIES 5
Robin Wakefield
Honored Contributor

Re: database shutdown script after power failure detection

inittab should call /sbin/powerfail - this script indicates the steps required when SIGPWR is received.

Robin
Joseph C. Denman
Honored Contributor

Re: database shutdown script after power failure detection

Do you have upsmond configured to do a normal shutdown upon powerfail? If so.

1. Create a startup/shutdown script in /etc/init.d
2. Create a K and S link to this file in the respective rc dir such as /sbin/rc2.d

When the system does a shutdown, the script will shutdown the DB.

Hope this helps.

...jcd...
If I had only read the instructions first??
Andrew Maslin
Frequent Advisor

Re: database shutdown script after power failure detection

I have created startup/shutdown scripts for my databases as Joseph suggested and it works well. In our case, we have both a production and a test database on the same server, so to test it I shutdown the production database manually and then rebooted the machine. After it came back up I checked the logs to make sure the test database was shutdown correctly, and I verified that both databases were automatically started correctly on bootup.

Another option if you just want to shut down the database but not the server you could set up the scripts that you need, then unplug the UPS from the wall - that should start the database shutdown, and you could plug it back in before the UPS died so the machine itself doesn't go down.

Andy
Satish Y
Trusted Contributor

Re: database shutdown script after power failure detection

If u have configured UPS in ur set-up, u can go through man pages of pwer_onoff, ups_conf and ups_mond.

Cheers...
Satish.
Difference between good and the best is only a little effort
Joseph C. Denman
Honored Contributor

Re: database shutdown script after power failure detection

DO NOT JUST UNPLUG THE MACHINE WHILE IT IS RUNNING.

This could cause significant hardware problems. The UPS/systems gets its ground from the plug. If you just unplug while it is running, you loose your ground....very very bad.

I suggest tripping the breaker.

...jcd...
If I had only read the instructions first??