2

I am new to Oracle and i am struggling with the permissions. I created some tables with user called ADMIN on a specific tablespace. The tables are in the schema ADMIN now. I want access this tables from another user called TESTUSER which is in a role called TEST.

Is there a way to grant this role called TEST access to the schema ADMIN? Or a way to grant access to the user for this schema? I aslo want that the ADMIN tables show up in the sqldeveloper under the TEST user.

I already used some commands to try this out but it doesnt work. Eg.

GRANT SELECT on ADMIN.TABLE1 to TEST

What do I have to do?

Bins Ich
  • 1,822
  • 6
  • 33
  • 47
  • did you try to connect as user(schema) ADMIN and execute the commend "GRANT SELECT on TABLE1 to TEST" ? what did you get ? what did you get when you tried to access TABLE1 ? – A.B.Cade Jan 05 '12 at 12:48
  • ok got it. seems that i made something wrong with the query first. is there a way to the grant the privilege to a role too? – Bins Ich Jan 05 '12 at 13:01
  • Isn't TEST the role ? did you try "GRANT TEST TO TESTUSER" ? – A.B.Cade Jan 05 '12 at 13:04
  • i want to grant the role called TESTROLE where TEST is a member of to select tables from ADMIN schema. – Bins Ich Jan 05 '12 at 13:27

1 Answers1

2

Assuming:
TEST, ADMIN are users
ADMIN is the owner of table TABLE1
TESTROLE is a role

Connect to the schema ADMIN then run command:

GRANT SELECT on TABLE1 to TESTROLE;

Then run the command:

GRANT TESTROLE TO TEST; 

connect as TEST user and check:

SELECT * FROM ADMIN.TABLE1;
A.B.Cade
  • 16,735
  • 1
  • 37
  • 53