SlideShare a Scribd company logo
R2
 Distributing and Partitioning Data
 Table partitioning means to split large tables across multiple storage
structures. Previously, objects were restricted to a single filegroup that could
contain multiple files. However, the placement of data within a filegroup was
still determined by SQL Server.
 Table partitioning allows tables, indexes, and indexed views to be created
on multiple filegroups while also allowing the database administrator (DBA)
to specify which portion of the object will be stored on a specific filegroup.
Table Partitioning
Table Partitioning
 For patitioning of a table, index or indexed view do the following:
1) Create a partition function.
2) Create a partition scheme mapped to a partition function.
3) Create the table, indexed , or indexed view on the partition
scheme.
 A partition function defines the set of boundary points for which data
will be partitioned and used to split data across a partition scheme.
 All data types that are valid for use as index columns can be used as a
partitioning column, except :
 text, ntext, image , varbinary(max) , timestamp, xml, varchar(max)
 Computed columns that participate in a partition function must be
explicitly marked PERSISTED.
 Any Columns are used to partition must be deterministic.
Table Partitioning
CREATE PARTITION FUNCTION
partfunctionname (datatype)
AS RANGE LEFT
FOR VALUES (10,20,30,40,50,60)
(1) PARTITION FUNCTION
CREATE PARTITION FUNCTION
partfunctionname(datatype)
AS RANGE RIGHT
FOR VALUES (10,20,30,40,50,60)
(1) PARTITION FUNCTION (Continue…)
 The AS clause allows you to specifiy whether the partition function you are
creating is RANGE LEFT or RANGE RIGHT .
 The LEFT and RIGHT parameters define which partition will include a
boundary point.
 CREATE PARTITION FUNCTION myRangePF1 (int) AS RANGE LEFT FOR VALUES (1, 100, 1000);
Partition 1 2 3 4
Values col1 <= 1 col1 > 1 AND col1 <= 100 col1 > 100 AND col1 <=1000 col1 > 1000
 CREATE PARTITION FUNCTION myRangePF2 (int) AS RANGE RIGHT FOR VALUES (1, 100, 1000);
Partition 1 2 3 4
Values col1 < 1 col1 >= 1 AND col1 < 100 col1 >= 100 AND col1 < 1000 col1 >= 1000
(2) PARTITION FUNCTION (Continue…)
 A partition function always maps the range of data ; no gaps are present.
 You cannot specify dublicate boundary points. This ensures that any value
stored in a column always evaluates to a single partition.
 Null values are always stored in the leftmost partition until you explicitly
specifiy Null as a boundary point and use the RANGE RIGHT syntax in
which case nulls are stored in the rightmost partition.
 Partition function is a stand-alone object that you can apply to multiply
tables, indexes , or indexed views.
 You can partition an existing object after it has populated with data.
 To partition an existing table, you need to :
 Drop the clustered index and re-create the clustered index on the
partition scheme.
 To partition an existing index or indexed view you need to:
 Drop the index and re-create the index on a partition scheme.
 You can have a maximum of (1000) partitions for an object , therefore you
are allowed to specify a maximum of (999) boundary points.
Creating a PARTITION Scheme
 A partition scheme defines the storage structure and collection of
filegroups that you want to use with a given partition function.
 Partition Schemes provide an alternate definition for storage.
 You define a partition scheme to encompass one or more filegroups.
CREATE PARTITION SCHEME partition_scheme_name
AS PARTITION partition_function_name
[ ALL ] TO ( { file_group_name | [ PRIMARY ] } [ ,...n ] )
 CREATE PARTITION SCHEME mypartscheme AS PARTITION
mypartfunction TO (Filegroup1, Filegroup2, Filegroup3, Filegroup4,
Filegroup5)
 Any filegroup specified in the CREATE PARTITION SCHEME statement
must already exist in the database.
 A partition scheme must be defined in such a way as to contain a
