Restore-VESQLIRDatabase
Short Description
Performs instant recovery of a backed-up Microsoft SQL Server database.
Product: Veeam Backup & Replication
Product Edition: Enterprise, Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides the following parameter sets:
-
RestoreUsingCredentialsFromVBRRestore-VESQLIRDatabase [-Database] <VESQLDatabase> [-DatabaseName <String>] [-ServerName <String>]
[-InstanceName <String>] [-Port <Int32>] [-ToPointInTimeUtc <DateTime>] [-TargetFolder <String>]
[-File <VESQLDatabaseFile[]>] [-TargetPath <String[]>] [-Force] -SwitchOverOptions <VESQLIRSwitchOverOptions> [<CommonParameters>]
-
RestoreUsingCredentialsRestore-VESQLIRDatabase [-Database] <VESQLDatabase> [-DatabaseName <String>] [-ServerName <String>]
[-InstanceName <String>] [-Port <Int32>] -SqlCredentials <PSCredential> [-UseSQLAuthentication]
[-GuestCredentials <PSCredential>] [-ToPointInTimeUtc <DateTime>] [-TargetFolder <String>]
[-File <VESQLDatabaseFile[]>] [-TargetPath <String[]>] [-Force] -SwitchOverOptions <VESQLIRSwitchOverOptions> [<CommonParameters>]
-
RestoreUsingGmsaAccountRestore-VESQLIRDatabase [-Database] <VESQLDatabase> [-DatabaseName <String>] [-ServerName <String>]
[-InstanceName <String>] [-Port <Int32>] -GMSAAccount <String> [-ToPointInTimeUtc <DateTime>]
[-TargetFolder <String>] [-File <VESQLDatabaseFile[]>] [-TargetPath <String[]>] [-Force]
-SwitchOverOptions <VESQLIRSwitchOverOptions> [<CommonParameters>]
Detailed Description
This cmdlet performs instant recovery of a backed-up Microsoft SQL Server database. You can restore a database to the original location or to another location. For details, see the Instant Recovery section of the Veeam Explorers User Guide.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Database |
Specifies a Microsoft SQL Server database. The cmdlet will restore this database.
Accepts the |
True |
0 |
True (ByValue) |
|
|
DatabaseName |
For restore to another location. Specifies a name for the restored Microsoft SQL Server database on the target location. The database will be restored with the specified name. |
|
False |
Named |
False |
|
File |
Specifies an array of file names for Microsoft SQL Server databases.
Accepts the |
False |
Named |
False |
|
|
Force |
Defines that the cmdlet will overwrite an existing Microsoft SQL Server database with a Microsoft SQL Server database from the backup. Note: The cmdlet will show no prompt before executing the command. |
|
False |
Named |
False |
|
GMSAAccount |
Specifies the name of the Group Managed Service Account (gMSA). The cmdlet will use this account to authenticate to Microsoft SQL Server on the target machine. |
|
True |
Named |
False |
|
GuestCredentials |
Specifies credentials for authenticating to the target machine. If these credentials do not work, the cmdlet will use the credentials specified in the backup job. Consider the following:
Accepts the |
|
False |
Named |
False |
|
InstanceName |
For restore to another location. Specifies the name of the target Microsoft SQL Server instance. The cmdlet will restore the Microsoft SQL Server database to the specified target instance. |
|
False |
Named |
False |
|
Port |
Specifies a port number that will be used to connect to the target Microsoft SQL Server. |
|
False |
Named |
False |
|
ServerName |
For restore to another location. Specifies DNS name or IP address of the target SQL Server machine. The cmdlet will restore the database to the specified Microsoft SQL Server machine. |
|
False |
Named |
False |
|
SqlCredentials |
Specifies Microsoft SQL Server credentials for authenticating to Microsoft SQL Server on the target machine. Note: If you do not specify Microsoft SQL Server credentials, the cmdlet will use the current account credentials. If these credentials do not work, the cmdlet will use the credentials specified in the backup job.
Accepts the |
|
True |
Named |
False |
|
SwitchOverOptions |
Specifies a switchover option: automatic, manual or scheduled.
Accepts the |
True |
Named |
True (ByValue) |
|
|
TargetFolder |
For restoring Microsoft SQL Server database files to specific location. Specifies the destination folder. The cmdlet will restore all database files to that folder.
Note: This parameter is not available if you use the |
|
False |
Named |
False |
|
TargetPath |
Specifies a target path array. The cmdlet will restore Microsoft SQL Server database files to the locations specified in the array. Consider the following:
|
|
False |
Named |
False |
|
ToPointInTimeUtc |
Specifies a point in time in the UTC format within the restore interval of a Microsoft SQL Server database. The cmdlet will restore the database to the state of the specified point in time. |
|
False |
Named |
False |
|
UseSQLAuthentication |
Defines that the cmdlet will use SQL authentication to connect to Microsoft SQL Server on the target machine.
Note: If you omit this parameter, the cmdlet will use credentials specified in the |
|
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Learn.
Output Object
The cmdlet returns the VESQLIRDatabase object that contains information about the Microsoft SQL Server database published within the instant recovery session.
Examples
Example 1. Performing Instant Recovery of Microsoft SQL Server Database to Original Location with Scheduled Switchover
|
This example shows how to perform instant recovery of the
Perform the following steps:
|
Example 2. Performing Instant Recovery of Microsoft SQL Server Databases to Specific Folder and Switching over Manually
|
This example shows how to restore the
Perform the following steps:
|
Related Commands
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases.Start-VESQLRestoreSessionStarts a restore session to explore backed-up Microsoft SQL Server databases and to perform operations with these databases.Get-VESQLDatabaseReturns backed-up Microsoft SQL Server databases.Get-VESQLDatabaseFileReturns full file names for a backed-up Microsoft SQL Server database.New-VESQLIRSwitchOverOptionsDefines the switchover option that you can apply to the instant recovery session of a Microsoft SQL Server database.Switch-VESQLIRDatabasePerforms switchover of a Microsoft SQL Server database published within an instant recovery session.Get-VBRApplicationRestorePointGet-Date