how can you compact .log file ?
they can be > 20 gigas ! ...
can you delete it ?do you mean the log files that the server itself writes? Those have no file extension normally, usuall called something like ERRORLOG. when the server restarts it renames it to ERRORLOG.1 and starts a new one. I would be very surprised if you have a 20gb one though. that's pretty large. maybe you have a lot of failed login attempts (which are logged as I recall).
Or perhaps you mean a ldf file? These are transaction log files for a database - it's common for these to get large. You can shrink the size of the ldf using DBCC SHRINKFILE. You should not delete an ldf file unless you want to delete the database it's associated with.
Note that if you care about recoverability, you should be making regular backups of both your database and transaction log.|||thank you Jezemine
yes of course I mean transaction log files
DBCC SHRINKFILE ? i musyt look how to use it ? do you run it as a stored procedure ?
EXECUTE DBCC SHRINKFILE
thank you for helping|||it's not a sproc.
read about DBCC SHRINKFILE in bol.
Showing posts with label compacting. Show all posts
Showing posts with label compacting. Show all posts
Wednesday, March 7, 2012
Compacting a db via T-SQL
Hello dbForumers,
I was wondering if there is a way (MUST be) to instruct SQL server to compact a chosen database's files. I have a batch that runs every night who generate a huge amount to log lines that I get rid of with a backup log xxx with truncate_only, but still the logfile is several GB big afterwards with a lotsa empty space... I wanna get a clean small file everyday =)
Thank you!Its not ideal to shrink the Transaction log every day, rather define a set of size by testing the activity on the database.
During that batch overnight take before and after sizes for Tlog and set the higher level.
Also maintain regular backups of Tlogs which will reduce the size of logical file and helps to fillup the Tlog quickly. If RECOVERY MODEL Is set to SIMPLE then ensure full database backups are carried in regular intervals.|||try DBCC SHRINKFILE
USE UserDB
GO
DBCC SHRINKFILE (logical file name,Target_size)
GO
Target_size is how much free size is left over after you shrink
if you leave this off, you will get the default.
also
you may have to switch the VLogs internally before you can shrink to a size that you desire...
all of his should be done after a tlog backup.
look up "Shrinking the Transaction Log" AND DBCC Shrinkfile in [BOL]
I was wondering if there is a way (MUST be) to instruct SQL server to compact a chosen database's files. I have a batch that runs every night who generate a huge amount to log lines that I get rid of with a backup log xxx with truncate_only, but still the logfile is several GB big afterwards with a lotsa empty space... I wanna get a clean small file everyday =)
Thank you!Its not ideal to shrink the Transaction log every day, rather define a set of size by testing the activity on the database.
During that batch overnight take before and after sizes for Tlog and set the higher level.
Also maintain regular backups of Tlogs which will reduce the size of logical file and helps to fillup the Tlog quickly. If RECOVERY MODEL Is set to SIMPLE then ensure full database backups are carried in regular intervals.|||try DBCC SHRINKFILE
USE UserDB
GO
DBCC SHRINKFILE (logical file name,Target_size)
GO
Target_size is how much free size is left over after you shrink
if you leave this off, you will get the default.
also
you may have to switch the VLogs internally before you can shrink to a size that you desire...
all of his should be done after a tlog backup.
look up "Shrinking the Transaction Log" AND DBCC Shrinkfile in [BOL]
Compacting a database MS SQL
Hi
for mS SQL 2000-2500
LDF and MDF files can be very very big, if I import the datas into a new database they can become 10 time smaller
is there a way to compact (reduce the MB) of a database ?
thank youLook up DBCC SHRINKDATABASE and DBCC SHRINKFILE in BOL.|||thank you !|||Do not shrink your databases. It can impair performance. SQL Server databases are not like Microsoft Access databases, and do not need to be regularly compacted.|||if I import the datas into a new database they can become 10 time smaller.
is there a way to compact (reduce the MB) of a database ?
Yeah, you can transfer required data in the new database - using DTS.
Accordingly, make changes in your application for accessing old data too.
Note : Before any action you need to deeply analyze pros & cons for the current issues as well as upcoming issues.
for mS SQL 2000-2500
LDF and MDF files can be very very big, if I import the datas into a new database they can become 10 time smaller
is there a way to compact (reduce the MB) of a database ?
thank youLook up DBCC SHRINKDATABASE and DBCC SHRINKFILE in BOL.|||thank you !|||Do not shrink your databases. It can impair performance. SQL Server databases are not like Microsoft Access databases, and do not need to be regularly compacted.|||if I import the datas into a new database they can become 10 time smaller.
is there a way to compact (reduce the MB) of a database ?
Yeah, you can transfer required data in the new database - using DTS.
Accordingly, make changes in your application for accessing old data too.
Note : Before any action you need to deeply analyze pros & cons for the current issues as well as upcoming issues.
compacting / to repair base of data sql, using the msde
I am developing a project of the access for a friend, more I am with the
following doubts:
Does some exist it sorts things out of compacting / to repair base of data
sql, using the msde or the adp.?
MSDE databases do not require compacting. When updates or other changes are
made, the space freed when a row is deleted is reused automatically. For the
most part, MSDE/SQL Server databases are not subject to the file corruption
problems that are associated (from time-to-time ) with JET databases. There
are utilities (DBCC for one) that can be used to perform maintenance on the
database, but it's unusual to have to resort to these for smaller databases
as typically implemented with MSDE.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Frank Dulk" <fdulk@.bol.com.br> wrote in message
news:%23ZUa0OKMEHA.2456@.TK2MSFTNGP12.phx.gbl...
> I am developing a project of the access for a friend, more I am with the
> following doubts:
> Does some exist it sorts things out of compacting / to repair base of data
> sql, using the msde or the adp.?
>
following doubts:
Does some exist it sorts things out of compacting / to repair base of data
sql, using the msde or the adp.?
MSDE databases do not require compacting. When updates or other changes are
made, the space freed when a row is deleted is reused automatically. For the
most part, MSDE/SQL Server databases are not subject to the file corruption
problems that are associated (from time-to-time ) with JET databases. There
are utilities (DBCC for one) that can be used to perform maintenance on the
database, but it's unusual to have to resort to these for smaller databases
as typically implemented with MSDE.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Frank Dulk" <fdulk@.bol.com.br> wrote in message
news:%23ZUa0OKMEHA.2456@.TK2MSFTNGP12.phx.gbl...
> I am developing a project of the access for a friend, more I am with the
> following doubts:
> Does some exist it sorts things out of compacting / to repair base of data
> sql, using the msde or the adp.?
>
Labels:
access,
base,
compacting,
database,
developing,
doubtsdoes,
exist,
friend,
microsoft,
msde,
mysql,
oracle,
project,
repair,
server,
sorts,
sql,
thefollowing
Subscribe to:
Posts (Atom)