Exam DP-300 All QuestionsBrowse all questions from this exam
Question 255

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have two Azure SQL Database servers named Server1 and Server2. Each server contains an Azure SQL database named Database1.

You need to restore Database1 from Server1 to Server2. The solution must replace the existing Database1 on Server2.

Solution: You run the Remove-AzSqlDatabase PowerShell cmdlet for Database1 on Server2. You run the Restore-AzSqlDatabase PowerShell cmdlet for

Database1 on Server2.

Does this meet the goal?

    Correct Answer: B

    To restore a database from one server to another in Azure SQL, the process typically involves deleting the existing database on the target server and then creating a new one from the backup of the source server. The solution presented involves using the Remove-AzSqlDatabase and Restore-AzSqlDatabase PowerShell cmdlets. However, the Restore-AzSqlDatabase cmdlet would need additional steps and parameters (like FromGeoBackup) to correctly restore a database from a different server, which are not mentioned here. Therefore, this approach as described would not meet the goal of replacing the existing Database1 on Server2 with the data from Database1 on Server1.

Discussion
MeirOption: A

The answer is yes. See https://docs.microsoft.com/en-us/powershell/module/az.sql/restore-azsqldatabase?view=azps-4.5.0 that doesn't have replsce option. The suggested solution is not for Azure DB

[Removed]Option: B

"You run the Restore-AzSqlDatabase PowerShell cmdlet for Database1 on Server2." Based on the above statement, the above command will end up restoring backup of the deleted database again. So the answer is (B) No. ???

bobicos

I agree. Although it is possible to restore a geo-replicated backup w/ Restore-AzSqlDatabase, but the instructions would be missing a step to do so. https://docs.microsoft.com/en-us/powershell/module/az.sql/restore-azsqldatabase?view=azps-4.8.0#example-5--geo-restore-a-database

U_C

Needs two steps to restore: --Gets the geo-redundant backup for the database named Database01, and then stores it in the $GeoBackup variable. $GeoBackup = Get-AzSqlDatabaseGeoBackup -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" --Restores the backup in $GeoBackup to the SQL database named RestoredDatabase. Restore-AzSqlDatabase -FromGeoBackup -ResourceGroupName "TargetResourceGroup" -ServerName "TargetServer" -TargetDatabaseName "RestoredDatabase" -ResourceId $GeoBackup.ResourceID -Edition "Standard" -ServiceObjectiveName "S2"

Luke97

Restore-AzSqlDatabase can also restore Azure DB from point-of-time.

CorbizOption: B

No. Azure SQL Database does not currently support cross server restore. The source and target server names must be the same. https://docs.microsoft.com/en-us/powershell/module/servicemanagement/azure.service/start-azuresqldatabaserestore?view=azuresmps-4.0.0

Corbiz

Sorry, answer is actually Yes. You can do it using the "-FromGeoBackup" parameter. Tested myself.

ed7

but there is no info that GeoBackup exists anywhere

nazant

Exactly. So we may suppose that ony PITR backups exist on server1 and I haven't found information if it is possible to restore PITR on other server with Restore-AzSqlDatabase command.

Raffer

"By default, SQL Database and SQL Managed Instance store data in geo-redundant storage blobs that are replicated to a paired region." https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database

JohnCrawfordOption: A

The correct answer is YES. The Restore-AzSqlDatabase cmdlet restores a SQL database from a geo-redundant backup, a backup of a deleted database, a long term retention backup, or a point in time in a live database. The restored database is created as a new database. You can create an elastic SQL database by setting the ElasticPoolName parameter to an existing elastic pool.

Geese_HowardOption: A

The answer is A. You can restore database with the given command. To restore a deleted backup you need to run Get-AzSqlDeletedDatabaseBackup before restore. And also to restore from geo redundant copy one have to use -FromGeoBackup as a parameter as well.

Geese_Howard

MS link here https://docs.microsoft.com/en-us/azure/azure-sql/database/scripts/restore-database-powershell

rob51i03Option: B

The answer is correct, but not the explanation. In Azure SQL you can't restore a database over an existing one, so WITH REPLACE does not exist. However, the business requirements are not met because there is a step missing, which would be to make the backup from Server 1 available to Server 2 for restoring.

Luke97

You can't create Backup manually on Azure SQL DB. So, no missing step here.

cusmanOption: B

No - Since it does not specify that you are restoring Database1 from Server1 to Server2 after Database1 on Server2 was removed.

examtryOption: A

Answer is Yes. This can be done from Geo backups.

Jas_dandiwalOption: B

Answer is No. it does not let you delete database to restore on another server as throw ResourceId wrong message for database.

scottytohottyOption: B

No this does not meet the requirements, tricky worded question.

hydrilloOption: A

What's the right answer here guys? I tried both with the Azure Portal and with Powershell and both works as suggested in the answers. Maybe this questions is outdated

hydrillo

Update: Theoretically it would work with powershell, but I think the clue here is that it says "restore Database 1 on Server 2" which would just restore the previously deleted Database. In the answer with the Azure Portals the correct terms are used. That's why that is right and this is wrong.

QiangQiang

without seeing the actual PS commands, it's hard to say if it's yes or no

QiangQiang

it should be Yes

V_karagOption: B

A deleted database can only be recovered on the same server. https://docs.microsoft.com/en-us/azure/azure-sql/database/recovery-using-backups#:~:text=To%20recover%20a%20deleted%20database,data%20restored%20from%20the%20backup. In order to restore on different virtual server you need to create on first and then restore from latest backup

BurhanUddin

What is the answer her?

MediMediOption: B

Remove and restore is not the target here.