Monday, April 12, 2021

 



Recover or Plug a PDB in a New CDB without or lost XML Manifest file - STIMULATION:


In oracle 12c the ALTER PLUGGABLE DATABASE 'ORCLPDBPLUG' UNPLUG INTO 'ORCLPDBPLUG.XML' statement create the XML manifest. 


Is it possible to plug a PDB in a new CDB if it isn't correctly unplugged first and then source CDB isn't active or XML file missed or deleted after unplug?


Source VM:  srlabgg3

Source CDB: SRCDB

Source PDB: ORCLPDBPLUG


Target VM:  srlabgg2

Target CDB: SRLAB12C

Target PDB: ORCLPDBPLUG


Source CDB: SRCDB

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


SQL> select name from v$datafile;


SQL> alter pluggable database ORCLPDBPLUG close immediate;


SQL> alter pluggable database ORCLPDBPLUG unplug into '/u03/oradata/srcdb/orclpdbplug/ORCLPDBPLUG.xml';


SQL> drop pluggable database ORCLPDBPLUG keep datafiles;


Now unfortunately deleted or missed the 'ORCLPDBPLUG.xml' file. How to recover the PDB? How to plug the PDB source or target CDB?


Now you can recover the XML file of a not unplugged PDB.


Steps to be performed:

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


1. COPY the PDB folder into the CDB folder on the New VMs.


Target VM: srlabgg2

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


mkdir -p /u01/oradata/srlab12c/orclpdbplug


Source VM: srlabgg3

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


[oracle@srlabgg3 ~]$ cd /u03/oradata/srcdb/orclpdbplug

[oracle@srlabgg3 orclpdbplug]$ ls -lrt

total 884676

-rw-r-----. 1 oracle oinstall 135274496 Apr  4 15:57 temp01.dbf

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 13:48 users01.dbf

-rw-r-----. 1 oracle oinstall 398467072 Apr 11 14:54 sysaux01.dbf

-rw-r-----. 1 oracle oinstall 272637952 Apr 11 15:38 system01.dbf

-rw-r-----. 1 oracle oinstall 104865792 Apr 11 15:38 undotbs01.dbf


[oracle@srlabgg3 orclpdbplug]$ scp * oracle@192.168.58.202:/u01/oradata/srlab12c/orclpdbplug


2. Connect as SYSDBA to the new CDB on Target VM.

 

3. EXECUTE the package DBMS_PDB.RECOVER (it uses 3 parameters):


-> /u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml (/path/to/new/pdb.xml)


-> ORCLPDBPLUG (NAME_OF_PDB - you can use the same as OLD PDB or a NEW ONE)


-> /u01/oradata/srlab12c/orclpdbplug (/path/to/pdb/folder/)


Example:


BEGIN

  DBMS_PDB.RECOVER (

  pdb_descr_file => '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml',

  pdb_name => 'ORCLPDBPLUG',

  filenames => '/u01/oradata/srlab12c/orclpdbplug'

  );

END;

/


Check the PDB Plug Compatiblity:


set serveroutput on


DECLARE

compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml', pdb_name => 'ORCLPDBPLUG') WHEN TRUE THEN 'YES' ELSE 'NO'

END;

BEGIN

DBMS_OUTPUT.PUT_LINE('Is the future PDB compatible?  ==>  ' || compatible);

END;

/



THEN, you can plug the database using:


SQL> CREATE PLUGGABLE DATABASE ORCLPDBPLUG USING '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml' NOCOPY TEMPFILE REUSE;


SQL> alter session set container=ORCLPDBPLUG;


SQL> alter pluggable database rename global_name to ORCLPDBPLUG;


alter database tempfile '/u02/oradata/CDB2/pdb1/temp01.dbf' drop including datafiles;

alter tablespace TEMP add tempfile '/u02/oradata/CDB2/hugo/temp01.dbf' size 20M reuse;



THEN open the PDB:


SQL> ALTER PLUGGABLE DATABASE ORCLPDBPLUG OPEN FORCE;


If PDB opened with warnings, then check the pdb_violations


col name for a20

col message for a45

col cause for a30

select name,cause,message,status from PDB_PLUG_IN_VIOLATIONS;



======================================================================================================================================


If you want to keep the PDB in the source CDB, you do not need to unplug the PDB, you can just simply clone the PDB to another CDB:


Have a user in the source PDB or CDB with the CREATE PLUGGABLE DATABASE privilege


