Showing posts with label tempdb. Show all posts
Showing posts with label tempdb. Show all posts

Wednesday, March 7, 2012

Large TempDB

Hi
I have many reports running from a SQL Server DB, from Crystal Enterprise
reporting system. However I have noticed some performance degradation, and
I noticed that my TempDB had ballooned in size. Is there a way to reset
this? I tried Shrink, but this did not reduce the size of the DB?
Kind Regards
Ricky
(SQL2K-SP3A/WIN2K-Client/WIN2K-Server/Crystal Enterprise 9.0)http://www.aspfaq.com/show.asp?id=2446
David Portas
SQL Server MVP
--
"rikesh patel" <trikky@.rukp28.freeserve.co.uk> wrote in message
news:ubgD8RnxFHA.3124@.TK2MSFTNGP12.phx.gbl...
> Hi
> I have many reports running from a SQL Server DB, from Crystal Enterprise
> reporting system. However I have noticed some performance degradation,
> and
> I noticed that my TempDB had ballooned in size. Is there a way to reset
> this? I tried Shrink, but this did not reduce the size of the DB?
> Kind Regards
> Ricky
> (SQL2K-SP3A/WIN2K-Client/WIN2K-Server/Crystal Enterprise 9.0)
>

Large System Databases

I manage a SQL Server where the master database is almost 3 times
larger than any other database and the tempdb is even bigger than that.
I have not been monitoring the size of these databases for very long
so I don't have a good baseline. However, it seems like a problem. I
would appreciate any help.
Thanks!
What is large? Does the app use master to store user data?
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143653999.425234.24030@.t31g2000cwb.googlegro ups.com...
>I manage a SQL Server where the master database is almost 3 times
> larger than any other database and the tempdb is even bigger than that.
> I have not been monitoring the size of these databases for very long
> so I don't have a good baseline. However, it seems like a problem. I
> would appreciate any help.
> Thanks!
>
|||The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
for some environments.
You are right, our Sitescope monitoring software maintains a log table
in the Master database that is 3.3 GB alone. Is that a good practice?
Thank you for your help Sir!
|||No that is very poor practice. Why would you use the Master database as a
user db? If that is third party software then you should ask for your money
back and tell them to call you when they get a clue. It is impossible to
say why tempdb is that big and if it is needed that big or not without much
more information. Check to be sure there are no long running open
transactions in Tempdb.
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143749039.920309.50530@.v46g2000cwv.googlegro ups.com...
> The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
> for some environments.
> You are right, our Sitescope monitoring software maintains a log table
> in the Master database that is 3.3 GB alone. Is that a good practice?
> Thank you for your help Sir!
>
|||It turned out that it was 3rd party software and consultant that
installed it in the Master. Thanks to your help we were able to
resolve the problem and move the table into a user database. We regard
to temp there was no long running open transactions...I restarted the
sql service and it shrunk to a resonable size, I'm monitoring it now.
Thanks again!

Friday, February 24, 2012

Large System Databases

I manage a SQL Server where the master database is almost 3 times
larger than any other database and the tempdb is even bigger than that.
I have not been monitoring the size of these databases for very long
so I don't have a good baseline. However, it seems like a problem. I
would appreciate any help.
Thanks!What is large? Does the app use master to store user data?
--
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143653999.425234.24030@.t31g2000cwb.googlegroups.com...
>I manage a SQL Server where the master database is almost 3 times
> larger than any other database and the tempdb is even bigger than that.
> I have not been monitoring the size of these databases for very long
> so I don't have a good baseline. However, it seems like a problem. I
> would appreciate any help.
> Thanks!
>|||The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
for some environments.
You are right, our Sitescope monitoring software maintains a log table
in the Master database that is 3.3 GB alone. Is that a good practice?
Thank you for your help Sir!|||No that is very poor practice. Why would you use the Master database as a
user db? If that is third party software then you should ask for your money
back and tell them to call you when they get a clue. It is impossible to
say why tempdb is that big and if it is needed that big or not without much
more information. Check to be sure there are no long running open
transactions in Tempdb.
--
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143749039.920309.50530@.v46g2000cwv.googlegroups.com...
> The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
> for some environments.
> You are right, our Sitescope monitoring software maintains a log table
> in the Master database that is 3.3 GB alone. Is that a good practice?
> Thank you for your help Sir!
>|||It turned out that it was 3rd party software and consultant that
installed it in the Master. Thanks to your help we were able to
resolve the problem and move the table into a user database. We regard
to temp there was no long running open transactions...I restarted the
sql service and it shrunk to a resonable size, I'm monitoring it now.
Thanks again!

