Pages

Saturday, April 9, 2016

Oracle Shutdown Immediate Waiting On Active Process

Oracle Shutdown Immediate Waiting On Active Process

Usually whenever you trying to shutdown an Oracle database with immediate option, it will wait for some active process to get terminate. This may take long time and it also depends on the number of processes.

use below command to find out the active sessions on database:

bash-3.00$ ps -ef | grep LOCAL=NO

oracle 17862     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17882     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17854     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17890     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17906     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17848     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17978     1   0   Jun 13 ?           0:03 oracletest (LOCAL=NO)
oracle 17908     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17918     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17910     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17852     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17922     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17982     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17970     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17866     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17930     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17914     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17874     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17932     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17986     1   0   Jun 13 ?           0:03 oracletest (LOCAL=NO)
oracle 17952     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17936     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17836     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17944     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17974     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17948     1   0   Jun 13 ?           0:05 oracletest (LOCAL=NO)
oracle 17898     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17878     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17876     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17900     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17924     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17902     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17892     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17894     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17956     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17966     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17940     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17834     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17960     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17934     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17884     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17916     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17860     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17868     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17856     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)


You need to kill the process only with option LOCAL=NO. The below is the very useful UNIX command which can be used for killing these idle active session on database which are avoiding the database to shutdown with immediate option.

kill -9 `ps -ef | grep LOCAL=NO | grep <INSTANCE NAME> | grep -v grep | awk '{print $2}'`

Now, verify the processes again with ps -ef | grep LOCAL=NO it should not return any list, If these processes are killed successfully then the database will shutdown smoothly.

Note: It is strongly recommended to do on Test Instances before executing on Producion.










No comments:

Post a Comment