"UnixSlaxer" <un********@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hello,
- I have a database, which i want to backup, not only the data, but
also the indexes and views/procedures associated with it. Is the
backup/restore operations (Through the DB2 Control Center) sufficient ?
- And what happens if I later on add an index, and then restore the old
database, will this new index/view be removed ?
Any help would be appreciated.
Thanks
Regards,
Salem
A database backup includes everything, except for certain DB2 environment
variables (DB2SET) and database manager instance variables (dbm dfg),
neither of which are specific to a database. In certain cases, if you
restore a database that already exists, some database level configuration
variables (db cfg) are not over-written with a restore.
However, all DDL (tables, indexes, views, etc, and procedures, etc) are
contained in the database backup, in addtion to the data. So if you restore
the entire database to a prior point in time, you will loose any changes
made after that backup time. But if you restore the database and roll the
logs forward, DB2 will reapply any changes up to the latest consistent
commit point on the logs (or some other point in time you define). In order
to roll the logs forward, you will need LOGRETAIN = ON (or the user exit
program defined).
If you don't want to restore procedures, indexes, etc (only restore data),
you could do a tablespace restore. Tablespace restores also require
LOGRETAIN = ON.