In this series of articles, we will learn how we can clone the SQL Server instance using SSDT 2017. In my previous article, we learned how to Install and configure SSDT 2017 on Windows 10. In this series of articles, we will migrate the following SQL Server components to another server using SSIS tools provided in SSDT 2017:
Read more »Jobs
Automate consistency checks of SQL database using Windows Task Scheduler
April 20, 2021The SQL database integrity check is one of the most crucial and important tasks of the database administrator. The database integrity task checks the structural integrity and allocation of all database objects and indexes. The integrity checks can be performed by using the DBCC CheckDB command. The CheckDB command is used to identify the corruption in the database. The command performs the following operations on the database.
Read more »Automate SQL database backups using Windows Task Scheduler
April 15, 2021In this article, we will learn how we can automate the backup of SQL database created in SQL Server Express edition. SQL Server Express edition is a lightweight database that has limited functionalities and resource allocation. The SQL Server Express edition does not support SQL Server Agent jobs, so it is tricky to automate various database administration tasks.
Read more »Automate rebuilding SQL Database indexes using Maintenance Plans
April 9, 2021Index maintenance is a vital part of a database administrator’s job. I have worked for few clients who often face performance issues in SQL Database and don’t have a dedicated DBA. I remember that one of our clients was facing performance issues. I logged in to their server and found that they did not set up any index maintenance jobs; therefore, many indexes were fragmented, causing the problem.
Read more »Elastic Jobs in Azure SQL Database
February 18, 2021Introduction
I have dedicated this article to the topic of Elastic Jobs in Azure SQL Database which is in Public Review. This feature allows you to run scheduled tasks in your Azure SQL Databases. This is similar to SQL Server Agent you have in the On-prem SQL Server versions. However, in Elastic Jobs, you can execute the scheduled tasks in multiple Azure SQL Servers and multiple Databases which is an added advantage when considering the features of SQL Server Agent. Further, this execution performs parallelly.
Read more »Automate SQL database backups using Maintenance Plans
February 12, 2021In this article, we are going to learn how we can automate the backup of the SQL database using database maintenance plans. Data is one of the most important assets of any organization, and as a database administrator, it is our prime responsibility to protect it. There are various tools available that can be used to back up the data. These tools use state of the art technology to protect the data, and some of them are very costly. Instead of using these costly tools, some organizations prefer to use SQL native backups. These backups of SQL database can be automated by SQL Server Agent Jobs or Windows’ task scheduler.
Read more »Advanced Usages of SQL Server Agent
January 8, 2021In this article, I am going to introduce some advanced usages of the SQL Server Agent service in Microsoft SQL Server. In my previous article, Introduction to SQL Server Agent, I have discussed in detail how to use the service and the various components related to the service. To recap briefly, the SQL Server Agent is a job scheduler service within SQL Server and allows us to schedule T-SQL scripts, SSIS jobs, automate database backups and other tasks etc. In the last article, I have shown how to schedule a simple T-SQL script using the SQL Server Agent. This article will focus more on advanced concepts like scheduling a package in SSIS and processing an OLAP cube.
Read more »T-SQL scripts to update statistics based on the row modification
December 24, 2020In this article, we are going to learn how we can develop a T-SQL script to update statistics of tables based on the row modification. It is always a challenging task to perform maintenance on a table that has billions of rows. During the early years of my professional career, I was assigned a project and one of our clients had performance issues. The initial analysis showed that due to frequent data modifications, a specific table’s statistics become outdated.
Read more »Building U-SQL jobs locally for Azure Data Lake Analytics
December 23, 2020This article will help you learn to develop U-SQL jobs locally, which once ready, can be deployed on Azure Data Lake Analytics service on the Azure cloud.
Read more »Deploying U-SQL jobs on Azure Data Lake Analytics
December 23, 2020In this article, we will learn how to execute U-SQL jobs that have been developed or tested locally, to the production environment from a local machine.
Read more »Developing U-SQL jobs on Azure Data Lake Analytics
December 21, 2020In this article, we will learn how to develop U-SQL jobs on Azure Data Lake Analytics to process data stored in Data Lake Storage.
Read more »Introduction to the SQL Server Agent
December 15, 2020In this article, I am going to explain in detail about the SQL Server Agent service. This is a windows service that enables database developers and database administrators to schedule jobs on the SQL Server machine. The jobs can be simple T-SQL scripts, stored procedures, SSIS packages or SSAS databases. This service is available on all the editions of SQL Server except the Express edition.
Read more »Identify unused SQL databases
December 8, 2020In this article, I am going to show how we can identify unused SQL databases. In our organization, after release deployment, we receive the database refresh requests. To refresh the database, we were instructed to perform the following tasks:
Read more »T-SQL scripts to identify unused database files
October 30, 2020In this article, I am going to show how we can automate the report of unused database files using T-SQL.
Read more »T-SQL scripts to generate database health reports
October 21, 2020In this article, I am going to show how we can automate a database daily health report using T-SQL scripts. For a senior database administrator, it is always important to review the health of the database server. When a DBA manages many database servers, it becomes difficult to visit every server and review the status of databases, SQL jobs, and backups. To ease the monitoring, I have developed a T-SQL script that populates the following information:
Read more »Identify unused tables of SQL databases
September 24, 2020In this article, I am going to demonstrate how we can identify the unused tables of a given SQL Database. As a database administrator, we must maintain the tables and objects of the SQL Database. In my organization, when we add a new column or change the data type of a column, we export the data of the existing table in the backup table. Often, we forgot to review and maintain those backup tables. So as a solution, we decided to create a SQL Job that populates the list of unused tables and email the list to the DBA Team for review.
Read more »Monitor the growth of SQL databases using the Default Trace
July 23, 2020Monitoring the growth of the SQL Database is one of the essential tasks of the SQL Server DBA. In this article, I am going to explain how we can monitor the growth of the SQL database using the default trace. First, let me explain the default trace in SQL Server.
Read more »Automating Azure SQL Database index maintenance using Elastic Job Agents
July 14, 2020In this article, I am going to explain how we can automate the index and statistics maintenance of Azure SQL Database using an Elastic Job Agent.
Read more »Refresh a SQL Database using the maintenance plan
July 2, 2020In this article, I am going to explain how we can refresh a SQL Database using the Maintenance plan. To demonstrate the process, I have configured two virtual machines. I have installed SQL Server 2016 on both. To refresh the SQL database on destination database server, we will generate a copy-only backup of the SQL database on source database server. I have created a network share directory. Both the source and destination server have the read-write permission on it. The backup file will be copied on a shared directory. Once the database is restored to the destination, we will delete the file from the network share directory.
Read more »Scheduling SQL Notebooks in Azure Data Studio
April 10, 2020SQL Notebooks are an interactive way of creating documents, executing T-SQL queries along with Python and PowerShell codes. It is available in Azure Data Studio, a cross-platform client tool that works on both Windows and Linux operating systems.
Read more »How to fix the “Agent XPs disabled” error
December 27, 2019This article explains how we can fix SQL Server error “Agent XPs Disabled”. Before we dive into troubleshooting and methods for fixing the error, let me explain about Microsoft SQL Server Agent and the Agent XPs configuration parameter.
Read more »Audit and Alert SQL Server Jobs Status Changes (Enabled or Disabled)
December 4, 2019In this article, we will talk about how to track enabled or disabled SQL jobs in SQL Server using T-SQL. Users with the Sysadmin role have the default permissions to modify the information of any jobs in SQL Server. If a user is not in this role and wants access to this activity, then the user needs to be given the SQLAgentOperatorRole in the msdb database.
Read more »Azure SQL – Index tables using Azure Automation
June 25, 2019This article provides an overview of indexing tables in Azure SQL database using Azure Automation and how to schedule indexing jobs to run at specific intervals.
Read more »Azure SQL – Elastic Job Agent
June 24, 2019In this article, we will review on elastic job Agent in Azure SQL and how to configure elastic jobs to run scripts on Azure SQL databases. SQL Server Agent is a powerful component that is used to schedule and execute jobs in SQL server. But in Azure, SQL server agent is available only in managed instances and not in the single databases. To schedule and execute jobs on single databases we have a feature called elastic job agent. This feature is used for scheduling and execute jobs on a single database, all the databases in the server, or on all the databases in an elastic pool.
Read more »Detecting and Alerting on SQL Server Agent Missed Jobs
February 21, 2019Summary
While alerting on failed SQL Server Agent jobs is straightforward, being notified when a job is missed is not a simple or built-in feature.
Read more »