Hi, i have that due a problem have 2 transaction log, i need a procedure to
delete one log and manteien the other.
Thanks
Use the Alter Database <dbname> Remove File <TransactionLogFilename> to
remove the extraneous .LDF file. Or detach your database, delete one of the
..LDF files and then re-attach your database.
Make sure to do a complete backup of your DB BEFORE using either of these
options though. That will clear out the Transaction Logs and preserve your
info in case something goes horribly wrong.
"Adrian Lambardi" wrote:
> Hi, i have that due a problem have 2 transaction log, i need a procedure to
> delete one log and manteien the other.
> Thanks
|||> Or detach your database, delete one of the
> .LDF files and then re-attach your database.
Why not use the documented and supported methods instead of deleting the log, which, as you say,
might very well destroy the database?
ALTER DATABASE ... REMOVE FILE is the supported way to remove a database file. You need to DBCC
SHRINKFILE with the EMPTYFILE option first. You also need to make sure that the file is unused, the
undocumented DBCC LOGINFO can be useful for checking (Google and you will find).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Catadmin" <Catadmin@.discussions.microsoft.com> wrote in message
news:C9D4FC72-AD23-4E6E-9916-EC09BDF7BDB8@.microsoft.com...[vbcol=seagreen]
> Use the Alter Database <dbname> Remove File <TransactionLogFilename> to
> remove the extraneous .LDF file. Or detach your database, delete one of the
> .LDF files and then re-attach your database.
> Make sure to do a complete backup of your DB BEFORE using either of these
> options though. That will clear out the Transaction Logs and preserve your
> info in case something goes horribly wrong.
>
> "Adrian Lambardi" wrote:
sql
No comments:
Post a Comment