-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
XuanThuLab
committed
Aug 10, 2020
1 parent
a4a4257
commit 6780207
Showing
6 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# #CHECK MEDIA | ||
# /opt/mssql-tools/bin/sqlcmd \ | ||
# -S localhost -U SA -P 'Password123' \ | ||
# -Q "RESTORE FILELISTONLY FROM DISK = '/var/opt/mssql/backup/xtlab.bak'" | ||
|
||
|
||
/opt/mssql-tools/bin/sqlcmd \ | ||
-S localhost -U SA -P 'Password123' \ | ||
-Q 'RESTORE DATABASE xtlab FROM DISK = "/var/opt/mssql/backup/xtlab.bak" WITH MOVE "xtlab" TO "/var/opt/mssql/data/xtlab.mdf", MOVE "xtlab_log" TO "/var/opt/mssql/data/xtlab_log.ldf"' | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3.7" | ||
|
||
services: | ||
xtlab-mssql: | ||
image: "mcr.microsoft.com/mssql/server:2017-latest" | ||
container_name: sqlserver-xtlab | ||
restart: always | ||
hostname: mssql | ||
environment: | ||
SA_PASSWORD: Password123 #Thiết lập password | ||
ACCEPT_EULA: 'Y' | ||
# Express: | ||
|
||
volumes: | ||
- mssqlvolume:/var/opt/mssql/data # thư mục lưu DB | ||
- ./bk:/var/opt/mssql/backup | ||
ports: | ||
- "1433:1433" | ||
|
||
volumes: | ||
mssqlvolume: | ||
name: sqlserver-xtlab-vl | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Cài đặt MS SQL Server trên Docker | ||
``` | ||
docker-compose up -d | ||
``` | ||
container name: sqlserver-xtlab | ||
|
||
port: 1433 | ||
|
||
user: sa | ||
|
||
password: Password123 | ||
|
||
## Phục hồi dữ liệu mẫu | ||
``` | ||
docker exec sqlserver-xtlab /var/opt/mssql/backup/restore.sh | ||
``` | ||
Tên CSDL: xtlab | ||
|
||
Cấu trúc dữ liệu mẫu: | ||
https://xuanthulab.net/chay-sql-online-cong-cu-hoc-cau-lenh-sql.html |