Skip to content

Run the Stelo Capture jobs in their own subsystem

A Db2 for i Capture Agent reads changes through IBM i host server jobs: remote command (QZRCSRVS), database (QZDASOINIT) and file (QPWFSERVSO) jobs, which by default run in the QUSRWRK and QSERVER subsystems with all other client jobs (see Resource use on the IBM i). On a busy system you can route the jobs of the agent user to a subsystem of their own, and give them the run priority and resources you want.

This page routes the jobs by user profile: the agent user, SQDR in the examples. IBM i can also route host server jobs by the client's IP address, which you set up in IBM Navigator for i (see References).

Before you start

  • Routing by user profile needs IBM i 7.3 with PTF SI59915, 7.2 with TR2, Db2 PTF group level 9 and PTF SI59914, or 7.1 with TR10, Db2 PTF group level 38 and PTF SI59913 (later releases include it).
  • You need enough authority on the IBM i to create a subsystem, a class and a job queue, and to change server routing.

Create the subsystem

The examples create everything in the library SQDR, named SQDR.

  1. Create a library for the subsystem objects if you don't use an existing one:

    CRTLIB SQDR
    
  2. Create a class, which sets the jobs' run priority, time slice and default wait time:

    CRTCLS SQDR/SQDR RUNPTY(20) TIMESLICE(2000) DFTWAIT(30) TEXT('SQDR Class')
    

    On a system with tightened security, give the class the same authority as QSYSCLS20:

    GRTOBJAUT OBJ(SQDR/SQDR) OBJTYPE(*CLS) USER(*PUBLIC) AUT(*USE)
    
  3. Copy the QUSRWRK subsystem description, which already holds prestart job entries for the host servers:

    CRTDUPOBJ OBJ(QUSRWRK) FROMLIB(QSYS) OBJTYPE(*SBSD) TOLIB(SQDR) NEWOBJ(SQDR)
    
  4. Replace its job queue entry with a job queue of its own:

    RMVJOBQE SBSD(SQDR/SQDR) JOBQ(QUSRNOMAX)
    CRTJOBQ JOBQ(SQDR/SQDR)
    ADDJOBQE SBSD(SQDR/SQDR) JOBQ(SQDR/SQDR) MAXACT(*NOMAX)
    
  5. Add a prestart job entry for the file server, which runs in QSERVER by default:

    ADDPJE SBSD(SQDR/SQDR) PGM(QSYS/QPWFSERVSO)
    
  6. Optionally, check the other prestart job entries with WRKSBSD SBSD(SQDR/SQDR). To change an entry's class, remove and add it again, for example:

    RMVPJE SBSD(SQDR/SQDR) PGM(QZRCSRVS)
    ADDPJE SBSD(SQDR/SQDR) PGM(QSYS/QZRCSRVS)
    

Route the agent user's jobs to it

  1. In an SQL session, route the agent user's host server jobs to the subsystem, and check the routing:

    CALL QSYS2.SET_SERVER_SBS_ROUTING('SQDR', '*ALL', 'SQDR');
    SELECT * FROM QSYS2.SERVER_SBS_ROUTING WHERE AUTHORIZATION_NAME = 'SQDR';
    
  2. Start the subsystem:

    STRSBS SBSD(SQDR/SQDR)
    
  3. Restart the agent (see Start/Restart).

  4. Check that the agent user's jobs run in the new subsystem: WRKACTJOB SBS(SQDR), then F14 to include prestart jobs.
  5. Start the subsystem at each IPL: add the STRSBS command to your IPL start-up program (QSTRUP).

Tune the subsystem

The class sets the run priority, time slice, default wait and maximum CPU of the jobs; the subsystem description sets their storage pools and maximum number of jobs. For example, to give future jobs run priority 20 (the default of interactive jobs in QINTER):

DSPCLS CLS(SQDR/SQDR)
CHGCLS CLS(SQDR/SQDR) RUNPTY(20)

The change applies to new jobs, without restarting the subsystem or the agent.

Route the Replicator Service's jobs too

The Replicator Service's StarSQL connections run as DRDA jobs (QRWTSRVR). You can route them the same way, by the user profile SQDR connects as. That needs the PTF for APAR SE67211 (SI64752 on IBM i 7.3, SI64753 on 7.2, SI64754 on 7.1) or a later one, which current cumulative PTF packages include.

References

In the IBM i documentation and IBM Support:

  • Routing connections to subsystems based on user ID and the SET_SERVER_SBS_ROUTING procedure
  • Routing server jobs based on client IP address and Creating a user-defined server subsystem
  • Changing the IPL start-up program