Upgrading Oracle Database XE to Oracle AI Database FREE
While there is no XE release in Oracle AI Database, you can upgrade Oracle Database XE to Oracle AI Database using an unplug-plug upgrade.
Oracle Database Express Edition (XE) has been replaced by Oracle AI Free. There is no direct upgrade option from Oracle Database XE to Oracle AI Database Standard Edition (SE) or Enterprise Edition (EE). You must use Oracle Data Pump to export data files to Oracle AI Database. For more details, refer to the installation guide for your platform.
You can perform an unplug-plug upgrade from Oracle Database XE to Oracle AI Database Free.
- Upgrading Oracle Database XE 21c PDB to Oracle AI Database Free 26ai
You use an unplug-plug upgrade to upgrade Oracle Database XE to Oracle AI Database Free. - Exporting and Importing Data between Different Versions of Oracle AI Database 26ai Free
Learn how to export and import data between different versions of Oracle AI Database 26ai Free.
Parent topic: Using Other Methods for Oracle Database Upgrades
Upgrading Oracle Database XE 21c PDB to Oracle AI Database Free 26ai
You use an unplug-plug upgrade to upgrade Oracle Database XE to Oracle AI Database Free.
Upgrades from Oracle Database XE to Oracle AI Database have the following restrictions:
- Database Upgrade Assistant (DBUA) cannot be used to perform the upgrade.
- Database Configuration Assistant (DBCA) cannot be used to perform a plug-in upgrade of Oracle Database XE to Oracle AI Database.
- Unplug/plug upgrades from Enterprise Edition or Standard Edition into Oracle AI Database 26ai Free is not supported.
- Unplug/plug upgrades from Oracle Database XE or Oracle AI Database Free into Oracle AI Database Enterprise Edition or Standard Edition is not supported.
The upgrade consists of the following high-level steps:
- Unplug the PDB from Oracle Database XE 21c.
- Install the latest release of Oracle AI Database 26ai, and plug in Oracle Database XE 21c PDB to the Oracle AI Database CDB.
- Confirm that there are no invalid objects remaining in the upgraded PDB.
Unplug the PDB from Oracle Database XE 21c
-
From Oracle Database XE 21c, connect to the container database as SYSDBA.
SQL> CONNECT / AS SYSDBA SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;
The session is altered.
-
Close the PDB that you want to upgrade.
For example, use the following command to close the PDB named
XEPDB1.SQL> ALTER PLUGGABLE DATABASE XEPDB1 CLOSE;
The pluggable database is closed.
-
Unplug the Oracle Database XE 21c PDB by running the following SQL command:
SQL> ALTER PLUGGABLE DATABASE XEPDB1 UNPLUG INTO '/home/oracle/XEPDB1.xml';
In this example, the PDB name is
XEPDB1, and the location of the PDB XML file is/home/oracle/XEPDB1.xml.The following response appears when the command is completed:
Pluggable database altered. -
Drop the closed PDB, and keep the data files.
SQL> DROP PLUGGABLE DATABASE XEPDB1 KEEP DATAFILES;
- Deinstall Oracle Database XE 21c by running the following command:
/etc/init.d/oracle-xe-21c delete.
Plugging in Oracle Database XE 21c PDB to Oracle AI Database 26ai CDB
-
Install the latest version of Oracle AI Database Free 26ai.
For more information, see:
-
Connect to the Oracle AI Database CDB as SYSDBA. Unplug the PDB from the XE 21c CDB, and then plug it into the Oracle AI Database CDB by running the following command, where
XEPDB2is the PDB that you are upgrading:SQL> CONNECT / AS SYSDBA SQL> CREATE PLUGGABLE DATABASE XEPDB2 USING '/home/oracle/XEPDB1.xml' NOCOPY TEMPFILE REUSE;
A new pluggable database,
XEPDB2is created. -
Open the PDB in
UPGRADEmode.SQL> ALTER PLUGGABLE DATABASE XEPDB2 OPEN UPGRADE;
-
Upgrade the PDB using the
Parallel Upgrade Utilitycommand.$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catctl.pl -u sys -d $ORACLE_HOME/rdbms/admin -c XEPDB2 -l $ORACLE_BASE -t catupgrd.sql
You can view the upgrade summary report at
/opt/oracle/upg_summary.log. The PDB is in theMOUNTEDstate after the upgrade. -
Open the PDB to run post-upgrade fixups.
SQL> ALTER PLUGGABLE DATABASE XEPDB2 OPEN;
-
Use the
catcon.plutility to runutlrp.sqlfrom the$ORACLE_HOME/rdbms/admindirectory.$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -d $ORACLE_HOME/rdbms/admin -n 1 -l /home/oracle/utlrp -e -b utlrp -c 'XEPDB2' utlrp.sql
The script recompiles
INVALIDobjects in the database.
Confirm that there are no invalid objects remaining in the upgraded PDB
Confirm that there are no invalid objects in the database. For example:
SQL> alter session set container=XEPDB2;
Session altered.
SQL> show con_name;
CON_NAME
------------------------------
XEPDB2
SQL> select count(*) , ' Invalid Objects' from all_objects where status = 'INVALID';
COUNT(*) 'INVALIDOBJECTS'
---------- ----------------
0 Invalid Objects
Note:
To upgrade APEX, you also have to complete an APEX installation, as described in Oracle APEX Installation Guide.Exporting and Importing Data between Different Versions of Oracle AI Database 26ai Free
Learn how to export and import data between different versions of Oracle AI Database 26ai Free.
Note:
Oracle Database 23.x Free can refer to 23.2 or later releases.Exporting Data
To export data from Oracle Database 23.x Free:
-
As the
rootuser, create a/opt/dumpdirectory on the local file system for theDUMP_DIRdirectory object.mkdir /opt/dump chown -R oracle:oinstall /opt/dump chmod -R 760 /opt/dump -
Perform the following steps for each pluggable database (PDB). The steps in this section are for the PDB
freepdb1.-
Set the ORACLE_HOME and ORACLE_SID environment variables.
export ORACLE_SID=FREE export ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree -
Connect to the 23.x Free database as user
SYSusing theSYSDBAprivilege as theoracleuser, and switch the container tofreepdb1. -
Create the directory object
DUMP_DIRand grantREADandWRITEprivileges on theDUMP_DIRdirectory to theSYSTEMuser./opt/oracle/product/23ai/dbhomeFree/bin/sqlplus / AS SYSDBA SQL> ALTER SESSION SET CONTAINER=freepdb1; SQL> CREATE DIRECTORY DUMP_DIR AS '/opt/dump'; SQL> GRANT READ, WRITE ON DIRECTORY DUMP_DIR TO SYSTEM; -
Export data from your 23.x Free PDB
freepdb1to the dump folder. For example:/opt/oracle/product/23ai/dbhomeFree/bin/expdp system/system_password@dbhost.example.com:1521/freepdb1 full=Y directory=DUMP_DIR dumpfile=expdb23ai_freepdb1.dmp logfile=expdb23ai_freepdb1.logNote:
- Replace
dbhost.example.comwith your database host name. If required, replace1521with the port number the listener listens on. - The default PDB name created is
freepdb1in 26ai.
- Replace
-
-
Deinstall Oracle Database 23.x Free if you plan to install 26ai Free on the same system.
-
Install Oracle AI Database 26ai Free.
Importing Data
To import data to your Oracle AI Database 26ai Free, perform the following steps for each PDB. The steps in this section are for importing data from 23.x Free PDB freepdb1 and overwriting to the same PDB freepdb1 in 26ai Free.
-
Set the ORACLE_HOME and ORACLE_SID environment variables.
export ORACLE_SID=FREE export ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree -
Connect to the 26ai Free database as user
SYSusing theSYSDBAprivilege as theoracleuser and switch the container tofreepdb1. -
Create the directory object
DUMP_DIRand grantREADandWRITEprivileges on theDUMP_DIRdirectory to theSYSTEMuser./opt/oracle/product/26ai/dbhomeFree/bin/sqlplus / AS SYSDBA SQL> ALTER SESSION SET CONTAINER=freepdb1; SQL> CREATE DIRECTORY DUMP_DIR AS '/opt/dump'; SQL> GRANT READ, WRITE ON DIRECTORY DUMP_DIR TO SYSTEM; -
Import data to the 26ai Free PDB
freepdb1from the dump folder created during the export operation. For example:/opt/oracle/product/26ai/dbhomeFree/bin/impdp system/system_password@dbhost.example.com:1521/freepdb1 full=Y directory=DUMP_DIR dumpfile=expdb23ai_freepdb1.dmp logfile=impdb26ai_freepdb1.logNote:
- Replace
dbhost.example.comwith your database host name. If required, replace1521with the port number the listener listens on. - The default PDB name created is
freepdb1in 26ai.
- Replace
Ignore the following errors:
- ORA-39342: Data Pump did not import dependent objects for NETWORK_ACL due to the previous error
- ORA-31684: Object type TABLESPACE:"UNDOTBS1" already exists
- ORA-31684: Object type TABLESPACE:"TEMP" already exists
- ORA-31684: Object type TABLESPACE:"USERS" already exists
- ORA-31684: Object type USER:"PDBADMIN" already exists
- ORA-31684: Object type DIRECTORY:"DUMP_DIR" already exists
Parent topic: Upgrading Oracle Database XE to Oracle AI Database FREE