To generate SQL script you could use the following, similar to the solution suggested by DCookie
SELECT 'GRANT SELECT, UPDATE, DELETE, INSERT ON ' || table_name || ' TO other_user;'
FROM all_tables WHERE owner = 'other_user';
UNION ALL
SELECT 'GRANT EXECUTE ON ' || object_name || ' TO other_user;'
FROM all_objects
WHERE owner = 'other_user'
AND object_type IN ('FUNCTION', 'PROCEDURE', 'PACKAGE');
Generally, I would suggest using roles to avoid granting access rights for each user.
If using roles, run the following SQL as user you are copying roles from. You could also include other options like admin_option
and default_role
.
SELECT 'GRANT ' || granted_role || ' TO other_user;'
FROM user_role_privs;
Alternatively you could query dba_role_privs
to get the roles of a specific user:
SELECT 'GRANT ' || granted_role || ' TO other_user;'
FROM dba_role_privs WHERE grantee = 'source_user';