Explicitly activating the database (ACTIVATE)

Source: Internet
Author: User

One day the attendant contacted me and said, I am responsible for a set of submission system did not generate the message on time, because this alarm in advance, and the system often occurs in the event of not timely generation of messages, that is, do not care, and then not slow to the company, open the system page, found that one of the stored procedures nearly 8 hours has not ended In the past, the longest running record for this stored procedure was less than 2 hours, which is certainly problematic. Viewing the previous day's running record is also about 10 hours, in the past the record is about half an hour, and then the stored procedure runs the next batch of jobs (a Java program), the day before the run for 1 hours, in the past a few minutes. In order to ensure business use, contacted the project team, consulting This stored procedure can skip not run, then force off the database connection, and then run the Java program, but the operation is very slow, tail output log, the discovery program each processing a record, the database connection, and closed, And then process the record (the last time a Java connection fails to closed, causing the Java connection pool to run out and the project group modifying the connection). This approach is certainly not efficient, but should also be so slow, 10 seconds to deal with a record, there must be a problem, because this Java program has been online for many days, why the two geniuses slow.
At this time, I think of the problem analysis methodology that the great God often says, one of the methodology: The recent system has not made the change, indeed has, last week restarted the server, and the DB2 process uses the double machine software to pull up, when pulls up the DB2 process, did not explicitly activate the database, but this system does not have the foreground application, That is, no long connected data connection to the database, the database in the absence of connectivity, will release some of the resources, only the necessary resources, when the application is connected to the database again, the relevant resources will be re-imported, complete data processing, This initialization process is a time-consuming operation (when performing a db2start operation, if the database is not explicitly activated, the first time the DB2 Conncet to dbname is not feeling very slow), the analysis to this immediately executed the Activate database operation, That Java program is instantaneous, as for the previous stored procedure, re-run is about 20 minutes to complete, by inference, the display of the activation of the database should not affect the operation of the stored procedure, but the fact is affected, then the days did not occur similar problems.
It is recommended that for databases that do not have long connections, if the database is not running other software, or if the system resources are sufficient, it is best to explicitly activate the database

Explicitly activating the database (ACTIVATE)

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.