Pseudo object type migration

A pseudo object type is a special object type value used in the object tracking list to reference an entity that is not a system object. Pseudo object types are defined for system level environment variables (*ENVVAR), security attributes (*SECATR), system values (*SYSVAL), and function usage identifiers (*FCNUSG).

The pseudo object types are described below, along with their migration characteristics.

The job that handles pseudo object types during data synchronization is named QMRDBESYNC. This job starts and ends on an interval basis. If there are tracked changes to objects on the object tracking list (OTL), the synchronization job will migrate the changes from the source node to the copy node.

System level environment variables (*ENVVAR)

System-level environment variables are not migrated during system migration. Also, they are not replicated by Db2® Mirror.

That means it is likely that the system-level environment variables will be different between the source and copy node.

The following SQL can be used to understand which system-level environment variables are missing from the copy node and build CL commands that can be executed on the copy node to establish those environment variables.

--
-- Generate a list of system level environment variables (*ENVVAR) that exist on the copy node
--
DECLARE GLOBAL TEMPORARY TABLE SESSION.REMOTE_ENVVARS (
      ENVIRONMENT_VARIABLE_NAME, ENVIRONMENT_VARIABLE_VALUE, ENVIRONMENT_VARIABLE_CCSID) AS
      (SELECT ENVIRONMENT_VARIABLE_NAME, ENVIRONMENT_VARIABLE_VALUE, ENVIRONMENT_VARIABLE_CCSID
          FROM QIBM_DB2M_00000.QSYS2.ENVIRONMENT_VARIABLE_INFO
          WHERE ENVIRONMENT_VARIABLE_TYPE = 'SYSTEM')
      WITH DATA
  WITH REPLACE;

--
-- List the system level environment variables (*ENVVAR) that exist only on the source node
--
SELECT SOURCE.ENVIRONMENT_VARIABLE_NAME, SOURCE.ENVIRONMENT_VARIABLE_VALUE,
       SOURCE.ENVIRONMENT_VARIABLE_CCSID
  FROM QSYS2.ENVIRONMENT_VARIABLE_INFO SOURCE
       LEFT EXCEPTION JOIN SESSION.REMOTE_ENVVARS COPY
         ON SOURCE.ENVIRONMENT_VARIABLE_NAME = COPY.ENVIRONMENT_VARIABLE_NAME
  WHERE SOURCE.ENVIRONMENT_VARIABLE_TYPE = 'SYSTEM';
  
--
-- Generate CL commands that can be executed on the copy node to create the 
--   missing environment variables
--
SELECT 'QSYS/ADDENVVAR ENVVAR(''' CONCAT SOURCE.ENVIRONMENT_VARIABLE_NAME CONCAT 
       ''') VALUE(''' CONCAT  SOURCE.ENVIRONMENT_VARIABLE_VALUE CONCAT 
       ''') CCSID(' CONCAT SOURCE.ENVIRONMENT_VARIABLE_CCSID CONCAT ') LEVEL(*SYS)' 
       AS ENVVAR_COMMANDS
  FROM QSYS2.ENVIRONMENT_VARIABLE_INFO SOURCE
       LEFT EXCEPTION JOIN SESSION.REMOTE_ENVVARS COPY
         ON SOURCE.ENVIRONMENT_VARIABLE_NAME = COPY.ENVIRONMENT_VARIABLE_NAME
  WHERE SOURCE.ENVIRONMENT_VARIABLE_TYPE = 'SYSTEM';

Security attributes (*SECATR)

Security attributes are those security settings that can be changed using the Change Security Attributes (CHGSECA) command. Security attributes are migrated to the copy node during system migration.

During the data synchronization stage, security attributes are tracked and synchronized to the copy node using Db2 Mirror technology.

System values (*SYSVAL)

System values are migrated to the copy node during system migration.

During the data synchronization stage, only a subset of system values support tracking and migration of changes to the copy node.

Table 1. System values tracked and migrated during data synchronization stage
QALWOBJRST QCURSYM QHOUR QSECOND
QCCSID QDATE QIGCCDEFNT QSECURITY
QCENTURY QDATETIME QIGCFNTSIZ QSRTSEQ
QCHRID QDATFMT QKBDTYPE QTIME
QCHRIDCTL QDATSEP QLANGID QTIMSEP
QCNTRYID QDAY QMINUTE QTIMZON
QCRTAUT QDECFMT QMONTH QVFYOBJRST
QCRTOBJAUD QFRCCVNRST QPWDLVL QYEAR

Changes to system values not listed in Table 1 are not tracked or synchronized by Migrate While Active. Use the compare facility described below to recognize changes to system values that need to be manually migrated.

Function usage identifiers (*FCNUSG)

Function usage identifiers and the configuration of function usage are migrated to the copy node during system migration.

During the data synchronization stage, function usage identifiers are tracked and synchronized to the copy node using Db2 Mirror technology.

Comparing pseudo object types between the source and copy node

The MIRROR_COMPARE_LIBRARY procedure can be used to compare pseudo object types.

To compare the following replicated object types: *AUTL, *USRPRF, *SYSVAL, *ENVVAR, *FCNUSG, and *SECATR use this special form of MIRROR_COMPARE_LIBRARY.

--
-- Determine if the pseudo object types are "in sync" between the source and copy node
--
CALL QSYS2.MIRROR_COMPARE_LIBRARY(
    LIBRARY_NAME   => 'QSYS',
    RESULT_SET     => 'YES',
    RESULT_LIBRARY => 'MIG_COMP',
    RESULT_FILE    => 'PSEUDOCOMP');

SELECT * FROM MIG_COMP.PSEUDOCOMP;

If the MIG_COMP/PSEUDOCOMP *FILE contains zero rows, the pseudo object types are identical between the source and copy nodes. If rows are returned, examine the differences and decide whether to manually make a change.