DP-300 Exam QuestionsBrowse all questions from this exam

DP-300 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?

Show Answer
Correct Answer: AB

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

15 comments
Sign in to comment
MeirOption: A
Aug 16, 2020

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
Aug 30, 2020

"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
Oct 25, 2020

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
Apr 4, 2021

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
Dec 9, 2020

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

JohnCrawfordOption: A
Jan 7, 2021

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.

CorbizOption: B
Feb 22, 2021

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
Feb 23, 2021

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

ed7
Feb 27, 2021

but there is no info that GeoBackup exists anywhere

nazant
Mar 29, 2021

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
Mar 30, 2021

"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

rob51i03Option: B
Oct 29, 2020

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
Dec 9, 2020

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

Geese_HowardOption: A
Feb 20, 2021

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
Feb 20, 2021

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

Jas_dandiwalOption: B
Mar 4, 2021

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

examtryOption: A
Jun 13, 2021

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

cusmanOption: B
Apr 1, 2022

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

MediMediOption: B
Oct 28, 2020

Remove and restore is not the target here.

BurhanUddin
Jan 6, 2021

What is the answer her?

V_karagOption: B
Jan 15, 2021

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

QiangQiang
Feb 3, 2021

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

QiangQiang
Feb 4, 2021

it should be Yes

hydrilloOption: A
Mar 28, 2021

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
Apr 4, 2021

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.

scottytohottyOption: B
Jul 15, 2024

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