Articles of sql server 2008

改进SQL Server 2008中的自动故障转移scheme

我们将SQL Server 2008与主体,镜像和监视器服务器一起设置,镜像被同步并设置为自动故障转移。 我们最近发现,在主服务器上空间不足的情况下,尽pipe应用程序运行的每个查询都返回了一个错误,但它使用数据库使应用程序瘫痪,但并未导致故障切换: The transaction log for database 'XXXX' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases 我试图找出为什么故障转移没有发生。 是因为镜像/见证人仍然认为服务器已经启动,因为它正在响应ping和查询(所有这些都是有错误的)? 还是这是我们错误的configuration? 我们是否需要在应用程序层添加代码来检测这样的数据库错误并启动故障转移? 同时,我们正在改进我们的监控,以尽量避免磁盘空间问题,但我们仍然希望提高自动故障切换的可靠性。

SQL Server 2008快照复制触发器启动

我已经设置了生产服务器和临时服务器。 每当我们在发布周期中我们想要开始testing的时候,我想把生产数据库复制到我们的临时服务器上。 我已经设置了快照复制来完成这个工作,并且设置了登台服务器来对生产数据库进行拉取订阅。 我希望我的持续集成服务器能够启动这个过程。 如何以编程方式触发要创build和复制的快照? 如果有办法触发这个过程,有什么方法可以知道什么时候结束?

如何configurationMunin montior Microsoft SQL Server 2008

是否可以configurationMunin montior Microsoft SQL Server 2008? 在Windows 2003 Server上。

SQL Server 2008超时过期

