Home > Articles

This chapter is from the book

The File System

Each database has one or more files used to store indexes and data. In a lot of database scenarios, you will not implement more than one data file and one log file. In some instances, however, you might want to implement a filegroup. You might also have a performance gain through the appropriate placement of objects within these groups.

The first file created for this purpose is referred to as the primary file. The primary file contains the information needed to start up a database and is also used to store some or all of the data. If desired, secondary files can be created to hold some of the data and other objects. Some databases might be large enough or complex enough in their design to have multiple secondary files used for storage. Normally, the log is maintained in a single file. The log file is used to store changes to the database before these changes are recorded in the data files themselves. The storage of information into log files in this manner enables SQL Server to use these files as an important part of its recovery process. Every time the SQL Server is started, it uses the log files for each of the databases to determine what units of work were still being handled at the time the server was stopped.

The filenames given to all data and log files can be any desired name, although it is recommended that you select a name that indicates the content of the file. The file extensions for the primary data file, secondary data file(s), and log files can also be any chosen set of characters. It is recommended for consistency and standardization that the extensions be .mdf, .ndf, and .ldf for the primary, secondary, and log files, respectively.

Creating Files and Filegroups

Filegroups enable a group of files to be handled as a single unit, and thus make implementations that require multiple files easier to accommodate. With filegroups, SQL Server provides an administrative mechanism of grouping files within a database. You might want to implement filegroups to spread data across more than one logical disk partition or physical disk drive. In some cases, this provides for increased performance as long as the hardware is sufficient to optimize reading and writing to multiple drives concurrently.

You can create a filegroup when a database is created, or you might add them later when more files are needed or desired. After a filegroup has been assigned to a database, you cannot move its files to a different filegroup. Therefore, a file cannot be a member of more than one filegroup. SQL Server provides for a lot of flexibility in the implementation of filegroups. Tables, indexes, text, ntext, and image data can be associated with a specific filegroup, allocating all pages to one specific group. Filegroups can contain only data files; log files cannot be part of a filegroup.

If you place indexes into their own filegroup, the index and data pages can be handled as separate physical read elements. If the associated filegroups are placed onto separate physical devices, each can be read without interfering with the reading of the other. This is to say that while an index is read through in a sequential manner, the data can be accessed randomly without the need for manipulating the physical arm of a hard drive back and forth from the index and the data. This can improve performance and at the same time save on hardware wear and tear.

Placing an entire table onto its own filegroup offers many benefits. If you do so, you can back up a table without having to perform a much larger backup operation. Archived or seldom-used data can be separated from the data that is more readily needed. Of course, the reverse is true: A table that needs to be more readily available within a database can be placed into its own filegroup to enable quicker access. In many instances, planned denormalization (the purposeful creation of redundant data) can be combined with this feature to obtain the best response.

Placing text, ntext, and image data in their own filegroup can improve application performance. Consider an application design that allows the data for these column types to be fetched only upon user request. Frequently, it is not necessary for a user to view pictures and extensive notes within a standard query. Not only does this accommodate better-performing hardware, but it also can provide faster query responses and less bandwidth saturation, because data that is not required is not sent across the network.

Filegroups can provide for a more effective backup strategy for larger database environments. If a large database is placed across multiple filegroups, the database can be backed up in smaller pieces. This is an important aspect if the time to perform a full backup of the entire database is too lengthy.

After a determination has been made to use a filegroup strategy for storing data, always ensure that when a backup is performed against a filegroup the indexes are also backed up at the same time. This is easily accomplished if the data and indexes are stored in the same filegroup. If they are located on separate filegroups, ensure that both the data and the index filegroups are included in a single backup operation. Be aware that SQL Server does not enforce backup of data and index filegroups in a single operation. You must ensure that the files associated with the indexes tied to a particular dataset are backed up with the data during a filegroup backup.

Objects can easily be moved from one filegroup to another. Using the appropriate property page, you just select the new filegroup into which you want to move the object. Logs are not stored in filegroups. You can, however, use multiple log files and place them in different locations to obtain better and more varied maintenance and allow more storage space for log content.

File Placement for Performance and Reliability

The placement of the files related to a SQL Server 2000 database environment helps to ensure optimum performance while minimizing administration. Recoverability can also be improved in the event of data corruption or hardware failures if appropriate measures are taken. On the exam, you must be prepared to respond to these requirements and properly configure the interactions with the file system.

It is absolutely mandatory to understand the basics of the file system and its use by SQL Server. Know when to split off a portion of the database structure and storage to a separate physical disk drive. Many processes performed within SQL Server can be classified as sequential or random. In a sequential process, the data or file can be read in a forward progression without having to locate the next data to be read. In a random process, the data is typically more spread out, and getting at the actual physical data requires multiple accesses.

Where possible, it is desirable to keep sequential processes running without physical interruption caused by other processes contending for the device. Using file placement strategies to keep random processes separate from sequential ones enables the configuration to minimize the competition over the placement of the read/write heads.

As a minimum requirement for almost any implementation, you should separate the normal sequential processing of the log files from the random processing of the data. You also improve recoverability by separating the data from the log and placing them on separate physical volumes. If the volume where the data is stored is damaged and must be restored from backup, you will still have access to the last log entries. The final log can be backed up and restored against the database, which gives something very close to 100% recoverability right to the point of failure.

An interesting and flexible strategy is to provide a separate drive solely for the log. This single volume does not have to participate in RAID architecture, but RAID might be desired for full recoverability. If you give the log the space of an entire volume, you give the log more room to grow and accumulate over time without the need for periodic emptying. Less frequent log backups are needed and the best possible log performance is achieved.

Two primary concerns in most data environments are data recoverability in the event of the inevitable failures and considerations for minimal downtime. In the industry, one of the optimum ratings to strive for is the elusive "five nines" (99.999). This rating means that over any given period (a generally accepted standard of 365 days minimum), the server remained online and servicing the end user 99.999% of the time. In other words, the total downtime for an entire year would be a little more than five minutes.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Pearson IT Certification products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.pearsonitcertification.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020