Upgrade the Non-CDB to PDB in a CDB Environment Oracle 12c
We are going to upgrade the 220.127.116.11 Non-cdb database as a PDB in 18.104.22.168 Container Database.
1. Database Non-CDB 22.214.171.124 (or lower version) version first upgrade to the 126.96.36.199 version NON-CDB database. Then it converted to PDB.
Follow link for upgrade the lower version of Non cdb to upper version on Non CDB
2. After upgrade Patches set must be same for both 12.2 version before start upgrade check the patch applied.
3. Apex configuration must be checked before otherwise it will give error.
Following are the Steps of converting NON-CDB Same version database to PDB
1. Install the new version 188.8.131.52 database as CDB.
2. Set the compatibility of CDB database as 12.0.0
3. Open the database in read only mode of 12.1 version which going to upgrade as pdb
alter database open read only;
4. Create XML file for database, file XML name must be the name of PDB.
5. Shutdown the soruce database
6. Set the New oracle home of 12.2 version.
7. Run the DBMS_PDB.CHECK_PLUG_COMPATIBILITY test.
set serveroutput on
compatible CONSTANT VARCHAR2(3) :=
pdb_descr_file => '/home/oracle/PDB2.xml',
pdb_name => 'PDB2')
WHEN TRUE THEN 'YES'
If output is YES, then the PDB is compatible.
If output is NO, then PDB_PLUG_IN_VIOLATIONS view to see why it is not compatible.
8. Create the database as pluggable in container database of 12.2 version.
CREATE PLUGGABLE DATABASE pdb2 USING '/home/oracle/pdb2.xml' NOCOPY TEMPFILE REUSE;
NOCOPY means location of files is same as old.
TEMPFILE REUSE means temp file old is used again.
9. Connect to the PDB database.
ALTER SESSION set container=pdb2;
10. Must run the script before open the pdb2 database for convert noncdb to pdb dictionary
11. Startup the PDB database in read write mode.
alter pluggable database pdb2 close;
alter pluggable database pdb2 open;
alter pluggable database pdb2 save state;
12. Backup the PDB2 database with RMAN.