当前位置: 代码迷 >> Sql Server >> 问个关于connection string的,timeout了,该怎么处理
  详细解决方案

问个关于connection string的,timeout了,该怎么处理

热度:98   发布时间:2016-04-27 13:05:22.0
问个关于connection string的,timeout了
Error是这么写滴
“timeout expired. the timeout period elapsed 。。。”之类的

我们的环境是这样子滴
一台服务器,里面包括了一个database和几个application
其他几个application都可以连接的好好的,就一个有timeout的问题

==================================================================

仔细比对connection string

发现可以连的是这么写的:
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

timeout的是这么写的:
Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;

==================================================================

因为我不懂application的东西,google之后说:
第一个是 .NET Framework Data Provider for SQL Server
第二个是Native Client OLE DB, ODBC 之类的
这个纯属猜测,我只是比对了一下User ID和Uid之类的这几个,在http://www.connectionstrings.com/sql-server-2008看了看。。

但是我的config file里面没有写到Provider是谁之类的

==================================================================

请问我的timeout问题是不是跟connection string有关呢
我把可以连的那个copy到timeout的那个,也是不能用啊
但是没看到Provider在哪里define的

我要哭了
有没有遇到过的给点经验啊,帮忙提供点线索也好哇

===================================================================


------解决方案--------------------
dbcc open tran --看这个库有没有未提交的事务
sp_who
sp_who2
动态管理视图 查锁
sp_lock
SQL code
SELECT count(*)*8 AS cached_pages_kb    ,obj.name ,obj.index_id,b.type_desc,b.nameFROM sys.dm_os_buffer_descriptors AS bd    INNER JOIN    (        SELECT object_name(object_id) AS name            ,index_id ,allocation_unit_id,object_id        FROM sys.allocation_units AS au            INNER JOIN sys.partitions AS p                ON au.container_id = p.hobt_id                    AND (au.type = 1 OR au.type = 3)        UNION ALL        SELECT object_name(object_id) AS name              ,index_id, allocation_unit_id,object_id        FROM sys.allocation_units AS au            INNER JOIN sys.partitions AS p                ON au.container_id = p.partition_id                    AND au.type = 2    ) AS obj        ON bd.allocation_unit_id = obj.allocation_unit_id        LEFT JOIN sys.indexes b on b.object_id = obj.object_id AND b.index_id = obj.index_id WHERE database_id = db_id()GROUP BY obj.name, obj.index_id ,b.name,b.type_descORDER BY cached_pages_kb DESC;
------解决方案--------------------
连接没有问题。 连接超时你看下是不是网络问题。
------解决方案--------------------
sp_readerrorlog 不是 xp_readerrorlog 他是记录从上次数据库引擎开启后到现在...的所有信息..包裹你打开查询分析器的时候他先调用那个数据,在根据model建立那些库! 什么时候出现过错误!
  相关解决方案