To isolate some types of problems, especially problems with queries, log server requests.
Setting the -zr command line option when you start the server, or
Calling the sa_server_option stored procedure, which overrides the current setting of the -zr.
Server requests are logged in *.srvlog. The -zr server startup option enables request-level logging of operations and sets the type of requests to log (SQL | HOSTVARS | PLAN | PROCEDURES | TRIGGERS | OTHER | BLOCKS | REPLACE | ALL | NONE). The -zo option redirects request-level logging information to a file separate from the regular log file. The -zs limits the size of this file.
call sa_server_option('RequestLogging','SQL'); call sa_server_option('RequestLogFile', 'sqllog.txt')To disable request-level logging, use:
call sa_server_option('RequestLogging','NO');To view the current settings for the SQL log file and logging level, execute:
select property('RequestLogFile'), property('RequestLogging');
To match .iqmsg log and the -zr server request log (.srvlog) entries using connection information, correlate connection information between the .srvlog and .iqmsg files.
In addition, more information is recorded in the request log. For queries, the information recorded is isolation level, number of rows fetched, and cursor type. For INSERT, UPDATE, and DELETE statements, the information recorded is number of rows affected and number of triggers fired.
Optionally, you can also choose to log statements executed within procedures and triggers.
You can select to record the short form of query plans in the request log. If procedure logging is enabled, plans for procedure statements are also recorded.
The following output shows an excerpt from the request log, when the server is started with the -zr all option. In this example, the user connects to the iqdemo database and executes sp_iqstatus.
MMdd hhmmss.sss 0523 095954.807,[,1000000001,sp_iq_mpx_init,16,iq utilities status 1For lines after this line, for example, “+13,C,1,UID=DBA”, the offset is from the previous line. In this case, “+13” means that about 13 milliseconds have passed since the last line. In some cases, “=” means approximately 0 milliseconds have elapsed since the last line.
0523 095954.807,[,1000000001,sp_iq_mpx_init,16,iq utilities status 1 +2,],1000000001,sp_iq_mpx_init,16 +1,[,1000000001,sp_iq_mpx_init,62,message STRING('IQ Server ',@@servername,'.') to console +2,],1000000001,sp_iq_mpx_init,62 taj% pg iqdemo.sqllog 0523 095954.807,[,1000000001,sp_iq_mpx_init,16,iq utilities status 1 +2,],1000000001,sp_iq_mpx_init,16 +1,[,1000000001,sp_iq_mpx_init,62,message STRING('IQ Server ',@@servername,'.') to console +2,],1000000001,sp_iq_mpx_init,62 0523 100510.344,<,1,CONNECT +13,C,1,UID=DBA +83,>,1,CONNECT,1 +1,<,1,PREPARE,SELECT @@version, if 'A'<>'a' then 1 else 0 endif, isnull(property('IsIQ'),'NO'), isnull(connection_property('odbc_distinguish_char_and_ varchar'),'Off'), isnull(connection_property('odbc_describe_binary_as_va rbinary'),'Off'), connection_property('charset'), db_property('charset') +1,>,1,PREPARE,65536 =,<,1,EXEC,65536 +79,P,1,[S]DUMMY<seq> =,>,1,EXEC +1,<,1,DROP_STMT,65536 =,>,1,DROP_STMT =,<,1,PREPARE,SET TEMPORARY OPTION time_format = 'hh:nn:ss';SET TEMPORARY OPTION timestamp_format = 'yyyy-mm-dd hh:nn:ss.ssssss';SET TEMPORARY OPTION date_format = 'yyyy-mm-dd';SET TEMPORARY OPTION date_order = 'ymd';SET TEMPORARY OPTION isolation_level = 0; +1,>,1,PREPARE,65537 +1,<,1,EXEC,65537 =,[,1,*batch*,1,set temporary option time_format = 'hh:nn:ss' +11,],1,*batch*,1 =,[,1,*batch*,1,set temporary option timestamp_format = 'yyyy-mm-dd hh:nn:ss.ssssss' +11,],1,*batch*,1 +1,[,1,*batch*,1,set temporary option date_format = 'yyyy-mm-dd' +11,],1,*batch*,1 =,[,1,*batch*,1,set temporary option date_order = 'ymd'+11,],1,*batch*,1 =,[,1,*batch*,1,set temporary option isolation_level = 0 +11,],1,*batch*,1 =,>,1,EXEC