SlideShare una empresa de Scribd logo
1 de 18
Automation 
Ram Kedem
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
The What 
•SQL Server Agent enables you to automatethe execution of jobs. 
•SQL Server Agent jobs are collections of tasks known asjob steps. A step might be an activity such as taking a transaction log backup or copying data from one location to another.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
The When 
•You can use SQL Server Agent to configure jobs to run according to a schedule. 
•You can also configure SQL Server Agent so that specific eventstrigger the execution of jobs.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
The How 
•The SQL Server Agent service is disabled by default on SQL Server 2012Database Engine instances. You can start SQL Server Agent by right-clicking SQL Server Agent in SQL Server Management Studio and then choosing Start. 
•Startup Type-(auto / manual) can be configured using the configuration manager 
•Restart Behavior (Management Studio)–in case of the SQL Server service fails or if the SQL Server Agent service fails is configured by editing the properties of SQL Server Agent within SQL Server. 
•Each DatabaseEngineinstance has a separate SQL Server Agent.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Account 
Windows Server Side 
•Although you can use the Local Systemor a local virtual accountfor the SQL Server Agent, this limits how the account can interact with resources external to the host server. 
•When choosing to use a domain-based security account, ensure that the account has the following permissions: 
•The logon as a service right. You assign this right by using Group Policy. 
•Membership of the Pre-Windows 2000 Compatible Access security group at the domain level. 
•Win7-Control Panel / System & Security / Local Security Poliy 
•a virtual account using the instance name as the service name is using the following formatNT SERVICE<SERVICENAME>. 
•Services that run as virtual accounts access network resources by using the credentials of the computer account in the format<domain_name><computer_name>$.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Account 
•SQL Server Side 
•The account used for the SQL Server Agent service must be a member of the sysadminfixed server role. 
•If a user is not a member of the sysadminfixed server role, he or she must be a member of one or more of the following fixed database roles in the msdbdatabase to use SQL Server Agent: 
•SQLAgentUserRoleRole members have permissions only on the local jobsand job schedules they own. This role does not allow use of multi-server jobs. 
•SQLAgentReaderRoleThis role includes all the permissions assigned to the 
•SQLAgentUserRole. In addition, members of this role can view the properties and history of all available jobs and job schedules, including multi-server jobs. 
•SQLAgentOperatorRoleThis role includes all the permissions assigned to the SQLAgentReaderRole. In addition, members of this role can execute, stop, or start all local jobs and delete job history for any local job. Members can also enable and disable all local jobs and schedules.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Mail Profile
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Mail Profile
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Mail Profile
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Configuring SQL Server Agent Mail Profile 
•Gmail details : smtp.gmail.com 587 
•Make sure at least one profile is Global & Set to default 
•Make sure to restart SQL Server Agent before sending test Email. 
•Make sure your antivirus is disabled !
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Setting Up the SQL Server Agent Error Log 
•The SQL Server Agent error log stores warnings and error messages from SQL Server Agent. 
•You can configure the SQL Server Agent error log to store informational 
•events by choosing Information in the Agent log–level category in the error log 
•properties 
•Up to nine error logs are maintained.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Setting Up the SQL Server Agent Error Log 
•Use the following command in order to manually recycle the error log: 
•By default, the error log is located at Program FilesMicrosoft SQLServerMSSQL.nMSSQLLOGERRORLOG 
EXECsp_cycle_errorlogGO
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Managing Alerts 
•In case you want the ability to send an email as a response for alert, first you must configure the SQL Server Agent and activate this option under the “Alert System” in its properties. 
•Restart to the agent must follows.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Alert Types 
•Based on Severity / Error number 
•Alerts are only capture-able for errors that goes to the eventlog, which by default only a small amount of the system errors does. You can see what errors goes to eventlogin sys.messages. 
•You can change whether a specific error should be written to the eventlogusing sp_altermessage 
SQL Server Performance condition 
Alerts based on some performance issue (such as Locks / FTS etc.)
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Severity Based Alert
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Error Number Based Alert
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Performance Based Alert
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent 
Managing Jobs 
•Database administrators use jobs to automate routine tasks such as index maintenance or database backup. 
•When you configure a job, you : 
•Build a collection of job steps=> 
•such as TSQL / OS Commands 
•each job step can use a different execution type 
•add a schedule=> 
•choose appropriate alerts and notifications.

Más contenido relacionado

La actualidad más candente

Oracle 12c New Features for Developers
Oracle 12c New Features for DevelopersOracle 12c New Features for Developers
Oracle 12c New Features for DevelopersCompleteITProfessional
 
SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeDean Richards
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowDean Richards
 
Speed up your XPages Application performance
Speed up your XPages Application performanceSpeed up your XPages Application performance
Speed up your XPages Application performanceMaarga Systems
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Bob Ward
 
SQL Server Optimization Checklist
SQL Server Optimization ChecklistSQL Server Optimization Checklist
SQL Server Optimization ChecklistGrant Fritchey
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportAlfredo Krieg
 
JPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsJPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsVlad Mihalcea
 

La actualidad más candente (13)

Using Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource UtilizationUsing Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource Utilization
 
Oracle 12c New Features for Developers
Oracle 12c New Features for DevelopersOracle 12c New Features for Developers
Oracle 12c New Features for Developers
 
SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First Time
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
 
Speed up your XPages Application performance
Speed up your XPages Application performanceSpeed up your XPages Application performance
Speed up your XPages Application performance
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017
 
SQL Server 2012 Best Practices
SQL Server 2012 Best PracticesSQL Server 2012 Best Practices
SQL Server 2012 Best Practices
 
SQL Server Optimization Checklist
SQL Server Optimization ChecklistSQL Server Optimization Checklist
SQL Server Optimization Checklist
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR Report
 
JPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsJPA and Hibernate Performance Tips
JPA and Hibernate Performance Tips
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 

Similar a SQL Server Agent Automation

Lesson 5 security
Lesson 5   securityLesson 5   security
Lesson 5 securityRam Kedem
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuringRam Kedem
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshippingZeba Ansari
 
Installation & configuration
Installation & configurationInstallation & configuration
Installation & configurationSyAM Software
 
Microsoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationMicrosoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationJukka Niiranen
 
Professional sql server dba online training
Professional sql server dba online trainingProfessional sql server dba online training
Professional sql server dba online trainingsssql
 
Weblogic Domain Activity
Weblogic Domain ActivityWeblogic Domain Activity
Weblogic Domain Activitysubash prakash
 
Sql dba 2008 r2 online training
Sql dba 2008 r2 online trainingSql dba 2008 r2 online training
Sql dba 2008 r2 online trainingsssql
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitationsBRIJESH KUMAR
 
Sql server distributed replay
Sql server distributed replaySql server distributed replay
Sql server distributed replaySteve Xu
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
WebSphere 6.1 admin Course 3
WebSphere 6.1 admin Course 3WebSphere 6.1 admin Course 3
WebSphere 6.1 admin Course 3odedns
 
Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroringwebhostingguy
 
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017Amazon Web Services
 
Global Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went AzureGlobal Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went AzureKarim Vaes
 
Deploy SSRS Project - SQL Server 2014
Deploy SSRS Project - SQL Server 2014Deploy SSRS Project - SQL Server 2014
Deploy SSRS Project - SQL Server 2014Ram Kedem
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Antonios Chatzipavlis
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dbaOsama Mustafa
 

Similar a SQL Server Agent Automation (20)

Lesson 5 security
Lesson 5   securityLesson 5   security
Lesson 5 security
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuring
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshipping
 
Installation & configuration
Installation & configurationInstallation & configuration
Installation & configuration
 
SQLServerAgentIntro.pdf
SQLServerAgentIntro.pdfSQLServerAgentIntro.pdf
SQLServerAgentIntro.pdf
 
Microsoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationMicrosoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installation
 
Professional sql server dba online training
Professional sql server dba online trainingProfessional sql server dba online training
Professional sql server dba online training
 
Weblogic Domain Activity
Weblogic Domain ActivityWeblogic Domain Activity
Weblogic Domain Activity
 
Sql dba 2008 r2 online training
Sql dba 2008 r2 online trainingSql dba 2008 r2 online training
Sql dba 2008 r2 online training
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitations
 
Sql server distributed replay
Sql server distributed replaySql server distributed replay
Sql server distributed replay
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
WebSphere 6.1 admin Course 3
WebSphere 6.1 admin Course 3WebSphere 6.1 admin Course 3
WebSphere 6.1 admin Course 3
 
Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroring
 
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017
Embrace DevOps and Learn How to Automate Operations - DEV306 - re:Invent 2017
 
Global Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went AzureGlobal Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went Azure
 
Deploy SSRS Project - SQL Server 2014
Deploy SSRS Project - SQL Server 2014Deploy SSRS Project - SQL Server 2014
Deploy SSRS Project - SQL Server 2014
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
 
Managing servers
Managing serversManaging servers
Managing servers
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
 

Más de Ram Kedem

Impala use case @ edge
Impala use case @ edgeImpala use case @ edge
Impala use case @ edgeRam Kedem
 
Advanced SQL Webinar
Advanced SQL WebinarAdvanced SQL Webinar
Advanced SQL WebinarRam Kedem
 
Managing oracle Database Instance
Managing oracle Database InstanceManaging oracle Database Instance
Managing oracle Database InstanceRam Kedem
 
Power Pivot and Power View
Power Pivot and Power ViewPower Pivot and Power View
Power Pivot and Power ViewRam Kedem
 
Data Mining in SSAS
Data Mining in SSASData Mining in SSAS
Data Mining in SSASRam Kedem
 
Data mining In SSAS
Data mining In SSASData mining In SSAS
Data mining In SSASRam Kedem
 
SQL Injections - Oracle
SQL Injections - OracleSQL Injections - Oracle
SQL Injections - OracleRam Kedem
 
SSAS Attributes
SSAS AttributesSSAS Attributes
SSAS AttributesRam Kedem
 
DDL Practice (Hebrew)
DDL Practice (Hebrew)DDL Practice (Hebrew)
DDL Practice (Hebrew)Ram Kedem
 
DML Practice (Hebrew)
DML Practice (Hebrew)DML Practice (Hebrew)
DML Practice (Hebrew)Ram Kedem
 
Exploring Oracle Database Architecture (Hebrew)
Exploring Oracle Database Architecture (Hebrew)Exploring Oracle Database Architecture (Hebrew)
Exploring Oracle Database Architecture (Hebrew)Ram Kedem
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQLRam Kedem
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to DatabasesRam Kedem
 
Pig - Processing XML data
Pig - Processing XML dataPig - Processing XML data
Pig - Processing XML dataRam Kedem
 
SSAS Cubes & Hierarchies
SSAS Cubes & HierarchiesSSAS Cubes & Hierarchies
SSAS Cubes & HierarchiesRam Kedem
 
SSRS Basic Parameters
SSRS Basic ParametersSSRS Basic Parameters
SSRS Basic ParametersRam Kedem
 
SSRS Conditional Formatting
SSRS Conditional FormattingSSRS Conditional Formatting
SSRS Conditional FormattingRam Kedem
 
SSRS Calculated Fields
SSRS Calculated FieldsSSRS Calculated Fields
SSRS Calculated FieldsRam Kedem
 

Más de Ram Kedem (20)

Impala use case @ edge
Impala use case @ edgeImpala use case @ edge
Impala use case @ edge
 
Advanced SQL Webinar
Advanced SQL WebinarAdvanced SQL Webinar
Advanced SQL Webinar
 
Managing oracle Database Instance
Managing oracle Database InstanceManaging oracle Database Instance
Managing oracle Database Instance
 
Power Pivot and Power View
Power Pivot and Power ViewPower Pivot and Power View
Power Pivot and Power View
 
Data Mining in SSAS
Data Mining in SSASData Mining in SSAS
Data Mining in SSAS
 
Data mining In SSAS
Data mining In SSASData mining In SSAS
Data mining In SSAS
 
SQL Injections - Oracle
SQL Injections - OracleSQL Injections - Oracle
SQL Injections - Oracle
 
SSAS Attributes
SSAS AttributesSSAS Attributes
SSAS Attributes
 
SSRS Matrix
SSRS MatrixSSRS Matrix
SSRS Matrix
 
DDL Practice (Hebrew)
DDL Practice (Hebrew)DDL Practice (Hebrew)
DDL Practice (Hebrew)
 
DML Practice (Hebrew)
DML Practice (Hebrew)DML Practice (Hebrew)
DML Practice (Hebrew)
 
Exploring Oracle Database Architecture (Hebrew)
Exploring Oracle Database Architecture (Hebrew)Exploring Oracle Database Architecture (Hebrew)
Exploring Oracle Database Architecture (Hebrew)
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to Databases
 
Pig - Processing XML data
Pig - Processing XML dataPig - Processing XML data
Pig - Processing XML data
 
SSAS Cubes & Hierarchies
SSAS Cubes & HierarchiesSSAS Cubes & Hierarchies
SSAS Cubes & Hierarchies
 
SSRS Basic Parameters
SSRS Basic ParametersSSRS Basic Parameters
SSRS Basic Parameters
 
SSRS Gauges
SSRS GaugesSSRS Gauges
SSRS Gauges
 
