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";
GRANT INSERT, UPDATE, SELECT ON "&3".CONTAINER TO "&1";
GRANT SELECT ON "&3".PACKINGNOTECONTAINER TO "&1";
GRANT SELECT ON "&3".DEPARTMENT TO "&1";
GRANT SELECT ON "&3".DISTRIBUTIONPOINT TO "&1";
GRANT SELECT ON "&3".PACKINGNOTE TO "&1";
GRANT SELECT ON "&3".ROUTE TO "&1";
GRANT INSERT, UPDATE, SELECT ON "&3".SECONDARYCONTAINER TO "&1";
GRANT INSERT, UPDATE, SELECT ON "&3".CONTAINERTYPE TO "&1";
GRANT INSERT, UPDATE, SELECT ON "&3".CONTAINERTYPE_DESC TO "&1";
GRANT UPDATE, SELECT ON "&3".CONTAINERRENT TO "&1";
GRANT DELETE, SELECT ON "&3".CONTAINERCHARGE TO "&1";
GRANT INSERT ON "&3".BUSINESSUNIT TO "&1";
GRANT SELECT, INSERT ON "&3".CONTAINERSCAN TO "&1";
GRANT SELECT ON "&3".SEQ_CONTAINERTYPE TO "&1";
GRANT SELECT ON "&3".LANGUAGES TO "&1";
GRANT SELECT ON "&3".SEQ_CONTAINER TO "&1";
GRANT SELECT ON "&3".SEQ_CONTAINERSCAN TO "&1";
GRANT SELECT ON "&3".STAY TO "&1";
GRANT EXECUTE ON "&3".GETABSDAYNUMBER TO "&1";
GRANT EXECUTE ON "&3".GETISOWEEK TO "&1";
GRANT EXECUTE ON "&3".GETYEAROFWEEK TO "&1";
GRANT SELECT ON "&3".SIZEDEFINITION TO "&1";
GRANT SELECT ON "&3".PRODUCT TO "&1";
GRANT SELECT ON "&3".UNIQUEITEMFIXEDINFO TO "&1"; 
GRANT SELECT ON "&3".UNIQUEITEM TO "&1"; 
GRANT SELECT ON "&3".SCAN TO "&1";
GRANT SELECT ON "&3".RAGGEDITEM TO "&1";
GRANT SELECT ON "&3".RAGREASON TO "&1";
GRANT SELECT ON "&3".RAGREASON_DESC TO "&1";
GRANT SELECT ON "&3".UNIQUEITEM_LINK TO "&1";
GRANT SELECT ON "&3".PACKINGNOTELINE TO "&1";
GRANT SELECT ON "&3".STATUS TO "&1";
GRANT SELECT ON "&3".SYSTEMUSER TO "&1";
/
exit;
