Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Server Agent All the Knobs You Need to Know Taiob M Ali.

Similar presentations


Presentation on theme: "SQL Server Agent All the Knobs You Need to Know Taiob M Ali."— Presentation transcript:

1 SQL Server Agent All the Knobs You Need to Know Taiob M Ali

2 About Me  10 Years as DBA  MCSA SQL Server 2012  Certified MongoDB DBA  11 Years in Merchant Marine  Education Naval Science and Computer Science

3 Agenda  Agent Security  Schedule when CPU Idle  Job History  Operators  Alerts  Proxies

4 Security-Service Account  Should not run as Local System Account  Run under domain account but not a member of local admin group  Give privilege to “Log on as a service”  How to do it? How to do it?

5 Security-Users  MSDB database roles  SQLAgentUserRole  SQLAgentReaderRole  SQLAgentOperatorRole  Details Details

6 Agenda Agent Security  Schedule when CPU Idle  Job History  Operators  Alerts  Proxies

7 Job Schedule  Skip a single run- do not disable job  An extra run- add an one time schedule  One time job –Delete automatically.  Changing standard schedules

8

9 Job Schedule- Idle CPU  Schedule a job when CPU is idle  Create a definition of idle CPU  Chose from “Schedule Type”

10 Job Schedule- Idle CPU  Does not work out of the gate  CPU Idle definition control schedule  Need custom solution

11 Running every 20 Secs—CPU IDLE Definition control job schedule Running every hour—Custom Solution; You control job schedule Hour Interval Interval in Seconds

12 Job Run CPU Idle condition meet Test Run every 20 sec FIRE JOB

13 Job Run only if Enabled CPU Idle condition meet Test Run every 20 sec Control Job run every one hour Enable Job Disable Job FIRE JOB

14 DEMO– Schedule Job When CPU Idle

15 Agenda Agent Security Schedule when CPU Idle  Job History  Operators  Alerts  Proxies

16 Job History  If bigger than 3998 char get truncated …History is truncated

17 Why does history get truncated?

18

19

20 Custom Solution  More Options  Per job category  Per job  Different threshold for success/failure  Default value  Details: bit.ly/purgehistory bit.ly/purgehistory

21 Driving table

22 Create two store procedures  One will drive  DBA_sysjobhistory_driver  One will do the purge  DBA_sp_jobhistory_row_limiter

23 Schedule a job

24 Fail Safe 30 days

25 Agenda Agent Security Schedule when CPU Idle Job History  Operators  Alerts  Proxies

26 DEMO-Operators

27 Built in report  20 most frequently executed jobs  20 most frequently failing jobs  20 slowest jobs based  Job Steps Execution History

28 Agenda Agent Security Schedule when CPU Idle Job History Operators  Alerts  Proxies

29 Alert  Powerful feature for monitoring  SQL Server Event  Performance Condition  WMI Event-added in 2005  Service broker must be enabled for MSDB  Pager and net send options will be removed from SQL Server Agent in a future version of Microsoft SQL Server

30 DEMO ALERT

31 Agenda Agent Security Schedule when CPU Idle Job History Operators Alerts  Proxies

32 Proxies-when to Use  Jobs are interacting with other network components or machines. .bat file  PowerShell script

33 Proxies-How to set up  Create a privileged account  Create a credential  Create a new proxy  Use proxy in job step  Demo Proxy

34 DEMO Proxies

35 Resource  Security Considerations - SQL Server Installation Security Considerations - SQL Server Installation  SQL Server Agent Fixed Database Roles SQL Server Agent Fixed Database Roles  Script to create alerts by Glenn Berry Script to create alerts by Glenn Berry  Custom Category article by Tim Ford Custom Category article by Tim Ford  Scripts-custom job history retention Scripts-custom job history retention  Deadlock alert blog Deadlock alert blog  How to read Deadlock Graph How to read Deadlock Graph

36 @SqlWorldWide linkedin.com/in/taiobali sqlworldwide.com taiob@sqlworldwide.com

37

38 I am Thankful to  Robert Padilla  Mike Hillwig  Adam Machanic  Jeremy Lowell  Suneel Mundlapudi  Ayman El-Ghazali  Kenneth Fisher


Download ppt "SQL Server Agent All the Knobs You Need to Know Taiob M Ali."

Similar presentations


Ads by Google