Fanr

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  MSSQL

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页

摘要:Exec sp_droplinkedsrvlogin DBVIP,NullExec sp_dropserver DBVIPEXEC sp_addlinkedserver @server='DBVIP',--被访问的服务器别名 @srvproduct='', @provider='SQLOLEDB', @datasrc='Server2' --要访问的服务器EXEC sp_addlinkedsrvlogin 'DBVIP', --被访问的服务器别名 'false', NULL, 'sa' 阅读全文
posted @ 2011-03-30 14:33 Fanr_Zh 阅读(383) 评论(0) 推荐(0) 编辑

摘要:Make sure each maintenance job has an output file in a standarddirectory.In the advanced tab under the job steps create an output file. This willallow you to see the full description of the job execution. There isnothing more annoying than not being able to see why a job failed.如何设置作业输出文档:In Object 阅读全文
posted @ 2011-03-30 11:10 Fanr_Zh 阅读(187) 评论(0) 推荐(0) 编辑

摘要:You may find yourself in a position where you need to look at what jobs have been running over a specifiedperiod of time. SQL Server has a stored procedure sphelpjob that will allow you to look at the jobs and what their status is currently, but maybe you need to do some additional processing like s 阅读全文
posted @ 2011-03-30 10:40 Fanr_Zh 阅读(1202) 评论(0) 推荐(0) 编辑

摘要:Whenever SQL Server is restarted, it creates a new error log. If theserver stays up for a while, this can make for a very large error log. I create a job that runs on a daily or weekly basis that executes the sp_cycle_errorlog stored procedure in the master database. This will create a new error lo. 阅读全文
posted @ 2011-03-30 10:13 Fanr_Zh 阅读(290) 评论(0) 推荐(0) 编辑

摘要:This script permit executes the sp_updatestats in all databases at same time.First I create the stored procedure above in an admin database, for sample I create one database with ADMIN name where I put all administration objects create for me. You can create this sp in exist db, if you want.Now you 阅读全文
posted @ 2011-03-30 09:38 Fanr_Zh 阅读(2281) 评论(0) 推荐(0) 编辑

摘要:问题: 有一个库, 做的是 全备份+日志备份,在2011年3月8日,14点产生一次全备份,在14:10分产生日志备份,在14:12分down 机,请问 怎么能恢复 14:10 到 14:12分中的这段数据(前提,前期日志备份全部正确可用),机器硬盘完好。使用方法: 1.如果数据库已经损坏 如果数据库已经损坏,可以使用 backup log {数据库名} to {磁盘逻辑地址} with no_truncate 备份数据库。 因为可能存在对受损数据库备份日志尾部时,日志备份中正常捕获的部分元数据可能不可用。 尾日志备份可捕获日志尾部,即使数据库离线、损坏或缺少数据文件。 这可能导致还原信息命令和 阅读全文
posted @ 2011-03-29 14:07 Fanr_Zh 阅读(631) 评论(0) 推荐(0) 编辑

摘要:优化数据库快照(一)优化数据库快照(二) 阅读全文
posted @ 2011-03-28 16:44 Fanr_Zh 阅读(277) 评论(0) 推荐(0) 编辑

摘要:以下是一些sql server的DBCC命令,可以在优化 sql server时使用。1. DBCC CacheStats:显示存在于当前 buffer Cache 中的对象的信息,例如 :hit rates,编译的对象和执行计划例:DBCC CACHESTATS执行结果(缩略)Object Name Hit Ratio-------------------------Proc0.86420054765378507Prepared0.99988494930394334Adhoc 0.93237136647793051ReplProc0.0Trigger 0.99843452831887947C 阅读全文
posted @ 2011-03-28 16:29 Fanr_Zh 阅读(298) 评论(0) 推荐(0) 编辑

摘要:Detect CPU Bottleneck in SQL ServerBy : Kasim Wirama, MCDBAWhen you have your database server experiencing a problem, there are many possibilities here, such as CPU, memory, hard disk or database configuration itself. There should be a systematic way to trouble shooting performance problem in SQL Se 阅读全文
posted @ 2011-03-28 14:12 Fanr_Zh 阅读(573) 评论(0) 推荐(0) 编辑

摘要:Detecting and Resolving I/O BottleneckBy : Kasim Wirama, MCDBAI/O subsystem is one of critical component in SQL Server. I/O subsystem is used when SQL Server moves page between memory and I/O subsystem. With intensive activity of DML and DDL, SQL Server generates significant log entries and to tempd 阅读全文
posted @ 2011-03-28 13:51 Fanr_Zh 阅读(1044) 评论(0) 推荐(0) 编辑

摘要:Detect Memory Bottleneck in SQL ServerBy : Kasim Wirama, MCDBAThis article, I would like to give information about memory bottleneck at SQL Server. The easiest way to know whether your SQL Server undergoes memory bottleneck is by looking at Task Manager, tab Performance, Physical Memory section. Com 阅读全文
posted @ 2011-03-28 13:07 Fanr_Zh 阅读(444) 评论(0) 推荐(0) 编辑

