对着月亮发誓,不如顶着太阳做事!
认真的人改变自己,执着的人改变命运!

最近用pcanywhere ,由于经常无故掉线,导致pcanywhere连接时提示:host is busy ,最简单的办法,打电话给机房网管,自己在sql 2005中也可以解决,如下:

--在sql 2005查询分析器中执行
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 开启xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO
--执行想要的xp_cmdshell语句
Exec xp_cmdshell 'net stop awhost32' --执行之,将pcanywhere先停止
GO
--执行想要的xp_cmdshell语句
Exec xp_cmdshell 'net start awhost32' --再次执行,这样pcanywhere就重新启动了
Go

 

--用完后,要记得将xp_cmdshell禁用(出于安全考虑)
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 0
GO
--重新配置
RECONFIGURE
GO


 

posted on 2007-10-11 15:56  抽象的继承  阅读(1303)  评论(2)    收藏  举报