filegroup for each partition that is created by the partition function
mapped to the partition scheme.
Creating a Partitioned Tables and indexes
 SQL Server 2008 allows the use of the ALL keyword, as shown
previously, which allows you to create all partitions defined by the
partition function within a single filegroup.
 If you do not use the ALL keyword, the partition scheme must contain at
least one filegroup for each partition defined within the partition function.
Creating a PARTITION Scheme (Continue…)
Because a Partition Scheme is Just a definition for storage you should put
parition scheme name after ON cluase :
CREATE TABLE Employee (EmployeeID int NOT NULL,
FirstName varchar(50) NOT NULL,
LastName varchar(50) NOT NULL)
ON mypartscheme(EmployeeID);
 Run The following commands to check on results:
Select * From sys.partition_range_values ;
Select * From sys.partition_schemes ;
Creating a Partitioned Tables and indexes
 The key is the ON clause.
 Instead of specifying a filegroup on which to create the table you specify a
partition scheme .
 The On clause is used to specify the storage structure , filegroup partition
scheme to store a table or index.
 The partitioning key that is specified must match the data type, length and
precision of the partition function.
 If the partitioning key is a computed column, the computed column must be
PERSISTED.
Creating a Partitioned Tables and indexes
 When specifying the partitioning key for an index, you are not limited to
the columns that on which the index is defined.
 When you create an index on a partitioned table, SQL server
automatically includes the partitioning key in the definition of each index.
CREATE NONCLUSTERED INDEX idx_employeefirstname
ON dbo.Employee(FirstName) ON mypartscheme(EmployeeID);
Managing Partitions
 With data constantly changing , partitions are rarely static .
 Two operators are available to manage the boundary point definitions:
 SPLIT
 MERGE
 The SPLIT operator introduce a new boundary point into a partition function.
 The MERGE eliminates a boundary point from a partition function.
ALTER PARTITION FUNCTION
partition_function_name()
{SPLIT RANGE ( boundary_value )
| MERGE RANGE ( boundary_value ) } [ ; ]
 You must be very careful when using SPLIT and MERGE operators. You are
either adding or removing an entire partition from the partition function
 Data is not being removed from the table these operator, Only the partition.
Managing Partitions
 Because a partition can reside only in a single filegroup , a SPLIT or MERGE
could cause a significant amount of disk I/O as SQL server relocates rows on the
disk.
 ALTER PARTITION SCHEME
 You can add filegroups to an existing partition scheme to create more storage
space for a partition table.
ALTER PARTITION SCHEME part_name
NEXT USED [filegroupname] [;]
The Next USED clause has two purpose :
1) It adds a new filegroup to the partition scheme, if the specified filegroup is
not already part of partition scheme.
2) It marks the NEXT USED property for a filegroup.
 The filegroup that is marked with the NEXT USEDflag is the filegroup that
contains the next partition that is created when a SPLIToperation is executed.
Index Alignment
 You can partition a table and its associated indexes differently.
 SQL Server cannot store the clustered index in a structure separate from
the table.
 If a table and all its indexes are partitioned using the same partition
function, they are said to be aligned.
 If a table and all its indexes use the same partition function and the same
partition scheme, the storage is aligned as well.
 By aligning the storage, rows in a table along with the indexes dependent
upon the rows are stored in the same filegroups..
 This ensures that if a single partition is backed up or restored, the data
and corresponding indexes are kept together as a single unit.
 The purpose of partitioning is to split a table and its associated indexes
into multiple storage structures.
 Partitioning allows advanced data management features that go well
beyond simply storing a portion of a table in a filegroup.
Index Alignment
 SQL Server stores data on pages in a doubly linked list. To locate and
access data, SQL Server performs the following basic process:
1. Resolve the table name to an object ID.
2. Locate the entry for the object ID in sys.indexesto extract the first
page for the object.
3. Read the first page of the object.
4. Using the Next Page and Previous Page entries on each data page,
walk the page chain to locate the data required
 SWITH operator allows you to exchange partitions between tables in a
