Doubts in Creating Synonym

We have Oracle9i, i have seen about synonym.
I have some doubts...
1. Is that we can create synonym for objects like Packages, stored
procedures,views and Functions.
2. How Synonyms helpful in user privileges?.
3. What is Public and Private Synonyms?
I have seen some documents but they couldnot clear my doubts....
Any one can help me in this please

A quick example :
SQL> desc myusers
Name                                      Null?    Type
USERNAME                                  NOT NULL VARCHAR2(30)
USER_ID                                   NOT NULL NUMBER
CREATED                                   NOT NULL DATE
SQL> grant create session to toto identified by toto;
Grant succeeded.
SQL> grant select on myusers to toto;
Grant succeeded.
SQL> grant create synonym to toto;
Grant succeeded.
SQL> conn toto/toto@H89UCBAC
Connected.
SQL> desc myusers
ERROR:
ORA-04043: object myusers does not exist
SQL> desc h89ucbac.myusers
Name                                      Null?    Type
USERNAME                                  NOT NULL VARCHAR2(30)
USER_ID                                   NOT NULL NUMBER
CREATED                                   NOT NULL DATE
SQL> create synonym myusers for h89ucbac.myusers;
Synonym created.
SQL> desc myusers
Name                                      Null?    Type
USERNAME                                  NOT NULL VARCHAR2(30)
USER_ID                                   NOT NULL NUMBER
CREATED                                   NOT NULL DATE
SQL> HTH,
Nicolas.

