Showing posts with label shrinking. Show all posts
Showing posts with label shrinking. Show all posts

Friday, February 24, 2012

cannot shrink transaction log

I have problems with shrinking the transaction log. I have first backup the
transactionlog and then I try to shrink de transaction log with the shrink
file command but the log wil not shrink. When I use the DBCC loginfo I see
that the status is 2 for the VLF's and they never change to 0.
How can I shrink my transaction log file.A quick way to achieve this is by:
1)Backup your db
2)Detach db
3)rename the relevant log file
4)Attach db - the reattach will automatically create a new log file
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"cas" <cas@.discussions.microsoft.com> wrote in message
news:62EB1A28-DC4C-4A6D-A5DB-D293B8B00E0C@.microsoft.com...

> I have problems with shrinking the transaction log. I have first backup
the
> transactionlog and then I try to shrink de transaction log with the shrink
> file command but the log wil not shrink. When I use the DBCC loginfo I see
> that the status is 2 for the VLF's and they never change to 0.
> How can I shrink my transaction log file.|||After taking the backup make sure there is no open transaction run DBCC
OpenTran to get the open transaction.
"Jack Vamvas" wrote:

> A quick way to achieve this is by:
> 1)Backup your db
> 2)Detach db
> 3)rename the relevant log file
> 4)Attach db - the reattach will automatically create a new log file
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "cas" <cas@.discussions.microsoft.com> wrote in message
> news:62EB1A28-DC4C-4A6D-A5DB-D293B8B00E0C@.microsoft.com...
>
> the
>
>

cannot shrink transaction log

I have problems with shrinking the transaction log. I have first backup the
transactionlog and then I try to shrink de transaction log with the shrink
file command but the log wil not shrink. When I use the DBCC loginfo I see
that the status is 2 for the VLF's and they never change to 0.
How can I shrink my transaction log file.A quick way to achieve this is by:
1)Backup your db
2)Detach db
3)rename the relevant log file
4)Attach db - the reattach will automatically create a new log file
--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"cas" <cas@.discussions.microsoft.com> wrote in message
news:62EB1A28-DC4C-4A6D-A5DB-D293B8B00E0C@.microsoft.com...
> I have problems with shrinking the transaction log. I have first backup
the
> transactionlog and then I try to shrink de transaction log with the shrink
> file command but the log wil not shrink. When I use the DBCC loginfo I see
> that the status is 2 for the VLF's and they never change to 0.
> How can I shrink my transaction log file.|||After taking the backup make sure there is no open transaction run DBCC
OpenTran to get the open transaction.
"Jack Vamvas" wrote:
> A quick way to achieve this is by:
> 1)Backup your db
> 2)Detach db
> 3)rename the relevant log file
> 4)Attach db - the reattach will automatically create a new log file
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "cas" <cas@.discussions.microsoft.com> wrote in message
> news:62EB1A28-DC4C-4A6D-A5DB-D293B8B00E0C@.microsoft.com...
> > I have problems with shrinking the transaction log. I have first backup
> the
> > transactionlog and then I try to shrink de transaction log with the shrink
> > file command but the log wil not shrink. When I use the DBCC loginfo I see
> > that the status is 2 for the VLF's and they never change to 0.
> > How can I shrink my transaction log file.
>
>

Cannot shrink log file more than 2GB in small database

Hi2all,
I have some trouble with shrinking log file. No more user is connected
on this database. According to dbcc loginfo command log file is just
made up with active log. Here is the result
FileId_FileSize_____ StartOffset FSeqNo Status
Parity CreateLSN
2 1186201600 8192 15 2 128 0
2 1186201600 1186209792 16
2 64 0
I don't know why it remains so much space in active log because no
transaction is applied.
Can someone help me ?
Mo
--
Mo
Posted via http://dbforums.comSee
http://support.microsoft.com/default.aspx?scid=kb;en-
us;272318
http://support.microsoft.com/default.aspx?scid=kb;en-
us;256650
(and the references at the botom)
Do you have the database in full recovery mode and are you
taking log backups
If yes and no then set it to simple and read about backup
strategies in bol.

Cannot shrink log file 2 (emptydb_Log) because all logical log files are in use.

I am getting the following error message that is
preventing me from shrinking the log file for a
database. The database was created by doing a restore
from a backup of a database named emptydb. Prior to the
backup of emptydb, its transaction log had been backed up
and truncated, then a complete database backup of emptydb
had been done using the overwrite option in Enterprise
Manager | Tools | Backup Database.
After the restore of emptydb into a new database, the new
database was loaded and a large transaction file was
created. I did a backup of the complete new database,
then a backup of the transaction log, then attempted to
shrink the new database.
Why is there still an emptydb log file in this database?
How do I get the shrinkfile or shrinkdatase to truncate
the log file?
Thanks in advance for your help.
Jim DurbinIt sounds like the database was created with a "large" log file. If the
file size was set explicitly, as opposed to growing, you will need to use
the dbcc shrinkfile command to resize it. The dbcc shrink database will
only shrink the file to it's initial size at best.
If the dbcc shrinkfile does not actually shrink the file, this basically
means that you have active transactions in the trailing virtual log files so
it can't be truncated and dropped. You can take a look at your VLF's by
issuing a dbcc loginfo command, this shows how many VLFs you have and which
one(s) are active. You may have to issue several backup log commands before
the active log circles around to some of the first VLFs and then you can
drop the trailing ones, etc...
See "Truncating the Transaction Log" and "Shrinking the Transaction Log" in
Books Online for full details.
"Jim Durbin" <anonymous@.discussions.microsoft.com> wrote in message
news:22cd01c3d160$228ae760$3101280a@.phx.gbl...
> I am getting the following error message that is
> preventing me from shrinking the log file for a
> database. The database was created by doing a restore
> from a backup of a database named emptydb. Prior to the
> backup of emptydb, its transaction log had been backed up
> and truncated, then a complete database backup of emptydb
> had been done using the overwrite option in Enterprise
> Manager | Tools | Backup Database.
> After the restore of emptydb into a new database, the new
> database was loaded and a large transaction file was
> created. I did a backup of the complete new database,
> then a backup of the transaction log, then attempted to
> shrink the new database.
> Why is there still an emptydb log file in this database?
> How do I get the shrinkfile or shrinkdatase to truncate
> the log file?
> Thanks in advance for your help.
> Jim Durbin
>