[0:00]Hello, this is the final video in the series using SQL Server 2008 R2 backup to Microsoft Azure blob storage. In this video, I'm going to demonstrate how to automate the whole backup process. We previously created a database and then we created a backup of that database to an Azure blob storage. And then we restored that database from an Azure blob storage. In this video, I'm going to show you how you can automate this process without having to use the graphical user interface. And the tool that we're going to use to automate the process is called SQL Server Agent. And if you're not familiar with SQL Server Agent, it's basically a job scheduling tool within SQL Server. You create a job with a series of steps and a schedule, and then the job is automatically executed. So let's see how that looks like in SQL Server Management Studio. Here, I'm already connected to SQL Server Management Studio, and you can see in the object explorer here, I have the SQL Server agent right here. So I'm just going to click on that and then I'm going to expand the jobs folder here. So right now, I don't have any jobs and I'm going to right click and create a new job. So I'm just going to click on New Job and that's going to launch the New Job dialog box. So, the first thing is the job name. So I'm just going to call this backup to Azure. And then in the owner, I'm just going to leave it to the default. The category will be database backups. And then in the description, I'm just going to call it automatic database backup to Microsoft Azure blob storage. So that's the general section. Now, I'm going to jump to the steps section here. So I'm just going to click on steps. And in the steps section, this is where you create a new step. So I'm going to click on new here, and that's going to launch the new step dialog box. So the first thing is a step name. So I'm just going to call this step full backup. And then the type is T SQL, Transact SQL, that's correct. The database is the master database, and I'm just going to change that to the Adventure Works 2012 database. And the command is where I'm going to write the T-SQL script that's going to do the backup. So I'm just going to paste it in there. And this is the same T-SQL script that we previously used to backup the database. So it's backup database, then the database name, then to URL, and then the name of the blob storage. So here, I'm just going to change the blob name, so I'm just going to remove this and I'm going to call it Adventureworks2012.bak. So this is a full backup and then with credential. And then the credential is the name of the SQL Server credential that you previously created. And if you remember, the credential that we created, I called it my Azure credential. So make sure that you write the correct name of the SQL Server credential that you created. And then here you can also jump to the advanced tab and here you can tell the job what to do if it succeeds and what to do if it fails. So here, I'm just going to tell it to quit the job reporting success if it succeeds. And if it fails, quit the job reporting failure. And then here, you can also write the output of the T-SQL script to a file. And you can also append to that output file if you want. Here, I'm not going to write it to a file, so I'm just going to click OK. So this is the step here. If you want, you can create multiple steps so you can create a step for a differential backup and a step for a transaction log backup. But for this demonstration, I'm just going to create a step for a full backup. So I'm just going to click OK here. So now I've created the step. The final thing I need to do is to create a schedule for this job. So I'm just going to jump to schedules here and then I'm just going to create a new schedule. So I'm just going to click on new. And that's going to launch the new job schedule dialog box. So here, I'm just going to give it a name. I'm just going to call it daily full backup. And then the schedule type will be recurring. And here, I'm just going to leave it to daily, so it will run once every day. And the recurrence happens every one day. And the daily frequency happens once a day at 12:00 AM. So if you want, you can change the time here. And the duration will have no end date. So it will be running forever. So I'm just going to click OK here. And then I'm going to click OK here. So now the job has been created. If I expand jobs here, you can see I have the backup to Azure job created. So now, I'm going to show you how you can execute this job manually instead of waiting for the job to run automatically. So I'm just going to right click on the job and I'm going to start job at step. And it's going to run the full backup step. So I'm just going to click on Start. And as you can see, the job execution has succeeded. So I'm just going to close it. So what I'm going to do right now is that I'm going to go to my Azure blob storage account and I'm going to verify that the backup has been successfully created. So here I'm in my Azure management portal, and I'm in my storage account, SQL backup to Azure, and I'm in the containers. And I have the backups container. So I'm just going to click on the backups container and I'm going to see the newly created backup. So here it is, Adventureworks2012.bak. And if I expand it here, you can see that it's created at 10:14 PM. So that's the time right now. So it's been created successfully. So in this video, I've demonstrated how you can automate the whole backup process to Microsoft Azure blob storage. And this is the last video in the series using SQL Server 2008 R2 to backup to Microsoft Azure blob storage. I hope you've enjoyed this series and thank you for watching.
Transcript source
YouTube auto captions
This transcript was extracted from YouTube's auto-generated caption track. The transcript below is server-rendered so it can be read, searched, cited, and shared without opening the original YouTube player.
Pull quotes
[0:00]Hello, this is the final video in the series using SQL Server 2008 R2 backup to Microsoft Azure blob storage.
[0:00]In this video, I'm going to demonstrate how to automate the whole backup process.
[0:00]We previously created a database and then we created a backup of that database to an Azure blob storage.
[0:00]In this video, I'm going to show you how you can automate this process without having to use the graphical user interface.
Use this transcript
Related transcript hubs
Watch on YouTube
Share
MORE TRANSCRIPTS



