Drawing QR Code in .NET Filegroups

Using Barcode encoder for Reporting Service Control to generate, create bar code image in Reporting Service applications.

While filegroups will be discussed in greater depth in 7, they deserve a mention here By using filegroups, we can place the Orders table in one file on one disk and the OrdersArchive table in another file on another disk However, we can t do this directly Filegroups are the interim objects that allow us to place a table object on a specific drive Figure 3-19 shows the relationships between files and filegroups Files can be created via SSMS or T-SQL statements, and their location can be changed after being created Just as an Excel file would be stored on the hard drive, SQL Server databases use files that are stored on the hard drive to hold database objects

By default, we have one file (mdf) and one filegroup (Primary) Additional files can be created and, by default, are associated with the Primary filegroup We can also create additional filegroups and associate different files with filegroups

Using Barcode encoder for Android Control to generate, create Data Matrix ECC200 image in Android applications.

In Figure 3-20, we can see the relationships among objects (such as tables), filegroups, and files We can associate one file (such as ordersndf on the D: drive) with a filegroup (such as fgSecond) Now we place a table named Orders into fgSecond; it will be stored on the D: drive Similarly, we can associate another file (such as archivendf on the E: drive) with a different filegroup (such as fgArc) When we place the OrdersArchive table into fgArc, it will be stored on the E: drive

Figure 3-20 Files are associated with filegroups, and database objects are placed in filegroups

File D:\Ordersndf Filegroup fgSecond File E:\Archivendf

Filegroup fgArc

Table orders

Table ArchiveOrders

When designing a table, we are not given the option of which file to place it in We can only place database objects in filegroups

Federations of Servers and Federated Databases

A federated database is a database that is spread across multiple servers, often in multiple geographical locations A primary difference between horizontally partitioned databases and federated databases is that, the different partitions of federated databases are maintained on different servers that have a level of autonomy and can be independently managed The servers that hold the different parts of a federated database are referred to as a federation or federated database servers A federation of database servers is used to spread the processing load across a group of servers The data is horizontally partitioned allowing each of the servers to be independently managed, but distributed queries can be used to process requests on the entire database EXAM TIP When a large amount of data from a single database needs to spread across multiple locations, consider creating a federated database A federated database can provide both scalability and load balancing Federated database servers are often used in the largest Web sites, with a multitier system to balance the processing load across multiple servers This multitier system can provide very high levels of performance

Partition Schemes

Partition schemes perform a function similar to horizontal partitioning, but are much more automated New to SQL Server 2005, they partition a table based on ranges Though appearing to be a single table, in truth they are spread across different filegroups (and normally spread across different disks) so overall I/O access to the database performs more efficiently

MCITP SQL Server 2005 Database Developer All-in-One Exam Guide

The different elements of a partition scheme are listed in Table 3-2

Partition Element Purpose

Filegroups Partition function Partition scheme

Used to separate partitions onto different physical disks Identifies ranges of the different partitions Assigns partition functions to filegroups

Table 3-2 Partition Scheme Elements

Once the elements are created, a table can be created with the partition scheme

Creating Filegroups

The first step in implementing a partition scheme is to create additional filegroups and files so we can actually spread the partitions across different files In a production environment, we would have the different files on different disks, but in these exercises, we ll place them in the same drive Since a partition scheme needs some data in order for us to see what it s doing, we ll use the AdventureWorks database EXAM TIP Partitioning data is an effective method of retaining all the original data (as opposed to archiving it), while storing the data on separate physical disks For example, archived data could be placed on one partition (stored on one physical disk), while current data could be stored on another partition (on another physical disk) With the data stored on different drives, queries for the different partitions are optimized due to multiple disks being accessed simultaneously In this first exercise, we ll create the filegroups necessary for our partition scheme Exercise 35: Create Filegroups in AdventureWorks 1 If it s not already open, open SSMS Double-click Databases and double-click AdventureWorks to open up the AdventureWorks database 2 Right-click AdventureWorks and click Properties 3 Select the Filegroups Properties page Notice one filegroup is named Primary Click OK 4 Create a New Query window and use the following script to add three new filegroups to the AdventureWorks database Notice we are altering the database (not a database object), so our context is from the Master database