8.4 Migrating Oracle R Enterprise After a Database Upgrade

After upgrading your Oracle Database, you must migrate your Oracle R Enterprise Server components to the new ORACLE_HOME.

If you do not migrate the Oracle R Enterprise Server components to the new ORACLE_HOME, then running an R function using Oracle R Enterprise embedded R execution results in errors such as:
ORA-28578: protocol error during callback from an external procedure

The components of Oracle R Enterprise Server are:

  • The Oracle Database schema RQSYS and schema-related objects

  • Oracle Database shared libraries for supporting Oracle R Enterprise clients

  • Oracle R Enterprise packages and supporting packages installed on the Oracle Database server

After a database upgrade, you must migrate the RQSYS schema and dependent database components to the new ORACLE_HOME. The Oracle R Enterprise packages must also be installed to the new database location.

You can easily do this by running the Oracle R Enterprise Server installation script against the new ORACLE_HOME. Doing so creates a new path to the ORACLE_HOME in the Oracle R Enterprise metadata.

If the Oracle R Enterprise user already exists in the upgraded database, then use the --no-user flag when running the server script.

The following steps illustrate migrating Oracle R Enterprise 1.5.0 from an initial database installation to a new database after a database upgrade. Oracle Database was upgraded from Release 12.1.0.2 to Release 12.2.0.1. Oracle R Distribution and Oracle R Enterprise are not upgraded, only migrated to the new ORACLE_HOME.

  1. Before migrating the Oracle R Enterprise components, back up the RQSYS schema and Oracle R Enterprise user schema.
  2. Run the Oracle R Enterprise Server installation script against the new ORACLE_HOME.
    $ ./server.sh --no-user
  3. As the sysdba user, verify that the Oracle R Enterprise configuration script is pointing to the new ORACLE_HOME:
    SQL> SELECT * FROM sys.rq_config;
    NAME                                                       VALUE
    ——————-----  ————————————————————————--------------------------- 
    R_HOME       /usr/lib64/R  
    R_LIBS_USER  /u01/app/oracle/product/12.2.0.1/dbhome_1/R/library
    VERSION      1.5
    ...
    
  4. As the sysdba user, verify that the Oracle R Enterprise dependent libraries ore.so and librqe.so are in the new ORACLE_HOME:
    SQL> select library_name, file_spec from all_libraries where owner = 'RQSYS';
    LIBRARY_NAME                                                FILE_SPEC
    ------------  -------------------------------------------------------
    RQ$LIB        /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/ore.so
    RQELIB        /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/librqe.so
    
  5. Finally, test the Oracle R Enterprise installation against the upgraded ORACLE_HOME by running Oracle R Enterprise demonstration programs.