2.Run preupgrade.jar
$OLD_ORACLE_HOME/jdk/bin/java -jar $NEW_ORACLE_HOME/rdbms/admin/preupgrade.jar -FILE DIR $OS_DIRECTORY
Install 19c Software
Run preupgrade.jar
Perform Pre-Upgrade Actions
Upgrade the Database
Perform Post-Upgrade Actions
Create New Container Database (CDB)
Convert Non-CDB to PDB
Final Steps
- Install Oracle 19c in the target server
- Apply latest patch (not covered in this article)
- Take RMAN and Export backup of 12c
- EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS; in 12c database
- PURGE DBA_RECYCLEBIN; in 12c database
- Run Pre upgrade.jar
- Wait until all materialized views have completed refreshing
- Create restore point for flashback incase upgrade fails
- Check Timezone version
- Take care of the Required and Recommended actions before upgrade
- Stop LISTENER in 12c
- Stop the 12c Database
- Copy listener, tnsnames and sqlnet.ora and password file to 19c network/admin
- Copy init file to 19c dbs location
- Start Listener in 19c location
- Start the 19c DB in upgrade mode
- Upgrade the Time Zone
- Gather dictionary statistics after the upgrade
- Execute the postupgrade fixups
- Drop restore point
Convert Oracle 19c Non-CDB
to PDB
Execute DBMS_PDB.DESCRIBE
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ sqlplus sys as sysdba
Connected to:
Oracle Database 19c Enterprise Edition
Release 19.0.0.0.0 - Production
Version 19.6.0.0.0
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2147478488
bytes
Fixed Size 8874968 bytes
Variable Size 1258291200 bytes
Database Buffers 872415232 bytes
Redo Buffers 7897088 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
SQL> exec DBMS_PDB.DESCRIBE ('/export/home/oracle/dgpdevl.xml');
PL/SQL procedure successfully completed.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Plug in the database to existing Oracle 19c CDB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
----------
------------------------------ ---------- ----------
2 PDB$SEED
READ ONLY NO
SQL> create pluggable database dgpdevl using '/export/home/oracle/dgpdevl.xml' nocopy tempfile reuse;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------
---------- ----------
2 PDB$SEED
READ ONLY NO
3 DGPDEVL
MOUNTED
SQL> alter pluggable database open;
Pluggable database altered.
Execute noncdb_to_pdb.sql script
SQL> alter session set container=DGPDEVL;
Session altered.
SQL> @?/rdbms/admin/noncdb_to_pdb.sql
….
….
13:47:57 SQL> set tab OFF
13:47:57 SQL> set termout ON
13:47:57 SQL> set time OFF
SQL> set timing OFF
SQL> set trimout ON
SQL> set trimspool ON
SQL> set underline "-"
SQL> set verify OFF
SQL> set wrap ON
SQL> set xmloptimizationcheck OFF
Verify PDB plug-in operation via PDB_PLUG_IN_VIOLATIONS
SQL> select con_id, type, message, status
from PDB_PLUG_IN_VIOLATIONS
where status <>'RESOLVED'
order by time;
CON_ID TYPE MESSAGE STATUS
---------- ---------
----------------------------------------------------------------------------------------------------
---------
4 WARNING Character set
mismatch: PDB character set US7ASCII. CDB character set AL32UTF8. PENDING
4 WARNING Database option APS
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option
CATJAVA mismatch: PDB installed version NULL. CDB installed version
19.0.0.0.0. PENDING
4 WARNING Database option CONTEXT
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option DV
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option JAVAVM
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option OLS
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option ORDIM
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option OWM
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option SDO
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option XML
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
4 WARNING Database option XOQ
mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING
Verify PDB is open in READ WRITE mode
SQL> conn / as sysdba
Connected.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
----------
------------------------------ ---------- ----------
2 PDB$SEED
READ ONLY NO
3DGPDEVL
READ WRITE NO
https://isqlplus.com/oracle/upgrade/upgrading-oracle-database-11g-to-oracle-database-19c-non-cdb-to-cdb/
https://mikedietrichde.com/2019/07/23/database-migration-from-non-cdb-to-pdb-upgrade-plug-in-convert/
https://oracle-base.com/articles/19c/upgrading-to-19c#create-new-cdb
No comments:
Post a Comment