Sybase DR – What to do if all devices deleted

In case all the device files vanish and you have to start from scratch these are the steps to take;


1)         Run buildmaster –d <path to master device> -s <size in pages> (or dataserver in ASE12.5) to create a new master device


2)         Start the dataserver in single user mode


3)         log in using sa with null password and do the following

a)         update sysservers set srvnetname=”<Old backup server name>”

b)         alter database master on master =46MB (or whatever the master db size was before)

c)         shutdown and restart the server  and backupserver

d)         load the master database from a recent dump


4)          The server will shut down after the load, start it up again in single user mode, this time though log in with your ususal sa account and execute the following;

a)         In the sysusages table remove all but the first 2MB fragment for tempdb (dbid =2) and also change the segmap for this first fragment to 7

I)          update sysusages set segmap=7 where lstart=0 and dbid=2

go

II)         delete from sysusages wheredbid=2 and lstart >1000

go

b)         update sysdatabases set status=320 where name not in (“master”,”model”,”tempdb”,”sybsystemdb”)

c)         execute dbcc dbrepair (sybsystemprocs, dropdb)

d)         delete from sysdevices where name=”sysprocsdev”

e)         shut down the dataserver


5)        Edit the runserver file to start the dataserver up in normal mode and start it up again


6)        Log in normally and create a sysprocsdev device, then create the sybsystemprocs database on it (200MB) and load this database from a recent dump.


7)        Now you just need to extend tempdb and create the other databases.