Sunday, March 25, 2012

Can't Shrink log File

Hi, All,
I tried to shrink a log file which was restored from production backup, but
got error. The log file is about only 10% usage according to the result of
DBCC SQLPERF ( LOGSPACE ).
When I tried this command: DBCC ShrinkFile(productionlog, 30), I got this
message:
Cannot shrink log file 2 (productionlog) because all logical log files are
in use.
DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
-- -- -- -- -- --
14 2 92888 76753 92888 76752
We do have Replication set up in Production, but I drop all replications
after restored it to Test environment. We are using SQL Server 2000.
Any help will be appreciated.
PerayuDid you backup the log first? Refer to:
http://support.microsoft.com/?id=272318
-Sue
On Thu, 8 Dec 2005 08:37:43 -0600, "Perayu"
<yu.he@.state.mn.us.Remove4Replay> wrote:
>Hi, All,
>I tried to shrink a log file which was restored from production backup, but
>got error. The log file is about only 10% usage according to the result of
>DBCC SQLPERF ( LOGSPACE ).
>When I tried this command: DBCC ShrinkFile(productionlog, 30), I got this
>message:
>Cannot shrink log file 2 (productionlog) because all logical log files are
>in use.
>DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
>-- -- -- -- -- --
>14 2 92888 76753 92888 76752
>We do have Replication set up in Production, but I drop all replications
>after restored it to Test environment. We are using SQL Server 2000.
>Any help will be appreciated.
>Perayu
>|||I did not run Backup before run ShrintFile. But we backup log file everyday.
I just want to truncate the unused portion because the SQLPERF shows there
are only 10% space are used.
Thanks for your help.
Perayu
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:0dthp1pqj5hnpejtc0gao5hr1a5rcaju27@.4ax.com...
> Did you backup the log first? Refer to:
> http://support.microsoft.com/?id=272318
> -Sue
> On Thu, 8 Dec 2005 08:37:43 -0600, "Perayu"
> <yu.he@.state.mn.us.Remove4Replay> wrote:
>>Hi, All,
>>I tried to shrink a log file which was restored from production backup,
>>but
>>got error. The log file is about only 10% usage according to the result of
>>DBCC SQLPERF ( LOGSPACE ).
>>When I tried this command: DBCC ShrinkFile(productionlog, 30), I got this
>>message:
>>Cannot shrink log file 2 (productionlog) because all logical log files are
>>in use.
>>DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
>>-- -- -- -- -- --
>>14 2 92888 76753 92888 76752
>>We do have Replication set up in Production, but I drop all replications
>>after restored it to Test environment. We are using SQL Server 2000.
>>Any help will be appreciated.
>>Perayu
>|||Here's some comments on the topic: http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Perayu" <yu.he@.state.mn.us.Remove4Replay> wrote in message
news:%23XBv5XM$FHA.3444@.TK2MSFTNGP10.phx.gbl...
>I did not run Backup before run ShrintFile. But we backup log file everyday. I just want to
>truncate the unused portion because the SQLPERF shows there are only 10% space are used.
> Thanks for your help.
> Perayu
> "Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> news:0dthp1pqj5hnpejtc0gao5hr1a5rcaju27@.4ax.com...
>> Did you backup the log first? Refer to:
>> http://support.microsoft.com/?id=272318
>> -Sue
>> On Thu, 8 Dec 2005 08:37:43 -0600, "Perayu"
>> <yu.he@.state.mn.us.Remove4Replay> wrote:
>>Hi, All,
>>I tried to shrink a log file which was restored from production backup, but
>>got error. The log file is about only 10% usage according to the result of
>>DBCC SQLPERF ( LOGSPACE ).
>>When I tried this command: DBCC ShrinkFile(productionlog, 30), I got this
>>message:
>>Cannot shrink log file 2 (productionlog) because all logical log files are
>>in use.
>>DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
>>-- -- -- -- -- --
>>14 2 92888 76753 92888 76752
>>We do have Replication set up in Production, but I drop all replications
>>after restored it to Test environment. We are using SQL Server 2000.
>>Any help will be appreciated.
>>Perayu
>>
>

No comments:

Post a Comment