我问了Stackoverflow下面的问题没有任何答案,但是,有人build议我问serverfault上的问题也。 希望有人能帮助。 我最近将ASP.Net MVC 3 Web应用程序(用于数据持久性的entity framework4.1)发布到实时服务器。 该应用程序位于一个Web服务器上,而数据库(SQL Server 2008)位于另一个单独的服务器上。 这个网站只用了几天的时间,只有很less的命中,因此数据库表中包含的logging很less(最多10-20个)。 我也有ELMAH(错误logging模块和处理程序的ASP.NET)集成到网站,我已收到以下错误的几个实例 System.Data.SqlClient.SqlException:超时过期。 操作完成之前超时的时间或服务器没有响应。 下面显示了由ELMAH提供的全部细节 System.Data.EntityException:底层提供程序在打开时失败。 —> System.Data.SqlClient.SqlException:超时过期。 操作完成之前超时的时间或服务器没有响应。 在System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj,UInt32错误)System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()System.Data.SqlClient.SqlInternalConnection.OnError(SqlExceptionexception,布尔breakConnection) .SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult,TdsParserStateObject stateObj)在System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()在System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(布尔encryption,布尔trustServerCert,布尔&marsCapable)在System.Data。 SqlClient.TdsParser.Connect(ServerInfo serverInfo,SqlInternalConnectionTds connHandler,布尔ignoreSniOpenTimeout,Int64计时器展开,布尔encryption,布尔trustServerCert,布尔integratedSecurity)在System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo,stringnewPassword,布尔ignoreSniOpenTimeout,TimeoutTimer超时, SqlConnection拥有对象)在System.Data.S (SqlConnection拥有对象,超时计时器超时,SqlConnectionString连接选项,SQL Server数据库连接选项),qlClient.SqlInternalConnectionTds.LoginWithFailover(布尔useFailoverHost,ServerInfo primaryServerInfo,stringfailoverHost,stringnewPassword,布尔redirectedUserInstance,SqlConnection拥有对象,SqlConnectionString连接选项,TimeoutTimer超时)在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity身份,SqlConnectionString connectionOptions,对象providerInfo,stringnewPassword,SqlConnection拥有对象,布尔redirectedUserInstance)stringnewPassword,布尔redirectedUserInstance)对象poolGroupProviderInfo,DbConnectionPool池,DbConnection拥有连接)在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection,DbConnectionPoo (DbConnection拥有对象)在System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection拥有对象)在System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection拥有对象)System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection拥有对象) .Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)在System.Data.SqlClient.SqlConnection.Open()在System.Data.EntityClient.EntityConnection。 OpenStoreConnectionIf(布尔openCondition,DbConnection storeConnectionToOpen,DbConnection originalConnection,stringexceptionCode,string企图操作,布尔和closeStoreConnectionOnFailure)—结束内部exception堆栈跟踪—在System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(布尔openCondition,DbConnection storeConnectionToOpen,DbConnection要么 在System.Data.EntityClient.EntityConnection.Open()在System.Data.Objects.ObjectContext.EnsureConnection()在System.Data.Objects.ObjectQuery 1.GetResults(Nullable 1 forMergeOption 1.GetResults(Nullable iginalOption,String exceptionCode,String attemptedOperation,Boolean&closeStoreConnectionOnFailure) )在System.Data.Objects.ObjectQuery 1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Collections.Generic.List […]

Sql Server – 最小权限能够授予其他人类似的权利

我想在我们的开发和testing环境中授予我们的Web开发团队中的其他用户(其他Web开发人员以及他们创build的应用程序用户)datareader,datawriter和exec sproc。 我需要什么让他能够做到这一点? 我想给他最小的成就。

在整个数据库中进行stringsearch和replace

在ASP.NET网站上进行攻击之后,客户端留下了一个特定的恶意代码string,这个恶意代码string遍布整个数据库,多个表中的多列。 前缀string是一致的,不会因表格而有所不同,所以理论上如果我可以在整个数据库中进行search和replace,可以在一个操作中清除。 我可以在PostgreSQL或MySQL中很容易地做到这一点: mysqldump bad_db | sed 's/evilcode//g' | mysql fixed_db 但是,如何用SQLServer做这样的事情呢? 我不确定它在Windows下非常简单。

无法从sql server标准连接到sql server express

…像我的标题说…我不能连接到我的实例在SQL Server Express从SQL Server标准…我已经尝试禁用发射墙和检查sqlbrowser已经启动,但由于某种原因,我不能连接到我的datbase .. 。叫做server_name \ sqlexpress .. 我有一台虚拟机和全面运行的MS SQL Server 2008 R2 …我还有几个运行sqlexpress的vm。 他们运行良好,我可以使用sqlexpress连接到他们…但是当我尝试从sqlserver访问…我得到这个错误。 与SQL Serverbuild立连接时发生networking相关或特定于实例的错误。 服务器未find或无法访问。 validation实例名称是否正确,并将SQL Serverconfiguration为允许远程连接。 (提供程序:SQLnetworking接口,错误:26 – 错误定位服务器/实例指定)(Microsoft SQL Server,错误:-1) 深入挖掘错误,我发现了这一点 错误编号:-1严重性:20状态:0 最后这个… Program Location: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection […]

通过SQL Server Management Studio更改表 – 获取SQL

在devise视图中更改表格时,是否有办法让pipe理工作室运行ALTER语句?

从SQL Server 2008升级到SQL Server 2008 R2时出错

我需要将数据库(在SQL Server 2008 R2中创build – 版本10.50.1600)还原到Server 2008(版本 – 10.00.2531)中的新数据库。 我得到了错误 – 恢复服务器失败…. Additional info System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. That incompatible with the server which is running version 10.00.2531. Either restore the database on a server that supports the backup or use a backup that is compatible with […]

安装MS SQL Server 2008 R2利用数据arrays

也许我不能把find我在网上find的查询放在一起,但我想确保这样做是正确的。 我有一个新的服务器,Windows Server 2008 R2加载到RAID 1configuration。 我需要安装SQL Server 2008 R2才能利用我在此服务器上的RAID 1 + 0(10)configuration。 我了解这些基本知识: 将数据库(mdf)文件托pipe在数据arrays(RAID 10分区)上 在OSarrays(RAID 1分区)上托pipe日志(ldf)文件 我需要澄清的是SQL Server的实际安装。 例如,我应该将程序文件放在数据数组上吗? 我应该把名字实例放在数据数组上吗? 如果没有,SQL Server实际安装的最佳实践是什么? 其余的我可以很容易search谷歌。 如果有人有任何build议,方向或资源,我会很感激。 提前致谢!