perfectly scalable manner with no locking, blocking, or deadlocking
Review
1) Contoso has a very high-volume transaction system. There is not enough
memory on the database server to hold the active data set, so a very high
number of read and write operations are hitting the disk drives directly. After
adding several additional indexes, the performance still does not meet
expectations. Unfortunately, the DBAs cannot find any more candidates for
additional indexes. There isn’t enough money in the budget for additional
memory, additional servers, or a server with more capacity.
However, a new storage area network (SAN) has recently been
implemented. What technology can Contoso use to increase performance?
A. Log shipping
B. Replication
C. Partitioning
D. Database mirroring
Review (Continue …)
2) Margie’s Travel wants to keep orders in their online transaction processing
database for a maximum of 30 days from the date an order is placed. The
orders table contains a column called OrderDate that contains the date an
order was placed. How can the DBAs at Margie’s Travel move orders that
are older than 30 days from the orders table with the least amount of impact
on user transactions? (Choose two. Each answer represents a part of the
solution.)
A. Use the SWITCH operator to move data partitions containing data that
is older than 30 days.
B. Create a stored procedure that deletes any orders that are older than
30 days.
C. Partition the order table using the partition function defined for a
datetimedata type using the OrderDatecolumn.
D. Create a job to delete orders that are older than 30 days
Review (Continue…)
3) Wide World Importers has a very large and active data warehouse that is
required to be accessible to users 24 hours a day, 7 days a week. The
DBA team needs to load new sets of data on a weekly basis to support
business operations. Inserting large volumes of data would affect users
unacceptably. Which feature should be used to minimize the impact while
still handling the weekly data loads?
A. Transactional replication
B. The SWITCH operator within partitioning
C. Database mirroring
D. Database snapshots
Review (Continue…)
4) Contoso Limited has a very high-volume order entry system. Management
has determined that orders should be maintained in the operational
system for a maximum of six months before being archived. After data is
archived from the table, it is loaded into the data warehouse. The data
load occurs once per month. Which technology is the most appropriate
choice for archiving data from the order entry system?
A. Database mirroring
B. Transactional replication
C. Database snapshots
D. Partitioning
Answers
1) Correct Answer: C
A. Incorrect: Although log shipping allows additional copies of the
database to be created, Contoso does not have any additional
hardware to use.
B. Incorrect: Although replication allows additional copies of the database
to be created, Contoso does not have any additional hardware to use
C. Correct: You could partition the most heavily used tables, thus
allowing you to spread the data across multiple files, which improves
performance.
D. Incorrect: Although database mirroring creates an additional copy of
the database, Contoso does not have any additional hardware to use
Answers (continue…)
2) Correct Answers: A and C
A. Correct: The SWITCH operator removes orders that are older than
30 days without causing any blocking.
B. Incorrect: You could execute a DELETE operation, but exclusive
locks would be acquired that would affect the ability of customers to
place orders.
C. Correct: Partitioning the OrderDate column allows you to use the
SWITCH operator to move data that is older than 30 days off the
table without causing any blocking.
D. Incorrect: You could execute a DELETE operation, but exclusive
locks would be acquired that would affect the ability of customers to
place orders.
Answers (continue…)
3) Correct Answer: B
A. Incorrect: Transactional replication has the capability to move data
into the tables within the data warehouse; however, locks are
acquired during the insert process that would affect users.
B. Correct: The SWITCH operator is designed to move partitions of data
into a table without causing blocking.
C. Incorrect: Database mirroring requires the mirror database to be
offline and would not be a valid technology in this scenario.
D. Incorrect: Database snapshots provide a point in time, read only copy
of a database, and would not reflect any new data that is added
Answers (continue…)
4) Correct Answer: D
A. Incorrect: Database mirroring keeps a secondary database
synchronized, but the mirror is inaccessible. Therefore, it is
inappropriate for archiving.
B. Incorrect: Transactional replication could be used to move the data to
another system for loading into the data warehouse; however, you
still need to delete data from the order entry system. This affects the
concurrency and performance of the order entry system.
C. Incorrect: Database snapshots maintain a read-only copy of the data
at that point in time and is inappropriate for archiving.
D. Correct: By designing the table with partitioning, you can remove
order data from the order entry system without affecting performance
or concurrency. After you remove the partition from the table, you can
load the data into the data warehouse.
Sql server lesson7

