Private synonym working

Hi,
I have created a private synonym and granted a select privilege in one schema (webcen) as shown below, it is working fine,but the same thing is not working in another schema.
CREATE SYNONYM HZ_LOCATIONS FOR OPERAPPS.HZ_LOCATIONS;
connected to operapps and granted the below privilage.
grant select on HZ_LOCATIONS to testsafe;
it is showing the message PL/SQL: ORA-00942: table or view does not exist
please advice.
Regards
Sudhir

Hi Panela,
i ahve done the below mentioned steps that are working fine.
user:safex_dev
schema : webcen
owner of table :operapps
synonym creation:
CREATE SYNONYM HZ_LOCATIONS FOR OPERAPPS.HZ_LOCATIONS;
privilege :
grant select on HZ_LOCATIONS to safex_dev;
i am following the below steps in another schema but it is not working.
user:testsafe
schema : oadtb
owner of table :operapps
synonym creation:
CREATE SYNONYM HZ_LOCATIONS FOR OPERAPPS.HZ_LOCATIONS;
privilege :
grant select on HZ_LOCATIONS to testsafe;
Please advice.

Similar Messages

  • Private synonym created on  table not working in function

    hi,
    I have created a private synonym on a table.
    now i am trying to create a function below is the code of the same.
    FUNCTION party_name(p_cntr_id NUMBER)
    RETURN VARCHAR2 AS
    v_cust_name VARCHAR2(100);
    v_cust_no varchar2(100);
    BEGIN
    select occ.cust_no
    into v_cust_no
    from ops_cust_cntr occ
    where occ.ID = p_cntr_id;
    SELECT party_name
    INTO v_cust_name
    FROM hz_parties -- this is the table on which synonym is created .
    WHERE party_id = v_cust_no;
    RETURN (v_cust_name);
    EXCEPTION
    WHEN OTHERS THEN
    RETURN NULL;
    END party_name;
    it is giving the message
    SQL> sho errors;
    Errors for FUNCTION PARTY_TEST:
    LINE/COL ERROR
    12/1 PL/SQL: SQL Statement ignored
    14/6 PL/SQL: ORA-00942: table or view does not exist
    but when i run
    SELECT party_name
    FROM hz_parties;
    it is giving me the data.
    Please advice.
    Regards
    Sudhir.

    This has nothing to do with the synonym.
    Look at this:
    SQL> create table t1 (c1 number);
    Table created.
    SQL> create synonym test_tab for t1;
    Synonym created.
    SQL> create or replace procedure p1 as
      2    l_count pls_integer;
      3  begin
      4    select count(*)
      5    into   l_count
      6    from   test_tab;
      7    dbms_output.put_line(l_count || ' records found.');
      8  end;
      9  /
    Procedure created.
    SQL> exec p1
    0 records found.
    PL/SQL procedure successfully completed.
    SQL> I guess, you don't have the select privilege on this table.
    Remember: The privileg must be granted directly to the user who is the owner of the procedure/function/package. Privilege through a role are not valid inside the procedure/function/package.

  • Expdp / impdp - Private synonyms using DB link not imported

    Hi
    I'd appreciate any help with this.
    We are taking an export (expdp) of a database on Oracle EE 10.2.0.3 in Prod and then importing it into an identical DB on 10.2.0.5 in Dev.
    I doubt the minor version difference is an issues, but I mention it for completeness.
    Our expdp in prod used to look like this:
    expdp agdba/x directory=DATA_PUMP_DIR dumpfile=X.DMP logfile=X.LOG schemas=A,B,C,D
    We have changed it to:
    expdp agdba/x directory=DATA_PUMP_DIR dumpfile=X.DMP logfile=X.LOG full=y EXCLUDE=SCHEMA:"IN ('E', 'F')"
    ( so basically do a full export, but exclude schemas E & F )
    The impdp in dev has not changed (we import one schema at a time):
    impdp agdba/x DUMPFILE=X.DMP LOGFILE=imp_X.LOG SCHEMAS=A DIRECTORY=DATA_PUMP_DIR TABLE_EXISTS_ACTION=SKIP
    DB user AGDBA has been granted the DBA role...
    The Issue:_
    Private synonyms that use a DB link are NOT imported, but private synonyms that do NOT use a DB link ARE imported.
    I can fix the issue by simply recreating the private synonyms using the DB link - e.g.:
    CREATE SYNONYM EVENTLOGTBL FOR EVENTLOGTBL@FCISTOSMS;
    Things were working fine until we change the expdp to use FULL. I see a few posts about synonyms and FULL=Y issues, but nothing quite like our problem.
    Any ideas?
    Thanks,
    Andreas

    Andreas Hess wrote:
    So the problem is expdp FULL=Y for some reason does not export synonyms that refer to objects via DB links. I doubt that ... More than few times a week I refresh non-prod databases from a prod db, (it is schema level export not FULL=Y), and two of the schema own db links, and others have synonyms pointing to them. I have never encountered synonym problem (except that if db_links are invalid then impdp takes extremely long time to timeout while compiling pl/sql code.). We normally change db_links after the impdp is done, or (while it is importing table via another session).
    I just re-ran sqlfile option with include=db_link,synonym option and i can see statements that create synonyms and create db links.
    However i think the order in which impdp runs might be the source of your problem ... see this
    Starting "ME"."SYS_SQL_FILE_SCHEMA_01":  ME/******** dumpfile=xxxx.%u.dmp directory=xxxx_exp schemas=schema1,schema2,schema3 sqlfile=schema.sql include=db_link,synonym
    Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM       <<<< Synonyms are created first
    Processing object type SCHEMA_EXPORT/DB_LINK               <<<< db_links come later
    Job "ME"."SYS_SQL_FILE_SCHEMA_01" successfully completed at 08:32:02So, it is conceivable that if you drop synonyms/db_links from your schemas before impdp, some synonyms will fail to create properly. This could be a version specific issue, mine is 11.2 and I don't see failures for synonym creation, i.e. no error messages while impdp. Next time you could try to drop objects except db_links and see if you still have the same issue.
    Raj

  • Complex use of private synonyms

    I need to write a create user script that sets up our database. for production this is easy, but for development and test it gest complicated.
    We have 1 user that contains all of our data tables.
    another user that has all our code and our logging data.
    In development I need to create sets so developers can have their own environment.
    So how do I make code_user_a only see code_user_b's data without changing code? I think can do this with private synonyms, but I am not sure how to do it.

    First off. Synonyms have not changed over the last few version, but we are in 10.2
    Second off the point of the question is that I do not want to put them each in their own schema, I want it to mirror production. This is where the complexity comes from. I also don't want to change code.
    In production we will have two schemas
    Schema 1: All the tables that contain application data that users will see
    Schema 2: All the code and the logging tables
    This is a fairly standard deploy and not that uncommon. However, it gets complicated in development because I can have multiple "sets" of
    Schema 1
    Schema 2
    For example, a Developer named Jim and a Developer named Bob need to have their own set of schemas to do testing. So I need
    Schema1_Jim
    Schema2_Jim
    Schema1_Bob
    Schema2_Bob
    I only want Bob's Schema2(which has code that uses data in schema 1) to see schema1_Bob and not Schema1_Jim.
    It is not uncommon to deploy with multiple schemas for security reasons. I have seen it required by SOX auditors because the group that deploys the code is different than the group that deploys the data and the auditors say they are not allowed to share passwords.
    This is my requirement and I have to deal with it. The question is what is the best way to handle it in development. Productoin is easy becuase there is only one set of privileges.
    DBMS_WM is a good suggestion for a simple system. However, we have code that adds and drops partitions that need to act on the other schema so it won't work/.

  • Private synonym unknown obj type

    Hi,
    I'm making a script, that makes private synonyms for the new database schema "ABC", for our existing schemas.
    part of the script is:
    SELECT * FROM (
         SELECT owner, object_name FROM all_objects WHERE owner IN ('ETL') AND object_type IN ('TABLE', 'VIEW') AND object_name NOT LIKE '%$%' MINUS(
    SELECT table_owner, table_name FROM all_synonyms WHERE UPPER(owner) IN ('PUBLIC', 'ABC')
    AND UPPER(table_owner) IN ('ETL'))
    r_synonym     sys.all_objects%ROWTYPE;
         FOR r_synonym IN table_synonyms
         LOOP
         EXECUTE IMMEDIATE 'CREATE OR REPLACE SYNONYM ABC.'||r_synonym.object_name ||' FOR '||r_synonym.owner||'.'||r_synonym.object_name;
         END LOOP;
    Now, the synonym gets created, but the info shows me "<unknown obj type>" and as you can expect, the synonym doesn't work (even though it's created).
    Any ideas?
    Thx

    Does ABC have any privileges on the objects?
    E.g. a sysnonym on a table will not work if you don't have a privilege like SELECT or UPDATE.
    Regards
    Marcus

  • Previously I had 2 iphone 4s work and private, I diverted the private to work ph and found that I was receiving sms's on both mobiles, from the a sender? Is there an option to do so for an IPhone 5 and Iphone 4? Jules

    Previously I had 2 iphones 4 and diverted private to work (calls) and found out the sms (from iphones and both phones had same contacts) that went to my private also registered to my work ph (different number)??!
    Is there a procedure to do from iphone 5 and 4??

    Are you using the same apple id in imessage? If so this is why.
    You need to sign out or uncheck the email in settings > messages

  • Can't view private synonyms in OWB 9.2.0.2

    Hi All,
    I have created a number of private synonyms in Schema A for objects that exist in Schema B. When querying these tables via SQLPLUS (whilst in Schema A) I have no problems but I can not see these synonyms when trying an import in OWB (my Source module is connect to Schema A). I have checked the "Use a synonym to look up objects" checkbox but I still only see physical objects in my shema and not synonyms.
    Any help would be hugely appreciated.
    Kind Regards
    Mitesh

    I would like to add that I have created the synonyms in SchemaA for object in SchemaB across using a DB_LINK. When I create the synonyms without the use of a db_link I have no problems but when using it I do?

  • Private Synonyms Referencing

    Question in my text asks
    13. A private synonym:
    A. Can be seen by any user in the database who has privileges on it and has privileges on the
    synonym’s underlying object.
    B. Can only be seen by the user who creates it, and cannot ever be seen by any other user in
    the database under any circumstances.
    C. Is created with the CREATE PRIVATE SYNONYM statement.
    D. Is also called a “column alias” in a SELECT statement.
    Anser is A.
    My question is can't you grant privileges on the private synonym alone in order for it to be 'seen' by the given user.
    I mean normally you would grant a table privilege to a user, then create a synonym for it. What if we just created a synonym and granted privileges on the synonym without granting access to the table. Can't the user still see the synonym, without being able to query the table..?

    When you grant a privilege on a private synonym to a user oracle actually grants privilege to the underlying object itself. Just create a synonym and grant select privilege to some user for that synonym and then check the user_tab_privs for the granted user.

  • Private synonym privileges

    Hello i am new to oracle.can anyone help me with this problem?
    I am able to create public and private synonym in main user 'system'
    But while creating the same in other users 'scott'
    1* create public synonym empdetails for emp
    SQL> /
    Synonym created.
    public synonym is created but while trying for private synonym
    SQL> CREATE SYNONYM empd for emp;
    CREATE SYNONYM empd for emp
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Thanks in advance

    Your system privileges:
    select *  from USER_SYS_PRIVS
    -- related to synonyms
    select *  from USER_SYS_PRIVS WHERE PRIVILEGE like  '%SYNONYM%'If you don't have this privileges, you need to connect to another schema which can give scott this kind of privilege(you've already done in your first post from SYSTEM):
    grant create /*public*/ synonym to scottYou could start reading here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16508/schemaob.htm#CNCPT711
    or
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9013.htm#i2062318
    and
    http://wikis.sun.com/display/Forums/Forums+FAQ
    Edited by: zep111 on Apr 18, 2011 5:16 PM
    Ops. I've commented "public" in the grant.

  • Reading private key: works in jdk 1.5, but throws exception in 1.4

    Hello,
    I am trying to read an RSA private key from a file. I am using the following code snippet:
    KeySpec spec = new RSAPrivateKeySpec(modulus, pExp);
    KeyFactory factory = KeyFactory.getInstance("RSA");
    PrivateKey key = factory.generatePrivate(spec);
    This runs perfectly fine under jdk 1.5 on keys I generate with OpenSSL. However, if I recompile and run under jdk 1.4, I get the following exception:
    java.security.spec.InvalidKeySpecException: Unknown key spec.
         at com.sun.net.ssl.internal.ssl.JS_KeyFactory.engineGeneratePrivate(DashoA6275)
         at com.sun.net.ssl.internal.ssl.JSA_RSAKeyFactory.engineGeneratePrivate(DashoA6275)
         at java.security.KeyFactory.generatePrivate(KeyFactory.java:237)
    I have also tried using RSAPrivateCrtKeySpec but I get the same error. Can anyone shed some light on what is going on?
    Thank you.

    'Unlimited Strength Jurisdiction Policy Files 1.4' Could be the solution.
    I had a similar problem with java 1.4 and those files do the work.
    ... finally the problem was that the password that protectd the keystore had 7 characters, using one of 5 characters works ok...

  • Why wont my private browsing work - it did yesturday

    also I have two blue bars across the top of browser. On the left side the top one has the firefox logo, the bottom has Firefox button. And on the right side I have two minimiz-resize and close buttons, one set on top bar, one set on bottom bar. Is something wrong with my insallation??? And private browsing quit working. Just installed this two days ago. Just updated it. I have four add-ons. Ghostery, No-Script, Privacychoice and better privacy. thanks, W

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Change Display Privat to Work?

    How can I change a existing Adress from Privat (Name/Prename) to Work (Firm) or vis versa via iCloud, iPad or iPhone?   
    On the Mac it is easy via the Adress Application but with the others I don't know.

    It's not there. In Mountain Lion, the Displays options have changed somewhat:
    It only shows the external display option when a display is detected.
    Clinton

  • How to check my RAC private interconnect working properly?

    All,
    Is there any way to check whether my RAC private interconnect is working properly or not?
    Thanks,
    Mahi

    Mahi wrote:
    All,
    Is there any way to check whether my RAC private interconnect is working properly or not?
    Thanks,
    MahiCVU verifies the connectivity between all of the nodes in the cluster through those interfaces.
    $cluvfy comp nodecon -n all -verbose
    http://docs.oracle.com/cd/E11882_01/rac.112/e16794/cvu.htm

  • How a Synonym works in APEX

    I have been trying to set up a table for users to Insert, Update, or delete. This table is in a synonym from another schema and I can't get it to show up how I would like so that the users can modify the table.
    When I look at the synonym from the Object Browser, I can not see any fields, Is this Correct?
    I would like to show the fields for this table in a tabular form for update, but the forms only accepts tables unless you use a SQL query, Is there a way to show a synonym's fields in a form for Update, Insert, or delete?
    Whwn I use a sql query for the synonym, no values shw up when I run the form, any reason why?
    Thanks
    Rob

    Hi,
    i don't have a clue, i mean, without seeing the application it's hard to say.
    Clearly you need to find and replace each and every occurrence of the dummy table name and put the name of the synonym, along with the name of the primary key.
    I never tried to use rowid as primary key, so i cannot say if that works or not, i'd stay on the safe side and define a primary key on the table, a simple ID column with a sequence number (you can use it inside a trigger or let apex use the sequence directly).
    Bye,
    Flavio
    http://www.oraclequirks.com

  • Firefox won't load, but private browsing works.

    I cannot load any pages in Firefox. They will not show as loading, and it simply says Connecting...
    Then, if I click anywhere else, it'll fade and say "Not Responding". It started today, and every time I open Firefox, it does this.
    However, if I enter private browsing, everything works just fine.

    If you are in PB mode then the disk cache is disabled and you do not have access to the cookies from normal mode (you get a fresh new set).
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.<br />
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete other present cookie files like <b>cookies.sqlite-journal</b> in the Firefox Profile Folder in case the file cookies.sqlite got corrupted.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    See also:
    *http://kb.mozillazine.org/Cookies

Maybe you are looking for

  • Can 2 people with different apple id's share an iTunes library

    We have 2 apple id's and one laptop. Can we shre our iTunes library?

  • Acrobat Pro 9 Crashes

    APro9 has not worked from the initial install of CS5 and not even a brand new computer (Core i5 3.1 GHz) and new OS (10.7.1) or reinstalls have made a difference in fixing it. Nor have all the tedious updates from 9.0 through 9.46 done a thing. And t

  • Setting up router with ethernet bridge

    I have a new computer and want to re-setup my Linksys Model BEFSX41 Version 2 broadband firewall router with the Linksys Model WET11 wireless-b ethernet bridge to use my laptop wirelessly.  I don't want the desktop pc to be wireless, just the laptop.

  • Archiving Purchasing documents particularly scheduling agreements

    Hi  , I need to archive scheduling agreements. Kindly let me know the process for archiving it. I have tried using SARA and the object MM_EKKO but the agreement number which i try to archive returns the message , no data selection found. Thanks in ad

  • IPhoto 6 retouch question?

    Hi all, Was wondering if anyone knew how to make the retouch button cover a smaller area when trying to touch up a photo. In 5 it gave me the arrow which was really great for close detailed touchups around the lip and eye areas. 6 always covers a rat