How to delete all the DB2 packages in collection COLL1?

A DB2 collection is a physical quantity which is used to group the packages. A collection can be simply termed as a group of DB2 packages. By using collections we can bind the same DBRM into different packages. In order to delete all the DB2 packages under a collection, we can issue the FREE PACKAGE command.

Syntax

FREE PACKAGE(collection_name.*)

Example: Deleting All Packages in COLL1

To delete all packages in the collection named COLL1, use the following command:

// DB2 command to delete all packages in COLL1 collection
console.log("Executing: FREE PACKAGE(COLL1.*)");
FREE PACKAGE(COLL1.*)

How It Works

The FREE PACKAGE command consists of:

  • FREE PACKAGE - The reserved command to delete packages
  • COLL1 - The name of the target collection
  • .* - Wildcard indicating all packages within the collection

Key Points

  • The asterisk (*) after the collection name deletes all packages in that collection
  • This operation is irreversible - deleted packages cannot be recovered
  • Ensure you have proper authorization to execute FREE PACKAGE commands
  • Consider backing up important packages before deletion

Conclusion

Use the FREE PACKAGE(collection_name.*) command to delete all DB2 packages within a specific collection. The wildcard syntax makes it efficient for bulk package removal operations.

Updated on: 2026-03-15T23:18:59+05:30

532 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements