Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9090

Re: Moving tempdb database fragments off the master device

$
0
0

Hi Jean-Pierre,

 

I'll start by mentioning that I do not recommend completely removing

tempdb from the master device.  I think it is best to leave the

very first fragment for tempdb on the master device as it makes

recovery slightly easier in those rare (but stressful) moments when

you have to perform disaster recovery by rebuilding the master

device from scratch.

 

 

The steps you took removed the first fragment of sysusages from

the master device (among others)  but didn't replace it with anything.

And it could have left scattered fragments of tempdb on other devices,

which doesn't do any good if the core system tables are nowhere to be

found (they are found on the first fragment).

 

 

If I were to want to completely remove tempdb from the master device, the

approach I would use doesn't try to preserve any non-master

allocations (it is easier to restore them by just altering the new tempdb

back onto the desired devices).  What I would do is:

 

sp_configure "allow updates", 1

go

-- create a database where you want tempdb to be in the future:

create database newtempdb on <devname>

go

-- find the dbid of this new database

select dbid from sysdatabases where name = "newtempdb"

go

-- Hook up the origina sysdatabases tempdb entry to the newtempdb

-- entries in sysuseages and clean up

 

begin tran

delete sysusages where dbid = 2

delete sysdatabases where name = "newtempdb"

update sysusages set dbid = 2 where dbid = <newtempdb dbid>

go

-- sanity check the number of rows returned before issuing commit tran

commit tran

go

shutdown

go

 

-- reboot ASE and tempdb should now be in its new location.

 

 

 

----------------------

Now, to deal with your current problem:

 

Shutdown ASE

 

Modify the configuration file ($SYBASE/ASE-*/<servername>.cfg )  so that updates to system tables are allowed as sp_configure likely wont  be working

 

Boot ASE with traceflag 3608 to cause it to only recover master and not recover any other databases (tempdb being our particular concern.) (add -T3608 to the list of dataserver parameters in the RUN_<servername> file.)

 

Follow the same general steps above (create new db point tempdb entry at it)

 

Remove the traceflag after shutting down, then reboot.normally. 

 

-bret

 

Message was edited by: Bret Halford    Added personal opinion that it is best not to completely remove tempdb from the master device.


Viewing all articles
Browse latest Browse all 9090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>