1. Do the deployment (Refer this link: https://community.ibm.com/community/user/hybriddatamanagement/blogs/vishwa-hs1/2021/08/06/azure-functions-using-db2-net-core-drivers?CommunityKey=f2e5dc34-896d-4e8e-9678-724907c4b9f5), Login to Azure portal and Go to the Deployed Application resource and then click on "Advanced Tool > go > Kudu > Debug Console > CMD option > Go to the Location D:\home\site\wwwroot\bin\clidriver\cfg\ And modify the db2dsdriver.cfg file in azure environment (If db2dsdriver.cfg file not there then create it):
Modify/Add the global section of db2dsdriver.cfg configuration file with below lines.
<configuration>
<parameters>
<parameter name="TraceRefreshInterval" value="3"/>
</parameters>
</configuration>
Reference info-center link for TraceRefreshInterval configuration keyword
: https://www.ibm.com/docs/en/db2/11.5?topic=keywords-tracerefreshinterval
2. Stop the azure function app service if it is already running.
3. Start the azure function app service.
4. Invoke the Azure Function through the web browser by selecting the link provided in the Azure Function and then appending the function name e.g. <FunctionURL>\api\HttpExample
5. Azure function app will display the result/output in the web browser.
6. Modify the db2dsdriver.cfg configuration file by adding "SwitchDb2trace" parameter. Here, D:\home\LogFiles\db2trc.dmp is the location, where we have write permission to capture db2trc dump. Update the db2dsdriver.cfg file as below:
<configuration>
<parameters>
<parameter name="SwitchDb2trace" value="on -f
D:\home\LogFiles\db2trc.dmp"/>
<parameter name="TraceRefreshInterval" value="3"/>
</parameters>
</configuration>
Reference info-center link for SwitchDb2trace configuration keyword
: https://www.ibm.com/docs/en/db2/11.5?topic=keywords-switchdb2trace
7. Refresh the web browser by pressing F5 and reproduce the issue (Problem statement).
8. Once issue is created, Switch off the db2 trace by modifying the db2dsdriver.cfg configuration file as below.
<configuration>
<parameters>
<parameter name="SwitchDb2trace" value="off"/>
<parameter name="TraceRefreshInterval" value="3"/>
</parameters>
</configuration>
9. Refresh the web browser by pressing F5 again.
10. Go to Advanced Tool->go-> Kudu -> Debug Console -> CMD option .Then browse the D:\home\LogFiles\ directory. db2trc.dmp file created, Format the db2trc dump file by executing the below command in Kudu CMD console:
For flow file:
D:\home\LogFiles>d:\home\site\wwwroot\bin\clidriver\bin\db2trc flw db2trc.dmp db2trc.flw
For Format file:
D:\home\LogFiles>d:\home\site\wwwroot\bin\clidriver\bin\db2trc fmt db2trc.dmp db2trc.fmt
For CLI trace:
D:\home\LogFiles>d:\home\site\wwwroot\bin\clidriver\bin\db2trc fmt -cli db2trc.dmp db2trc.cli
For DRDA trace:
D:\home\LogFiles>d:\home\site\wwwroot\bin\clidriver\bin\db2trc fmt -c db2trc.dmp db2trc.fmtc
|