Rebinding existing packages
Rebind is the process of recreating a previously bound package. Rebinding becomes necessary in the following scenarios:
When the database statistics are updated, we should rebind the existing packages so that fresh access plans are generated. These new access plans will be based on the latest statistics. It becomes significant if any new indexes are added to a table. In such cases, rebinding will result in access plans that can use this index. This is necessary for consistent performance.
If any database object that has a dependency on a package is dropped, then the package becomes invalid. In such cases, we need to rebind the package. This rebinding is optional as all invalid packages are automatically validated and rebound when they are executed. As a best practice, we should rebind even invalid packages once all dependencies are back in place.
A package that depends on user-defined functions becomes inoperative when the underlying UDF is dropped. In such cases...