2012-03-14 3 views
1

우리 팀은 파티션을 생성 소스 제어에있는 스크립트를 실행하려고하고 우리는 다음과 같은 오류로 실행중인 : 스크립트의 CREATE/ALTER partition function failed as only a maximum of 1000 partitions can be created.SQL 서버의 파티션을 최대한 활용하는 방법은 무엇입니까?

부 :

CREATE PARTITION FUNCTION [PFDailyPartition](DATETIME) 
    AS RANGE RIGHT FOR VALUES ('01/01/2005 00:00:00' 
'01/02/2005 00:00:00' 
'01/03/2005 00:00:00' 
'01/04/2005 00:00:00' 
'01/05/2005 00:00:00' 
'01/06/2005 00:00:00' 
'01/07/2005 00:00:00' 
'01/08/2005 00:00:00' 
'01/09/2005 00:00:00' 
'01/10/2005 00:00:00' 
'01/11/2005 00:00:00' 
'01/12/2005 00:00:00' 
'01/13/2005 00:00:00' 
'01/14/2005 00:00:00' 
etc... 

우리의 현재 설정에 select * from sys.partition_range_values 실행 우리는 10,000 개가 넘는 파티션이 있음을 보여줍니다.

이 1000 한계를 벗어날 방법이 있습니까? 우리는이 파티션이 이미 얼마나 많은지 알 수 없습니다.

두 설정간에 환경적인 차이가있을 수 있습니까?

미리 감사드립니다.

답변

4

파티션 기능이 하루에 별도의 파티션을 생성합니다. 그것은 많은 파티션입니다! 2005 년 이래로 이것은 대략 365 * 7 = 2,555 개의 파티션이됩니다. 당신은 정말로 하루에 분리 된 파티션을 원하십니까?

this article에 따르면 SQL Server 2008 SP2 및 SQL Server 2008 R2 SP1에서는 제한이 15,000 개의 파티션으로 증가했습니다. 서버 간 서비스 팩 차이가 있습니까?

기사에서 인용 :

Problem

SQL Server 2005 introduced table and index partitioning. Partitioning can make large tables and indexes more manageable and scalable. For more information about partitioning, see Partitioned Tables and Indexes (http://msdn.microsoft.com/en-us/library/ms188706(v=SQL.100).aspx). In SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2, the number of partitions is limited to 1,000.

Customers primarily use partitioning to facilitate the management of large fact tables in data warehouses. Data warehouse customers commonly load data as a batch. Daily loads are the most common pattern, but increasingly customers want to load data more than once a day. With the limit of 1,000 partitions, if customers load daily, they can store less than three years of data in a partitioned table, whereas business requirements often mandate that data be retained for longer periods of time, such as seven years. The 1,000 partitions maximum becomes a limitation for customers in this scenario.

If merging of partitions is too complex and time-consuming, customers prefer to have the flexibility to create a large number of partitions and use them as and when required. The 1,000 partitions maximum also becomes a limitation in this scenario.

Solution

In SQL Server 2008 SP2 and SQL Server 2008 R2 SP1, you can choose to enable support for 15,000 partitions at a database-level granularity by using the new sp_db_increased_partitions stored procedure. You can also disable support on a database (after it has been enabled) and set the limit on the number of partitions back to 1,000.

+0

타다을! 당신은 정확합니다, 우리 SP1을 실행하고 있습니다. 고맙습니다! – Khan

관련 문제