Results 1 to 5 of 5

Thread: The synonyms in oracle database

  1. #1
    Join Date
    Jan 2010
    Posts
    48

    The synonyms in oracle database

    I am SQL beginner and want to know about the existence of synonyms in database and their usage. I am aware about only one feature, it provides the second and short name for a database object that has a large name.Can you provide me some more information and possible features of synonyms.Please help me !!!!

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    The synonyms in oracle database

    Synonyms :

    The synonyms provide an alternative name for any database object (Table,view,sequence, procedure, stored function, package) and much more.
    It allows applications to execute without any updation without any headache of which user owns the table or view and which database holds particular object.

    You can use synonyms with following DML statements : SELECT, INSERT, UPDATE, DELETE, EXPLAIN PLAN and LOCK TABLE
    and with DML statements like AUDIT, NOAUDIT, GRANT, REVOKE and COMMENT.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Creating synonyms in oracle database

    There are two ways of creating synonyms for different purpose that we would discuss here.
    1. Simple synonyms
    2. Public synonyms

    Creating Simple SYNONYMS:

    Assume, The table Library_booksheld by SCOTT schema and you want to create a synonyms named "L_books". To do this you need to use this statements :

    Code:
    SQL> CREATE SYNONYM L_books
                    FOR SCOTT.Library_books;

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Creating public synonyms in oracle database

    Creating PUBLIC Synonyms :

    You can create a PUBLIC synonyms on any object of any database that is on remote location.Here I will show you a statement which creates a synonyms named "Emp" for database object "EMPLOYEES" that is on remote location and the name of database is "Org_database". To create the synonyms for EMPLOYEES table in Kelfro schema use below statement

    Code:
    SQL> CREATE PUBLIC SYNONYM emp 
             FOR Kelfro.employees@Org_database;
    Last edited by kelfro; 02-02-2010 at 10:36 PM.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Dropping synonyms in oracle database

    Dropping Synonyms :

    You can drop the created synonyms of any simple or Public synonyms using this drop statement for synonyms.Before dropping any synonyms you should have privilege to drop.

    Code:
    SQL> DROP PUBLIC SYNONYM emp;

Similar Threads

  1. Statpack in oracle database
    By Reegan in forum Networking & Security
    Replies: 5
    Last Post: 16-02-2010, 08:00 PM
  2. Dynamic SQL in Oracle database
    By Adriana_andros in forum Software Development
    Replies: 5
    Last Post: 11-02-2010, 07:49 PM
  3. Java in oracle 9i database
    By Gerri in forum Software Development
    Replies: 4
    Last Post: 03-02-2010, 08:35 PM
  4. Top-N Analysis in Oracle database
    By LaMarcus in forum Software Development
    Replies: 3
    Last Post: 28-01-2010, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,526,650.11068 seconds with 17 queries