Rem Rem $Header: sdo/admin/sdocswpv.sql /main/6 2009/10/13 12:50:15 bkazar Exp $ Rem Rem sdocswpv.sql Rem Rem Copyright (c) 2006, 2009, Oracle and/or its affiliates. Rem All rights reserved. Rem Rem NAME Rem sdocswpv.sql - Rem Rem DESCRIPTION Rem Rem Rem NOTES Rem Rem Rem MODIFIED (MM/DD/YY) Rem bkazar 10/12/09 - bug 9006338 - roles set as not identified Rem sravada 12/23/08 - bug 7659056 Rem rchatter 01/12/06 - Created Rem alter session set current_schema=sys; -- drop role spatial_csw_admin; -- create role spatial_csw_admin identified by spatial_csw_admin; declare stmt VARCHAR2(10000); begin stmt := ' CREATE role spatial_csw_admin not identified '; execute immediate stmt; exception when others then null; end; / -- drop user spatial_csw_admin_usr cascade; -- CREATE USER spatial_csw_admin_usr IDENTIFIED BY spatial_csw_admin_usr; -- the password for spatial_csw_admin_usr can be set by the user after installation declare stmt VARCHAR2(10000); rec_count NUMBER; begin select count(*) into rec_count from DBA_USERS where USERNAME = 'SPATIAL_CSW_ADMIN_USR' ; if(rec_count = 0) then stmt := ' CREATE USER spatial_csw_admin_usr IDENTIFIED BY spatial_csw_admin_usr '; execute immediate stmt; else stmt := ' drop user spatial_csw_admin_usr cascade '; execute immediate stmt; stmt := ' CREATE USER spatial_csw_admin_usr IDENTIFIED BY spatial_csw_admin_usr '; execute immediate stmt; end if; end; / GRANT CONNECT, RESOURCE, CREATE LIBRARY, create procedure TO spatial_csw_admin_usr; GRANT CREATE ANY DIRECTORY TO spatial_csw_admin_usr; GRANT create role, alter any role, drop any role, grant any role TO spatial_csw_admin_usr; grant spatial_csw_admin to spatial_csw_admin_usr with admin option; alter user spatial_csw_admin_usr account lock password expire; -- drop role csw_usr_role; -- create role csw_usr_role identified by csw_usr_role; declare stmt VARCHAR2(10000); begin stmt := ' CREATE role csw_usr_role not identified '; execute immediate stmt; exception when others then null; end; / alter session set current_schema=mdsys;