<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Joon Kyu Lee’s Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/joonkyulee/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/joonkyulee/feed.xml</link>
    <description>Microsoft Database Platform &amp;amp; BigData Analytics</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:42:56 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to create user-defined restore points on Azure SQL Data Warehouse</title>
      <link>https://docs.microsoft.com/archive/blogs/joonkyulee/how-to-create-user-defined-restore-points-on-azure-sql-data-warehouse</link>
      <pubDate>Tue, 26 Jun 2018 00:37:49 GMT</pubDate>
      <dc:creator><![CDATA[Joon Kyu Lee]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joonkyulee/?p=295</guid>
      <description><![CDATA[Microsoft announced user-defined restore point on Azure SQL Data Warehouse.

This feature enables...]]></description>
      <content:encoded><![CDATA[Microsoft announced user-defined restore point on Azure SQL Data Warehouse.

This feature enables you to manually trigger snapshots to create restore points of your data warehouse before and after large modifications. This capability ensures that restore points are logically consistent which provides additional data protection in case of any workload interruptions or user errors for quick recovery time. User-defined restore points are available for seven days and are automatically deleted on your behalf. Only 42 user-defined restore points are supported at any point in time so they must be <a href="https://go.microsoft.com/fwlink/?linkid=875299">deleted</a> before creating another restore point. You can trigger snapshots to create user-defined restore points through <a href="https://docs.microsoft.com/powershell/module/azurerm.sql/new-azurermsqldatabaserestorepoint?view=azurermps-6.2.0#examples">PowerShell</a>.

Backup and restore in Azure SQL Data Warehouse.

<a href="https://docs.microsoft.com/en-us/azure/sql-data-warehouse/backup-and-restore">https://docs.microsoft.com/en-us/azure/sql-data-warehouse/backup-and-restore</a>

You can follow up below simple steps to utilize user-defined restore point.

<strong><u>Create user-defined restore point</u></strong>

1) Run powershell to create user-defined restore point.

$SubscriptionName="&lt;subscription id&gt;"

$ResourceGroupName="adwdbrg"

$ServerName="adwsv"

$DatabaseName="adwdb"

$RestorePointLabel="adwdb_restorepoint"

Connect-AzureRmAccount

Get-AzureRmSubscription

Select-AzureRmSubscription -SubscriptionName $SubscriptionName

#Create Restore point

New-AzureRmSqlDatabaseRestorePoint -ResourceGroupName $ResourceGroupName -ServerName $ServerName -DatabaseName $DatabaseName -RestorePointLabel $RestorePointLabel

2) Sign in with admin account.

3) You can see this output in powershell window when restore point is created.

ResourceGroupName        : adwdbrg

ServerName               : adwsv

DatabaseName             : adwdb

Location                 : Central US

RestorePointType         : DISCRETE

RestorePointCreationDate : 6/26/2018 4:45:44 AM

EarliestRestoreDate      :

RestorePointLabel        : adwdb_restorepoint

<strong><u>Restore database</u></strong>

1) Open SQL Server Management Studio and connect to user database ‘adwdb’. Run below query to check user-defined restore point.

select *

from sys.pdw_loader_backup_runs

where name = 'adwdb_restorepoint'

you can see that submit_time is ‘<strong>2018-06-26 04:45:44</strong>.023’

<img width="828" height="63" class="alignnone size-full wp-image-315" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/UserDefinedRestore-2.png" />

2) Click ‘Restore’ button on the ‘adwdb’ SQL data warehouse in Azure Portal.

<img width="512" height="271" class="alignnone size-full wp-image-325" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/UserDefinedRestore-3.png" />

3) Change database name and choose ‘<strong>2018-06-26 04:45:44’</strong> as Restore point (UTC). Click ‘OK’ to start restoring database.

<img width="312" height="547" class="alignnone size-full wp-image-335" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/UserDefinedRestore-4.png" />

4) New database (‘adwdb_restorepoint’) is created on same SQL Server.

<img width="530" height="280" class="alignnone size-full wp-image-345" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/UserDefinedRestore-5.png" />

<strong><u>Remove user-defined restore point</u></strong>

1) Run powershell to remove user-defined restore point.

$SubscriptionName="&lt;subscription id&gt;"

$ResourceGroupName="adwdbrg"

$ServerName="adwsv"

$DatabaseName="adwdb"

$RestorePointCreationDate = Get-Date "<strong>6/26/2018 4:45:44 AM</strong>"

Connect-AzureRmAccount

Get-AzureRmSubscription

Select-AzureRmSubscription -SubscriptionName $SubscriptionName

#Remove Restore point

Remove-AzureRmSqlDatabaseRestorePoint -ResourceGroupName $ResourceGroupName -ServerName $ServerName -DatabaseName $DatabaseName -RestorePointCreationDate $RestorePointCreationDate

2) Sign in with admin account.

