In previous article we have seen Installing Application and Synchronizing it with Application PDB.

Introduction to Application Container

Application Container Creation and Installation of Application

In this article, we will see upgrading Application and Patching Application.

1. Upgrade Application in Application Container :

Before starting application upgrade you need to know the current version of Application.

Step 1: Connect the current container as app-pdb

ALTER SESSION SET CONTAINER=APP_PDB;

Step 2: Check the current version pd application

SQL> SELECT APP_NAME,APP_VERSION FROM DBA_APPLICATIONS WHERE APP_IMPLICIT='N';

APP_NAME															 APP_VERSION
-------------------------------------------------------------------------------------------------------------------------------- ------------------------------
APP_PDB 															 1.0

Step 3: Start upgrade application

SQL> ALTER PLUGGABLE DATABASE APPLICATION APP_PDB BEGIN UPGRADE '1.0' TO '2.0';

Pluggable database altered.

Step 4 : We can see as the result of the above upgrade statement one PDB “F348281081_21_1” created as a clone of app_pdb

SQL> show pdbs;

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 TESTPDB1			  MOUNTED
	 4 APP_PDB			  READ WRITE NO
	 5 APP_SAL			  MOUNTED
	 6 F348281081_21_1		  READ ONLY  NO

Step 5 : Run upgrade script

SQL>@/u01/upg_2.0.sql

Step 6 : End upgrade

SQL> ALTER PLUGGABLE DATABASE APPLICATION APP_PDB END UPGRADE TO '2.0';

Pluggable database altered.

Step 7 : Connect to application pdb :

[oracle@localhost admin]$ sqlplus sys/oracle@app_sal as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 30 02:17:44 2018

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>

Step 8 : Synchronize application pdb with application root :

SQL> ALTER PLUGGABLE DATABASE APPLICATION APP_PDB SYNC;

Pluggable database altered.

2. Patching application root and application pdb :

Minor changes in application constitutes Application Patches. Let us see step by step procedure to apply a patch and synchronizing it with application pdb.

The current user must have the ALTER PLUGGABLE DATABASE  system privilege, and the privilege must be commonly granted in the application root.

Step 1 : Connect to the application root

Step 2 : applying patch statement needs patch number and the minimum version of an application on which this patch can be applied :

SQL> ALTER PLUGGABLE DATABASE APPLICATION APP_PDB BEGIN PATCH 1783 MINIMUM VERSION '2.0';

Pluggable database altered.

This patch can be applied only on an application running on 2.0 version.

Step 3 : Apply patch script

SQL>@/u01/patches/pat_1783.sql

Step 4 : End patching

SQL> ALTER PLUGGABLE DATABASE APPLICATION APP_PDB END PATCH 1783;

Pluggable database altered.

You can sync patching to application pdbs using step 8 of the Upgrade procedure.

Stay tuned for More articles on Oracle Multitenant

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

 

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.