SQL/MP Programming Manual for COBOL

HP NonStop SQL/MP Programming Manual for COBOL529758-003
C-1
C Maximizing Local Autonomy
This appendix describes about the local autonomy in the NonStop SQL/MP
network-distributed database.
Topics include:
Using a Local Partition
Using TACL DEFINEs on page C-2
Using Current Statistics on page C-2
Local autonomy in the NonStop SQL/MP network-distributed database ensures that a
program can access data on the local node, regardless of the availability of SQL
objects on remote nodes. In some cases, the design of NonStop SQL/MP allows for
local autonomy. For example, if a DDL change alters a table on \NODEA when
\NODEB is unavailable, an SQL program file on \NODEB that uses the altered
\NODEA table is not marked as invalid. The invalid SQL program on \NODEB that is
erroneously marked as valid is detected at run time by the timestamp check and then
automatically recompiled.
If your program accesses a network-distributed database, you can maximize local
autonomy by following these guidelines:
Use a local partition, rather than the primary partition, as the table name for
partitioned tables.
Use TACL DEFINEs to refer to tables.
Use current statistics.
Skip unavailable partitions.
For collations, SQL/MP supports run-time node autonomy because collations are
stored in an SQL object’s file label and within expressions that operate on the SQL
objects. For example, suppose that you create a partitioned table, TABLEA, with
partitions on \NEWYORK and \PARIS. TABLEA requires the collation
\NEWYORK.$SQL.COLLATE.FRENCH. If \NEWYORK goes down, programs on
\PARIS that refer to TABLEA continue to run, because they get the collation
information from the TABLEA file label. However, the recompilation of a program on
\PARIS that uses TABLEA fails, because the \NEWYORK.$SQL.COLLATE.FRENCH
collation is not available.
Using a Local Partition
If your program uses a remote partition, the SQL compiler looks for information about
the table in a remote catalog. If the remote node is down, the SQL compilation fails.
However, if your program uses a local partition, the SQL compiler looks for the
information in a local catalog. If the local node and the data is available, the SQL
compilation is successful.