3) You can see this output in PowerShell window when restore point is deleted.

ResourceGroupName        : adwdbrg

ServerName               : adwsv

DatabaseName             : adwdb

Location                 :

RestorePointType         :

RestorePointCreationDate : 6/26/2018 4:45:44 AM

EarliestRestoreDate      :

RestorePointLabel        :]]></content:encoded>
    </item>
    <item>
      <title>Mapping a login to a user in Azure SQL Data Warehouse</title>
      <link>https://docs.microsoft.com/archive/blogs/joonkyulee/mapping-a-login-to-a-user-in-azure-sql-data-warehouse</link>
      <pubDate>Sun, 08 Oct 2017 08:17:55 GMT</pubDate>
      <dc:creator><![CDATA[Joon Kyu Lee]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joonkyulee/?p=246</guid>
      <description><![CDATA[Recently I got an inquiry from one customer who needed to move Azure SQL Data Warehouse(ADW)...]]></description>
      <content:encoded><![CDATA[Recently I got an inquiry from one customer who needed to move Azure SQL Data Warehouse(ADW) database into another existing Azure SQL Server. We can move Azure SQL Server including ADW database with "Move" function in Azure Portal.  Customer had to move only ADW database. After moving ADW database through creating new database from backup successfully, customer received the following message when connecting to new ADW database in new SQL Server with a login ("ETLLogin").

<img width="608" height="171" class="alignnone size-full wp-image-256" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/LoginError.png" />

This message is a result of incorrect mapping a login ("ETLLogin") in master database to a user ("ETLUser")  in user database on new SQL Server. This error can be simply resolved by <strong>ALTER USER</strong> command to update SID of a user ("ETLUser") in user database.

<em>From old SQL Server,</em>

1) Connect to master database and check SID of a login ("ETLLogin") in master database.

select name, sid, type_desc from sys.sql_logins where name = 'ETLLogin'

ETLLogin <em>0x010600000000006400000000000000005BE84C3C0FD46B4399F03F785DE81F32 </em>SQL_Login

2) Connect to user database and check a user that has same SID value at first step. In this example, the user ("ETLUser")  has same SID value with the login ("ETLLogin").

SELECT name, sid, type_desc, authentication_type_desc FROM sys.database_principals where sid = 0x010600000000006400000000000000005BE84C3C0FD46B4399F03F785DE81F32

ETLUser <em>0x010600000000006400000000000000005BE84C3C0FD46B4399F03F785DE81F32 </em>SQL_USER INSTANCE

<em>From new SQL Server,</em>

3) Connect to master database and check SID of the login ("ETLLogin") in master database, If it doesn't exist, create new login and note SID value.

select name, sid, type_desc from sys.sql_logins where name = 'ETLLogin'

ETLLogin <em>0x01060000000000640000000000000000A8E9A04A1C58C14EAF2FDA894DEF7C66 </em>SQL_Login

4) Connect to user database and check SID of the user ("ETLUser") in user database. The SID of user ("ETLUser") is not equal to that of the login ("ETLLogin").

SELECT name, sid, type_desc, authentication_type_desc FROM sys.database_principals where name = 'ETLUser'

ETLUser <em>0x010600000000006400000000000000005BE84C3C0FD46B4399F03F785DE81F32 </em>SQL_USER INSTANCE

5) Connect to user database and run <strong>ALTER USER</strong> command to match up SID value between the login ("ETLLogin") and the user ("ETLUser").

ALTER USER ETLUser WITH LOGIN = ETLLogin

6) Connect to user database and check SID of the user ("ETLUser") in user database. It is updated and matched up with SID of the login ("ETLLogin").

SELECT name, sid, type_desc, authentication_type_desc FROM sys.database_principals where name = 'ETLUser'

ETLUser <em>0x01060000000000640000000000000000A8E9A04A1C58C14EAF2FDA894DEF7C66 </em>SQL_USER INSTANCE

7) Now the login ("ETLLogin") can connect to ADW database successfully.]]></content:encoded>
    </item>
    <item>
      <title>Introduction - Joon Kyu Lee</title>
      <link>https://docs.microsoft.com/archive/blogs/joonkyulee/introduction</link>
      <pubDate>Sat, 07 Oct 2017 00:00:02 GMT</pubDate>
      <dc:creator><![CDATA[Varsha G]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joonkyulee/?p=1</guid>
      <description><![CDATA[Hello. I'm Joon Kyu Lee who is working as Microsoft Support Engineer for APS(Analytics Platform...]]></description>
      <content:encoded><![CDATA[Hello. I'm Joon Kyu Lee who is working as Microsoft Support Engineer for APS(Analytics Platform System) and ADW(Azure SQL Data Warehouse).

I would like to share my daily work and experience about SQL Server Data Platform and Big Data Analytics.]]></content:encoded>
    </item>
  </channel>
</rss>