Q
Problem solve Get help with specific problems with your technologies, process and projects.

Accessing a schema for data retrieval only

I have a particular user who owns a schema. I want to create another user who can access the same schema but for data retrieval purposes only. How can I do that?

I have a particular user who owns a schema. I want to create another user who can access the same schema but for data retrieval purposes only. How can I do that?
In Oracle, you will have to create the new user, then grant SELECT privileges on each table in the original schema. Let's assume that you want to create a new user, BOBBIE, and grant that user the ability to see all of the tables in the SCOTT schema. Then perform the following actions:
CREATE USER bobbie IDENTIFIED BY new_password;
GRANT create session TO bobbie;

SPOOL grant.sql
SELECT 'GRANT select ON '||table_name||' TO bobbie;'
FROM dba_tables WHERE owner='SCOTT';
SPOOL off
@grant.sql
These steps will let BOBBIE query all of SCOTT's tables.

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close