olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Reading File Info - Linux OS #771

Open mrdm-nl opened 1 year ago

mrdm-nl commented 1 year ago

Reading File Info - Linux OS

SQL Server all version and edition running on Linux Microsoft SQL Server 2019 (RTM-CU22) (KB5027702) - 15.0.4322.2 (X64) Jul 27 2023 18:11:00 Copyright (C) 2019 Microsoft Corporation Web Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS) This issue is valid when non Sysadmin users want to make backup

Version of the script 2022-01-02 13:58:13

What command are you executing? in DatabaseBackup is executed INSERT INTO @DirectoryInfo (FileExists, FileIsADirectory, ParentDirectoryExists) EXECUTE [master].dbo.xp_fileexist @CurrentRootDirectoryPath) -- '/linux/folder'

What output are you getting? File_Exists = 0, FileIsDirectory = 0, ParentDirExists = 0

Suppposed working Solution using newer sys.dm_os_file_exists INSERT INTO @DirectoryInfo (FileExists, FileIsADirectory, ParentDirectoryExists) (SELECT * FROM sys.dm_os_file_exists(@CurrentRootDirectoryPath))

olahallengren commented 2 weeks ago

I guess I should be using the new DMF on SQL Server 2017 and later, on Windows and Linux.