db2 Restored database size vs source database size

362 Views Asked by At

When a DB2 database is restored and recovered from backups

  • is the restored database a physical copy - ie: identical block for block with the source database (as it was at time of backup) - and of identical size of source database?

or

  • is the restored database a logical copy - where datafile blocks are reorganized and coalesced (so the most of unused, fragmented free space in datafiles has been removed - causing restored database to often be smaller in storage footprint?
2

There are 2 best solutions below

5
On

It's a page-for-page physical copy. (This is why you can't, for example, backup on a little-endian system and restore onto a big-endian system.)

2
On

It is a page-for-page physical copy, but only of the used extents of pages in each table space. You can not change the logical contents of the data during a restore but you could alter the layout of the physical persistent storage.

There are also some changes you can cause during the restore process which can affect the persistently stored state of the system, such as a redirected restore altering the table space definitions or storage groups, replacing the DB history file, changing the encryption method in use, or upgrading the DB to a new release level.