While running datapatch tool in Oracle 12c, as part of post patching got ORA-20013 error.

Use below steps to solve the issue.

Problem:

 

Solution:

Check the patching related directories from dba_directories.

 

 

Check the ORACLE_HOME :

echo $ORACLE_HOME
/oracle/app/oracle/product/12.1.0.2/dbhome_1

We can see that directories are pointing to wrong location.
So recreate them pointing to correct ORACLE_HOME location.

 

Now run the datapatch tool, it should work fine.