Log reader stored procedure¶
The Stelo log reader stored procedure reads the log on the database server instead of through the Db2 ODBC driver on the
Stelo VM (see Reading the log over ODBC or with the stored procedure). It works
with Db2 for LUW 10.5 and later, on Windows, Linux and AIX database servers. The Capture Agent user also needs
CREATE_EXTERNAL_ROUTINE, to create the external C procedures SQ_GET_INITIAL_LRI and SQ_READLOG in its schema;
without it, the agent only logs a warning, and the problem shows up later when it reads the log.
-
Copy the file for the database server's operating system from the
StarQuestSPfolder of the Stelo Capture installation on Windows (by defaultC:\Program Files\StarQuest\sqdrplus\StarQuestSP) to the Db2 instance'sfunctiondirectory. If you can't find the folder, ask Stelo Support for the file.- Windows:
Windows\StarQuestSP.dlltoC:\Program Files\IBM\SQLLIB\function. This isn't the directory that usually holds Java stored procedures (ProgramData\IBM\DB2\DB2COPY1\function). The server also needs a recent Microsoft Visual C++ Redistributable for Visual Studio 2015–2022. -
Linux or AIX:
Linux/StarQuestSPorAIX/StarQuestSPto the instance'ssqllib/functiondirectory (not the Db2 program directory/opt/ibm/db2/<version>/function). The instance owner must be able to read and run it:chmod 755 /home/db2inst1/sqllib/function/StarQuestSP
- Windows:
-
After you add the agent, add the property
udbReadLogUsingSPwith the valuetrueon its Configuration tab and save. Saving restarts the agent, which registers the proceduresSQ_GET_INITIAL_LRIandSQ_READLOGin its control schema (see Users and privileges).
To stop using it, set udbReadLogUsingSP to false, delete the file from the function directory, and drop the
procedures (here in the control schema SQDR):
DROP PROCEDURE "SQDR"."SQ_GET_INITIAL_LRI";
DROP PROCEDURE "SQDR"."SQ_READLOG";