Product Environment 9-23
Two-Phase Commit and Automatic Recovery
Two-Phase Commit and Automatic Recovery
Thetwo-phase commit protocol includes automatic recovery in the event of
anuncontrolled shutdown (such as an operating-system failure) experienced
byeither the coordinator or a participant OnLine database server. Two types
of recovery mechanics are included in the two-phase commit protocol:
Ifyour OnLine database server is configured for IBM Informix STAR and you
experience a failure, you must restart thesqlexecd daemon when you reini-
tialize. To do this, log in asroot and enter the following commands at the
system prompt when you are ready to reinitialize OnLine:
tbmode -ky ## Ensure all processes are terminated
## and shared memory has been detached.
tbinit ## Reinitialize shared memory and start
## OnLine in online mode. Use tbinit -s
## to start OnLine in quiescent mode.
sqlexecd ## Restart the INFORMIX-STAR daemon.
Thesqlexecd command can take a servicename argument, although a default
is assumed. For more information about theservicename value for your
OnLine database server, refer to theIBMInformix NET and IBM Informix STAR
Installation and ConfigurationGuide. (The servicename value is stored in the
$INFORMIXDIR/etc/sqlhosts file.)

Coordinator Recovery

Coordinator recovery occurs automatically whenever a database server
processacting as coordinator completes the precommit phase and decides to
commit the transaction, but is terminated before the two-phase commit
protocol can be completed. During coordinator recovery, a new coordinator
database server process is spawned to complete the two-phase commit
protocoland ensure that the transaction is completed by every participating
OnLine database server.Figure 9-6 on page 9-25 illustrates coordinator
recovery.
Coordinator
recovery The coordinating database server process is terminated
prematurely.
Participant
recovery The database server process at a participating OnLine
database server is terminated prematurely.