After a session got stuck/failed or process got killed somehow, we are getting an error trying to re-run datapatch.
[oracle@dune asanzto]$ $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 19.25.0.0.0 Production on Wed Apr 16 19:29:53 2025
Copyright (c) 2012, 2024, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_7755_2025_04_16_19_29_53/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...Unable to acquire sqlpatch global lock in EXCLUSIVE mode
because another datapatch session is currently running.
Waiting for that session to complete before continuing...
Checking if we have a rogue process, we can see the old PID still there:
[root@dune ~]# ps -ef | grep -i opatch
root 962 1 0 16:45 ? 00:00:00 /bin/su oracle -m -c /bin/sh -c 'cd /u01/app/oracle/product/19c/db_1;ORACLE_HOME=/u01/app/oracle/product/19c/db_1 ORACLE_SID=testdb /u01/app/oracle/product/19c/db_1/OPatch/datapatch -verbose'
oracle 5977 2269 0 19:29 pts/1 00:00:00 /bin/sh /u01/app/oracle/product/19c/db_1/OPatch/datapatch -verbose
[root@dune ~]#
We killed, but still the same,no progress.
This case we had to kill the sqlpatch pid, and after this, datapatch completed without issues.
[root@dune ~]# ps -ef | grep sqlpatch | grep -v grep
oracle 983 1 0 16:45 ? 00:00:00 /bin/sh /u01/app/oracle/product/19c/db_1/sqlpatch/sqlpatch -verbose
[root@dune ~]#
[root@dune ~]# kill -9 983
Tadaaa!!!
Comments