Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Basic Administration

In this chapter, we will cover:

  • Creating a SQL Server instance inventory

  • Creating a SQL Server database inventory

  • Listing installed hotfixes and Service Packs

  • Listing running/blocking processes

  • Killing a blocking process

  • Checking disk space usage

  • Setting up WMI server event alerts

  • Detaching a database

  • Attaching a database

  • Copying a database

  • Executing a SQL query to multiple servers

  • Creating a filegroup

  • Adding a secondary data file to a filegroup

  • Increasing data file size

  • Moving an index to a different filegroup

  • Checking index fragmentation

  • Reorganizing/rebuilding an index

  • Running DBCC commands

  • Setting up Database Mail

  • Listing SQL Server Jobs

  • Adding a SQL Server operator

  • Creating a SQL Server Job

  • Adding a SQL Server event alert

  • Running a SQL Server Job

  • Scheduling a SQL Server Job