Pages

Monday, August 19, 2019

Opatch Interview Questions

Opatch Interview Questions


1. What is Opactch in Oracle?

The Opatch utility is a tool that allows the application and rollback of interim patches to Oracle products. This chapter provides information on using Opatch to apply patches.

2. What is a Catbundle.sql script ?

To make necessary modification to the catalog.
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
sql>@catbundle.sql psu apply
Once you’ve executed the catbundle.sql means your database is fully patched.

3. what a database bundle series ?

A database bundle series is a sequence of patches where each patch in the series includes the contents of the previous patch in the series.

4. How to check conflicts while applying CPU patch?

step 1: unzip your patch zip file
step 2: run below command
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir
Example:
$ unzip p9655017_10204_linux.zip
$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir 9655017

5. Opatch options and description?

* apply: Installs an interim patch. Refer to "apply Command" for more information.
* napply:  Installs n number of patches (hence napply). Refer to "napply Command" for more     information.
* auto: Applies Oracle Clusterware patches. Refer to "auto Command" for more information.
* lsinventory: Lists what is currently installed on the system. Refer to "lsinventory Command" for more information.
* query: Queries a given patch for specific details. Refer to "query Command" for more information.
* rollback: Removes an interim patch. Refer to "rollback Command" for more information.
* version: Prints the current version of the patch tool. Refer to "version Command" for more information.

6. What are the features of opatch?

* Scalability: Opatch is scalable to support a large number of patches.
* Reliability: Opatch is reliable and protects the Oracle home and inventory. It can bring back the Oracle home to a stable state from patch application failures. It can also easily detect patch conflicts.
* Availability: Opatch's online patching improves system availability by allowing database patches   to be applied without needing to shut down databases.
* Portability: Opatch is compatible with all operating systems for which Oracle releases software.
* Robust: Opatch is very robust. It is very easy to apply a patch as well as remove it.
* Easy to maintain: Opatch is easy to maintain and is also extensible.
* Support for Silent Operation: Opatch supports silent operation. This mode allows you to run the software without any user interaction.
* Support for Real Application Clusters: Opatch supports RAC and works well in that setup. It is easy to extend it to Enterprise Manager Grid   Control.
* Easy to debug: Opatch has various levels of logging and tracing mechanisms. It also has a debug option that helps to easily diagnose software problems.

7. Opatch supports the following tasks ?

Applying an interim patch.
Rolling back the application of an interim patch.
Detecting a conflict when applying an interim patch after previous interim patches have been applied. It also suggests the best options to resolve a conflict.
Reporting on installed products and interim patches.

8. What is CPU patch?
Critical Patch Update (CPU) - Release of security fixes each quarter instead the cumulative database security patch for the quarter.

9. What is PSU patch?
Patch Set Updates (PSU) - Cumulative patches that include both the security fixes and priority fixes. They are "version upgrades" modifying the las number of version (11.2.0.1.1, 11.2.0.1.2,...).

10. What is SPU patch?
Security Patch Update (SPU) - It is the new terminology of CPU (From October 2012) . SPU's can't be applied if any PSU's have been applied, unless your database is upgraded with a new base version.

11. In which months oracle release CPU patches?
JAN, APR, JUL, OCT

12. When we applying single Patch, can you use opatch utility?
Yes, we can use Opatch incase of single patch. The only type of patch that can't be used with OPatch is a patchset.

13. Is it possible to apply OPATCH without downtime?
As you know for apply patch your database and listener must be down. When you apply OPTACH it will update your current ORACLE_HOME. Thus coming to your question to the point in fact it is not possible without or zero downtime in case of single instance but in RAC you can Apply Opatch without downtime as there will be more separate ORACLE_HOME and more separate instances (running once instance on each ORACLE_HOME).

14. You have collection of patch (nearly 100 patches) or patchset. How can you apply only one patch from it?

With Napply itself (by providing patch location and specific patch id) you can apply only one patch from a collection of extracted patch. For more information check the opatch util NApply –help. It will give you clear picture.
For Example:
opatch util napply <patch_location> -id 9 -skip_subset -skip_duplicate
This will apply only the patch id 9 from the patch location and will skip duplicate and subset of patch installed in your ORACLE_HOME.

