If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix Jedi Wanted: Peeking at interactive users SQL statements?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-01-03, 07:32
GoldenBoy GoldenBoy is offline
Registered User
 
Join Date: Sep 2003
Posts: 10
Informix Jedi Wanted: Peeking at interactive users SQL statements?

Good morning all,
I have a little SQL script that allows me to see the SQL thats going on behind the 4GL apps that our users run from a menu option. This shop (and I use that word loosely) is missing lots of source code and so it comes in pretty handy when I need to reverse engineer a report or something so I can manually recreate. Heres the script:

select username, sqx_sessionid, sqx_conbno, sqx_sqlstatement
from syssqexplain, sysscblst
where username='someuser'
and length(sqx_sqlstatement) > 0
order by sqx_sessionid DESC;

This isnt pretty, but its handy. Anyway, anyone have a guess as to why it is I can use this on 4GL apps but NOT use it to see SQL submitted form a DBAccess session? I really would like to log SQL statements submitted through DBAccess by our programming staff because they are constantly dropping tables accidentally or doing updates incorrectly and of course no one admits who did what thus my need to see a log of SQL statements! I know it sounds crazy, but I spend at least 20 hours a month restoring a database just to recover one table that a programmer was to lazy to unload before fouling up.
-thanks
__________________
Karma...it works regarless of your belief in it.
Reply With Quote
  #2 (permalink)  
Old 10-01-03, 11:30
fprose fprose is offline
Registered User
 
Join Date: Apr 2003
Location: Phoenix, AZ
Posts: 177
Well, not to be picky, but you have presented an invalid SQL statement. There is no join between the tables.

At best you get a snapshot of the "current" SQL statement - which could be hours old. You will never see all SQL statements unless you are running them through ISpy.

If you're trying to catch programmers improperly using admin commands I suggest you look at auditing in the Trusted Facility Manual. You can set exactly which events you wish to log, like drops or creates.
__________________
Fred Prose
Reply With Quote
  #3 (permalink)  
Old 10-01-03, 12:13
dnix dnix is offline
Registered User
 
Join Date: Sep 2002
Posts: 51
...reply

Well, your right about the sql - it was just a typo. But I was thinking for some reason that ISpy was no longer an option since IBM swallowed Informix up. I have read a little abouit it and I will check it out.
-thanks

Quote:
Originally posted by fprose
Well, not to be picky, but you have presented an invalid SQL statement. There is no join between the tables.

At best you get a snapshot of the "current" SQL statement - which could be hours old. You will never see all SQL statements unless you are running them through ISpy.

If you're trying to catch programmers improperly using admin commands I suggest you look at auditing in the Trusted Facility Manual. You can set exactly which events you wish to log, like drops or creates.
__________________
When in doubt just ask your self,
-WWSBD?-
(what would Sponge Bob do?)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On