Rebuild indexes online with SQL Server 2005
Rebuild indexes online with SQL Server 2005
http://blogs.techrepublic.com.com/datacenter/?p=249
Online index rebuild
SQL Server 2005 introduces the ability to rebuild your indexes in an
online fashion so that other processes are able to access the table
while the rebuild is occurring. Because you can access the indexes
during the rebuild, you are not limited to only rebuilding indexes
during off-peak hours.
To accomplish this, the database engine takes some special actions
to rebuild the index and to allow access to the index at the same time.
The original index will remain available to users for reading data and
data modification. Row versioning is used to allow for transactional
consistency. During the rebuild, a new index is created that mimics the
old index. Any data modifications that alter the original index will
also be applied to this index by SQL Server during the rebuild. This
new index is not read from at all — it is write-only. It is essential
that you have enough available disk space to accommodate the data for
the two concurrent indexes during the online rebuild. While the rebuild
is taking place, SQL Server uses a mapping index to determine records
to modify in the new index when modifications occur in the original
index. Once the rebuild process has finished, any queries or data
modifications occur to the new index, and the original index is dropped.
Example
The process to rebuild an index online is not much different than
the typical rebuild process; however, there are a few ways to
accomplish the rebuild. One way is to simply drop the index using a
DROP INDEX statement followed by a CREATE INDEX statement. Rebuilding
indexes in this fashion leaves the table without an index until the
index is completely created. For this reason (and a number of other
reasons), dropping the index and recreating it is not recommended.
The CREATE INDEX statement can still be used to rebuild an index if
the DROP_EXISTING option is u
相关文档:
在这里,我所指的版本是指的2000,2005,2008这样的版本区别,而不是企业版,开发版这样的版本区别.从官方的说法来看,SQL Server是允许数据库从低版本向高版本恢复,但不支持高版本向低版本的恢复,如果我们用高版本的数据库在低版本的数据库引擎下恢复,会出现什么错误描述呢?
......
SQL常用字符串函数
一、字符转换函数
1、ASCII()
返回字符表达式最左端字符的ASCII 码值。在ASCII()函数中,纯数字的字符串可不用‘’括起来,但含其它字符的字符串必须用‘’括起来使用,否则会出错。
2、CHAR()
将ASCII 码转换为字符。如果没有输入0 ~ 255 之间 ......
MS SQL Server查询优化方法
作者:xmllover 2007-11-29
查询速度慢的原因很多,常见如下几种
1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷)
2、I/O吞吐量小,形成了瓶颈效应。
3、没有创建计算列导致查询不优化。
4、内存 ......
在SQL Server 2005 Express 上附加从另外一台电脑Copy过来的数据库后,数据库为“只读”。
解决办法:
打开 SQL Server Configuration Manager, 打开SQL Server SQLEXPRESS 的属性
在内置帐号处,把“网络服务”改成“本地系统”,重新启动SQL Server 2005 Express 后,再附加数据 ......