I moved all my data files from mssql2000 to mssql2005.
problem is that my log files are GB's bigger than the MDF file.
Can I delete the LOG files? IF not, can I reduced the size?
How?
Thanks,
Raul Rego
NJPIESDo you mean transaction log files (typically .ldf) or something else? If you mean transaction log
files, then do not delete them (unless you are prepared to restore the databases from backups). You
can shrink the file size using DBCC SHRINKFILE.
Bu the fact that these are so large is an indication that you or your dba haven't thought out a
suitable backup plan for your database and set the recovery model accordingly.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Raul" <rrego@.njpies.org> wrote in message
news:26041173-37E9-44E0-AA79-CFDFC093EC5B@.microsoft.com...
>I moved all my data files from mssql2000 to mssql2005.
> problem is that my log files are GB's bigger than the MDF file.
> Can I delete the LOG files? IF not, can I reduced the size?
> How?
> Thanks,
> Raul Rego
> NJPIES
Showing posts with label bigger. Show all posts
Showing posts with label bigger. Show all posts
Monday, March 26, 2012
LOG files
I have an SQL server with data files which have name_LOG.ldf files much much
bigger than the data files themselves.
How can I delete them or crunch them?
If I just delete them it appears that the data file can no loger be read.
Thanks,
Raul Rego
NJPIES
rrego.njpies.orgHi,
Dont delete, just shrink the file.
Steps to shrink the Log file.
1. Backup the transaction log (Use command:- BACKUP Log dbname to
disk='c:\backup\dbname.tr1' (or use enterprise manager) or (if you do need
the trasaction log backup execute below command)
backup log <dbname> with truncate_only
2. Indetify the log file for shrinking:-
use <dbname>
go
sp_helpfile
Based on the name column for the transaction log file execute the dbcc
shrinkfile
3. Shrink the transaction log file.
DBCC SHRINKFILE('logical_transaction_log file name','truncateonly')
Have a look into the below article,
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
Thanks
Hari
MCDBA
"Raul Rego" <rrego@.njpies.org> wrote in message
news:eDV$K5hTEHA.3480@.TK2MSFTNGP11.phx.gbl...
> I have an SQL server with data files which have name_LOG.ldf files much
much
> bigger than the data files themselves.
> How can I delete them or crunch them?
> If I just delete them it appears that the data file can no loger be read.
> Thanks,
> Raul Rego
> NJPIES
> rrego.njpies.org
>|||> I have an SQL server with data files which have name_LOG.ldf files much
much
> bigger than the data files themselves.
Do you have any concept of recovery model? Do you ever back up your
database or transaction logs?
> If I just delete them it appears that the data file can no loger be read.
Yep, the log file is a pretty essential component of a SQL Server database.
http://www.aspfaq.com/2471
If you have no interest in data integrity or backups, you can set the
recovery model to simple, back up the log with truncate_only, then shrink
the file.
ALTER DATABASE database_name SET RECOVERY SIMPLE
GO
BACKUP LOG database_name WITH TRUNCATE_ONLY
GO
USE database_name
GO
DBCC SHRINKFILE(database_name_log, 1)
GO
--
http://www.aspfaq.com/
(Reverse address to reply.)
bigger than the data files themselves.
How can I delete them or crunch them?
If I just delete them it appears that the data file can no loger be read.
Thanks,
Raul Rego
NJPIES
rrego.njpies.orgHi,
Dont delete, just shrink the file.
Steps to shrink the Log file.
1. Backup the transaction log (Use command:- BACKUP Log dbname to
disk='c:\backup\dbname.tr1' (or use enterprise manager) or (if you do need
the trasaction log backup execute below command)
backup log <dbname> with truncate_only
2. Indetify the log file for shrinking:-
use <dbname>
go
sp_helpfile
Based on the name column for the transaction log file execute the dbcc
shrinkfile
3. Shrink the transaction log file.
DBCC SHRINKFILE('logical_transaction_log file name','truncateonly')
Have a look into the below article,
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
Thanks
Hari
MCDBA
"Raul Rego" <rrego@.njpies.org> wrote in message
news:eDV$K5hTEHA.3480@.TK2MSFTNGP11.phx.gbl...
> I have an SQL server with data files which have name_LOG.ldf files much
much
> bigger than the data files themselves.
> How can I delete them or crunch them?
> If I just delete them it appears that the data file can no loger be read.
> Thanks,
> Raul Rego
> NJPIES
> rrego.njpies.org
>|||> I have an SQL server with data files which have name_LOG.ldf files much
much
> bigger than the data files themselves.
Do you have any concept of recovery model? Do you ever back up your
database or transaction logs?
> If I just delete them it appears that the data file can no loger be read.
Yep, the log file is a pretty essential component of a SQL Server database.
http://www.aspfaq.com/2471
If you have no interest in data integrity or backups, you can set the
recovery model to simple, back up the log with truncate_only, then shrink
the file.
ALTER DATABASE database_name SET RECOVERY SIMPLE
GO
BACKUP LOG database_name WITH TRUNCATE_ONLY
GO
USE database_name
GO
DBCC SHRINKFILE(database_name_log, 1)
GO
--
http://www.aspfaq.com/
(Reverse address to reply.)
LOG files
I moved all my data files from mssql2000 to mssql2005.
problem is that my log files are GB's bigger than the MDF file.
Can I delete the LOG files? IF not, can I reduced the size?
How?
Thanks,
Raul Rego
NJPIES
Do you mean transaction log files (typically .ldf) or something else? If you mean transaction log
files, then do not delete them (unless you are prepared to restore the databases from backups). You
can shrink the file size using DBCC SHRINKFILE.
Bu the fact that these are so large is an indication that you or your dba haven't thought out a
suitable backup plan for your database and set the recovery model accordingly.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Raul" <rrego@.njpies.org> wrote in message
news:26041173-37E9-44E0-AA79-CFDFC093EC5B@.microsoft.com...
>I moved all my data files from mssql2000 to mssql2005.
> problem is that my log files are GB's bigger than the MDF file.
> Can I delete the LOG files? IF not, can I reduced the size?
> How?
> Thanks,
> Raul Rego
> NJPIES
sql
problem is that my log files are GB's bigger than the MDF file.
Can I delete the LOG files? IF not, can I reduced the size?
How?
Thanks,
Raul Rego
NJPIES
Do you mean transaction log files (typically .ldf) or something else? If you mean transaction log
files, then do not delete them (unless you are prepared to restore the databases from backups). You
can shrink the file size using DBCC SHRINKFILE.
Bu the fact that these are so large is an indication that you or your dba haven't thought out a
suitable backup plan for your database and set the recovery model accordingly.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Raul" <rrego@.njpies.org> wrote in message
news:26041173-37E9-44E0-AA79-CFDFC093EC5B@.microsoft.com...
>I moved all my data files from mssql2000 to mssql2005.
> problem is that my log files are GB's bigger than the MDF file.
> Can I delete the LOG files? IF not, can I reduced the size?
> How?
> Thanks,
> Raul Rego
> NJPIES
sql
Subscribe to:
Posts (Atom)