Monday, August 30, 2021

Boot OL8 in single user mode to reset root password.

2:46 PM Posted by Dilli Raj Maharjan No comments

Booting OL8 in single user mode to reset root password.

Press e to edit the boot menu.



Once boot options is displayed, add rd.break at the end of the linux.. . Below is the screenshot of the rd.break at the end. Once rd.break is added Press CTRL + x to boot system in single user mode.



Once booted into single user mode, it looks something like below.



Remount /sysroot with rw and chroot to /sysroot.



Now change password with passwd command.



Once password is changed. Type exit get out of chroot. Type reboot to restart normal.



Sunday, August 29, 2021

Applying PSU Oracle database 19c

5:08 PM Posted by Dilli Raj Maharjan , No comments

    



    Since Oracle database version 12.2.0.1, Oracle has changed patching model from Patch Set Updates(PS) and Proactive Bundle Patches(BP) to Release Updates(RU) and Release Update Revisions(RUR). Release updates changes the second number from the database version. Following are the steps by step guide to apply RU and upgrading database from 19.3.0.0.0 to 19.7.0.0.0.

       Go to MOS document below and download Oracle RU and opatch utility. It is always good idea to download latest version of the opatch from MOS site. Search for patch number 6880880 to download the latest version of opatch. If you are not able to download the latest version of opatch then go to Patch README.html file and make sure the version of patch you have match the least required version of opatch. 

Primary Note for Database Proactive Patch Program (Doc ID 888.1)

Once you have downloaded the patches. Extract them
unzip p30869156_190000_Linux-x86-64.zip
unzip p6880880_190000_LINUX.zip

List of the patches downloaded from MOS site.

Extracted DB and OJVM combo patch.

Extracted Opatch utilities.


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.