-
Notifications
You must be signed in to change notification settings - Fork 568
Open
Labels
Description
Environment
- Python: 3.12
- pyodbc: 5.2.0
- OS: RHEL 9.6
- DB: MS SQL Server 2022
- Driver: Microsoft ODBC Driver 18 for SQL Server (18.5.1.1)
Background
We are currently working with SQL Server on Linux snapshot backups. The highlevel steps entail:
- Take SQL Server snapshot
- Open DB connection.
- Execute
"ALTER SERVER CONFIGURATION SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON;" - Take Linux LVM snapshot
- Execute
"BACKUP SERVER TO DISK = '/var/opt/mssql/backup/metadata/backup_1.bkm' WITH METADATA_ONLY, FORMAT; - Close DB connection
- Mount LVM snapshots
- Backup them up
- Unmount LVM snapshots
- Delete LVM snapshots
Issue
The statement in Step 1, iv fails with multiple "Error: 3041, Severity: 16, State: 1.". We made test with Java, SQL SSMS, Powershell using ODBC connections and all worked fine.
When we used isql with the -v flag we noted that statement in Step 1, iv returns an "SQL_SUCCESS_WITH_INFO" for each datafile in the SQL instance. Looks like only the first "SQL_SUCCESS_WITH_INFO" is handled by pyodbc Note I can provide the isql output if needed.