Friday, November 22, 2019

how to resolve ./datapatch hangs for 12c and run cat bundle for 12c?

Oracle 12c has introduced ./datapatch script which takes care of the post patching steps such as cat bundle run as performed for 11g.

This script exists in opatch directory in oracle home. cd $ORACLE_HOME/OPatch

set the environment for the database where you want to run the post patching cat bundle.

. oraenv
pwal

cd $ORACLE_HOME/OPatch
./datapatch

SQL Patching tool version 12.1.0.2.0 Production on Wed Nov 15 11:06:38 2017
Copyright (c) 2012, 2017, Oracle. All rights reserved.

Log file for this invocation: /refresh/home/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_14112_2017_11_15_11_06_38/sqlpatch_invocation.log

Connecting to database…OK <=================

now this is were the data patch hangs for hours. There were a few articles provided by support to resolve this. In my case i tried and both did not work.

1. make sure you have db link.
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=554764476646724&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2329511.1&_afrWindowMode=0&_adf.ctrl-state=nq6pppq7e_53

2. make sure there are no locks.
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=554749085416735&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2402880.1&_afrWindowMode=0&_adf.ctrl-state=nq6pppq7e_4

Keep the queues stopped and keep the below two parameter value as 0.
Note job_queue_processes value and set to zero
Note aq_tm_processes value and set to zero

when you are about to run the datapatch perform steps 3 real quick and then run the datapatch as in my case it did not work otherwise.  

3. The solution which worked for me was bounce the database after performing step 2.  Using server control I stopped the database and restarted it and then ran the ./datapatch.
[oracle@test1 OPatch]$ srvctl status database -d PWAL
Instance PWAL1 is running on node test1
Instance PWAL2 is running on node test2
[oracle@test1 OPatch]$ srvctl stop database -d PWAL
[oracle@test1 OPatch]$ srvctl start database -d PWAL
[oracle@test1 OPatch]$ srvctl status database -d PWAL
Instance PWAL1 is running on node test1
Instance PWAL2 is running on node test2


. oraenv
pwal

cd $ORACLE_HOME/OPatch
./datapatch

it should finish cleanly. Just make sure to start the queue back and set the two parameter back to original value.

hope this helps. 

No comments:

Post a Comment