Availability Guide for Application Design

Designing Applications for Change
Availability Guide for Application Design525637-004
10-31
Physically Reconfiguring the Database
and additional examples of the features described here, refer to the appropriate
NonStop SQL/MP programming manual.
A similarity check enables the SQL executer to determine which parts of an application
need to be recompiled as a result of a change. Unnecessary recompilation is thus
reduced, and the availability of the application increases.
By default, no similarity check is done. To understand the importance of the similarity
check to availability, first let’s examine how change would be managed without
similarity checks.
Your SQL application program is initially compiled by the compiler for the language in
which it is written. Subsequently, it must be compiled with SQL to generate execution
plans for each SQL statement and bind the program with other SQL objects. When you
make changes related to the SQL environment, such as changing the name of a table
or moving a partition, some of the existing execution plans become invalid and require
changing.
To correct the execution plans, you must do one of the following:
Stop the application and perform a static recompilation of SQL statements.
Allow SQL statements to be automatically recompiled at execution time.
The following text discusses how the similarity check can be applied to the program
code to improve availability for static recompilation or automatic recompilation. In either
case, similarity checks must also be explicitly enabled against affected SQL tables and
protection views.
Similarity Checks With Static SQL Recompilation
Recompilation involves bringing the application down but it also ensures that the
change will not affect run-time behavior. The following SQL compiler options provide a
choice of availability levels:
Compile the program with SQL (the default) using the COMPILE PROGRAM
option.
This option recompiles all SQL statements irrespective of whether the
corresponding execution plans change. All execution plans are fully optimized.
Recompile invalid execution plans using the COMPILE INVALID PLANS option.
This option recompiles only the SQL statements that make use of SQL objects that
have changed. All execution plans are fully optimized.
Recompile inoperable execution plans using the COMPILE INOPERABLE PLANS
option.
This option recompiles only the SQL statements that failed the similarity checks.
Although some aspect of an SQL object has changed, the new object is sufficiently
similar to the original object that the same execution plans still work. However,