Use of (SYNONYMS)

Hi ,
What are the benifites of SYNONYMS in database.
Plz explain with example.
Thank's in advance

well u cud have got this from any oracle book :)
1) masking --- the user won't be able to know the owner of the table ect .
2) ease of use :) instead of everytime write schemaname.tablename directly use the synonym

Similar Messages

  • How can I access a database remote without using dblink, synonyms,aliases?

    My store procedure access a remote tables using dblink, synonyms, alias, but by business company requirenments I nedd to use another data base access method. My PL/SQL statement looks like
    select c.cus_id, c.cus_name, p.bankaccno
    into v_cus_id, v_cus_name, v_bankaccno
    from customer c, payment@finantial p
    where c.cus_id = p.cus_id
    Are any method else to connect to several remote databases concurrently?
    If Yes, plase say me how is it, or tell me where do I obtain some examples, or any documentation.
    Edited by: user518321 on Apr 21, 2009 1:58 PM
    Ok, But I must not use any of these data base access method, metioned: dbliks, aliases, synonyms.
    Edited by: user518321 on Apr 21, 2009 2:05 PM
    Ok, It is enough for now, I am surprised for the response time and for their arguments, thanks a lot.
    Edited by: user518321 on Apr 21, 2009 2:50 PM

    If you want to access a table in a remote database using SQL, you will need a database link. It would be exceptionally odd for the business to require that you access a remote database and to prohibit the use of database links. What is the business reason for that combination?
    If you want to look into rather more esoteric solutions, you could load a JDBC driver for the remote database, write a Java stored procedure that queries the remote table using that JDBC driver, and then cobble together some PL/SQL that joins the two result sets. You won't be able to reference the remote table in SQL and the solution won't scale well as data volumes increase and you'll be writing a whole lot of code to manually join tables together, but it does avoid database links. Of course, whatever concerns lead to the ban on database links would probably apply to loading a JDBC driver into the database and writing Java stored procedures to access the remote database, but since you haven't explained the reasoning behind the restrictions, we're just guessing.
    Justin

  • Using table synonyms in Spatial 8.1.7 - ORA-13203 error

    I'm using Oracle Spatial 8.1.7, and I'm encountering an "ORA-13203: failed to read USER_SDO_GEOM_METADATA" error when I try to run an SDO_RELATE query on a table that is a synonym of another table.
    The table is called T_TRB1_BIN and the synonym is called S_TRB1_BIN. I can load T_TRB1_BIN just fine.
    My USER_SDO_GEOM_METADATA view has a TABLE_NAME entry for T_TRB1_BIN. I tried changing it to S_TRB1_BIN, but to no avail.
    So, am I correct in assuming that you cannot use synonyms on spatial tables if they are used in spatial queries? If so, does this apply to 9i as well?
    Thank you.

    I'm not 100% positive, but it looks like this does apply to 9i as well (synonym support doesn't work correctly, unless you use a synonym name equal to the table name).
    Also, I believe this support has been added in 10i (but not 100% sure).

  • Force the use of synonym (database link)

    Hello,
    I'm on a database DB_1 with the user NP.
    In the NP schema I have a table TEST_TABLE.
    I create a public synonym on TEST_TABLE referencing a table named TEST_TABLE in a database DB_2 (*the synonym use a dblink*).
    In my DB_1 instance connected with NP user, when I run "SELECT * FROM TEST_TABLE", the result is the content of TEST_TABLE in DB_1.
    Connected with NP user on DB1_instance, how can i force the use of the synonym to get the content of TEST_TABLE in DB_2 instance ? Is it possible ?
    Thanks...

    Pl post details of OS and database versions.
    I do not believe you can achieve your requirement, unless you name the synonym something other than "TEST_TABLE". The resolution to "TEST_TABLE" will always result in the local table first - the synonym will not be included in the name resolution.
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements009.htm#SQLRF51134
    HTH
    Srini

  • Search using Metadata & Synonyms

    In a document library I've added a metadata column, so tagging information with synonyms can occur.   However, I'm not able to search the document library with the tagged metadata or synonym terms. 
    I've created a new managed property within search, enabled use in scopes, and added the ows_ column from my document library.   I feel I'm missing something simple on this one.  
    Thanks in advanced.
    Joe--

    Yes using the site search box. 
    Also, I've completed a full crawl.
    Originally, I was working within a Content center template.   But, to simplify things I created a team site, and tested with a new document library with just 2 documents. 
    Joe--
    Joe--

  • Use of synonyms in procedures

    In my procedure I need to select from a table in another schema. There is a public synonym for the table but I keep getting the compile error, 'Table or view does not exist'. I also tried making a private synonym with the same compilation results. I heard that in a procedure you can't select from a synonym but you can from a private one. Anyone know if that is true? Any suggestions?

    I heard that in a procedure you can't select from a synonym but you can from a private one.Horse feathers.
    What you actually got is permissions problems: we cannot build procedures (or views for that matter) on tables belonging to other users who have granted us privileges through a role. If you get user B to grant you SELECT or whatever directly to your user account you will be able to build your procedure.
    Cheers, APC

  • Migrating from SQL to ORACLE 11g : naming length Issue using synonyms...

    Hi,
    In sql I have maximum length of objects is 98 char
    now i m migrating it into oracle , i m using synonyms for it ..
    it is showing synonyms created ...
    but it gets converted into encrypted forms,
    due to this i m not able to use actual synonyms that i have created
    so tell me how can i create synonyms of more than 30 characters
    If this is not possible , then wht else solution by which i can solve ma problem.
    please give me solution asap!!!!!!!

    Create synonym name with more than 30 character.

  • SQL Server synonym used in two ways, local table and Oracle table via ODBC, fails on ODBC

    I am implementing a Web Site at our institution that was written for another institution that was all SQL Server.The Web Site has included as a feature the use of synonyms which have a dual use. Normally they point to a different machine, different database (PeopleSoft)
    via linked server, but if the linked server connection fails they can be switched to point to tables on the local instance by running a stored procedure that redefines the synonyms. This is a failover feature meant to keep the site up by resorting to
    possibly out of date data if need be.
    This means that any SQL Select statement that uses one of these synonyms is unaware of whether the data returned comes from the local instance or from another remote instance. There is no logic to check whether the linked server is functioning or not.
    The local instance is a custom SQL Server database at both institutions. The remote instance is one of two PeopleSoft instances at both shops; however, while the original website was written to work with the remote instance being SQL Server,
    our shop uses Oracle for PeopleSoft. This means that our linked servers are further complicated by an ODBC connection that the original site did not need.
    The problem I have is that the SQL statements in the stored procedures that came with the Web Site do not work when a synonym is used that points to the remote PeopleSoft instance. The same statements also fail in SSMS.  I get this error when I run
    this statement (select * from PS_ZZ_BUD_JOB_VW):
    Error: The OLE DB provider "OraOLEDB.Oracle" for linked server "CSUPG" does not contain the table
         ""dbo"."PS_ZZ_BUD_JOB_VW"". The table either does not exist or the current user does not have  permissions on that table.
    I can successfully query the PeopleSoft database using openquery, but unless I can get the synonyms to work as they were intended to, I'll have to rewrite all the stored procedures that use them to: 1) check if the linked servers are up, then 2) execute
    one of two versions of each SQL statement depending on the result of that check.

    Will the four-part notation work when the synonym is pointing to the local SQL Server table ?
    You should not use four-part notation when you reference your synonym. The four-part query that I suggested is only one you would to determine to define our synonym correctly when the view is on the Oracle server.
    In the case of synonym PS_ZZ_BUD_JOB_VW, it can point to either an Oracle view of the same name, or to a local SQL Server table named PS_HR_JOB.
    Then the table is local the synonuym definition should be
    CREATE SYNONYM PS_ZZ_BUD_JOB_VW FOR dbo.PS_HR_JOB
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Automatic Row Processing (DML) using synonym name instead of table

    I want my APEX form to select info using the table name but perform all the DML (add, change, delete) using the synonym name. I created the form using the wizard and went into the "Process Row of xxx" process that was created. I tried changing the table name to synonym name under the 'Source: Automatic Row Processing (DML)' section, but it still uses the table name. Is this possible or do I need to manually create processes using the synonym names

    Hi,
    when I change the Table Name property in the "Automatic Row Processing (DML)" process to a non existing table it raises an error when I run the page and try to save something. So it's actually using the value.
    Does the synonym point to the same table or a different table? What is the intention behind selecting from the table but updating through the synonym?
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com/
    The APEX Builder Plugin: http://builderplugin.oracleapex.info/
    The ApexLib Framework: http://apexlib.sourceforge.net/

  • Using Synonyms in DI

    Post Author: HintonBR
    CA Forum: Data Integration
    Does anyone know of a good workaround to be able to use Oracle synonyms as data sources?  I know that if the synonym and the underlying object (table or view) have the same name I can rename the owner of the object (if say the object was in one schema and the synonym was defined in the schema I was connecting with) and that will fact the system into accepting the synonym. I imagine that only works because DI was able to get the metadata first from the real object.  In fact you can't reimport objects that have been renamed to use the synonym because it can't find the metadata now.  Not to mention this workaround doesn't work for any object where the synonym and the underlying object don't have the same name. Synonyms are important to us to provide an abstraction between our ETL and the upstream data sources so that we aren't dependent on object names, schemas, etc... so has a fairly serious impact to our architecture not to be able to use them.  Anyone have any ideas? Thanks,Bryan

    Post Author: wdaehn
    CA Forum: Data Integration
    I would have used database views as the abstraction layer rather than synonyms. The advantage would be that for views you can see the dependencies, for synonyms not that easy as they are just textual replacements inside Oracle.

  • Oracle Best Practices Discussion Pros/Cons of using Synonyms

    Please share your experience given the Pros/Cons of Developing Enterprise Database Applications using public and private Synonyms.
    My recommendation to developers on my team is to avoid using Public Synonyms in their code and instead Fully Qualify the database object by schema owner.
    Pros: When you drop a schema, you do not drop the public synonyms that they created. Therefore if you have to use synonym, make it private and not public.
    Please share your experience!

    Fahd Mirza wrote:
    Well I rarely use public synonyms and that only case of db links. For example, I have a scenario, in which I have hooked up a MS SQLSERVER database with Oracle database through Heterogenous Services. I am accessing the SQLSERVER table in real time, through HS, in Oracle in real time, and then from this Oracle environment I have created db links to many other interested databases. In those interested database, I have created public synonyms over those dblinks.
    It's so transparent for the interested databases. But I have documented this whole configuration in great detail for any upcoming DBA, just in case I leave, or expire or anything. Sounds interesting - this might be worth 'cleaning' and publishing to OTN's Articles. If you are interested in pursuing this, you might want to contact Justin (Community Forum) or myself ([email protected])

  • Form creation using Synonym

    Hi,
    Is there any way to create a Form using a Synonym?
    Mohan

    You could create a view as a select * from it like this
    CREATE OR REPLACE PUBLIC SYNONYM emp_sym FOR emp;
    CREATE OR REPLACE FORCE VIEW emp_vw AS
    (SELECT *
    FROM emp_sym);
    -- then create your form on emp_vwCheers
    Ben

  • Report using two different data sources won't work.

    I'm trying to build a report that shows information from a production table and an archive table.
    Tables are in different databases, which are defined as their own Data Sources in Publisher.
    Two data sets containing the same query but using different Data Sources are defined in the Data Model.
    When selecting option 'Concatenated SQL Data Source' the report never completes.
    If any of the two Data Sets is selected as the Main Data Set, the report shows information related to that source only.
    Any hints on how to make this work would be appreciated.
    Thanks.
    ccastillo

    More details on this issue:
    The production database has a synonym pointing to the archive database. I build a query using a UNION ALL statement linking both tables.
    For the same set of parameters, this query completes in a couple of minutes outside BI Publisher, but never ends (I cancel after an hour) inside Publisher.
    Is there any special considerations for the use of synonyms inside Publisher?

  • Unable to parse query when using dblink in forms 4.5

    Hi,
    I have created a query that uses a DBlink because I need to do query on a table located on another dbase. I've used the query on creating my report using Reports 6i. The report needs to be called from a menu on our system, which was developed under Developer 2000 (forms 4.5). The problem is, when I tried to access the report from the menu, it returns the error 'unable to parse query'. What I did after getting error was to create a dummy module using Forms 6i, and call my report from there. It worked fine.
    By the way, the table that I'm accessing using the dblink is under Oracle 9i dbase, and the dbase of the system that I've been working at is Oracle 8i.
    I don't have any idea on what's causing this error. Is there a compatibility issue when using a dblink located in Oracle 9i database with forms 4.5?
    Thanks!

    Hello,
    Not sure if it is the good answer, but I know that Forms does not recognize dblink and owner.object syntax. You have to create a simple synomym that point to the distant object and use this synonym within Forms.
    Francois

  • Error while loading the jar file using loadjava

    Hi,
    I'm trying to load a jar file in to a database through the loadjava utility. First time when i loaded a jar file it created few public synonyms with /'s. like /5b3d7f97_BeanInfoIndexer.
    Now i want to drop these synonyms before i reload the jar file with loadjava.
    If i use DROP PUBLIC SYNONYM /5b3d7f97_BeanInfoIndexer; it gives the following error...
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    I wonder how to drop these synonyms. I have to drop all these synonyms to freshly load the jar file.
    Thanks
    Shiva

    You can include the synonym names in double quotes in the drop synonym command. But it is not a good idea to drop the synonyms(which have been created by loadjava) using drop synonym command. Instead, you can use dropjava command which will automatically drop all the synonyms created by the loadjava command.

Maybe you are looking for

  • A Hacker going at my computer?

    Hello, I think the following log indicates a hacker going at my computer, trying to gain access. Is that right? I took off the repeats, because each attempt at a username had about five or six or seven tries in a row. And also, I separated each try f

  • How can I get my 10.6.8 MacBook to download Mavericks?

    Hi there, I've been scouting various threads on the Support Community but still can't seem to figure out what's up with my MacBook... * I get onto the App Store... * Click on the link to download the free upgrade of OS X Mavericks... * Click on 'Inst

  • WRT160N wireless is working, but not wired

    Hello,  I installed firmware 2.0.02 and configured my WRT160N using the instructions from this post: Post WRT160N   My wireless connection is working great from my laptop.  I am very happy with the range and speed.  However, I have a desktop that is

  • Bug in PDF pinch and zoom?

    Hi, I have a big problem related the PDF pinch and zoom. When I try to make an article with 2 vertical pages each containing one imported PDF and 1 horizontal page contain two imported PDF, the result is a simple jpeg page with no pinch and zoom. The

  • Passing Query to CFC

    I am passing a query to a cfc. When I dump the query in the cfc it looks fine. However, when I attempt to loop over the query I get the following error: Complex object types cannot be converted to simple values. The expression has requested a variabl