disable logs sql 2000

Posted on 2007-04-05
Last Modified: 2008-02-01
We are having drive issues and we need to disable log file.  What script do I need to use to do this?  we are only going to keep the mdf file until we get better hardware
Question by:yanci1179
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

DocGyver earned 400 total points
ID: 18860616
Well you can't drop your logs but you can switch to Simple recovery model and do regular backups or Full Recovery and do regular Transaction log backups followed by a shrink file.

The latter is most likely the easiest.

Go to Enterprise Manager and right click on the database and select properties.  In that dialog go to the options tab and choose Full recovery model if it isn't already selected.

Then setup a job that runs periodically (every half hour or so I'd guess) that does:

It won't get rid of the log but it will keep it small.

Of course I among others will tell you this can put you in a tenous situation with respect to recovery.  Be sure you are doing good backups.


Expert Comment

ID: 18860670
Oops.  Forgot to include the shrinkfile.  While you are in the properties look at the Transaction Log tab and wee what the "File Name" is for your transaction log.  It is usually something like 'yourDatabase_LOG'.  Add to the job you created above:

DBCC SHRINKFILE ( yourDatabase_LOG )

Author Comment

ID: 18861018
if i can't disable the .ldf file what script can i use to point it to another disk?
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

LVL 16

Assisted Solution

rboyd56 earned 100 total points
ID: 18861061
You can user Alter Database. Here is an example from books on line. This adds 2 log files.

USE master
( NAME = test1log2,
  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\test2log.ldf',
  SIZE = 5MB,
  MAXSIZE = 100MB,
( NAME = test1log3,
  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\test3log.ldf',
  SIZE = 5MB,
  MAXSIZE = 100MB,

Just change the parameters to match your situation

Author Comment

ID: 18861143
We want to put the ldf file on the same drive as the database server, are there any performance issues in doing this?

Assisted Solution

DocGyver earned 400 total points
ID: 18865512
Normally you want to have 3 (at least) physical drives involved.  The first drive for the OS, the next for data, and the last for logs.  Those drives may each or individually be made up of multiple drives if, say, they are a RAID volume.

The reason for this is that when you write data then the data goes into both the mdf file and gets logged into the ldf file.  Depending on the recovery model not all things are logged but in general you should think of both the mdf and ldf files being active at the same time. Putting the OS and applications on a third drive is to protect you from bad things happening from untrolled growth.  If the OS disk gets full then bad things happen.

So the short answer is yes there are performance issues that arise from combining any two of the three.

With that said I can tell you that if you are having terrible performance and are trying to just "get by" for a while then you might put the ldf file on the same disk as the OS but still separate from the mdf but be sure to monitor things well to make sure you are leaving a good portion of that drive empty.  When there is less than 30% or 1 gig left on the OS drive I begin to get nervous.


Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question