Similar Messages

  • Doubt in creating program to display application logs

    Hi,
    I have doubt in creating a program to display application logs.
    The standard transaction code SLG1 has been used to display Application logs till now by the user.
    They came up with the new requirement on this.
    <u>The requirements were:</u>
    1)New custom program shoud be created like SLG1 with limited selection fields( data from, date to, Program name and User)
    2) Detail list should be displyed immediately when this program is executed because SLG1 gives Basic list,Detailed list which is getting displayed when 'Detail view' is selected in the first list.
    I have created one program with limited selection fields as per the requirement using the below function modules .
    BAL_FILTER_CREATE
    BAL_DB_SEARCH
    BAL_DB_LOAD
    and BAL_DSP_LOG_DISPLAY
    <u>Issue :</u> still I am getting the firt list.
    both Basic and Detailled lists are getting triggered at the FM BAL_DSP_LOG_DISPLAY.
    Is it only the way to copy and modify this FM.
    Could you please suggest me?
    Thans in advace,
    babu.
    Message was edited by:
            babu v
    Message was edited by:
            babu v

    Hello All,
    Thanks for your valuable suggitions.
    I have seen most of the demo programs.
    I found one fm'BAL_DSP_PROFILE_NO_TREE_GET' which avoids the tree list which is getting listed above the profile list.
    I have been searching alot to omit the Profile list. I searched alot to find any function modules realted to that.
    The requirement was only the Detail list should only be listed.
    Could you please suggest me to avopid that profile list also?
    Thanks in advance,
    babu
    Message was edited by:
            babu v

  • Doubts in creating ztable?

    Hi
    doubts in creating ztable?
    while creating  currency fields and quantity fields
      which ref table and ref field is suggestable
    which techincal settings is suggestable
    is there any possibility to move ztable which is developed as local object to package for futher transportation?
    thanks in advance

    Hi Sitaram,
    - which ref table and ref field is suggestable: : For clarity include currency and unit fields in the same Z-table
    - which techincal settings is suggestable: This heavenly depends on the number of expected records and the type of use.
    You can use SE03 -> Change Object Directory entries for assigning a local object to a package.
    Regards,
    John

  • Creating SYNONYM for all tables who don't have one at once!

    Hello to all,
    I'm trying to create synonyms for every table who's missing one at the moment. I'm trying this code:
    declare
    cursor cur_objects is
    select obj.object_name , obj.owner
    from all_objects obj
    where owner = '&&SCHEMA_OWNER'
    AND NOT EXISTS (SELECT *
    FROM all_synonyms syn
    WHERE obj.object_name = syn.table_name)
    AND obj.object_type = 'TABLE'
    AND obj.object_name LIKE 'CI_%';
    begin
    for rec_objects in cur_objects loop
    begin
    dbms_output.put_line(rec_objects.object_name);
    execute immediate('create public synonym ' || rec_objects.object_name || ' for '
    || rec_objects.owner ||'.'||rec_objects.object_name )
    exception when others then
    null;
    end;
    end loop;
    end;
    I'm getting this error:
    ORA-06550: line 10, column 37:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    begin function package pragma procedure subtype type use
    <een ID>
    <een scheidingsteken-ID tussen dubbele aanhalingstekens> form
    current cursor
    I'm still pretty new at PL/SQL and can't get it to work. Does anyone got any tips ?
    Thnx already

    Ok now I got this error:
    RA-06550: line 17, column 1:
    PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem return
    returning <een exponent (**)> <> or != or ~= >= <= <> and or
    like LIKE2_ LIKE4_ LIKEC_ between into overlaps using ||
    multiset bulk year DAY_ member SUBMULTISET_
    The symbol ";" was substituted for "EXCEPTION" to continue.

  • Doubt in createing forms in flex ?

    hai all,
    i have doubt in creating forms in flex, how can we validate phone number in form and can we have any script for predefined calender to select date for date of birth. plz help by attaching some references,
              one more doubt how to create my UI(user interface) with good look with dropdown menus and incoprate graphics like .gif,.swf tables ect plz forword or attach some references plz do it fast it very urgent

    Hi,
    Try to use page protection in the Folder. 
    Create a Folder in the Main Area of the table and check the Page Protection Option.  Include all your Line types (Row types) in this folder.
    It will avoid page break and display the records in a set.
    Reward if useful........

  • Script to create synonyms for the tables of Oracle Applications

    Team,
    For Oracle Applications 11i on W2K, where might I find a script to create synonyms for all of the application tables? I would think there would be a standard script somewhere in one of the directories created during the install or on the CDs.
    Thanks,
    Luther

    John, it is ssome sort of a bleed, but in this case it's not the part that 'might be cut off' that matters; it's the part that still needs to be on the page. Yes, I meant it to be (virtually) not-noticeable for the casual reader. Of course you can make it part of the page design, that ought to ease up matters.
    The amount pages shift horizontally because of binding is called "creep", and this depends on the type of binding and the thickness of the paper. You cannot adjust for creep unless you know exactly how much this is and how your book is going to be printed and bound.
    Airkite:
    But the book that you printed worked out alright? Was it done with a different method?
    This was a simple outlined text, not an image. Through the inaccuracies of printing and binding combined, there were no straight edges *anywhere* but fortunately the lines were thick enough to let you mentally connect them
    This was done (I'm sure) with the method you proposed.
    There is an alternative way, but it's way more expensive (on the other hand, the result is impressive): after the entire process of printing, binding, and cutting, books are put in a clamp one at a time and fed through a silk screen printer, fore edge on top, and printed with whatever you like.
    I know of the existance of this technique but I haven't seen a book done like this in years and have no clue at all of the costs involved (writing that down in one sentence makes me realize those two might be connected).

  • Create synonym name with more than 30 character.

    I have created a synonym for a table which is more than 30 character long.
    After creating the synonym with create synonym... synonym created message is showing.
    but when i am checking in all_objects view that syninym is not available there, and
    select * from <synonym_name> also not returtning any rows.
    What is the reason for this ? if oracle is showing message like Syninym Created then where its has stored ?
    Thanks in Advance...

    To demonstrate the above...
    SQL> select * from user_synonyms;
    no rows selected
    SQL> create synonym MY_EMPLOYEE_RECORDS_VERY_LONG_NAME for EMP;
    Synonym created.
    SQL> select * from user_synonyms;
    SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
    /9c4d39ff_MY_EMPLOYEE_RECORDS_ SCOTT                          EMP
    SQL> select * from MY_EMPLOYEE_RECORDS_VERY_LONG_NAME;
    select * from MY_EMPLOYEE_RECORDS_VERY_LONG_NAME
    ERROR at line 1:
    ORA-00972: identifier is too long
    SQL> select * from "/9c4d39ff_MY_EMPLOYEE_RECORDS_"
      2  ;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17/12/1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20/02/1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22/02/1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02/04/1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28/09/1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01/05/1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09/06/1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19/04/1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17/11/1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08/09/1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23/05/1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03/12/1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03/12/1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23/01/1982 00:00:00       1300                    10
    14 rows selected.
    SQL>

  • Dynamic create synonym script

    we want to create few synonyms dynamicalyy, (ie) we will aceept the owner Name,DB link Names as parameter
    (ex) I need to create dynamic statement
    create synonym A.ATAB FOR B.ATAB@link1
    while i execute the statement as
    create synonym A.ATAB FOR &OWNER||".ATAB@"||&DBLINK
    it gives an error saying that
    SQL command not properly ended
    what is wrong?

    Did you try using dynamic or native dynamic sql?
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/11_dynam.htm#8074

  • Error when running execute immediate to create synonym in Procedure

    The following command
    execute immediate 'create synonym EW6379_DM.kbr_v_tag_eq_new_tags for EW6379.kbr_v_tag_eq_new_tags';
    runs fine if executed outside in a Stored procedure,
    but if I add this command to a Procedure will fails with error ORA-01031 insuficient Privilegies
    Very strange.

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as SYS
    SQL>
    SQL> drop role r1;
    Role dropped
    SQL> drop user u1 cascade;
    User dropped
    SQL> create user u1 identified by u1;
    User created
    SQL> grant connect, resource to u1;
    Grant succeeded
    SQL> create role r1;
    Role created
    SQL> grant create any synonym to r1;
    Grant succeeded
    SQL> grant create any procedure to r1;
    Grant succeeded
    SQL> grant r1 to u1;
    Grant succeeded
    SQL> conn u1/u1;
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as u1
    SQL> create table t(i number);
    Table created
    SQL> create synonym s for t;
    Synonym created
    SQL> create table t2(i number);
    Table created
    SQL> create or replace procedure p
      2  is
      3  begin
      4  execute immediate 'create synonym s2 for t2';
      5  end;
      6  /
    Procedure created
    SQL> show err;
    No errors for PROCEDURE U1.P
    SQL> exec p;
    begin p; end;
    ORA-01031: insufficient privileges
    ORA-06512: at "U1.P", line 4
    ORA-06512: at line 1
    SQL> conn sys/0000 as sysdba;
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as SYS
    SQL> grant create any synonym to u1;
    Grant succeeded
    SQL> conn u1/u1;
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as u1
    SQL> exec p;
    PL/SQL procedure successfully completed
    SQL>

  • Error in create synonym dialog

    Hi,
    when I try and create a new synonym using the "create database synonym" dialog box (right click "synonyms" in the db browser, choose "create synonym"), and then click OK, I am getting an error:
    "Error in Synonyms SYNONYM1, "null" is not a valid synonym reference."
    This has happened every time I've tried to create a synonym via this dialog, whether or not I change the default name (synonym1).
    If you OK the error and switch to the DDL tab and click OK the synonym is created correctly, without having to make any other changes.
    There also doesn't appear to be any way of refreshing the drop down boxes in the dialog - so if I change permissions via another session somewhere, I have to close the dialog and restart, rather than trying again.
    Next, the synonym info window doesn't seem to show what the synonym is for, which would be useful; at the moment I have to switch to the sql window to see what the synonym points to.
    Next, if you right click on a synonym and choose drop (and then ok it), the synonym is not removed from the list; you have to explicitely refresh to remove it; if you press the delete key with the synonym selected it is removed from the list without having to refresh.
    Creating and dropping synonyms via the menus can also result in the synonym window refusing to display anything (just a blank tab, the only option being to close it). The window also fails to close when you delete the last synonym in the list, remaining till you explicitly refresh the synonym list. I once managed to get it into a state where I had to restart Raptor to view synonyms, but I've not been able to reproduce this.
    regards,
    William Moffatt

    I once managed to get it into a state where I had to restart Raptor to view synonyms, but I've not been able to reproduce thisI managed to reproduce it:
    starting with no synonyms, create two, using the default names.
    right click delete one, select the other and then back again; the synonym tab should be a blank page.
    right click delete the 2nd one.
    The synonym tab is now broken, and as far as I can tell you have to restart Raptor to get it working properly.
    You can also confuse it by creating a new synonym with the same name after right-click deleting the first; this synonym will refuse to display any details, even after refreshing.
    regards,
    William

  • Create synonym everytime a new table/record is created

    Hi
    Is there a way of specifying within the peoplecode/Application designer to ensure that a synonym is created everytime a table/record object is created atleast for the Oracle database.
    I am looking for a solution within the peoplecode/Application designer since currently we are hand-coding it from outside using shell scripts and sql*plus.
    Thanks
    Cyril
    PS: sorry for the repeat post..the other was wrong

    Since I don't see what was wrong there, I'll repeat my answer from the other :
    "You should create a trigger on schema level (most probably on SYSADM).
    In that trigger (BEFORE CREATE), create a job (to be execute immediately, without recurrence), that job will call a procedure with the object name in input parameter. The procedure will grant and create synonym with in dynamic sql for that object."
    That said, why do you want to manage it in Peoplesoft, tables are hosted by Oracle, when something is changed in AppDesigner, you should rebuild this object, the rebuild will affect the Oracle object, then the trigger can be fired.
    Nicolas.

  • Create synonym of tables & views in one go!

    Hi,
    My oracle database is 11gR1 and Linux is the platform. I have more then 1500 tables and views. I need to create synonym of all views and tables. Is it possible to do it with some routine? Name of synonym is to be same as table name or view name. Kindly help me if it is possible.
    Thanks, Imran

    You can certainly write a small PL/SQL block to generate the synonyms, i.e.
    BEGIN
      FOR t IN (SELECT owner, table_name FROM dba_tables WHERE owner = <<schema name>>)
      LOOP
        EXECUTE IMMEDIATE 'CREATE PUBLIC SYNONYM ' || t.table_name || ' FOR ' || t.owner || '.' || t.table_name;
      END LOOP;
      FOR v IN (SELECT owner, view_name FROM dba_views WHERE owner = <<schema name>>)
      LOOP
        EXECUTE IMMEDIATE 'CREATE PUBLIC SYNONYM ' || v.view_name|| ' FOR ' || v.owner || '.' || v.view_name;
      END LOOP;
    END;(This assumes that you want to create public synonyms. If you are creating private synonyms, change the DDL appropriately).
    Justin

  • Creating synonym is showing invalid

    Hi Gurus,
    I need your help.
    Currently in our UAT box we have user CISADM where all the main views and tables present.
    There is a user called "FAXUSER" which is used to test the Innofax application.
    Currently there is a view "CI_ACCT_FAX_INFO_VW" in CISADM, and i need to create synonym for that to FAXUSER.
    The same goes for production and it is workign fine.
    I am not sure, why i can't create the synonym to my UAT Faxuser. I tried, but the synonym is invalid, No showing any error.
    Can you advice on that?
    Regards,
    Meena

    >
    Currently in our UAT box we have user CISADM where all the main views and tables present.
    There is a user called "FAXUSER" which is used to test the Innofax application.
    Currently there is a view "CI_ACCT_FAX_INFO_VW" in CISADM, and i need to create synonym for that to FAXUSER.
    The same goes for production and it is workign fine.
    I am not sure, why i can't create the synonym to my UAT Faxuser. I tried, but the synonym is invalid, No showing any error.
    >
    Post the following info:
    1. your 4 digit Oracle version (result of SELECT * FROM V$VERSION) - always provide this when you post
    2. the user with SYS privileges you are using to create the synonym
    3. the DDL for the CREATE SYNONYM statement you are using
    4. the DDL you used to grant SELECT privileges on the VIEW to the user or to PUBLIC
    5. the query you are using that shows you the synonym is invalid.

  • Create synonym privs

    Hello all,
    we have 1 user say XXX, as give all privs to this user (CREATE SYNONYM,SELECT ANY TABLE,DROP PUBLIC SYNONYM etc), so basicall this user can create/drop any synonym into its own schema.
    Now the req is, this XXX user also must have privs to ceate synonym in APPS schema.
    Kindly help me to do the same.
    Thanks in ADV!!!!!

    if you want XXX user to create synonym in APPS user, you need to grant "create any synonym" privilege to XXX user.

  • How create synonym for more than one user

    Hi,
    In a DB I have more than one schema. For example:
    1) User1 has these tables:
    Menu
    Employes
    Zipcode
    Billing etc..
    2) User2 has only the a personalized table Menu
    3) User3 has only the a personalized table Menu
    How can enable User2, User3 and other to use the tables Employes, Zipcode, Billing etc. of schema User1 ?
    I think with synonyms. Can You help to write a script in order to create this ?
    I hope in Your Help.
    Thank You and Best Regards.
    Gaetano

    Hi Gaetano,
    If I understand your requirement correctly User2, User3 and other users should be able to access tables owned by User1. If that's the case, synonyms won't help at all.
    Read up any English dictionary and you'll understand what a synonym is.
    What you need to do (as User1) is: GRANT the appropriate privilege (SELECT, UPDATE...) on the tables to the other users.
    Oh, btw: what is a 'personalized table Menu'? I never heard that.
    Regards,
    Guido

Maybe you are looking for

  • How long does it take for Verizon to activate a new device?

    I got an iPad 4 for Christmas. Today I screwed up my courage and decided to go online and add a tablet to my Share Everywhere service. Went thru all the screens giving them the EMEI #, the SIM card number and all the other requested info. I got a lin

  • Force Error message in BADI ME_PROCESS_PO_CUST

    when PO is created, I have to collect the  error message similar to  Standard SAP does for certain condition (based on the quantity entered in the Service line items )  , Please let me know how to do this within the BADI. I’m using post method of  ME

  • Default tax code in PO from Condition record :::::::

    Hello experts If a condition record for a plant vendor material combination  is maintained for a particular tax code , is it possible to default the tax code maintained in PO from the condition record?? Pls give ur valuable inputs Regards Anis

  • Can't view digital booklets in iTunes 9.0

    I recently copied my entire iTunes library to a new hard drive and just noticed that my digital booklets are no longer showing up as line items in the iTunes player. The PDF files are on the hard drive and are accessible if I go to the correct folder

  • How can you move multiple events?

    I often need to move chunk of events to another day, usually half a day's worth. Each chunk may have events from three or four different calendars. Is there any way to select more than one event and move them all at once? Right now I need to move an