Transcript Slide 1

SQL WHAT’S NEW?
Natália Matos
[email protected]
MCT, MCP, MCTS, MCITP, MCAD, MCSD
NOVAS TECNOLOGIAS MICROSOFT
WHAT’S NEW IN SQL SERVER 2008?
Configuration
Servers
Policy-Based
Management
Resource Governor
Data Collector
Plan Freezing
Transparent Data
Encryption
Auditing All Actions
FILESTREAM Data
Type
Spatial Data
Hot Add CPU
Conflict Detection
Change Data
Capture
MERGE Statement
Report Designer
Analysis Services
Wizards
NOVAS TECNOLOGIAS MICROSOFT
WHAT ARE CONFIGURATION SERVERS?
Configuration
Servers
Centralized management servers
• Maintain connection information for servers in a server group:
• Only Windows Authentication is supported
• Enable central administration of multiple servers:
• Multiserver queries
• Policy-based management
Multiserver Query
Configuration
Server
Server
Group
NOVAS TECNOLOGIAS MICROSOFT
CONFIGURATION SERVERS
Configuration
Servers
DEMO
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS POLICY-BASED MANAGEMENT?
Policy-Based
Management
• Policy-based management provides the ability to define
policies that apply to servers, databases, and other objects in
your data environment.
• Well-defined policies can help administrators to control and
manage change proactively within the data services
environment.
NOVAS TECNOLOGIAS MICROSOFT
WHAT ARE TARGETS, FACETS, AND CONDITIONS?
Policy-Based
Management
Facets
An aspect of SQL Server management in
which one or more related configuration
options is defined
Conditions
Settings to define state of a facet
Targets
Entities such as servers, databases, logins,
and other database objects to which policies
can be applied
NOVAS TECNOLOGIAS MICROSOFT
WHAT ARE POLICIES?
Policy-Based
Management
• A condition enforced on one or more targets
• Organized into categories
NOVAS TECNOLOGIAS MICROSOFT
POLICY EXECUTION MODES
Policy-Based
Management
• On Demand
• Automated policy execution:
• On Schedule, log out-of-compliance
• Changes are attempted, prevent out-of-compliance
• Changes are attempted, log out-of-compliance
NOVAS TECNOLOGIAS MICROSOFT
POLICY-BASED MANAGEMENT
Policy-Based
Management
DEMO
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS RESOURCE GOVERNOR?
• Tool to define limits and assign priorities to individual
workloads that are running on a SQL Server instance
Resource
Governor
• Workloads are based on factors such as users,
applications, and databases
• Limits control the resources that are available to specific
workloads
• Minimizes the effects of runaway queries
• Priorities can optimize the performance of a mission-critical
process while maintaining predictability for the other
workloads on the server
NOVAS TECNOLOGIAS MICROSOFT
HOW TO MANAGE RESOURCE GOVERNOR
Resource
Governor
1. Enable Resource governor
2. Configure resource pools
3. Configure workload groups
4. Create a classification function to assign workloads to workload
groups
NOVAS TECNOLOGIAS MICROSOFT
WHAT ARE RESOURCE POOLS AND WORKLOAD
GROUPS?
• Resource pools:
Resource
Governor
• Can contain many workload groups
• Limit system resources
• Workload groups:
• Are assigned to resource pools
• Group applications and limit SQL Server specific resources
NOVAS TECNOLOGIAS MICROSOFT
HOW TO ASSIGN A WORKLOAD TO A WORKLOAD
GROUP
• Create a classifier function
Resource
Governor
CREATE FUNCTION dbo.fn_ClassifyApps() RETURNS sysname
WITH SCHEMABINDING
AS
BEGIN
DECLARE @ret sysname
IF (APP_NAME() LIKE '%Low Importance Application%')
SET @ret='Low Importance Group'
RETURN @ret
END
GO
ALTER RESOURCE GOVERNOR
WITH (CLASSIFIER_FUNCTION = dbo.fn_ClassifyApps)
ALTER RESOURCE GOVERNOR RECONFIGURE
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS DATA COLLECTOR?
Data Collector
• Set of tools to collect performance information
• Application programming interface (API) that enables
client applications to access performance data
• SQL Server Agent jobs and SQL Server Integration
Services (SSIS) packages that provide data to the API
• Management data warehouse that stores historical
performance data
NOVAS TECNOLOGIAS MICROSOFT
HOW TO VIEW PERFORMANCE DATA
• To view available reports, right-click the System Data
Collection Set, point to Reports, point to Historical
• Some reports have links to more specific information
Data Collector
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS PLAN FREEZING?
• Plan freezing creates a plan guide:
• Plan guide contains hints or a full query plan
• Plan guide is attached to a specific Transact-SQL statement
Plan Freezing
• Plan guides can be enabled or disabled
• Plan guides can be copied between servers
exec sp_create_plan_guide_from_cache
@name = N'CustomerSales',
@plan_handle = @plan_handle,
@statement_start_offset = @offset
NOVAS TECNOLOGIAS MICROSOFT
SCENARIOS FOR PLAN FREEZING
• SQL Server upgrade:
Plan Freezing
• Query plans are often updated during migration
• Most updates are beneficial
• Plan guides allow you to roll back detrimental query plan
updates
• Prevent query regression:
• Plan guides can be created and then disabled to enable
queries to benefit from statistics-based recompiles
• If the query regresses, the plan guide can be enabled to
revert to the previous query plan
• Copy plan guides:
• Plan guides can be scripted on test servers and then
applied to production servers
• Allows thorough testing of plan guides before deployment
NOVAS TECNOLOGIAS MICROSOFT
HOW TO COPY A PLAN GUIDE
1. Script plan guide in SQL Server Management Studio on source
server:
• Plan guides are also included in complete database scripts.
2. Execute script on destination server
Plan Freezing
NOVAS TECNOLOGIAS MICROSOFT
ENCRYPTION IN PREVIOUS RELEASES
• SQL Server 2000 and earlier
• No encryption provided
• Encryption must be entirely provided
by applications
Transparent
Data
Encryption
• SQL Server 2005
• Encryption included
• Encryption and decryption must be
performed by Transact-SQL
statements
• Increased application complexity over
unencrypted data
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS TRANSPARENT DATA ENCRYPTION?
Transparent
Data
Encryption
• Database level encryption
• Encryption and decryption performed automatically by
SQL Server
• Transparent to users and applications
• Requires no additional code or functionality for an
application to use encrypted data
• The process of accessing encrypted data is identical to the
process of accessing unencrypted data
NOVAS TECNOLOGIAS MICROSOFT
TRANSPARENT DATA ENCRYPTION
DEMO
Transparent
Data
Encryption
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS ALL ACTION AUDITING?
Auditing All
Actions
• All action auditing captures activity in the database server and
stores it in a log
• You can store audit information in the following destinations:
• File
• Windows Application Log
• Windows Security Log
• Consists of an Audit and an Audit Specification
NOVAS TECNOLOGIAS MICROSOFT
SCENARIOS FOR ALL ACTION AUDITING
• Increased security
• Monitor failed login attempts
• Monitor successful login attempts to check for activity at
unusual times of the day
• Regulatory compliance
Auditing All
Actions
• Log data changes and maintain a version history of data
• Regulations might comply you to keep all versions of a
record
NOVAS TECNOLOGIAS MICROSOFT
HOW TO CREATE AN AUDIT
• Use the CREATE SERVER AUDIT statement
• Specify destination
CREATE SERVER AUDIT HIPAA_File_Audit
TO FILE ( FILEPATH=’\\SQLPROD_1\Audit\’ )
Auditing All
Actions
CREATE SERVER AUDIT HIPAA_AppLog_Audit
TO APPLICATION_LOG
WITH ( QUEUE_DELAY = 500, ON_FAILURE =
SHUTDOWN)
NOVAS TECNOLOGIAS MICROSOFT
HOW TO CREATE AN AUDIT SPECIFICATION
• Server audit specification
CREATE SERVER AUDIT SPECIFICATION
Failed_Login_Spec
FOR SERVER AUDIT HIPAA_File_Audit
ADD (FAILED_LOGIN_GROUP)
Auditing All
Actions
• Database audit specification
CREATE DATABASE AUDIT SPECIFICATION
Sales_Audit_Spec
FOR SERVER AUDIT HIPAA_AppLog_Audit
ADD (DATABASE_OBJECT_CHANGE_GROUP),
ADD (INSERT, UPDATE, DELETE
ON Schema::Sales
BY SalesUser, SalesAdmin)
NOVAS TECNOLOGIAS MICROSOFT
FILESTREAM DATA
• Use to store unstructured data on the NTFS file system,
but manage it by using SQL Server
• Data stored as BLOBs on the file system
• To store FILESTREAM data:
FILESTREAM
Data Type
•
•
•
•
•
Enable the FILESTREAM
Create a FILESTREAM filegroup
Create a column of type varbinary(max) FILESTREAM
Use an unique identifier for the table
Use Transact-SQL or Win32 APIs to access FILESTREAM data
INSERT INTO
CREATE
DATABASE
TABLE
ResumeData
ResumeData
Applicants ON PRIMARY
(...),
VALUES
(
EXEC
sp_filestream_configure
FILEGROUP
(
FSGroup1
ApplicantID
int, CONTAINS FILESTREAM
@enable_level=3,
@share_name="FileStreamData"
(NAME=ApplicantsBLOBData,
1, CAST(‘Resume
varbinary(max)
Text’
AS varbinary(max)),
FILENAME=N‘C:\SQLData’)
newid()
Resume
FILESTREAM,
LOG
.
)
.ON
.
ResumeID
UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL UNIQUE
(...)
)
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS SPATIAL DATA?
• Information about the location and shape of a geometric
object:
•
•
•
•
Store locations
Sales regions
Customer sites
Area within a specific distance of a location
• Two types:
Spatial Data
• Planar (or Euclidean) data for coordinate points on a flat,
bounded surface. Distances measured directly between
points.
• Geodetic (or ellipsoidal) data for latitude and longitude
points on the surface of the earth. Distances measured
taking into account the curvature of the ellipsoid surface.
NOVAS TECNOLOGIAS MICROSOFT
THE GEOMETRY AND GEOGRAPHY DATA
TYPES
• SQL Server supports two spatial data types:
• geometry for planar spatial data
• geography for ellipsoidal spatial data
• Both data types:
• Are implemented as .NET Framework CLR types
• Can store points, lines, and areas
• Provide members to perform spatial operations
• Common uses:
Spatial Data
• geometry – localized geospatial data,
such as street maps
• geography – locations on the earth’s
surface and integration with
geospatial systems
NOVAS TECNOLOGIAS MICROSOFT
SPATIAL DATA
DEMO
Spatial Data
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS HOT ADD CPU?
• Add CPUs to supported systems while system is running:
•
•
•
•
No downtime
Increased availability
Requires Windows Server 2008
Extends the hot add memory capabilities of SQL Server
2005
Hot Add CPU
NOVAS TECNOLOGIAS MICROSOFT
AUTOMATIC CONFLICT DETECTION
• Detect accidental conflicts when multiple replication nodes
update the same row
• Prevents inconsistent data across nodes
• Conflicting change is treated as a critical error that causes the
failure of the Distribution Agent
• Topology remains in an inconsistent state until the conflict is
resolved
Conflict
Detection
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS CHANGE DATA CAPTURE?
• Improves incremental loads
• Captures insert, update, and delete commands
• Enabled at the database and table levels
• Stores before and after images for updates
• Stores changes in a relational format
• Supports configuration to allow queries to access all changes or
only net changes
• Includes tables and functions created to support storing and
retrieving changed data
• Depends on the SQL Server Agent service and jobs to manage
and clean-up the change data capture
Change Data
Capture
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS THE MERGE STATEMENT?
Transact-SQL command
Joins a data source with a target table or view
Performs multiple actions based on the results of the join
Option_Transactions
Insert Option_Transactions
Values (1,3,’1/1/2008’)
MERGE
Statement
Emp_Option_Total
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS REPORT DESIGNER?
• Enhanced design tool with new Office 2007 Ribbon
interface
• Local preview without requiring a data cache
• Support for the following data sources:
Report
Designer
•
•
•
•
•
•
•
•
Microsoft SQL Server
OLE DB
Oracle
ODBC
XML
Report Server Model
SAP NetWeaverBI
Hyperion Essbase
NOVAS TECNOLOGIAS MICROSOFT
CHART REGION ENHANCEMENTS
•
•
•
•
•
•
•
Expanded user interface
Support for formulas in chart data regions
Context menus for each chart element
Support for text editing directly in the chart
Chart type selector available when you right-click the chart
Drag and drop capabilities
Ability to display multiple series on a single axis
Report
Designer
NOVAS TECNOLOGIAS MICROSOFT
WHAT IS THE TABLIX DATA REGION?
•
•
•
•
Combines features of both table and matrix formats
Provides flexible grid layout
Provides flexible groupings for rows and columns
Allows hidden areas that become visible when another area is
selected
• Provides the ability to create interactive reports
Report
Designer
NOVAS TECNOLOGIAS MICROSOFT
REPORT DESIGNER
DEMO
Report
Designer
NOVAS TECNOLOGIAS MICROSOFT
CUBE WIZARD
• New Cube Wizard:
• More efficient interface
• Create a cube based on a single de-normalized table
• Create a cube based on a data source that has only linked
dimensions
Analysis
Services
Wizards
NOVAS TECNOLOGIAS MICROSOFT
DIMENSION WIZARD
• New Dimension Wizard:
•
•
•
•
Create dimensions more efficiently
Automatically detect parent-child hierarchies
Provide safer default error configuration
Set member properties while creating the dimension
Analysis
Services
Wizards
NOVAS TECNOLOGIAS MICROSOFT
MORE INFORMATION
• SQL Server 2008 Product Info
http://www.microsoft.com/sql/2008
• SQL Server 2008 Books Online
• Microsoft SQL Server Community
http://www.microsoft.com/sql/community
http://www.codeplex.com/SqlServerSamples
http://mvp.support.microsoft.com
http://www.sqljunkies.com
• SQL Server Developer Center
http://msdn.microsoft.com/sql
• Training
http://www.rumos.pt
NOVAS TECNOLOGIAS MICROSOFT
MICROSOFT LEARNING
COURSE
M6157
M6158
M6231
TITLE
What's new in SQL Server 2008
Updating Your SQL Server 2005 Skills to SQL Server
2008
Writing Queries Using Microsoft SQL Server 2008
Transact-SQL
Maintaining a Microsoft SQL Server 2008 Database
M6232
Implementing a Microsoft SQL Server 2008 Database
M6234
Implementing and Maintaining Microsoft SQL Server
2008 Analysis Services
Implementing and Maintaining Microsoft SQL Server
2008 Integration Services
Implementing and Maintaining Microsoft SQL Server
2008 Reporting Services
M2778
M6235
M6236
NOVAS TECNOLOGIAS MICROSOFT
Q&A
Questions & Answers
NOVAS TECNOLOGIAS MICROSOFT