Restoring sybsystemprocs with installmaster

  1. Check to see what logical device currently stores the database. If you can still use sp_helpdb, issue:

    sp_helpdb sybsystemprocs
    
    name                db_size       owner            dbid
            created
            status
    ------------------- ------------- ---------------- ------
    sybsystemprocs            28.0 MB sa                    4
            Aug 07, 1993
            trunc log on chkpt
    
    device_fragments   size        usage            free kbytes
    ------------------ ----------- ---------------- -----------
    sprocdev           28.0 MB     data and log            3120
    

    The “device_fragments” column indicates that the database is stored on sprocdev.

    If you cannot use sp_helpdb, this query reports the devices used by the database and the amount of space on each device:

    select sysdevices.name, sysusages.size / 512
    from sysdevices, sysdatabases, sysusages
    where sysdatabases.name = "sybsystemprocs"
      and sysdatabases.dbid = sysusages.dbid
      and sysdevices.low <= sysusages.size + vstart
      and sysdevices.high >= sysusages.size + vstart -1
    
    name
    ---------------- -------
    sprocdev              28
    

  2. Drop the database:

    drop database sybsystemprocs
    

    If the physical disk is damaged, use dbcc dbrepair to drop the database and then use sp_dropdevice to drop the device (sp_dropdevice is stored in master, so it still exists even though you dropped sybsystemprocs). If necessary, use disk init to initialize a new database device. See Chapter 16, “Initializing Database Devices,” for more information on disk init.

  3. Re-create the sybsystemprocs database on the device, using the size returned by the query under step 1:

    create database sybsystemprocs
        on sprocdev = 28
    

    NoteThe required size for sybsystemprocs may be different for your operating system. See the installation documentation for your platform for the correct size.

  4. Run the installmaster script.

    WARNING! Running installmaster repeatedly can change the distribution of index values in such a way that the sysprocedures table will require much more disk space to store the same amount of data. To avoid this problem, drop and re-create sybsystemprocs before running installmaster.

  5. If you have made any changes to permissions in sybsystemprocs, or if you have added your own procedures to the database, you must redo the changes.