StretchDB Got Easier With SQL Server 2016

By | In SQL Server | May 25th, 2016

stretchDB_desktopThe world is moving towards the cloud and when I talk with decision makers around the world, there is one thing that comes up on top of the mind – how can I embrace the cloud adoption within my company. Yes, there are a select few who still love being on the on-premise infrastructure because of the investments they have already made. But that number is reducing faster than you can ever think off. I am amazed that the day for learning something completely new seems to be coming really faster than I really thought. I like it when customers push the boundaries of technology to achieve a larger objective.

Coming back to our topic of discussion for us. The next version of SQL Server is loaded with features and capabilities where the cloud technologies are playing a very important and vital role. This cannot be negated with the fact being this is evolving and changing to customer needs.

With SQL Server 2016, we have the luxury of integrating seamlessly with the Cloud offering of SQL Azure databases from our onpremise with the help of Stretch Database (or simply StretchDB). Here parts of your older data is moved seamlessly to the cloud (Azure SQLDB) based on how we configure things. This got simpler with the fact that we can enable this using the wizard with SQL Server Management Studio.

We have a number of ways to do this, let us use the simplest wizard format for this task. We can select the database -> right click -> Tasks -> Stretch -> Enable.

stretch-01

This starts the wizard and will take us through a number of steps wherein we need to feed some vital information from Azure account and the passwords for the setup to complete.

stretch-02

Creating a database master key is one of the important steps and make sure you remember the passwords being used. It is easy to get confused with the credentials being used for Azure and your on-premise default SQL Server instance. So keep track of this.

stretch-03

Once your firewall and IP addresses have been given access, the database is configured for stretch. At the instance level we can go ahead and use the TSQL command of doing the same with:

EXECsys.sp_configureN’remote data archive’,’1′;

RECONFIGURE;

GO

As you can see, the same above steps are available on TSQL with Configure server/instance setting, Database master key, IP settings, enabling stretch at the DB level etc. Once done, we can go ahead and stretch our table to cloud seamlessly using a command as shown below:

stretch-04

ALTERTABLE [tblStretch]

ENABLE REMOTE_DATA_ARCHIVE WITH ( MIGRATION_STATE =ON);

GO

If during the wizard you selected the table too, then the wizard will add another line item as shown below:

There is no point in adding a stretch if you are not able to track what data is moving and what is the current status of the data movement from various databases. This can be identified using the DMV as shown below:

–Check the migration status

SELECT*FROMSYS.dm_db_rda_migration_status

StretchDB is a powerful feature and can enable new workloads to be configured with Azure SQLDBs seamlessly. Using the power of cloud and building such hybrid architectures with the comfort of working inside SQL Server Management Studio is the key to success as far as SQL Server 2016 is concerned. I am glad to see such innovations happening inside SQL Server 2016 and this is pushing the comfort zone of traditional DBA’s who need to learn these things every single day. Do let me know if you explored working with StretchDB in your organization. Are you interested in utilizing this hybrid approach for storing historical / archive data? What are your thoughts on this capability?

Contact Us
Eric Russo
Senior Vice President of Database Services
Eric Russo is SVP of Database Services overseeing all of Datavail’s database practices including project and managed services for MS SQL, Oracle, Oracle EBS, MySQL, MongoDB, SharePoint and DB2. He is also the Product Owner for Datavail Delta, a database monitoring tool. He has 21 years’ experience in technology including 16 years in database management. His management success and style has attracted top DBAs from around the world to create one of the most talented and largest SQL Server teams. He has been with Datavail since 2008: previous to that his work experiences include DBA Manager at StrataVia, Senior Web Developer at Manifest Information Systems and SQL Server DBA at Clark County, Nevada.

Leave a Reply

Your email address will not be published.
Required fields are marked (*).