SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


need script to generate load on tempdb databse!!!


need script to generate load on tempdb databse!!!

Author
Message
sanketahir1985
sanketahir1985
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2139 Visits: 1274
Hi friends

can any buddy provide script to generate load on tempdb database in sql 2005.

Sanket Ahir
Don't run behind the success, Try to be eligible & success will run behind u......
Welsh Corgi
Welsh Corgi
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62226 Visits: 4895
Could you please refer to the article listed below and let me know if this helps?

Regards,
Kent

http://www.mssqltips.com/tip.asp?tip=1853

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
RBarryYoung
RBarryYoung
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73050 Visits: 9519
Well, I am no fan of loops, but since the goal IS to slow things down, this ought to do it:

CREATE PROC EXERCISE_TEMPDB_SILLY AS
SET STATISTICS TIME ON
SET STATISTICS IO ON

CREATE TABLE #temp(RecNo INT PRIMARY KEY CLUSTERED, Data varchar(80))

INSERT INTO #temp SELECT -1, CAST(NewID() AS varchar(80))

DECLARE @cnt AS INT
SET @cnt = 0

WHILE @cnt > -1
BEGIN
Print 'Loop ' + CAST(@cnt AS VARCHAR(9))

INSERT INTO #temp
SELECT RecNo-Power(2,@cnt) , Right(Data + CAST(NewID() AS varchar(80)), 80)
FROM #temp

SET @cnt = @cnt+1
END



-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
RBarryYoung
RBarryYoung
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73050 Visits: 9519
FYI, it goes ballistic around Loop 18 or 19 for me, which takes about 5-10 seconds to reach.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)SSC Guru (461K reputation)

Group: General Forum Members
Points: 461105 Visits: 43770
sanketahir1985 (2/1/2010)
Hi friends

can any buddy provide script to generate load on tempdb database in sql 2005.


Heh... generate a load? Shoot... run one or two of the following... this will stress TempDB and it's log file to the max...

    USE TempDB;
GO
SELECT TOP 1000000000
IDENTITY(INT,1,1) AS RowNum
INTO #StressTempDB
FROM Master.sys.All_Columns ac1,
Master.sys.All_Columns ac2,
Master.sys.All_Columns ac3;
GO



I guarantee that it will "generate a load on TempDB".

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
sanketahir1985
sanketahir1985
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2139 Visits: 1274
RBarryYoung (2/6/2010)
Well, I am no fan of loops, but since the goal IS to slow things down, this ought to do it:

CREATE PROC EXERCISE_TEMPDB_SILLY AS
SET STATISTICS TIME ON
SET STATISTICS IO ON

CREATE TABLE #temp(RecNo INT PRIMARY KEY CLUSTERED, Data varchar(80))

INSERT INTO #temp SELECT -1, CAST(NewID() AS varchar(80))

DECLARE @cnt AS INT
SET @cnt = 0

WHILE @cnt > -1
BEGIN
Print 'Loop ' + CAST(@cnt AS VARCHAR(9))

INSERT INTO #temp
SELECT RecNo-Power(2,@cnt) , Right(Data + CAST(NewID() AS varchar(80)), 80)
FROM #temp

SET @cnt = @cnt+1
END





hiii RBarryYoung,


on my server its going beyond 21 loops
so finally i have to kill this SP
tell me exactly whether this SP goes in infinite loop or will finish after some time?

Sanket Ahir
Don't run behind the success, Try to be eligible & success will run behind u......
RBarryYoung
RBarryYoung
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73050 Visits: 9519
sanketahir1985 (2/8/2010)
...
hiii RBarryYoung,


on my server its going beyond 21 loops
so finally i have to kill this SP
tell me exactly whether this SP goes in infinite loop or will finish after some time?


No, that is correct, this script will run until you kill it. That is quite typical for a "script to generate load" as you requested. For instance, Jeff's script *will* finish "sometime", but that "sometime" could take several days. If this is not what you want then please let us know.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
sanketahir1985
sanketahir1985
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2139 Visits: 1274
OK
i m fine with this
Thanx a lot to both of u

Sanket Ahir
Don't run behind the success, Try to be eligible & success will run behind u......
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search