在 sql advantge 中设置
/************************SQL****************/
set showplan on
set noexec on
go
select .......
go
set showplan off
set noexec off
go
/**************PROCEDURE***********/
set showplan on
go
exec sp_name
go
set showplan off
go
/***********************TRACE*******************/
DBCC TRACEON(3604) 信息必须用于要返回到前端的最终结果区域, 和 DBCC TRACEON(3605) 必须用于信息写入到日志:
---------------------------------------------------------
dbcc traceon(3604)
go
dbcc sqltext(spid)
go
---------------------------------------------------------
sp_showplan does not always work
---------------------------------------------------------
You can also get iwatch to sniff out sql statements from the network, iwatch is made by Exact Inc. it is an expensive software.
---------------------------------------------------------
If your ase server is 12.5x and above, you can get the sql statement out from master.dbo.monSysSQLText table. Check $SYBASE/$SYBASE_ASE/scripts/installmontables for details.
---------------------------------------------------------
if your ase version is older than 11.92, try dbcc pss(suid, spid)
To get the usage on dbcc command, try
dbcc traceon(3604)
go
dbcc help(dbcc command)
for example
dbcc help(pss)
go
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/756652/viewspace-242420/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/756652/viewspace-242420/