DECLARE 
    USER_EXISTS EXCEPTION;
    PRAGMA EXCEPTION_INIT(USER_EXISTS, -1920);
BEGIN
  EXECUTE IMMEDIATE 'CREATE USER "&1" IDENTIFIED BY "&2"';
EXCEPTION
   WHEN USER_EXISTS THEN
     NULL;
   WHEN OTHERS THEN
     RAISE;
END;
/
GRANT DBA, AQ_ADMINISTRATOR_ROLE, AQ_USER_ROLE TO "&1";
GRANT EXECUTE ON DBMS_AQADM TO "&1";
GRANT EXECUTE ON DBMS_AQ TO "&1";
GRANT EXECUTE ON DBMS_LOB TO "&1";
GRANT EXECUTE ON DBMS_JMS_PLSQL TO "&1";

GRANT INSERT ON "&3".ERP_I_CUSTOMER TO "&1";
GRANT SELECT ON "&3".SEQ_TRANSFER TO "&1";
GRANT SELECT ON "&3".ERP_I_CUSTOMER TO "&1";
GRANT SELECT ON "&3".CUSTOMER TO "&1";
GRANT UPDATE ON "&3".CUSTOMER TO "&1";
GRANT SELECT ON "&3".ADDRESS TO "&1";
GRANT UPDATE ON "&3".ADDRESS TO "&1";
GRANT SELECT ON "&3".COUNTRY TO "&1";
GRANT SELECT ON "&3".LANGUAGES TO "&1";
GRANT SELECT ON "&3".PLANT TO "&1";
GRANT SELECT ON "&3".BUSINESSUNIT TO "&1";
GRANT SELECT ON "&3".MARKETSEGMENT TO "&1";
GRANT SELECT ON "&3".SYSTEMSETTING TO "&1";
GRANT INSERT ON "&3".ERP_I_DELIVERYPOINT TO "&1";
GRANT INSERT ON "&3".ERP_I_CONSUMPTIONPOINT TO "&1";
GRANT INSERT ON "&3".ERP_I_DEPARTMENT TO "&1";
GRANT INSERT ON "&3".ERP_I_COSTCENTER TO "&1";
/
exit;
