Remove extra transaction log files from sql server 2000 database
Hi Experts,
I am working with SQL server 2000 and have a database that has multiple transaction log file.
I need to remove the extra transaction log files and keep only one. Attached is the code that I am planning to execute. I am NOT A DBA but have this responsibility to perform this task.
Attached are also screenshots of maintenance plan and transaction log properties.
Please advice if the steps I am about to take are correct or not and any other steps should I be taking or not. I have seen a similar question posted on EE, but I am just nervous since this is the production server and I can not afford to loose any data.
Please advise ASAP since my transaction log is filling up the drive and I must clean up ASAP.
Thank you in advance.
1. Take a complete backup of your Database.
2. Now Delete your Existing Database.
3. Create a new database with only one Transactional Log file.
4. Now restore that backup into this new Database.
After that reconfigure your Maintenance plans and Transactional logs accordingly for the single Log file.
It should not be an issue.
Dimitris
my suggestion is this
Backup your database
Change the database recovery model to simple (properties menu)
Delete from the properties menu again on the transaction log tab the second file
change you database recovery model back to full
that's all
RekhaShah
ASKER
So I don't have to shrink the logfile? or execute any of the sql commands I mentioned above?
If you have a full backup of your database then there is no need to try to shrink it.
Also by changing the recovery model to simple will do an auto-truncate to the transaction log.
If you perform the actions I describe above from the GUI then there is no need to execute any SQL statement.
Raja Jegan R
Dont ever plan to shrink a log file which will remove all the index statistics and file allocation was affected.
Instead go for periodical Transactional Log backup which will reduce your Log File Size along with maintaining your indexes and file system managed properly.
RekhaShah
ASKER
Now i am really confused. What are my steps? can some one guide my step by step thru this process please.
All i want to do is remove extra log files and keep only one.
I was able to delete the extra log files with this solution.
RekhaShah
ASKER
I still have two log files. When i tried to delete the log file in directory E;\Microsoft swl server\MSSQL\Data\mydb.ldf, sql server did not let me delete. It gave me a message saying 'primary log file can not be deleted'. But this file is only 47 mb, i don't mind having it around, Ideally, I wouldl ike to have only one which should be on D drive.
1. Take a complete backup of your Database.
2. Now Delete your Existing Database.
3. Create a new database with only one Transactional Log file.
4. Now restore that backup into this new Database.
After that reconfigure your Maintenance plans and Transactional logs accordingly for the single Log file.
It should not be an issue.