SSRS Conditional Formatting
SSRS Conditional FormattingSSRS Conditional Formatting
SSRS Conditional Formatting
 
SSRS Calculated Fields
SSRS Calculated FieldsSSRS Calculated Fields
SSRS Calculated Fields
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

SQL Server Agent Automation

  • 2. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent The What •SQL Server Agent enables you to automatethe execution of jobs. •SQL Server Agent jobs are collections of tasks known asjob steps. A step might be an activity such as taking a transaction log backup or copying data from one location to another.
  • 3. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent The When •You can use SQL Server Agent to configure jobs to run according to a schedule. •You can also configure SQL Server Agent so that specific eventstrigger the execution of jobs.
  • 4. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent The How •The SQL Server Agent service is disabled by default on SQL Server 2012Database Engine instances. You can start SQL Server Agent by right-clicking SQL Server Agent in SQL Server Management Studio and then choosing Start. •Startup Type-(auto / manual) can be configured using the configuration manager •Restart Behavior (Management Studio)–in case of the SQL Server service fails or if the SQL Server Agent service fails is configured by editing the properties of SQL Server Agent within SQL Server. •Each DatabaseEngineinstance has a separate SQL Server Agent.
  • 5. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Account Windows Server Side •Although you can use the Local Systemor a local virtual accountfor the SQL Server Agent, this limits how the account can interact with resources external to the host server. •When choosing to use a domain-based security account, ensure that the account has the following permissions: •The logon as a service right. You assign this right by using Group Policy. •Membership of the Pre-Windows 2000 Compatible Access security group at the domain level. •Win7-Control Panel / System & Security / Local Security Poliy •a virtual account using the instance name as the service name is using the following formatNT SERVICE<SERVICENAME>. •Services that run as virtual accounts access network resources by using the credentials of the computer account in the format<domain_name><computer_name>$.
  • 6. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Account •SQL Server Side •The account used for the SQL Server Agent service must be a member of the sysadminfixed server role. •If a user is not a member of the sysadminfixed server role, he or she must be a member of one or more of the following fixed database roles in the msdbdatabase to use SQL Server Agent: •SQLAgentUserRoleRole members have permissions only on the local jobsand job schedules they own. This role does not allow use of multi-server jobs. •SQLAgentReaderRoleThis role includes all the permissions assigned to the •SQLAgentUserRole. In addition, members of this role can view the properties and history of all available jobs and job schedules, including multi-server jobs. •SQLAgentOperatorRoleThis role includes all the permissions assigned to the SQLAgentReaderRole. In addition, members of this role can execute, stop, or start all local jobs and delete job history for any local job. Members can also enable and disable all local jobs and schedules.
  • 7. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Mail Profile
  • 8. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Mail Profile
  • 9. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Mail Profile
  • 10. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Configuring SQL Server Agent Mail Profile •Gmail details : smtp.gmail.com 587 •Make sure at least one profile is Global & Set to default •Make sure to restart SQL Server Agent before sending test Email. •Make sure your antivirus is disabled !
  • 11. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Setting Up the SQL Server Agent Error Log •The SQL Server Agent error log stores warnings and error messages from SQL Server Agent. •You can configure the SQL Server Agent error log to store informational •events by choosing Information in the Agent log–level category in the error log •properties •Up to nine error logs are maintained.
  • 12. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Setting Up the SQL Server Agent Error Log •Use the following command in order to manually recycle the error log: •By default, the error log is located at Program FilesMicrosoft SQLServerMSSQL.nMSSQLLOGERRORLOG EXECsp_cycle_errorlogGO
  • 13. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Managing Alerts •In case you want the ability to send an email as a response for alert, first you must configure the SQL Server Agent and activate this option under the “Alert System” in its properties. •Restart to the agent must follows.
  • 14. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Alert Types •Based on Severity / Error number •Alerts are only capture-able for errors that goes to the eventlog, which by default only a small amount of the system errors does. You can see what errors goes to eventlogin sys.messages. •You can change whether a specific error should be written to the eventlogusing sp_altermessage SQL Server Performance condition Alerts based on some performance issue (such as Locks / FTS etc.)
  • 15. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Severity Based Alert
  • 16. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Error Number Based Alert
  • 17. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Performance Based Alert
  • 18. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Managing Jobs •Database administrators use jobs to automate routine tasks such as index maintenance or database backup. •When you configure a job, you : •Build a collection of job steps=> •such as TSQL / OS Commands •each job step can use a different execution type •add a schedule=> •choose appropriate alerts and notifications.