Январь 5

mssql restore DB from bash

Восстановить через «Азуру» не получилась, так как ругалось что кто-то подключен ох уж этот «микрософт», конечно я — подключен

Msg 3101, Level 16, State 1, Server name_mssqlinstallserver, Line 1
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Server name_mssqlinstallserver, Line 1
RESTORE DATABASE is terminating abnormally.

даже

systemctl stop mssql-server
systemctl start mssql-server

не помогал

но в совокупности через баш получилось после перу перезагрузок

но после восстановления, нужно выполнить пару команд, чтоб подключить базу — иначе она будет висеть в восставляемых

sqlcmd -S localhost -U sa -Q "RESTORE DATABASE [BD_name name] FROM DISK = N'/var/opt/old/data/BD_name name-202515-12-51-56.bak' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"
sqlcmd -S localhost -U sa -Q "RESTORE DATABASE [BD_name name] WITH RECOVERY"
sqlcmd -S localhost -U sa -Q "SELECT name, state_desc FROM sys.databases WHERE name = 'BD_name name'"

в суме получится что-то подобное

 
root@server:/var/opt/mssql/data# sqlcmd -S localhost -U sa -Q "RESTORE DATABASE [BD_name name] FROM DISK = N'/var/opt/old/data/BD_name name-202515-12-51-56.bak' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"
Password:
5 percent processed
10 percent processed.
15 percent processed.
20 percent processed.
25 percent processed.
30 percent processed.
35 percent processed.
40 percent processed.
45 percent processed.
50 percent processed.
55 percent processed.
60 percent processed.
65 percent processed.
70 percent processed.
75 percent processed.
80 percent processed.
85 percent processed.
90 percent processed.
95 percent processed.
100 percent processed.
Processed 32832 pages for database 'BD_name name', file 'BD_name name' on file 1.
Processed 2 pages for database 'BD_name name', file 'BD_name name_log' on file 1.
RESTORE DATABASE successfully processed 32834 pages in 7.609 seconds (33.711 MB/sec).
root@server:/var/opt/mssql/data# sqlcmd -S localhost -U sa -Q "RESTORE DATABASE [BD_name name] WITH RECOVERY"
Password:
RESTORE DATABASE successfully processed 0 pages in 4.043 seconds (0.000 MB/sec).
root@server:/var/opt/mssql/data# sqlcmd -S localhost -U sa -Q "SELECT name, state_desc FROM sys.databases WHERE name = 'BD_name name'"
Password:
name                                                                                                                             state_desc
-------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------
BD_name name                                                                                                             ONLINE

(1 rows affected)
root@server:/var/opt/mssql/data#

Апрель 10

backup and restore all MySQL

 Buy cheap and genuine Windows 7 product key  |
 Windows 7 Ultimate ISO download  |
 Windows 7 Product Key Generator For 32&64 Bits  |
 Windows 7 Product Key Online Store  |
 Windows 7 Ultimate SP1 Product Key Sale  |
 Windows 7 Key  |
 Get Free Newest Windows 7 Product Key  |
 Windows 7 Product Key for 32bit/64bit Updated 2016  |
 Microsoft Office 2010 Professional Plus 14 serial key dowload  |
 Windows 7 Professional Download ISO Free Download  |
windows 10 education key
windows 10 enterprise mak
office 2010 key
windows 7 key sale
windows 10 home-key
windows 10 education
windows 10 pro key
office 2016 key
windows 10 key
office 2013 key
windows 10 home edition
windows 7 key
windows 10 activation key

backup and restore all MySQL databases with 2 simple commands1
#backup all databases in one file (eventually add the option —add-locks):
mysqldump -u username -p -–all-databases > file.sql

#backup all databases in one gzipped file:
mysqldump -u username -p -–all-databases | gzip > file.sql.gz

#restore all databases:
mysql -u username -p < file.sql