DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Public vs. Public Synonym

  1. #1
    Join Date
    Jan 2001
    Posts
    138

    Public vs. Public Synonym

    If we grant privileges on a table to PUBLIC, all database users have access to the table. How does a public synonym differ from that? If we create a public synonym on that table, does that make the table available to all users too? What is the dierence between a direct grant to public and creating a public synonym? Thanks.

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    It is how the table is referenced by other users. You doing grant select on table_name as the owner of that table to public means others would have to do select * from owner.table_name. If you create the public synonym, then others only need to do select * from table_name as opposed to select * from owner.table_name.

  3. #3
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    And more ever never grant priviliges to PUBLIC. If necessary give grants to individual users.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  4. #4
    Join Date
    Jan 2001
    Posts
    138
    [QUOTE]Originally posted by stecal
    It is how the table is referenced by other users. You doing grant select on table_name as the owner of that table to public means others would have to do select * from owner.table_name. If you create the public synonym, then others only need to do select * from table_name as opposed to select * from owner.table_name. [/QUOTE

    That being the case, if I were to create a new table and then create public synonym on it, then anyone can access the table, right? What is the point of a public synonym then? Isn't just like granting to PUBLIC?

  5. #5
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by pcotten
    That being the case, if I were to create a new table and then create public synonym on it, then anyone can access the table, right?
    Wrong, of course!

    How about reading some concepts manuals to understand what is SYNONYM and what is PRVILEGE (GRANT)? They are two totaly different things, they have nothing in common whatsoever.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  6. #6
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Creating a public synonym does not grant any privileges to the table you will still need to grant those addtionally.
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  7. #7
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by jmodic
    How about reading some concepts manuals to understand what is SYNONYM and what is PRVILEGE (GRANT)? They are two totaly different things, they have nothing in common whatsoever.
    Ok here is the link pcotten

    http://download-west.oracle.com/docs...m.htm#CNCPT711
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  8. #8
    Join Date
    Aug 2003
    Location
    Singapore
    Posts
    1

    Public vs. Public Synonym

    If we grant privileges on a table to PUBLIC, all database users have access to the table. How does a public synonym differ from that? If we create a public synonym on that table, does that make the table available to all users too? What is the dierence between a direct grant to public and creating a public synonym? Thanks.

    --
    Create Public Synonym doesnt necessarily grants access rights to the objects, it's just an alternate way of referring the object without mentioning the Schema owner's name.

    Only if a table has been given grant it can be viewed/accessed.

    To PUBLIC is giving grants to all users of this Database instead of giving grants to individual users.

    Hope it's clear!

    --Thiagu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width