15. How to Apply Opatch in Oracle?

* You MUST read the Readme.txt file included in opatch file, look for any prereq. steps/ post installation steps or and DB related changes. Also, make sure that you have the correct opatch version required by this patch.
* Make sure you have a good backup of database.
* Make a note of all Invalid objects in the database prior to the patch.
* Shutdown All the Oracle Processes running from that Oracle Home , including the Listener and Database instance, Management agent etc.
* You MUST Backup your oracle Home and Inventory
  tar -cvf $ORACLE_HOME $ORACLE_HOME/oraInventory | gzip > Backup_Software_Version.tar.gz
* Unzip the patch in $ORACLE_HOME/patches
* cd to the patch direcory and do opatch -apply to apply the patch.
* Read the output/log file to make sure there were no errors.
* Log file location : /d02/oracle/ebs12/db/tech_st/11.2.0.3.0/cfgtoollogs/opatch/opatch2016-03-30_21-41-45PM_1.log

16. Oracle version 11.2.0.1.0 what does each number refers to?
 
Oracle version number refers:
  11 - Major database release number
   2 - Database Maintenance release number
   0 - Application server release number
   1 - Component Specific release number
   0 - Platform specific release number


17. When we applying single Patch, can you use opatch utility?

Yes, you can use Opatch incase of single patch. The only type of patch that cannot be used with OPatch is a patchset.

18. Is it possible to apply OPATCH without downtime?

As you know for apply patch your database and listener must be down. When you apply OPTACH it will update your current ORACLE_HOME. Thus coming to your question to the point in fact it is not possible without or zero downtime in case of single instance but in RAC you can Apply Opatch without downtime as there will be more separate ORACLE_HOME and more separate instances (running once instance on each ORACLE_HOME).

19. You have collection of patch (nearly 100 patches) or patchset. How can you apply only one patch from it?

With Napply itself (by providing patch location and specific patch id) you can apply only one patch from a collection of extracted patch. For more information check the opatch util NApply –help. It will give you clear picture.
For Example:
opatch util napply <patch_location> -id 9 -skip_subset -skip_duplicate
This will apply only the patch id 9 from the patch location and will skip duplicate and subset of patch installed in your ORACLE_HOME.

20. Oracle version 10.2.0.4.0 what does each number refers to?

Oracle version number refers:
10 – Major database release number
 2 – Database Maintenance release number
 0 – Application server release number
 4 – Component Specific release number
 0 – Platform specific release number


21. Will Patch Application affect System Performance?

Sometimes applying certain patch could affect Application performance of SQL statements. Thus it is recommended to collect a set of performance statistics that can serve as a baseline before we make any major changes like applying a patch to the system.

Can you stop applying a patch after applying it to a few nodes? What are the possible issues?

Yes, it is possible to stop applying a patch after applying it to a few nodes. There is a prompt that allows you to stop applying the patch. But, Oracle recommends that you do not do this because you cannot apply another patch until the process is restarted and all the nodes are patched or the partially applied patch is rolled back.

22. How you know impact of patch before applying a patch?

OPATCH <option> -report
You can use the above command to know the impact of the patch before actually applying it.

23. How can you run patching in scripted mode?

opatch <option> -silent
You can use the above command to run the patches in scripted mode.

Can you use OPATCH 10.2 to apply 10.1 patches?

No, Opatch 10.2 is not backward compatible. You can use Opatch 10.2 only to apply 10.2 patches.

24. What you will do if you lost or corrupted your Central Inventory?

In that case when you lost or corrupted your Central Inventory and your ORACLE_HOME is safe, you just need to execute the command with –attachHomeflag, OUI automatically setup the Central Inventory for attached home.

25. What you will do if you lost your Oracle home inventory (comps.xml)?

Oracle recommended backup your ORACLE_HOME before applying any patchset. In that case either you can restore your ORACLE_HOME from the backup or perform the identical installation of the ORACLE_HOME.

