18 Apr

SQL Tip-12 | Using SQL Server Backup to Windows Azure Tool – Part2

In last part we discussed the installation, configuration and usage of the SQL Server Backup to windows azure tool.

In this part we’ll discuss some internals of this tool and how to restore the backups which were moved to Azure storage.

As we discussed in the last part this tool creates a login ID with the name of SQLBackup2Azure , let’s diagnose it further. The tool creates this login with a low privilege account which is used to run this service. This tool also creates a group called “TempGroup” and the login SQLBackup2Azure gets the membership of this group. The name of the group and login are hardcoded and can’t be changed. However the password of the login gets generated automatically and randomly which is not known to anyone including Microsoft.

When you start adding different rules in this tool, this group get read\write access on the specified location – that is how this tool is able to take backup and restore.

The biggest disadvantage of this tool is it doesn’t provide a mechanism to track the uploaded files and any kind of error logging information, you don’t even have any control over the schedule of the uploading of backups since there is a service it keeps on checking the files.

 

Restore a Database from the Backup file which was uploaded using this tool

This tool creates a Stub file with some metadata to use during restore. You can use this tool just like a regular backup file when you want to restore a database. SQL Server automatically reads the metadata information in the file and restore the database by getting the required file from the Azure Account. Internet connectivity is a must since the stub file contains only the metadata information about the backup file rest everything is there in the Azure Storage account.

 

Stub File

This tool uploads the specified backups from the file path mentioned in the rule but once the backup file gets uploaded it creates a Stub file for the same and leaves it in the local storage folder with metadata information to be used during restore.

 

What if Stub file is inaccessible or Deleted by mistake?

A copy of the same Stub file gets uploaded along with the backup on your Azure Storage Account. If for any reason the stub file is inaccessible you can download the copy of the stub file and place it in the same location which is configured for this tool.

 

Some known issues:

1. In the event of a loss of network connectivity, SQL Server will surface the error as not being able to write to the device. You will need to clean up the files relating to this backup operation (if any) and retry the backup.

2. If you want to create a backup using the Tool, you must create a new backup file instead of overwriting/appending to an existing backup file.

 

Thanks,
Sarabpreet Singh


8 Apr

SQL Tip-11 | Using SQL Server Backup to Windows Azure Tool

As you know there are so many cool benefits of using Windows Azure Storage Account, everybody want to use it to get advantage. Last month i blogged about “SQL DB Backup to URL\Cloud” feature which was first introduced in SQL Server 2012 and later in SQL 2014 it was integrated completely in every aspect.

But what if you are still running old version of SQL Server and want to take advantage of Cloud?

Microsoft is being very kind and they are providing you a workaround. They released a small tool which can help you create a one cloud backup strategy that means you will be able to take backups on cloud for prior SQL versions like SQL Server 2005, 2008 and SQL 2008 R2.

By using this tool you get all the latest features like Backup on Cloud, using Encryption and Compression in all earlier versions.  Currently these features are available only in following versions\editions.

Feature Version Edition
Backup Encryption 2014 Enterprise, Standard and Business Intelligence Edition
Backup Compression 2008 Enterprise Edition
Backup Compression 2008 R2 Enterprise and Standard Edition


Isn’t it cool you get all latest features even if you’ve not upgraded to new version\edition.

The Utility can be downloaded from this link and the utility is less than 10 MB is size. Let’s see how to install, configure and use this tool.

Installation of this tool is quite simple just like any other regular software.

1  2

3   4

The tool installs a service which takes the responsibility of taking the backups from local system to Cloud. The tool also creates a separate login for this tool with the name of “SQLBackup2Azure.

service

 

To configure this tool you’ve to provide a local path of a folder where your backups will be placed – this location will act as a source for this tool. You need to also mention the file name\extension which will be picked to be backed-up on the cloud. The best part is you can use wildcards to select the type of files.

config1 config2

 

Next you need to mention the details about your Windows Azure Storage Account, this is similar to creating a credential which will provide necessary access to this tool to backup the files on Azure. You get an option to Verify the account details right from the wizard.

config3

In the next page you also get an option to use Encryption and Compression for all these backups.

config4 config5

Read the next part here…

Thanks,
Sarabpreet Singh


23 Jul

SQL Tip-3 | Don’t Shrink your Database

You should avoid shrinking your database until and unless it becomes unmanageable. Shrinking is a Resource intensive task, Moreover it introduces high degree of fragmentation which affects performance.

Let’s say you shrink a Database, Now if the data is growing in your database the data\log file will reserve more space by auto-growth (if configured) to meet the new requirements. So it does the same work again, Moreover your data is now fragmented which needs to be fixed by doing maintenance activity.

So, The best way to keep free space manageable in your data\log files is to configure Auto-Growth setting with fixed numbers (size) rather than using Percentage (%) value, this will make the auto-growth predictable and ensure that the growth will not go beyond a certain limit.

Happy Learning 🙂

Thanks,
Sarabpreet Singh Anand
Subscribe now to get latest Tips in your Inbox


4 Sep

SQL Server Day | Gurgaon | 8-Sept-2012 + Hiring Drive for Microsoft India

SQLServerGeeks.com cordially invites you to SQL Server Day, the quarterly dose of SQL Server knowledge & learning. And after multiple successful events in Bangalore, Kolkata, Mumbai & Delhi NCR, we are coming to Gurgaon, once again! This time SQL Server Day event has been customized for SQL Server Developers. We bring you 3 rock star speakers and 3 intriguing sessions related to SQL Server Development.

And Don’t forget to bring your CV and meet the Microsoft India Recruitment Team Smile

Details

Session & Speaker details

Venue & Contact details

Date & Time

Welcome Note (15 mins) by Amit Bansal(MVP-SQL Server)

Tips & Tricks of Transact SQL
by Sarabpreet Singh Anand, (Vice President, SQLServerGeeks.com)

Session by Microsoft IDC Recruitment Team

Optimizing Transactional and Procedural code by Amit Bansal (Director, Peopleware India, MVP-SQL Server)

SQL Server Myth-buster for Developers by Ahmad Osama

Closing Note (15 mins)

Microsoft Corporation (I) Pvt. Ltd.
DLF Phase 3, Cyber Greens,9th Floor, Tower A, DLF Cyber City, Sector 25A (Near Shankar Chowk)

Note: Refreshments will be served

 

September 8, 2012 (Saturday)
1.30 pm to 5.30 pm

Note: The event will start sharp at 2.00 pm. Please come by 1.30 pm for registration. (Due to security policies, registration takes time. Please come with a valid photo ID)


clip_image001[4]

You can register @ http://sqlserverdaygurgaon8sep2012.eventbrite.com/

8-sep-2012-t-sql-tips-sessions-gurgaon

See you at the event.