8 Moving from Previous Versions of Oracle Database XE to Oracle AI Database Free
This section explains how to export data from Oracle Database Express Edition XE 21c and import to Oracle AI Database 26ai Free.
Note these points before you start the export and import process:
- You cannot use Oracle Database Upgrade Assistant (Oracle DBUA) to perform an upgrade.
- You cannot use Oracle Database Configuration Assistant (Oracle DBCA) to plug PDBs of previous versions to Oracle AI Database Free.
- Oracle Database 18c XE users must first move to 21c XE (See, Moving from Previous Versions of Oracle Database XE to XE 21c), and then export data from 21c XE to import them into Oracle AI Database 26ai Free.
Exporting and Importing Data between Oracle Database 21c XE and Oracle AI Database 26ai Free
Learn how to export and import data between Oracle Database 21c Express Edition (XE) and Oracle AI Database 26ai Free.
Exporting Data
To export data from your 21c XE database:
-
Create a
C:\Temp\dump1directory for theDUMP_DIRdirectory object.mkdir C:\Temp\dump1 -
Perform the following steps for each pluggable database (PDB). The steps in this section are for the PDB
xepdb1.-
Set the ORACLE_HOME and ORACLE_SID environment variables.
set ORACLE_SID=XE set ORACLE_HOME=C:\oldexpxe\dbhomeXE -
Connect to the 21c XE database as user
SYSusing theSYSDBAprivilege, and switch the container toxepdb1. -
Create the directory object
DUMP_DIRand grantREADandWRITEprivileges on theDUMP_DIRdirectory to theSYSTEMuser.SQL> ALTER SESSION SET CONTAINER=xepdb1; SQL> CREATE DIRECTORY DUMP_DIR6 AS 'C:\TEMP\dump1'; SQL> GRANT read, write ON DIRECTORY DUMP_DIR6 TO SYSTEM; -
Export data from your 21c XE PDB
xepdb1to the dump folder.%ORACLE_HOME%/bin/expdp system/system_password@dbhost.example.com:1521/xepdb1 full=Y directory=DUMP_DIR6 dumpfile=DB10G.dmp logfile=expdpDB10G.logOUTPUT:Master table "SYSTEM"."SYS_EXPORT_FULL_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_FULL_01 is: C:\TEMP\DUMP1\DB10G.DMP Job "SYSTEM"."SYS_EXPORT_FULL_01" successfully completed at .*Note:
- Replace
dbhost.example.comwith your database host name. If required, replace1521with the port number the listener listens on. - The default PDB name created is
xepdb1in 21c andfreepdb1in 26ai.
- Replace
-
-
Deinstall Oracle Database 21c XE if you plan to install 26ai Free on the same system. See, Deinstalling Oracle Database XE for more information.
-
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
PDB xepdb1 to freepdb1.
-
Set the ORACLE_HOME and ORACLE_SID environment variables.
set ORACLE_SID=FREE set ORACLE_HOME=C:\newimpfree\dbhomeFree -
Connect to the 26ai Free database as user
SYSusing theSYSDBAprivilege and switch the container tofreepdb1. -
Create the directory object
DUMP_DIRand grantREADandWRITEprivileges on theDUMP_DIRdirectory to theSYSTEMuser.SQL> ALTER SESSION SET CONTAINER=freepdb1; SQL> CREATE DIRECTORY DUMP_DIR6 AS 'C:\Temp\dump1'; SQL> GRANT read, write ON DIRECTORY DUMP_DIR6 TO SYSTEM; -
Import data to the 26ai Free PDB
freepdb1from the dump folder created during the export operation.%ORACLE_HOME%/bin/impdp system/system_password@dbhost.example.com:1521/freepdb1 full=Y directory=DUMP_DIR6 dumpfile=DB10G.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
xepdb1in 21c andfreepdb1in 26ai.
- Replace
Ignore the following errors:
- 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-39083: Object type PROC_SYSTEM_GRANT failed to create with error:
- ORA-29393: user EM_EXPRESS_ALL does not exist or is not logged on
Failing sql is:
BEGIN
dbms_resource_manager_privs.grant_system_privilege(grantee_name => '"EM_EXPRESS_ALL"', admin_option => TRUE);COMMIT; END;
ORA-31684: Object type DIRECTORY:"DUMP_DIR6" already exists