How to create a user and grant Different roles to that user in Oracle
- To Create a user in Oracle run below command:
"CREATE USER User_Name IDENTIFIED BY MyPassword;"
- To allow a user to connect to a Database run below command: (Connect is a Role)
"GRANT CONNECT TO User_Name;"
- To allow a user to connect to a Database run below command: (Create Session is a privilege)
"GRANT CREATE SESSION TO User_Name;"
- To grant Select on a Table or all tables simply run below SQL Statement:
"GRANT SELECT ON TableName TO User_Name;"
"GRANT SELECT ON ANY TABLE To User_Name;"
- To grant Table Privileges a user simply run below SQL Statement:
"GRANT SELECT,INSERT,UPDATE,DELETE ON Schema.Table TO User_Name;"
- To grant DBA role to a user simply run below SQL Statement:
"GRANT DBA to User_Name"
Comments
Post a Comment