Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Management
Overview
Management
Overview
BEGIN TRAN
INSERT PayrollProcessingHistory
VALUES (‘Whigham’, ‘2009-04-01’, @PayAmount)
INSERT ChecksToWrite
VALUES (@ProcessingHistoryId , @PayAmount)
COMMIT TRAN
SQL Server Databases
Management
Overview
Management
Overview
Management
Overview
Management
Overview
* More information can be found in our SQL Server 2008 Analysis Services course
In the next video…
Management
Overview
Management
Overview
• Performance
– The more disks, the faster performance
– SQL Server can read two files on two separate
disks in parallel
• Can nearly double read and write access
Why should I use multiple files?
Management
Overview
Management
Overview
• Autogrowth parameters:
– Grow the file by a percentage of current size or a
fixed amount (in MB)
– Set maximum size
• Hint: Always set a maximum size
– Do not let the file grow until it fills up the disk
Creating Databases
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
SELECT *
FROM Parent p JOIN Child c
ON p.DateTimeKey = c.DateTimeKey
Database Configuration
• Parameterization continued…
– When parameterization is SIMPLE and SQL Server
recognizes a query that it thinks will be used in the
exact same way but with different SARGs (Search
ARGuments), it will attempt to create a reusable
execution plan
• Previously called “auto-parameterization”
Database Configuration
SQL Server recognizes that this query will likely have multiple variations
SQL Server creates a reusable, parameterized query plan that satisfies both
queries
Database Configuration
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
Management
Overview
• Let’s do a demo!
An Overview of Indexes and
Partitioning
Management
Overview
Management
Overview
Management
Overview
• Let’s do a demo!
Managing Database Files
Management
Overview
• Let’s demo!
Managing Database Files
Management
Overview
DBCC SHRINKDATABASE
( database_name [ , target_percent ]
[ , { NOTRUNCATE | TRUNCATEONLY } ]
)
Shrinking a Database
• NOTRUNCATE
– Compress pages to “front” of file
– Does not release freed space to OS
– Only available in T-SQL
• TRUNCATEONLY
– Does not compress the pages to the front of the file
– Releases freed space after the “last” page to the OS
– Default in SSMS
Shrinking a Database
-- TRUNCATEONLY:
DBCC SHRINKDATABASE(N'LearnItFirst.com')
-- NOTRUNCATE:
DBCC SHRINKDATABASE(N'LearnItFirst.com',
NOTRUNCATE)
Shrinking a Database
• EMPTYFILE
– Moves pages to another file in the file group
• target_size
– Cannot compress data
– Defaults to MB
– If not specified, uses the creation size
Shrinking a Database
• Let’s demo!
Suggested Changes After the
Upgrade
Management
Overview
• Remember that:
– Service packs are the most-tested
– Cumulative Updates are the next-most-tested
– Critical Updates are the least-tested
• You don’t have to install the most recent
updates
– Unless there is a specific security issue
After the Upgrade
• Let’s demo!
Suggested Changes After the
Upgrade
Management
Overview
Management
Overview
Management
Overview