安装SQL Server后必做12步
12 Essential Steps After Installing SQL Server
By : Sadequl Hussain
Jul 13, 2009
from: http://www.sql-server-performance.com/articles/dba/post_installation_steps_p1.aspx
Rolling out SQL Servers is a key task for
DBAs. While for some DBAs this can be a frequent exercise, others will have to
face it one time or other throughout their career in an organisation.
Successfully planning an installation
requires a fair bit of knowledge about SQL Server and a basic understanding of
the operating system. Once the installation is complete, the system usually
needs some changes to default configuration before production databases can be
rolled out. In this article I list some common steps that I take after
installing a SQL Server. This can be used as a “checklist” to ensure consistency
for all the SQL Servers that you roll out.
Step1: Install the Service Pack, Hotfixes and Cumulative
Updates
This is the first step you should take after
a successful installation. You should always install the latest service pack
available unless there is a clear business cause not to do so. At the time of
this writing, SQL Server 2005 is in service pack level 3 and SQL Server 2008 has
service pack 1. Service packs are freely downloadable from the Microsoft web
site. If there are hotfixes or cumulative updates available after the last
service pack has been released, you should apply them as well. This ensures that
your server is ready with the latest version of the database software. Once all
the patches are installed, make a backup of your system databases and reboot the
server.
Step
2: Configure SQL Services
Although your planning phase should
determine what SQL services you are going to install, there may be occasions
when a service is rolled out but not needed immediately. Perhaps your business
requires you to install a SQL Server and although reporting is not going to be
part of it, management in
相关文档:
写程序的人,往往需要分析所写的SQL语句是否已经优化过了,服务器的响应时间有多快,这个时候就需要用到SQL的STATISTICS状态值来查看了。
通过设置STATISTICS我们可以查看执行SQL时的系统情况。选项有PROFILE,IO ,TIME。介绍如下:
SET STATISTICS PROFILE ON:显示分析 ......
SQL 中的 TRIM 函数
是用来移除掉一个字串中的字头或字尾。最常见的用途是移除字首或字尾的空白。这个函数在不同的资料库中有不同的名称:
MySQL: TRIM(), RTRIM(), LTRIM()
Oracle: RTRIM(), LTRIM()
SQL Server: RTRIM(), LTRIM()
各种 trim 函数的语法如下:
TRIM ([[位置] [要移除的字串] from ] 字串): [位置 ......
SQL注入简单分析
示例语句:
select * from admintable where adminName like '%a%'
在查询中我们一般在a这个地方由界面传入不同的值,当我们在a这里传入的值为“'”单引号时,拼凑成的SQL语句就如下:
select * from admintable where adminName like '%'%'
执行这句语句我们会发现出现以下异常:
......
本系列文章导航
[Oracle]高效的SQL语句之分析函数(一)--sum()
[Oracle]高效的SQL语句之分析函数(二)--max()
[Oracle]高效的SQL语句之分析函数(三)--row_number() /rank()/dense_rank()
[Oracle]高效的SQL语句之分析函数(四)--lag()/lead()
有些时候我们希望得到指定数据中的前n列,示例如下:
得到每个部门薪水最高的 ......
本系列文章导航
[Oracle]高效的PL/SQL程序设计(一)--伪列ROWNUM使用技巧
[Oracle]高效的PL/SQL程序设计(二)--标量子查询
[Oracle]高效的PL/SQL程序设计(三)--Package的优点
[Oracle]高效的PL/SQL程序设计(四)--批量处理
[Oracle]高效的PL/SQL程序设计(五)--调用存储过程返回结果集
[Oracle]高效的PL/SQL程序设计(六)- ......