Book description
The definitive guide to automating SQL Server admnistration with Powershell scripts
If you're a SQL Server database administrator, this book will make your life easier. Windows PowerShell is an administrative scripting tool that allows you to automate many tasks you're probably currently doing by hand. This nuts-and-bolts guide shows you how to create Windows PowerShell scripts to administer almost every aspect of SQL Server.
You'll get a thorough introduction to PowerShell basics and all the PowerShell components that have been integrated into SQL Server 2008, as well as actual administration tasks. The book provides complete scripts that have been tested and proven, saving you hours of effort.
The new release of Microsoft SQL Server 2008 now includes Windows PowerShell, allowing administrators of large-scale enterprise databases to automate many tasks
SQL Server 2008 Administration with Windows PowerShell introduces you to PowerShell, covering its components in detail as well as providing basic instruction in using scripts to administer the database
The book includes numerous examples of SQL tasks that have been automated and also provides completed scripts that you can put to use immediately
The Companion Web site includes complete code scripts
If you're a database administrator, the scripts and techniques in SQL Server 2008 Administration with Windows PowerShell will save you hours of effort.
Table of contents
- Copyright
- About the Authors
- Credits
- Acknowledgments
- Introduction
- 1. What Is Windows PowerShell?
- 2. Windows PowerShell Command Types, Snap-ins, and cmdlets
- 3. Windows PowerShell Programming, Scripting, Error Handling, and Debugging
- 4. Windows PowerShell Functions, Parameters, Sourcing, Scopes, and User Profiles
-
5. Working with the File System, Registry, and Variables
- 5.1. Using Get-PSDrive and Get-PSProvider
- 5.2. Working with File System
- 5.3. Working with the Registry
-
5.4. Working with Variables
- 5.4.1. Automatic Variables
- 5.4.2. Preference Variables
-
5.4.3. User-Created Variables
- 5.4.3.1. New-Variable: Creates a New Variable
- 5.4.3.2. Get-Variable: Gets the Variables
- 5.4.3.3. Set-Variable: Sets the Value of Variables or Changes the Properties of the Variables
- 5.4.3.4. Remove-Variable: Removes Variables
- 5.4.3.5. Clear-Variable: Deletes the Value of Variables and Makes the Variables Null
- 5.5. Working with Environment Variables
- 5.6. Summary
- 6. Working with Event Logs
- 7. Working with Windows Services and Processes
- 8. Working with WMI
- 9. WMI Provider for Configuration Management
-
10. WMI Provider for Server Events
- 10.1. WMI Provider for Server Events
- 10.2. WMI Query Language (WQL)
- 10.3. Event Handling with Windows PowerShell 2.0
- 10.4. Monitoring Errors from the SQL Server Error Log
- 10.5. Monitoring Deadlocks
- 10.6. Monitoring Blockings
- 10.7. Monitoring Login Changes and Failed Login Attempts
- 10.8. Monitoring Databases
- 10.9. Monitoring Database Objects
- 10.10. Summary
- 11. Windows PowerShell in SQL Server 2008 Environment, SQL Server PowerShell Provider
- 12. Managing Policies through SQLSERVER:\SQLPolicy
- 13. Windows PowerShell and SMO
-
14. Building SQL Server Standards and PowerShell Coding Standards
- 14.1. SQL Server Standards
-
14.2. SQL Server Development Standards
-
14.2.1. Naming Conventions
- 14.2.1.1. Databases
- 14.2.1.2. Tables
- 14.2.1.3. Views
- 14.2.1.4. Stored Procedures
- 14.2.1.5. User-Defined Functions
- 14.2.1.6. Triggers
- 14.2.1.7. Indexes
- 14.2.1.8. Columns
- 14.2.1.9. User-Defined Data Types
- 14.2.1.10. Primary Keys
- 14.2.1.11. Foreign Keys
- 14.2.1.12. Default and Check Constraints
- 14.2.1.13. Variables
- 14.2.1.14. Roles
- 14.2.2. General Rules
-
14.2.1. Naming Conventions
-
14.3. Stored Procedure Standards
- 14.3.1. Keep Them Small
- 14.3.2. "DBO" As Object Owner
- 14.3.3. Use Comments Generously
- 14.3.4. Select *
- 14.3.5. Cursors
- 14.3.6. Temporary Tables
- 14.3.7. Things to Avoid
- 14.3.8. Things to Use
- 14.3.9. Check @@ERROR
- 14.3.10. Use SQL Server Date Data Types
- 14.3.11. DML Statements
- 14.3.12. ANSI-Standard Join Clauses
- 14.3.13. Deprecated Features
- 14.4. Database Design Standards and Best Practices
- 14.5. Data Protection Standards and Best Practices
- 14.6. SQL Server Production Standards
- 14.7. PowerShell Coding Standard
- 14.8. Summary
- 15. Building SQL Server Inventory
- 16. SQL Server Installation
- 17. Collecting SQL Server Performance and Host Performance Data
- 18. Monitoring SQL Server
- 19. Monitoring Disk Space Usage, Database Files, and Backups
- 20. Defining Policies
- 21. Generating Database Scripts
- A. cmdlets
Product information
- Title: Microsoft® SQL Server® 2008 Administration with Windows PowerShell™
- Author(s):
- Release date: June 2009
- Publisher(s): Wrox
- ISBN: 9780470477281
You might also like
book
Microsoft® SQL Server® 2008 Internals
Delve inside the core SQL Server engine—and put that knowledge to work—with guidance from a team …
book
SQL Server 2005 Practical Troubleshooting: The Database Engine
Never-Before-Published Insiders’ Information for Troubleshooting SQL Server 2005. This is the definitive guide to troubleshooting the …
book
Exchange Server 2007 How-To: Real Solutions for Exchange Server 2007 SP1 Administrators
Exchange Server 2007 How-To Real Solutions for Exchange Server 2007 SP1 Administrators J. Peter Bruzzese Need …
book
Pro Oracle Database 11g RAC on Linux
Pro Oracle Database 11g RAC on Linux provides full-life-cycle guidance on implementing Oracle Real Application Clusters …