Open the source PDB in read-only mode


In the target CDB, create a database link to the source PDB with the above user


In the target CDB: CREATE PLUGGABLE DATABASE pdbclone FROM pdbsource@dblink;


SQL> exec dbms_pdb.describe('/home/oracle/pdb1.xml');


SQL> alter system checkpoint;


SQL> shutdown immediate


Validate pdb compatible:


=====================================================================================================================================



    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 ORCLPDBPLUG                    MOUNTED

SQL> alter pluggable database ORCLPDBPLUG open;


Pluggable database altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 ORCLPDBPLUG                    READ WRITE NO

SQL>

SQL>

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ ls -lrt

total 762984

-rw-r--r--. 1 oracle oinstall      7093 Apr 11 15:55 ORCLPDBPLUG.xml

-rw-r-----. 1 oracle oinstall 135274496 Apr 11 16:32 temp01.dbf

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 16:32 users01.dbf

-rw-r-----. 1 oracle oinstall 104865792 Apr 11 16:32 undotbs01.dbf

-rw-r-----. 1 oracle oinstall 272637952 Apr 11 16:32 system01.dbf

-rw-r-----. 1 oracle oinstall 398467072 Apr 11 16:33 sysaux01.dbf

[oracle@srlabgg3 orclpdbplug]$ rm ORCLPDBPLUG.xml

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ clear

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ ps -ef |grep pmon

oracle    5574     1  0 13:48 ?        00:00:01 ora_pmon_srcdb

oracle   10127  5483  0 16:33 pts/1    00:00:00 grep --color=auto pmon

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Sun Apr 11 16:42:38 2021


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL>

SQL> select * from global_name;


GLOBAL_NAME

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

SRCDB


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 ORCLPDBPLUG                    READ WRITE NO

SQL> select name from v$datafile;


NAME

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

/u03/oradata/srcdb/system01.dbf

/u03/oradata/srcdb/sysaux01.dbf

/u03/oradata/srcdb/undotbs01.dbf

/u03/oradata/srcdb/pdbseed/system01.dbf

/u03/oradata/srcdb/pdbseed/sysaux01.dbf

/u03/oradata/srcdb/users01.dbf

/u03/oradata/srcdb/pdbseed/undotbs01.dbf

/u03/oradata/srcdb/orclpdbplug/system01.dbf

/u03/oradata/srcdb/orclpdbplug/sysaux01.dbf

/u03/oradata/srcdb/orclpdbplug/undotbs01.dbf

/u03/oradata/srcdb/orclpdbplug/users01.dbf


11 rows selected.


SQL> alter pluggable database ORCLPDBPLUG close immediate;


Pluggable database altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 ORCLPDBPLUG                    MOUNTED

SQL> alter pluggable database ORCLPDBPLUG unplug into '/u03/oradata/srcdb/orclpdbplug/ORCLPDBPLUG.xml';


Pluggable database altered.


SQL> ! ls -lrt /u03/oradata/srcdb/orclpdbplug/ORCLPDBPLUG.xml

-rw-r--r--. 1 oracle oinstall 7094 Apr 11 16:44 /u03/oradata/srcdb/orclpdbplug/ORCLPDBPLUG.xml


SQL> drop pluggable database ORCLPDBPLUG keep datafiles;


Pluggable database dropped.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ pwd

/u03/oradata/srcdb/orclpdbplug

[oracle@srlabgg3 orclpdbplug]$ ls -lrt

total 762928

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 16:44 users01.dbf

-rw-r-----. 1 oracle oinstall 104865792 Apr 11 16:44 undotbs01.dbf

-rw-r-----. 1 oracle oinstall 398467072 Apr 11 16:44 sysaux01.dbf

-rw-r-----. 1 oracle oinstall 272637952 Apr 11 16:44 system01.dbf

-rw-r--r--. 1 oracle oinstall      7094 Apr 11 16:44 ORCLPDBPLUG.xml

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$ pwd

/u03/oradata/srcdb/orclpdbplug

[oracle@srlabgg3 orclpdbplug]$ scp * oracle@192.168.58.202:/u01/oradata/srlab12c/orclpdbplug

oracle@192.168.58.202's password:

ORCLPDBPLUG.xml                                                                         100% 7094     6.9KB/s   00:00

sysaux01.dbf                                                                            100%  380MB  14.1MB/s   00:27

