Step 1: Take Oracle Binaries TAR backup before proceeding with Patching activity. tar -cvzf /backup_location/TAR_BKP_Oracle_Binaries.tar.gz $ORACLE_HOME |
Step 2: Login to Oracle Metalink Support and go to the tab “Patches & Updates”. Select Oracle Database, product, and release with correct Platform.Click on tab “Search”. Check Description and select PSU(Patch Set Update), also check the version is correct or not, click on patch number. You will get another page, just open the readmi file and also click on “download” option. Step 3: Now transfer the downloaded patch to respective server to any location and unzip the zip file. Step 4: Check current opatch version is minimum opatch version to apply the patch. If not then click on the link in Readmi file to download one more opatch version(Refer readmi file). Replace the same with existing opatch version by taking backup of the current one. |
Step 5: Perform prerequisites before applying patch. Example: export ORACLE_SID=test export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export PATH =$ORACLE_HOME/OPatch:$PATH $opatch version $opatch lsinventory $opatch lsinventory | grep applied |
Step 6: Check conflict in patch before applying. $cd PATCH_LOCATION/patch_number/ $opatch prereq CheckConflictAgainstOHWithDetail -ph ./ |
Step 7: Stop all oracle services including database,listener, and agent. SQL> shut immediate; SQL> EXIT; $ps -ef | grep tns $lsnrctl stop $ps -ef | grep agent $cd $AGENT_HOME/bin $./emctl status agent $./emctl stop agent Note : Though your database is shut down, exit from sqlplus session otherwise you will get error while applying patch. |
Step 8: Start patching activity. $opatch apply It will ask “Do you want to proceed?”. Say “YES”. It will also ask “Email Address / User Name :”. Press ENTER. Is the local system ready for patching ?. [y/n] => Say Y Once you done with patching, ensure that there are no errors in the log file. Also resolve any error if you get while applying patch. |
Step 9: Apply below post fix.
Note: Sometimes, you may require to put the database in upgrade mode to run “datapatch -verbose” command. For this, put your database in upgrade mode. SQL> shut immediate; SQL>startup upgrade; SQL> quit $cd $ORACLE_HOME/OPatch $ ./datapatch -verbose SQL> shut immediate; SQL> startup; |
Step 10: Check Oracle library permissions. Go to the location $ORACLE_HOME/lib. $cd $ORACLE_HOME/lib $ls -ltr *sqlplus*. => must have755 $ls -ltr *clnt*.so => Must have 755 permissions |
Step 11: Start all oracle services. $cd $AGENT_HOME/bin $./emctl start agent $./emctl status agent $lsnrctl start $lsnrctl status |
Step 12: Verify everything before handover to client. $ps -ef| grep pmon $lsnrctl status $ps -ef | grep agent $opatch lsinventory SQL> select patch_id,version,action,status,action_time from DBA_registry_sqlpatch order by 5; |
Thanks for reading this post ! Please comment if you like this post ! Click on FOLLOW to get future blog updates !
#9, we are connecting to CDB right?
ReplyDeleteYes, we are connecting the root database i.e. CDB. This is just for setting up the environment variables.Later we are applying patch to Oracle binaries so DB connections are going to be closed.
ReplyDeleteVery well explained on Oracle 12c patch. Thanks for sharing.
ReplyDeleteYes, but there are steps to stop/start PDB for pluggable. You hv to follow the patch readme file for these steps.
ReplyDeleteNprosivcomte Robert Sharp https://marketplace.visualstudio.com/items?itemName=8diapecamda.Descargar-Pet-Idle-gratuita
ReplyDeleteomparbenglink