Sql Server 2005连接限制

时间:2008-10-02 19:03:40

标签: sql-server sql-server-2005

Sql Server 2005 Developers Edition是否存在连接限制。我们有许多线程抓取连接,我知道ADO.NET会进行连接池,但是我得到OutOfMemory异常。我们取出数据库连接,它工作正常。

4 个答案:

答案 0 :(得分:4)

这是对Euan Garden(Visual Studio Team Edition的程序经理)博客的回答:

DE的内存,db大小或procs没有限制,它本质上是Enterprise Edition。 但是,存在许可限制,阻止其在生产中使用。

因此,您可能只需要确保正确关闭连接对象。 使用块非常适合这样的工作......

答案 1 :(得分:3)

您可能无法正确关闭或处置连接对象。确保您的代码看起来像这样:

using (SqlConnection conn = new SqlConnection("connectionstring"))
{
    conn.Open();

    // database access code goes here
}

使用块将自动关闭并处理您的连接对象。

答案 2 :(得分:2)

企业版

32767


< ServerProductVersion> 9.00.3235.00< / ServerProductVersion>
< ServerProductLevel> SP2< / ServerProductLevel>
< ServerEdition> Enterprise Edition< / ServerEdition>
< ServerEngineEdition> 3< / ServerEngineEdition>

我如何检查...

创建功能[dbo] .svfV1GetSessionAndServerEnvironmentMetaData 退回xml 如 BEGIN

-- Declare the return variable here
DECLARE @ResultVar xml

-- Add the T-SQL statements to compute the return value here
SET @ResultVar =
    (
        SELECT  
            @@SPID                                          as  SPID,
            @@ProcID                                        as  ProcId,
            @@DBTS                                          as  DBTS,
            getdate()                                       as  DateTimeStamp,
            System_User                                     as  SystemUser,
            Current_User                                    as  CurrentUser,
            Session_User                                    as  SessionUser,
            User_Name()                                     as  UserName,
            Permissions()                                   as  UserSessionPermissionsBitmap,
            Host_Id()                                       as  HostId,
            Host_Name()                                     as  HostName,
            App_Name()                                      as  AppName,

            ServerProperty('ProcessId')                     as  ServerProcessId,
            ServerProperty('MachineName')                   as  ServerMachineName,
            ServerProperty('ServerName')                    as  ServerServerName,
            ServerProperty('ComputerNamePhysicalNetBIOS')   as  ServerComputerNamePhysicalNetBIOS,
            ServerProperty('InstanceName')                  as  ServerInstanceName,
            ServerProperty('ProductVersion')                as  ServerProductVersion,
            ServerProperty('ProductLevel')                  as  ServerProductLevel,

            @@CONNECTIONS                                   as  CumulativeSqlConnectionsSinceStartup,
            @@TOTAL_ERRORS                                  as  CumulativeDiskWriteErrorsSinceStartup,
            @@PACKET_ERRORS                                 as  CumulativeNetworkPacketErrorsSinceStartup,

            --Note:  
            --If the time returned in @@CPU_BUSY, or @@IO_BUSY exceeds approximately 49 days of cumulative CPU time, 
            --you receive an arithmetic overflow warning. In that case, 
            --the value of @@CPU_BUSY, @@IO_BUSY and @@IDLE variables are not accurate. 
        --  @@CPU_BUSY * @@TIMETICKS                        as  CumulativeMicroSecondsServerCpuBusyTimeSinceStartup,
        --  @@IO_BUSY * @@TIMETICKS                         as  CumulativeMicroSecondsServerIoBusyTimeSinceStartup,
        --  @@IDLE * @@TIMETICKS                            as  CumulativeMicroSecondsServerIdleTimeSinceStartup,

            ServerProperty('BuildClrVersion')               as  ServerBuildClrVersion,
            ServerProperty('Collation')                     as  ServerCollation,
            ServerProperty('CollationID')                   as  ServerCollationId,
            ServerProperty('ComparisonStyle')               as  ServerComparisonStyle,
            ServerProperty('Edition')                       as  ServerEdition,
            ServerProperty('EditionID')                     as  ServerEditionID,
            ServerProperty('EngineEdition')                 as  ServerEngineEdition,
            ServerProperty('IsClustered')                   as  ServerIsClustered,
            ServerProperty('IsFullTextInstalled')           as  ServerIsFullTextInstalled,
            ServerProperty('IsIntegratedSecurityOnly')      as  ServerIsIntegratedSecurityOnly,
            ServerProperty('IsSingleUser')                  as  ServerIsSingleUser,
            ServerProperty('LCID')                          as  ServerLCID,
            ServerProperty('LicenseType')                   as  ServerLicenseType,
            ServerProperty('NumLicenses')                   as  ServerNumLicenses,
            ServerProperty('ResourceLastUpdateDateTime')    as  ServerResourceLastUpdateDateTime,
            ServerProperty('ResourceVersion')               as  ServerResourceVersion,
            ServerProperty('SqlCharSet')                    as  ServerSqlCharSet,
            ServerProperty('SqlCharSetName')                as  ServerSqlCharSetName,
            ServerProperty('SqlSortOrder')                  as  ServerSqlSortOrder,
            ServerProperty('SqlSortOrderName')              as  ServerSqlSortOrderName,

            @@MAX_CONNECTIONS                               as  MaxAllowedConcurrentSqlConnections,

            SessionProperty('ANSI_NULLS')                   as  SessionANSI_NULLS,
            SessionProperty('ANSI_PADDING')                 as  SessionANSI_PADDING,
            SessionProperty('ANSI_WARNINGS')                as  SessionANSI_WARNINGS,
            SessionProperty('ARITHABORT')                   as  SessionARITHABORT,
            SessionProperty('CONCAT_NULL_YIELDS_NULL')      as  SessionCONCAT_NULL_YIELDS_NULL,
            SessionProperty('NUMERIC_ROUNDABORT')           as  SessionNUMERIC_ROUNDABORT,
            SessionProperty('QUOTED_IDENTIFIER')            as  SessionQUOTED_IDENTIFIER
        FOR XML PATH('SequenceIdEnvironment')
    )   
