Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Move Tranaction Log (ShrinkLogFile EmptyFile?)

Author  Topic 

rocksteer
Yak Posting Veteran

69 Posts

Posted - 2011-10-27 : 05:11:08
I had additional tranaction logs spanning to desired disk to allow records to be deleted from a database that filled my primary data drive. We have had problems with the additional drive (causing database to be marked suspect when it dropped out).

I intend to have it ghosted and replaced. I would then like to put the current transaction log on the new drive. The database is large (250+ GB) and exists in a workstation, rather than a true server.

The database is in simple recovery mode, so the tranaction log is small.

Could I just add an additional tranaction log on the new drive, and do a shrinkfile (empty file) on the current tranaction log, and delete it? It worked getting rid of tranaction logs on the end, don't know if it would work on the first one.

Would that work?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-10-27 : 05:26:04
Here is a step by step listing:
http://geekswithblogs.net/jpl/archive/2011/06/20/move-sql-server-transaction-log-to-another-disk.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

rocksteer
Yak Posting Veteran

69 Posts

Posted - 2011-10-27 : 06:52:35
So this is pretty safe.

In the example it shows several transaction logs.

It said copy using windows explorer, would move be ok?

Also, on the sp_attach_db...

I only have one transaction log,so

sp_attach_db 'dbname', 'mdf filename', 'ldf filename(new location)'?

Mike
Go to Top of Page

human12
Starting Member

5 Posts

Posted - 2011-10-27 : 07:24:41
Are you using SQL 2000 or later versions?


Tarek Omar
Technical Manager and Database Administrator
http://intosql.blogspot.com
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-10-27 : 07:26:08
quote:
Originally posted by rocksteer

So this is pretty safe.

In the example it shows several transaction logs.

It said copy using windows explorer, would move be ok?
Yes

Also, on the sp_attach_db...

I only have one transaction log,so

sp_attach_db 'dbname', 'mdf filename', 'ldf filename(new location)'?
Yes
Mike




No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

rocksteer
Yak Posting Veteran

69 Posts

Posted - 2011-10-27 : 07:43:27
Yes, SQL Server 2000
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-10-27 : 10:44:10
Be sure to stop the sql service before you detach.

PBUH

Go to Top of Page

rocksteer
Yak Posting Veteran

69 Posts

Posted - 2011-10-27 : 10:49:30
If I stop sql server, will I be able to detach?

I thought SQL Server had to be up to use Query Analyzer.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-10-27 : 11:19:52
No sorry what I wanted to say was put the sql service in a single user mode.Not sure why did I suggest to stop the service...

PBUH

Go to Top of Page
   

- Advertisement -