Rem Rem $Header: sdo/admin/semu111post.sql /st_sdo_11.2.0/1 2011/04/29 12:19:52 sdas Exp $ Rem Rem semu111post.sql Rem Rem Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Rem Rem NAME Rem semu111post.sql - Rem Rem DESCRIPTION Rem Rem Rem NOTES Rem Rem Rem MODIFIED (MM/DD/YY) Rem matperry 03/08/11 - Created Rem ---------------------------------------------------------------------- -- Called after upgrade -- -- Makes any calls to the new codebase to finish upgrading the -- -- semantics installation -- -- calls semu112post so that post processing is "stacked" -- ---------------------------------------------------------------------- alter session set current_schema=MDSYS; -- add SKOSCORE rulebase if a network is present -- -- We should do this in semu111.sql but create_rulebase could be invalid, -- so we are doing it after loading all 11.2 packages declare network_exists number; skos_exists number; rl_exists number; begin -- see if RDF Network is present in DB SELECT count(*) INTO network_exists FROM ALL_TABLES WHERE table_name='RDF_VALUE$' AND owner='MDSYS'; if (network_exists > 0) then -- create SKOS rulebase if it doesn't already exist -- skos_exists := 0; begin execute immediate 'select count(*) from mdsys.rdf_rulebase$ where name=''SKOSCORE''' into skos_exists; exception when others then null; end; if (skos_exists = 0) then mdsys.rdf_apis_internal.create_rulebase('SKOSCORE'); begin execute immediate 'update mdsys.rdf_rulebase$ set owner= (select owner from mdsys.rdf_rulebase$ where name=''RDFS'') where name=''SKOSCORE'''; exception when others then null; end; begin EXECUTE IMMEDIATE 'GRANT SELECT ON "SEMR_SKOSCORE" TO PUBLIC'; exception when others then null; end; begin EXECUTE IMMEDIATE 'GRANT SELECT ON "RDFR_SKOSCORE" TO PUBLIC'; exception when others then null; end; end if; --create RL rulebase if it doesn't already exist (same code as for SKOS, refactor this) rl_exists := 0; begin execute immediate 'select count(*) from mdsys.rdf_rulebase$ where name=''OWL2RL''' into rl_exists; exception when others then null; end; if (rl_exists = 0) then mdsys.rdf_apis_internal.create_rulebase('OWL2RL'); begin execute immediate 'update mdsys.rdf_rulebase$ set owner= (select owner from mdsys.rdf_rulebase$ where name=''RDFS'') where name=''OWL2RL'''; exception when others then null; end; begin EXECUTE IMMEDIATE 'GRANT SELECT ON "SEMR_OWL2RL" TO PUBLIC'; exception when others then null; end; begin EXECUTE IMMEDIATE 'GRANT SELECT ON "RDFR_OWL2RL" TO PUBLIC'; exception when others then null; end; end if; commit; end if; end; / show errors; -- call semu112post -- @@ semu112post.sql