- Introduction
-
Table of Contents
- Microsoft SQL Server Defined
- Microsoft SQL Server Features
- Microsoft SQL Server Administration
- Microsoft SQL Server Programming
- Performance Tuning
-
Practical Applications
- Choosing the Back End
- The DBA's Toolbox, Part 1
- The DBA's Toolbox, Part 2
- Scripting Solutions for SQL Server
- Building a SQL Server Lab
- Using Graphics Files with SQL Server
- Enterprise Resource Planning
- Customer Relationship Management (CRM)
- Building a Reporting Data Server
- Building a Database Documenter, Part 1
- Building a Database Documenter, Part 2
- Data Management Objects
- Data Management Objects: The Server Object
- Data Management Objects: Server Object Methods
- Data Management Objects: Collections and the Database Object
- Data Management Objects: Database Information
- Data Management Objects: Database Control
- Data Management Objects: Database Maintenance
- Data Management Objects: Logging the Process
- Data Management Objects: Running SQL Statements
- Data Management Objects: Multiple Row Returns
- Data Management Objects: Other Database Objects
- Data Management Objects: Security
- Data Management Objects: Scripting
- Powershell and SQL Server - Overview
- PowerShell and SQL Server - Objects and Providers
- Powershell and SQL Server - A Script Framework
- Powershell and SQL Server - Logging the Process
- Powershell and SQL Server - Reading a Control File
- Powershell and SQL Server - SQL Server Access
- Powershell and SQL Server - Web Pages from a SQL Query
- Powershell and SQL Server - Scrubbing the Event Logs
- SQL Server 2008 PowerShell Provider
- SQL Server I/O: Importing and Exporting Data
- SQL Server I/O: XML in Database Terms
- SQL Server I/O: Creating XML Output
- SQL Server I/O: Reading XML Documents
- SQL Server I/O: Using XML Control Mechanisms
- SQL Server I/O: Creating Hierarchies
- SQL Server I/O: Using HTTP with SQL Server XML
- SQL Server I/O: Using HTTP with SQL Server XML Templates
- SQL Server I/O: Remote Queries
- SQL Server I/O: Working with Text Files
- Using Microsoft SQL Server on Handheld Devices
- Front-Ends 101: Microsoft Access
- Comparing Two SQL Server Databases
- English Query - Part 1
- English Query - Part 2
- English Query - Part 3
- English Query - Part 4
- English Query - Part 5
- RSS Feeds from SQL Server
- Using SQL Server Agent to Monitor Backups
- Reporting Services - Creating a Maintenance Report
- SQL Server Chargeback Strategies, Part 1
- SQL Server Chargeback Strategies, Part 2
- SQL Server Replication Example
- Creating a Master Agent and Alert Server
- The SQL Server Central Management System: Definition
- The SQL Server Central Management System: Base Tables
- The SQL Server Central Management System: Execution of Server Information (Part 1)
- The SQL Server Central Management System: Execution of Server Information (Part 2)
- The SQL Server Central Management System: Collecting Performance Metrics
- The SQL Server Central Management System: Centralizing Agent Jobs, Events and Scripts
- The SQL Server Central Management System: Reporting the Data and Project Summary
- Time Tracking for SQL Server Operations
- Migrating Departmental Data Stores to SQL Server
- Migrating Departmental Data Stores to SQL Server: Model the System
- Migrating Departmental Data Stores to SQL Server: Model the System, Continued
- Migrating Departmental Data Stores to SQL Server: Decide on the Destination
- Migrating Departmental Data Stores to SQL Server: Design the ETL
- Migrating Departmental Data Stores to SQL Server: Design the ETL, Continued
- Migrating Departmental Data Stores to SQL Server: Attach the Front End, Test, and Monitor
- Tracking SQL Server Timed Events, Part 1
- Tracking SQL Server Timed Events, Part 2
- Patterns and Practices for the Data Professional
- Managing Vendor Databases
- Consolidation Options
- Connecting to a SQL Azure Database from Microsoft Access
- SharePoint 2007 and SQL Server, Part One
- SharePoint 2007 and SQL Server, Part Two
- SharePoint 2007 and SQL Server, Part Three
- Querying Multiple Data Sources from a Single Location (Distributed Queries)
- Importing and Exporting Data for SQL Azure
- Working on Distributed Teams
- Professional Development
- Application Architecture Assessments
- Business Intelligence
- Tips and Troubleshooting
- Additional Resources
The DBA's Toolbox, Part 2
Last updated Mar 28, 2003.
In the last installment of this two-part series, I mentioned that there are often more things to learn about SQL Server Management than you can take in at one time. A simple method to help cut the information down to size is to categorize it all into concepts, processes and tools. You can attack the knowledge from any or all of those angles.
I also mentioned that I’ve covered the general concepts for some of the features and components in SQL Server in a series of tutorials called Microsoft SQL Server Features. I pointed out a DBA checklist that I created to help with some process, and I mentioned longer tutorials and articles on the native SQL Server Tools for SQL Server 2000 here and SQL Server 2005 here. In this installment, I’ll close out the discussion of the tools, and just so you don’t have to flip back and forth between the two articles I’ll duplicate the chart information in this tutorial as well.
Once again, I’ll try and stick with the tools that ship with SQL Server. Every once in a while, though, I run into a tool that just does such a good job that I’ll mention it, although I won’t be able to go into as much process with those tools. You’ll just have to rely on their documentation for that.
And I need to add another word or two about those charts before we dive in. The steps I show you here are guides—they may not suite your needs in every situation. For instance, having Analysis Services or Reporting Services installed on your system might dictate different steps than I show here. The best approach is to have a test system that you can play around with until you’re comfortable, and then create your own checklists and processes that fit your situation perfectly. I show you how to create your own testing lab here.
Let’s pick up where we left off in the last installment, with the checklist as it stands now.
Installing and Configuring the SQL Server Platform
Task |
Tool |
Process/Reference |
|
Install SQL Server |
Installation CD |
Run SETUP.EXE. |
|
Multiple Installations of SQL Server |
Installation CD and Unattended Installation File |
Run SETUP.EXE with command line switches. |
|
Multiple Installations of SQL Server |
Microsoft SMS |
Develop installation packages, select targets, set schedule. Now called "System Center Configuration Manager" |
|
Multiple Installations of SQL Server |
Windows Server |
You can use Windows Policies to push out software based on policy conditions. |
Designing and Implementing Databases
Task |
Tool |
Process/Reference |
|
Run Transact-SQL (T-SQL) Statements |
SQL Server Query Analyzer (2K) |
Open Query Analyzer tool, connect to a database. |
|
Run Transact-SQL (T-SQL) Statements |
SQL Server Management Studio (2K5) |
Open SSMS, open a Query Window. |
|
Run Transact-SQL (T-SQL) Statements |
TOAD (Quest Software) |
Connect to a database engine, open query. |
|
Create Database Design Graphically |
SQL Server Enterprise Manager (2K) |
Connect to a server. Right-click database folder. Select "Create New Database" from the menu that appears. Create a database with any options you want. Open the database, right-click the "Database Diagrams" folder, and select "Create New Diagram" from the menu. (you’ll be asked about creating some objects. Let it do that). Bypass the "Add Tables" request. Right-click in the screen to create tables and relationships. |
|
Create Database Design Graphically |
SQL Server Management Studio (2K5) |
Connect to a server. Right-click database folder. Select "Create New Database" from the menu that appears. Create a database with any options you want. Open the database, right-click the "Database Diagrams" folder, and select "Create New Diagram" from the menu. (you’ll be asked about creating some objects. Let it do that) Bypass the "Add Tables" request. Right-click in the screen to create tables and relationships. |
|
Create Database Design Graphically |
Visual Studio Enterprise Edition |
See this reference for more information. |
|
Create Database Design Graphically |
Erwin |
See this reference for more information. |
|
Create Database Design Graphically |
Visual Studio Team Edition for Database Professionals (a.k.a. "Data Dude") |
See this reference for more information. |
Configuring Security and Access
Task |
Tool |
Process/Reference |
|
Create Database Roles |
Transact-SQL Commands |
Open a query tool, use the CREATE ROLE command. |
|
Create Database Roles |
Enterprise Manager (2K) |
Open EM, connect to a server. Navigate to and open a database. Right-click Roles, Select New Database Role from the menu. Follow the prompts. |
|
Create Database Roles |
SQL Server Management Studio (2K5) |
Open SSMS, connect to a database Open a database Right-click the Security/Roles/Database Roles node, select New Database Role from the menu. Follow the prompts |
|
Grant Rights to Roles |
Transact-SQL Commands |
Open a query tool, use the GRANT command. |
|
Grant Rights to Roles |
Enterprise Manager (2K) |
Open EM, connect to a server. Navigate to and open a database. Right-click an object (such as a table), Select Properties from the menu. Click the Permissions button. Select the permissions you want from the list that shows, assign them to the proper Role. Follow the prompts. |
|
Grant Rights to Roles |
SQL Server Management Studio (2K5) |
Open SSMS, connect to a server. Navigate to and open a database. Right-click an object (such as a table), Select Properties from the menu. Click the Permissions object. Click the Add Button. Select the permissions you want from the list that shows, assign them to the proper Role. Follow the prompts. |
|
Create Server Logins |
Transact-SQL Commands |
Open a query tool, use the CREATE LOGIN command. |
|
Create Server Logins |
Enterprise Manager (2K) |
Open EM, connect to a server. Open the Security node. Right-click the Logins object, select New Login from the menu that appears. Follow the prompts. |
|
Create Server Logins |
SQL Server Management Studio (2K5) |
Open SSMS, connect to a server. Open the Security node. Right-click the Logins object, select New Login from the menu that appears. Follow the prompts. |
|
Create Database Users |
Transact-SQL Commands |
Open a query tool, use the CREATE LOGIN command. |
|
Create Database Users |
Enterprise Manager (2K) |
Open EM, connect to a server. Navigate to and open a database. Right-click Users, Select New Database User from the menu. Follow the prompts. |
|
Create Database Users |
SQL Server Management Studio (2K5) |
Open SSMS, connect to a database Open a database Right-click the Security/Users node, select New User from the menu. Follow the prompts |
|
Add Users to Roles |
Transact-SQL Commands |
Open a query tool, use the CREATE LOGIN command. |
|
Add Users to Roles |
Enterprise Manager (2K) |
Open EM, connect to a server. Navigate to and open a database. Right-click a Role, Select Properties from the menu. Click the Add button. Follow the prompts. |
|
Add Users to Roles |
SQL Server Management Studio (2K5) |
Open SSMS, connect to a database Open a database Right-click the Security/Roles/Database Roles node, select Properties from the menu. Click the Add button. Follow the prompts |
That’s the last of the previous list, so let’s continue now with the rest of the tasks you need to work with.
Maintenance
The server is now installed and configured. You have designed and created a database, and you’re secured the objects in it to the proper roles and tied Server Logins and Database Users to those roles. The applications are written, and your system is up and running.
Now it’s time to ensure that the system is properly maintained. You should start out with a good disaster recovery plan, which I’ve explained here. The reason that’s a good place to start is that it forces you to plan out what the desired outcomes of your system are after a major meltdown—something you hopefully won’t have to face a lot. Determining that state will tell you what to protect.
Along with protection, you need to optimize. Although I’ll cover optimization in a moment, there are some steps you need to take as part of general maintenance. I’ll cover those below.
The final two checklists are a bit different. Maintenance and Performance Tuning are two things that aren’t quite as simple as following a few steps, so I’m going to copy the checklist I have in this tutorial and put it here for the maintenance part. The reason is that the maintenance section can become quite complex, and for most of these things you shouldn’t just follow a simple set of instructions. Don’t worry, however, this checklist still points out the tools to use and has links to more information. I’m going to add some information here so that you have a full set of links to understand how each of these tasks can be accomplished. Note that for the most part, Enterprise Manager and Query Analyzer are the tools you use with SQL Server 2000, and SQL Server Management Studio has everything you need for SQL Server 2005. In the links I provide, both are referenced, and the scripts for each are also part of the link.
Remember, the checklist there and here cover only the basics; your setup will most certainly be different. But this is a good way to exercise your maintenance plan to see what mix of graphical, command or scripting you like to work in.
|
Task |
Tools, Processes and Reference |
|
Check Backups |
Check the backups using the logs. |
|
Check Event Logs |
Check the System, Application and Security areas in the Windows Event logs. |
|
Check SQL Server Logs |
Check the log files in SQL Server. |
|
Check Drive Space |
Check that the drives that store database logs, data files and operational files have sufficient space. |
|
Check jobs history |
Check the job history to ensure that it ran correctly. |
|
Check Agent Logs |
Check the agent logs on your system. |
|
Perform database backups |
Create a plan that executes an automated backup for all of your databases, including the system databases. |
|
Update Indexes and Statistics |
Develop a good re-indexing strategy. Use DBCC commands or the referenced graphical tools to check and tune the indexes. |
|
Archive Backups |
Determine when the data is no longer needed locally and send tapes or other media off-site for storage. This is a physical process so there isn’t tool involved here (other than your brain) so use the link provided to learn what you need to do. |
|
Data Archival |
If you have data that loses its immediate value, create a "rollup" strategy to aggregate the data to save space. Once again, many tools or processes are useful here, such as Data Transformation Services (2000) or Integration Services (2005) are great places to start. The link will point to more articles on those tools. |
|
Update Change Management Scripts |
Script your database objects into a change control management system. I use PowerShell, but you can also use Database Management Objects (DMO) or even right-click on object and script it from there. |
|
Install and configure SQL Mail or Database Mail |
Install and configure SQL or Database Mail. The same installation tools from above can be used here. |
|
Automate Maintenance and Logging |
Use the SQL Server Agent to process all maintenance and logging tasks possible. You can find more information on SQL Server Agent in the link provided. |
|
Review Security Access Points |
Check the server for network access. You can do this using various tools, check the link provided. |
|
Test Restore Operations |
Restore the database backups to a test server. The link shows you how. |
|
Check indexes |
Create a report on indexes to find which are useful. Various DBCC commands and graphical tools are available to help you do that in the link provided. |
Monitoring and Performance Tuning
Monitoring and Performance Tuning go hand-in-hand. You have to know which part of the system is the bottleneck before you can choose a tool to fix it, so you’ll want to check this series of tutorials to learn how to do that.
As I mentioned earlier, you’ll find many of the same tasks for improving your performance on your system in maintenance as here. I’ll duplicate some of those in case you’re using this chart for reference.
Once again, this chart differs from the ones I created in the last article. The reason is that the steps are quite involved, and would make the checklist too bulky to easily read. This format allows you to see the tasks in a list, but use the hyperlinks in the text to get to more information.
Task |
Tool |
Process/Reference |
|
Check indexes |
DBCC Commands Graphical tools in EM, QA and SSMS Third-party tools |
Create a report on indexes to find which are useful. Various DBCC commands and graphical tools are available to help you do that in the link provided. |
|
Check overall performance of the system |
Index Tuning Wizard (2000) Database Tuning Advisor (2005) |
Check this series of articles for more in-depth information on these tools and processes you should follow to monitor and tune your system. |
|
Find performance issues and determine steps to correct them |
Spotlight on SQL Server |
I have to mention this tool because I have found it so useful. You can read my review and the steps to check your system here. |
InformIT Articles and Sample Chapters
If you’re really in a hurry and need an even shorter checklist, I’ve got one of those here.
Online Resources
Since this is such a general list, it may be useful to point out Microsoft’s site on SQL Server—at least the technical one. There’s another here that deals with the marketing side.
