Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Another version was published at Note on CORE_SYS Update !Change log:

Date:

Author:

Version:

Changes:

Completed

Ext.

Int.

Is in Core

24 April 2013

DBA

1.0

Note on CORE_SYS Update

Yes

X

 

 


CORE_SYS

In consequence of conflicts occurring in Oracle name spaces, the SYS package has been replaced by the CORE_SYS package.

The CORE_SYS package includes functionality found in the existing versions of the SYS package. Internal database references to the former SYS package (in triggers and PL/SQL procedures and packages) will exist for while yet, but will be cleaned out in time, and a wrapper has been developed to handle such references in a transition period so as not to invalidate Java code.

Building the Wrapper

The wrapper is a collection of functions and synonyms located in the SYS schema, where the function name starts with "RATOR_" making it easy to identify. The function in the SYS schema calls the relevant function in the CORE_SYS package, and the synonym ensures that the name resolution works.

For example, the wrapper for the NEXTOID function in the CORE_SYS package in the RATOR schema (RATOR.CORE_SYS.NEXTOID) will work as follows:

  • The function SYS.NEXTOID is called and using the synonym translated to SYS.RATOR_NEXTOID.
  • The function SYS.RATOR_NEXTOID will call the function RATOR.CORE_SYS.NEXTOID
  • The function RATOR.CORE_SYS.NEXTOID will do its work and will return the result to the caller through the wrapper SYS.RATOR_NEXTOID.

The SQL code required to rebuild the wrapper is distributed to the customers as the source code for security against the loss of the code during an Oracle update, as Oracle reserves the right to delete all objects in the SYS and SYSTEM schemas during an update, i.e. the wrapper will be lost.

Installing CORE_SYS Package

Required files

Installing the CORE_SYS package requires the following files:

core_sys_install.sql

Installation script for the core_sys package

core_sys.pks

Package specification

core_sys.pkb

Package body

core_sys_wrapper_install.sql

Installation script for core_sys_wrapper functions and associated context code

core_sys_wrapper.sql

The real wrapper code including calls to the context tracker

rator_sysctx.sql

Script for creating the context area

rator_sysctxpkg.pks

Package specification for access to the context area

rator_sysctxpkg.pkb

Package body for access to the context area

Installation

The only tool to be used is SqlPlus run from the database server.

At the start of the installation scripts there are defines for the RATOR and RATOR_CDR users. These can be changed, if the customer's setup differs from the standard (e.g. EASY).

  • Connect to the database server using RDP or ssh, and copy the installation files to a directory on the database server.
  • Ensure that the ORACLE_SID environment variable has been set.
  • Define a folder in the DB server where alle the files are located.
  • Change to that folder from the command line.
  • Connect to the database as SYS user with:

    CMD> sqlplus / as sysdba

Installing the core_sys Software

You are connected to the database as the user SYS.

  • Execute the core_sys_install script with:

    SQL> @core_sys_install
  • Check the terminal output carefully for any errors, fix and rerun as required.

Installing the core_sys_wrapper Software

You are connected to the database as the user SYS.

  • Execute the core_sys_wrapper_install script with:

    SQL> @core_sys_wrapper_install
  • Check the terminal output carefully for any errors, fix and rerun as required.

Removing old SYS

  • Connect to the database as RATOR_CDR.
  • Remove the SYS synonym with:

    SQL> drop synonym sys;
  • Check for any code (trigger, function, procedure or package) that has become invalid because the reference to RATOR.SYS has been hardcoded.

  • Fix those errors by changing the hardcoded reference RATOR.SYS to CORE_SYS.
  • Connect to the database as RATOR
  • Remove the SYS package with:

    SQL> drop packagesys;
  • Remove the SYS synonym with:

    SQL> drop synonym sys;
  • Check for any code (trigger, function, procedure or package) that has become invalid because the reference to RATOR.SYS has been hardcoded.

  • Fix those errors by changing the hardcoded reference RATOR.SYS to CORE_SYS.

Final step (verification) after the CORE_SYS package is installed

If you encounter the issue regarding the function sys.WAIT_MAX(1) on the RATOR.AGGREGATION and RATOR.POST_DEPLOYMENT_VERIFICATION  packages, you must follow the instructions below:

1. Aggregation package: The solution is to get rid of the function “NEXTOID” from the Aggregation package, these are the steps:

  •  Delete the function “NEXTOID” from the declaration itself and the following function in the body of the package: 
   FUNCTION NEXTOID 
      RETURN NUMBER IS 
      NEXT_VAL   NUMBER; 
   BEGIN 
      SELECT SYSTEM_OID_AGG.NEXTVAL INTO NEXT_VAL FROM DUAL; 
  
      IF NEXT_VAL = 1 THEN 
         sys.WAIT_MAX (1); 
      END IF; 
  
      RETURN TO_NUMBER ( (TO_CHAR (SYSDATE, 'YYYYMMDDHH24MISS') || TRIM (TO_CHAR (NEXT_VAL, '0000')))); 
   END NEXTOID; 
  •  In the body everywhere there is aggregation.nextoid change to core_sys.nextoid;

2. POST_DEPLOYMENT_VERIFICATION PACKAGE: 

change the “sys.WAIT_MAX(2)” to “dbms_lock.sleep(2)”
This solution applies to all the similar setbacks you might find. 

 

Wholesale database

It could be that in the wholesale database the table "users" is missing. If that is the case it is enough to add an empty "users" table.

Another issue you may face on the wholesale database is that the sequence "payref_seq" is missing. If that is the case, you can add it from the retail database.