Home > database >  After landing with SYS restore the database, users can not access the default Schema
After landing with SYS restore the database, users can not access the default Schema

Time:10-13

I use SYS log in to restore a database, then use User1 login, found that when accessing a table must be prefixed with Schema, such as select * from User1. Table1. If write a select * from table1 is wrong, I don't know how to solve this problem, thank you for your attention

CodePudding user response:

In general, need to use the schema name applied to other users/object mode, oracle and PG, there is no such parameters as search_path,
But can be disguised omit schema name: which in the current schema created under synonyms or view, with the same premise is not under the current schema objects with the same, otherwise only specify the schema name a way,

CodePudding user response:

Sorry, I am a beginner, may not be clear, my user name and Schema is consistent, but cannot access the table, the user name is User1, Schema User1, but can not access the Table1, must add prefix User1. Table1.

CodePudding user response:

refer to the second floor helloabcde response:
Sorry, I'm a beginner, may not be clear, my user name and Schema is consistent, but cannot access the table, the user name is User1, Schema User1, but can not access the Table1, must add prefix User1. Table1.


Select * from user_tables where table_name='Table1 did look at the record

CodePudding user response:

reference minsic78 reply: 3/f
Quote: refer to the second floor helloabcde response:

Sorry, I am a beginner, may not be clear, my user name and Schema is consistent, but cannot access the table, the user name is User1, Schema User1, but can not access the Table1, must add prefix User1. Table1.


Select * from user_tables where table_name='Table1 did look at the record

There is no
I use SYS landed in user_tables also have no, but a select * from Table1 records can be found

CodePudding user response:

reference 4 floor helloabcde response:
Quote: reference minsic78 reply: 3/f

Quote: refer to the second floor helloabcde response:

Sorry, I am a beginner, may not be clear, my user name and Schema is consistent, but cannot access the table, the user name is User1, Schema User1, but can not access the Table1, must add prefix User1. Table1.


Select * from user_tables where table_name='Table1 did look at the record

There is no
I use the SYS log in, nor in user_tables, but a select * from Table1 can detect record


You this paradoxical,
If your table table1 under the sys user, then the query should be recorded, if under the user1 user, then you use user1 login, this query also recorded,

If couldn't say for sure, please on the map, or video,

CodePudding user response:

Select * from dba_tables where table_name='Table1' owner to see the table below
  • Related