Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBCC SHRINKFILE

Status
Not open for further replies.

pavithra123

IS-IT--Management
Jun 17, 2001
54
CZ
Hi All,

I am using SQL Server version 7.

I am trying to shrink the DB and was OK with it but I was not able to shrink the transaction log . After reading previous threads about it I tried to use dbcc shrinkfile.

This is what i am doing .

use <DB>
select * from sysfiles.

Get the fileid from this and use it in

dbcc shrinkfile (<fileid>,128,truncateonly )

I did not get any errors but only a message, But when i see the size of this from the enterprise manager the size is not released to the OS.

truncateonly option says that the space will be release why is not doing so or I am doing something wrong.

Please help me with this.

Best regards
Prem.
 
Did you refresh the database info in Enterprise Manager? The display won't change unless you refresh or disconnect and reconnect. Right click the database and select Refresh.

Have you read faq183-1534 - &quot;Shrinking Databases and Logs - SQL 7 and Higher?&quot; Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
You can try to shrink the transaction log until you're blue in the face, but you won't get anywhere with SQL Server 7 unless you read this: &quot;How to Shrink the SQL Server 7.0 Transaction Log&quot; (Q256650)
Use the large section of code at the bottom of the page (unless you modify their code, you'll more than likely have to run the script several times in a row to shrink to your desired size).

-BMcG
 
Hi terry ,

I did that several times but in vain.

Hi Bmcg,

I 'll try what has been said.

Best regards
Prem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top