How do you manage your database deployments? You'll be surprised but this is one subject that seems to be a problem in many places I've worked. It all depends, of course, on how you run your deployments in general. So, what are the usual options? Manual - you copy all the files to your target server(s) manually and you deploy your database scripts by running them separately on each database server. Scripted - you use scripts, like PowerShell, to semi-automate your deployments by taking the steps from the manual process described above and running them in an automated way. …[read more]
Showing all posts tagged: 'SQL'
A 6-post collection
One of the cool things of SQL Server 2012, is the ability to backup any database to Azure. This frees DBA’s from having to maintain tapes for offsite backups. Think of it as your Disaster Recovery on the cheap (and easy) The setup is incredibly simple and I would urge you to take advantage of this feature as soon as possible. If you don’t have an Azure account, you can get one here In order to be able to backup to Azure, you need to configure a credential to store the Windows Azure Storage authentication details. You can …[read more]
Over the last couple of days I’ve been trying to customize Ola Hallegren’s script in order to perform backups on an Always On Availability Group running on Azure (blog to follow soon). I managed to get everything working apart from the Log Backups and the culprit was fairly easy to find. In Ola’s DatabaseBackup stored proc, there is a section of code that checks whether the specified backup type (full, diff, log) can run on the current server as per below: IF @Version >= 11 AND @Cluster IS NOT NULL BEGIN SELECT @CurrentAvailabilityGroup = availability_groups.name, …[read more]
One of the coolest features in Azure is the fact that you can create Always On Availability Groups and configure a Listeners in order to provide high availability and redundancy to your back-end SQL Server solution. If you want to know more about AlwaysOn and what it can do for you, you can go here. Up until recently, Always On was a bit “hacky” on Azure as we had to use workarounds, especially for the Listener part, which is one of the most important feature as far as applications are concerned. However, the latest patches and updates to Windows Server …[read more]
Emails are an integral part for any SQL Administrator who wishes to stay on top of thins. Emails can be used to send alerts on job failures, run and report on diagnostics or return a query result set that your users may be interested in. Today we will look on how to configure SQL Server to send emails from an Azure VM. However, there is little to no difference between this configuration and an on premise SQL Server. However, Azure doesn't offer smtp servers by default so you have to use a third party provider. For this example, we will …[read more]
If you ever have the need to create a number of logins and users for a specific database(s) programmatically, then the following scripts may be of use to you. The first script leverages the strength of Powershell and can be extended for example to pull a number of usernames and passwords from a file and then use these to create the necessary logins. For our purposes today, I’ve decided to use a hardcoded username and password but it is nice to know that Powershell can do much more. The script is attached below: #import SQL Server module Import-Module …[read more]