In the previous post, we talked about application maintenance within an Application Root Container, specifically an application installation. As promised, let’s talk about application
upgrade, find out what it is and how to perform it.
The application upgrade can be performed only on an existing application (that is obvious), and it involves changing the physical architecture of the application. During the upgrade you might add new tables, packages, users, alter tables, views…you get the idea, anything that would change the physical architecture of the application. You can also run DML statements.
The following three things are mandatory to be specified when upgrading the application:
1)the name of the application
2)old application version
3)new application version
The statement you use is similar to the one you used for installing the application, with the slight difference of BEGIN UPGRADE instead:
ALTER PLUGGABLE DATABASE APPLICATION hr_app BEGIN UPGRADE ‘v1.0’ to ‘v2.0’;
The application upgrade follows the same 4 steps as the installation, and as any maintenance operation:
1) login to the application root
2) start the maintenance process: upgrade
3) alter the application
4) end the maintenance process
Did you know that during the application upgrade process the application remains available, because Oracle clones the application root? The name of the container will be a random combination of letter and numbers, usually starting with the letter F: F3213955783_41_1. When you issue the BEGIN UPGRADE statement, the original version of the Application Root is cloned, and all the application PDBs belonging to the
Application Root, are pointed to the cloned Application Root. When you issue the END UPGRADE statement, the Application Root is upgraded to the newer version, the Cloned Application Root is still at the original version and the Application PDBs are pointing to the Cloned Application Root. When you Sync the application PDBs, some of them will point to the upgraded Application Root, and some of the will still point to the Cloned Application Root. The fact that the Application Root is cloned, means
that you must have the free space available to accommodate the clone. The Cloned Application Root will be present until all the application PDBs are synced with the application root, and the compatibility version is set. We’ll discuss this in an upcoming post.
Here is an example of the Application Upgrade process.