Skip to content

Commit 1ceff6d

Browse files
committed
Adressing comments
1 parent 6f69ba9 commit 1ceff6d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/Sql/Sql.Test/ScenarioTests/ManagedDatabaseCrudScenarioTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function Test-RestoreManagedDatabase
219219
$targetManagedDatabaseName = Get-ManagedDatabaseName
220220
$pointInTime = (Get-date).AddMinutes(5)
221221

222-
# Wait for 450 seconds for restore to be ready
222+
# Once database is created, backup service will automaticly take log backups every 5 minutes. We are waiting 450s to ensure backups are taken to which we can restore.
223223
Wait-Seconds 450
224224

225225
# restore managed database to the same instance
@@ -279,7 +279,7 @@ function Test-RestoreDeletedManagedDatabase
279279
$targetManagedDatabaseName4 = Get-ManagedDatabaseName
280280
$targetManagedDatabaseName5 = Get-ManagedDatabaseName
281281

282-
# Wait for 450 seconds for restore to be ready
282+
# Once database is created, backup service will automatically take log backups every 5 minutes. We are waiting 450s to ensure backups are taken to which we can restore.
283283
Wait-Seconds 450
284284

285285
# Test remove using all parameters

src/Sql/Sql/help/Restore-AzSqlInstanceDatabase.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,24 @@ PS C:\> $GeoBackup | Restore-AzSqlInstanceDatabase -FromGeoBackup -TargetInstanc
122122
The first command gets the geo-redundant backup for the database named Database01, and then stores it in the $GeoBackup variable.
123123
The second command restores the backup in $GeoBackup to the instance database named Database01_restored.
124124

125+
### Example 4: Restore an deleted instance database from a point in time
126+
```
127+
PS C:\> $deletedDatabase = Get-AzSqlDeletedInstanceDatabaseBackup -ResourceGroupName "ResourceGroup01" -InstanceName "managedInstance1" -DatabaseName "DB1"
128+
PS C:\> Restore-AzSqlinstanceDatabase -Name $deletedDatabase.Name -InstanceName $deletedDatabase.ManagedInstanceName -ResourceGroupName $deletedDatabase.ResourceGroupName -DeletionDate $deletedDatabase.DeletionDate -PointInTime UTCDateTime -TargetInstanceDatabaseName "Database01_restored"
129+
```
130+
131+
The first command gets the deleted instance databases named 'DB1' on Instance 'managedInstance1'
132+
The second command restores the the fetched database, from the specified point-in-time backup to the instance database named Database01_restored.
133+
134+
### Example 4: Restore an deleted instance database from a point in time
135+
```
136+
PS C:\> $deletedDatabase = Get-AzSqlDeletedInstanceDatabaseBackup -ResourceGroupName "ResourceGroup01" -InstanceName "managedInstance1" -DatabaseName "DB1"
137+
PS C:\> Restore-AzSqlinstanceDatabase -InputObject $deletedDatabase[0] -PointInTime UTCDateTime -TargetInstanceDatabaseName "Database01_restored"
138+
```
139+
140+
The first command gets the deleted instance databases named 'DB1' on Instance 'managedInstance1'
141+
The second command restores the the fetched database, from the specified point-in-time backup to the instance database named Database01_restored using input object.
142+
125143
## PARAMETERS
126144

127145
### -AsJob

0 commit comments

Comments
 (0)