Restoring the table space

You can restore the table space by reloading data into it or by re-creating the table space, which requires advance planning. Either of these methods is easier than using REPAIR.

About this task

Reloading the table space is the preferred approach, when it is possible, because reloading is easier and requires less advance planning than re-creating a table space. Re-creating a table space involves dropping and then re-creating the table space and associated tables, indexes, authorities, and views, which are implicitly dropped when the table space is dropped. Therefore, re-creating the objects means that you need to plan ahead so that you will be prepared to re-establish indexes, views, authorizations, and the data content itself.

Restriction:

You cannot drop Db2 system tables, such as the catalog and directory. For these system tables, follow one of these procedures instead of this one:

Procedure

To restore the table space:

  1. Decide whether you can reload the table space or must drop and re-create it.
    • If you can reload the table space, run the appropriate LOAD utility jobs to do so; specify the REPLACE option. After you load the content of the table space, skip to step 6.
    • If you cannot reload the table space, continue with step 2.
  2. Issue an SQL DROP TABLESPACE statement for the table space that is suspected of being involved in the problem.
  3. Re-create the table space, tables, indexes, synonyms, and views by using SQL CREATE statements.
  4. Grant access to these objects the same way that access was granted prior to the time of the error.
  5. Reconstruct the data in the tables.
  6. Run the RUNSTATS utility on the data.
  7. Use the COPY utility to acquire a full image copy of all data.
  8. Use the REBIND command on all plans that use the tables or views that are involved in this activity.