摘要: 在数据库应用的设计中,我们往往会需要获取某些表的记录总数,用于判断表的记录总数是否过大,是否需要备份数据等。我们通常的做法是:select count(*) as c from tableA 。然而对于记录数巨大的表,上述做法将会非常耗时。在DELL 4400 服务器上做试验,MS Sqlserve 阅读全文
posted @ 2017-06-14 17:17 rosewong 阅读(6263) 评论(0) 推荐(0) 编辑
摘要: 1.服务器迁移之后,将原来的系统数据库覆盖到新的server,用当前windows account出现无法登录的现象,这时有以下几个方法: (1)在原机器上添加新的账号并赋予管理员的权限,然后迁移到新机器; (2)以单用户的模式登录,创建新的login: 1)迁移完成之后,停止sql服务; 2)运行 阅读全文
posted @ 2017-06-14 17:13 rosewong 阅读(426) 评论(0) 推荐(0) 编辑
摘要: Message: Unable to start execution of step 3 (reason: The PowerShell subsystem failed to load [see the SQLAGENT.OUT file for details]; The job has bee 阅读全文
posted @ 2017-06-14 17:05 rosewong 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 1.The database principal owns a schema in the database, and cannot be dropped 2.User:sa trying to delete a user 'test' which exists in the db 'TestDB' 阅读全文
posted @ 2017-06-14 17:03 rosewong 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 1.删除replication,先删除replication的作业,再删除对应的订阅,再删除发布; 2.相关脚本:删除监视器里不存在的条目sp_removedistpublisherdbreplication @publisher = 'publisher server' , @publisher_ 阅读全文
posted @ 2017-06-14 16:45 rosewong 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 默认情况下在日志复制中如果新增加Article那么需要产生一个包含所有Article的Snapshot。由于产生Snapshot会加锁,同时会产生IO操作,所以对于大的数据库性能影响是很大的。 可以通过下面的办法让SQL Server针对增加的Article产生Snapshot。 1. Disabl 阅读全文
posted @ 2017-06-14 16:40 rosewong 阅读(442) 评论(0) 推荐(0) 编辑