Solved

disable logs sql 2000

Posted on 2007-04-05
6
289 Views
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
0
Comment
Question by:yanci1179
  • 3
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
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:
BACKUP LOG yourDatabase WITH TRUNCATEONLY

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.

Doc..
0
 
LVL 6

Expert Comment

by:DocGyver
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 )
0
 

Author Comment

by:yanci1179
ID: 18861018
if i can't disable the .ldf file what script can i use to point it to another disk?
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 16

Assisted Solution

by:rboyd56
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
GO
ALTER DATABASE Test1
ADD LOG FILE
( NAME = test1log2,
  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\test2log.ldf',
  SIZE = 5MB,
  MAXSIZE = 100MB,
  FILEGROWTH = 5MB),
( NAME = test1log3,
  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\test3log.ldf',
  SIZE = 5MB,
  MAXSIZE = 100MB,
  FILEGROWTH = 5MB)
GO



Just change the parameters to match your situation
0
 

Author Comment

by:yanci1179
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?
0
 
LVL 6

Assisted Solution

by:DocGyver
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.

Doc..
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server 2012 VS Server 2016 for SQL Cluster 4 40
Need help on t-sql 2012 10 53
cannot connect to sqlserver 8 26
Increment column based of a FK 8 20
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.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

775 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