CREATE USER SWINGSTOR
  IDENTIFIED BY VALUES 'F4010CD995987CBB'
  DEFAULT TABLESPACE SWING
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK;
  -- 1 Role for SWINGSTOR 
  GRANT CONNECT TO SWINGSTOR;
  ALTER USER SWINGSTOR DEFAULT ROLE ALL;
  -- 12 System Privileges for SWINGSTOR 
  GRANT CREATE VIEW TO SWINGSTOR;
  GRANT CREATE TABLE TO SWINGSTOR;
  GRANT DROP ANY VIEW TO SWINGSTOR WITH ADMIN OPTION;
  GRANT CREATE SESSION TO SWINGSTOR;
  GRANT CREATE SYNONYM TO SWINGSTOR;
  GRANT DROP ANY TABLE TO SWINGSTOR WITH ADMIN OPTION;
  GRANT CREATE ANY VIEW TO SWINGSTOR;
  GRANT CREATE PROCEDURE TO SWINGSTOR;
  GRANT SELECT ANY TABLE TO SWINGSTOR WITH ADMIN OPTION;
  GRANT CREATE ANY PROCEDURE TO SWINGSTOR;
  GRANT EXECUTE ANY PROCEDURE TO SWINGSTOR WITH ADMIN OPTION;
  GRANT CREATE PUBLIC DATABASE LINK TO SWINGSTOR;
  -- 1 Tablespace Quota for SWINGSTOR 
  ALTER USER SWINGSTOR QUOTA UNLIMITED ON SWING;
  -- 6 Object Privileges for SWINGSTOR 
    GRANT EXECUTE ON  SYS.DBMS_AQ TO SWINGSTOR WITH GRANT OPTION;
    GRANT EXECUTE ON  SYS.DBMS_AQADM TO SWINGSTOR WITH GRANT OPTION;
    GRANT EXECUTE ON  SYS.DBMS_AQELM TO SWINGSTOR WITH GRANT OPTION;
    GRANT EXECUTE ON  SYS.DBMS_AQ_IMPORT_INTERNAL TO SWINGSTOR WITH GRANT OPTION;
    GRANT EXECUTE ON  SYS.DBMS_RULE_EXIMP TO SWINGSTOR WITH GRANT OPTION;
    GRANT EXECUTE ON  SYS.DBMS_TRANSFORM_EXIMP TO SWINGSTOR WITH GRANT OPTION;
  -- 1 Resoure Group Privilege for SWINGSTOR 
BEGIN
  SYS.DBMS_RESOURCE_MANAGER.clear_pending_area();
  SYS.DBMS_RESOURCE_MANAGER.create_pending_area();
  SYS.DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP
    ('SWINGSTOR','SYS_GROUP',TRUE);
  SYS.DBMS_RESOURCE_MANAGER.submit_pending_area();
END;
/


