dbTalk Databases Forums  

Is there a substitute of sp_who2 in ASA7..?

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Is there a substitute of sp_who2 in ASA7..? in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deepali
 
Posts: n/a

Default Is there a substitute of sp_who2 in ASA7..? - 11-17-2009 , 05:37 AM






Is there a substitute of sp_who2 in ASA7. How can we find
out what activity is going on the server..?

Reply With Quote
  #2  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: Is there a substitute of sp_who2 in ASA7..? - 11-17-2009 , 09:07 AM






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( ).

Quote:
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...
Quote:
Is there a substitute of sp_who2 in ASA7. How can we find
out what activity is going on the server..?

Reply With Quote
  #3  
Old   
Rachan Terrell
 
Posts: n/a

Default Re: Is there a substitute of sp_who2 in ASA7..? - 12-02-2009 , 12:44 PM



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..?

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.