ZhangZhihui's Blog  

https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver17&tabs=ssms

 

Download the bak files from https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver17&tabs=ssms .

 

Copy the bak files to the docker container where SQL Server 2022 is running:

PS D:\docker> docker exec -it sqlsvr22 mkdir /var/opt/mssql/backup
PS D:\docker> docker cp .\AdventureWorksLT2022.bak sqlsvr22:/var/opt/mssql/backup/AdventureWorksLT2022.bak
Successfully copied 8.51MB to sqlsvr22:/var/opt/mssql/backup/AdventureWorksLT2022.bak
PS D:\docker> docker cp AdventureWorks2022.bak sqlsvr22:/var/opt/mssql/backup/AdventureWorks2022.bak
Successfully copied 210MB to sqlsvr22:/var/opt/mssql/backup/AdventureWorks2022.bak

 

Restore the sample databases using SSMS:

  1. Open SSMS and connect to your SQL Server instance.

  2. Right-click Databases in Object Explorer and then select Restore Database... to start the Restore Database wizard.

    Screenshot showing the steps for starting the Restore Database wizard.

  3. Select Device, and then select the ellipsis (...) to choose a device.

  4. Select Add, and then choose the .bak file you recently moved to the backup location. If you moved your file to this location but you don't see it in the wizard, SQL Server or the user signed into SQL Server doesn't have permission to this file in this folder.

  5. Select OK to confirm your database backup selection and close the Select backup devices window.

  6. Check the Files tab to confirm that the Restore as location and file names match your intended location and file names in the Restore Database wizard.

  7. Select OK to restore your database.

1

 

2

 

posted on 2026-01-08 12:38  ZhangZhihuiAAA  阅读(2)  评论(0)    收藏  举报