ConfiguringSQLServer2008•Chapter3 107 The default value of 0 means use all available processors. You can also change this set- ting in SQL Server Management Studio on the Advanced page. Security Certifications SQL Server 2008 can be easily configured to support requirements to meet certain compliance standards. You should be aware of these and how to enable them for the exam. C2 Auditing This is a standard developed by the U.S. government that determines how system usage is audited. It is enabled by running: sp_configure 'c2 audit mode', 1 go reconfigure This will start a SQL Trace that runs continually and stores the output in a trace file in the default data directory. Because of the stringent requirements set out by the C2 standard, if SQL Server can’t write that trace file (if you run out of disk space for example) it will stop the SQL Server Service, in other words, nothing happens unless it’s audited. You can also enable this setting in SQL Server Management Studio on the Security page. Common Criteria Compliance This a security standard developed in Europe and adopted worldwide that supersedes the C2 standard. There are several levels of Evaluation Assurance Levels (EAL) within the Common Criteria and SQL Server 2008 is certified to level EAL4+, which is the most widely adopted. It is enabled by running: sp_configure 'common criteria compliance enabled', 1 go Common Criteria Compliance requires a SQL Server Service restart to take effect, and it can also be enabled in SQL Server Management Studio on the Security page. To be fully EAL4+ compliant, you need to download and run a script from Microsoft. New Features You’ll notice a couple of new configuration options if you’re upgrading your skills from SQL Server 2005. 108 Chapter3•ConfiguringSQLServer2008 Backup Compression Default SQL Server 2008 has a new feature that enables compressed backups to be taken, which saves time and storage requirements. It is an Enterprise Edition-only feature that is switched off by default. When you take a SQL Server backup it will not be compressed unless you specifically asked it to be. You can control this default behav- ior by configuring the backup compression default option with sp_configure. It is enabled by running: sp_configure 'backup compression default', 1 go reconfigure The backup compression default cannot be controlled through the SQL Server Management Studio interface. FileStream Access Level We’ve already looked at this option earlier in the chapter. It is configured the same way as all the other options, and you can refer back to Table 3.2 for a list of valid values and what they correspond to. You can also control this setting through the Management Studio interface on the Advanced page. Database Mail Database Mail is a solution that enables you to send email messages from SQL Server. It is disabled by default and uses the SMTP standard to deliver messages, so there is no need to have a MAPI client such as Outlook installed on the server. It runs as an isolated process outside of SQL Server to ensure it doesn’t affect the availability of your database, it can be configured with multiple SMTP servers for redundancy, and is fully supported to run on a Windows failover cluster. Database Mail uses SQL Server Service Broker to provide asynchronous message delivery, and you must be a member of the DatabaseMailUserRole in msdb to be able to send email messages. It is not supported in SQL Server Express. Scenarios where Database Mail is often used include: Sending a basic message on completion of a SQL Server Agent job Executing a query and emailing the results automatically as an attachment You can also send emails in HTML format. Figure 3.11 Adding a Database Mail Account to a Profile ConfiguringSQLServer2008•Chapter3 109 Configuring Database Mail Before you configure Database Mail you’ll need to have access to an existing SMTP server. Microsoft IIS, which comes with Windows, has an SMTP service that you can configure easily if you don’t have an existing SMTP server on your network. The easiest way to configure Database Mail is by using the Configure Database Mail wizard accessible by right-clicking Database Mail under the Management section of a SQL Server that you have connected to in Management Studio. You also use the same wizard to manage the Database Mail configuration after you’ve initially set up. When you run the wizard for the first time, you’ll need to select Set up Database Mail by performing the following tasks: Next you’ll need to specify a Profile name and create new SMTP accounts through which to send emails. You can add multiple SMTP accounts on different servers to a Profile. If the first account fails then Database Mail will try the next account and server in the list. In Figure 3.11 in the active window, you can see a second email account and SMTP server being added to a Database Mail profile (seen in the inactive window). 110 Chapter3•ConfiguringSQLServer2008 Once you’ve created a profile, the next screen will prompt you to configure profile security, where you can setup your profile to be Public and accessible to all users, or Private and accessible to a specific user. The last screen allows you to configure parameters such as retry attempts, but generally you can just leave the defaults. Once you’ve run through the wizard you’ll now be able to use Database Mail by calling the sp_send_dbmail stored procedure. Here is sample code that sends a basic email to an address using the CompanySQLServers profile that was created using the Database Mail wizard: EXEC msdb.dbo.sp_send_dbmail @profile_name = 'CompanySQLServers', @recipients = 'DBA@companyx.com', @body = 'Output from procedure X was not as expected', @subject = 'Procedure X execution'; Full-Text Indexing Full-text indexing is a feature of SQL Server 2008 that allows you to carry out sophisticated searches of text-based data called a full-text search. A full-text search is different from a normal search of data through a normal index because it enables you to use linguistic-based searches. For example, you could search a text-based column for inflectional forms of the word run, which would return results includ- ing running and ran. You could also search for similar words using the thesaurus feature, so searching for bicycle might return results including bike, pushbike, tandem and tricycle. For the exam you need to focus on configuring and managing full-text indexes to support full-text searches rather than how to implement the searches themselves. Configuring Full-Text Indexing All databases in SQL Server 2008 are enabled for full-text indexing by default, so the first step you need to make is to create a full-text catalog, which is a logical object for grouping together full-text indexes. Microsoft recommends that full-text indexes with similar update activity patterns are grouped together in a full-text catalog, so that population schedules can be applied at the catalog level to reduce resource usage during population. Full-text catalogs can be created from the right-click menu in SQL Server Management Studio at <instance> | Databases | <database> | Storage | Full Text Catalogs or by executing the following T-SQL: ConfiguringSQLServer2008•Chapter3 111 CREATE FULLTEXT CATALOG <name> Before you can create a full-text index for a table, you’ll need to make sure it has an existing unique, single column, nonnullable index. The full-text index will base its index keys on this. Once you’ve fulfilled all the requirements you can create a full-text index using the CREATE FULLTEXT INDEX t-sql command, or use Management Studio by navigating to the table and selecting Full-Text Indexes from the right-click menu. Managing Full-Text Indexes Once you’ve created a full-text index, the process of filling it is referred to as populat- ing the index. This is done initially when you create it, and by default the index will stay up to date as the underlying data changes. There are scenarios, however, where this default behavior is undesirable. As the population process is resource intensive, if you have frequent updates to your underlying text data, it might be prohibitive for you to keep the index automatically updated. In this scenario, you can modify the default behavior of change tracking, which is to automatically track changes and populate the index. You can configure it to manual, which specifies that changes will be tracked but not propagated until you run or schedule the ALTER FULLTEXT INDEX ON <tablename> START UPDATE POPULATION t-sql command or set it to off, in which case changes will not be tracked or propagated until you run a FULL or INCREMENTAL population. An incremental population will update the index with changed rows since the last population, but it requires a column with the timestamp data type to be present on the underlying table. . space for example) it will stop the SQL Server Service, in other words, nothing happens unless it’s audited. You can also enable this setting in SQL Server Management Studio on the Security. options if you’re upgrading your skills from SQL Server 2005. 108 Chapter3•Configuring SQL Server 2008 Backup Compression Default SQL Server 2008 has a new feature that enables compressed. Configuring SQL Server 2008 •Chapter3 107 The default value of 0 means use all available processors. You can also change this set- ting in SQL Server Management Studio on the Advanced page. Security