SYBASE執行計劃

zhouwf0726發表於2019-06-28
SYBASE執行計劃:


在 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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章