system01.dbf                                                                            100%  260MB  16.3MB/s   00:16

undotbs01.dbf                                                                           100%  100MB  14.3MB/s   00:07

users01.dbf                                                                             100% 5128KB   5.0MB/s   00:00

[oracle@srlabgg3 orclpdbplug]$

[oracle@srlabgg3 orclpdbplug]$





drwxr-xr-x. 2 oracle oinstall 4096 Jan  4 07:54 srlabdb

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$ su -

Password:

Last login: Sat Mar 27 15:48:22 IST 2021 on :0

ABRT has detected 2 problem(s). For more info run: abrt-cli list --since 1616840330

[root@srlabgg2 ~]#

[root@srlabgg2 ~]#

[root@srlabgg2 ~]# pwd

/root

[root@srlabgg2 ~]# cd /u01/archive/

[root@srlabgg2 archive]# ls -lrt

total 8

drwxr-xr-x. 2 root   root     4096 Sep  9  2020 srlab12c

drwxr-xr-x. 2 oracle oinstall 4096 Jan  4 07:54 srlabdb

[root@srlabgg2 archive]# pwd

/u01/archive

[root@srlabgg2 archive]# chown -R oracle:oinstall /u01/archive

[root@srlabgg2 archive]# chown -R oracle:oinstall /u01/archive/srlab12c

[root@srlabgg2 archive]#

[root@srlabgg2 archive]# ls -lrt

total 8

drwxr-xr-x. 2 oracle oinstall 4096 Sep  9  2020 srlab12c

drwxr-xr-x. 2 oracle oinstall 4096 Jan  4 07:54 srlabdb

[root@srlabgg2 archive]#

[root@srlabgg2 archive]#

[root@srlabgg2 archive]# exit

logout

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$ clear

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$ ps -ef |grep pmon

oracle   16062     1  0 13:44 ?        00:00:01 ora_pmon_srlab12c

oracle   29252 15970  0 16:37 pts/1    00:00:00 grep --color=auto pmon

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Sun Apr 11 16:41:50 2021


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> select * from global_name;


GLOBAL_NAME

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

SRLAB12C


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

SQL> select name from v$datafile;


NAME

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

/u01/oradata/srlab12c/system01.dbf

/u01/oradata/srlab12c/sysaux01.dbf

/u01/oradata/srlab12c/undotbs01.dbf

/u01/oradata/srlab12c/pdbseed/system01.dbf

/u01/oradata/srlab12c/pdbseed/sysaux01.dbf

/u01/oradata/srlab12c/users01.dbf

/u01/oradata/srlab12c/pdbseed/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/system01.dbf

/u01/oradata/srlab12c/srlab12cpdb/sysaux01.dbf

/u01/oradata/srlab12c/srlab12cpdb/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/users01.dbf


11 rows selected.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@srlabgg2 archive]$ mkdir -p /u01/oradata/srlab12c/orclpdbplug

[oracle@srlabgg2 archive]$

[oracle@srlabgg2 archive]$ cd /u01/oradata/srlab12c

[oracle@srlabgg2 srlab12c]$ ls -lrt

total 2137636

drwxr-x---. 2 oracle oinstall      4096 Sep  9  2020 pdbseed

drwxr-x---. 2 oracle oinstall      4096 Sep  9  2020 srlab12cpdb

-rw-r-----. 1 oracle oinstall 137371648 Sep  9  2020 temp01.dbf

-rw-r-----. 1 oracle oinstall 209715712 Apr 11 13:44 redo01.log

-rw-r-----. 1 oracle oinstall 209715712 Apr 11 13:44 redo02.log

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 13:44 users01.dbf

-rw-r-----. 1 oracle oinstall 838868992 Apr 11 16:35 system01.dbf

-rw-r-----. 1 oracle oinstall 503324672 Apr 11 16:41 sysaux01.dbf

-rw-r-----. 1 oracle oinstall  68165632 Apr 11 16:46 undotbs01.dbf

-rw-r-----. 1 oracle oinstall 209715712 Apr 11 16:47 redo03.log

drwxr-xr-x. 2 oracle oinstall      4096 Apr 11 16:48 orclpdbplug

-rw-r-----. 1 oracle oinstall  18726912 Apr 11 16:48 control01.ctl

[oracle@srlabgg2 srlab12c]$ cd orclpdbplug

[oracle@srlabgg2 orclpdbplug]$ pwd

