When upgrading from Oracle Enterprise Manager 12c R1 to R2, the one-system upgrade requires that you place the OMS into a new middleware home. After you’ve validated your R2 installation, and followed the instructions for removing the R1 install, the OMS host’s agent is still running out of your original middleware home so you can’t just remove the entire old directory.
You may have decided to clean up the leftover files from your old middleware home, taking care not to remove the agent. That’s all well and good. But after doing so, you may run into an error the next time you try to deploy the ASH Analytics PL/SQL packages to a database instance.
As a reminder, deploying these packages is done by going to the database target home page, and selecting “ASH Analytics” from the Performance menu.
If you’ve done a cleanup of your old middleware home, you are very likely to receive the following error text in the deployment job:
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_126.96.36.199.0/sql/db/latest/instance/ashviewer_pkgdefs.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_188.8.131.52.0/sql/db/latest/instance/ashviewer_pkgbodys.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_184.108.40.206.0/sql/db/latest/instance/prvs_awr_data.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_220.127.116.11.0/sql/db/latest/instance/prvt_awr_data.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_18.104.22.168.0/sql/db/latest/instance/prvs_awr_data_cp.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_22.214.171.124.0/sql/db/latest/instance/prvt_awr_data_cp.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_126.96.36.199.0/sql/db/latest/instance/dbms_compare_period.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_188.8.131.52.0/sql/db/latest/instance/prvt_compare_period.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_184.108.40.206.0/sql/db/latest/instance/eaddm_pkgdef.sql
Package deployment driver file is at /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_220.127.116.11.0/sql/db/latest/instance/eaddm_pkgbody.sql
Instantiated JDBC Engine with connect string host.domain.com:1521:SID
You can view the output of this execution at the following location /tmp/DB_Deploy_201210171243.log
Altering session to set schema to DBSNMP
urrently executing null :: ALTER SESSION SET CURRENT_SCHEMA = DBSNMP
Altered session to set schema to DBSNMP
Error while executing the script : oracle.sysman.assistants.common.dbutil.SQLFatalErrorException: java.io.FileNotFoundException: /oracle/oem/Middleware/plugins/oracle.sysman.db.oms.plugin_18.104.22.168.0/sql/db/latest/instance/ashviewer_pkgdefs.sql (No such file or directory) at line number - -1
Driver SQL Script encountered errors.
At least the error text makes the problem clear. The SQL files containing the needed packages can’t be found, because EM12cR2 is still looking for them in the old middleware home.
The fix is easy. Just add a symlink in your old middleware home for the ‘plugins’ directory that points to the new middleware home’s plugins directory:
oracle@omshost$ cd /oracle/oem/Middleware
oracle@omshost$ ln -s ../Middleware12cR2/plugins/ ./plugins
Once you’ve finished that, return to the ASH Analytics deployment page and re-run the deployment. It should succeed and you can now take advantage of ASH Analytics!