More Related Content

What's hot

8 i locally_mgr_tbsp
8 i locally_mgr_tbsp8 i locally_mgr_tbsp
8 i locally_mgr_tbsp
Anil Pandey
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
Anil Pandey
 
Oracle sql scripting homework
Oracle sql scripting homeworkOracle sql scripting homework
Oracle sql scripting homework
arnitaetsitty
 
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried FärberTrivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
Trivadis
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
Balqees Al.Mubarak
 
DDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsDDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsAshwin Dinoriya
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
Swapnali Pawar
 
Sql commands
Sql commandsSql commands
Sql commands
Prof. Dr. K. Adisesha
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
HudaRaghibKadhim
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
1keydata
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
Richie Rump
 

What's hot (20)

8 i locally_mgr_tbsp
8 i locally_mgr_tbsp8 i locally_mgr_tbsp
8 i locally_mgr_tbsp
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
 
Using T-SQL
Using T-SQL Using T-SQL
Using T-SQL
 
Oracle sql scripting homework
Oracle sql scripting homeworkOracle sql scripting homework
Oracle sql scripting homework
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried FärberTrivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
Trivadis TechEvent 2017 SQL Server 2016 Temporal Tables by Willfried Färber
 
Mysql database
Mysql databaseMysql database
Mysql database
 
Mysql cheatsheet
Mysql cheatsheetMysql cheatsheet
Mysql cheatsheet
 
Sql commands
Sql commandsSql commands
Sql commands
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
DDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsDDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and Joins
 
Ddl commands
Ddl commandsDdl commands
Ddl commands
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 

Similar to Sql server lesson7

Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
rainynovember12
 
Partitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- ArticlePartitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- Article
Hemant K Chitale
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
Ala Qunaibi
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to Couchbase
Mohammad Shaker
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
infusiondev
 
SKILLWISE-DB2 DBA
SKILLWISE-DB2 DBASKILLWISE-DB2 DBA
SKILLWISE-DB2 DBA
Skillwise Group
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 
Sqlserver interview questions
Sqlserver interview questionsSqlserver interview questions
Sqlserver interview questions
Taj Basha
 
初探AWS 平台上的 NoSQL 雲端資料庫服務
初探AWS 平台上的 NoSQL 雲端資料庫服務初探AWS 平台上的 NoSQL 雲端資料庫服務
初探AWS 平台上的 NoSQL 雲端資料庫服務
Amazon Web Services
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Michael Rys
 
Sql server lesson5
Sql server lesson5Sql server lesson5
Sql server lesson5
Ala Qunaibi
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
Sperasoft
 
Presentation on tablespaceses segments extends and blocks
Presentation on tablespaceses segments extends and blocksPresentation on tablespaceses segments extends and blocks
Presentation on tablespaceses segments extends and blocks
Vinay Ugave
 
Database testing
Database testingDatabase testing
Database testing
Pesara Swamy
 
Partitioning kendralittle
Partitioning kendralittlePartitioning kendralittle
Partitioning kendralittle
ngupt28
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
Er. Nawaraj Bhandari
 
8 i index_tables
8 i index_tables8 i index_tables
8 i index_tables
Anil Pandey
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
Amir Reza Hashemi
 

Similar to Sql server lesson7 (20)

Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
Partitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- ArticlePartitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- Article
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to Couchbase
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
SKILLWISE-DB2 DBA
SKILLWISE-DB2 DBASKILLWISE-DB2 DBA
SKILLWISE-DB2 DBA
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Sqlserver interview questions
Sqlserver interview questionsSqlserver interview questions
Sqlserver interview questions
 
