MSSQL restore all databases from folder with .bak files
Powershell
Install-Module dbatools Import-Module dbatools Set-DbatoolsInsecureConnection -SessionOnly Restore-DbaDatabase -SqlInstance SERVER-NAME\INSTANCE-NAME -Path 'C:\PATH-TO-BACKUPS'
Powershell
Install-Module dbatools Import-Module dbatools Set-DbatoolsInsecureConnection -SessionOnly Restore-DbaDatabase -SqlInstance SERVER-NAME\INSTANCE-NAME -Path 'C:\PATH-TO-BACKUPS'
lists logins and incorrect SIDs
USE <platnik_db>
GO
EXEC sp_change_users_login 'Report'
GO
Then start SQL
USE <platnik_db>
GO
EXEC sp_change_users_login 'Auto_Fix','<user_name>',NULL, '<password>'
GO
drop databases query
USE master; Go SELECT 'DROP DATABASE ['+ name + ']' FROM sys.databases WHERE name like 'PREFIX%'; GO
Shut down VM and then Listing qemu-img snapshot -l <file>.qcow2
Create qemu-img snapshot -c <snap-name> <file>.qcow2
Revert to qemu-img snapshot -a <snap-name> <file>.qcow2 Delete qemu-img snapshot -d <snap-name> <file>.qcow2
lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 04f2:b477 Chicony Electronics Co., Ltd HP HD Webcam
Bus 003 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
then
usbreset 0bda:8153
forfiles /p "C:\sql.arch" /s /m *.* /D -30 /C "cmd /c del /Q /S @path"
Stop openvpn server
List issued certs in
ls -alh /etc/openvpn/easy-rsa/pki/issued
cd /etc/openvpn/easy-rsa
./easy-rsa renew <cert-name>
copy new cert file from /etc/openvpn/easy-rsa/pki/issued
and
new key file from /etc/openvpn/easy-rsa/pki/private
to folder /etc/openvpn
create /etc/openvpn/auth.txt with key’s password
chmod 600 /etc/openvpn/auth.txt
add line to /etc/openvpn/server.conf
askpass /etc/openvpn/auth.txt
start openvpn server
Instalujemy po kolei
Microsoft Visual C++ Redistributable
Microsoft OLE DB Driver 19 for SQL Server (x64)
Microsoft SQL Server Migration Assistant (SSMA) for Access
SQL Server Management Studio (SSMS)
Uruchamiamy Migration Assistant (SSMA) for Access
Pomijamy Kreatora
Tools -> Default Project Settings
Zmieniamy “Add timestamp column” na Never
Tools -> Project Settings -> Type Mapping
zmieniamy
date na datetimetext[*..*]
text[*..*] na varchar[*]
memo na varchar[max]
Odpalamy kreatora, wybieramy bazę źródłową <nazwa>.mdb bazę docelową na serwerze MSSQL i wykonujemy konwersję.
Uruchom SQL Server Management Studio (SSMS) i usuń ograniczenia dotyczące zerowej długości wszystkich pól
polecenie poniżej wyświetli kwerendę która to zrobi
SELECT
ctu.TABLE_CATALOG
,ctu.TABLE_SCHEMA
,ctu.TABLE_NAME
,ctu.CONSTRAINT_CATALOG
,ctu.CONSTRAINT_SCHEMA
,ctu.CONSTRAINT_NAME
,cc.CHECK_CLAUSE
,[drop_statement]= 'ALTER TABLE [' + ctu.TABLE_CATALOG + '].['+ ctu.TABLE_SCHEMA+ '].[' + ctu.TABLE_NAME + '] DROP CONSTRAINT [' + ctu.CONSTRAINT_NAME +'];'
FROM [platnik].[INFORMATION_SCHEMA].[CONSTRAINT_TABLE_USAGE] ctu
join [platnik].[INFORMATION_SCHEMA].[CHECK_CONSTRAINTS] cc on ctu.CONSTRAINT_NAME=cc.CONSTRAINT_NAME
Uruchom SQL Server Management Studio (SSMS)
Utwórz konto dla bazy docelowej
Security -> Logins
Przejdź do User Mapping i ustaw usera jako właściciela bazy
Podłączamy się pod serwer MSSQL używając MSSQL Server Authentication, podając usera i hasło
Jeśli dostaniemy błąd
to zmieniamy sterownik połączenia z MSOLEDBSQL na SQLOLEDB (w moim przypadku musiałem tak zrobić pomimo migracji na MSSQL 2014 Standard)
Program accesspassview do odzyskiwania hasła do pliku mdb
Version | Path |
---|---|
SQL Server 2022 | C:\Windows\SysWOW64\SQLServerManager16.msc |
SQL Server 2019 | C:\Windows\SysWOW64\SQLServerManager15.msc |
SQL Server 2017 | C:\Windows\SysWOW64\SQLServerManager14.msc |
SQL Server 2016 | C:\Windows\SysWOW64\SQLServerManager13.msc |
SQL Server 2014 (12.x) | C:\Windows\SysWOW64\SQLServerManager12.msc |
SQL Server 2012 (11.x) | C:\Windows\SysWOW64\SQLServerManager11.msc |