Tuesday, February 14, 2012

cut the size of the log

I use this command but it doesnot work
cannot cut the size of the log to 2MB
DBCC SHRINKFILE(ABC_log,2)
what is the correct command actually pls?
actually i want to cut the size
because it is testing environment
"izumi" <test@.test.com> wrote in message
news:%23VPGv%23KXEHA.2408@.tk2msftngp13.phx.gbl...
> I use this command but it doesnot work
> cannot cut the size of the log to 2MB
> DBCC SHRINKFILE(ABC_log,2)
> what is the correct command actually pls?
>
|||If you are using a FULL or BULK LOGGED recovery model (SELECT
SERVERPROPERTYEX ('<db name>', 'RECOVERY), you can't shrink the log file
unless you backup the transaction log or truncate it. If you are using the
SIMPLE recovery model, you can't shrink it much if there are open
transactions that happen to occupy the end of the file.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Try MiniSQLBackup
"izumi" <test@.test.com> wrote in message
news:%23VPGv%23KXEHA.2408@.tk2msftngp13.phx.gbl...
> I use this command but it doesnot work
> cannot cut the size of the log to 2MB
> DBCC SHRINKFILE(ABC_log,2)
> what is the correct command actually pls?
>
|||http://www.nigelrivett.net/Transacti...leGrows_1.html
"izumi" wrote:

> actually i want to cut the size
> because it is testing environment
> "izumi" <test@.test.com> wrote in message
> news:%23VPGv%23KXEHA.2408@.tk2msftngp13.phx.gbl...
>
>
|||finnaly I offline the database
go to physical path and delete the abc_log
then get back much more disk space
"Peter Yeoh" <nospam@.nospam.com> wrote in message
news:%23IsFtKMXEHA.3988@.tk2msftngp13.phx.gbl...
> If you are using a FULL or BULK LOGGED recovery model (SELECT
> SERVERPROPERTYEX ('<db name>', 'RECOVERY), you can't shrink the log file
> unless you backup the transaction log or truncate it. If you are using
the
> SIMPLE recovery model, you can't shrink it much if there are open
> transactions that happen to occupy the end of the file.
> Peter Yeoh
> http://www.yohz.com
> Need smaller SQL2K backup files? Try MiniSQLBackup
>
> "izumi" <test@.test.com> wrote in message
> news:%23VPGv%23KXEHA.2408@.tk2msftngp13.phx.gbl...
>
|||I hope you did a backup before. This is not a safe operation, and you should consider yourself lucky
if the database isn't corrupt after the operation.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"izumi" <test@.test.com> wrote in message news:e2z8mbMXEHA.644@.tk2msftngp13.phx.gbl...
> finnaly I offline the database
> go to physical path and delete the abc_log
> then get back much more disk space
> "Peter Yeoh" <nospam@.nospam.com> wrote in message
> news:%23IsFtKMXEHA.3988@.tk2msftngp13.phx.gbl...
> the
>
|||Yes i agree your point....
But this time it is testing environment...
so it is ok
next time, if it is live, i will backup
Thanks d><b
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:e9I4kyNXEHA.2940@.TK2MSFTNGP09.phx.gbl...
> I hope you did a backup before. This is not a safe operation, and you
should consider yourself lucky
> if the database isn't corrupt after the operation.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "izumi" <test@.test.com> wrote in message
news:e2z8mbMXEHA.644@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
file[vbcol=seagreen]
using
>
|||Hi Izumi
What does 'does not work' mean? Do you get an error message? If so, what
error? Do you get any response at all? What does it say?
What version of SQL Server are you running?
Please give us more information.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"izumi" <test@.test.com> wrote in message
news:#VPGv#KXEHA.2408@.tk2msftngp13.phx.gbl...
> I use this command but it doesnot work
> cannot cut the size of the log to 2MB
> DBCC SHRINKFILE(ABC_log,2)
> what is the correct command actually pls?
>
|||I also had a hard time with this problem. If it's a testing environment or you just don't care about being able to recover to a point in time, change the recovery model to Simple and then issue the following command in SQL Query Analyzer.
SHRINKFILE (logfilename_log, -1)
In the simple recovery model, a sequence of transaction logs is not being Maintained. All log records before the MinLSN can be truncated at any time, except while a BACKUP statement is being processed. The log file will shrink down to about 1mb.
"Kalen Delaney" wrote:

> Hi Izumi
> What does 'does not work' mean? Do you get an error message? If so, what
> error? Do you get any response at all? What does it say?
> What version of SQL Server are you running?
> Please give us more information.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "izumi" <test@.test.com> wrote in message
> news:#VPGv#KXEHA.2408@.tk2msftngp13.phx.gbl...
>
>
|||I also had a hard time with this problem. If it's a testing environment or you just don't care about being able to recover to a point in time, change the recovery model to Simple and then issue the following command in SQL Query Analyzer.
SHRINKFILE (logfilename_log, -1)
In the simple recovery model, a sequence of transaction logs is not being Maintained. All log records before the MinLSN can be truncated at any time, except while a BACKUP statement is being processed. The log file will shrink down to about 1mb.
"Kalen Delaney" wrote:

> Hi Izumi
> What does 'does not work' mean? Do you get an error message? If so, what
> error? Do you get any response at all? What does it say?
> What version of SQL Server are you running?
> Please give us more information.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "izumi" <test@.test.com> wrote in message
> news:#VPGv#KXEHA.2408@.tk2msftngp13.phx.gbl...
>
>

No comments:

Post a Comment