With the introduction and availability of Oracle’s latest database version, Oracle Database 23ai, in our Always Free tier, you can now migrate your Always Free 21c databases to 23ai and access its hundreds of new and great features.

I wanted to provide an easy way of moving your schemas from your Always Free 21c database to an Always Free 23ai database. Here are the steps to follow to do this migration.

  1. Log in to the OCI cloud console with the account that has your Always Free 21c database.
  2. If you have not already created a 23ai database, create one. The Always Free tier allows two free databases in your tenancy. We are temporarily allowing a third database for a short duration so that you can create a 23ai database to migrate to. You will be able to create this new database as long as you have at least one 21c database in your tenancy.
  3. Open Cloud Shell by clicking the Developer Tools icon on the cloud console.
    Cloud Shell screenshot
  4. Run this command in Cloud Shell to download the script that will export the schemas you want from your source 21c database and import them into your target 23ai database.
    wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/ZvnKn60Ok5vkeU8Lls5m6oSteu-6TXpX-KZsEnCyC8VVgJbXvb0C9zqHxZjV2PfF/n/adwc4pm/b/migrateto23ai/o/migrate23schema.sh
  5. Run the downloaded script in Cloud Shell by running this command.
    bash migrate23schema.sh

The script will ask for the names of the target and source databases, their admin passwords, and the list of the schemas you want to move to your 23ai database.

Note that it will enable an access control list of 0.0.0.0/0 and TLS connections in your source database. After the migration, you can restore these settings to their original state.

Here is a sample output of running the script in my tenancy.

Click to expand and see the sample script output.

 

Enter your target database name: 
freetarget

