|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
hi,
i have a database that has a datafile of 40+GB and a log file of 51GB. i don't need the log file. i tried to do a shrinkfile command and it doesn't seem to make the file smaller. the command i'm running is: dbcc shrinkfile ('MA_Log', 1000, TRUNCATEONLY) please advise how to do this. thanks, |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Jun 16, 12:28pm, R C <R...@discussions.microsoft.com> wrote:
> hi, > i have a database that has a datafile of 40+GB and a log file of 51GB. i > don't need the log file. i tried to do a shrinkfile command and it doesn't > seem to make the file smaller. the command i'm running is: > dbcc shrinkfile ('MA_Log', 1000, TRUNCATEONLY) > > please advise how to do this. > > thanks, You probably haven't backed up the log yet. Backing up the transaction log "flushes out" all of the committed transactions, freeing up space in the log file, which DBCC SHRINKFILE will then remove. If you TRULY don't need (think hard about this) the recovery capabilities that the transaction log provides, you can put the DB into simple mode. This will automagically flush out the committed transactions - it does NOT disable or turn off the log file, that's not possible. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Also, do a DBCC OPENTRAN inside that database to see if there is any
long-running open tran preventing you from reclaiming the log space. Linchi "R C" wrote: > hi, > i have a database that has a datafile of 40+GB and a log file of 51GB. i > don't need the log file. i tried to do a shrinkfile command and it doesn't > seem to make the file smaller. the command i'm running is: > dbcc shrinkfile ('MA_Log', 1000, TRUNCATEONLY) > > please advise how to do this. > > thanks, |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
In addition to the other posts: Some detail on file shrinking:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "R C" <RC@discussions.microsoft.com> wrote in message news:A4420B07-4925-4033-B6D4-E2F8520A8012@microsoft.com... > hi, > i have a database that has a datafile of 40+GB and a log file of 51GB. i > don't need the log file. i tried to do a shrinkfile command and it doesn't > seem to make the file smaller. the command i'm running is: > dbcc shrinkfile ('MA_Log', 1000, TRUNCATEONLY) > > please advise how to do this. > > thanks, |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Rc
If you don't need the transaction to be recorded, why not set database recovery option to simple mode. the problem with simple mode is, if you need to recover your database at any point you may not be able to do it. More over the your transaction log file size is 11gb more than the datafile size, which is not good, also this telle me that you never taken a trnsaction log backup of the database. what i would do is, take trnsaction log back, and then shrink the transaction log file, vinu "R C" <RC@discussions.microsoft.com> wrote in message news:A4420B07-4925-4033-B6D4-E2F8520A8012@microsoft.com... > hi, > i have a database that has a datafile of 40+GB and a log file of 51GB. i > don't need the log file. i tried to do a shrinkfile command and it > doesn't > seem to make the file smaller. the command i'm running is: > dbcc shrinkfile ('MA_Log', 1000, TRUNCATEONLY) > > please advise how to do this. > > thanks, |
|
![]() |
| Outils de la discussion | |
|
|