最近遇到一个奇怪的问题,客户环境数据库的恢复模式为简单,但其日志文件一直无法收缩,即使重启数据库服务也一样。数据库版本为SQL Server2008 SP2,并且配置了订阅,复制订阅的状态是正常的。通过分析与查找资料后发现这是SQL Server 2008的升级bug,具体来说是复制订阅升级脚本的bug导致的问题,现将分析过程和解决方...【阅读全文】
官方手册中关于Flush tables的介绍, Closes all open tables, forces all tables in use to be closed, and flushes the query cache. FLUSH TABLES also removes all query results from the query cache, like the RESET QUERY CACHE statement.其解析就是关闭所有已打开的表对象,同时将查询缓存中的结果清空。就是说...【阅读全文】
日志传送模式中,主数据库故障转移到辅助数据库并将其用作新主数据库的操作步骤手动从主数据库故障转移到辅助数据库, 请确保用 NORECOVERY 备份主服务器上的活动事务日志,如果主服务器已经挂掉,请跳过此步骤。BACKUP LOG database_name TO DISK = 'G:/Backups/********.b...【阅读全文】
update [Pro_Products] set MaxRatio=b.maxRate,MinRatio=b.minRate,MaxTerm=b.maxTerm,minTerm=b.minTerm from Pro_Products A, (select MAX(Term) as maxTerm,MIN(term) as minTerm,MAX(YieldRate) as maxRate,MIN(YieldRate)as minRate,ProductId from Pro_YieldRate group ...【阅读全文】