This is a discussion on Reducing size of .ndf file in Ms Sql 2005 within the Database Support forums, part of the Web Development category; Reducing size of .ndf file in Ms Sql 2005 I am having some space problems here, would appreciate if anyone ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Reducing size of .ndf file in Ms Sql 2005 I am having some space problems here, would appreciate if anyone can help. I have a huge table (table A) with 20 million records in filegroup FILE1 (having one .ndf file). I had to create a copy of this table (table B), move data from table A to table B and then delete Table A. After deleting Table A I see that the .ndf file size has grown to more than double its original size, and I am not able to free up space from it. dbcc shrinkfile (FILE1, truncateonly) dbcc shrinkfile (FILE1, notruncate) |
|
#2
| |||
| |||
| HI, Did you do them in that order? Did the notruncate take a long time? If so try the truncate one again. How much free space do you have in the file? |
|
#3
| |||
| |||
| Hi, no I ran it in this order 1. dbcc shrinkfile (FILE1, notruncate) (took 15 secs to run) 2. dbcc shrinkfile (FILE1, truncateonly) i tried doing 1. a couple of times and everytime it takes about 15 decs how do I find out free space in the file? |
|
#4
| |||
| |||
| Hi, Easiest way is in management studio. Right click on database, tasks, shrink, files Select the file and it will shhow the free space. Also run dbcc opentran to see if there are open transactions Also check sysprocesses to make sure the checkpoint task isn't stuck. |
|
#5
| |||
| |||
| Hi, no open transactions checkpoint task is not stuck The ID i'm using does not have access to see the files in enterprise manager...could that be a reason? |
|
#6
| |||
| |||
| Hi, >> The ID i'm using does not have access to see the files in enterprise manager...could that be a reason? It could be but I would expect an error. You will at least need to be dbo. try sp_spaceused |
|
#7
| |||
| |||
| HI, is it true that for shrinkfile to work, the table should have a clustered index? |
|
#8
| |||
| |||
| Hi, No - you're shrinking a database file not a table |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can I run all VS Pro 2003, 2005 and 2008 as clients with VS Team System 2005? | shaalini | Server Management | 1 | 05-08-2009 03:08 AM |
| How to create a Setup file in VS 2005 to start a installer from a installer file? | $enthil | C# Programming | 2 | 11-16-2007 02:10 AM |
| MSSQL Log File Is Growing Fast in MSSQL 2005 ? | bluesky | Server Management | 5 | 11-12-2007 04:12 AM |
| File Upload Size Limit | KiruthikaSambandam | ASP and ASP.NET Programming | 9 | 09-27-2007 02:16 AM |
| How to Minimize PNG file size for mobile appl..? | itbarota | Mobile Software Development | 1 | 07-21-2007 12:43 AM |
Our Partners |