Forum Stats

  • 3,876,129 Users
  • 2,267,066 Discussions
  • 7,912,443 Comments

Discussions

non-cdb to cdb plugin issues

mlaz
mlaz Member Posts: 22
edited Jan 9, 2018 11:25AM in Multitenant

I am attempting to clear up issues found in:

SELECT * FROM PDB_PLUG_IN_VIOLATIONS WHERE Status = 'PENDING';

I have one row:

"Sync PDB failed with ORA-01981 while performing 'REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CONTAINER=ALL'"

If I attempt:

SQL> SELECT SYS_CONTEXT('USERENV','CON_NAME') FROM DUAL;

SYS_CONTEXT('USERENV','CON_NAME')

--------------------------------------------------------------------------------

CDB$ROOT

SQL> REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CONTAINER=ALL;

REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CONTAINER=ALL

*

ERROR at line 1:

ORA-01981: CASCADE CONSTRAINTS must be specified to perform this revoke

SQL> REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CASCADE CONSTRAINTS CONTAINER=ALL;

REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CASCADE CONSTRAINTS CONTAINER=ALL

*

ERROR at line 1:

ORA-65048: error encountered when processing the current DDL statement in

pluggable database TESTCPAT

ORA-65040: operation not allowed from within a pluggable database

So as you can see, this is not being performed from the new pdb moved here from a non-cdb database.

Any ideas? This is Oracle Enterprise 12.2.0.1

Answers

  • Unknown
    edited Jan 8, 2018 4:58PM
    ORA-65040: operation not allowed from within a pluggable databaseAny ideas? This is Oracle Enterprise 12.2.0.1

    The exception is telling you the problem.

    You can't do that 'from within a pluggable database'.

    You need to perform that operation while connected to the root/CDB container.

  • mlaz
    mlaz Member Posts: 22
    edited Jan 9, 2018 7:51AM

    ... and that is why I posted this. I am doing this from cdb$root, should have made that clear. I updated my original post.

  • Markus Flechtner
    Markus Flechtner Member Posts: 503 Bronze Trophy
    edited Jan 9, 2018 8:16AM

    Do you have APEX installed in CDB$ROOT?

    And is there APEX installed in the Non-CDB?

    If both answers are yes, there may be a conflict between both APEX users.

    I haven't tested such a configuration,  but I know it's recommended to remove APEX from CDB$ROOT (see https://mikedietrichde.com/2015/11/19/why-you-should-remove-apex-from-the-cdbroot/ for example)

    HTH

    Markus

  • mlaz
    mlaz Member Posts: 22
    edited Jan 9, 2018 9:21AM

    So during the move to this RAC container database from a non container RAC database that was the case as evident from this:

    SELECT Message, Status, Action FROM PDB_PLUG_IN_VIOLATIONS WHERE Message LIKE '%APEX%';

    MESSAGE                                                                                                                                        STATUS    ACTION             

    ---------------------------------------------------------------------------------------------------------------------------------------------- ---------- -----------------------

    APEX mismatch: the PDB has installed local APEX.                                                                                              RESOLVED  Run apex_to_common.sql.

    Sync PDB failed with ORA-01981 while performing 'REVOKE REFERENCES ON "FLOWS_FILES"."WWV_FLOW_FILE_OBJECTS$" FROM "APEX_050000" CONTAINER=ALL' PENDING

    So the first was resolved when noncdb_to_pdb.sql was run, evidently it executes apex_to_common.sql. But the second, still PENDING, has no action. So from above I attemted to execute the same command from the container root, which shows why I see ORA-01981 here. But new moved pdb will not come out of restricted mode:

    SQL> show pdbs;

        CON_ID CON_NAME   OPEN MODE  RESTRICTED

    ---------- ------------------------------ ---------- ----------

    2 PDB$SEED   READ ONLY  NO

    3 TESTCPAT   READ WRITE YES

    SQL> alter session set container=testcpat;

    Session altered.

    SQL> shutdown immediate;

    Pluggable Database closed.

    SQL> startup

    Warning: PDB altered with errors.

    Pluggable Database opened.

    At this point I have been trying to find resolution in support documents.

    After seeing this document: 2318035.1 and some other PENDING issues I am having, I believe I need to start all over.

    This time I will also use: document: 2288024.1 also as a guide and not just document 1576755.1,

    which is MISSING the check BEFORE the actual move takes place by running:

    "5) Connect to the target root CDB and check the compatibility of the 12c non-cdb database using "DBMS_PDB.CHECK_PLUG_COMPATIBILITY" package"

    this would have saved me issues and time here to get the non-cdb setup correctly before making the move.

    Thankfully this is a test environment to verify that it can be done without issue!

    I will update after this has been redone.

  • Unknown
    edited Jan 9, 2018 11:25AM

    That is why the most useful thing you can do when you post is SHOW US:

    1. WHAT you do

    2. HOW you do it

    3. WHAT results you get

    Post ALL of the info about:

    1. the Oracle doc you are using for reference - a link to it showing the steps you are following

    2. the non-cdb/pdb DB - version, how it was created, etc

    3. the cdb - version, how it was created, etc

    4. the plug-in operation

This discussion has been closed.