SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBCC shrinkfile error - Msg 8985


DBCC shrinkfile error - Msg 8985

Author
Message
rubes
rubes
Old Hand
Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)

Group: General Forum Members
Points: 390 Visits: 398

Chandu and Bapi, now that you fellas have the transaction log shrunk, you may want to start asking yourselves some more questions...

  • Why was the log file so big in the first place?
  • Do I have the correct recovery model? (Full, bulk-logged, simple)
  • Are transaction log backups being taken?... how often?...

Books online should be a great resource for you on disaster recovery and transaction log management if you don't have much experience in these areas.



Regards,
Rubes
Nicholas Cain
Nicholas Cain
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7166 Visits: 6200
Bapi run

SELECT NAME, FILEID FROM SYSFILES

to get the fileID of the log file, then use that in the DBCC SHRINKFILE script



Shamless self promotion - read my blog http://sirsql.net
guzman_anthony
guzman_anthony
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 35
Hi Chandu,

How to check/know the file ID. is it the same as SPID? i do have the same error..please help.

thanks

anthony
GilaMonster
GilaMonster
SSC Guru
SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)

Group: General Forum Members
Points: 216373 Visits: 46277
Please note: 8 year old thread. Chandu has not logged in in 7 years.

Please don't post the same problem in multiple places.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


dineshvishe
dineshvishe
Mr or Mrs. 500
Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)Mr or Mrs. 500 (508 reputation)

Group: General Forum Members
Points: 508 Visits: 342
1)SELECT name, size

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');


2)Try Make database recovery mode to Simple.
3) Right Click Datbase =>Tasks =>Shrinks =>Files => Log => select shrink action => Realease unused space.
select shrink action => select in MB
4) SELECT name, size

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');
check size...
GilaMonster
GilaMonster
SSC Guru
SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)SSC Guru (216K reputation)

Group: General Forum Members
Points: 216373 Visits: 46277
Please note: 9 year old thread.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Hany Helmy
Hany Helmy
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4457 Visits: 1117
Nicholas Cain (4/14/2004)
Try shrinking it using the fileid (SELECT NAME, FILEID FROM SYSFILES), use the same syntax, just replace the filename with the fileid.

Just want 2 thank u cause that fixed my issue with 1 of the db`s although the error msg was in sys.database_files & I found some Indexes corruption, even after REPAIR_REBUILD, could not fix the shrink_log file issue till I googled it and found your solution, so thanx again.
Hany Helmy
Hany Helmy
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4457 Visits: 1117
GilaMonster (5/24/2013)
Please note: 9 year old thread.

Now it`s even 11 years old thread, but amazingly still very useful to fix the current issues, seems that MS will never ran out of bugs :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search