初探AWS 平台上的 NoSQL 雲端資料庫服務
初探AWS 平台上的 NoSQL 雲端資料庫服務初探AWS 平台上的 NoSQL 雲端資料庫服務
初探AWS 平台上的 NoSQL 雲端資料庫服務
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
 
Sql server lesson5
Sql server lesson5Sql server lesson5
Sql server lesson5
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
 
Presentation on tablespaceses segments extends and blocks
Presentation on tablespaceses segments extends and blocksPresentation on tablespaceses segments extends and blocks
Presentation on tablespaceses segments extends and blocks
 
Database testing
Database testingDatabase testing
Database testing
 
Bigtable_Paper
Bigtable_PaperBigtable_Paper
Bigtable_Paper
 
Partitioning kendralittle
Partitioning kendralittlePartitioning kendralittle
Partitioning kendralittle
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
 
8 i index_tables
8 i index_tables8 i index_tables
8 i index_tables
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
 

More from Ala Qunaibi

Sql server lesson13
Sql server lesson13Sql server lesson13
Sql server lesson13
Ala Qunaibi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Sql server lesson11
Sql server lesson11Sql server lesson11
Sql server lesson11
Ala Qunaibi
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
Ala Qunaibi
 
Sql server lesson9
Sql server lesson9Sql server lesson9
Sql server lesson9
Ala Qunaibi
 
Sql server lesson8
Sql server lesson8Sql server lesson8
Sql server lesson8
Ala Qunaibi
 
Sql server lesson4_v2
Sql server lesson4_v2Sql server lesson4_v2
Sql server lesson4_v2
Ala Qunaibi
 
Sql server lesson3
Sql server lesson3Sql server lesson3
Sql server lesson3
Ala Qunaibi
 
Sql server lesson4
Sql server lesson4Sql server lesson4
Sql server lesson4
Ala Qunaibi
 
Sql server lesson2
Sql server lesson2Sql server lesson2
Sql server lesson2
Ala Qunaibi
 
الفروقات الفردية بين الطلاب كيف نفهمها
الفروقات الفردية بين الطلاب  كيف نفهمهاالفروقات الفردية بين الطلاب  كيف نفهمها
الفروقات الفردية بين الطلاب كيف نفهمها
Ala Qunaibi
 
صور
صورصور
صور
Ala Qunaibi
 
حوادث السير
حوادث السير حوادث السير
حوادث السير
Ala Qunaibi
 
المجموعة الشمسية
المجموعة الشمسيةالمجموعة الشمسية
المجموعة الشمسية
Ala Qunaibi
 

More from Ala Qunaibi (15)

Sql server lesson13
Sql server lesson13Sql server lesson13
Sql server lesson13
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
 
Sql server lesson11
Sql server lesson11Sql server lesson11
Sql server lesson11
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
 
Sql server lesson9
Sql server lesson9Sql server lesson9
Sql server lesson9
 
Sql server lesson8
Sql server lesson8Sql server lesson8
Sql server lesson8
 
Sql server lesson4_v2
Sql server lesson4_v2Sql server lesson4_v2
Sql server lesson4_v2
 
Sql server lesson3
Sql server lesson3Sql server lesson3
Sql server lesson3
 
Sql server lesson4
Sql server lesson4Sql server lesson4
Sql server lesson4
 
Sql server lesson2
Sql server lesson2Sql server lesson2
Sql server lesson2
 
الفروقات الفردية بين الطلاب كيف نفهمها
الفروقات الفردية بين الطلاب  كيف نفهمهاالفروقات الفردية بين الطلاب  كيف نفهمها
الفروقات الفردية بين الطلاب كيف نفهمها
 
صور
صورصور
صور
 
حوادث السير
حوادث السير حوادث السير
حوادث السير
 
المجموعة الشمسية
المجموعة الشمسيةالمجموعة الشمسية
المجموعة الشمسية
 

Recently uploaded

Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 

Recently uploaded (20)

Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 

