I have a DB in SQL Server who has very big log 60gb and I want to delete,
how can I do it that?
Thanks in advanceYou don't want to delete the log file. You can shrink it once you fix what
caused it to grow so large. Chances are you have it in FULL recovery mode
and are not doing regular log backups. These links should help.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=873235 How to stop the log file from
growing
http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
http://www.support.microsoft.com/?id=307487 Shrinking TempDB
Andrew J. Kelly SQL MVP
"Matas" <no@.hotmail.com> wrote in message
news:Ood6ms5pGHA.4812@.TK2MSFTNGP04.phx.gbl...
>I have a DB in SQL Server who has very big log 60gb and I want to delete,
>how can I do it that?
> Thanks in advance
>|||All databases have a log file which you can not delete. This log is used for
capturing all database events like insert, delete and update. It is used for
transaction rollback. Besides, when you commit a transaction, first of all,
SQL guarantees that the event logged in the transaction log, then SQL Server
refreshes the data and last, SQL frees the locked rows. So, if you dont
have a transaction log, you couldn't commit a transaction.
So, you must:
backup log periodically, because this process allows you to have a backup
and to free the log (only comitted entries)
or
set recovery model in simple for your database
I hope you can undestand me.
Maria Pia Fernandez
www.sqlgurus.org
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:uftR8G7pGHA.5116@.TK2MSFTNGP04.phx.gbl...
> You don't want to delete the log file. You can shrink it once you fix what
> caused it to grow so large. Chances are you have it in FULL recovery mode
> and are not doing regular log backups. These links should help.
>
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
> considerations
> http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
> http://www.support.microsoft.com/?id=317375 Log File Grows too big
> http://www.support.microsoft.com/?id=110139 Log file filling up
> http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
> and AutoShrink
> http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
> 2000 with DBCC SHRINKFILE
> http://www.support.microsoft.com/?id=873235 How to stop the log file
> from growing
> http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
> http://www.support.microsoft.com/?id=307487 Shrinking TempDB
> --
> Andrew J. Kelly SQL MVP
> "Matas" <no@.hotmail.com> wrote in message
> news:Ood6ms5pGHA.4812@.TK2MSFTNGP04.phx.gbl...
>|||All databases have a log file which you can not delete. This log is used for
capturing all database events like insert, delete and update. It is used for
transaction rollback. Besides, when you commit a transaction, first of all,
SQL guarantees that the event logged in the transaction log, then SQL Server
refreshes the data and last, SQL frees the locked rows. So, if you dont
have a transaction log, you couldn't commit a transaction.
So, you must:
backup log periodically, because this process allows you to have a backup
and to free the log (only comitted entries)
or
set recovery model in simple for your database
I hope you can undestand me.
Maria Pia Fernandez
www.sqlgurus.org
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:uftR8G7pGHA.5116@.TK2MSFTNGP04.phx.gbl...
> You don't want to delete the log file. You can shrink it once you fix what
> caused it to grow so large. Chances are you have it in FULL recovery mode
> and are not doing regular log backups. These links should help.
>
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
> considerations
> http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
> http://www.support.microsoft.com/?id=317375 Log File Grows too big
> http://www.support.microsoft.com/?id=110139 Log file filling up
> http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
> and AutoShrink
> http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
> 2000 with DBCC SHRINKFILE
> http://www.support.microsoft.com/?id=873235 How to stop the log file
> from growing
> http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
> http://www.support.microsoft.com/?id=307487 Shrinking TempDB
> --
> Andrew J. Kelly SQL MVP
> "Matas" <no@.hotmail.com> wrote in message
> news:Ood6ms5pGHA.4812@.TK2MSFTNGP04.phx.gbl...
>|||Matas wrote:
> I have a DB in SQL Server who has very big log 60gb and I want to delete,
> how can I do it that?
> Thanks in advance
>
After you've read the pages that Andrew linked to, and have the log file
under control, you might be interested in a backup script of mine that
will automatically handle your full backups and t-logs for every
database on your server:
http://realsqlguy.com/twiki/bin/vie...realsqlguy.com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment