Beruflich Dokumente
Kultur Dokumente
com
02 April 2010
IBM, the IBM logo, ibm.com, and DB2 are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their
first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common
law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or
common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and
trademark information” at www.ibm.com/legal/copytrade.shtml
Other company, product, or service names may be trademarks or service marks of others.
Motivation
Those operations require taking the tables down while the operation is
taking place. Usually performed during planned maintenance while the
system has been taken down.
What if the operation would take longer than the maintenance window
permits?
ADMIN_MOVE_TABLE
ADMIN_MOVE_TABLE
2
ADMIN_MOVE_TABLE
ADMIN_MOVE_TABLE
To avoid any naming conflicts the utility will use the following method to create these
temporary objects:
<characters from name of object><base64 encoded hash key over name of object><postfix>
Postfix:
"t" for target
"s" for staging
"i" for insert trigger
"d" for delete trigger
"u" for before update trigger
"v" for after update trigger
Example:
Assuming the source table is named T1:
Staging table: T1AAAAVxs
Target table: T1AAAAVxt
Insert trigger: T1AAAAVxi
Delete trigger: T1AAAAVxd
Before Update trigger: T1AAAAVxu
After Update trigger: T1AAAAVxv
ADMIN_MOVE_TABLE
ADMIN_MOVE_TABLE – Examples
ADMIN_MOVE_TABLE - Example
ADMIN_MOVE_TABLE - Example
ADMIN_MOVE_TABLE - Example
Changing column definition
Table before move: T1 ( C1 char(10), I2 SMALLINT )
db2 "call
SYSPROC.ADMIN_MOVE_TABLE('EBABANI','T1','USERSPACE2','USERSPACE2','USER
SPACE2','','','','C1 char(100), I2 BIGINT','','MOVE')"
Table after move: T1 (C1 char(100), I2 BIGINT)