Results 1 to 4 of 4

Thread: How to combine log files & delete secondary

  1. #1
    Join Date
    Nov 2002
    Location
    Bellingham, WA
    Posts
    34

    How to combine log files & delete secondary

    I have a database with 2 log files VE_log and VE_log2 (the split is left from legacy system with limited disk space). I want to eliminate the 2nd log.

    I've tried SHRINKFILE (EMPTYFILE), which of course reduces the file to the default minimum pages, SHRINKFILE (TRUNCATEONLY), SHRINKDATABASE (VE), and in every case the ALTER DATABASE REMOVE FILE command fails cause the log isn't empty.

    Ideas???

    Thanks,

    Al

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Try to insert some dummy records, commit and do shrink and remove file again.

    for example

    create table a (c1 char(255))

    while 1=1
    begin
    insert into a values ('aaa')
    end

    stop after some time and do the same routine of shrink and remove, you may be successful.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    do the following

    use database
    go
    checkpoint
    go
    backup log with truncate
    go
    dbcc shrink empty
    go
    alter database and remove file

  4. #4
    Join Date
    Nov 2002
    Location
    Bellingham, WA
    Posts
    34
    Thanks MAK - that did the trick! :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •