Shrink LDF SQL Server 7

Feb 7, 2007

How to shrink LDF in SQL Server 7 ?

We are using SQL Server 7 under Windows 2000 Advance Server with current Service Pack.

View 3 Replies


ADVERTISEMENT

How To Shrink A Tranlog Which Won't Shrink

Jan 5, 2007

If you have problems shrinking a transaction log no matter what commands you issue, here's a way to shrink the tranlog:

1. Right click on the properties of the database and go to the options tab.
2. Change the recovery mode to simple.
3. Right click again on the database - go to all tasks - shrink database.
4. Shrink the database.
5. Change the recovery mode back to what you had it as.

I found this out by trial and error as I could not find any documentation on it and no matter what I tried, I could not get the transaction log to shrink.

View 4 Replies View Related

SQL Server 7 Transaction Log - Can't Shrink!

Jun 10, 1999

For some reason (I'm sure it was my code) my transaction log segments grew to a huge size (>1 GB each). They are normally in the area of 150 MB each, so I wanted to shrink them back down. But I have one transaction log segment that won't shrink! I'm a relatively new administrator, but I've tried shrinking the database (which worked for all but one segment) and truncating the logs, I've tried issuing a CHECKPOINT, I've tried stopping and restarting SQL Server, but I can't get that last segment to shrink to a normal size. Any ideas?

Thanks,

Robin

View 2 Replies View Related

How To Shrink SQL Server Database

Jul 4, 2007

First of all thanks for taking interest in this thread.

I have database in Microsoft SQL Server and its size is appx. 427 GB. It consists of data from 2006. Everyday I expire data of 2-3 days and then try to shrink database as much as possible.

But it frees only 2-3 MB after 7-8 hours process. And in that database there some files which do not shrink even I put one of them on shrinking for whole day.

And as per company policy, I am only allowed to expire data which are 15 months older.

I am facing very much problem as my daily import and publish activity some times got failed for that reason.

If anyone knows the solution please tell me the solution.

View 14 Replies View Related

SQL Server 2000 Cannot Shrink LDF

Oct 26, 2007



use borden_europe
set nocount on
print @@version
select DATABASEPROPERTYEX( 'borden_europe' , 'recovery' )
select * from sysfiles
dbcc loginfo ('borden_europe')
dbcc opentran ( Borden_Europe )
backup log Borden_Europe with truncate_only
DBCC SHRINKFILE(borden_europe_log, 1)
dbcc loginfo ('borden_europe')

Yields this output:

Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: )

