|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 3:25 AM
Points: 1,371,
Visits: 2,302
|
|
Dear All, One of our client's server is in Germany. We have made a project for them recently. It got crashed today.When I checked I found that MDF size is hardly 256MB and LDF is 126GB (huuuge)...
How can I clear the LOG..? Wot are the things need to be done before clearing LOG...? Please guide me..Very urgent..
Thanks in advance...
Dear freind Marsh -- I expect an ealry reply from you especialy...
Santhos Nahir (India)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 1:28 PM
Points: 1,156,
Visits: 2,195
|
|
hello first dbcc loginfo and check status column may be 0 or 2 ,if 0 you can
backup log dn_name with truncate _only go dbcc shrinkfile(log_file_id or file_name,size you want to shrink) go
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367,
Visits: 1,585
|
|
And after you follow Hadrian's advice, take a full backup. Then find out if that database had any periodic full/log backups. If yes, try to find the reason for the large transaction log. If no, then set up periodic database and log backups (or if the recovery requirements permit it set it to simple recovery mode)
Regards, Andras
Andras Belokosztolszki, MCPD, PhD GoldenGate Software
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 3:25 AM
Points: 1,371,
Visits: 2,302
|
|
| Thanks a lot. will try the same...
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 3:25 AM
Points: 1,371,
Visits: 2,302
|
|
Hello,
The problem is that SSMS itself is not opening....Without query analyzer how will I fire the command..?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367,
Visits: 1,585
|
|
nairsanthu1977 (8/21/2008) Hello,
The problem is that SSMS itself is not opening....Without query analyzer how will I fire the command..?
You can use sqlcmd from command line for example. Or run SSMS on a remote computer.
Regards, Andras
Andras Belokosztolszki, MCPD, PhD GoldenGate Software
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:30 AM
Points: 37,742,
Visits: 30,021
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 2:28 AM
Points: 343,
Visits: 1,510
|
|
1 -stay calm.
2 - what is your database's recovery model? If it's simple, see 3). For full and bulk-logged, see 4).
3 - two possibilities 3a. you have an old transaction that's still active, that's preventing the log from being truncated, causing indefinite growth. Use DBCC OPENTRAN to determine if this is the case. Take steps to end that transaction (commit, rollback, kill etc). Then use DBCC SHRINKFILE to shrink the log file. May need to do it a couple of times, see here for reasons.
3b. there were large transactions that caused the transaction log to grow to such a huge size. If this is going to be common, shrinking the file may not be a good option. If not, run DBCC SHRINKFILE to shrink the log.
4. see 3a) and 3b) for possible reasons (but not the suggested resolutions), also 4a. you have not been backing up your transaction log, hence causing the transaction log to grow indefinitely.
Do you need to make a backup of the current transaction log, perhaps for log shipping purposes, or to be able to perform a point-in-time recovery (note that this would still be impossible if there are minimally logged transactions in the current transaction log)? If yes, you'll need to back it up to disk. Run a BACKUP LOG ... command, folowed by DBCC SHRINKFILE.
If not (and you're very sure of this), run a BACKUP LOG with the TRUNCATE_ONLY option, then follow the suggestions by Hadrian and Andras, especially the part on performing a full database backup.
Ray Mond
TLogInfo - the only FREE tool to analyse your transaction logs. Download here. SQL BAK Reader - the only FREE tool to inspect your SQL Server backup files without using SQL Server. Download here.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, March 12, 2013 11:24 PM
Points: 1,145,
Visits: 225
|
|
your log size is in GB while Data file size is in MB, it seems you are not taking backup of log. if log backup is not necessry for you then use command TRUNATE_ONLY and truncate the log.
hope this will work.
Manoj
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 10:07 AM
Points: 190,
Visits: 244
|
|
Just curious, not criticizing at all but...
Wouldn't a question like this be best suited for the administration forum?
I'm seeing a lot of these types of questions being posted in the performance forum.
I know we're all trying to help... Guess its just me being the picky "classification" type of anal retentive DBA again... :D
|
|
|
|