摘要:SQL Server内存还会影响性能,而如果在SQL Server系统中有太多的内存就是浪费钱,内存太少就又对性能十分有害。遗憾的是,决定你什么时候在系统里需要更多的内存很灵活。当内存出现问题时,你就会发现disk I/O就会增加,同样磁盘列队也会增加。你也会发现buffer cache hit ratio减少、page life会延长。随着内存需求的增加,你就会开始发现日志文件里的错误信息。 SQL Server内存的一个重要部分已经分开了,这样一来就造成了性能退化。持续时间:%n秒、工作组(KB):%w、committed (KB)::%c、内存利用:%u。 SQL Server遇到了%. 阅读全文
posted @ 2011-03-27 18:46 Fanr_Zh 阅读(804) 评论(0) 推荐(0) 编辑

摘要:sql server 2000 订阅发布 同步数据报错时间: 2011-3-26背景: 生产数据库有100+G,需要做一个订阅发布来容灾。订阅为请求订阅,分发服务器和发布服务器是同一个服务器问题: 发布订阅都已经完毕,在数据库使用快照同步时,报错: 报错内容大致如下: bcp 遇到意外的eof。 网上也有同类型的报错,但是很多都是因为发生错误的那张表中存在LOB数据类型导致。 该报错表上没有LOB字段,但是有一个varchar(2000)的字段,数据一共也只有100+(R)。 具体是否是varchar(2000)字段引起需要经过测试。解决办法: 使用手工同步快照 阅读全文
posted @ 2011-03-27 17:12 Fanr_Zh 阅读(329) 评论(0) 推荐(0) 编辑

摘要:概述“数据库镜像”是一种针对数据库高可用性的基于软件的解决方案。其维护着一个数据库的两个相同的副本,这两个副本分别放置在不同的SQL Server数据库实例中。建议使用不同位置的两台服务器来承载。在同一时刻,其中一台上的数据库用于客户端访问,充当“主体服务器”角色;而另一台则根据镜像会话的配置和状态,充当热备份服务器,即“镜像服务器角色”,这两种角色不是绝对的。优点l 增强了数据保护功能l 提高了数据库的可用性l 提高了生产数据库在升级期间的可用性工作方式在“数据库镜像会话”中,主体服务器和镜像服务器是相互通信和协作,并双方互补。主体服务器角色上的数据库副本为生产数据库。数据库镜像会尽快将主体 阅读全文
posted @ 2011-03-27 12:57 Fanr_Zh 阅读(558) 评论(0) 推荐(1) 编辑

摘要:利用动态管理视图提高SQL Server索引效率(一)利用动态管理视图提高SQL Server索引效率(二)利用动态管理视图提高SQL Server索引效率(三) 阅读全文
posted @ 2011-03-26 17:33 Fanr_Zh 阅读(259) 评论(0) 推荐(0) 编辑

摘要:优化数据库的注意事项: 1、关键字段建立索引。 2、使用存储过程,它使SQL变得更加灵活和高效。 3、备份数据库和清除垃圾数据。 4、SQL语句语法的优化。(可以用Sybase的SQL Expert,可惜我没找到unexpired的序列号) 5、清理删除日志。 SQL语句优化的基本原则: 1、使用索引来更快地遍历表。 缺省情况下建立的索引是非群集索引,但有时它并不是最佳的。在非群集索引下,数据在物理上随机存放在数据页上。合理的索引设计要建立在对各种查询的分析和预测上。一般来说:①.有大量重复值、且经常有范围查询(between, >,< ,>=,< =)和order b 阅读全文
posted @ 2011-03-26 14:30 Fanr_Zh 阅读(335) 评论(0) 推荐(0) 编辑

摘要:方法一: 现象:数据库Log日志太大了,shrink不掉。于是想把数据库文件卸下来,删除log,再附加上。附加失败。 提示错误: 服务器: 消息 1813,级别 16,状态 2,行 1 未能打开新数据库 'metadb'。CREATE DATABASE 将终止。 设备激活错误。物理文件名 'd:\metadb.LDF' 可能有误。 环境:MSSQL SERVER 2000 企业版 解决过程: 1.建一个新库newdb 2.停掉数据库。删除新库的log文件,讲metadb.mdf覆盖newdb.mdf。 3.启动数据库服务器。数据库newdb的状态为“置疑”。 4 阅读全文
posted @ 2011-03-26 13:49 Fanr_Zh 阅读(7466) 评论(0) 推荐(0) 编辑

摘要:SQL Server 同步订阅数据库 出现 主键不唯一错误修改如下:分发数据库的系统存储过程sp_msget_repl_commands进行修改后就可以了,将其中定义临时表中的一个字段的数据类型修改,declare @snapshot_seqnos table(subscription_seqno varchar(16) primary key),将varchar(16)改为varbinary(16)。 阅读全文
posted @ 2011-03-25 12:55 Fanr_Zh 阅读(292) 评论(0) 推荐(0) 编辑

摘要:net stop sqlserveragent net stop mssqlserver net start mssqlserver net start sqlserveragent 阅读全文
posted @ 2011-03-24 15:22 Fanr_Zh 阅读(346) 评论(0) 推荐(0) 编辑

摘要:SQL Server中事务日志自动增长对性能的影响(上)SQL Server中事务日志自动增长对性能的影响(下) 阅读全文
posted @ 2011-03-23 20:23 Fanr_Zh 阅读(487) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页