exam questions

Exam DP-300 All Questions

View all questions & answers for the DP-300 exam

Exam DP-300 topic 6 question 14 discussion

Actual exam question from Microsoft's DP-300
Question #: 14
Topic #: 6
[All DP-300 Questions]

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: From Microsoft SQL Server Management Studio (SSMS), you rename Database1 on Server2 as Database2. From the Azure portal, you create a new database on Server2 by restoring the backup of Database1 from Server1, and then you delete Database2.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
This procedure is necessary and correct, as there is no option in Azure SQL Database to directly restore a database.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/statements/restore-statements-transact-sql

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Jeembeem
Highly Voted 4 years, 1 month ago
It's "Yes": you can rename an Azure SQL Database on SSMS and then run the procedure. The explanation is wrong: there is no "replace" option on Azure SQL
upvoted 20 times
Raffer
4 years ago
You are right. https://azure.microsoft.com/en-gb/updates/azure-sql-database-managed-instance-database-rename-is-supported/
upvoted 2 times
Raffer
4 years ago
https://stackoverflow.com/questions/7711306/rename-sql-azure-database
upvoted 2 times
...
...
...
voodoo_sh
Most Recent 3 months ago
Selected Answer: A
if this: ""create a new database on Server2 by restoring the backup of Database1 from Server1, and then you delete Database2"" means Export (backup) database on Server1 to some storage account as a .bacpac file, and then Import (restore) database to Server2, then answer is Yes
upvoted 1 times
...
bingomutant
6 months, 2 weeks ago
chat says yes - Renaming Database1 on Server2: By renaming Database1 on Server2 to Database2, the name Database1 becomes available for the new restored database. Restoring Database1 from Server1: From the Azure portal, you can restore Database1 from Server1's backup to Server2, effectively replacing the original Database1 that was renamed. Deleting Database2: After the restore operation is complete, you can safely delete the renamed database (Database2), effectively replacing the original database on Server2 with the restored copy from Server1.
upvoted 1 times
...
vcloudpmp
1 year, 9 months ago
As noted below: https://learn.microsoft.com/en-us/sql/relational-databases/databases/rename-a-database?view=sql-server-ver16 Renaming a database does not change the physical name of the database files on disk, or the logical names of the files.
upvoted 1 times
...
vcloudpmp
1 year, 9 months ago
Backup/restore across Azure SQL databases is possible with export / import approach. https://www.mssqltips.com/sqlservertip/5189/restore-an-azure-sql-database-from-one-server-to-another-server/ https://learn.microsoft.com/en-us/answers/questions/821165/restore-azure-sql-database-on-a-server-to-a-differ
upvoted 1 times
...
Chunchi
3 years, 3 months ago
Answer is No
upvoted 1 times
...
quermi
3 years, 5 months ago
When you rename a database you don't rename the database files on premise. I don't know if in Azure SQL database is the same if before is true, Then you can only restore wtith CREATE DATABASE Database2 AS COPY OF server1.Database1; it you meet two conditions: - When you rename database changes the name of database files - And Both servers' firewalls must be configured to allow inbound connection from the IP of the client issuing the T-SQL CREATE DATABASE ... AS COPY OF command. To determine the source IP address of current connection, execute SELECT client_net_address FROM sys.dm_exec_connections WHERE session_id = @@SPID https://www.mssqltips.com/sqlservertip/4419/renaming-physical-database-file-names-for-a-sql-server-database/ https://docs.microsoft.com/en-us/azure/azure-sql/database/database-copy?tabs=azure-powershell
upvoted 2 times
...
o2091
3 years, 5 months ago
B ist correct?
upvoted 1 times
...
AmitB
3 years, 8 months ago
Answer is correct, It should be "NO" As asked in question, The solution must replace the existing Database1 on Server2. And in Solution: From Microsoft SQL Server Management Studio (SSMS), you rename Database1 on Server2 as Database2. From the Azure portal, you create a new database on Server2 by restoring the backup of Database1 from Server1, and then you delete Database2. When you perform the restore with replace, it will replace or overwrite the physical files as well but here by renaming database name will not change the physical files name.
upvoted 3 times
...
devpool
4 years ago
"The solution must replace the existing Database1 on Server2" Answer is correct.
upvoted 1 times
...
U_C
4 years ago
Answer is correct because you can NOT restore a backup from another server in Azure Database. But you can create a new DB by copying a backup from another server: -- Execute on the master database of the target server (server2) to start copying from Server1 to Server2 CREATE DATABASE Database2 AS COPY OF server1.Database1;
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago