REM Script to create SOADEMO schema owner
REM Note that the actual schema owner is passed in as a parameter
REM to allow for multiple instances on a shared sever

REM $Id: createSchema.sql,v 1.2 2006/12/01 23:50:28 robin Exp $ 

spool create_schema.log

DROP USER &&1 CASCADE;

CREATE USER &&1 IDENTIFIED BY &&2
 DEFAULT TABLESPACE users
 TEMPORARY TABLESPACE temp
 QUOTA UNLIMITED ON users;

GRANT create session
    , create table
    , create procedure
    , create sequence
    , create trigger
    , create view
    , create synonym
    , alter session
    , create type
    , create materialized view
    , query rewrite
    , create dimension
    , create any directory
    , alter user
    , resumable
    , ALTER ANY TABLE  -- These
    , DROP ANY TABLE   -- five are
    , LOCK ANY TABLE   -- needed
    , CREATE ANY TABLE -- to use
    , SELECT ANY TABLE -- DBMS_REDEFINITION
TO &&1;

GRANT select_catalog_role
    , execute_catalog_role
TO &&1;

spool off