Sql server lesson7

  • 1. R2
  • 2.  Distributing and Partitioning Data
  • 3.  Table partitioning means to split large tables across multiple storage structures. Previously, objects were restricted to a single filegroup that could contain multiple files. However, the placement of data within a filegroup was still determined by SQL Server.  Table partitioning allows tables, indexes, and indexed views to be created on multiple filegroups while also allowing the database administrator (DBA) to specify which portion of the object will be stored on a specific filegroup. Table Partitioning
  • 4. Table Partitioning  For patitioning of a table, index or indexed view do the following: 1) Create a partition function. 2) Create a partition scheme mapped to a partition function. 3) Create the table, indexed , or indexed view on the partition scheme.
  • 5.  A partition function defines the set of boundary points for which data will be partitioned and used to split data across a partition scheme.  All data types that are valid for use as index columns can be used as a partitioning column, except :  text, ntext, image , varbinary(max) , timestamp, xml, varchar(max)  Computed columns that participate in a partition function must be explicitly marked PERSISTED.  Any Columns are used to partition must be deterministic. Table Partitioning
  • 6. CREATE PARTITION FUNCTION partfunctionname (datatype) AS RANGE LEFT FOR VALUES (10,20,30,40,50,60) (1) PARTITION FUNCTION CREATE PARTITION FUNCTION partfunctionname(datatype) AS RANGE RIGHT FOR VALUES (10,20,30,40,50,60)
  • 7. (1) PARTITION FUNCTION (Continue…)  The AS clause allows you to specifiy whether the partition function you are creating is RANGE LEFT or RANGE RIGHT .  The LEFT and RIGHT parameters define which partition will include a boundary point.  CREATE PARTITION FUNCTION myRangePF1 (int) AS RANGE LEFT FOR VALUES (1, 100, 1000); Partition 1 2 3 4 Values col1 <= 1 col1 > 1 AND col1 <= 100 col1 > 100 AND col1 <=1000 col1 > 1000  CREATE PARTITION FUNCTION myRangePF2 (int) AS RANGE RIGHT FOR VALUES (1, 100, 1000); Partition 1 2 3 4 Values col1 < 1 col1 >= 1 AND col1 < 100 col1 >= 100 AND col1 < 1000 col1 >= 1000
  • 8. (2) PARTITION FUNCTION (Continue…)  A partition function always maps the range of data ; no gaps are present.  You cannot specify dublicate boundary points. This ensures that any value stored in a column always evaluates to a single partition.  Null values are always stored in the leftmost partition until you explicitly specifiy Null as a boundary point and use the RANGE RIGHT syntax in which case nulls are stored in the rightmost partition.  Partition function is a stand-alone object that you can apply to multiply tables, indexes , or indexed views.  You can partition an existing object after it has populated with data.  To partition an existing table, you need to :  Drop the clustered index and re-create the clustered index on the partition scheme.  To partition an existing index or indexed view you need to:  Drop the index and re-create the index on a partition scheme.  You can have a maximum of (1000) partitions for an object , therefore you are allowed to specify a maximum of (999) boundary points.
  • 9. Creating a PARTITION Scheme  A partition scheme defines the storage structure and collection of filegroups that you want to use with a given partition function.  Partition Schemes provide an alternate definition for storage.  You define a partition scheme to encompass one or more filegroups. CREATE PARTITION SCHEME partition_scheme_name AS PARTITION partition_function_name [ ALL ] TO ( { file_group_name | [ PRIMARY ] } [ ,...n ] )  CREATE PARTITION SCHEME mypartscheme AS PARTITION mypartfunction TO (Filegroup1, Filegroup2, Filegroup3, Filegroup4, Filegroup5)  Any filegroup specified in the CREATE PARTITION SCHEME statement must already exist in the database.  A partition scheme must be defined in such a way as to contain a filegroup for each partition that is created by the partition function mapped to the partition scheme.
  • 10. Creating a Partitioned Tables and indexes  SQL Server 2008 allows the use of the ALL keyword, as shown previously, which allows you to create all partitions defined by the partition function within a single filegroup.  If you do not use the ALL keyword, the partition scheme must contain at least one filegroup for each partition defined within the partition function. Creating a PARTITION Scheme (Continue…) Because a Partition Scheme is Just a definition for storage you should put parition scheme name after ON cluase : CREATE TABLE Employee (EmployeeID int NOT NULL, FirstName varchar(50) NOT NULL, LastName varchar(50) NOT NULL) ON mypartscheme(EmployeeID);
  • 11.  Run The following commands to check on results: Select * From sys.partition_range_values ; Select * From sys.partition_schemes ; Creating a Partitioned Tables and indexes  The key is the ON clause.  Instead of specifying a filegroup on which to create the table you specify a partition scheme .  The On clause is used to specify the storage structure , filegroup partition scheme to store a table or index.  The partitioning key that is specified must match the data type, length and precision of the partition function.  If the partitioning key is a computed column, the computed column must be PERSISTED.
  • 12. Creating a Partitioned Tables and indexes  When specifying the partitioning key for an index, you are not limited to the columns that on which the index is defined.  When you create an index on a partitioned table, SQL server automatically includes the partitioning key in the definition of each index. CREATE NONCLUSTERED INDEX idx_employeefirstname ON dbo.Employee(FirstName) ON mypartscheme(EmployeeID);
  • 13. Managing Partitions  With data constantly changing , partitions are rarely static .  Two operators are available to manage the boundary point definitions:  SPLIT  MERGE  The SPLIT operator introduce a new boundary point into a partition function.  The MERGE eliminates a boundary point from a partition function. ALTER PARTITION FUNCTION partition_function_name() {SPLIT RANGE ( boundary_value ) | MERGE RANGE ( boundary_value ) } [ ; ]  You must be very careful when using SPLIT and MERGE operators. You are either adding or removing an entire partition from the partition function  Data is not being removed from the table these operator, Only the partition.
  • 14. Managing Partitions  Because a partition can reside only in a single filegroup , a SPLIT or MERGE could cause a significant amount of disk I/O as SQL server relocates rows on the disk.  ALTER PARTITION SCHEME  You can add filegroups to an existing partition scheme to create more storage space for a partition table. ALTER PARTITION SCHEME part_name NEXT USED [filegroupname] [;] The Next USED clause has two purpose : 1) It adds a new filegroup to the partition scheme, if the specified filegroup is not already part of partition scheme. 2) It marks the NEXT USED property for a filegroup.  The filegroup that is marked with the NEXT USEDflag is the filegroup that contains the next partition that is created when a SPLIToperation is executed.
  • 15. Index Alignment  You can partition a table and its associated indexes differently.  SQL Server cannot store the clustered index in a structure separate from the table.  If a table and all its indexes are partitioned using the same partition function, they are said to be aligned.  If a table and all its indexes use the same partition function and the same partition scheme, the storage is aligned as well.  By aligning the storage, rows in a table along with the indexes dependent upon the rows are stored in the same filegroups..  This ensures that if a single partition is backed up or restored, the data and corresponding indexes are kept together as a single unit.  The purpose of partitioning is to split a table and its associated indexes into multiple storage structures.  Partitioning allows advanced data management features that go well beyond simply storing a portion of a table in a filegroup.
  • 16. Index Alignment  SQL Server stores data on pages in a doubly linked list. To locate and access data, SQL Server performs the following basic process: 1. Resolve the table name to an object ID. 2. Locate the entry for the object ID in sys.indexesto extract the first page for the object. 3. Read the first page of the object. 4. Using the Next Page and Previous Page entries on each data page, walk the page chain to locate the data required  SWITH operator allows you to exchange partitions between tables in a perfectly scalable manner with no locking, blocking, or deadlocking
  • 17. Review 1) Contoso has a very high-volume transaction system. There is not enough memory on the database server to hold the active data set, so a very high number of read and write operations are hitting the disk drives directly. After adding several additional indexes, the performance still does not meet expectations. Unfortunately, the DBAs cannot find any more candidates for additional indexes. There isn’t enough money in the budget for additional memory, additional servers, or a server with more capacity. However, a new storage area network (SAN) has recently been implemented. What technology can Contoso use to increase performance? A. Log shipping B. Replication C. Partitioning D. Database mirroring
  • 18. Review (Continue …) 2) Margie’s Travel wants to keep orders in their online transaction processing database for a maximum of 30 days from the date an order is placed. The orders table contains a column called OrderDate that contains the date an order was placed. How can the DBAs at Margie’s Travel move orders that are older than 30 days from the orders table with the least amount of impact on user transactions? (Choose two. Each answer represents a part of the solution.) A. Use the SWITCH operator to move data partitions containing data that is older than 30 days. B. Create a stored procedure that deletes any orders that are older than 30 days. C. Partition the order table using the partition function defined for a datetimedata type using the OrderDatecolumn. D. Create a job to delete orders that are older than 30 days
  • 19. Review (Continue…) 3) Wide World Importers has a very large and active data warehouse that is required to be accessible to users 24 hours a day, 7 days a week. The DBA team needs to load new sets of data on a weekly basis to support business operations. Inserting large volumes of data would affect users unacceptably. Which feature should be used to minimize the impact while still handling the weekly data loads? A. Transactional replication B. The SWITCH operator within partitioning C. Database mirroring D. Database snapshots
  • 20. Review (Continue…) 4) Contoso Limited has a very high-volume order entry system. Management has determined that orders should be maintained in the operational system for a maximum of six months before being archived. After data is archived from the table, it is loaded into the data warehouse. The data load occurs once per month. Which technology is the most appropriate choice for archiving data from the order entry system? A. Database mirroring B. Transactional replication C. Database snapshots D. Partitioning
  • 21. Answers 1) Correct Answer: C A. Incorrect: Although log shipping allows additional copies of the database to be created, Contoso does not have any additional hardware to use. B. Incorrect: Although replication allows additional copies of the database to be created, Contoso does not have any additional hardware to use C. Correct: You could partition the most heavily used tables, thus allowing you to spread the data across multiple files, which improves performance. D. Incorrect: Although database mirroring creates an additional copy of the database, Contoso does not have any additional hardware to use
  • 22. Answers (continue…) 2) Correct Answers: A and C A. Correct: The SWITCH operator removes orders that are older than 30 days without causing any blocking. B. Incorrect: You could execute a DELETE operation, but exclusive locks would be acquired that would affect the ability of customers to place orders. C. Correct: Partitioning the OrderDate column allows you to use the SWITCH operator to move data that is older than 30 days off the table without causing any blocking. D. Incorrect: You could execute a DELETE operation, but exclusive locks would be acquired that would affect the ability of customers to place orders.
  • 23. Answers (continue…) 3) Correct Answer: B A. Incorrect: Transactional replication has the capability to move data into the tables within the data warehouse; however, locks are acquired during the insert process that would affect users. B. Correct: The SWITCH operator is designed to move partitions of data into a table without causing blocking. C. Incorrect: Database mirroring requires the mirror database to be offline and would not be a valid technology in this scenario. D. Incorrect: Database snapshots provide a point in time, read only copy of a database, and would not reflect any new data that is added
  • 24. Answers (continue…) 4) Correct Answer: D A. Incorrect: Database mirroring keeps a secondary database synchronized, but the mirror is inaccessible. Therefore, it is inappropriate for archiving. B. Incorrect: Transactional replication could be used to move the data to another system for loading into the data warehouse; however, you still need to delete data from the order entry system. This affects the concurrency and performance of the order entry system. C. Incorrect: Database snapshots maintain a read-only copy of the data at that point in time and is inappropriate for archiving. D. Correct: By designing the table with partitioning, you can remove order data from the order entry system without affecting performance or concurrency. After you remove the partition from the table, you can load the data into the data warehouse.