Module 13 Automating SQL Server 2008 R2 Management.

Slides:



Advertisements
Similar presentations
Your Data Any Place, Any Time Manageability. SQL Server 2008 Manageability Challenges Challenges face database administrators today : Managing complex.
Advertisements

Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Module 12: Auditing SQL Server Environments
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Module 5: Performing Administrative Tasks. Overview Configuration Tasks Routine SQL Server Administrative Tasks Automating Routine Maintenance Tasks Creating.
Maintaining and Automating SQL Server
SQL Server Agent Keith Binford. SQL Server Agent SQL Server Agent is a Windows service that can execute and schedule tasks and jobs.
Module 4 Working with Databases. Module Overview Overview of SQL Server Databases Working with Files and Filegroups Moving Database Files.
OpalisRobot™ Demonstration Actual Run Book Procedure Actual Data center Run Book Procedure documenting for Level 1 staff how to both VERIFY.
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
Module 7 Restoring SQL Server 2008 R2 Databases. Module Overview Understanding the Restore Process Restoring Databases Working with Point-in-time Recovery.
Module 5: Creating and Configuring Group Policy
DataBase Administration Scheduling jobs Backing up and restoring Performing basic defragmentation and index rebuilding Using alerts Archiving.
SQL Server 2005 Implementation and Maintenance Chapter 10: Maintaining and Automating SQL Server.
Automating Common DBA Tasks
Module 12: Backup and Recovery. Overview Backup and recovery methods available in Oracle and SQL Server 2008 Types of failure Types of recovery Formulating.
Module 5 Understanding SQL Server 2008 R2 Recovery Models.
Module 8 Implementing Backup and Recovery. Module Overview Planning Backup and Recovery Backing Up Exchange Server 2010 Restoring Exchange Server 2010.
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Microsoft ® Official Course Module 12 Monitoring, Managing, and Recovering AD DS.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
Module 12 Installing and Upgrading to SharePoint 2010.
Microsoft ® Official Course Module 10 Optimizing and Maintaining Windows ® 8 Client Computers.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
Implementing Update Management
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
Module 7: Fundamentals of Administering Windows Server 2008.
Module 19 Managing Multiple Servers. Module Overview Working with Multiple Servers Virtualizing SQL Server Deploying and Upgrading Data-Tier Applications.
Module 9 Designing and Implementing Stored Procedures.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Module 6 Backup of SQL Server 2008 R2 Databases. Module Overview Backing up Databases and Transaction Logs Managing Database Backups Working with Backup.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Module 14 Configuring Security for SQL Server Agent.
18 Copyright © Oracle Corporation, All rights reserved. Workshop.
Monitoring Windows Server 2012
Module 9 Configuring Messaging Policy and Compliance.
Module 1: Exploring Replication. Overview Understanding SQL Server Replication Setting Up Replication Understanding Agents in Replication Securing Replication.
Module 16: Performing Ongoing Database Maintenance
Module 10 Assigning Server and Database Roles. Module Overview Working with Server Roles Working with Fixed Database Roles Creating User-defined Database.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.
Module 14 Monitoring and Optimizing SharePoint Performance.
SQL Server 2000 Sys Admin Jeremiah Curtis Engineering Services
Module 5: Creating and Configuring Group Policies.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
Module 11 Authorizing Users to Access Resources. Module Overview Authorizing User Access to Objects Authorizing Users to Execute Code Configuring Permissions.
SQL Server 2008 R2 Manageability. Challenges facing database administrators today: Scaling management to multiple data centers Proactively monitoring.
Module 1 Introduction to SQL Server® 2008 R2 and its Toolset.
Module 12: Configuring and Managing Storage Technologies
IT System Administration Lesson 3 Dr Jeffrey A Robinson.
Module 6: Configuring User Environments Using Group Policies.
Maintenance Practices. Goal  Automate the necessary DBA chores to put organizations on the path of having healthier, consistent and more trustworthy.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Microsoft ® Official Course Module 6 Managing Software Distribution and Deployment by Using Packages and Programs.
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
Unit 10 ITT TECHNICAL INSTITUTE NT1330 Client-Server Networking II Date: 2/24/2016 Instructor: Williams Obinkyereh.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
SQL Server Agent All the Knobs You Need to Know Taiob M Ali.
SQL Server DBA Online TrainingSQL Server DBA Online Training.
Maintaining a Microsoft SQL Server 2008 Database
SQL Database Management
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
SQL Server Agent All the Knobs You Need to Know
Deploying and Configuring SSIS Packages
Automating SQL Server Management
Workshop.
Ch 10. Maintaining and Automating SQL Server
Presentation transcript:

Module 13 Automating SQL Server 2008 R2 Management

Module Overview Automating SQL Server Management Working with SQL Server Agent Managing SQL Server Agent Jobs

Lesson 1: Automating SQL Server Management Benefits of Automating SQL Server Management Available Options for Automating SQL Server Management Overview of SQL Server Agent Demonstration 1A: SQL Server Agent

