Re-creating the databases

Use the following steps to re-create each database using the segment information you collected earlier.

NoteIf you chose not to gather information about segment usage, use create database...for load to create a new database that is at least as large as the original.

  1. Use create database with the for load option. Duplicate all device fragment mappings and sizes for each row of your database from the sysusages table, up to and including the first log device. Use the order of the rows as they appear in sysusages. (The results of sp_helpdb are in alphabetical order by device name, not in order of allocation.) For example, to re-create the mydb database allocations shown in Table 28-20, enter:

    create database mydb
        on datadev1 = 20,
            datadev2 = 10
    log on logdev1 = 10
    for load
    

    Notecreate database...for load temporarily locks users out of the newly created database, and load database marks the database offline for general use. This prevents users from performing logged transactions during recovery.

  2. Use alter database with the for load option to re-create the remaining entries, in order. Remember to treat device allocations for user segments as you would data allocations.

    In this example, to allocate more data space on datadev3 and more log space on logdev1, the command is:

    alter database mydb
    
        on datadev3 = "2M"
    log on logdev1= "4M"
    for load