/u01/oradata/srlab12c/orclpdbplug

[oracle@srlabgg2 orclpdbplug]$ ls -lrt

total 0

[oracle@srlabgg2 orclpdbplug]$ ls -lrt

total 762920

-rw-r--r--. 1 oracle oinstall      7094 Apr 11 16:49 ORCLPDBPLUG.xml

-rw-r-----. 1 oracle oinstall 398467072 Apr 11 16:49 sysaux01.dbf

-rw-r-----. 1 oracle oinstall 272637952 Apr 11 16:49 system01.dbf

-rw-r-----. 1 oracle oinstall 104865792 Apr 11 16:49 undotbs01.dbf

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 16:49 users01.dbf

[oracle@srlabgg2 orclpdbplug]$

[oracle@srlabgg2 orclpdbplug]$ rm ORCLPDBPLUG.xml

[oracle@srlabgg2 orclpdbplug]$

[oracle@srlabgg2 orclpdbplug]$ ls -lrt

total 762912

-rw-r-----. 1 oracle oinstall 398467072 Apr 11 16:49 sysaux01.dbf

-rw-r-----. 1 oracle oinstall 272637952 Apr 11 16:49 system01.dbf

-rw-r-----. 1 oracle oinstall 104865792 Apr 11 16:49 undotbs01.dbf

-rw-r-----. 1 oracle oinstall   5251072 Apr 11 16:49 users01.dbf

[oracle@srlabgg2 orclpdbplug]$

[oracle@srlabgg2 orclpdbplug]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Sun Apr 11 16:50:38 2021


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> select * from global_name;


GLOBAL_NAME

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

SRLAB12C


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

SQL> select name from v$datafile;


NAME

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

/u01/oradata/srlab12c/system01.dbf

/u01/oradata/srlab12c/sysaux01.dbf

/u01/oradata/srlab12c/undotbs01.dbf

/u01/oradata/srlab12c/pdbseed/system01.dbf

/u01/oradata/srlab12c/pdbseed/sysaux01.dbf

/u01/oradata/srlab12c/users01.dbf

/u01/oradata/srlab12c/pdbseed/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/system01.dbf

/u01/oradata/srlab12c/srlab12cpdb/sysaux01.dbf

/u01/oradata/srlab12c/srlab12cpdb/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/users01.dbf


11 rows selected.


SQL>

SQL> [oracle@srlabgg2 orclpdbplug]$ ls -lrt

total 762912

SP2-0734: unknown command beginning "[oracle@sr..." - rest of line ignored.

SQL> SP2-0734: unknown command beginning "total 7629..." - rest of line ignored.

SQL>

SQL>

SQL> BEGIN

  DBMS_PDB.RECOVER (

  pdb_descr_file => '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml',

  pdb_name => 'ORCLPDBPLUG',

  filenames => '/u01/oradata/srlab12c/orclpdbplug'

  );

END;

/  2    3    4    5    6    7    8


PL/SQL procedure successfully completed.


SQL>

SQL> ! ls -lrt /u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml

-rw-r--r--. 1 oracle oinstall 4190 Apr 11 16:52 /u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml


SQL> DECLARE

compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml', pdb_name => 'ORCLPDBPLUG') WHEN TRUE THEN 'YES' ELSE 'NO'

END;

BEGIN

  2    3    4  DBMS_OUTPUT.PUT_LINE('Is the future PDB compatible?  ==>  ' || compatible);

END;

/  5    6    7


PL/SQL procedure successfully completed.


SQL>

SQL> CREATE PLUGGABLE DATABASE ORCLPDBPLUG USING '/u01/oradata/srlab12c/orclpdbplug/orclpdbplug.xml' NOCOPY TEMPFILE REUSE;


Pluggable database created.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

         4 ORCLPDBPLUG                    MOUNTED

SQL> ALTER PLUGGABLE DATABASE ORCLPDBPLUG OPEN FORCE;


Pluggable database altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

         4 ORCLPDBPLUG                    MIGRATE    YES

SQL> ALTER PLUGGABLE DATABASE ORCLPDBPLUG close immediate;


Pluggable database altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

         4 ORCLPDBPLUG                    MOUNTED

SQL> ALTER PLUGGABLE DATABASE ORCLPDBPLUG OPEN FORCE;


Pluggable database altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 SRLAB12CPDB                    READ WRITE NO

         4 ORCLPDBPLUG                    READ WRITE NO