Large System Databases

I manage a SQL Server where the master database is almost 3 times
larger than any other database and the tempdb is even bigger than that.
I have not been monitoring the size of these databases for very long
so I don't have a good baseline. However, it seems like a problem. I
would appreciate any help.
Thanks!What is large? Does the app use master to store user data?
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143653999.425234.24030@.t31g2000cwb.googlegroups.com...
>I manage a SQL Server where the master database is almost 3 times
> larger than any other database and the tempdb is even bigger than that.
> I have not been monitoring the size of these databases for very long
> so I don't have a good baseline. However, it seems like a problem. I
> would appreciate any help.
> Thanks!
>|||The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
for some environments.
You are right, our Sitescope monitoring software maintains a log table
in the Master database that is 3.3 GB alone. Is that a good practice?
Thank you for your help Sir!|||No that is very poor practice. Why would you use the Master database as a
user db? If that is third party software then you should ask for your money
back and tell them to call you when they get a clue. It is impossible to
say why tempdb is that big and if it is needed that big or not without much
more information. Check to be sure there are no long running open
transactions in Tempdb.
Andrew J. Kelly SQL MVP
"shanghai360" <scott.seely@.sfsoma.com> wrote in message
news:1143749039.920309.50530@.v46g2000cwv.googlegroups.com...
> The Master database is 3.6 GB and Tempdb is 4.5 GB...perhaps not so big
> for some environments.
> You are right, our Sitescope monitoring software maintains a log table
> in the Master database that is 3.3 GB alone. Is that a good practice?
> Thank you for your help Sir!
>|||It turned out that it was 3rd party software and consultant that
installed it in the Master. Thanks to your help we were able to
resolve the problem and move the table into a user database. We regard
to temp there was no long running open transactions...I restarted the
sql service and it shrunk to a resonable size, I'm monitoring it now.
Thanks again!

Monday, February 20, 2012

Large Inserts, TempDB Growing

I have a query that's joining a messload of tables to populate a single
table used later for OLAP reporting.
The source tables, and the OLAP table are in different databases.
Basic Form:
INSERT INTO OLAPDB.dbo.SomeTable
SELECT lots_of_columns
FROM atables
INNER JOIN lots_of_tables...
No ORDER BYs... no GROUP BYs
The query dies because there isn't enough disk space for TempDB.
When I look at the files, tempdb is HUGE, and the OLAPDB (destination)
is tiny.
Is there a way to insert the data straight into the destination?
without it using tempdb as an intermediate?
any ideas?
thanks
-MarkMark,
Maybe add a WHERE clause and perform the INSERT in multiple parts.
HTH
Jerry
"Mark" <AnonymousPerson12345@.gmail.com> wrote in message
news:1127429078.936480.53900@.o13g2000cwo.googlegroups.com...
>I have a query that's joining a messload of tables to populate a single
> table used later for OLAP reporting.
> The source tables, and the OLAP table are in different databases.
> Basic Form:
> INSERT INTO OLAPDB.dbo.SomeTable
> SELECT lots_of_columns
> FROM atables
> INNER JOIN lots_of_tables...
> No ORDER BYs... no GROUP BYs
> The query dies because there isn't enough disk space for TempDB.
> When I look at the files, tempdb is HUGE, and the OLAPDB (destination)
> is tiny.
> Is there a way to insert the data straight into the destination?
> without it using tempdb as an intermediate?
> any ideas?
> thanks
> -Mark
>|||Mark wrote:
> I have a query that's joining a messload of tables to populate a
> single table used later for OLAP reporting.
> The source tables, and the OLAP table are in different databases.
> Basic Form:
> INSERT INTO OLAPDB.dbo.SomeTable
> SELECT lots_of_columns
> FROM atables
> INNER JOIN lots_of_tables...
> No ORDER BYs... no GROUP BYs
> The query dies because there isn't enough disk space for TempDB.
> When I look at the files, tempdb is HUGE, and the OLAPDB (destination)
> is tiny.
> Is there a way to insert the data straight into the destination?
> without it using tempdb as an intermediate?
> any ideas?
> thanks
> -Mark
An INSERT INTO is a fully logged operation. A SELECT INTO OTOH is a bulk
logged operation. Instead of using tempdb, you could use a regular table
in a database of your choosing. However, if you are running out of
space in tempdb, you could make sure tempdb is adequately sized to begin
with and can auto-grow if needed. You could also try using SELECT INTO
which will keep transaction logging to a minimum, but does require SQL
Server create the table for you based on the columns in the query. You
could also try speeding up the query by using a stored procedure that
pulls data from the tables in a more efficient manner - if that's
possible.
David Gugick
Quest Software
www.imceda.com
www.quest.com

