-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup.restore.sql
44 lines (38 loc) · 2.03 KB
/
setup.restore.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-- Enrique Catalá:
-- Web: https://www.clouddataninjas.com
-- Linkedin: https://www.linkedin.com/in/enriquecatala/
-- Support: https://github.com/sponsors/enriquecatala
-- Restoring databases
--
RESTORE DATABASE [Pubs] FROM DISK = N'/var/opt/mssql/backup/Pubs.bak' WITH
FILE = 1, MOVE N'pubs' TO N'/var/opt/mssql/data/Pubs.mdf',
MOVE N'pubs_log' TO N'/var/opt/mssql/data/Pubs_log.ldf',
REPLACE, NOUNLOAD, STATS = 5;
-- Northwind
--
RESTORE DATABASE [Northwind] FROM DISK = N'/var/opt/mssql/backup/Northwind.bak' WITH
FILE = 1, MOVE N'Northwind' TO N'/var/opt/mssql/data/Northwind.mdf',
MOVE N'Northwind_log' TO N'/var/opt/mssql/data/Northwind_log.ldf',
REPLACE, NOUNLOAD, STATS = 5;
-- AdventureWorks databases
--
RESTORE DATABASE [AdventureWorks2017] FROM DISK = N'/var/opt/mssql/backup/AdventureWorks2017.bak' WITH
FILE = 1, MOVE N'AdventureWorks2017' TO N'/var/opt/mssql/data/AdventureWorks2017.mdf',
MOVE N'AdventureWorks2017_log' TO N'/var/opt/mssql/data/AdventureWorks2017_log.ldf',
REPLACE, NOUNLOAD, STATS = 2;
--
RESTORE DATABASE [WideWorldImporters]
FROM DISK = N'/var/opt/mssql/backup/WideWorldImporters-Full.bak' WITH
FILE = 1, MOVE N'WWI_Primary' TO N'/var/opt/mssql/data/WideWorldImporters.mdf',
MOVE N'WWI_UserData' TO N'/var/opt/mssql/data/WideWorldImporters_UserData.ndf',
MOVE N'WWI_Log' TO N'/var/opt/mssql/data/WideWorldImporters.ldf',
MOVE N'WWI_InMemory_Data_1' TO N'/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1',
REPLACE, NOUNLOAD, STATS = 2;
--
RESTORE DATABASE [WideWorldImportersDW]
FROM DISK = N'/var/opt/mssql/backup/WideWorldImportersDW-Full.bak' WITH
FILE = 1, MOVE N'WWI_Primary' TO N'/var/opt/mssql/data/WideWorldImportersDW.mdf',
MOVE N'WWI_UserData' TO N'/var/opt/mssql/data/WideWorldImportersDW_UserData.ndf',
MOVE N'WWI_Log' TO N'/var/opt/mssql/data/WideWorldImportersDW.ldf',
MOVE N'WWIDW_InMemory_Data_1' TO N'/var/opt/mssql/data/WideWorldImportersDW_InMemory_Data_1',
REPLACE, NOUNLOAD, STATS = 2;