Detected database compartment ocid1.tenancy.oc1...
Detected database OCID ocid1.autonomousdatabase.oc1...
Downloading file  [####################################]  100%

Enter your target database's ADMIN password: 
***

Testing connectivity to the database...
Database connection successful.

Enter your source database name: 
freesource

Detected database compartment ocid1.tenancy.oc1...
Detected database OCID ocid1.autonomousdatabase.oc1...
Downloading file  [####################################]  100%

Enter your source database's ADMIN password: 
***

Testing connectivity to the database...
Database connection successful.

Enter the comma-delimited list of schemas you want to migrate: 
omluser,graphuser

Setting ACLs for 0.0.0.0/0 and enabling TLS in your source database.


SQLcl: Release 23.2 Production on Thu May 09 17:39:11 2024

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

Connected.

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production
Version 23.4.0.24.05
Archive:  target.zip
  inflating: ewallet.pem             
  inflating: README                  
  inflating: cwallet.sso             
  inflating: tnsnames.ora            
  inflating: truststore.jks          
  inflating: ojdbc.properties        
  inflating: sqlnet.ora              
  inflating: ewallet.p12             
  inflating: keystore.jks            

Import: Release 19.0.0.0.0 - Production on Thu May 9 17:39:18 2024
Version 19.10.0.0.0

Copyright (c) 1982, 2021, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production
Starting "ADMIN"."SYS_IMPORT_SCHEMA_01":  admin/********@freetarget_low schemas=omluser,graphuser parallel=4 network_link=MIGRATEDBLINK 
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PASSWORD_HISTORY
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA/LOGREP
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . imported "OMLUSER"."SALES"                           918843 rows
. . imported "OMLUSER"."DM$PCGLMR_57B273C445"              3655 rows
. . imported "OMLUSER"."DM$PFNN_E1AA9A75C8"                4361 rows
. . imported "GRAPHUSER"."BANK_TRANSFERS"                  5001 rows
. . imported "OMLUSER"."DM$P5NN_E1AA9A75C8"                  95 rows
. . imported "OMLUSER"."DM$P5GLMR_57B273C445"               105 rows
. . imported "GRAPHUSER"."BANK_ACCOUNTS"                   1000 rows
. . imported "OMLUSER"."DM$PBGLMR_57B273C445"                85 rows
. . imported "OMLUSER"."DM$PBGLM_F131EB5DEB"                 85 rows
. . imported "OMLUSER"."DM$PBMY_GLM_MODEL"                   85 rows
. . imported "OMLUSER"."DM$P5SVML_61DC2565C9"                95 rows
. . imported "OMLUSER"."DM$P5GLM_F131EB5DEB"                 91 rows
. . imported "OMLUSER"."DM$P5MY_GLM_MODEL"                   91 rows
. . imported "OMLUSER"."DM$PDGLMR_57B273C445"                84 rows
. . imported "OMLUSER"."DM$PDGLM_F131EB5DEB"                 84 rows
. . imported "OMLUSER"."DM$P5NB_51AFFFF6CF"                  32 rows
. . imported "OMLUSER"."DM$PDNN_E1AA9A75C8"                  88 rows
. . imported "OMLUSER"."DM$PDSVML_61DC2565C9"                88 rows
. . imported "OMLUSER"."DM$PNNB_51AFFFF6CF"                  94 rows
. . imported "OMLUSER"."DM$P0NB_51AFFFF6CF"                  48 rows
. . imported "OMLUSER"."PYQ$DATASTOREINVENTORY"               3 rows
. . imported "OMLUSER"."SALES_NEW"                           50 rows
. . imported "OMLUSER"."DM$PMNN_E1AA9A75C8"                  11 rows
. . imported "OMLUSER"."DM$PDMY_GLM_MODEL"                   84 rows
. . imported "OMLUSER"."DM$PMSVML_61DC2565C9"                11 rows
. . imported "OMLUSER"."DM$PZSVML_61DC2565C9"                 1 rows
. . imported "OMLUSER"."DM$PMGLMR_57B273C445"                 7 rows
. . imported "OMLUSER"."DM$PONB_51AFFFF6CF"                  25 rows
. . imported "OMLUSER"."DM$PMGLM_F131EB5DEB"                  7 rows
. . imported "OMLUSER"."DM$PMMY_GLM_MODEL"                    7 rows
. . imported "OMLUSER"."DM$PXSVML_61DC2565C9"                89 rows
. . imported "OMLUSER"."DM$PWNN_E1AA9A75C8"                  50 rows
. . imported "OMLUSER"."DM$PPMY_GLM_MODEL"                   23 rows
. . imported "OMLUSER"."DM$PPGLM_F131EB5DEB"                 23 rows
. . imported "OMLUSER"."DM$PPGLMR_57B273C445"                22 rows
. . imported "OMLUSER"."DM$PKGLMR_57B273C445"                 2 rows
. . imported "OMLUSER"."DM$PKGLM_F131EB5DEB"                  2 rows
. . imported "OMLUSER"."DM$PKMY_GLM_MODEL"                    2 rows
. . imported "OMLUSER"."DM$PKSVML_61DC2565C9"                 2 rows
. . imported "OMLUSER"."DM$PKNB_51AFFFF6CF"                   2 rows
. . imported "OMLUSER"."DM$PKNN_E1AA9A75C8"                   2 rows
. . imported "OMLUSER"."DM$PPNN_E1AA9A75C8"                   8 rows
. . imported "GRAPHUSER"."BANK_GRAPH_PROPERTY$"               5 rows
. . imported "OMLUSER"."DM$PPSVML_61DC2565C9"                 4 rows
. . imported "GRAPHUSER"."BANK_GRAPH_SRC_DST_KEY$"            2 rows
. . imported "OMLUSER"."DM$P1NB_51AFFFF6CF"                   2 rows
. . imported "OMLUSER"."DM$PPNB_51AFFFF6CF"                   1 rows
. . imported "GRAPHUSER"."BANK_GRAPH_ELEM_TABLE$"             2 rows
. . imported "OMLUSER"."DM$PFGLMR_57B273C445"                 7 rows
. . imported "GRAPHUSER"."BANK_GRAPH_KEY$"                    2 rows
. . imported "OMLUSER"."DM$PFGLM_F131EB5DEB"                  7 rows
. . imported "OMLUSER"."DM$PCGLM_F131EB5DEB"                  0 rows
. . imported "OMLUSER"."DM$PCMY_GLM_MODEL"                    0 rows
. . imported "OMLUSER"."DM$PEGLMR_57B273C445"                 0 rows
. . imported "OMLUSER"."DM$PFMY_GLM_MODEL"                    7 rows
. . imported "GRAPHUSER"."BANK_GRAPH_LABEL$"                  2 rows
. . imported "OMLUSER"."DM$PEMY_GLM_MODEL"                    0 rows
. . imported "OMLUSER"."DM$PEGLM_F131EB5DEB"                  0 rows
. . imported "OMLUSER"."DM$PSNN_E1AA9A75C8"                   1 rows
. . imported "OMLUSER"."DM$PENB_51AFFFF6CF"                   0 rows
. . imported "OMLUSER"."DM$PJGLMR_57B273C445"                 0 rows
. . imported "OMLUSER"."DM$PJGLM_F131EB5DEB"                  0 rows
. . imported "OMLUSER"."DM$PJMY_GLM_MODEL"                    0 rows
. . imported "OMLUSER"."DM$PJNB_51AFFFF6CF"                   0 rows
. . imported "OMLUSER"."DM$PJNN_E1AA9A75C8"                   0 rows
. . imported "OMLUSER"."DM$PJSVML_61DC2565C9"                 0 rows
. . imported "OMLUSER"."DM$PZGLMR_57B273C445"                 0 rows
. . imported "OMLUSER"."DM$PZGLM_F131EB5DEB"                  0 rows
. . imported "OMLUSER"."DM$PZMY_GLM_MODEL"                    0 rows
. . imported "OMLUSER"."OPE$1_236_00017T0"                    0 rows
. . imported "OMLUSER"."OPE$1_239_00017T1"                    0 rows
. . imported "OMLUSER"."OPE$1_250_00017T0"                    0 rows
. . imported "OMLUSER"."OPE$1_253_00017T1"                    0 rows
. . imported "OMLUSER"."OPE$1_264_00017T0"                    0 rows
. . imported "OMLUSER"."OPE$1_267_00017T1"                    0 rows
. . imported "OMLUSER"."OPE$1_278_00017T0"                    0 rows
. . imported "OMLUSER"."OPE$1_281_00017T1"                    0 rows
. . imported "OMLUSER"."OPE$1_311_00017T0"                    0 rows
. . imported "OMLUSER"."OPE$1_322_00017T1"                    0 rows
. . imported "OMLUSER"."OPE$1_338_00017"                      0 rows
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/POST_INSTANCE/PROCDEPOBJ/OAA
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA/LBAC_EXP
Job "ADMIN"."SYS_IMPORT_SCHEMA_01" successfully completed at Thu May 9 17:40:42 2024 elapsed 0 00:01:19

 

 

If you have used Graph Studio in your 21c database and you have Graph notebooks and templates, follow the documentation to export and import them from your 21c database to your 23ai database.