26. Different types of Patch Conflicts - Superset/Subset/Duplicate/Bug/File?

1.Superset
If all the bugs fixed by a patch which is already installed in the Oracle Home are also fixed by the patch to be applied, then the patch to be applied is considered a superset of the patch already applied.
Example:
Patch A, which is already installed in the Oracle home, fixed bugs 1, 2, and 3
Patch B,which is to be installed, fixes bugs 1, 2, 3, and 4.
Patch B is considered a superset of Patch A.
Result: it is not considered as an error situation. OPatch removes the subset patches from the Oracle Home and applies the new patch.

2.Subset
If all the bugs fixed by the patch being installed are fixed in a patch already installed in the Oracle Home, the patch being installed is a subset.

Example:
Patch A, which is already installed in the Oracle home, fixed bugs 1, 2 and 3
Patch B, which is to be installed, fixes bugs 1 and 2.
Patch B is a subset of Patch A
Result: it is not considered as an error situation. Patch B will not be installed and reported as a subset to Patch A

3.Duplicate
If a patch is installed and it is reinstalled, it is considered a duplicate
Example:
Patch A, which is already installed in the Oracle home, fixed bugs 1, 2 and 3
Patch A is reinstalled
 Results: If -skip_duplicate is included in the apply command, OPatch will skip the duplicate.  If not set, OPatch will rollback Patch A and reapply it

4.Bug Conflict
If a patch already installed in the Oracle Home has updated an object which the patch being installed also updates, the patch being installed is in Conflict with the patch already installed.
Example:
Patch A, which is already installed in the Oracle home, updates aaa.o, bbb.o and ccc.o in libserver10.a
Patch B, which is to be installed, updates aaa.o and ddd.o in libserver10.a
Patch B is in conflict with Patch A because they both update object aaa.o in libserver10.a
Result: OPatch reports Patch B is in conflict with Patch A and recommends an SR be filed requesting a merge of Patch A and Patch B created.  If the option to continue the installation is selected, Patch A will be rolled back and Patch B will be installed.  The bugs fixed in Patch A will no longer be fixed.

5.File Conflict
If a patch already installed in the Oracle Home has updated files which the patch being installed also updates, the patch being installed is in File Conflict with the patch already installed.
Example:
Patch A, which is already installed in the Oracle home, updates ins_rdbms.mk and env_rdbms.mk
Patch B, which is to be installed, updates ins_rdbms.mk, env_rdbms.mk and ins_sqlplus.mk
Patch B is in conflict with Patch A because they both update ins_rdbms.mk and env_rdbms.mk
Result: OPatch reports Patch B is in conflict with Patch A and recommends an SR be filed requesting a merge of Patch A and Patch B created.  If the option to continue the installation is selected, Patch A will be rolled back and Patch B will be installed.  The bugs fixed in Patch A will no longer be fixed.

Attention
It may happen that opatch returns a confusing output such as
"..is a  bug superset of patch .......but is not a file superset."
ex.:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./13343461
.................................................................................................
Given patch "13343461" is a bug superset of patch "12419384" but is not a file superset.

The "is not a file superset" can be just ignored and will be fixed in later OPatch versions

27. Types of patches ?

Critical Patch Update (CPU) now refers to the overall release of security fixes each quarter rather than the cumulative database security patch for the quarter.  Think of the CPU as the overarching quarterly release and not as a single patch.

Patch Set Updates (PSU) are the same cumulative patches that include both the security fixes and priority fixes.  The key with PSUs is they are minor version upgrades (e.g., 11.2.0.1.1 to 11.2.0.1.2).  Once a PSU is applied, only PSUs can be applied in future quarters until the database is upgraded to a new base version.

Security Patch Update (SPU) terminology is introduced in the October 2012 Critical Patch Update as the term for the quarterly security patch.  SPU patches are the same as previous CPU patches, just a new name.  For the database, SPUs can not be applied once PSUs have been applied until the database is upgraded to a new base version.

Bundle Patches are the quarterly patches for Windows and Exadata which include both the quarterly security patches as well as recommended fixes.


No comments:

Post a Comment