Start of change

Using an alias for an accelerator

When you need a DB2® application to run on an accelerator in a different subsystem, you can use logical names, called aliases. Using aliases can help make the application portable so that you can run the application, without modification, on an accelerator in another subsystem. For example, you might have an application that runs initially on an accelerator in your test subsystem, and then later you want to run it in a production subsystem. Similarly, you might run an application in one production subsystem, but you also need to run the application on accelerators in multiple other production subsystems. In both cases, using an alias is an efficient way to make the application portable across accelerators in different subsystems.

Before you begin

Ensure that the physical name for the accelerator in a specific subsystem is already defined.

About this task

Defining an accelerator alias enables you to map a logical name (alias) to a physical accelerator name that is used in a specific subsystem. A DB2 application can then use that alias, which points to an accelerator in that subsystem. You can also set up multiple aliases to point to the same accelerator, if needed.

Restrictions:
  • You cannot define a chain of aliases for accelerators. That is, you cannot have one alias point to another alias, which points to yet another alias.
  • DB2 performs only a single lookup for the mapping of a logical name (location alias) to a physical accelerator name in that same subsystem for each CREATE TABLE statement.

Procedure

To create an alias for an accelerator:

Create special rows in the SYSIBM.LOCATIONS communications database (CDB) table of one subsystem. For example:

Begin general-use programming interface information.

Start of change
INSERT INTO SYSIBM.LOCATIONS (LOCATION, LINKNAME, DBALIAS)
VALUES ('logical_system_accel_name', 'DSNACCELERATORALIAS',
'physical_system_accel_name')
End of change

End general-use programming interface information.

In this example:
logical_system_accel_name
Start of changeIs the name of an accelerator in another DB2 subsystem, typically a production subsystem, where the accelerator is defined. A logical name is used only when you issue a CREATE TABLE...IN ACCELERATOR accel_name statement.

For example, if the name of the accelerator on your production system is PACCEL, and the name of the accelerator on your test system is TACCEL, create an alias in SYSIBM.LOCATIONS on your test system in which LOCATION = 'PACCEL' and DBALIAS= 'TACCEL'. By doing so, when you port an application that uses accelerator-only tables from your test environment to your production environment, the DDL will not need to be changed.

End of change
physical_system_accel_name
Is the real name of an accelerator or accelerators in this DB2 subsystem.

Results

When DB2 processes the CREATE TABLE...IN ACCELERATOR logical_system_accel_name clause, DB2 first looks for the accelerator named logical_system_accel_name in that same subsystem. If an accelerator with that name does not exist in that subsystem, DB2 checks the SYSIBM.LOCATION table for the corresponding DSNACCELERATORALIAS value, which identifies the physical accelerator name in the that subsystem.

End of change