Skip to main content

APEX Deployment Tool - Recompile invalid objects


Invalid objects are often overlooked. Some teams don't care on DEV, others don't care even on PROD. Why would you care, if all you need to do is to wait for a first user who would crunch through the errors and that would recompile the invalid objects, right? It is not that hard to make sure everything is valid...

This is part of multiple ADT articles:

If you are looking for a PL/SQL solution, checkout the recompile procedure, which is part of the CORE project.

ADT comes with improved script which can be part of your CI/CD pipeline.

cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile

It recompiles invalid objects, but also the valid ones if you need to change PL/SQL flags. You can also limit the objects by object type and name. It shows progress bar, status before, status after, invalid objects with first error and it posts results to your Teams channel, so your team mates will be aware about broken things.

cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile -target DEV
cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile -target UAT
cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile -target PROD
cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile -target DEV -force -native -level 3 -warning SEVERE PERF -scope ALL
cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile -target DEV -name XX%