SQL> select name from v$datafile;


NAME

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

/u01/oradata/srlab12c/system01.dbf

/u01/oradata/srlab12c/sysaux01.dbf

/u01/oradata/srlab12c/undotbs01.dbf

/u01/oradata/srlab12c/pdbseed/system01.dbf

/u01/oradata/srlab12c/pdbseed/sysaux01.dbf

/u01/oradata/srlab12c/users01.dbf

/u01/oradata/srlab12c/pdbseed/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/system01.dbf

/u01/oradata/srlab12c/srlab12cpdb/sysaux01.dbf

/u01/oradata/srlab12c/srlab12cpdb/undotbs01.dbf

/u01/oradata/srlab12c/srlab12cpdb/users01.dbf


NAME

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

/u01/oradata/srlab12c/orclpdbplug/sysaux01.dbf

/u01/oradata/srlab12c/orclpdbplug/system01.dbf

/u01/oradata/srlab12c/orclpdbplug/users01.dbf

/u01/oradata/srlab12c/orclpdbplug/undotbs01.dbf


15 rows selected.


SQL>

SQL>

SQL> alter session set container=ORCLPDBPLUG;


Session altered.


SQL>

SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         4 ORCLPDBPLUG                    READ WRITE NO

SQL>

SQL> col comp_name for a40

SQL>

SQL> set lines 300

SQL>

SQL> select comp_id,comp_name,version,status from dba_registry;


COMP_ID                        COMP_NAME                                VERSION                        STATUS

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

CATALOG                        Oracle Database Catalog Views            12.2.0.1.0                     VALID

CATPROC                        Oracle Database Packages and Types       12.2.0.1.0                     VALID

JAVAVM                         JServer JAVA Virtual Machine             12.2.0.1.0                     VALID

XML                            Oracle XDK                               12.2.0.1.0                     VALID

CATJAVA                        Oracle Database Java Packages            12.2.0.1.0                     VALID

RAC                            Oracle Real Application Clusters         12.2.0.1.0                     OPTION OFF

XDB                            Oracle XML Database                      12.2.0.1.0                     VALID

XOQ                            Oracle OLAP API                          12.2.0.1.0                     OPTION OFF

DV                             Oracle Database Vault                    12.2.0.1.0                     INVALID


9 rows selected.


SQL> select count(*) from dba_objects wHEere status='INVALID';

select count(*) from dba_objects wHEere status='INVALID'

                                        *

ERROR at line 1:

ORA-00933: SQL command not properly ended



SQL> select count(*) from dba_objects wHEre status='INVALID';


  COUNT(*)

----------

         0


SQL> col name for a20

col message for a45

col cause for a30

select name,cause,message,status from PDB_PLUG_IN_VIOLATIONS;

SQL> SQL> SQL>

NAME                 CAUSE                          MESSAGE                                       STATUS

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

ORCLPDBPLUG          OPTION                         Database option APS mismatch: PDB installed v PENDING

                                                    ersion NULL. CDB installed version 12.2.0.1.0

                                                    .


ORCLPDBPLUG          OPTION                         Database option CONTEXT mismatch: PDB install PENDING

                                                    ed version NULL. CDB installed version 12.2.0

                                                    .1.0.


ORCLPDBPLUG          OPTION                         Database option OLS mismatch: PDB installed v PENDING

                                                    ersion NULL. CDB installed version 12.2.0.1.0

                                                    .


NAME                 CAUSE                          MESSAGE                                       STATUS

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


ORCLPDBPLUG          OPTION                         Database option ORDIM mismatch: PDB installed PENDING

                                                     version NULL. CDB installed version 12.2.0.1

                                                    .0.


ORCLPDBPLUG          OPTION                         Database option OWM mismatch: PDB installed v PENDING

                                                    ersion NULL. CDB installed version 12.2.0.1.0

                                                    .


ORCLPDBPLUG          OPTION                         Database option SDO mismatch: PDB installed v PENDING

                                                    ersion NULL. CDB installed version 12.2.0.1.0


NAME                 CAUSE                          MESSAGE                                       STATUS

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

                                                    .


ORCLPDBPLUG          OPTION                         Database option XOQ mismatch: PDB installed v PENDING

                                                    ersion NULL. CDB installed version 12.2.0.1.0

                                                    .



7 rows selected.


SQL>









Post a Comment: