首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 数据库 第二书店 程序员

zdg/ 


共35个网摘 [ 1  2 ]  下一页  |  访问zdg的个人空间

只让指定的机器连接SQLServer服务器

zdg收录,使用标签:SQLSERVER,时间:2008-6-20 16:09:44 | 相关网摘我也收藏

当SQL Server 2005升级到SP2或者更高的版本的时候,还可以通过新增的触发器来实现控制。
执行下面的T-SQL后,将使除IP地址为192.168.1.1之外的客户端连接失败。
USE master
GO
CREATE TRIGGER tr_LoginCheck
ON ALL SERVER
FOR LOGON
AS
IF EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'varchar(15)') <> '192.168.1.1'
ROLLBACK TRAN
GO


SQL Server 2005 中的DDL触发器应用

zdg收录,使用标签:SQLSERVER,时间:2008-6-20 15:57:57 | 相关网摘我也收藏

DDL 触发器像标准触发器一样,在响应事件时执行存储过程。但与标准触发器不同的是,它们并不在响应对表或视图的 UPDATE、INSERT 或 DELETE 语句时执行存储过程。它们主要在响应数据定义语言 (DDL) 语句执行存储过程。这些语句包括 CREATE、ALTER、DROP、GRANT、DENY、REVOKE 和 UPDATE STATISTICS 等语句。


数据库设计方案经典推荐

zdg收录,使用标签:DataBase, Performance, SQLServer,时间:2008-1-21 19:21:04 | 相关网摘我也收藏

大型系统的生产环境,一般情况下,我们评价一条查询是否有效率,更多的是关注逻辑IO(至于为什么,回头补一篇)。我们常说,“要建彪悍的索引”、“要写高效的SQL”,其实最终目的就是在相同结果集情况下,尽可能减少逻辑IO。


应用Profiler优化SQL Server数据库系统

zdg收录,使用标签:SQLServer, Performance,时间:2007-12-26 1:19:42 | 相关网摘我也收藏

当你的SQL Server数据库系统运行缓慢的时候,你或许多多少少知道可以使用SQL Server Profiler(中文叫SQL事件探查器)工具来进行跟踪和分析。是的,Profiler可以用来捕获发送到SQL Server的所有语句以及语句的执行性能相关数据(如语句的read/writes页面数目,CPU的使用量,以及语句的duration等)以供以后分析。但本文并不介绍如何使用Profiler 工具,而是将介绍如何使用read80trace(有关该工具见后面介绍)工具结合自定义的存储过程来提纲挈领地分析Profiler捕获的Trace文件,最终得出令人兴奋的数据分析报表,从而使你可以高屋建瓴地优化SQL Server数据库系统。

本文对那些需要分析SQL Server大型数据库系统性能的读者如DBA等特别有用。在规模较大、应用逻辑复杂的数据库系统中Profiler产生的文件往往非常巨大,比如说在Profiler中仅仅配置捕获基本的语句事件,运行二小时后捕获的Trace文件就可能有GB级的大小。应用本文介绍的方法不但可以大大节省分析Trace的时间和金钱,把你从Trace文件的海量数据中解放出来,更是让你对数据库系统的访问模式了如指掌,从而知道哪一类语句对性能影响最大,哪类语句需要优化等等。


小议ID生成算法

zdg收录,使用标签:Arithmetic, SQLServer,时间:2007-11-19 15:59:20 | 相关网摘我也收藏

替代方案之三,就是把ID分成两部分,Seed和IncrementID。Seed采用上面的方案二或者其他办法生成,IncrementID使用一个AtomicInteger来每次递增生成。SEED转化为九进制数字,这样SEED就不会包含9,于是使用9作为分隔符,把SEED和IncrementID隔开。这样做,就可以做高性能产生ID,而且确保不重复。甚至可以更进一步,SEED由一个中心服务器生成。使用9个分隔符号隔开SEED和IncrementID,好处是SEED是变长,而不是使用固定位数来保存SEED,这样产生的ID会更短,可读性更好。


SQL里的EXISTS与in、not exists与not in

zdg收录,使用标签:SQLServer,时间:2007-8-29 16:52:55 | 相关网摘我也收藏

综合以上对IN/EXISTS的讨论,我们可以得出一个基本通用的结论:IN适合于外表大而内表小的情况;EXISTS适合于外表小而内表大的情况。


MSSQL优化之——探索MSSQL执行计划

zdg收录,使用标签:Performance, SQLServer,时间:2007-8-16 0:04:36 | 相关网摘我也收藏

实现同一查询功能的SQL写法可能会有多种,如果判断哪种最优化,如果仅仅是从时间上来测,会受很多外界因素的影响,而我们明白了MSSQL如何去执行,通过IO逻辑读、通过查看图示的查询计划、通过其优化后而执行的SQL语句,才是优化SQL的真正途径。

另外提醒下:数据量的多少有时会影响MSSQL对同一种查询写法语句的执行计划,这一点在非聚集索引上特别明显,还有就是在多CPU与单CPU下,在多用户并发情况下,同一写法的查询语句执行计划会有所不同,这个就需要大家有机会去试验了


ClearTrace - Read80Trace for SQL Server 2005

zdg收录,使用标签:Tools, ClearTrace, SQLServer,时间:2007-4-26 17:53:56 | 相关网摘我也收藏

ClearTrace imports SQL Server 2000 and 2005 trace (and profiler) files into SQL Server and displays summary performance information. It is designed to provide the same performance summary as Read80Trace but in a graphical environment and for SQL Server 2005.


Arrays and Lists in SQL Server

zdg收录,使用标签:SQLServer,时间:2007-2-6 0:35:37 | 相关网摘我也收藏

In the public forums for SQL Server, you often see people asking How do I use arrays in SQL Server? Or Why does SELECT * FROM tbl WHERE col IN (@list) not work? This text describes several methods to do this, both good and bad ones. I also present data from performance tests of the various methods.


SQL Server2005性能调优(简化翻译版) - 3

zdg收录,使用标签:SQLServer, Performance,时间:2006-12-16 14:54:46 | 相关网摘我也收藏

我个人认为,更好的利用这些DMVs和sp的前提是,对于sql的基本概念要有所了解。索引、锁、阻塞、死锁等,为什么会产生,他们在SqlServer这种数据库下面是如何处理的,等等。否则,看着那些DMVs,很容易发懵。


SQL Server2005性能调优(简化翻译版) - 2

zdg收录,使用标签:SQLServer, Performance,时间:2006-12-16 14:54:15 | 相关网摘我也收藏

每个实例只有一个tempdb,所以这里很可能成为性能或者磁盘空间的瓶颈。


SQL Server Best Practices

zdg收录,使用标签:SQLServer, Performance,时间:2006-12-9 15:39:20 | 相关网摘我也收藏

Get the real-world guidelines, expert tips, and rock-solid guidance to take your SQL Server implementation to the next level. Drawing on the extensive experience and expertise from respected developers and engineers at Microsoft as they walk you through the specifics on solving particularly difficult issues.


Sql Server Performance Tuning(捅破窗户纸续2)

zdg收录,使用标签:Performance, Debug, SQLServer,时间:2006-12-8 18:39:11 | 相关网摘我也收藏

SQL调优的最终目的,就是大幅度的降低I/O大小,减少阻塞,避免死锁。


恢复误删数据(SQL Server 2000)--Log Explorer

zdg收录,使用标签:Tools, SQLServer,时间:2006-11-27 23:04:40 | 相关网摘我也收藏

今天不小心把客户那边的数据库中删了一千多条数据,而且之前又没有备份,真的是很郁闷,后来在网上找到一工具,用起来挺方便,让我躲过一劫。


海量数据库的查询优化及分页算法方案

zdg收录,使用标签:SQLServer,时间:2006-11-1 23:13:34 | 相关网摘我也收藏

本篇文章汇集了笔者近段在使用数据库方面的心得,是在做“办公自动化”系统时实践经验的积累。希望这篇文章不仅能够给大家的工作带来一定的帮助,也希望能让大家能够体会到分析问题的方法;最重要的是,希望这篇文章能够抛砖引玉,掀起大家的学习和讨论的兴趣,以共同促进,共同为公安科技强警事业和金盾工程做出自己最大的努力。


提高查询速度方法总结

zdg收录,使用标签:SQLServer,时间:2006-10-27 17:15:46 | 相关网摘我也收藏

这个帖子主要总结提高查询速度的方法,涉及到减少连接数据库次数、建立索引、优化语句等方面。


A More Efficient Method for Paging Through Large Result Sets

zdg收录,使用标签:SQLServer, 分页,时间:2006-10-27 1:28:27 | 相关网摘我也收藏

It is amazing the amount of cycles, hardware and brain ware, go into paging results efficiently. Recently Scott Mitchell authored an article titled Efficiently Paging Through Large Result Sets in SQL Server 2000 that looked at a stored procedure that returned a particular "page" of data from a table. After examining Scott's approach, I saw some potential improvements in his method. (If you haven't yet perused Scott's technique, take a moment to do so before continuing here, as this article builds upon Scott's example.)

Scott's approach made use of a table variable to generate a synthetic ID to act as a row counter. Every time a page is requested, all of the data in the table being paged must be read and inserted into the table variable in order to generate the synthetic ID, at which point a SELECT statement returns just those records whose IDs fall within the desired range. While Scott's method is faster than blindly returning all of the records, his approach can be greatly improved by using ROWCOUNT to greatly reduce the number of records that must be read and inserted into the table variable.

