Try this TSQL:
SELECT (SELECT [Value] FROM sa_eng_properties() WHERE PropName IN
('ActiveReq')) as ActiveReq,
(SELECT [Value] FROM sa_eng_properties() WHERE PropName IN
('UnschReq')) as UnschReq,
(CONVERT(integer, ActiveReq)+CONVERT(integer, UnschReq)) AS
TotalRequests,
Activity.number AS Number,
CONNECTION_PROPERTY('Name',Number) AS connection_name,
Activity.userID,
(select facility from fmds.FMDS_USERS WHERE USER_NAME =
Activity.userID) facility,
IF LENGTH(TRIM(CAST(Activity.lastReqTime AS CHAR(200)))) > 0
THEN DATEDIFF(ms,Activity.lastReqTime,now(*))/1000.0
ELSE
DATEDIFF(ms,TheLoginTime,now(*))/1000.0
ENDIF AS duration_sec,
Activity.lastReqTime,
CONNECTION_PROPERTY('LoginTime',number) as TheLoginTime,
CONNECTION_PROPERTY('TempFilePages',Number) as TempFilePages,
CONNECTION_PROPERTY('ApproximateCPUTime',Number) as
ApproximateCPUTime,
CONNECTION_PROPERTY('PrepStmt',Number) as PrepStmt,
CONNECTION_PROPERTY('LockCount',Number) as LockCount,
CONNECTION_PROPERTY('BlockedOn',Number) as BlockedOn,
CONNECTION_PROPERTY('DiskRead',Number) as DiskRead,
CONNECTION_PROPERTY('DiskWrite',Number) as DiskWrite,
CONNECTION_PROPERTY('LogWrite',Number) as LogWrite,
CONNECTION_PROPERTY('NodeAddress',Number) as IPAddr,
CONNECTION_PROPERTY('ReqType',Number) as requestType,
CONNECTION_PROPERTY('CurrentProcedure',Number) as Cur_sp,
CONNECTION_PROPERTY('CurrentLineNumber',Number) as Cur_line,
CONNECTION_PROPERTY('ReqStatus',Number) as ReqStatus,
Activity.lastStatement
FROM dbo.sa_conn_activity() as Activity
WHERE (requestType NOT IN('COMMIT','CURSOR_CLOSE','PREFETCH') AND (ReqStatus
<> 'Idle') AND (duration_sec > 900)) OR
(Activity.number IN (SELECT CONNECTION_PROPERTY('BlockedOn',Number)
FROM dbo.sa_conn_activity()) OR BlockedOn > 0) --shows blocker connection
info
ORDER BY Activity.number ASC;
Best regards,
Rachan Terrell
"Nick Elson [Sybase iAnywhere]" <@nick@dot@elson@at@sybase@dot@com@> wrote
in message news:4b02bc3d$1 (AT) forums-1-dub (DOT) ..
Quote:
Is there a substitute of sp_who2 in ASA7?
sp_who2 may be something that is home grown but the rough
equivalent to sp_who would be sa_conn_info( ).
How can we find out what activity is going on the server..?
There are a number of tools for this. Sybase Central has
a number of features built into it as properties of the server, database
and connections. The system stored procedure equivalents to that include
these procedures
sa_conn_info( )
sa_conn_properties( )
sa_eng_properties( )
sa_db_info( )
sa_db_properties( )
amoung many others.
There is also a request level logging facility [see the -zr and -zo
switches, and sa_server_option( ) ] and I beleive there
may have even been a perl script [under a sample by the name of
PerformanceTraceTime] to help analyze the output from that.
Of course upgrading to a current versions offers many more
tools.
"Deepali" wrote in message news:4b028b12.a68.1681692777 (AT) sybase (DOT) com...
Is there a substitute of sp_who2 in ASA7. How can we find
out what activity is going on the server..?
|