-- Usage @createuser.sql <P1>
--    P1: Create Dataminer User account
-- Example: @createuser.sql dmuser dmuser

SET SERVEROUTPUT ON;

DEFINE USER_NAME = &&1
DEFINE USER_PASS = &&2

-- USER SQL
CREATE USER "&USER_NAME" IDENTIFIED BY "&USER_PASS"
DEFAULT TABLESPACE "DATA"
TEMPORARY TABLESPACE "TEMP";

-- ROLES
GRANT "CONNECT" TO "&USER_NAME";

-- SYSTEM PRIVILEGES

-- QUOTAS
ALTER USER "&USER_NAME" QUOTA UNLIMITED ON "DATA";

@@usergrants.sql &USER_NAME

commit;

exit;
