Problem with Oracle Create View

Hey guys. So, I am registered as a dba account, and I want to create a view in User1 schema, but selecting data from User2.

I used the following query:

CREATE OR REPLACE VIEW User1.NewView (Column1) AS
SELECT DISTINCT Column1 FROM User2.Table

and I get the following error:

SQL Error: ORA-00942: table or view does not exist
00942. 00000 -  "table or view does not exist"
*Cause:    
*Action:

To solve this problem, I had to provide dedicated access to User1 on User2.Table. Is there a way to do this without giving access since I am already registered as dba? Thanks guys!

+5
source share
3 answers

Yes, you (and always should) explicitly provide access to objects in another schema.

GRANT SELECT ON user2.table TO user1

" dba" (SYS, ), CREATE user1.

+10

CREATE REPLACE FORCE VIEW...

, , , . , , (, script).

+8

, ,

;

0

All Articles