Reseeding identity columns

I recently worked on a project I which I redesigned sales data warehouse as a STAR schema, using daily file partitions, with a automatic sliding window, and applying data compression at the page level. I ended up reducing a 5 terabyte database to less than 750 GB. I will be writing several articles on the lessons that I learned during the process. Today, I want to talk about how to reseed a identity column if a data load for a dimension fails. Most dimension tables use a surrogate key to…

Shrinking the Transaction Log

The transaction log file records all transactions and the database modifications made by each transaction. Heavy application processing against the database can make the transaction log grow quickly. Therefore, the transaction log must be truncated on a ADHOC basis to keep it from filling up. Each physical log file is divided into smaller logical units called virtual log files (VLFs). Truncation provides free space by deleting inactive virtual log files. To avoid running out of log file space or physical disk space if growth is set to unlimited, one should…

Checksum vs Hashbytes

I recently worked on a project I which I redesigned sales data warehouse as a STAR schema, using daily file partitions, with a automatic sliding window, and applying data compression at the page level. I ended up reducing a 5 terabyte database to less than 750 GB. I will be writing several articles on the lessons that I learned during the process. Today, I want to talk about how to generate a hash key by using two built in SQL Server functions. A hash function is any algorithm that maps…

Surrogate Keys

I recently worked on a project I which I redesigned sales data warehouse as a STAR schema, using daily file partitions, with a automatic sliding window, and applying data compression at the page level. I ended up reducing a 5 terabyte database to less than 750 GB. I will be writing several articles on the lessons that I learned during the process. Today, I want to talk about how surrogate keys can be used to tie the dimension tables to the fact tables. I need to start the talk off…

Moving System DB’s – Part 3

I was recently approached by my manager to free up a Direct Attached Storage (DAS) device from a test server so that it could be leveraged in a higher environment. To my amazement, both the system databases and binary executables were installed on the drive I needed to move. Today, we are going to concentrate on moving the binary executables from Drives D: and H:. The solution to this technical problem is to trick the database engine in thinking nothing has changed. In reality, two new drives will be carved…

Moving System DB’s – Part 2

I was recently approached by my manager to free up a Direct Attached Storage (DAS) device from a test server so that it could be leveraged in a higher environment. To my amazement, both the system databases and binary executables were installed on the drive I needed to move. Today, we are going to concentrate on moving master and resource system databases. Here is a article from MSDN to use as reference. Moving the master database 1 – Open the SQL Server configuration manager. 2 – Select the SQL Server…

Moving System DB’s – Part 1

I was recently approached by my manager to free up a Direct Attached Storage Device (DAS) from a test server so that it could be leveraged in a higher environment. To my amazement, both the system databases and binary executables were installed on the drives I needed to move. From the lessons I learnt over the past few days, I am going to write a series of articles on moving a SQL Server system. Please refer to my database files article which explains how to move user databases. Today, we…

Managing Services

The SQL Server Enterprise database comes with many components to solve your business needs. Database Services – core relational database engine that executes TSQL SQL Server Agent – monitors database engine, fire alerts and schedules/executes jobs Integration Services – stores and executes ETL packages Reporting Services – manages, executes, and delivers reports Analysis Services – provides analytical processing and data mining SQL Server Browser – supports instance name resolution for clients All these components have one thing in common! They are all windows services that can be stopped, paused, and/or…

Server Benchmarking

“I feel the need for speed” is a memorable quote by the character Maverick in the 1986 Movie called Top Gun. We all want to have a server that executes as fast as a Mustang, not as slow as Yugo. With today’s servers being built on Virtual Machines (VM), how can you tell if your server is slow? One way to determine server speed is to benchmark your physical laptop against the newly built virtual machine (VM). To do this test, you need to create a program that is both…

Upgrading Older Databases

A new version of SQL Server is released every few years. This year was no different with the launch of SQL Server 2012 in March. It is important to migrate older, unsupported databases to a current version. I am going to examine 3 different techniques to upgrade the [PUBS] sample database from SQL Server 2000 to 2008 R2. The first two techniques require the database files to be copied from the older server to the new one. Use the ALTER DATABASE command to kick off the users and set the…