Quick way of moving log file | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Quick way of moving log file

Here’s a quick way of moving the transaction log file.
backup the master and the database which your trying to move the logfile first!’ ‘Reconfigure the system options to allow updates to the system tables’
sp_configure ‘allow update’,1
reconfigure with override
‘Update the sysfiles1 table from the database which you want to move its log file’
‘Update the filename with the new location ‘c:eek:ld_log.ldf ‘ to ‘e:eek:ld_file’ update sysfiles1 set filename=’e:sql_perform_log.ldf’ where fileid =2 ‘update the sysaltfiles in the master database with the new location of the logfile’
update sysaltfiles set filename=’e:sql_perform_log.ldf’ where fileid =2 and dbid=12 Take the database offline move the physical log file to its new location Place the database online ‘Reconfigure the system options to not allow updates to the system tables’
sp_configure ‘allow update’,0
reconfigure with override
Its always suggested not to touch(update) SYSTEM tables directly which might cause failure on the system. BOL provided various options to do such thing by the way of SP_ATTACH_DB, RESTORE etc. _________
Satya SKJ

]]>