Benefits of Automating SQL Server Management Reduced administrative workload Automate and Schedule regular tasks Proactive management Monitor Performance Recognize and respond to potential problems

Available Options for Automating SQL Server Management Jobs to perform regular tasks Alerts to respond to Events Operators to send Notifications from Jobs and Alerts

Overview of SQL Server Agent Runs as a Windows service Must be running to  Execute jobs  Fire alerts  Contact operators Start Mode should be set to Automatic SQL Server Agent is the component of SQL Server that is responsible for automation

Demonstration 1A: SQL Server Agent In this demonstration, you will see:  How to configure SQL Server Agent  How to review SQL Server Agent jobs using PowerShell

Lesson 2: Working with SQL Server Agent Defining Jobs, Job Step Types and Job Categories Creating Job Steps Scheduling Jobs for Execution Scripting Jobs Demonstration 2A: Scripting Jobs

Defining Jobs, Job Step Types and Job Categories Jobs support many types including: Transact-SQL Command line application PowerShell script execution Jobs can be configured to: Run once or repeatedly Start at SQL Server Agent start-up Start manually Jobs can be assigned to a Category SQL Server Agent Jobs are a specified series of operations performed sequentially by SQL Server Agent

Creating Job Steps Fail? Yes No Write to Application Log Fail the job Job step 1: Back up Database (Transact-SQL) Job step 2: Transfer Data (CmdExec) Job step 3: Custom Application (PowerShell) Yes Job succeeded Notify operator Job succeeded Notify operator No Fail? Notify operator

Scheduling Jobs for Execution Job: Backup Transaction Log Schedule: Mon-Sun Shift 1 Every 1 Hours From: 8:00 A.M. To: 5:00 P.M. Every 1 Hours From: 8:00 A.M. To: 5:00 P.M. Daily Schedule Schedule: Mon-Sun Shift 2 Every 4 Hours From: 5:01 P.M. To: 7:59 A.M. Every 4 Hours From: 5:01 P.M. To: 7:59 A.M. Daily Schedule More than one schedule can be defined per job Schedules can be reused in other jobs More than one schedule can be defined per job Schedules can be reused in other jobs

Scripting Jobs Jobs can be scripted for documentation, archiving, and deployment on other instances

Demonstration 2A: Scripting Jobs In this demonstration you will see how to:  Create a job in SSMS  Script a Job  Deploy a job on a second instance of SQL Server

Lesson 3: Managing SQL Server Agent Jobs Viewing Job History Querying SQL Server Agent-related System Tables and Views Troubleshooting Failed Jobs Demonstration 3A: Viewing Job History and Resolving Failed Jobs

Viewing Job History SQL Server Agent keeps history information in msdb Job history can be queried directly or viewed through SSMS Job Activity monitor shows current live information Retention of history can be configured based on time or size

Querying SQL Server Agent-related System Tables and Views SQL Server Agent keeps configuration and history in msdb  System tables for Agent are located in the dbo schema  Tables are documented in Books Online Use history tables to automate collection of job history over several systems SELECT j.name, jh.run_date, jh.run_time, jh.message FROM msdb.dbo.sysjobhistory AS jh INNER JOIN msdb.dbo.sysjobs AS j ON jh.job_id = j.job_id WHERE jh.step_id = 0; GO; SELECT j.name, jh.run_date, jh.run_time, jh.message FROM msdb.dbo.sysjobhistory AS jh INNER JOIN msdb.dbo.sysjobs AS j ON jh.job_id = j.job_id WHERE jh.step_id = 0; GO;

Troubleshooting Failed Jobs If SQL Server Agent is not running  Check settings of the service  Check the msdb database Review job history  Check job outcome to identify the last step that was executed  Check job step outcome to identify why the step failed If the job did not start, verify:  Job is enabled  Job is scheduled  Schedule is enabled Verify that all dependent objects such as databases, files, procedures are available  Check that security settings allow access to dependent objects

Demonstration 3A: Viewing Job History and Resolving Failed Jobs In this demonstration, you will see:  A job that has failed to execute correctly  How to review the job history using SSMS  How to review the job history using T-SQL

Lab 13: Automating SQL Server Management Exercise 1: Create a Data Extraction Job Exercise 2: Schedule the Data Extraction Job Challenge Exercise 3: Troubleshoot a Failing Job (Only if time permits) Logon information Estimated time: 45 minutes

Lab Scenario There are a number of routine tasks to be performed on the Proseware instance. Previously these tasks have been performed manually and the lack of consistency in performing these tasks has caused issues for the organization. On the new instance, you need to automate these tasks using SQL Server Agent. There is also a report about an existing SQL Server Agent job that is not performing as expected. If you have time, you need to resolve the issues with the job.

Lab Review How do you configure SQL Server Agent to notify you that a particular job has failed? Can one job include different types of job steps?

Module Review and Takeaways Review Questions Best Practices