You are not logged in or registered. Please login or register to use the full functionality of this SYBASETEAM.COM Website...
Current time: 03-12-2010, 01:29 AM Hello There, Guest! (LoginRegister)
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I move sybase tempdb off of the Master Device?
04-27-2009, 11:19 AM
Post: #1
How do I move sybase tempdb off of the Master Device?
Sybase TS Preferred Method of Moving tempdb off the Master Device.This is from Sybase ISUG FAQs.

This is the Sybase TS method of removing most activity from the master device:

1. Alter tempdb on another device:

1> alter database tempdb on ...
2> go

2. Use the tempdb:

1> use tempdb
2> go

3. Drop the segments:

1> sp_dropsegment "default", tempdb, master
2> go
1> sp_dropsegment "logsegment", tempdb, master
2> go
1> sp_dropsegment "system", tempdb, master
2> go

Note that there is still some activity on the master device. On a three connection test that I ran:

while ( 1 = 1 )
begin
create table #x (col_a int)
drop table #x
end

there was one write per second. Not bad.

An Alternative

(I recently did some bench marks comparing this method, the previous method and a combination of both. According to sp_sysmon there was no difference in activity at all. I leave it here just in case it proves useful to someone.)

The idea of this handy script is to simply fill the first 2MB of tempdb thus effectively blocking anyone else from using it. The slight gotcha with this script, since we're using model, is that all subsequent database creates will also have tempdb_filler installed. This is easily remedied by dropping the table after creating a new database.

This script works because tempdb is rebuilt every time the ASE is rebooted. Very nice trick!

/* this isql script creates a table in the model database. */
/* Since tempdb is created from the model database when the */
/* server is started, this effectively moves the active */
/* portion of tempdb off of the master device. */

use model
go

/* note: 2k row size */
create table tempdb_filler(
a char(255) not null,
b char(255) not null,
c char(255) not null,
d char(255) not null,
e char(255) not null
)
go

/* insert 1024 rows */
declare @i int
select @i = 1
while (@i <= 1024)
begin
insert into tempdb_filler values('a','b','c','d','e')
if (@i % 100 = 0) /* dump the transaction every 100 rows */
dump tran model with truncate_only
select @i=@i+1
end
go
Find all posts by this user
Quote this message in a reply

Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sybase Database dump failed for a database with no space left on device error padalav 0 174 01-28-2010 10:37 AM
Last Post: padalav
  How to get the max tempdb usage and max log file usage for user database till date GANESHBSUTAR 3 230 01-07-2010 10:49 PM
Last Post: Joshi
  Using Solaris tmpfs for a tempdb Device in Sybase ASE albert 0 105 12-20-2009 03:54 PM
Last Post: albert
  find out the size of tables and indexes in any tempdb john 0 184 12-03-2009 05:45 PM
Last Post: john
  Purpose of master and query entries in Sybase ASE interfaces file. Joshi 0 113 11-30-2009 04:38 PM
Last Post: Joshi
  Query to find device name for each database fragment Nagendra 0 164 07-22-2009 11:06 AM
Last Post: Nagendra
  Using Solaris temp filesystem tmpfs for a Sybase tempdb device Kishor 0 99 07-01-2009 02:11 AM
Last Post: Kishor
  monitor sybase tempdb log space albert 0 787 04-22-2009 01:58 AM
Last Post: albert
  Recovering the master Database or Master Device Nagendra 0 129 04-12-2009 01:56 AM
Last Post: Nagendra
  Some Musings on Device Options,Dsync in sybase by DAvid Wein zaadmin 0 43 03-22-2009 01:49 AM
Last Post: zaadmin

Forum Jump: