Public synonyms in a pluggable database deletion

I have a base Oracle container 12 c with pluggable databases in it.  In a pluggable data bases, I uninstalled OLAP by running the following scripts:

SQL > @%oracle_home%/olap/admin/catnoamd.sql

SQL > @ /olap/admin/olapidrp.plb% oracle_home %

SQL > @ /olap/admin/catnoxoq.sql% oracle_home %

SQL > @ /olap/admin/catnoaps.sql% oracle_home %

After you run the scripts, I then generated SQL statements to remove invalid OLAP synonyms, by executing the following:

Select ' drop public synonym ' | object_name | ';'

from dba_objects

where <>of status "VALID."

and owner = 'PUBLIC '.

and object_type = 'SYNONYM '.

and object_name like '% OLAP % ';

When I run the SQL statements resulting in the snap-in data base, I get the following error for each of them:

ERROR on line 1:

ORA-65040: operation not allowed a pluggable database

If I switch back to the ROOT of PEH container $ and executes the same statements, I get the following error:

ERROR on line 1:

ORA-01432: due public synonym being abandoned does not exist

How can I remove these invalid public synonyms for my snap-in database?

I think you're right. I re-read the note that I mentioned above. Even uninstalling an option is not supported for a CBD so far. Only option is to disable it. Second option is to create a non - CBD, uninstall option is not required and then plug it into a CBD.

Salman

----------

http://salmandba.blogspot.com

Tags: Database

