cancel
Showing results for 
Search instead for 
Did you mean: 

IQ tracing

Former Member
0 Kudos

Hi All,

I did enable the tracing as mentioned in the thread.

CALL sa_server_option( 'RequestLogging', 'ALL');

I dont see the sql statement which was executed.

Accepted Solutions (0)

Answers (3)

Answers (3)

tayeb_hadjou
Advisor
Advisor
0 Kudos

Hi,

Details about SQL tracing are in KBA I provided in previous thread

1. Display Request Logging setting:

select property('requestlogging') ;

If result is "NONE" then option is disabled. Otherwise it is enabled with the Request Level displayed.

2.  Display the current Request Log file name

select property('requestlogfile') ;

3. To specify a Request Log file name

CALL sa_server_option( 'RequestLogFile', 'file_name_zr.out');

4. To enable it or change its level

CALL sa_server_option( 'RequestLogging', 'ALL');

Value "ALL" means full request logging. To see other possible level values and their corresponding functions, refer to IQ SAP help page.

5. To disable it

CALL sa_server_option( 'RequestLogging', 'NONE');

CAUTION.

Request Logging is verbose and could contain sensitive information. Enable it for debugging purpose only and for short duration!

Regards,

Gisung
Advisor
Advisor
0 Kudos

Hi,

If you specify the -zr switch in cfg file, You can get the sql with the following way.

Request Log File Analysis

Use the stored procedures sa_get_request_profile and sa_get_request_times to read the -zr log file and summarize the results.

sa_get_request_profile analyzes the request log to determine the execution times of similar statements, and summarizes the results in the global temporary table

satmp_request_profile

. For example:

call sa_get_request_profile('/sys1/users/jones/iqreqs1_zr.log'); select * from satmp_request_profile;

sa_get_request_times also analyzes the request log to determine statement execution times and summarizes the results in the global temporary table

satmp_request_time

. For example:

call sa_get_request_times('/sys1/users/jones/iqreqs1_zr.log'); select * from satmp_request_time;

** Here are helpful url.

1. Request Log File Analysis

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01771.1604/doc/html/san12...

2. Request logging

SyBooks Online

Regards,

Gi-Sung Jang

saroj_bagai
Contributor
0 Kudos

Check your .srvlog

Former Member
0 Kudos

I did all i see is like this

grep -i ON<table> *.*

<hostname>_SID.001.srvlog:I.  Insert for '/BIC/ON<table>' completed in 0 seconds.  30rows inserted.

saroj_bagai
Contributor
0 Kudos

YOu do not need  'ALL' only SQL will be ok.   You can view the .srvlog on grep for that iqconnection from the .srvlog. If you did specify Request_Log_file , then  SQL should be logged in that file. Default is .srvlog

Former Member
0 Kudos

Hi Saroj,

i did check but there is no sql statement in there when i checked for the same with the table name.

saroj_bagai
Contributor
0 Kudos

Could you please post your .srvlog or attach .srvlog

saroj_bagai
Contributor
0 Kudos

could you please try simple test, login to server and execute sp_iqwho and check .srvlog and see if your command have been logged or not and also check .cfg to for -o startup switch, if it is there then sql logging would be logged in that file

Former Member
0 Kudos

Hi Saroj,

#### LOG DIAGNOSTIC

#-o

is commented will it hamper in tracing the sql statements.

Is it that complicated to trace the sql calls?

saroj_bagai
Contributor
0 Kudos

No It is very simple. if SQL logging have been enabled, without  zo startup switch or RequestLogFile option, then all  your SQL will be logged to your .srvlog, default location is $SYBASE/IQ-16_0/logfiles

e.g from my dbisql session, if I execute:

set chained off

it will be logged in the .srvlog

I. 03/10 15:37:08. <,9167,EXEC_ANY_IMM,set "CHAINED" off

I. 03/10 15:37:08. >.,9167

where 9167 is connection handle

Former Member
0 Kudos

Saroj,

Thanks a ton for the response.

-zo  is enabled but

-o commented out.

So you recommend to have -o set at the startup right in .cfg file.