SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à MSSQL Server - 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
 

Similaire à MSSQL Server - 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
 

Plus 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
 

Plus 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
 

Dernier

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Dernier (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

MSSQL Server - 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.