MS Sql Server 2005 ·ÖÇø±íÓеãÂé·³
ALTER DATABASE AdventureWorks ADD FILEGROUP [2003Q3]
´´½¨Îļþ×éºó£¬Ê¹Óà ALTER DATABASE ½«ÎļþÌí¼Óµ½¸ÃÎļþ×éÖС£
ALTER DATABASE AdventureWorks
ADD FILE
(NAME = N'2003Q3',
FILENAME = N'C:\AdventureWorks\2003Q3.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB)
TO FILEGROUP [2003Q3]
È·¶¨ÊÇ·ñӦʹÓöà¸öÎļþ×é
¡¡¡¡ÎªÁËÓÐÖúÓÚÓÅ»¯ÐÔÄܺÍά»¤£¬Ó¦Ê¹ÓÃÎļþ×é·ÖÀëÊý¾Ý¡£Îļþ×éµÄÊýĿһ¶¨³Ì¶ÈÉÏÓÉÓ²¼þ×ÊÔ´¾ö¶¨£ºÒ»°ãÇé¿öÏ£¬Îļþ×éÊý×îºÃÓë·ÖÇøÊýÏàͬ£¬²¢ÇÒÕâЩÎļþ×éͨ³£Î»ÓÚ²»Í¬µÄ´ÅÅÌÉÏ¡£µ«ÊÇ£¬ÕâÖ÷ÒªÊÊÓÃÓÚ´òËã¶ÔÕû¸öÊý¾Ý¼¯½øÐзÖÎöµÄϵͳ¡£Èç¹ûÄúÓжà¸ö CPU£¬SQL Server Ôò¿ÉÒÔ²¢Ðд¦Àí¶à¸ö·ÖÇø£¬´Ó¶ø´ó´óËõ¶Ì´¦Àí´óÁ¿¸´ÔÓ±¨±íºÍ·ÖÎöµÄ×ÜÌåʱ¼ä¡£ÕâÖÖÇé¿öÏ£¬¿ÉÒÔ»ñµÃ²¢Ðд¦ÀíÒÔ¼°ÔÚ·ÖÇø±íÖÐÒÆÈëºÍÒÆ³ö·ÖÇøµÄºÃ´¦¡£
±ßÉϵÄͬÊÂ˵Îļþ×é°üº¬¶à¸öÎļþ¿ÉÒÔÔö¼Ó²¢Ðжȣ¬Ò²¾ÍÊǶà¸öCPU¿ÉÒÔÒ»Æð¶Á£¿
ËûµÄÒâ˼ÄѵÀÊÇ˵²Ù×÷ϵͳ¶Ô³ÌÐò·ÃÎʵ¥¸öÎļþÓÐÏÞÖÆ£¬¶àÁË»°»á×èÈû£¿
Èç¹ûÊǵϰ Windows 2003 64λ ÆóÒµ°æ ÎļþÓдóСÏÞÖÆ Óв¢ÐзÃÎʵÄÏÞÖÆ²»£¿
Ëû»¹Ëµ¿ÉÒÔ°ÑËüÃÇ·ÖÅäµ½²»Í¬´ÅÅÌÉÏ¡£²»¹ýÈç½ñ¶¼ÓÃRaid 10ÁË ²»ÐèÒªÈËΪµÄ·Ö³É¶à¸öÎļþ£¬·´¶øÔö¼Óά»¤¸´ÔÓ¶È¡£
Ëû½Ó×Å˵ ÎļþС¶ø¶à±È´ó¶øÉÙ ÈÝÒ×±¸·Ý£¡
Ëû˵µÄÊÇÕæµÄÂð£¿
Òò´Ë±¾ÈË»¹ÊDzÉÓÃÒ»¸öÎļþ×éºÍÒ»¸öÎļþ.Æäʵ¾ÍÊÇÓÃÔÀ´µÄÊý¾ÝÎļþµÄ.
½¨Á¢·ÖÇøº¯Êý
CREATE PARTITION FUNCTION FuPart_szumevent(datetime)AS RANGE RIGHT FOR VALUES ('20070801','20070901','20071001','20071101','20071201','20080101','20080201','20080301','20080401','20080501','20080601','20080701','20080801','20080901','20081001','20081101','20081201')
ÕâÀï²ÉÓõÄÊÇ·¶Î§·ÖÇø¡£ ÕâÀïÓиöRight ºÍLeft ¡£Right±È½ÏÈÝÒ×Àí½â ËüÊÇСÓÚʱ¼äµãµÄÊÇÁíÍâ¸ö·ÖÇøÊý¾Ý£¬´óÓں͵ÈÓÚËüµÄÊÇËùÔڵķÖÇø¡£
A<Time1<=B<Time2<=C ¶øLeftÊÇ·´¹ýÀ´ A>=Time1>B>=Time2>C
Left ÓиöÂé·³µãÊÇ >=Time1 => 2008-01-01 23:59:59.997
½¨Á¢·ÖÇø¼Ü¹¹£º
CREATE PARTITION SCHEME FNw_szumevent AS PARTITION FuPart_szumevent ALL TO ([PRIMARY])
Æäʵ¾ÍÊǹØÁª¶«¶«£¬»òÐíMsÈÏΪÒÔºóDBA»á¶Ô·ÖÇø±í½øÐиÄÓ÷ÖÇøº¯Êý
½¨Á¢·ÖÇø±í£º
CREATE TABLE [dbo].[Part_
Ïà¹ØÎĵµ£º
ÔÚSQLÓï¾äÓÅ»¯¹ý³ÌÖУ¬ÎÒÃǾ³£»áÓõ½hint,ÏÖ×ܽáÒ»ÏÂÔÚSQLÓÅ»¯¹ý³ÌÖг£¼ûOracle HINTµÄÓ÷¨£º
1. /*+ALL_ROWS*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.
ÀýÈç:
SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT';
2. /*+FIRST_ROWS*/
±í ......
½â¾ö·½·¨...
¹ØÓÚSQL°²×°±»¹ÒÆðµÄÐÞ¸´´ó¼Ò¿ÉÄܶ¼Óöµ½¹ýµ±SQL±»É¾³ýºóÐèÒªÖØÐ°²×°Ê±£¬½øÈë°²×°½çÃæ¾Í»á³öÏÖSQL´íÎóÌáʾ£º
´ÓǰµÄ°²×°³ÌÐò²Ù×÷ʹ°²×°³ÌÐò²Ù×÷¹ÒÆð£¬ÐèÒªÖØÐÂÆô¶¯¼ÆËã»ú
È»¶øÕâЩ¶¼Êǰ׷Ѿ¢£¬²»¹ÜÄãÖØÐÂÆô¶¯¶àÉÙ´ÎÒ²¶¼ÎÞ¼ÃÓÚÊ£¬ÏÂÃæÎҾͽ²½²ÔõÑùÄܹ»½â³ý°²×°»òÉý¼¶Ê±Îļþ±»¹ÒÆðµÄ²Ù×÷¡£
µã»÷ ¿ ......
ÔÚ΢ÈíµÄSQL ServerϵͳÖÐͨ¹ýÓÐЧµÄʹÓÃË÷Òý¿ÉÒÔÌá¸ßÊý¾Ý¿âµÄ²éѯÐÔÄÜ£¬µ«ÊÇÐÔÄܵÄÌá¸ßÈ¡¾öÓÚÊý¾Ý¿âµÄʵÏÖ¡£ÔÚ±¾ÎÄÖн«»á¸æËßÄãÈçºÎʵÏÖË÷Òý²¢ÓÐЧµÄÌá¸ßÊý¾Ý¿âµÄÐÔÄÜ¡£¡¡
¡¡¡¡
¡¡¡¡ÔÚ¹ØÏµÐÍÊý¾Ý¿âÖÐʹÓÃË÷ÒýÄܹ»Ìá¸ßÊý¾Ý¿âÐÔÄÜ£¬ÕâÒ»µãÊǷdz£Ã÷ÏԵġ£ÓõÄË÷ÒýÔ½¶à£¬´ÓÊý¾Ý¿âϵͳÖеõ½Êý¾ÝµÄËٶȾÍÔ½¿ì¡£È»¶ø£¬Ðè ......
C# SQLÊý¾Ý¿â²Ù×÷ͨÓÃÀà
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
namespace Framework.DataBase
{
///
/// ͨÓÃÊý¾Ý¿âÀà
///
public class DataBase
{
private string ConnStr = null;
public DataBase()
{
&nb ......