One of the core features of Stat involves application of Oracle Ebusiness patches. An oft asked question of me is “Can Stat backout a patch?’ and the answer is ‘kind of’. Let me explain and try to clarify. Stat can take backups of the objects replaced in a patch and it can restore those previous versions, much like you can do with migrations and reverting to previous iterations or the baseline set. It however will not truly undo everything that was done it the patch and truly back it out. This should also only be attempted by experienced DBA’s that fully understand the implications and restrictions of what is being done. In this paper I will try to explain how ‘Patch Backout’ works in Stat, what requirements and restrictions exist, and how you would do it in Stat.
How Patch Backout in Stat works
When you apply a patch via Stat you will see an option to ‘Disable Patch Backout’ as seen in the screenshot below.
If you do not check this box or have a Stat.conf parameter set to disable it, then you have the option of performing patch backout. As discussed in the ‘Patch Application’ document in this series, this option has Stat run both ‘Impact Analysis’ and ‘Patch Application’ in the same run. During the ‘Impact Analysis’ phase, Stat will go out and grab backups (if they exist) in that environment. These backups can then be used to revert back to using the ‘Patch Backout’ utility.
What Requirements and Restrictions Exist
As I stated in the introduction, I believe this to be a very powerful tool that should be used by only those with very good knowledge of the implications and restrictions that are part of this process. Patches can have dependencies and, as I discuss later, patches can only be backed out in the order that they were applied. Patches may also contain pieces or code, such as DDL, that will cannot be ‘backed out’ or undone. It’s important to keep these things in mind before attempting a ‘Patch Backout’:
- Was the Patch run with ‘Disable Patch Backout’ or run in a manner that allows the patch to be ‘backed out’?
- In looking at the ‘Impact Analysis’ and the patch ‘Readme’ are there any dependencies or objects that, if the backed up code is recovered, will be negatively impacted?
- Have any other patches been applied since that will need to be ‘backed out’ first and then evaluate #1 and #2 for them as well.
How Patch Backout in Stat works
Start by opening the ‘OraApps Patch Console’ under the top menu Consoles/OraApps Patch Console or the icon on the menu bar.
Navigate to the ‘Environment History’ tab. Select the patch which you would like to ‘Backout’ and then press the ‘Backout’ button on the right side menu.
This opens the ‘Patch Backout Request’ window. Select the ‘Environment’ from the dropdown for the environment you wish to backout the patch. Select the appropriate Maintenance Mode ‘Maint’ or ‘Normal’. Select any pre/post patch scripts you wish to call in the center.
Note: Notice how Stat presents the ‘Backout Order’. Patches must be backed out in the order in which they were applied last to first.
Hit ‘Save’ when you are ready to start ‘Patch Backout.’ You will be prompted to ensure that you “want to back out this patch?” If sure, press ‘Yes.’
Stat will now inform you that the patch will be backed out. Click ‘OK’ and then you can click ‘Close’ to close the window.
In the ‘Environment History’ tab you will see that your patch has been backed out when it shows ‘Patch Backout’ in the ‘Request Type’ column and the ‘Process Status’ is completed.
You have now backed out a patch and understand how Stat can execute a ‘Patch Backout’, the implications and restrictions, and how to utilize this functionality.
Please feel free to ask me questions about this if you need more details.