dcsimg

How to rebuild or create LDFs

Products

Webtrends Analytics 9.x
Webtrends Analytics 8.7
Webtrends Analytics 8.5

Cause

You need to recreate the database ldf files because they have become corrupted, have grown too large, or are not available.

Resolution

This process is actually pretty simple. You can use the “sp_attach_single_file_db” system stored procedure to achieve this. To start this process you will need to make sure that your user does not have the database that you are about to manipulate,set as their default database–or you will have issues after the database is detached.
Find thedatabase.mdf and move thedatabase.ldf outside of the directory after the database has been detached. You may have to Drop connections to get the database to detach.
EXEC sp_detach_db @dbname = ‘wtmaster’
EXEC sp_attach_single_file_db @dbname = ‘wtmaster’,
@physname = ‘C:\Program Files\webtrends\common\database\MSSQL\MSSQL.1\DATA\wtmaster.mdf’
NOTE: Update the@physname path with the correct path to the MDF.