SQL Server 2005 ·ÖÇø±íʵ¼ù——·ÖÇøÇл»
±¾ÎÄÑÝʾÁË SQL Server 2005 ·ÖÇø±í·ÖÇøÇл»µÄÈýÖÖÐÎʽ£º
1. Çл»·ÖÇø±íµÄÒ»¸ö·ÖÇøµ½ÆÕͨÊý¾Ý±íÖУºPartition to Table£»
2. Çл»ÆÕͨ±íÊý¾Ýµ½·ÖÇø±íµÄÒ»¸ö·ÖÇøÖУºTable to Partition£»
3. Çл»·ÖÇø±íµÄ·ÖÇøµ½ÁíÒ»·ÖÇø±í£ºPartition to Partition¡£
²¢Ö¸³öÁËÔÚ·ÖÇø±í·ÖÇøÇл»¹ý³ÌÖеÄ×¢ÒâÊÂÏî¡£
-- ´´½¨·ÖÇøº¯Êý
create partition function PF_Orders_OrderDateRange(datetime)
as
range right for values (
'1997-01-01',
'1998-01-01',
'1999-01-01'
)
go
-- ´´½¨·ÖÇø·½°¸
create partition scheme PS_Orders
as
partition PF_Orders_OrderDateRange
to ([primary], [primary], [primary], [primary])
go
-- ´´½¨·ÖÇø±í
create table dbo.Orders
(
OrderID int not null
,CustomerID varchar(10) not null
,EmployeeID int not null
,OrderDate datetime not null
)
on PS_Orders(OrderDate)
go
-- ´´½¨¾Û¼¯·ÖÇøË÷Òý
create clustered index IXC_Orders_OrderDate on dbo.Orders(OrderDate)
go
-- Ϊ·ÖÇø±íÉèÖÃÖ÷¼ü
alter table dbo.Orders add constraint PK_Orders
primary key (OrderID, CustomerID, OrderDate)
go
-- µ¼ÈëÊý¾Ýµ½·ÖÇø±í
insert into dbo.Orders
select OrderID, CustomerID, EmployeeID, OrderDate
from dbo.Orders_from_SQL2000_Northwind --£¨×¢£ºÊý¾ÝÀ´Ô´ÓÚ SQL Server 2000 ʾÀýÊý¾Ý¿â£©
go
-- ²é¿´·ÖÇø±íÿ¸ö·ÖÇøµÄÊý¾Ý·Ö²¼Çé¿ö
select partition = $partition.PF_Orders_OrderDateRange(OrderDate)
,rows = count(*)
,minval = min(OrderDate)
,maxval = max(OrderDate)
from dbo.Orders
group by $partition.PF_Orders_OrderDateRange(OrderDate)
order by partition
go
Ò»¡¢Çл»·ÖÇø±íµÄÒ»¸ö·ÖÇøµ½ÆÕͨÊý¾Ý±íÖУºPartition to Table
Ê×ÏȽ¨Á¢ÆÕͨÊý¾Ý±í Orders_1998£¬¸Ã±íÓÃÀ´´æ·Å¶©µ¥ÈÕÆÚΪ 1998 ÄêµÄËùÓÐÊý¾Ý¡£
create table dbo.Orders_1998
(
OrderID int not null
,CustomerID varchar(10) not null
,EmployeeID int not null
,OrderDate datetime not null
) on [primary]
go
create clustered index IXC_Orders1998_OrderDate on dbo.Orders_1998(OrderDate)
go
alter table dbo.Orders_1998 add constrai
Ïà¹ØÎĵµ£º
3¡£±íÄÚÈÝÈçÏÂ
-----------------------------
ID LogTime
1 2008/10/10 10:00:00
1 2008/10/10 10:03:00
1 2008/10/10 10:09:00
2 ¡ ......
[¿ÉÓÃ]Èç¹û³öÏÖ°²×°sql server 2000ÒªÇóCD-KEYµÄÇé¿ö,ÇëʹÓÃregedt32ÕÒ¿ª×¢²á±í,ÔÚÒÔÏÂÖ÷¼ü[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]Öн¨Á¢Ò»¸öDWORD¼ü
SafeDLLSearchMode²¢ÉèֵΪ0
Õâ¸öÊÔ¹ý£¬ÊÇ¿ÉÒÔÓõÄ
H6TWQ-TQQM8-HXJYG-D69F7-R84VM - ......
×÷Õß Haidong Ji ·Òë GoodKid
ÎÒÃǵ±ÖеĴ󲿷ÖÈ˹¤×÷ÔÚÒ»¸öµ¥Ò»µÄ RDBMS ϵͳÖУ¬Èç MSSQL, Oracle, or IBM DB2¡£È»¶ø£¬ÎÒÃÇÈÕÒæ¸Ð¾õµ½£¬ÎÒÃÇÕý´¦ÓÚ²»Í¬µÄÊý¾Ý¿â»·¾³µ±Öв¢ÇÒÐèÒª½â¾öÊý¾ÝµÄ»¥ÓÃÐÔÎÊÌâ¡£
¾¡¹ÜÖ÷ÒªµÄ RDBMS ³§ÉÌÊÔͼȥ×ñѹØϵÊý¾Ý¿âÄ£ÐÍÔÀí£¬²¢ÇÒÓ÷dz£Ð¡µÄ²îÒìȥʵÏÖËüÃÇ¡£ÁíÍ⣬¼¸ºõÖ÷ÒªµÄ ......
½üÈÕ£¬°³Í¨¹ýMS SQL Server 2008µÄÁ´½Ó·þÎñÆ÷²éѯMySQLµÄÊý¾Ý¡£Æäʵ£¬°³ÔÚ¶àÄêÇ°¾ÍʹÓùýÕâ¸ö£¬µ±Ê±ÊÇ·Ö²¼Ê½²éѯExcel±íÊý¾Ý£¬ÏÖÔÚ£¬»»³ÉÒì¹¹Êý¾Ý¿âMySQL¡£°³ÒÔ64λϵͳ˵Ã÷£º
Ê×ÏÈ£¬Windows³ÌÐò·ÃÎÊMySQLÊý¾Ý¿âÐèÒªÇý¶¯³ÌÐò£¬¿ÉÒÔµ½¹Ù·½ÍøÕ¾ÏÂÔØ£¬°³¾ÍÊÇʹÓÃMysql ODBC 5.1 Driver for 64bit£¬Í¨¹ýÊý ......