You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Restore a SQL database in a managed instance to a previous point in time.
4
4
services: sql-database
5
5
ms.service: sql-database
@@ -18,22 +18,18 @@ Use point-in-time restore (PITR) to create a database as a copy of another datab
18
18
19
19
Point-in-time restore is useful in recovery scenarios, such as incidents caused by errors, incorrectly loaded data, or deletion of crucial data. You can also use it simply for testing or auditing. Backup files are kept for 7 to 35 days, depending on your database settings.
20
20
21
-
Point-in-time restore can:
21
+
Point-in-time restore can restore a database:
22
22
23
-
- Restore a database from an existing database.
24
-
- Restore a database from a deleted database.
25
-
26
-
For a managed instance, point-in-time restore can also:
27
-
28
-
- Restore a database to the same managed instance.
29
-
- Restore a database to another managed instance.
30
-
31
-
> [!NOTE]
32
-
> Point-in-time restore of a whole managed instance is not possible. This article explains only what's possible: point-in-time restore of a database that's hosted on a managed instance.
23
+
- from an existing database.
24
+
- from a deleted database.
25
+
- to the same managed instance, or to another managed instance.
33
26
34
27
## Limitations
35
28
36
-
When you're restoring from one managed instance to another, both instances must be in the same subscription and region. Cross-region and cross-subscription restore aren't currently supported.
29
+
Point in time restore to a managed instance has the following limitations:
30
+
31
+
- When you're restoring from one managed instance to another, both instances must be in the same subscription and region. Cross-region and cross-subscription restore aren't currently supported.
32
+
- Point-in-time restore of a whole managed instance is not possible. This article explains only what's possible: point-in-time restore of a database that's hosted on a managed instance.
37
33
38
34
> [!WARNING]
39
35
> Be aware of the storage size of your managed instance. Depending on size of the data to be restored, you might run out of instance storage. If there isn't enough space for the restored data, use a different approach.
@@ -42,13 +38,13 @@ The following table shows point-in-time restore scenarios for managed instances:
42
38
43
39
||Restore existing DB to same managed instance| Restore existing DB to another managed instance|Restore dropped DB to same managed instance|Restore dropped DB to another managed instance|
Restore an existing database to the same instance by using the Azure portal, Powershell, or the Azure CLI. To restore a database to another instance, use Powershell or the Azure CLI so you can specify the properties for the target managed instance and resource group. If you don't specify these parameters, the database will be restored to the existing instance by default. The Azure portal doesn't currently support restoring to another instance.
47
+
Restore an existing database to the same instance by using the Azure portal, PowerShell, or the Azure CLI. To restore a database to another instance, use PowerShell or the Azure CLI so you can specify the properties for the target managed instance and resource group. If you don't specify these parameters, the database will be restored to the existing instance by default. The Azure portal doesn't currently support restoring to another instance.
To restore the database to another managed instance, also specify the names of the target resource group and managed instance:
85
+
To restore the database to another managed instance, also specify the names of the target resource group and target managed instance:
90
86
91
87
```powershell-interactive
92
88
$targetResourceGroupName = "<Resource group of target managed instance>"
@@ -130,9 +126,18 @@ For a detailed explanation of the available parameters, see the [CLI documentati
130
126
131
127
## Restore a deleted database
132
128
133
-
Restoring a deleted database can be done by using PowerShell or Azure Portal.Please use this document to do this by [Azure Portal](https://docs.microsoft.com/azure/sql-database/sql-database-recovery-using-backups#managed-instance-database-1). The database can be restored to the same instance or another instance.
129
+
Restoring a deleted database can be done by using PowerShell or Azure portal. To restore a deleted database to the same instance, use either the Azure portal or PowerShell. To restore a deleted database to another instance, use PowerShell.
130
+
131
+
### Portal
132
+
133
+
134
+
To recover a managed database using the Azure portal, open the managed instance overview page, and select **Deleted databases**. Choose a deleted database that you want to restore, and type the name for the new database that will be created with data restored from the backup.
134
135
135
-
To restore a deleted database by using PowerShell, specify your values for the parameters in the following command. Then, run the command:
136
+

137
+
138
+
### PowerShell
139
+
140
+
To restore a database to the same instance, update the parameter values and then run the following PowerShell command:
To restore the deleted database to another instance, change the names of the resource group and managed instance. Also, make sure that the location parameter matches the location of the resource group and the managed instance.
163
+
To restore the database to another managed instance, also specify the names of the target resource group and target managed instance:
157
164
158
165
```powershell-interactive
159
-
$resourceGroupName = "<Second resource group name>"
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-recovery-using-backups.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ For a sample PowerShell script showing how to restore a deleted Azure SQL databa
120
120
121
121
#### Managed instance database
122
122
123
-
For a sample PowerShell script showing how to restore a deleted instance database, see [Restore deleted database on managed instance using PowerShell](https://blogs.msdn.microsoft.com/sqlserverstorageengine/20../../recreate-dropped-database-on-azure-sql-managed-instance).
123
+
For a sample PowerShell script showing how to restore a deleted instance database, see [Restore deleted database on managed instance using PowerShell](sql-database-managed-instance-point-in-time-restore.md#restore-a-deleted-database)
124
124
125
125
> [!TIP]
126
126
> To programmatically restore a deleted database, see [Programmatically performing recovery using automated backups](sql-database-recovery-using-backups.md).
0 commit comments