Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Jonathan Bessell
Starting Member
4 Posts |
Posted - 2005-06-23 : 08:36:13
|
| I've got a database with a very large current activity log. Too large to open and read actually. Can I force the system to start writing to a new log? Is there a parameter I can set to control the size of the activity logs to prevent this from happening?Thanks in advance. |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2005-06-23 : 08:56:25
|
| I assume by current activity log u mean the error log. you can truncate the error log by running dbcc errorlog or sp_cycle_errorlog.by default sql server keeps seven copies of error logs, u can change/increase the number by adding this entry into your server's registry. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\NumErrorLogsOnce this key is added, you will need to enter a REG_DWORD value representing the number of error logs you to retain.He is a fool for five minutes who asks , but who does not ask remains a fool for life!http://www.sqldude.4t.comhttp://www.sqljunkies.com/weblog/sqldude |
 |
|
|
Jonathan Bessell
Starting Member
4 Posts |
Posted - 2005-06-23 : 09:00:17
|
| Thanks! The log cycled with the command and I can now read the current error log. I understand about controlling the number of error logs, but can a limit be set on the size of the error log? |
 |
|
|
drtherc
Starting Member
19 Posts |
Posted - 2005-06-23 : 10:59:52
|
| I run the sp_cycle_errorlog weekly as a job to keep the size small, but you could do it monthly if necessary.David |
 |
|
|
Jonathan Bessell
Starting Member
4 Posts |
Posted - 2005-06-23 : 11:03:44
|
| So there is no parameter to control the size of the current error log?Cycling is the only way to ensure it doesn't grow too large? |
 |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2005-06-23 : 11:09:27
|
| i think cycling is the only way to control the size of the error logs.He is a fool for five minutes who asks , but who does not ask remains a fool for life!http://www.sqldude.4t.comhttp://www.sqljunkies.com/weblog/sqldude |
 |
|
|
drtherc
Starting Member
19 Posts |
Posted - 2005-06-23 : 11:12:42
|
| I think so, too.David |
 |
|
|
Jonathan Bessell
Starting Member
4 Posts |
Posted - 2005-06-23 : 11:19:04
|
| Okay, thank you very much for your help. I may have to see if I can schedule a job to run the cycle command on a regular basis. |
 |
|
|
|
|
|