MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/olap/admin/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/olap/admin/apsdbmig.sql

Rem
Rem Copyright (c) 2002, 2017, Oracle and/or its affiliates. 
Rem All rights reserved.
Rem
Rem    NAME
Rem      apsdbmig.sql - migration script for upgrading olap aw component
Rem
Rem    DESCRIPTION
Rem      Migration script for providing upgrading to the olap aw component
Rem
Rem    NOTES
Rem
Rem    
Rem    
Rem    BEGIN SQL_FILE_METADATA
Rem    SQL_SOURCE_FILE: oraolap/admin/apsdbmig.sql
Rem    SQL_SHIPPED_FILE: olap/admin/apsdbmig.sql
Rem    SQL_PHASE: UPGRADE
Rem    SQL_STARTUP_MODE: UPGRADE
Rem    SQL_IGNORABLE_ERRORS: NONE
Rem    END SQL_FILE_METADATA
Rem    
Rem    MODIFIED   (MM/DD/YY)
Rem    cchiappa    09/20/16 - Upgrade from 12.2
Rem    cchiappa    02/03/16 - Check for errors
Rem    cchiappa    08/05/14 - 12.2 support
Rem    cchiappa    02/03/11 - V12 support
Rem    zqiu        02/21/08 - 11gR1 support 
Rem    awesley     04/21/06 - 10gR2 support 
Rem    cdalessi    08/24/04 - 10gR1 support 
Rem    cdalessi    11/03/03 - fix banner 
Rem    cdalessi    08/20/03 - Add aps_validate call
Rem    cdalessi    02/06/03 - 
Rem    cdalessi    01/22/03 - Set registry to upgraded
Rem    cdalessi    01/21/03 - Fix typos, compatibility checks and
Rem                           reload logic
Rem    cdalessi    12/09/02 - 10i migration changes
Rem    cdalessi    10/14/02 - change to cataps
Rem    cdalessi    08/15/02 - Creation

execute sys.dbms_registry.upgrading('APS' ,'OLAP Analytic Workspace' ,'aps_validate','');

COLUMN :aps_relod NEW_VALUE aps_relod NOPRINT
VARIABLE aps_relod VARCHAR2(128)
COLUMN :aps_fname NEW_VALUE aps_file NOPRINT
VARIABLE aps_fname VARCHAR2(128)
DECLARE
  compat VARCHAR2(30);
BEGIN
  :aps_relod := '?/rdbms/admin/nothing.sql';

  -- if the current version of APS is 12cR1
  IF substr(dbms_registry.version('APS'),1,4)='12.2' THEN
    :aps_fname := 'apsu122.sql';
    :aps_relod := 'apsrelod.sql';
  -- if the current version of APS is 12cR1
  ELSIF substr(dbms_registry.version('APS'),1,4)='12.1' THEN
    :aps_fname := 'apsu121.sql';
    :aps_relod := 'apsrelod.sql';
  -- if the current version of APS is 11gR2
  ELSIF substr(dbms_registry.version('APS'),1,4)='11.2' THEN
    :aps_fname := 'apsu112.sql';
    :aps_relod := 'apsrelod.sql';
  -- if the current version of APS is 11gR1
  ELSIF substr(dbms_registry.version('APS'),1,4)='11.1' THEN
    :aps_fname := 'apsu111.sql';
    :aps_relod := 'apsrelod.sql';
  -- if the current version of APS is 10gR2
  ELSIF substr(dbms_registry.version('APS'),1,4)='10.2' THEN
    :aps_fname := 'apsu102.sql';
    :aps_relod := 'apsrelod.sql';
  -- if the current version of APS is 10gR1
  ELSIF substr(dbms_registry.version('APS'),1,4)='10.1' THEN
    :aps_fname := 'apsu101.sql';
    :aps_relod := 'apsrelod.sql';
  ELSIF substr(dbms_registry.version('APS'),1,5)='9.2.0' THEN
    -- upgrade it;  basically, we just rerun the install
    -- script; so no reload would be necessary; in fact, it
    -- would redundant;
    -- we call upgrade so the registry is set to 'Upgraded'
    :aps_fname := 'apsu920.sql';
  ELSE
    -- otherwise, if the OLAP option is turned ON
    select value into compat from v$option where parameter='OLAP';
    IF upper(compat) = 'TRUE' THEN
      -- Put the component in, no reload would be necessary
      :aps_fname := 'cataps.sql';
    ELSE
      :aps_fname := '?/rdbms/admin/nothing.sql';
    END IF;
  END IF;
END;
/

SELECT :aps_fname FROM DUAL;
@@&aps_file

SELECT :aps_relod from DUAL;
@@&aps_relod

execute sys.dbms_registry.upgraded('APS');

Rem Check for errors during upgrade, set status to INVALID if errors found
BEGIN
  IF sys.dbms_registry.count_errors_in_registry('APS') > 0 THEN
      sys.dbms_registry.invalid('APS');
  END IF;
END;
/

OHA YOOOO