Tuesday, April 23, 2013

Graceful shutdown with timeout vs force shutdown

http://docs.oracle.com/cd/E25054_01/web.1111/e13708/server_life.htm

Graceful Shutdown

The Graceful Shutdown command transitions a server instance from the RUNNING state to the SHUTDOWN state, allowing work in process to be handled gracefully, with this sequence of state transitions:

RUNNING > SUSPENDING > ADMIN > SHUTTING_DOWN > SHUTDOWN


Force Shutdown

The Force Shutdown command transitions a server instance from the any state to the SHUTDOWN state, without allowing work in process to be handled gracefully. When run for a server instance in the RUNNING state, the Force Shutdown command results in these state transitions:

RUNNING > FORCE_SUSPENDING > ADMIN > STANDBY > SHUTDOWN


If you specify a "Graceful Shutdown Timeout" (value is in seconds), you can transform a Graceful Shutdown into a Force Shutdown if the shutdown is impeded by some funny causes. I think this is the safest option: set 120 so as to allow 2 minutes for all work to be completed, then shutdown.

connect('weblogic', 'weblogic1', 't3://myserver.acme.com:7001')
edit()
startEdit()
cd('/')
serverList=cmo.getServers()
for server in serverList:
    name=server.getName()
    cd('/Servers/' + name)
    cmo.setGracefulShutdownTimeout(120)
save()
activate()



No comments: