Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Error Moving Log File

$
0
0
[code="sql"]-- SELECT @@ServerName-- I'm trying to move D:\MSSQL\Data\Staging_log.ldf' to L:\MSSQL\Log\Staging_log.ldf'-- 1. Set Database OFFLINEALTER DATABASE Staging SET OFFLINE;-- 2.Move the file or files to the new location.-- 3.For each file moved, run the following statement.ALTER DATABASE Staging MODIFY FILE ( NAME = Staging_log, FILENAME = 'L:\MSSQL\Log\Staging.ldf' );-- 4.Run the following statement.ALTER DATABASE Staging SET ONLINE;[/code]I get the following error:[quote]Msg 5120, Level 16, State 101, Line 37Unable to open the physical file "L:\MSSQL\Log\Staging.ldf". Operating system error 5: "5(Access is denied.)".File activation failure. The physical file name "L:\MSSQL\Log\Staging.ldf" may be incorrect.New log file 'D:\MSSQL\Data\Staging_log.ldf' was created.[code="sql"][/code][code="sql"][/code][/code][/quote]I do not get it. The first Database moved the log file just fine, however this one does not work?

Viewing all articles
Browse latest Browse all 6525

Trending Articles