Hi Cenk Ince,

If your log file is not being used to trace any transaction into database, then you may use backup with truncate using the command backup log and then shrink the log file using dbcc shrink file command.
The following script is to truncate all databases' log file. You can put the script in the job, but run it in cautious that you don't use the log file to trace any transaction or anything.

use [master]
declare cur cursor for
select name from sysdatabases
declare @dbname varchar(100)
open cur
fetch cur into @dbname
while @@fetch_status = 0
begin
exec ('use [' + @dbname + ']')
exec ('backup log [' + @dbname + '] with truncate_only')
exec ('dbcc shrinkfile (2,1,truncateonly)')
fetch cur into @dbname
end
close cur
deallocate cur


Cheers,

Sonny Wibawa Adi


Cenk Ince <[EMAIL PROTECTED]> wrote:
First i want to thank for all replies;

But i couldn't solve problem, when i shrink db, the physical file size
is not getting smaller. How can i get it smaller?

Thanks in advance.



Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
 
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


           
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

[Non-text portions of this message have been removed]



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to