-- Return the result of the function

RETURN @ResultVar

END

我的SQL Server数据库引擎实例上的

返回


< SequenceIdEnvironment>
< SPID> 56< / SPID>
< ProcId> 1666821000< / ProcId>
< DBTS> AAAAAAAAB9A =< / DBTS>
< DateTimeStamp> 2008-10-02T15:09:26.560< / DateTimeStamp> ...
< CurrentUser> dbo< / CurrentUser>
< SessionUser> dbo< / SessionUser>
< UserName> dbo< / UserName>
< UserSessionPermissionsBitmap> 67044350< / UserSessionPermissionsBitmap>
< HostId> 3852< / HostId> ...
< AppName> Microsoft SQL Server Management Studio - 查询< / AppName>
< ServerProcessId> 508< / ServerProcessId> ...
< ServerProductVersion> 9.00.3235.00< / ServerProductVersion>
< ServerProductLevel> SP2< / ServerProductLevel>
< CumulativeSqlConnectionsSinceStartup> 169394< / CumulativeSqlConnectionsSinceStartup>
< CumulativeDiskWriteErrorsSinceStartup> 0< / CumulativeDiskWriteErrorsSinceStartup>
< CumulativeNetworkPacketErrorsSinceStartup> 0< / CumulativeNetworkPacketErrorsSinceStartup>
< ServerBuildClrVersion> v2.0.50727< / ServerBuildClrVersion>
< ServerCollat​​ion> SQL_Latin1_General_CP1_CI_AS< / ServerCollat​​ion>
< ServerCollat​​ionId> 872468488< / ServerCollat​​ionId>
< ServerComparisonStyle> 196609< / ServerComparisonStyle>
< ServerEdition> Enterprise Edition< / ServerEdition> ...
< ServerEngineEdition> 3< / ServerEngineEdition>
< ServerIsClustered> 0< / ServerIsClustered>
< ServerIsFullTextInstalled> 1< / ServerIsFullTextInstalled>
< ServerIsIntegratedSecurityOnly> 0< / ServerIsIntegratedSecurityOnly>
< ServerIsSingleUser> 0< / ServerIsSingleUser> ...
< ServerResourceLastUpdateDateTime> 2008-03-12T18:59:08.633< / ServerResourceLastUpdateDateTime>
< ServerResourceVersion> 9.00.3235< / ServerResourceVersion>
< ServerSqlCharSet> 1< / ServerSqlCharSet>
< ServerSqlCharSetName> iso_1< / ServerSqlCharSetName>
< ServerSqlSortOrder> 52< / ServerSqlSortOrder>
< ServerSqlSortOrderName> nocase_iso< / ServerSqlSortOrderName> **
< MaxAllowedConcurrentSqlConnections> 32767< / MaxAllowedConcurrentSqlConnections> **
< SessionANSI_NULLS> 1< / SessionANSI_NULLS>
< SessionANSI_PADDING> 1< / SessionANSI_PADDING>
< SessionANSI_WARNINGS> 1< / SessionANSI_WARNINGS>
< SessionARITHABORT> 1< / SessionARITHABORT>
< SessionCONCAT_NULL_YIELDS_NULL> 1< / SessionCONCAT_NULL_YIELDS_NULL>
< SessionNUMERIC_ROUNDABORT> 0< / SessionNUMERIC_ROUNDABORT>
< SessionQUOTED_IDENTIFIER> 1< / SessionQUOTED_IDENTIFIER>
< / SequenceIdEnvironment>

答案 3 :(得分:0)

来自.NET的内存不足吗?如果错误发生在服务器上,您可能会看到连接被拒绝的消息。