Similar Questions

  • Synonym does public get used by the database engine in the schema of the owner?

    I have database public synonym 'P' and "S.P" table (in the "S" pattern).
    If my article references select array/object 'P' (without prefix-schema for the table), then there is no reference to the table ("S.P') or that it references a synonym ("P")?
    I understand that if my select query is executed in the session/connection made with schema/user "S", then the database engine does not at all synonymous, it will immediately table 'S.P. Is this right?
    Can you just confirm my understanding, maybe I'm wrong.

    (Oracle 10g, Windows OS)

    Fix. There is a certain order regarding name resolution.

    If I remember correctly then it searches first for the current schema objects (tables, views, procedures, etc.), then for private synonyms, then public synonyms.

    I get a bit more complex if you have a schema that is also the name of a package for example.

    For more information, see: http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general008.htm

    Published by: Sven w. December 1, 2010 11:09

  • Privileging the public synonym over schema object

    Hello

    I have a request.

    I logged in a scheme called "SCOTT."

    I have a table called 'EMP '.

    Now, I created a view called "EMP_D" with the addition of more of a few columns.

    Now I create a public synonym 'EMP' pointing to display "EMP_D".

    Now, I'm pulled the query in the schema "SCOTT."

    Select * from EMP

    I want that data to the EMP_D view.

    How to get there?

    Thanks in advance

    S. Jean-Charles

    user629814 wrote:

    My question is

    is it possible to prioritize the resulting public synonym of the same schema?

    Its only for a solution.

    This is called "name resolution" and is documented here: http://docs.oracle.com/cd/B28359_01/server.111/b28310/general008.htm#ADMIN11561

    1 oracle database attempts to qualify the first piece of the name referenced in the SQL statement. For example, in scott.emp , scott is the first piece. If there is only one piece, the piece is considered to be the first piece.

    1. In the current schema, the database looking for an object whose name matches the first part of the name of the object. If it does not find such an object, it continues with step b.
    2. The database looking for a public synonym that matches the first part of the name. If it does not find one, it continues with stepc.
    3. ...

    So if you have a schema object with the same name as a public synonym, oracle will always use first the schema object.

    Your only chance would be to rename the schema object or use another schema.

  • 2 various CARS: same Public Synonyms on the same 2 diagrams - any interaction?

    I'm having a senior moment.

    I have not worked with public synonyms that often, so I just want to make sure I got it right.

    If you have two instances: Instance1 and Instance2

    They both live on the same Oracle RAC cluster.

    Intance1 and Instance2 have a schema named FRED.  Both of them have a synonym Public THISTABLE for FRED. THISTABLE

    Now, I want to just make sure that the public synonyms do NOT connect between two different, although instances on the same RAC system, right?

    Someone on Instance2 inserting in fred.thistable is ONLY for this instance, instance1 do not affect all, correct?

    You would have to do something like this, essentially a database link between them and could have a public link THISTABLE on Instance2 pointing to FRED. THISTABLE on Instance1... but simply want to make sure that I understand that only a dblink between two patterns on the two bodies will... allow traffic/access between the two bodies and public synonyms on their own will not cross the instance gap, even with two instances on the same cluster.

    Once again, senior moment here and just want to make sure I have it directly.

    Thanks in advance,

    Cayenne

    This case I put in place the same pattern of FRED and the same FRED table name. TABLEAUCETTE on the database instance instsqa... There is no link between the two with this public synonym on instdev. The only way you could link the two instances and schemas for the table would be by a... correct database link?

    Yes. You got right.

    Take CARS out of it.  It's the same as if you had 2 databases one-off names instdev and instqa.

    Post edited by: Brian Bontrager

  • Public synonym in Expdp

    Oracle: 11.2.0

    OS: Windows

    Is it possible to export the public synonym with the help of the utility expdp?

    Otherwise, what is the reason behind this?

    Thank you

    AKPT

    Hello

    public synonyms can be extracted on their own by using:

    expdp / full = include = PUBLIC_SYNONYM/SYNONYM

    Full database export then by default includes

    Kind regards

    Harry

  • public synonyms

    Hello

    my database name is sch.in I have two patterns named ownr and database user.

    I've created tables, packages in ownr. I have to offer subsidies to these tables and packages to the schema of the user.

    If I create public synonyms for all tables and packages in the ownr schema are there the subsidies needed to access these objects from the user scehma?

    user10447332 wrote:
    Hello

    my database name is sch.in I have two patterns named ownr and database user.

    I've created tables, packages in ownr. I have to offer subsidies to these tables and packages to the schema of the user.

    If I create public synonyms for all tables and packages in the ownr schema are there the subsidies needed to access these objects from the user scehma?

    YES, in all THAT Oracle is FORBIDDEN; except as explicitly granted.

    SYNONYM is NOT a GRANT

    Handle: user10447332
    Status level: Beginner
    Join date: October 20, 2008
    Messages total: 322
    Total Questions: 215 (194 pending)

    Why so MANY unanswered questions?

  • How to check what are the objects using this public synonym?

    Hi Experts

    Currently, I have a public synonym, WORK that is created for WORK table in the schema of the BRAND: "synonym PUBLIC EMPLOYMENT BRAND. JOB. "
    SELECT THIS OPTION. WORK is granted to the TOM_UPDATE (a role): GRANT SELECT ON MARK. JOBS AT TOM_UPDATE;

    I am using TOAD 9.6.1.1 and I wanted to drop the public synonym but I am not able to see that another object in the database uses this public synonym, JOB.

    Help, please.

    moslee wrote:
    Hi Experts

    Currently, I have a public synonym, WORK that is created for WORK table in the schema of the BRAND: "synonym PUBLIC EMPLOYMENT BRAND. JOB. "
    SELECT THIS OPTION. WORK is granted to the TOM_UPDATE (a role): GRANT SELECT ON MARK. JOBS AT TOM_UPDATE;

    I am using TOAD 9.6.1.1 and I wanted to drop the public synonym but
    I am not able to see that another object in the database uses this public synonym, JOB.

    The objects are not "use the synonym".
    The code use synonym to access object.

    use grep allows you to browse the source code that resides in your repository

  • Which granted CREATE a PUBLIC SYNONYM for user SCOTT?

    version: 11.2.0.3
    Operating system: Solaris 10

    Auditing is enabled in our database.
    SQL> show parameter audit_trail
     
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    audit_trail                          string      DB
    Of DBA_SYS_PRIVS, we have confirmed that one of our DBA colleagues gave some risky privileges like CREATE PUBLIC SYNONYM, SELECT ANY TABLE... etc. to the user SCOTT.

    We would like to find out 2 things
    1. the SQL GRANT
    2. the date and time on which the statetement GRANT was pulled


    How can we find it?

    Y.Ramlet wrote:
    version: 11.2.0.3
    Operating system: Solaris 10

    Auditing is enabled in our database.

    SQL> show parameter audit_trail
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    audit_trail                          string      DB
    

    Of DBA_SYS_PRIVS, we have confirmed that one of our DBA colleagues gave some risky privileges like CREATE PUBLIC SYNONYM, SELECT ANY TABLE... etc. to the user SCOTT.

    We would like to find out 2 things
    1. the SQL GRANT

    You will have no SQL in the audit trail, because you have not configured the parameter correctly. You must audit_trail = db, extended to get the SQL code.

    2. the date and time on which the statetement GRANT was pulled

    You will have anything unless you have enabled auditing for the instruction given with
    Check create public synonym;

    How can we find it?

    You can't until you configure the audit in an appropriate manner.

  • Public synonym for DBA only?

    Is it true that only DBA can create public synonyms?
    Or is it better for a DBA to publish it rather than other users? Is it because it is the responsibility of the DBA or what? Thank you.

    Published by: 801264 on December 17, 2010 20:35

    Everyone can 'CREATE a PUBLIC SYNONYM':
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/statements_9013.htm#i2155015

    And it should be someone who knows what is happening in all of the database. Sometimes it's s/n, but above all, there is a technical project manager who knows the need for application much better.

  • PUBLIC SYNONYM - strange behavior

    I just organized a test on SQL queries for my students.

    It is based on four tables in a schema, and I created public synonyms for each table and read privilege to the PUBLIC, for example

    Staff CREATE a PUBLIC SYNONYM FOR testuser.staff
    GRANT SELECT ON testuser.staff to PUBLIC

    All the 150 + of my students have exactly the same roles and privileges, and yet two could not access the table of personnel without to refer to him as testuser.staff. They were able to access as provided for in the past.

    Has anyone encountered this before? I can't imagine that it's something to do with 60 students hit the synonym even at the same time, but I wonder.

    Brian

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    AMT for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    Hello

    Both users apparently have their own tables (views, synonyms, or other objects) called the STAFF.

    What kind of results do get when they use the unqualified name, like this

    SELECT  last_name
    FROM    staff;
    

    ? "If they get"ORA-00904"'Name': invalid identifier", it might be because their own staffing table is not a column named LAST_NAME.

    A name to your own schema takes precedence over a PUBLIC synonym. It makes sense: you don't want all your own queries on your own STAFFING table to stop just because someone used the same name for a public synonym.

  • What can I do for the creation of a public synonym view?

    Hi people,
    I create a public synonym of another object to users

    SQL > create public synonym PAPD for scott.dept;


    The synonym is created.

    so I tend to create a view of this public syn

    SQL > create view vpdep in select * from PAPD.
    Create view vpdep in select * from PAPD
    *
    ERROR on line 1:
    ORA-01031: insufficient privileges

    I have the privilege to create view.also, I can create views of a public synonym for my own ex objects.for,

    SQL > create public synonym cdep for dept.

    The synonym is created.

    SQL > create view vcdep in select * from cdep;

    Created view.

    What could be the reason behind this? is there any privilege required to me.pls suggest me.

    Concerning
    VIDS

    Hi vidusnat!

    It is onlinedocumentation to Oracle:
    >
    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 by a role:
    o CREATE The VIEW system privilege (to create views in your schema)
    o The CREATE ANY VIEW system privilege (to create a view of another user schema)
    You must explicitly obtained one of the following privileges:
    o the SELECT, INSERT, UPDATE, or DELETE object privileges on all objects in the view's underlying base
    o SELECT it ANY TABLE, INSERT a WHOLE TABLE, UPDATE ANY TABLE or DELETE ANY TABLE access privileges

    In addition, in order to grant access to your display of other users, you must have privileges to object to the base with the OPTION GIVING clause objects or system privileges with ADMIN OPTION clause. If you do not, users cannot access your view.
    >

    I hope that this will bring a little light in the darkness!

    Yours sincerely

    Florian W.

  • How Public synonym works.

    When a search is done in data in a table via a public synonym, not the associated table, the index is used or not. I think he did, but I want to be sure, can someone also confirms this.

    Thank you

    Hello

    Yes, of course public synonyms use underlying indices. Its very simple test.

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    
    SQL>
    SQL>
    SQL> create table t as select rownum x from dual connect by level <=10000;
    
    Table created.
    
    SQL> exec dbms_stats.gather_table_stats(user, 't');
    
    PL/SQL procedure successfully completed.
    
    SQL> create index t_idx on t(x);
    
    Index created.
    
    SQL> create public synonym pub_t for test.t;
    
    Synonym created.
    
    SQL> set autotrace traceonly exp
    SQL> select * from t where x = 5;
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2946670127
    
    --------------------------------------------------------------------------
    | Id  | Operation        | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |       |     1 |     3 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| T_IDX |     1 |     3 |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("X"=5)
    
    SQL> select * from pub_t where x = 5;
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2946670127
    
    --------------------------------------------------------------------------
    | Id  | Operation        | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |       |     1 |     3 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| T_IDX |     1 |     3 |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("X"=5)
    
    SQL> set autotrace off;
    SQL>
    
  • Unable to connect pluggable database

    Hello

    Version: 12.1.0.2, platform: AIX, CBD: B12C, PDB: MYPDB1

    I am trying to connect newly created connectable to database. But it is throwing an error is not available and when I check open_mode is read/write for mypdb1 the database.

    Can you please help me where I am wrong? I fight with it more than a week.

    listener.ora :
    LSNRB12C =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = adc40)(PORT = 1550))
        )
      )
    
    
    SID_LIST_LSNRB12C =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = B12C)
          (ORACLE_HOME = /oracle/AIX/12102_64)
          (SID_NAME = B12C)
        )
        (SID_DESC =
          (ORACLE_HOME = /oracle/AIX/12102_64)
          (SID_NAME =MYPDB1)
        )
      )
    
    
    tnsnames.ora for pluggable database:
    MYPDB1 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = adc40)(PORT = 1550))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = MYPDB1)
        )
      )
    
    
    adc40 {oracle}:>lsnrctl status LSNRB12C
    LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production on 09-SEP-2015 21:56:44
    Copyright (c) 1991, 2014, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=adc40)(PORT=1550)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LSNRB12C
    Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production
    Start Date                08-SEP-2015 23:21:16
    Uptime                    0 days 22 hr. 35 min. 28 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /oracle/AIX/12102_64/network/admin/listener.ora
    Listener Log File         /oracle/AIX/diag/tnslsnr/adc40/lsnrb12c/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=adc40)(PORT=1550)))
    Services Summary...
    Service "B12C" has 1 instance(s).
      Instance "B12C", status UNKNOWN, has 1 handler(s) for this service...
    Service "MYPDB1" has 1 instance(s).
      Instance "MYPDB1", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    
    
    adc40 {oracle}:>env |grep ORACLE
    ORACLE_BASE=/oracle/AIX
    ORACLE_SID=B12C
    ORACLE_HOME=/oracle/AIX/12102_64
    
    
    adc40 {oracle}:>sqlplus "/as sysdba"
    SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 22:01:50 2015
    Copyright (c) 1982, 2014, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    
    
    SQL> select NAME,OPEN_MODE,RESTRICTED from v$pdbs;
    
    
    NAME                           OPEN_MODE  RES
    ------------------------------ ---------- ---
    PDB$SEED                       READ ONLY  NO
    MYPDB1                         READ WRITE NO
    MYPDB2                         READ WRITE NO
    MYPDB3                         READ WRITE NO
    
    
    SQL> create user c##1 identified by oracle container=all;
    User created.
    SQL> grant create session to C##1 container=all;
    Grant succeeded.
    SQL> sho con_name
    CON_NAME
    ------------------------------
    CDB$ROOT
    SQL>  alter session set container=mypdb1;
    Session altered.
    SQL> sho con_name
    CON_NAME
    ------------------------------
    MYPDB1
    
    
    SQL> connect c##1/oracle@adc40:1550/b12c
    Connected.
    SQL> connect c##1/oracle@adc40:1550/mypdb1
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    IBM AIX RISC System/6000 Error: 2: No such file or directory
    Additional information: 2311
    Additional information: 186818867
    Process ID: 0
    Session ID: 0 Serial number: 0
    
    
    Warning: You are no longer connected to ORACLE.
    
    
    
    

    Can you please tell me why it shows database is unavailable, even if mypdb is open?

    Thank you

    Arul

    You cannot connect to a PDB file through a registration of the listener static like this, because there is just no SID not named MYPDB1. You must register the services dynamically. In the root.

    ALTER system set local_listener = "adc40:1550";

    editing the system registry;

    --

    John Watson

    Oracle Certified Master s/n

  • 4.1EA2 - overview of Code does not take into account public synonyms

    Hello there,

    I think that the completion of the tablenames in the modified spreadsheet of sort it ignores now public synonyms.

    When I type

    Select * from user_

    and press CTRL-space I get SYS.user_tables SYS.user_tab_columns etc. It's a little embarrassing.

    Now the question is, can I code insight also offer public synonyms? And if not can I at least get the usernames lowercase?

    Kind regards

    dhalek

    Run

    the hidden value of param querySynonyms = true

    command to activate the thesaurus in code insight. This has changed due to the execution of view poor synonyms dictionary in 12 c with insight omitting guest more important objects tables, views and pl/sql modules.

    Also, make sure that

    Preferences-> completion Insight-> change case as long as you type = None

    then the object names would be in the same case that they extracted from the dictionary (upper case).

  • Reached the maximum number of pluggable databases

    Hello

    I seem to have a problem creating a pluggable database.  I'm getting ORA-65010: maximum number of pluggable databases created.  What seems strange to me, is that I have only a plug-in database in the container.  This doesn't seem to be a common theoretical problem? maximum number is 252.? I've seen a few different numbers while rummaging through the internet.  I can't seem to find documentation about this limit or why that would trigger my max at 1.  I wonder if this can a hardware limitation, but after going through the error logs and love it, I can't find any problems with the initial installation.

    A little info, installation was complete installation + CBD + PDB.  Class Server, standard installation and I can connect both the container and the snap-in internal database and connection to the outside.  Most of the time I think its configured correctly.  I have a feeling that I missed something along the way, but I'm struggling to find an explanation for this.  The documentation is fine as a response, just needing a point in the right direction.

    Thank you.

    Hello

    For Enterprise edition of Oracle database, the limit is 252 connectable to databases. If you are using an Oracle database Standard edition, you can create a single snap-in database.

    Thank you

    Sanket

Maybe you are looking for