During Oracle DB 19.9 patching, hit 2 speared issue for opatch & srvctl, at the end all relate to DB login issue with /var/tmp/.oracle socket locks.
dataptch error for ORA-12547:
$ ./datapatch -verbose
SQL Patching tool version 19.9.0.0.0 Production on Fri Jan 29 18:44:56 2021
Copyright (c) 2012, 2020, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_20567_2021_01_29_18_44_56/sqlpatch_invocation.log
Connecting to database...
Error: prereq checks failed!
Database connect failed with: ORA-12547: TNS:lost contact (DBD ERROR: OCIServerAttach)
Please refer to MOS Note 1609718.1 and/or the invocation log
...
srvctl error with ORA-01017:
$ srvctl start database -db c19_dwhtest_x6e3
PRCR-1079 : Failed to start resource ora.c19_dwhtest_x6e3.db
CRS-5017: The resource action "ora.c19_dwhtest_x6e3.db start" encountered the following error:
ORA-01017: invalid username/password; logon denied
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/hkx6e3db01/crs/trace/crsd_oraagent_oracle.trc".
CRS-2674: Start of 'ora.c19_dwhtest_x6e3.db' on 'hkx6e3db01' failed
CRS-2632: There are no more servers to try to place resource 'ora.c19_dwhtest_x6e3.db' on that would satisfy its placement policy
Solution:
Remove /var/tmp/.oracle folder to release socket locks. Exit and re-login to oracle session, startup DB then proceed the previous steps.
CAUTION: this action would terminate all the running oracle DB instances in the host. equal to kill pmon process or shutdown abort. Suggest run the command in oracle account, to prevent it messing grid/root processes.
$ rm -rf /var/tmp/.oracle/
Reference: