📜  oracle 创建角色 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:12.749000             🧑  作者: Mango

代码示例1
-- CREATE ROLE role_name [IDENTIFIED BY password] [NOT IDENTIFIED]
CREATE ROLE role_name;
GRANT CREATE SESSION, ALTER SESSION TO role_name;
GRANT SELECT, INSERT, DELETE, UPDATE ON table_name TO role_name;
GRANT EXECUTE ON proc_name TO role_name;
-- Grant role to user
GRANT role_name TO user_name;
ALTER USER user_name DEFAULT ROLE role_name;
SELECT * FROM DBA_ROLES WHERE ROLE = 'role_name';
SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE = 'role_name' 
    AND GRANTEE = 'user_name';