Friday, July 27, 2007

Copy and Drop Schema

Do you need to make the exact copy of all the objects in a given schema? Are you planning to write a script for this task? If you are using DB2 version 9, perhaps you can avoid writing this script and still perform the same task using a single statement.

DB2 version 9 provides a new stored procedure called ADMIN_COPY_SCHEMA that can be used to copy all the objects from one schema to another schema name. The syntax for this stored procedure can be found at


ADMIN_COPY_SCHEMA at DB2 Info Center

In addition to the copy schema stored procedure, DB2 9 also offers a drop schema stored procedure to drop all the objects in a schema. The stored procedure is called ADMIN_DROP_SCHEMA. The syntax of this stored procedure can be found at

ADMIN_DROP_SCHEMA at DB2 Info Center

1 comment:

Anonymous said...

This is great info. Thanks for the blog

Raj