Restore-AzureRmSqlInstanceDatabase
Restores an Azure SQL Managed Instance database.
Important
Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.
To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.
Syntax
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-Name] <String>
[-InstanceName] <String>
[-ResourceGroupName] <String>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-InputObject] <AzureSqlManagedDatabaseModel>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-ResourceId] <String>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-Name] <String>
[-InstanceName] <String>
[-ResourceGroupName] <String>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
-TargetInstanceName <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-InputObject] <AzureSqlManagedDatabaseModel>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
-TargetInstanceName <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzureRmSqlInstanceDatabase
[-FromPointInTimeBackup]
[-ResourceId] <String>
-PointInTime <DateTime>
-TargetInstanceDatabaseName <String>
-TargetInstanceName <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Restore-AzureRmSqlInstanceDatabase cmdlet restores an instance database from a point in time in a live database. The restored database is created as a new instance database.
Examples
Example 1: Restore a instance database from a point in time
PS C:\> Restore-AzureRmSqlinstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01" -PointInTime UTCDateTime -TargetInstanceDatabaseName "Database01_restored"
The command restores the instance database Database01 from the specified point-in-time backup to the instance database named Database01_restored.
Example 2: Restore a instance database from a point in time to another instance on different resource group
PS C:\> Restore-AzureRmSqlInstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01" -PointInTime UTCDateTime -TargetInstanceDatabaseName "Database01_restored" -TargetInstanceName "managedInstance1" -TargetResourceGroupName "ResourceGroup02"
The command restores the instance database Database01 on instance managedInstance1 on resource group ResourceGroup01 from the specified point-in-time backup to the instance database named Database01_restored on instance managedInstance2 on resource group ResourceGroup02.
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Restore from a point-in-time backup.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Instance Database object to restore
| Type: | AzureSqlManagedDatabaseModel |
| Aliases: | InstanceDatabase |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The instance name.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The instance database name to restore.
| Type: | String |
| Aliases: | InstanceDatabaseName |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The point in time to restore the database to.
| Type: | DateTime |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The resource id of Instance Database object to restore
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the target instance database to restore to.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the target instance to restore to. If not specified, the target instance is the same as the source instance.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the target resource group to restore to. If not specified, the target resource group is the same as the source resource group.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
System.String