26
I am a DBA – Why should I care about SQL Server 2008 R2? Peter Ward – [email protected]

I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

  • Upload
    vuhuong

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

I am a DBA – Why should I care about SQL Server 2008 R2?

Peter Ward – [email protected]

Page 2: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

About Peter Ward

• Chief Technical Architect WARDY IT Solutions – Blog: www.wardyit.com/blog

– Email: [email protected]

– Twitter: @wardy

• APC Data Management Partner of the Year

• President QLD SQL Server User Group – www.qssug.org

• SQL Server MVP

• Microsoft Virtual TSP

Page 3: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Contents

• What’s new

• What’s under the hood

– My Top 3

Page 4: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

What’s New…

Page 5: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL
Page 6: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

What is new

• SQL Server Utility

• Data-Tier Application

• Connectivity to SQL Azure

• SQL Server PowerShell Provider

• Unicode Compression

Page 7: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

What is new

• SQL Server Utility

• Data-Tier Application

• Connectivity to SQL Azure

• SQL Server PowerShell Provider

• Unicode Compression

Page 8: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

-4

-2

0

2

4

6

8

10

DBA's

Databases

Hardware

Page 9: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Management Challenges

• Ever-increasing number of servers and applications

– Lack of enterprise-wide view of SQL Server health

– Server/instance

– Application

• Difficult resource planning

Page 10: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Deployment Challenges

• Difficult deployment

– Need to package applications with databases

– Need to record deployment intent

– Handing off T-SQL scripts is error-prone

– Upgrades are challenging

Page 11: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

SQL Server Utility

• Provides unified view of an organization’s SQL Server usage

• Shows health of – SQL Server instances

– Data-tier applications

– Database files, filegroups and volumes

• Provides resource monitoring – CPU utilization

– Storage space

Page 12: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Using a Utility Control Point

Create Utility Control Point (UCP)

Enroll SQL Server instances

Data-tier applications auto-enrolled

Monitor apps and instances using SSMS

Customize policies to suit

Page 13: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Data Tier Applications (DAC)

• Simplifies the development, deployment, and management of the data-tier

• Defines all of the Database Engine schema and instance objects

• A single unit of management through the development, deployment, and management lifecycle

• Contains policies that define the deployment prerequisite

Page 14: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

UCP & DAC Demo

Page 15: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Unicode Compression

• SQL Server stores Unicode as 2 bytes - UCS-2

• Save up to 50% of storage

• nvarchar(n) and nchar(n) columns compressed using Standard Compression Scheme for Unicode (SCSU)

• nvarchar(max) data is never compressed

• To take full advantage the object must be rebuilt with page or row compression

Page 16: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Unicode Compression Demo

Page 17: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL
Page 18: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

My top 3

• Merging Partitions

• Minimizing lockhash key collisions

• sp_estimate_data_compression_savings

Page 19: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

If I have a table consisting of five partitions and the middle partition needs to be dropped what are the steps?

Page 20: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Partition Steps

1) Create a non-partitioned target table with the same structure and indexes as the partitioned table

2) Use the switch command to move the data from the middle partition to the new target table

3) Alter the partition function by merging the empty partition

Page 21: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Merging Partitions

• The partition switch command is a metadata-only operation

• Work around – temporarily removes data

• 2008 SP 1 CU 6 fix only works with the same filegroup

Page 22: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Minimizing lockhash key Collisions

• SQL Server uses a lockhash value to represent a lock on the lock structure - introduced is SQL Server 7.0

• lockhash = 6 byte value made up of the key of the row and a hash algorithm to it

• A calculated lockhash value can lock more than one row within a B-Tree

• Algorithm re-written in SQL Server 2008 R2

Page 23: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Lockhash Key Demo

Page 24: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

sp_estimate_data_compression

• Using Compression (index or table or partition), there are two components of space savings – Fragmentation

– Compression

• What savings do I get from each?

• In SLQ Server 2008 R2 sp_estimate_data_compression can show space savings by defragmenting

Page 25: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Defragmentation Demo

Page 26: I am a DBA – Why should I care about SQL Server 2008 R2? am a DBA Why...Create Utility Control Point ... Create a non-partitioned target table with ... Why should I care about SQL

Questions