large INSERTS effects on TempDB?

We have a long running query that inserts a large dynamic sql statement with
lots of joins, into a table.
There appear to be some locking issues around this object. How do I
determine the effect, if any, on tempdb?
Would the Select portion of the Insert create some exclusive locks, or tie
up the tempdb in some way? If so, how do I monitor tempdb size?
Thanks,
Bill Thompson> Would the Select portion of the Insert create some exclusive locks, or tie
> up the tempdb in some way?
Could be that, depending on your query hints. Also, if you are inserting
into a table with a clustered index, there could be a lot of sorting and
data movement going on...
--
http://www.aspfaq.com/
(Reverse address to reply.)

large INSERTS effects on TempDB?

We have a long running query that inserts a large dynamic sql statement with
lots of joins, into a table.
There appear to be some locking issues around this object. How do I
determine the effect, if any, on tempdb?
Would the Select portion of the Insert create some exclusive locks, or tie
up the tempdb in some way? If so, how do I monitor tempdb size?
Thanks,
Bill Thompson
> Would the Select portion of the Insert create some exclusive locks, or tie
> up the tempdb in some way?
Could be that, depending on your query hints. Also, if you are inserting
into a table with a clustered index, there could be a lot of sorting and
data movement going on...
http://www.aspfaq.com/
(Reverse address to reply.)

large INSERTS effects on TempDB?

We have a long running query that inserts a large dynamic sql statement with
lots of joins, into a table.
There appear to be some locking issues around this object. How do I
determine the effect, if any, on tempdb?
Would the Select portion of the Insert create some exclusive locks, or tie
up the tempdb in some way? If so, how do I monitor tempdb size?
Thanks,
Bill Thompson> Would the Select portion of the Insert create some exclusive locks, or tie
> up the tempdb in some way?
Could be that, depending on your query hints. Also, if you are inserting
into a table with a clustered index, there could be a lot of sorting and
data movement going on...
http://www.aspfaq.com/
(Reverse address to reply.)

Large Insert Causing Problem With TempDB

Hello,

I have an SSIS package that basically inserts a large amount of data into a SQL Server table. The table contains sixty five columns, and a single load of data can contain two million records.

The 'loads' are split up into several 'daily' flat files. The package uses a ForEachFile loop to process each of the files. As each file is processed, the data from the files is loaded into a SQL Server table (destination).

Apparently, as the package is running, tempDB begins to consume a lot of disk space. The data file for TempDB on this particular server is configured to grow in 50mb increments with unrestricted file growth. During the last run of the package, the data file grew to 17GB. I ran the following and got the data file size down to 50mb;

USE TempDb

GO

DBCC SHRINKFILE(tempdev, 1)

Should I consider incorporating this code as part of the package, or is there something else I should consider to configure the SSIS package so that I don't run into space problems with TempDB?

Thank you for your help!

cdun2

Be sure you are loading using "fast load" and set the Maximum Insert Commit Size to a reasonable value. (100,000 perhaps)|||

Thanks. I'll check into this.

cdun2