I created a role and it worked. Then I dropped it, and when I try to recreate it it doesn't work anymore.
I have to create a role, grant select to that role and grant that role to a user named user2, to check whether it is able to see the tables made by another user named user1. I made this:
CREATE ROLE access1;
GRANT SELECT, ALTER, DELETE ON user1.table1 TO access1;
GRANT SELECT, ALTER, DELETE ON user1.table2 TO access1;
GRANT SELECT, ALTER, DELETE ON user1.table3 TO access1;
GRANT access1 TO user2;
It worked the first time, but I had to delete the role following the instructions of the university project and I wrote the following:
DROP ROLE access1;
Now I have to check if I can see the tables from user2
and, indeed, I couldn't.
The problem starts when I have to create the role again. I did the same code but not it doesn't work anymore. From user2
I see this error message:
ORA-00942: table or view does not exist
What am I missing? Why did the instructions work the first time but now they don't?