For a database-level restore, the
backup image can differ from the existing database in its alias name,
its database name, or its database seed. A database seed
is a unique identifier for a database that does not change during
the life of the database.
The database manager assigns
the seed when you create the database. DB2® always
uses the seed from the backup image.You
can restore a table space into an existing database only if the table
space exists and if the table spaces are the same, meaning that you
did not drop the table space and then re-create it between the backup
and the restore operations. The database on disk and in the backup
image must be the same.You
cannot modify the currently defined storage groups or explicitly create
new storage groups when restoring a table space.
When
restoring to an existing database, the restore utility performs the
following actions:
- Deletes table, index, and long field data from the existing database
and replaces it with data from the backup image.
- Replaces table entries for each table space that you are restoring.
- Retains the recovery history file unless it is damaged or has
no entries. If the recovery history file is damaged or contains no
entries, the database manager copies the file from the backup image.
If you want to replace the recovery history file, you can issue the RESTORE
DATABASE command with the REPLACE HISTORY FILE parameter.
- Retains the authentication type for the existing database.
- Retains the database directories for the existing database. The
directories define where the database is located and
how it is cataloged.
- Compares the database seeds. If the seeds are different, the utility
performs the following actions:
- Deletes the logs that are associated with the existing database.
- Copies the database configuration file from the backup image.
- If
you specify the NEWLOGPATH parameter, the utility
sets the NEWLOGPATH parameter for the RESTORE
DATABASE command to the value of the logpath database
configuration parameter. If you do not specify the NEWLOGPATH parameter,
the utility performs the following actions:
- Validates the log path.
- If the database cannot use the log path, the utility changes the
database configuration to use the default log path.
If the database seeds are the same, the utility performs the
following actions: - Deletes all log files if the image is for a non-recoverable
database.
- Deletes empty log files if the image is for a recoverable
database. Non-empty log files are not affected.
- Retains the current database configuration file.
- If you specify the NEWLOGPATH parameter,
the utility sets the NEWLOGPATH parameter for
the RESTORE DATABASE command to the value of the logpath database
configuration parameter. If you do not specify the NEWLOGPATH parameter,
the utility performs the following actions:
- Copies the current log path to the database configuration file.
- Validates the log path.
- If the database cannot use the log path, the utility changes the
database configuration to use the default log path.