In this article we'll look at two ways to improve Scott's method. The first approach uses a table variable (just like Scott's), but utilizes the SET ROWCOUNT command to reduce the number of records read and inserted into the table variable. The second technique more cleverly uses SET ROWCOUNT to provide an even more efficient approach than the first. Read on to learn more!


ROW_NUMBER() OVER Not Fast Enough With Large Result Set

zdg收录,使用标签:SQLServer, 分页,时间:2006-10-27 1:27:53 | 相关网摘我也收藏

思归: Erik Porter 在开发下一个版本的Channel 9 中发现 SQL Server 2005 中的 ROW_NUMBER OVER 函数在海量数据(譬如250,000行)的情形下分页性能有点问题,最后采用了Greg Hamilton 的SET ROWCOUNT方案,把查询时间从8秒减小到少于1秒!

Currently, to do paging we've been using the ROW_NUMBER OVER function. It's a new feature of SQL Server 2005 and is very simple and easy to use. Unfortunately, it doesn't work very well with a lot of rows (250,000 for example). I did some searching and came across this gem of an article. It uses an interesting trick to use SET ROWCOUNT to get the first record to start with in a paged result set, then you just run the query again and set the row count again to the number you want where the values are greater than the first row from the starting point of the paged result set and man is it snappy. Do check it out if you're having troubles with performance of ROW_NUMBER() OVER.


Tom的法则:当你开发数据库软件时

zdg收录,使用标签:SQLServer,时间:2006-10-26 18:32:25 | 相关网摘我也收藏

1.我们应该尽量使用单个SQL陈述来实现应用需求
2.如果单个SQL无法实现,考虑使用PL/SQL来实现
3.如果PL/SQL无法实现,接下来可以尝试使用Java存储过程来实现
4.如果Java过程也不行,尝试使用C的外部存储过程来解决
5.如果以上都不能实现,那么你应该认真考虑你为什么要实现这个需求...


Ten hacker tricks to exploit SQL Server systems

zdg收录,使用标签:Security, SQLServer,时间:2006-3-21 18:47:35 | 相关网摘我也收藏

Whether it is through manual poking and prodding or the use of security testing tools, malicious attackers employ a variety of tricks to break into SQL Server systems, both inside and outside your firewall. It stands to reason then, if the hackers are doing it, you need to carry the same attacks to test the security strength of your systems. Here are 10 hacker tricks to gain access and violate systems running SQL Server.


下一代数据访问:使概念级别成为现实

zdg收录,使用标签:.NET开发, DataBase, SQLServer,时间:2006-7-27 18:00:03 | 相关网摘我也收藏

通过将抽象级别从逻辑(关系)级别提高到概念(实体)级别来消除应用程序和数据服务(例如,作为 SQL Server 产品一部分提供的报告、分析和复制服务)两方面的阻抗失谐。


SQL Server 2005 – Automating Creation of Database Snapshots

zdg收录,使用标签:DataBase, SQLServer,时间:2006-6-12 10:14:15 | 相关网摘我也收藏

SQL Server 2005 is packed with many new features. One of the new features that I would like to discuss in this article is Database Snapshots, which are read only static views of a database. SQL Server 2005 allows you to create multiple snapshots on a database. In this article, I would like to demonstrate the creation of database snapshots and automating the creation of database snapshots.


MSSQL Server 2005 Replication Step by Step

zdg收录,使用标签:DataBase, SQLServer,时间:2006-6-10 3:07:36 | 相关网摘我也收藏

Replication is designed to increase data availability by distributing the data across multiple database servers. Availability is increased by allowing applications to scale out the SQL Server read workload across databases. SQL Server 2005 offers enhanced replication using a new peer-to-peer model that provides a new topology in which databases can be synchronized transactionally with any identical peer database.


十个探测SQL Server 2000漏洞的技巧或工具

zdg收录,使用标签:SQLServer, Security,时间:2006-3-21 18:46:14 | 相关网摘我也收藏

看到这篇文章之后,感觉到每个SQL Server 2000都有可以"挖掘"和"探索"的漏洞(还好现在用SQL Server 2005居多),告诫自己以后每次部署SQL Server 2000/2005的时候,都要从这些工具箱中选出几个,试一下。SQL injection 无处不在,要时刻保持安全警惕性。


大数据量下的数据库日期操作问题

zdg收录,使用标签:SQLServer,时间:2006-2-14 22:35:08 | 相关网摘我也收藏

奇怪了,第三条语句执行起来飞快,虽然问题是曲线解决了,可这又是为什么?难道和索引的排序次序有关?欢迎大家讨论。


无废话-SQL Server 2005新功能(1) - TSQL

zdg收录,使用标签:SQLServer,时间:2006-1-20 16:32:01 | 相关网摘我也收藏

SQL Server 2005相对于SQL Server 2000改进很大,有些还是非常实用的。


SQL Server的5年期待

zdg收录,使用标签:SQLServer,时间:2005-11-7 22:31:39 | 相关网摘我也收藏

从SQL Server 2000到SQL Server 2005,不仅仅是数据库系统具有更高的性能、处理能力,新版本的系统还带来了许多新的、在旧版本中从未出现的特性。而这些新特性也都是和现代数据库的发展方向一致的。例如,对XML的支持、在SQL语言中嵌入高级语言的支持。在企业环境中,更注重安全性、高可用性、集成的管理工具等。



共35个网摘 [ 1  2 ]  下一页

zdg/相关标签



网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
Copyright © 2000-2008, CSDN.NET, All Rights Reserved