简体   繁体   中英

Oracle : table or view doesn't exist?

I have a schema in oracle in which I have some tables, let's say Table1 (I'm sure it exists)

When I query the table using the same schema :

select * from Table1; 

I have the error "table or view doesn't exit"

I suspect something related to table space... because when I created the user

CREATE USER MyUser IDENTIFIED BY password DEFAULT TABLESPACE MyTableSpace;

I set a different default table space.

I tried

select * from MyTableSpace.Table1; 
select * from MyUser.Table1;  

But that was unsuccesful.

Does anyone have an idea please ?

Thanks.

If I understood you correctly - you have two users (schemes) -User1,User2. You logged into SQL Developer as User1 and then created Table1. Then You login into SQL Developer as User2 and try to execute select * from Table1 and select * from User1.Table1 and it is unsuccessful.

So first you have to grant select access on User1.Table1 to User2. To do this you have to login as User1 and execute

GRANT SELECT, INSERT ON Table1 TO User2;

After this will be able to execute query (When you are logged in as User2)

select * from User1.Table1;

then you have to create synonym in order not to use prefix User1. To do this - loggin as User2 and execute

CREATE SYNONYM Table1 FOR User1.Table1;

Now you can loggin as User2 and execute:

select * from User1.Table1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM