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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Check log file size by code

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-07-04 : 14:33:59
How to code to check database log file size for remote SQL server?
I can not see the log file.

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-07-04 : 23:14:02
You should be able to query the sysfiles system table. Check out Books Online for more info on sysfiles.

HTH,

Tim
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-07-05 : 02:59:38
sp_helpdb <db_name>

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-07-05 : 03:02:34
use <db_name>
GO

sp_helpfile <log_file_name>


------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-07-05 : 06:28:08
Thank you.
I used sp_helpdb, it works great.
I found that a remote server data and log file's size as bellow:
149,099,328 KB, 142,597,184 KB. Log file is very closed to data file.
What I shoul do?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-05 : 06:45:45
Unless you're out of disk space, nothing. Log file size has nothing to do with data file size.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-07-05 : 07:01:22
Does big log file affect performance?
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-07-05 : 09:27:43
>> Does big log file affect performance?
I think it affects!
If you have a daily full backup of db and if you are okay with one day data loss, you can go for RECOVERY TYPE, SIMPLE!


------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

funk.phenomena
Posting Yak Master

121 Posts

Posted - 2011-12-06 : 11:55:30
Databases with massive log files take longer to re-attach/backup.
Go to Top of Page
   

- Advertisement -