help me to understand the synonym concept while providing grant permissions to users

There is a table test created by info user.
To provide permissions to other user below is the syntax i have used.

create or replace synonym info1.test for info.test
GRANT SELECT,INSERT,UPDATE,ALTER,DELETE ON info.test TO info1

is it mandatory to create synonym while granting permissions to other user?
suggest me how it helps.
LVL 2
srikoteshAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
no, not mandatory

but when logged on as info1, the full schema info. has to be supplied

this works too:
alter session set current_schema=info;
select * from test;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
awking00Information Technology SpecialistCommented:
It is certainly not mandatory to create a synonym when granting permissions to other users. However, it can be beneficial in many cases. For example, say there is a schema called project_fiscal_year_2018  that contains a staging table named input_data_2018 that has been granted access permissions to other users. If the five other users only need to get certain records, they would each have to select from project_fiscal_year_2018.input_data_2018 with the fully qualified name. However, creating a synonym for that table with a name like stg_2018 would make things a lot easier.
0
Mark GeerlingsDatabase AdministratorCommented:
Synonyms and grants are two different and independent things.  A synonym just provides a shorter way to refer to an object.  Instead of having to use the full "owner.table_name" syntax, you can simply use the "synonym_name" to refer to the object the synonym points to.

But, without a grant, a synonym doesn't help you.  If you don't have a grant, you can't do anything with the object even if a synonym allows you to refer toit.
0
srikoteshAuthor Commented:
hi experts,

Thanks for valuable suggestions.
which statement i need to give first.
is there any order first grant then synonym or
synonym then grant

create or replace synonym info1.test for info.test
GRANT SELECT,INSERT,UPDATE,ALTER,DELETE ON info.test TO info1
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.