Thursday, March 8, 2012

Bug in DBCC SHRINKDATABASE ?

Hi,
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why '''?
I do not want to have so big transaction log.BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
'''?
> I do not want to have so big transaction log.|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:

> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> '''?
>
>|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...[vbcol=seagreen]
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
>|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / fil
es
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:

> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>
>|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database[vbcol=seagreen]
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>
log[vbcol=seagreen]|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/defaul...kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/defaul...kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / f
iles
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to trunca
te
> log to 35 MB. I did all combination of options in all task / shrink databa
se
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:

> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> files
> truncate
> database
> log
>
>

No comments:

Post a Comment