Crash Recovery (crash recovery) with AutoRestart parameters

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to log log

The impact of this parameter setting has been experienced two times in the production system:
For the first time there is a set of less important systems installed on the virtual machine, and all applications of this system (DB2 was IHS) are configured to/etc/ rc.local, each boot machine will automatically pull up the application, and then a virtual machine down, after restarting to check that each application process starts normally, but the foreground page access exception is inaccessible, and then to the background to manually connect to the database report:
sql1015n the database is a inconsistent state. sqlstate=55025
According to sql1015n hint: need to execute restart Database dbname command, after execution, then databases can connect normally

The second is a set of HA server host power failure system switchover, after switching to the standby, check that the application is normally pulled up, but the foreground is inaccessible, and the first time is the same problem, the AutoRestart parameter is set off

This parameter is explained as follows:
If the DB2 database suffers a power outage or shuts down unexpectedly, the database does not shut down cleanly, then the database will be crash recovery when it is started. However, if the database parameter AutoRestart is set to OFF, DB2 does not crash RECOVERY after starting the database. About crash recovery, in the Db2diag.log log will have a relevant expression

This scenario is reproduced below:

/* 1 set AutoRestart to OFF */[[email protected] ~]$ DB2 UPDATE DATABASE CONFIGURATION for Limtdb USING AutoRestart of F immediatedb20000i the UPDATE DATABASE CONFIGURATION command completed successfully. [[email protected] ~]$ DB2 get DB cfg for limtdb|grep-i autorestart Auto restart enabled (AUTOR        Estart) = OFF [[email protected] yunwei]$ DB2 connect to LIMTDB database Connection information Database server    = db2/linuxx8664 10.1.0 SQL Authorization ID = db2inst1 Local Database alias = limtdb/* 2 Insert a piece of data but not commit, in order to be inconsistent */[[email protected] yunwei]$ DB2 +c "INSERT into A values (15485, ' Asdas ', ' Asdas ')" db20000i the SQL command compl Eted successfully. [[email protected] yunwei]$/* 3 Kill database, simulation of abnormal downtime */[[email protected] yunwei]$ ps-ef|grep db2sysdb2inst1 5    287 5285 1 08:07 pts/1 00:00:04 db2sysc 0 db2inst1 5827 3612 0 08:12 PTS/1 00:00:00 grep db2sys[[email protecteD] yunwei]$ kill-9 5287/* 4 Start the database, the database does not have a crash recovery because AutoRestart is off */[[email protected] yunwei]$ [[Email prot Ected] yunwei]$ db2start12/19/2014 08:13:04 0 0 sql1063n db2start processing was successful. SQL1063N Db2start processing was successful. [[email protected] yunwei]$ [[email protected] yunwei]$/* 5 This error is because the DB2BP process did not terminate */[[email   Protected] yunwei]$ DB2 connect to limtdbsql0752n connecting to a database was not permitted within a logical unit of work  When the CONNECT type 1 setting are in use. Sqlstate=0a001[[email protected] yunwei]$ DB2 terminatedb20000i the TERMINATE command completed successfully./* 6 again  At the start of the report database inconsistency */[[email protected] yunwei]$ DB2 connect to limtdbsql1015n the. sqlstate=55025/* 7 DB2?  SQL1015N has a suggestion: using the RESTART database command*/[[email protected] yunwei]$ DB2 RESTART database limtdbdb20000i The RESTART DATABASE command completed successfully. /* 8  Database can connect normally */[[email protected] yunwei]$ DB2 connect to LIMTDB database Connection information databases server = db2/linuxx8664 10.1.0 SQL Authorization ID = db2inst1 Local Database alias = limtdb/* 9 The following is the setting AutoRestart to on case, Database outage Restart (no need to execute restart database) */[[email protected] yunwei]$ [[email protected] yunwei]$ DB2 UPDATE Database Configuration for Limtdb USING AutoRestart on immediatedb20000i the UPDATE DATABASE CONFIGURATION command completed SUCCE Ssfully. [[email protected] yunwei]$ [[email protected] yunwei]$ DB2 get DB cfg for limtdb|grep-i AutoRestart Auto Resta RT enabled (AutoRestart) = on[[email protected] yunwei]$ [[email protected] yunwei]$ [[Emai L protected] yunwei]$ DB2 +c "INSERT into A values (15485, ' Asdas ', ' Asdas ')" db20000i the SQL command completed succes Sfully.                          [[email protected] yunwei]$ ps-ef|grep db2sysdb2inst1 5870 5868 1 08:13 pts/1 00:00:03 DB2SYSC 0            Db2inst1 6122 3612 0 08:16 pts/1 00:00:00 grep db2sys[[email protected] yunwei]$ kill-9 5870[[emai L protected] yunwei]$ db2start12/19/2014 08:16:35 0 0 sql1063n db2start processing was successful. SQL1063N Db2start processing was successful.  [[email protected] yunwei]$ DB2 connect to limtdbsql0752n connecting to a database was not permitted within a logical Unit of work when the CONNECT type 1 setting are in use. [[email protected] yunwei]$ DB2 terminatedb20000i the TERMINATE command completed successfully. [[email protected] yunwei]$ DB2 connect to LIMTDB database Connection information Database server = Db2/linu XX8664 10.1.0 SQL Authorization ID = db2inst1 Local Database alias = Limtdb


Crash Recovery (crash recovery) with AutoRestart parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.