I have my database on Oracle and I want to grant privileges to a certain group of users (for example, considering they're identfied by an id, users 1 to 9) and I also want to grant them access to a certain data (for example, a data which has a certain attribute).
Do I need to create a role in order for the group of users? And what do I have to do for only granting privileges to a certain data?
You don't have to create a role (as you can grant privileges directly to those users), but - role makes it simpler to maintain. So yes, I'd suggest you to create a role, grant privileges to that role, and then grant role to any user you want.
As of certain data: a simple option - if you think it is an option in your case - is to create a view whose WHERE
clause restricts data only to specific set of rows. Then grant access on such a view to previously mentioned role (and users will "inherit" that privilege through it).