Re: Unsplitting a log file?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/21/04


Date: Wed, 21 Jul 2004 09:00:54 +0530

Hi,

Do the below steps to remove the second LDF file:-

-- Backup the transaction log

backup log chk to disk='c:\chk.trn'
go
-- Empty the LDF which needs to be removed

dbcc shrinkfile('LDF_LOGICAL_NAME','emptyfile')
go

-- mention the database in which the LDF file needs to be removed.

alter database <dbname> remove file <LDF_LOGICAL_NAME>

Thanks
Hari
MCDBA

"David Jenkins" <davidD0Tjenkins@cmgD0TcoD0Tnz> wrote in message
news:#MCKdpsbEHA.3944@tk2msftngp13.phx.gbl...
> David Jenkins wrote:
>
> > General question.
> >
> > Got a 40GB database which has two log files. I want to be able to delete
> > one of them and return it to a single log file as the database will be
> > moving on to new hardware. I have been unsuccessful so far.
> >
> > I've used a dbcc shrinkfile emptyfile statement on the appropriate log
> > file, followed by a truncate log to purge the info. However this does
> > not empty the second log file completely. It leaves it at 76MB and I
> > cannot delete it accordingly.
> >
> > Any help appreciated.
>
> Should have mentioned that this is SQL7 SP4



Relevant Pages

  • Re: Confused about log size after running Backup/Maintenance
    ... Transaction Log file (the *.ldf) would not be truncated by itself. ... To truncate the passive virtual logs in your Transaction Log file, you should back it up using Transaction Log Backup. ... As much as you perform operations against your database, this file will grow that much. ... And you may want to take a look at Tibor's article about this Truncation and Shirinkage. ...
    (microsoft.public.sqlserver.setup)
  • Re: connection between sql files and .Net
    ... Before connecting it from the application attach the database (MDF and LDF) ... Attach the MDF and LDF files to SQL server using a database name, ...
    (microsoft.public.sqlserver.server)
  • Re: HELP! Transaction log huge, & Im out of space!!
    ... Then reattach the database. ... It will create a new .ldf. ... > the transaction logs so I would like to just delete them ... > cant do that either because I cant access the database. ...
    (microsoft.public.sqlserver.server)
  • Re: Crash Recovery
    ... probably created on this machine from the BAK file. ... (i.e. the database was ... The LDF will reflect changes since that was done, ... > How to restore the BAK file. ...
    (microsoft.public.sqlserver.server)
  • Re: Crashed C drive, but DB on D drive
    ... Can you tell the location of system databases MDF ... SQL server up with all the configurations and data same as old. ... Copy all the MDF and LDF files to the same directory stucture as before ... Restore the master database ...
    (microsoft.public.sqlserver.server)