---------------------------------------------------------------------------------------------------
SIMPLE
fileid groupid size maxsize growth status perf name filename
------ ------- ----------- ----------- ----------- ----------- ----------- ------------------------
1 1 204336 -1 20 1081346 0 Borden_EUROPE e:Program FilesMicrosoft SQL ServerMSSQLdataBorden_Europe.mdf
2 0 7889 -1 20 1081410 0 Borden_EUROPE_log d:program filesMicrosoft SQL ServerMSSQLlogsBorden_Europe_log.ldf
FileId FileSize StartOffset FSeqNo Status Parity CreateLSN
----------- ---------------------- ---------------------- ----------- ----------- ------ ----------
2 32309248 8192 78110 2 128 0
2 32309248 32317440 78109 0 128 0
(2 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
No active open transactions.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Cannot shrink log file 2 (Borden_EUROPE_log) because total number of logical log files cannot be fewer than 2.
DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
------ ------ ----------- ----------- ----------- --------------
5 2 7889 7889 7888 7888
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
FileId FileSize StartOffset FSeqNo Status Parity CreateLSN
----------- ---------------------- ---------------------- ----------- ----------- ------ ---------------------------
2 32309248 8192 78112 2 64 0
2 32309248 32317440 78111 0 64 0
(2 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

View 3 Replies View Related

SQL Server 2008 :: DB Log Shrink Job Failure - No Often But Once In A While

Jun 19, 2015

I wrote a custom procedure to shrink the db log files alone. It works well always but yesterday in one of the server the job execution was failed.

Error msg:

: The log for database 'ReportServer$DB' failed to grow while shrink in progress. Please retry. [SQLSTATE 42000] (Error 50000) Error 9020, Severity 16, State 2,

The code is v simple. It just shrinks the db log files of all user dbs.

I also checked and confirm you that against all dbs the auto-shrink feature is disabled.

View 1 Replies View Related

SQL Server 2008 :: Shrink System Databases

Apr 28, 2015

I have some questions :

1.Is it OK to shrink Master, model ? the transaction log for those databases are full .
2.Is it OK to set the Recovery model of Database MODEL as SIMPLE ? at the moment it is in FULL recovery model and the transaction log is Full too

View 1 Replies View Related

SQL Server Admin 2014 :: Shrink Log Files In AlwaysOn

Oct 12, 2015

how to shrink log files in SQL 2014 alwaysOn ?

View 1 Replies View Related

SQL Server 2008 :: Unable To Shrink Transaction Log - Could Not Locate Files

Jan 10, 2012

I am trying to reorganise the log files on a server, (long story short they are fragmented so I want to shrink and reset the initial size and growth) and I am unable to shrink them. When I run the following:

use test
DBCC SHRINKFILE(test_log, TRUNCATEONLY)
--or
use
DBCC SHRINKFILE(test_log,2, TRUNCATEONLY)

I get the following message:

Msg 8985, Level 16, State 1, Line 1

Could not locate file 'test_log' for database 'test' in sys.database_files. The file either does not exist, or was dropped.

I get this message for every database on the server. I got the logical name of the file using sp_helpfile and have checked it against sys.masterfiles, sys.database_files and sys.sysaltfiles, all match up and confirm the name 'test_log'.

I rebooted the server last night and was able to shrink the first couple of .ldf's I tried so I presumed it was fixed. This morning when I try again i get the sanme error, I don't see anything in the SQL server or system logs that indicates a change.

I am able to add new log files and remove log files, however if I add a new log file (test_log2) and then try and truncate that file I get the same error.

View 9 Replies View Related

SQL Server Admin 2014 :: What Happens If Shrink Database With Truncate Only And Take A Backup

Apr 30, 2015

I would like to know what happens if i shrink the database with truncate only option and do a full backup or transaction log backup ? are the full backup or transaction log backup valid? I know that the performance of the database is bad if i shrink the database. What happens to full backup or transaction log backups?

View 9 Replies View Related

Transaction Log Does Not Truncate And Shrink Using A SQL Server 2005 Maintenance Plan

May 15, 2006

We are using SQL Server 2005 (SP1). I have created a maintenance plan that backs up up the datebase every night. The problem is that the transaction log is continuing to grow. I have been told that a full backup will automatically truncate and shrink the transaction log. However, this is not happening. How can I truncate and shrink the transaction log after a full backup as part of our maintenance plan. Thank you.

View 29 Replies View Related

SQL Server Admin 2014 :: Unable To Shrink Log On Simple Recovery Mode Database

Jul 27, 2015

I have a database that I am trying to recover space from, it consists mostly of unallocated space, but I can’t seem to get that unused space released.

Database size: 40,245.13 MB
DatafileMB: 38,063.63, DataAvailableMB: 37,085.15
LogfileMB: 2181.51

Sysfiles shows:
fileidgroupidsizemaxsizegrowthstatusperfname
114872144-112820SomeDB
202792332684354561010486420SomeDB_log

The DB is in simple recovery mode. There are no open transactions (used dbcc opentran).

The server is running SQL Server 2014 and the DB is in compatibility mode SQL Server 2008 (100). It was upgraded to 2014 a month or two ago.

I have tried to re-size the log to 100mb, but any way I have tried (none gave errors), the log file remains the same size. I have tied to shrink the log file (through the UI and via DBCC commands) without success; no errors, but also no change in file size.

I have checked Log Reuse Waits, just in case, and as expected it showed “NOTHING” (select log_reuse_wait_desc, name from sys.databases)

I tried running a checkpoint, but that did not allow any resize or shrink to work.

I have tied creating large transactions to move the used point in the log file, in case this was the issue. I did this by creating tables that I drop after large inserts. While it shows me that the log space % used increased, the log file still does not allow the space to be reduced.

The following is what I was using for the transactions to get the log used.

BEGIN TRAN
select a.* into testtable from sysobjects a, sysobjects b, sysobjects c
ROLLBACK TRAN

Each insert creates 93,576,664 rows.

Running dbcc SQLPerf(logspace) :
DBLogSize(MB)LogSpaceUsed(%)Status
SomeDB2181.534.204890

Running dbcc loginfo:
RecoveryUnitIdFileIdFileSizeStartOffsetFSeqNoStatusParityCreateLSN
0211437342728192602640
02114373427211437424645701280

Do I just need to continue running large transactions until the log space used gets high enough to get the “end point” in the log to really move? Is there an easier way to accomplish this (I have several DBs that have the almost identical problem), what I am using moves the Log Space Percent Used about a percent on each execution.

View 9 Replies View Related

Shrink DB

Jun 6, 2002

I have a SQL 7.0 sp3 server and I am trying to shrink a production database for use on other servers. The database/log sizes are 9601mb / 138mb with 772mb / 128mb free. I truncate a table that contains binary data. After this the database/log sizes are 9601mb / 138mb with 6634mb / 111mb free. The next step is to use EM to issue a shrink db. After this the database/log sizes are 6807mb / 378mb with 9.56mb / 365mb free.

After the use of truncate the the data in the datafile is about 2967mb.
After the shrink db the data in the datafile is about 6797mb.

The size of the data grew after the shrink db was issued. I looked at the tables and the space is largely associated with two tables that have a binary field, but the number or rows are still the same. I ran a checkdb just to make sure that there was not a problem and no problems were reported. I have used this process many times and this is the first time I have come up with these results. Any suggestions?
Thanks,
Glen

View 2 Replies View Related

Shrink Db

Aug 17, 2001

if I shrink the db will it enable me to create another db with that space released by the first db?

View 1 Replies View Related

How Can I Shrink My Log?

Jul 19, 2000

How can i shrink my log file? It is like 900 megs and i
was it to be more like 400 megs.

Please Help

Melissa Sener
Project Manager
Square Yard

View 5 Replies View Related

Log Not Shrink

Sep 27, 2002

Hi, My name is Alexander and cames to ask about Sql Server log.
Do you know why sometimes the log not truncate? All time
comes increasing!

I setup "Automatic Shrink" and it swims happens. If you can help me!
Thanks in advanced

View 3 Replies View Related

Shrink Db

Jun 30, 1999

Hi everybody:

Actually I have a 8.5 Gb database but the correct size that I need
to due disk space is 5 Gb. When I make a backup, the size of the dump is
4Gb, so I wonder if I create a 4- 4.5Gb my dump db will fit in it, but
not. Other way is create antoher db with 4 - 4.5 Gb and transfer via
sql-transfer or sql-bcp but I got a message that my device is too
short.

So I ask : What are the correct ways to reduce the size of a
database ?


Thanks in advance.

View 1 Replies View Related

Why Is SQL DB So Big? Can I Shrink?

Jun 16, 2004

Hello,

We just migrated our DB from one SQL Server to Another. Both DB's used to be the same size at 11GB. The new SQL Server is a whopping 33GB, and I can't seem to find out why. The new DM has fewer tables (the data is identical).

Does anyone know how I can compact or shrink my DB, know why or how it grew so much and didn't go back down to normal size, and maybe where I can search properties or change settings to find out what is going on and prevent it from happening again.

I know MS Access has a shrink utility, but don't know where it is in SQL Server.

Thanks, in advance for your help.

Rodney

View 12 Replies View Related

Shrink Db

Jul 26, 2004

Hello,
I have a 24go sqlserver 2000 database, but only 5go used, when i use the shrink command in em there is no change.

can i modify the property of the db (auto-shrink => on ) actually it's on OFF.

View 6 Replies View Related

To Shrink Or Not To Shrink ??

Nov 27, 2006

Newbie question about reclaiming some disk space on our SQL server.

We currently have a db that has the following stats:

space allocated: 34734 MB
space free: 843.66

of this the current size of .mdf is 33877 MB and the space used is 33873 MB

the drive that holds this database is running out of space, what is the best method for me to use to reclaim some disk space?

I have read books online and am a little bit confused as to whether or not using shrinkfile on the .mdf will free up space to the OS? Do I need to do anything else before or after such as reindex? Also what is the overhead as we only have about 10% free on the drive.

View 4 Replies View Related

Shrink An LDF

May 22, 2006

I am trying to shrink a log file (.LDF), but it will not work. I am typing:
BACKUP LOG "Database1" WITH TRUNCATE_ONLY
dbcc shrinkfile ("Database1_log", 50)
The microsoft site says this should work:
http://support.microsoft.com/kb/272318/
...but I can't get the file to shrink, at all? I'm sure the SQL services need to be running. I am logged in as my Administrator / sa. What could I be missing? Trying to shrink it too much? (THANKS).

View 3 Replies View Related

Why Is Database Still Big After Shrink?

Jul 26, 2000

A few of the databases I have are take up a lot of space, but when I look at the actual space that's being used, it's very small. I've tried shrinking them but they still remain at this bloated size. Is there any other way to reduce their size?

View 3 Replies View Related

Auto Shrink Db

Oct 24, 2001

what's this : "auto shrink " db option in properties ???

in which case may i use this option ?
please help

View 3 Replies View Related

10GB Log Won't Shrink

Sep 18, 2000

Txn log is nearly 10GB with only 60MB actually used. Disk has 150MB remaining. SQL 7.0 SP2.
I've truncated the log several times. I'm aware that the active portion of the log can be at the end and have added many records to cycle the active portion round to the start of the log file. How big are these log segments?

I've run dbcc shrinkfile with and without a target size.

I've checked DBCC OPENTRAN. No open txns exist.

What else can I try? I've looked through similar postings and haven't spotted anything.

Yours hopefully,

Simon

View 2 Replies View Related

Shrink File

Mar 27, 2000

I am looking for the correct procedure for shrinking a database file ,
please reply back if anybody knows the solution
Thanks
Ajay

View 1 Replies View Related

Shrink Transaction Log

Jan 18, 2001

Is it possible to shrink Transaction Log file? If yes, how? Urgent matter please.

Regards,

View 1 Replies View Related

How To Shrink A Log File?

Oct 20, 1999

On a database with a log file that has an unrestricted file growth, the file size exceeds 1 GB. Since this excessive was caused by a badly written update statement, I want to reduce the size to about 200MB.
After reading the BOL I was convinced that I only need to take two actions: truncate the log file (to create some free space in the log file)and shrink it.
These are the statements I executed:

backup log ODS with truncate_only
dbcc shrinkfile (ODS_Log, truncateonly)

After I executed these statements - BTW, there were no errors - the file size was still the same. Can somebody tell me why?

Thanks,
Stef

View 1 Replies View Related

Shrink Error Log

Feb 17, 2000

Is there a way to shrink the error log in SQL 6.5 without stoping the server?

View 1 Replies View Related

My SQL 7 Log File Won't Shrink

Aug 27, 1999

Hi,

I have created a new database in SQL Server 7 with the auto grow options set to on. I then added a whole load of new data to the table which made the transaction log file grow to 20Mb.

I then truncated the transaction log to remove all the completed transactions. The Enterprise Manager now shows the Log to only have 3MB of data in it but the file is still 20MB.

I have tried setting the truncate log on checkpoint option, and tried running DBCC SHRINK DATABASE and DBCC SHRINK FILE commands but these seem to have no affect on the file size.

Does anyone have any idea what I might have missed/done wrong?

Yours well and truly stuck,

Martin

View 2 Replies View Related

Shrink Logfile ?

Jun 9, 2000

How do I shrink my transaction log file ? The physical file are 10Gb in size but only contains 100Mb data so I want to shrink it to save diskspace. I tried DBCC SHRINKFILE command but the file dont shrink.

Any other methods to shrink a transaction log file ? Like backup/restore ?

Help !




Thanks

View 2 Replies View Related

Shrink SQL 6.5 Transaction Log

Mar 7, 2001

Is it possible to shrink the size of a transaction log file in SQL 6.5. Normally in SQL 7.0 I use detach and reattach but this is not supported in 6.5. The log file for a 200Mb database is 749Mb with no unused space and no open transaction. Thanks

View 2 Replies View Related

Cannot Shrink Transaction Log

Sep 25, 2002

Hi,

I have a t-log on one database which is 400mb when the database size is only 30mb. dbcc shrinkfile does not work and dbcc opentran shows no open transactions. When I tried to do a Backup log with truncate_only the following message displays:

The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.

The database in question is not a publisher and only receives 5 subscribed articles, none of which are changed very often. The database operates 24 x 7.

Does anyone have a solution to this dilemma?

Thank You

View 4 Replies View Related

SHRINK Database

Nov 9, 1999

I am in the process of copying database from large size to smaller size one. The actual data in the database is very less.
When I try to shrink the database, I am getting message I can't shrink the database.

Can any one suggest on 'How to copy this database?'

Thank you,

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved