473,383 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Transaction log and tempdb

Hello

I have questions about how works transaction log et the database
tempdb in SQL Server and I hop you could help me
- Is it possible to reduce the size of the transaction log fil during
an execution ? Indeed, I have a script inserting a very large quantity
of data (many Go) and during that process my transaction log file use
all the space avaible on my hard drive. Is there any way to solve that
problem ?
- Is it possible to limit the size of the database tempdb ? I have an
another script inserting data using a select joinning 2 tables of
about 20 Go with group by. If I execute that script sql server seems
to freeze and I must kill the process. What can I do ? Is the only
solution is that I must make more avaible space on my hard drive ?

Thanks in advance for your answers.
K.

May 22 '07 #1
3 7048
Kurt (ni**************@gmail.com) writes:
I have questions about how works transaction log et the database
tempdb in SQL Server and I hop you could help me
- Is it possible to reduce the size of the transaction log fil during
an execution ? Indeed, I have a script inserting a very large quantity
of data (many Go) and during that process my transaction log file use
all the space avaible on my hard drive. Is there any way to solve that
problem ?
Maybe. It sounds as if you are the database is in full recovery. If you
would switch to simple recovery, the transaction log would truncate
after each committed transaction (more or less). But! If this is a
production database for which there is a requirement of being able
to a point-in-time recovery in case of a disaster, then this is not
an option. Then again, if this is your development database, and you are
content with restoring from the most recent backup, you are probably
better of with simple recovery any way.

When loading data, there are several techniques of optimization, but
without further knowledge of your situation it's difficult to say
what may be better for you.
- Is it possible to limit the size of the database tempdb ? I have an
another script inserting data using a select joinning 2 tables of
about 20 Go with group by. If I execute that script sql server seems
to freeze and I must kill the process. What can I do ? Is the only
solution is that I must make more avaible space on my hard drive ?
Yes, it's possible to define a max limit fot the size of tempdb, but
I'm not really sure that I see the point with this.

If you have a wild query, you should rather see what you can do to
improve it, maybe add an index. Or run in it first on a smaller data
set, to verify that the query is logically correct.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 22 '07 #2
Hello,

On 22 mai, 23:44, Erland Sommarskog <esq...@sommarskog.sewrote:
Kurt (nicolas.agrap...@gmail.com) writes:
I have questions about how works transaction log et the database
tempdb in SQL Server and I hop you could help me
- Is it possible to reduce the size of the transaction log fil during
an execution ? Indeed, I have a script inserting a very large quantity
of data (many Go) and during that process my transaction log file use
all the space avaible on my hard drive. Is there any way to solve that
problem ?

Maybe. It sounds as if you are the database is in full recovery. If you
would switch to simple recovery, the transaction log would truncate
after each committed transaction (more or less). But! If this is a
production database for which there is a requirement of being able
to a point-in-time recovery in case of a disaster, then this is not
an option. Then again, if this is your development database, and you are
content with restoring from the most recent backup, you are probably
better of with simple recovery any way.

When loading data, there are several techniques of optimization, but
without further knowledge of your situation it's difficult to say
what may be better for you.
You write that there is several technique of optimization, I know a
few that I always apply. But is there any place where I could find
those ?
- Is it possible to limit the size of the database tempdb ? I have an
another script inserting data using a select joinning 2 tables of
about 20 Go with group by. If I execute that script sql server seems
to freeze and I must kill the process. What can I do ? Is the only
solution is that I must make more avaible space on my hard drive ?

Yes, it's possible to define a max limit fot the size of tempdb, but
I'm not really sure that I see the point with this.

If you have a wild query, you should rather see what you can do to
improve it, maybe add an index. Or run in it first on a smaller data
set, to verify that the query is logically correct.
The query is correct, tested with a small amount of datas.
The index are set. I don't really know what I can do more?
>
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thanks.

May 23 '07 #3
Kurt (ni**************@gmail.com) writes:
You write that there is several technique of optimization, I know a
few that I always apply. But is there any place where I could find
those ?
A good book on SQL programming beyond the introductory stuff should
probably cover this. No, I don't have any direct suggestions for titles.

If you give more specifics about your problem, we might able to give some
suggestions.
>If you have a wild query, you should rather see what you can do to
improve it, maybe add an index. Or run in it first on a smaller data
set, to verify that the query is logically correct.

The query is correct, tested with a small amount of datas.
The index are set. I don't really know what I can do more?
Make sure that statistics are up to date, and that tables aren't fragmented
are start. Also investigate the query plan, and verify that this is the best
you can get (which is unlikely given the performance). Query tuning can
sometimes be a difficult matter. You could post the query here together
with table and index definitions. Which version of SQL Server are you
using?
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for database 'tempdb' is full. Back up the transaction...
3
by: tom horner | last post by:
Something strange is happening to our SQL Server DB (2000). The tempdb transaction log file continues to grow (quite slowly) for no apparent reason. We have it in simple mode, and I have tried a...
2
by: Warren Wright | last post by:
Hi All, First, where can I get some questions of this sort answered? Preferably, are there good books or online guides that I can consult for these types of answers when necessary? 1. How do...
2
by: Tom | last post by:
I received an error that the log in tempdb was full, but the log and data segments are set to automatically grow with no limit AND there is plenty of available space on the disk. So I don't...
1
by: adude | last post by:
I am interested to hear if people think it would be a good idea to move the Master & TempDB to a different HD. Here is my DB Server's set up: 1. Processor: (1) AMD XP 2800 2. 1st HD (IDE 0) is...
8
by: arijitchatterjee123 | last post by:
Hi Group, I am facing a problem regarding locking. I have created a Stored Procedure in my Database. In this Stored Procedure Temprary Tables get created and after that values are inserted in...
2
by: New MSSQL DBA | last post by:
hi all, we have a SQL2000SP3 runing in W2K3. The application is JDEdwards. recently I've observed that once in a while (about a few hours), there would be a process from the ERP application...
3
by: New MSSQL DBA | last post by:
has anyone met with this before? the setting is SQL2K with SP3 on a 2 node active-active W2K3 cluster. on one of the machine, it occasionally prompts for the following error: "The log file for...
0
by: Kurt | last post by:
Hello I have questions about how works transaction log et the database tempdb in SQL Server and I hop you could help me - Is it possible to reduce the size of the transaction log fil during an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.