One of the databases I am going to support does not have a validate log file location. The drive which the log file is pointing to does not exist. But I don't see any error in database error log because of this.
Is there a default location for SQL server log file when the log file path is not set right?
Thanks
Best Answer
Perhaps the log is on is a network share that is only visible to the SQL Server service account?
If this were the case you could log onto the server using that same service account used by SQL Server, and "see" the drive in Windows Explorer.
SQL Server will refuse to load a database if it cannot locate a valid log file. It will NOT simply create the log file in the "default" Log file location.
An alternate method to see if the log file really exists, and perhaps where it actually is, would be to use the
xp_cmdshell
extended stored procedure to run adir
command on the SQL Server itself, in the context of the service account. This relies on havingexec sp_configure 'xp_cmdshell'
being set to1
. Ifxp_cmdshell
is enabled, you could run the following: