Tree view of the README.html file. Make sure you read the README.html file in details for pre-requisites and the steps to apply patches.
Check existing opatch version in the database server.
cd $ORACLE_HOME/OPatch
./opatch version
Copied latest version of opatch and checked version. But there were errors.
cd $ORACLE_HOME
mv OPatch/ OPatch.001
mv /mnt/Ora19c_Patches/OPatch .
Checked java version and it was 1.8.0_302.
While searching in an Internet for the solution I finally found the way to fix it by adding option jdk at the end of the command as -jdk $ORACLE_HOME/jdk.
cd $ORACLE_HOME/OPatch
./opatch version -jdk $ORACLE_HOME/jdk
Shutdown the database prior to applying patch.
Change directory to DB patch. In my case directory 30869156 contains the DB Patches.
cd 30869156
Export PATH environment variables to include the location of the latest version of opatch. Validate the opatch location using which linux command.
export PATH=$ORACLE_HOME/OPatch:$PATH
which opatch
Check if there is any conflicting interim patches installed in the database with command below.
opatch prereq CheckConflictAgainstOHWithDetail -ph ./ -jdk $ORACLE_HOME/jdk
Once conflict check is passed apply PSU with command below.
opatch apply -jdk $ORACLE_HOME/jdk
Login to database and start database and pdb(s) if applicable.
sqlplus /nolog
conn / as sysdba
startup
alter pluggable database all open;
quit
Applied datapatch with verbose option but noticed error ORA-20001.
Error ORA-20001: Latest xml inventory is not loaded into table
Search on an Internet and modified hidden parameter _disable_directory_link_check to TRUE. It did not worked for me :(
alter system set "_disable_directory_link_check"=TRUE scope=spfile;
shutdown immediate
startup
alter pluggable database all open;
Next solution tried is to created directory OPATCH_LOG_DIR and OPATCH_SCRIPT_DIR. It did not worked for me :( :(
create or replace directory OPATCH_LOG_DIR as
'/u01/app/oracle/product/19.3.0/dbhome_1/QOpatch';
create or replace directory OPATCH_SCRIPT_DIR as
'/u01/app/oracle/product/19.3.0/dbhome_1/QOpatch';
While reading site https://mikedietrichde.com/2020/07/31/upgrade-fails-with-ora-20001-during-datapatch-run/ I came to know about the inventory table OPATCH_XML_INV. I checked the table and noticed the error was due to the opatch.
select * from OPATCH_XML_INV;
I opened the file qopiprep.bat file in the location mentioned above and added option jdk in the command opatch.
cd $ORACLE_HOME/QOpatch
vi qopiprep.bat
I accessed the inventory table once again and it worked.
select * from OPATCH_XML_INV;
Applied datapatch with verbose option and it succeed.
cd $ORACLE_HOME/OPatch
./datapatch -verbose
Once datapatch is completed shutdown database to apply OJVM Patch.
conn / as sysdba
shutdown immediate
exit
Change directory to OJVM patch. Check if any conflicting patch is installed for OJVM patch.
Apply OJVM Patch
Start database in upgrade mode
Apply datapatch with verbose option
Shutdown and start database in normal mode.
Query DBA Patch registry.
Execute opatch lspatches command to list the patches applied.
No comments:
Post a Comment