MINI MINI MANI MO
Rem
Rem $Header: ordim/admin/immisc.sql /main/8 2017/01/25 11:11:43 smavris Exp $
Rem
Rem immisc.sql
Rem
Rem Copyright (c) 2012, 2017, Oracle and/or its affiliates.
Rem All rights reserved.
Rem
Rem NAME
Rem immisc.sql - Oracle Multimedia Install Miscellaneous
Rem
Rem
Rem DESCRIPTION
Rem Package for miscellaneous functions and procedures used during
Rem install/upgrade/downgrade/patch/reload/etc.
Rem
Rem NOTES
Rem Installed in SYS and run as definers to avoid having to grant
Rem inherit privs on SYS.
Rem
Rem
Rem MODIFIED (MM/DD/YY)
Rem smavris 01/23/17 - Schema qualify
Rem smavris 03/04/16 - Update comments about checking v dollar option
Rem smavris 02/23/16 - Update comment - no more 11.1 downgrade
Rem smavris 12/06/15 - Definers, sys package
Rem smavris 08/07/13 - Remove sets, increate script_name varchar lengths
Rem smavris 03/26/13 - XbranchMerge smavris_bug-16473669 from
Rem st_ordim_12.1.0
Rem smavris 03/15/13 - Common start and end scripts
Rem smavris 07/24/12 - Package for miscellaneous
Rem install/upgrade/patch/downgrade functions and
Rem procedures
Rem smavris 07/24/12 - Created
Rem
Rem BEGIN SQL_FILE_METADATA
Rem SQL_SOURCE_FILE: ordim/admin/immisc.sql
Rem SQL_SHIPPED_FILE: ord/im/admin/immisc.sql
Rem SQL_PHASE:
Rem SQL_STARTUP_MODE: NORMAL
Rem SQL_IGNORABLE_ERRORS: NONE
Rem SQL_CALLING_FILE: $SRCHOME/ordim/admin/catim.sql,ime112.sql,ime121.sql,
Rem impatch.sql,imrelod.sql,imremchk.sql,imupmain.sql
Rem END SQL_FILE_METADATA
Rem
@@?/rdbms/admin/sqlsessstart.sql
create or replace package sys.immisc
authid definer
as
-- ======================================================
-- Bug 22092616
-- Always set check_linked_on to FALSE. According to
-- Siva this is a useless check. The Spatial library
-- should always be linked in because even Locator uses
-- it.
--
-- I'm keeping the parameter here because we've changed
-- our minds about this before. It'll be easier to
-- revert if we have to.
-- ======================================================
function isSDOInstalled (check_linked_on IN BOOLEAN)
return BOOLEAN;
end;
/
create or replace package body sys.immisc
as
-- =========================================================
-- Define the helper function used to determine if Spatial
-- is installed or not. Note, we won't return Spatial
-- installed unless MDSYS exists, because we use this to
-- determine whether or not to install/upgrade/patch/etc
-- Locator. MDSYS must exist for us to 'handle' Locator.
-- =========================================================
function isSDOInstalled (
check_linked_on IN BOOLEAN)
return BOOLEAN
is
mdsyscnt NUMBER := 0;
sdo_status VARCHAR2(20) := NULL;
linked_on NUMBER := 1;
sdo_installed BOOLEAN := FALSE;
begin
--
-- Check whether MDSYS exists. Using dynamic SQL since
-- this fails at compile time (doesn't know we have access
-- to sys.dba_users at runtime).
--
execute immediate 'select count(*) from sys.dba_users ' ||
' where username = ''MDSYS'' '
into mdsyscnt;
--
-- Are we checking linked_on? If not, leave linked_on at default value of 1.
--
if (check_linked_on) then
select count(*) into linked_on from v$option
where parameter='Spatial' and value='TRUE';
end if;
--
-- Now check whether SDO is installed
--
execute immediate 'select sys.dbms_registry.status(''SDO'') from sys.dual'
into sdo_status;
if ((sdo_status is NULL or sdo_status = 'OPTION OFF' or
sdo_status = 'REMOVED' or linked_on = 0) and
(mdsyscnt > 0)) then
sdo_installed := false;
else
sdo_installed := true;
end if;
return sdo_installed;
end;
end;
/
show errors;
@?/rdbms/admin/sqlsessend.sql
OHA YOOOO