Fanr

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页

2012年2月15日

摘要: A Performance Troubleshooting Methodology for SQL Server28 September 2011byJonathan KehayiasWhenhealing a sickSQL Server, you must forget the idea that therecould ever bea simple correspondence between symptom and disease: The art of troubleshooting is much more the art of discovering, and assemblin 阅读全文
posted @ 2012-02-15 14:30 Fanr_Zh 阅读(2427) 评论(1) 推荐(0) 编辑

摘要: 今天在 相同环境测试 2000 和 2008 性能让我意外的是 2008 明显比2000 慢很多测试sql:SET STATISTICS IO ONSET STATISTICS TIME ON SELECT COUNT(1) FROM dbo.tbtext a INNER LOOP JOIN dbo.tbtext b ON a.id = b.id option (maxdop 1)SET STATISTICS IO OffSET STATISTICS TIME Off 表结构:CREATE TABLE [dbo].[tbtext]( [id] [int] IDENTI... 阅读全文
posted @ 2012-02-15 13:19 Fanr_Zh 阅读(4484) 评论(5) 推荐(0) 编辑

2012年2月14日

摘要: Investigating perfomance bottlenecks in SQL Server 2008 bylooking at wait events using the XE trace systemIntroduction.In my previous articlesSQL Server Wait Events: Taking the Guesswork out of Performance Profiling, andTaking the Guesswork out of SQL Server Performance Profiling Part 2,I introduced 阅读全文
posted @ 2012-02-14 12:41 Fanr_Zh 阅读(1497) 评论(0) 推荐(0) 编辑

2012年2月12日

摘要: Taking the Guesswork out of SQL Server Performance Profiling Part 218 May 2007byMario BroodbakkerIn the previous article,Dude, where's my time, I described a method, based on use of SQL Server wait events, for measuring response time and pinpointing the main bottlenecks in your SQL Server applic 阅读全文
posted @ 2012-02-12 20:29 Fanr_Zh 阅读(2269) 评论(0) 推荐(0) 编辑

摘要: SQL Server Wait Events: Taking the Guesswork out of Performance Profiling22 March 2007byMario BroodbakkerMeasuring what is actually happening is always the best course of action when investigating performance issues on databases, rather than relying on cache hit ratios, or best practices, or worst o 阅读全文
posted @ 2012-02-12 18:56 Fanr_Zh 阅读(2012) 评论(0) 推荐(0) 编辑

2012年2月10日

摘要: 非聚集索引和聚集索引的区别不在不会详细说明非聚集索引和聚集索引的结构有什么不一样,因为这种东西网上已经说的很多了。一个表一旦建立了聚集索引,那么那张表就是一张被b树重新组织过的表。而没聚集索引表就是一个堆表。什么是b树,什么是堆表就不解释了。小弟对,非聚集索引状况下 和 聚集索引状况下的 常量绑定和变量绑定做了测试。会发在这边是因为聚集索引的变量绑定的执行计划,和非聚集索引的变量绑定的执行计划不一样。use northwindCREATE INDEX idx_orderdate_orders ON dbo.Orders(OrderDate)DBCC FREEPROCCACHE SELECT * 阅读全文
posted @ 2012-02-10 11:28 Fanr_Zh 阅读(1323) 评论(2) 推荐(0) 编辑

2012年2月8日

摘要: --1. 查看数据库northwind 是否启用 全文索引 SELECT * FROM sys.databasesUSE NorthWind--2.创建全文目录CREATE FULLTEXT CATALOG [employee_fulltext]WITH ACCENT_SENSITIVITY = OFFAS DEFAULT--3. 指定唯一索引CREATE FULLTEXT INDEX ON [dbo].[Employees] KEY INDEX [PK_Employees] ON ([employee_fulltext]) WITH (CHANGE_TRACKING AUTO)--4... 阅读全文
posted @ 2012-02-08 10:12 Fanr_Zh 阅读(575) 评论(0) 推荐(0) 编辑

2012年2月3日

摘要: 这问题今天纠结了我一天了。下面的代码是网上转载来的create partition function PF_Orders_OrderDateRange(datetime)asrange right for values ('1997-01-01','1998-01-01','1999-01-01')go-- 创建分区方案create partition scheme PS_Ordersaspartition PF_Orders_OrderDateRangeto ([primary], [primary], [primary], [primary] 阅读全文
posted @ 2012-02-03 16:41 Fanr_Zh 阅读(2380) 评论(0) 推荐(0) 编辑

2012年2月2日

摘要: SQL Server 备份中又很多术语,让阅读联机文档的读者感到很蛋疼,很纠结,不知道那个是那个。介质集/媒体集(联机文档中尽然有2中叫法,让俺们初学者很蛋疼):备份介质有序的集合。备份介质/备份媒体:应该是备份设备的一个统称。物理备份设备:这个比较简单,就是大家常用的 disk='c:\xxx.bak'。逻辑备份设备:通过sp_adddumpdevice 定义,使用方法为 disk = xxx。介质簇/媒体簇:我也不知道干嘛用的介质标头:如果是一样的标头的备份那么和起来就是一个介质集。备份集:成功的备份操作将向介质集中添加一个“备份集”。下面结合一下backup 语句:BAC 阅读全文
posted @ 2012-02-02 16:49 Fanr_Zh 阅读(830) 评论(0) 推荐(1) 编辑

摘要: 表连接的方式如join,semi-join,outer-join,anti-join;表连接的实现方式如nested loop,merge,hash.本文简单的介绍表连接的方式join,semi-join,outer-join,anti-join和适用情景。假设2个数据源(row source).Emp(id pk,ename,deptno) Dept(deptno pk,dname)如下是joinselect ename,dname from emp,dept where emp.deptno=dname.deptno;2个数据源键值一一比较,返回相互匹配的记录集for example: n 阅读全文
posted @ 2012-02-02 10:25 Fanr_Zh 阅读(5256) 评论(0) 推荐(0) 编辑

2012年1月30日

摘要: 虚拟日志文件剖析(转) 阅读全文
posted @ 2012-01-30 15:32 Fanr_Zh 阅读(323) 评论(0) 推荐(0) 编辑

2012年1月16日

摘要: 网上有很多 except 和 not in的返回结果区别这里就就提了。主要讲 except 和 not in 的性能上的区别。CREATE TABLE tb1(ID int) CREATE TABLE tb2(ID int)BEGIN TRANDECLARE @i INT = 500WHILE @i > 0beginINSERT INTO dbo.tb1VALUES ( @i -- v - int )SET @i = @i -1endCOMMIT我测试的时候tb1 是1000,tb2 是500 DBCC FREESYSTEMCACHE ('ALL','defaul 阅读全文
posted @ 2012-01-16 15:01 Fanr_Zh 阅读(2436) 评论(2) 推荐(0) 编辑

2011年12月12日

摘要: from:http://www.sql-server-performance.com/2011/restoring-sql-server-database-low-disk-space/Performing a Database Restore is a part of a DBA’s daily life. A DBA may need to perform a Restore due to various reasons such as recovery, refreshing a database for testing purpose etc. Many times it can be 阅读全文
posted @ 2011-12-12 14:12 Fanr_Zh 阅读(1000) 评论(0) 推荐(0) 编辑

2011年12月10日

摘要: 对于SQLOS的任务调度,简单的画了一个框架示意图。如果对SQLOS十分了解的可以上来评论给予意见。小弟感激不尽 阅读全文
posted @ 2011-12-10 11:13 Fanr_Zh 阅读(442) 评论(0) 推荐(0) 编辑

2011年12月9日

摘要: 在SQL Server中存储方式主要分为2大类 缓冲和池。都是用来临时存放数据的,到底有什么不同。一直很恼人。有幸看到一位大牛的博客,截取了其中讲述cache 和 pool的不同点。Before we jump into further description of stores I would like to explain a difference between meanings of caches and pools. In SQLOS's world, cache is a mechanism to cache heterogeneous type of data with 阅读全文
posted @ 2011-12-09 13:20 Fanr_Zh 阅读(736) 评论(1) 推荐(0) 编辑

摘要: 以下观点可能和实际情况有点不符合,因为本人没有阅读过微软的内部文档,也找不到其他资料只能根据现有的资料,推测,希望懂的人或者牛人能够指点。指出其中的问题,欢迎拍砖普通内存分配方式: 图的左边,是普通内存分配方式。 当程序中的虚拟内存提交时,程序会向系统申请内存,系统会分配一个PFN,一个PFN包含了很多信息,主要是代表内存页,有时候也可以把它看成内存页,这样比较容易理解 PTE是如果从VAS 也就是 虚拟内存,提交到物理内存时,PTE会记录映射的信息。 普通分配的基本流程可能是这样。申请到PFN 后,PTE 会映射到相应的PFN,并把VAS中的页读到PFN对应的物理内存页中。 这个感... 阅读全文
posted @ 2011-12-09 00:02 Fanr_Zh 阅读(3098) 评论(0) 推荐(0) 编辑

2011年12月7日

摘要: from:http://blogs.msdn.com/b/slavao/archive/2005/02/11/371063.aspxSQLOS's memory manager consists of several components such as memory nodes, memory clerks, memory caches, and memory objects. Fig 1. depicts memory manager components and their relationship:----------------|Memory Object|--------- 阅读全文
posted @ 2011-12-07 15:51 Fanr_Zh 阅读(505) 评论(0) 推荐(0) 编辑

2011年11月28日

摘要: 主要是和普通的索引进行对比:/******************** 准备数据 ******************/select * into ColumnStoreTest from northwind..ordersdeclare @i int set @i = 12while(@i > 0)begin insert into ColumnStoreTest select * from ColumnStoreTest union all select * from ColumnStoreTest set @i = @i-1e... 阅读全文
posted @ 2011-11-28 14:35 Fanr_Zh 阅读(1138) 评论(1) 推荐(0) 编辑

2011年11月17日

摘要: 下载:附件SQL2008,SQL2005存储过程解密第一步操作步骤:'程序'->'Sql Server2005'-> '配置工具'-> 'Sql Server 外围应用配置器'-> '功能的外围应用配置器'-> 'DataBase Engine'-> 'DAC' -> '启用远程DAC' 第二步:启动SQL Server Browser 服务 第三部使用DAC模式登陆(关键就在这个地方) 1 登陆SQL Server Mana 阅读全文
posted @ 2011-11-17 21:10 Fanr_Zh 阅读(622) 评论(1) 推荐(0) 编辑

2011年11月16日

摘要: 工具:VS 2010,.Net 3.5(特别提示.net 4不支持)环境:PS V2,Windows 7using System;using System.Collections.Generic;using System.Text;using System.Management.Automation;using System.Collections;using System.Management;using System.Collections.ObjectModel;namespace Snapin{ [Cmdlet(VerbsCommon.Get, "Hi")] pub 阅读全文
posted @ 2011-11-16 23:22 Fanr_Zh 阅读(687) 评论(0) 推荐(0) 编辑

摘要: 可下载附件/***********************主机ANNATROV*******************************//*数据库镜像主机:ANNATROV备机:JOHN见证机:KATE以上三台机器均:XP SP3;SQL SERVER 2008 SP1.备机,见证机均为VM虚拟机,主机为本机由于系统是XP,所以没有做域.因此采用证书认证方式来连接.所以,如果要用于透明数据加密的请注意.MASTER证书可以共用,需要建的是数据库证书.数据库要能够互相访问,不懂的端口的可以把防火墙关掉.由于数据库镜像只对数据库内数据进行同步,因此主库上的(msdb)作业,(master). 阅读全文
posted @ 2011-11-16 10:29 Fanr_Zh 阅读(933) 评论(0) 推荐(0) 编辑

2011年11月15日

摘要: -- 创建要使用的数据库Create Database HelloWorldDBgoUse HelloWorldDBgo-- 创建要使用的两种消息类型。我们要使用的消息将是-- 字符串而不是 XML - 因此无需进行验证CREATE MESSAGE TYPE [HelloWorldRequest] VALIDATION = NONE CREATE MESSAGE TYPE [HelloWorldResponse] VALIDATION = NONE -- 创建一个限制此对话框中消息类型-- 的规范。请求由对话框的初始化程序发出-- 响应消息由对话框目标发送。CREATE CONTRACT... 阅读全文
posted @ 2011-11-15 14:04 Fanr_Zh 阅读(263) 评论(0) 推荐(0) 编辑

2011年11月11日

摘要: 很多开发人员都想成为一名数据库培训,也有很多人一开始就把自己定位成为一名DBA,DBA究竟需要掌握些什么知识和技能呢?以下是我 做DBA工作和面试DBA时,整理的一些DBA方面的三十个问题,三十个大问题中还有许多小的问题,涵括了SQL Server 2008 R2培训比较多的技术知识点,与大家分享下,希望给有志做DBA的朋友们一些帮助:1. char、varchar、nvarchar之间的区别(包括用途和空间占用);xml类型查找某个节点的数据有哪些方法,哪个效率高;使用存储过程和使用T-SQL查询数据有啥不一样;2.系统DB有哪些,都有什么作用,需不需要做备份,为什么;损坏了如何做还原(.. 阅读全文
posted @ 2011-11-11 09:54 Fanr_Zh 阅读(471) 评论(0) 推荐(0) 编辑

2011年11月3日

摘要: Transparent data encryption (TDE) is a new feature in Microsoft SQL Server 2008 Enterprise edition and in my opinion one of the best small features to come out of this release. It is a source of annoyance that you have to fork out the not inconsiderable sum of money for the Enterprise Edition in ord 阅读全文
posted @ 2011-11-03 13:18 Fanr_Zh 阅读(294) 评论(0) 推荐(0) 编辑

2011年10月31日

摘要: Deadlockingoccurs when two user processes have locks on separate objects and each process is trying to acquire a lock on the object that the other process has. When this happens, SQL Server identifies the problem and ends the deadlock by automatically choosing one process and aborting the other proc 阅读全文
posted @ 2011-10-31 09:37 Fanr_Zh 阅读(447) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页