Monday, February 20, 2012

reduce num of transaction files

I have two transaction log files and I want to reduce it to one. How do I de
lete one and make sure I'm not losing any information? Can I just back up th
e transaction logs, then delete the 2nd file and it will continue logging tr
ansactions to the remaining
file?
Thanks!Hi,
It is not possible to migrate the transaction log data from one log file to
another to delete a transaction log file.
To purge the transactions from a transaction log file, the transaction log
must be truncated (Backup log <dbname> with truncate_only) or
backed up (Backup log <dbname> to disk='c:\backup\dbanme.trn).
Once the transaction log file no longer contains any active or inactive
transactions, the Empty log file can be removed from the database.
Steps to remove the Empty Log file:
backup log <dbname> to disk='c:\backup\dbname.trn'
go
use <dbname>
go
dbcc shrinkfile('logical_log_filename_to_dele
te','emptyfile')
go
alter database <dbname> remove file 'logical_log_file_name_to_delete'
Thanks
Hari
MCDBA
"holly" <anonymous@.discussions.microsoft.com> wrote in message
news:1ABE2C6B-C01F-4D16-A689-E61E1A2E68C6@.microsoft.com...
> I have two transaction log files and I want to reduce it to one. How do I
delete one and make sure I'm not losing any information? Can I just back up
the transaction logs, then delete the 2nd file and it will continue logging
transactions to the remaining file?
> Thanks!

No comments:

Post a Comment