Error 5013

Severity

16

Message text

Cannot extend the MASTER database onto any device other than 'master'. The ALTER DATABASE was aborted.

Explanation

This error occurs when you try to extend the master database onto a device other than the master device.

NoteIt is recommended that you keep user objects out of the master database. If you keep user databases off the master device, you allow space in case the master database needs to grow. In addition, if you ever need to rebuild the master device, it will be easier if it does not contain user databases.

Action

Adaptive Server users can move any “home-grown” system procedures that start with “sp_” to sybsystemprocs (by dropping them from the master database and creating them in sybsystemprocs).

Extend the master database only if absolutely necessary! If you are sure you must increase the master database size and have no room on the current master device, use the following procedure to remove user databases from the master device.


Moving user databases

  1. Dump the user databases with the dump database command.

  2. Rename the dumped databases on the master device with sp_renamedb.

  3. Re-create the databases with their original names on another device with create database. Be sure they are created exactly like the old databases, to avoid 2558 and other errors. Refer to “Error 2558” for more information.

  4. Load the dumps with load database.

  5. Use the online database command for each database to make the databases available for use.

  6. Check the databases in their new location to make sure the load was successful (that is, perform a simple query with isql), and if everything loaded successfully, drop the old databases from the master device.

You can now try to increase the size of the master database on the master device with the alter database command.


Increasing master device size

If the master device contains only the master database and the master device is too small, then use the following procedure:

WARNING! Altering the master device is extremely risky! Avoid it if at all possible. Be familiar with the recovery methods in the chapter “Adaptive Server System Recovery” in the most recent version of Troubleshooting and Disaster Recovery in case you lose your master database or device.

  1. Back up the master database with the dump database command.

  2. Save the contents of key system tables such as sysdatabases, sysdevices, sysusages, and syslogins.

  3. Use the buildmaster utility to build a new master device with enough extra space so that you will never need to increase the master device again. When buildmaster completes, a new master database will exist on the new master device.

  4. Expand the size of the new master database with the alter database command, if necessary, so that it matches the size of the dumped master database.

  5. Execute the following command in isql:

    1> select name, high from master..sysdevices 
    2> where name = "master" 
    3> go
    

    and note the “high” value for the master device.

  6. Start Adaptive Server in single-user mode. Refer to “Starting Adaptive Server in single-user mode” in the chapter “Server Recovery Tasks” in the most recent version of Troubleshooting and Disaster Recovery.

  7. Load the dump of the master database. Test the database to make sure it is functioning correctly before deleting any extra backups of master.

  8. Allow updates to the system catalog:

    1> sp_configure, "allow updates", 1
    2> go
    
  9. Reset the “high” value in master..sysdevices:

    1> begin transaction
    2> go
    
    1> update master..sysdevices 
    2> set high = <value_of_high_from_step_5>
    3> where name = "master"
    4> go
    
  10. If the previous update affected only one row, commit the transaction.

  11. Restart Adaptive Server.

  12. Turn off allow updates:

    1> sp_configure, "allow updates", 0
    2> go
    

Versions in which this error is raised

All versions