ASE 12.5 and Later

  1. Rebuild the lost master device. Refer to “How to Build a New Master Device” for instructions.

  2. Start Adaptive Server in single-user mode. Refer to “How to Start Adaptive Server in Single-User Mode”.

  3. Ensure that the Adaptive Server has the correct name for the Backup Server in the sysservers table. Refer to “How to Set A Default Backup Server Manually in Adaptive Server” for instructions.

  4. Load the master database from backup using the load database command to specify the physical device or file name to reference. For example:

    1> load database master from device_name
    2> go
    

    NoteYou can only load a dump of master that matches your server level. Loading an older version dump to a newer server is not permitted.

    The server inspects the master device and makes any corrections needed in the newly loaded sysdatabases and sysusages. These corrections affect only the master device, since that is the only device that changed -- the server assumes that all your other devices are undamaged and need not be inspected.

    After this step, it is possible that your new master device contains database entries for databases that also exist on other devices in your system. This may happen if you moved tempdb to a different device, or created sybsystemdb on a different device. The server recognizes and handles this situation: if it finds pre-existing entries for those databases on other devices, it presumes that the existing entries are correct and does not change them.

    After the load completes but before shutting down, the server does some post-processing to reconcile the newly loaded sysdatabases and sysusages tables against the information in the master device. At this time the server may print a variety of error messages regarding failures to use or find the master database, and/or attempts to insert duplicate keys or duplicate rows to sysusages. Ignore these messages; they occur only during the reconciliation phase, and will not affect the server’s operation after it shuts down and is restarted.

    After the checks and validations are complete the server shuts down. You may now restart it normally.

  5. When you created a new master device in step 1 above, the server created only its default set of databases, with minimal data. You will probably need to load dumps of the databases (notably model) that used to be there.

    Are the databases on your new master device large enough to hold the dumps you will be loading into them? Are all the necessary databases present? Is there any obsolete data that you need to clean up?

    Log in as sa and inspect the databases on your system:

    1> declare @pgspermb int
    2> select @pgspermb = 1048576 / @@maxpagesize
    3> select "db name"=db_name(dbid), dbid, "size"=sum(size) / @pgspermb
    4> from master.dbo.sysusages
    5> group by dbid
    6> go
    

    This command shows you all the databases present on your system, and their total size. Note that the size column in the output is expressed in megabytes.

    Does this list contain any entries where database name is null? These sysusages entries don’t have any matching entries in sysdatabases; they are unnecessary and should be deleted. You may be especially susceptible to this if you upgraded from pre-12.0 versions, and created sybsystemdb on the older version; sybsystemdb will have a different dbid than the default dbid. To remove these entries, use a script like the following:

    1> exec sp_configure "allow updates", 1
    2> go
    1> delete sysusages
    2> where db_name(<dbid>) is null
    3> go
    1> exec sp_configure "allow updates", 0
    2> go
    

    where <dbid> corresponds to the null database name.

    Are any databases missing? Create those databases. Are the databases large enough? If not, alter them to be at least large enough to hold the dumps. (It is okay if they are too large; the server simply clears the excess space.)