Rem Rem $Header: sdo/admin/semupgrd.sql /st_sdo_11.2.0/1 2011/04/29 12:19:52 sdas Exp $ Rem Rem semupgrd.sql Rem Rem Copyright (c) 2010, 2011, Oracle and/or its affiliates. Rem All rights reserved. Rem Rem NAME Rem semupgrd.sql - Rem Rem DESCRIPTION Rem Rem Rem NOTES Rem Rem Rem MODIFIED (MM/DD/YY) Rem matperry 03/10/11 - add better logging Rem matperry 08/26/10 - Created Rem ------------------------------------------------------------------------------------ -- This script performs a patch upgrade of the semantic component for all prior -- -- releases supported for upgrade (11.2.0.1.0 and above in this case) -- ------------------------------------------------------------------------------------ WHENEVER SQLERROR CONTINUE; COLUMN :script_name1 NEW_VALUE comp_file1 NOPRINT VARIABLE script_name1 VARCHAR2(50) COLUMN :script_name2 NEW_VALUE comp_file2 NOPRINT VARIABLE script_name2 VARCHAR2(50) alter session set current_schema=MDSYS; -- get the appropriate scripts for the upgrade -- declare type_112_exists NUMBER; post_ng_exists NUMBER; begin -- see if 11.2 is installed SELECT count(*) INTO type_112_exists FROM ALL_OBJECTS WHERE object_name='RDF_PARAMETER' AND owner='MDSYS'; -- if 11.2+ is installed then upgrade installation -- if (type_112_exists > 0) then SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE, 'SEM_INSTALL: Upgrading Semantic Technologies'); -- make sure patch hasn't already been installed execute immediate 'select count(*) from mdsys.rdf_parameter where namespace = :1 and attribute = :2 and description = :3 and value in (:4, :5)' into post_ng_exists using 'MDSYS','SEM_VERSION','VALID','11202_P1','11203'; if (post_ng_exists > 0) then -- named graph patch already applied, so no need to update types, tables and views :script_name1 := dbms_registry.nothing_script; else -- update types, tables, views -- :script_name1 := '@semu112.sql'; end if; -- load new code -- :script_name2 := '@semrelod.sql'; -- else semantic component has not been installed, so do nothing -- else SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE, 'SEM_INSTALL: Not upgrading Semantic Technologies: release 11.2.0.1.0 or later is not installed'); :script_name1 := dbms_registry.nothing_script; :script_name2 := dbms_registry.nothing_script; end if; end; / -- run the appropriate scripts -- alter session set current_schema=MDSYS; SELECT :script_name1 FROM DUAL; @&comp_file1 SELECT :script_name2 FROM DUAL; @&comp_file2 alter session set current_schema=SYS;