Export of public synonym in oracle

Hi All,
I am trying to export the database dump in oracle 10g using expdp command.But when I am trying to import that file i found that public synonym are missing.
Can anyone help me its very urgent.
expdp system/oracle directory=export dumpfile=<<x.dmp>> logfile=<<y.log>> schemas=ww_admin
TIA,
Ravi

Hi,
You can write a script to spool the list of public synonyms.
set feedback off
set trimspool on
set pagesize 1000
set linesize 1000
set heading off
spool public_synonyms.txt
select      'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
from      dba_synonyms
where
     owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
order by
     table_owner;
spool off
exit
Hope it helps.
Regards,
Z.K.

Similar Messages

  • Export Database Link & Public Synonyms using Expdp

    Dear All,
    We are using expdp to do schema level exports:
    expdp dumpfile=<Directory>:expdp.dmp SCHEMAS=S1,S2,S3
    We also want to export the Public/Private Synonyms (created for the objects owned by above users), Public/Private Database Links as part of above command.
    How we can achieve this? We are using 11gR2.
    regards,
    Riaz

    HI,
    Public synonym can not be exported and never exported even at FULL Export also. . You can get them from "dba_synonyms". I suggest that you create so customer script .
    select      'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
    from      dba_synonyms
    where
         owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
    order by
         table_owner;
    More: Information:
    https://forums.oracle.com/thread/855639?start=0&tstart=0
    Oracle Data Pump Schema Export and Public Synonyms
    Thank you

  • Public Synonym in Expdp

    Oracle:11.2.0
    OS: Windows
    Is it possible to export public synonym with the help of expdp utility?
    If not, what is the reason behind this?
    Thanks,
    AKPT

    No it is not possible. You can run the following scriptm spool it and run it on a desired database
    select 'create public synonym ' || synonym_name ||
           ' for ' || table_owner || '.' || table_name || ';'
    from dba_synonyms
    where owner = 'PUBLIC'
    and table_owner = 'THAT USER'
    Also, if you want to export using expdp, you can read the following link
    http://www.dadbm.com/2012/01/how-to-export-public-database-objects-with-oracle-data-pump/

  • Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?

    Hi All,
    I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
      2  REFRESH ON DEMAND
      3  WITH PRIMARY KEY
      4  AS
      5  SELECT name,id
      6  FROM syn_t;
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
      2  WITH PRIMARY KEY
      3   (name)
      4    INCLUDING NEW VALUES;
    Materialized view log created.
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
    REFRESH ON DEMAND
    WITH PRIMARY KEY
    AS
      2    3    4    5  SELECT name,id
    FROM syn_t;   6
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
    WITH PRIMARY KEY
    (name)
      INCLUDING NEW VALUES;  2    3    4
    CREATE MATERIALIZED VIEW LOG ON  MV_t
    ERROR at line 1:
    ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
    Message was edited by:
    Avinash Tripathi
    null

    Hi Nicloei,
    Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
    Regards
    Avinash

  • What can i do for creating view on a public synonym?

    Hi people,
    I have create a public synonym for other users object as,
    SQL> create public synonym pdep for scott.dept;
    Synonym created.
    then i tend to create a view on this public syn as,
    SQL> create view vpdep as select * from pdep;
    create view vpdep as select * from pdep
    ERROR at line 1:
    ORA-01031: insufficient privileges
    I have privilege to create view.also i can create view on a public synonym of my own objects.for ex,
    SQL> create public synonym cdep for dept;
    Synonym created.
    SQL> create view vcdep as select * from cdep;
    View created.
    what could be the reason behind this?is there any privilege required for me.pls suggest me.
    Regards
    VIDS

    Hi vidusnat!
    This is from Oracle's onlinedocumentation:
    >
    Privileges Required to Create Views
    To create a view, you must meet the following requirements:
    You must have been granted one of the following system privileges, either explicitly or through a role:
    o The CREATE VIEW system privilege (to create a view in your schema)
    o The CREATE ANY VIEW system privilege (to create a view in another user's schema)
    You must have been explicitly granted one of the following privileges:
    o The SELECT, INSERT, UPDATE, or DELETE object privileges on all base objects underlying the view
    o The SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, or DELETE ANY TABLE system privileges
    In addition, in order to grant other users access to your view, you must have received object privileges to the base objects with the GRANT OPTION clause or appropriate system privileges with the ADMIN OPTION clause. If you have not, then grantees cannot access your view.
    >
    I hope that this will bring a little light into darkness!
    Yours sincerely
    Florian W.

  • Performance of DB Link VS Public Synonyms

    1) In a single database(Oracle 9.2) , I have multiple schema say a, b ,c d ,e etc.Currently we are using public synonyms to access tables of other schema.There is a plan to split the database into two or three DB and to use db links instead of public synonyms.So what would be impact on performance?
    2) In a same database for accessing multiple schema objects which one between DB link and Synonym is a better approach and why? How are the working mechanism for each of them?
    Appreciate your quick response.

    MSINHA wrote:
    No, on the same server we will have different instances. We are trying to split the schema into separate DB so as to independently upgrade them as they are for different applications and modules but some of the tables are common and being accessed using public synonym.Horrible idea to run multiple database instances on a single server. This is not how servers scale.
    Oracle scales by adding more servers to a single database - this is called RAC.
    Your approach is the exact opposite. Adding more databases to a single server.
    That approach seldom makes any technical sense - and is usually forced by circumstances (like running 2 different Oracle versions) and not by sound technical, performance and scalability reasons.
    Keep in mind that an Oracle database is NOT architecturally and technically the same as a mySQL or SQL-Server database. A mySQL/SQL-Server database is called a schema in the Oracle environment.

  • Problem in CR XI returning Views with PUBLIC synonyms

    I am having problem in CR XI returning Views with PUBLIC synonym.
    I can see the tables and stored procedures with PUBLIC synonym but not VIEWS.
    This is a simple View that has a PUBLIC synonym to it. I have granted the user SELECT access to the underlying Views.
    I checked the boxes in Report > Options for all the combinations possible one by one but to no avail.
    I connect CR to the instance as a specific user , password. But when I go to Views (and Tables) there is nothing visible.
    I tried PRIVATE synonyms and when I go to Views (and Tables) the views are visible, but now the Fields are not visible.
    In SQL+ and Oracle SQL Developer connected as the same user , password everything looks ok.
    Any help will be appreciated.

    Hi Wayne,
    Sorry for the delay. Not sure where this post came from.... must have been transferred from another forum.
    R1 is no longer support nor are updates available. You can upgrade to CR Xi R2 for free, it's end of life now also but has all of the latest patches included.
    Install with your XI R1 keycode and then test again.
    http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
    http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE
    Thank you
    Don

  • Dropping public synonyms in a pluggable database

    I have an Oracle 12c container database with several pluggable databases in it.  In one of the pluggable databases, I de-installed OLAP by running the following scripts:
    SQL> @%oracle_home%/olap/admin/catnoamd.sql
    SQL> @%oracle_home%/olap/admin/olapidrp.plb
    SQL> @%oracle_home%/olap/admin/catnoxoq.sql
    SQL> @%oracle_home%/olap/admin/catnoaps.sql
    After running the scripts, I then generated the SQL statements to remove invalid OLAP synonyms, by executing the following:
    select 'drop public synonym ' || object_name || ';'
    from dba_objects
    where status <> 'VALID'
    and owner = 'PUBLIC'
    and object_type = 'SYNONYM'
    and object_name like '%OLAP%';
    When I execute the resulting SQL statements in the pluggable database, I get the following error for all of them:
    ERROR at line 1:
    ORA-65040: operation not allowed from within a pluggable database
    If I switch back to the CDB$ROOT container and execute the same statements, I get the following error:
    ERROR at line 1:
    ORA-01432: public synonym to be dropped does not exist
    How can I remove these invalid public synonyms from my pluggable database?

    OK - let's go back to the basics
    For 12c you should NOT be manually removing/uninstalling/disabling Oracle options.
    There is a CHOPT utitlity specifically designed to enable or disable certain options.
    http://docs.oracle.com/cd/E11882_01/install.112/e48740/post_inst_task.htm#CHDFEIJF
    5.2.7 Enabling and Disabling Database Options
    When you install Oracle Database, some options are enabled and others are disabled. To enable or disable a particular database feature for an Oracle home, shut down the database and use the chopt tool. See Example 5-1.
    The chopt tool is a command-line utility that is located in the ORACLE_HOME/bin directory. The syntax for chopt is:
    That doc section shows that one of the 'db_option' values available is 'olap' to disable. NOTE: the uttility DISABLES the option. It is still not clear to me why you would attempt to actually deinstall it.
    If your concern is licensing then all you need to do is disable it. It is very possible that you have corrupted that PDB by attempting a manual uninstall. Only Oracle support could tell you for sure.
    If it is a new PDB and licensing is your issue you may be far better off starting over and using CHOPT to disable the options you don't want.
    1. why are you 'unistalling' olap in the pdb? What PROBLEM are you trying to solve?
    2. why are you manually dropping synonyms?
    3. how did you decide to execute those particular scripts? Is there an Oracle doc you are following that has instructions for deinstalling olap? Does that doc give you the order to execute the scripts in?
    If you review the catnoamd.sql script you will see that just about ALL that it does is drop public synonyms.
    Most of those synonyms that it drops have 'olap' in the name.
    Which suggests that if Oracle wanted those synonyms YOU are trying to drop to be dropped you have to wonder why it didn't drop them itself in that script.
    Was that script the FIRST script you executed?
    1. Modify your 'drop' script to simply create the DDL to drop the synonyms.
    2. Then examine the data dictionary to see what objects those synonyms refer to.
    3. Then check if those objects still exist or not
    4. Also check those scripts to see if they did anything (e.g. drop) those objects.
    Post the results of the above.

  • "Loading Public Synonyms" in SYS schema hangs indefinitely

    When I try to expand "Public Synonyms" in SYS schema tree, the "Loading Public Synonyms" message window appears and hangs indefinitely without giving any result.
    Trying the same in Reports/All Objects/Public Synonyms I get the result within a second.
    What's wrong?
    I'm running SQL Developer 1.1.2.25.79, Oracle Database 10g R2 (10.2.0.3) on 32-bit RHEL-4.4 AS using Sun jdk1.6.0_01.
    N.J.

    If you do a select count(*) from dba_synonyms where owner='PUBLIC' you'll get a figure around 20,000 (I get 19697 from a 10.2.0.1 database out of a total of 23992). So, it'll not only take a while to return all the public synonyms but it'll also take a while to sort the output.
    However, I've created a test report with the following SQL and it works quickly
    select *
    from dba_synonyms
    where owner='PUBLIC'
    I guess it's a bug in SQL Developer - perhaps one of the development team could confirm?

  • Recreation of Public Synonym

    Database version 11g. (11.1.0.7)
    Please advise. We had a customer at one of our companies that said they were forced to do a "CREATE OR REPLACE" on a couple Public Synonyms this past weekend that was marked as "VALID" according to DBA_OBJECTS. The synonyms and the objects they pointed to were still in existance. They are using an older version of Oracle Forms which stopped working this past weekend. They did a "CREATE OR REPLACE" on the synonym and fixed their problem.
    I am trying to think of possible reasons why they would have needed to do the "CREATE OR REPLACE" on a "VALID" synonym. Any advice?
    I understand why a synonym can become invalid when the underlying object goes away or permissions change.

    Hi,
    You can write a script to spool the list of public synonyms.
    set feedback off
    set trimspool on
    set pagesize 1000
    set linesize 1000
    set heading off
    spool public_synonyms.txt
    select      'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
    from      dba_synonyms
    where
         owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
    order by
         table_owner;
    spool off
    exit
    Hope it helps.
    Regards,
    Z.K.

  • Context public synonym

    Hello,
    After installing Oracle text in 9i, we realized that the install drops/creates a public synonym named context. Our third party App already had a public synonym named context that pointed to one of its table. . Are there any issues with dropping and pointing this synonym back to our applications objects?
    I am mainly worried about patches
    Thanks

    Hi,
    I certainly wouldn't recommend doing it. Contact your 3rd party app vendor. If they are connecting to oracle and creating synonyms that are in conflict with oracle defaults, they should change it. You wouldn't expect an application to take over a system dll file on Windows and expect MS to change to accommodate - same here. The vendor should change their code (I'm a vendor saying this...).
    Thanks,
    Ron

  • Problem to resolve existing public synonym ?

    Hello,
    I would like to know if there are some circumstances under which a valid
    public synonym on a table still brings up
    ORA-00980 (in Oracle Reports).
    The situation is this:
    We have two main schemas, one is crowded with tables and all stored
    procedures, and one with a single but
    large table. This table has a public synonym and can be selected from in
    SQLPlus and so on. No [schema.] is needed.
    But in Oracle Reports, the synonym "cannot be resolved". All other tables
    can be selected, but the update on the
    special large table failes.
    Or is Reports behaving different from SQL*Plus ? One of our developers gave
    up using synonyms
    and started adding [schema.]table to the statements.
    Has anybody here made similar observations ?
    I re-created the public synonym last night, because we thought it maybe caused by our
    recent db upgrade, but the situation did not change.
    What could it be ?
    ThanX in advance.
    Jan

    Jan,
    You didn't state what version of the database you are using, nor whether you are accessing the table in the Reports data model or in a PL/SQL trigger. There are known bugs about when accessing a synonym under specific conditions, although a common theme seems to be when accessing from within a PL/SQL block. You should contact Oracle Support and work with them to resolve this issue for your specific situation.
    regards,
    Stewart

  • Cannot see columns for some of the public synonyms

    Background Info
    I am using the Oracle 8.1.6 JDBC driver and connecting to Oracle 8 database. My plan is to give the user the option to initially select the type of tables that they want to see i.e. USER tables, SYSTEM tables, VIEWS and SYNONYMS. Based on the user selection I first display all the tables (for that type) and for each table selected by a user display the relevant columns.
    I am doing this by using the DatabaseMetaData.getTables () and then the DatabaseMetaData.getColumns () methods
    Problem
    When I use these methods for SYNONYMS I cannot see the columns for lot of the public synonyms. Some the SYNONYMS for which I cannot see the columns are
    ALL_JOBS, COLS, CLU, CAT, TABS.
    As part of the debugging process, I found a java file OracleDatabaseMetadata.java file (as part of 8.0.4 sample files). In this file I see that calls are being made against ALL_TAB_COLUMNS. For each of the synonym that I am seeing the problem, there are no columns in ALL_TAB_COLUMNS. But when I do a desc ALL_JOBS in SQLPLUS, I get the columns for ALL_JOBS. So now I am confused on what is happening in the 8.1.6 JDBC driver.
    Has anyone else run into the same problem.
    Thanks

    There are some cases where Discoverer cannot determine with certainty that the Totals or subtotals you create will be correct. It flags those totals as Values that cannot be aggregated. Go to Options-> Sheet Format and you can set what string you would like to see placed in those cells that Discoverer determines cannot be aggregated correctly.
    Assuming that the blank totals are non-aggregable by Discoverer, there are some things you can do to to alter either your business area or worksheet or calculation that will enable you to get the totals you want. As this analysis takes some time and iterations, it is usually best handled through Oracle Support. Also see the doc and RN references to the EnhancedAggregationStrategy in the Preferences.
    Also, given the version you are using it seems that you have just started using 9.0.2. You should strongly consider upgrading to OracleAS 10g (9.0.4) or at least upgrade to the latest 9.0.2 patch -> 9.0.2.54.
    Discoverer Product Management

  • Create a public synonym for a db link - "Connection desccriptor not found".

    I want to create a public synonym for a db link.
    The existing db link name is tst.world ( which is in db links table and is working fine).
    I created the following db link using the following command:
    create public synonym "syn.world" for "tst.world";
    It created the synonym successfully.
    If I try the following, it throws error "Connection desccriptor not found".
    select * from [email protected];
    It says "Connection desccriptor not found".
    Any suggestions.
    Thanks in Advance.

    Well then, lookup the Documentation on the CREATE SYNONYM statement in the SQL Language Reference manual.
    The documentation lists the types of objects which you can create synonyms for.
    You can create synonyms for objects referenced across DBLinks.
    You cannot create synonyms for DBLinks.
    Hemant K Chitale

  • What is the easiest way to export all tables data from Oracle to MS SQL Server?

    Hello MS,
    I would like to export all tables from Oracle 11.2 to MS SQL Server 2012 R1.
    Using the tool "Microsoft SQL Server Migration Assistant v6.0 for Oracle" did not work for me because there are too many warnings and errors regarding the schema creation (MS cannot know it because they are not the schema designer). My idea is
    to leave/skip the schema creation to the application designer/supplier and instead concentrate on the Oracle data export and MS SQL data import.
    What is the easiest way to export all tables data from Oracle to MS SQL Server quickly?
    Is it:
    - the „MS SQL Import and Export Data“ Tool
    - the “MS SQL Integration Services” Tool
    - not Oracle dump *.dmp format because it is a propritery binary format
    - flat file *.csv (delimited format)
    Thanks!

    Hi lingodingo,
    If you want to directly export all tables from Oracle database to SQL Server, I suggest you use SQL Server Import and Export Wizard. Because you just need to follow the wizard with GUI, this is the easiest way.
    If you want to make some modification for the tables‘ data before loading to SQL Server, I suggest you use SQL Server Integration Services package. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38b2bed2-9d4e-48d4-a33f-1d9eed1c062d/flat-file-to-sql-server?forum=sqldatamining
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Importing all my music to iTunes(Please help me out)

    Hello, I just purchased a 20gb ipod today and am havintg some trouble importing all of my music. I have complete music library's in "RealPlayer" "Winamp" and "Windows Media Player", it doesnt matter which one of these i import from(whatevers easier i

  • How to get recipient n# in pcsuite?

    how to get recipient n# in pcsuite? im doing a program that will recieve and send message using C# programming language and pcsuite with my n95, i want to get n# of the recipient so that if my system will recieve a message it will automatically reply

  • How do I do a search based on a range of dates in Address Book?

    In Palm Desktop, when I performed a search, a dialogue window would pop up that gave me a drop down list of every category in my database (ie. date modified, company, first name, last name, etc.).  I could choose to just search for entries that were

  • How to upgrade WCS Plus 500 to 700?

    To upgrade WCS Plus 500 lic to support 200 more APs, which one is the correct choice? 1. Add WCS Plus 100 lic x 2; or 2. Add WCS Enterprise 1000 lic Refer to ordering guide http://www.cisco.com/en/US/prod/collateral/wireless/ps5755/ps6301/ps6305/prod

  • BBP_INB_DELIVERY_CREATE issue

    Hi, I have to split an inbound delivery into several different inbound deliveries depending on the lines in table xlips. For this I'm using function module  BBP_INB_DELIVERY_CREATE. When using this function module I get an error: No item category exi