Upgrade Process

Learn about the sequence of tasks to upgrade an Oracle Database Classic Cloud Service (DBCS) Single Instance database on Oracle Cloud at Customer (OCC) 20.4 to Oracle Database 19c.

The following terms are used in the following tasks:
  • SOURCE DB: The single instance database that needs to be upgraded to Oracle Database 19c. Valid SOURCE DB versions are DBCS 11g, 12.1, 12.2, or 18c only.
  • TARGET DB: The upgraded single instance database.

Note:

If you encounter any issues while executing the below tasks, refer to the Problems with Single Instance Upgrades to Oracle Cloud Database 19c on OCC 20.4.

Task 1: Take Full Backup of SOURCE DB

Execute the following steps on SOURCE DB:

Note:

Execute these steps using db tooling on the VM only. Do not run this step via the PSM user interface.
  1. Update dbaastools rpm on the database instance to the dbaastools-1.0-1+19.1.1.1.0_210119.1615.x86_64 version, at a minimum. See Updating the Cloud Tooling by Using the dbaascli Utility for more details.
  2. Take a full backup of the database by executing the following command as a root user, and note down the UUID of the triggered backup.
    Command:
    /var/opt/oracle/bkup_api/bkup_api bkup_start --keep
    Sample Result:
    [root@sourcedbhost oracle]# /var/opt/oracle/bkup_api/bkup_api bkup_start --keep
    DBaaS Backup API V1.5 @2016 Multi-Oracle home
    DBaaS Backup API V1.5 @2015 Multi-Oracle home
    -> Action : bkup_start
    -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log
    UUID b71e3616373211ebb6efc6b0f3d419b2 for this backup
    ** process started with PID: 5575
    ** see log file for monitor progress
    -------------------------------------
    [root@sourcedbhost oracle]#
  3. Using the bkup_api, check the status of the full backup job triggered in the previous step, and note down the TAG of the triggered backup.
    Command:
    /var/opt/oracle/bkup_api/bkup_api --uuid <uuid_mentioned_when_backup_was_triggered>
    Sample Result:
    [root@sourcedbhost oracle]# /var/opt/oracle/bkup_api/bkup_api --uuid <uuid_mentioned_when_backup_was_triggered>
    DBaaS Backup API V1.5 @2016 Multi-Oracle home
    DBaaS Backup API V1.5 @2015 Multi-Oracle home
    @ STARTING CHECK STATUS b71e3616373211ebb6efc6b0f3d419b2
    [ REQUEST TICKET ]
    [UUID    ->  b71e3616373211ebb6efc6b0f3d419b2
    [DBNAME  ->  ORCL
    [STATE   ->  success
    [ACTION  ->  create-backup-keep-forever
    [STARTED ->  2020-12-05 19:47:54
    [ENDED   ->  2020-12-05 19:49:34.668479
    [PID     ->  5575
    [TAG     ->  JAAS20201205T194812
    [LOG     ->  API:: Wallet is in open state
    [LOG     ->  API:: Oracle database state is up and running
    [LOG     ->  API:: LONG TERM BACKUP RETENTION #####
    [LOG     ->  API:: STARTING LONG TERM BACKUP
    [LOG     ->  API:: RMAN STEPS FINISHED
    [LOG     ->  API:: VALIDATING DATABASE BACKUPS:
    [LOG     ->  API:: LOOKING FOR ISSUES:
    [LOG     ->  API:: EVERYTHING OK
    [ END TICKET ]
    [root@sourcedbhost oracle]#

Task 2: Provision SHELL DB Instance

Note:

  • You can not provision the shell database from the PSM user interface. You have to use the PSM REST API only.
  • The source database will be restored on this new database service. So, choose the shape and usable storage such that SOURCE DB can be fit in the shell database without any issues.
  1. Execute the following command using the PSM REST API to provision an OL7 based shell database of the same version as the SOURCE DB:
    curl -X POST \
    -H Content-Type:application/json \
    -H "X-ID-TENANT-NAME:<tenant_name>" \
    -u <username>:<password> \
    -d '{ "serviceName": "<service_name>","version": "<version_of_source_db>", "level": "PAAS", "edition": "<edition_of_source_db>", "subscriptionType": "<sub_type>", "trial": "false", "description": "<description>", "shape": "<shape_of_source_service>", "parameters": [ {"type":"db","usableStorage": "<usable_storage_of_source_service>", "adminPassword": "<admin_pwd_of_source_service>", "sid": "<sid_of_source_service>", "failoverDatabase": "no", "backupDestination": "<backup_dest_of_source_db>", "cloudStorageContainer":"<container_of_source_db>","cloudStorageUser": "<container_user_of_source_db>", "cloudStoragePwd":"<container_pwd_of_source_db>"} ], "vmPublicKeyText": "<public_key>", "additionalParams":{"dbUpgrade":"true"}}' https://<psm_host>/paas/service/dbcs/api/v1.1/instances/<identity_domain>
    The below code block shows a sample execution of the REST API to provision the shell DB instance.
    curl -v -X \
    POST -H Content-Type:application/json \
    -H "X-ID-TENANT-NAME:idcs-67260f80472b4fb48ec01630f420ec45" \
    -u testuser@oracle.com:password \
    -d '{ "serviceName": "new-service","version": "18.0.0.0", "level": "PAAS", "edition": "EE", "subscriptionType": "HOURLY", "trial": "false", "description": "Description For Test Service", "shape": "oc3",   "parameters": [ {"type":"db","usableStorage": "25", "adminPassword": "Welcome_1", "sid": "ORCL", "failoverDatabase": "no", "backupDestination": "BOTH", "createStorageContainerIfMissing":"true", "cloudStorageContainer":"https://example.com/v1/Storage-testaccount/dbcs-old-service","cloudStorageUser": "testuser@oracle.com", "cloudStoragePwd":"*****"}   ],  "vmPublicKeyText": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSUGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XAt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/EnmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbxNrRFi9wrf+M7Q== example", "additionalParams":{"dbUpgrade":"true"}}' https://example.com/paas/service/dbcs/api/v1.1/instances/idcs-67260f80472b4fb48ec01630f420ec45

Task 3: Get the spfile handle, controlfile handle, tde wallet that contains the autologin wallet, and the dbid from SOURCE DB VM

Execute the following steps on SOURCE DB:
  1. Get the spfile handle using the following commands.
    1. Change to super user and open RMAN.
      Commands:
      sudo su - oracle
      rman target=/
      Sample Result:
      [opc@sourcedbhost ~]$ sudo su - oracle
      Last login: Thu Dec 17 03:36:33 UTC 2020
      Last login: Thu Dec 17 03:57:02 UTC 2020 on pts/0
      [oracle@sourcedbhost ~]$ rman target=/
        
      Recovery Manager: Release 12.1.0.2.0 - Production on Thu Dec 17 03:57:08 2020
        
      Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
        
      connected to target database (not started)
    2. Execute the following command in RMAN:
      list backup of spfile tag=<backup_tag>;

      Tip:

      You can find the backup_tag from the Step 3 under Task 1.
      Sample Result:
      RMAN> list backup of spfile tag=<backup_tag>;
        
      using target database control file instead of recovery catalog
      List of Backup Sets
      ===================
        
      BS Key  Type LV Size       Device Type Elapsed Time Completion Time
      ------- ---- -- ---------- ----------- ------------ ---------------
      83      Full    256.00K    SBT_TAPE    00:00:00     05-DEC-20    
              BP Key: 85   Status: AVAILABLE  Compressed: NO  Tag: JAAS20201205T194812
              Handle: 31vhbb1b_1_1-ORCL---EE-12-1587550697-20201221   Media: example.com/v1/St
              Keep: BACKUP_LOGS        Until: 14-AUG-34    
        SPFILE Included: Modification time: 04-DEC-20
        SPFILE db_unique_name: ORCL
  2. Get the controlfile handle using the following command in RMAN:
    list backup of controlfile tag=<backup_tag>;

    Tip:

    You can find the backup_tag from the Step 3 under Task 1.
    Sample Result:
    RMAN> list backup of controlfile tag=<backup_tag>;
      
    List of Backup Sets
    ===================
      
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    ------- ---- -- ---------- ----------- ------------ ---------------
    84      Full    18.50M     SBT_TAPE    00:00:02     05-DEC-20    
            BP Key: 86   Status: AVAILABLE  Compressed: NO  Tag: JAAS20201205T194812
            Handle: 32vhbb1e_1_1-ORCL---EE-12-1587550697-20201221   Media: example.com/v1/St
            Keep: BACKUP_LOGS        Until: 14-AUG-34    
      Control File Included: Ckp SCN: 2864711      Ckp time: 05-DEC-20
  3. Copy the tde wallet from SOURCE DB to the new shell target database provisioned in Task 2 above.
    1. Find the location of the tde wallet.
      grep tde_wallet /var/opt/oracle/creg/ORCL.ini
      Sample Result:
      [oracle@sourcedbhost opc]$ grep tde_wallet /var/opt/oracle/creg/ORCL.ini
      tde_ks_loc=/u01/app/oracle/admin/ORCL/tde_wallet
    2. Navigate to the wallet folder.
      Example:
      [oracle@sourcedbhost opc]$ cd /u01/app/oracle/admin/ORCL/
    3. Zip the wallet.
      Example:
      zip -r <wallet_zip_name>.zip tde_wallet
    4. Copy the wallet to the SHELL database provisioned in Task 2 above.
      Example:
      scp -i <private_key> <wallet_zip_name>.zip oracle@<ip_address_of_target_db>:~/
      
  4. Get the db id of SOURCE DB by executing the following command from sqlplus.
    select dbid from v$database;
    Sample Result:
    [oracle@sourcedbhost opc]$ sqlplus / as sysdba
      
    SQL*Plus: Release 18.0.0.0.0 - Production on Wed Dec 9 00:40:53 2020
    Version 18.3.0.0.0
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 18c EE Extreme Perf Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
      
    SQL> select dbid from v$database;
          DBID
    ----------
    1586094212
      
    SQL>

Task 4: Get Oracle Application Express (APEX) images directory from SOURCE DB

For SOURCE DB versions 12.1, 12.2, or 18c

Execute the following steps for SOURCE DB versions 12.1, 12.2, or 18c.

  1. Identify the PDB that has Oracle APEX installed.
    Command:
    select name from V$PDBS p inner join CDB_REGISTRY c on p.con_id = c.con_id WHERE COMP_ID = 'APEX' ORDER BY c.CON_ID ASC;
    NAME
    Sample Result:
    SQL> select name from V$PDBS p inner join CDB_REGISTRY c on p.con_id = c.con_id WHERE COMP_ID = 'APEX' ORDER BY c.CON_ID ASC;
    NAME
    ------------------------------
    PDB1
  2. Change the session to the PDB where Oracle APEX is installed.
    Command:
    alter session set container=pdb1;
    Sample Result:
    SQL> alter session set container=pdb1;
    Session altered.

For SOURCE DB versions 11g, 12.1, 12.2, or 18c

Execute the following steps for all the SOURCE DB versions (11g, 12.1, 12.2, or 18c).

  1. Identify the version of Oracle APEX installed in SOURCE DB.
    Command:
    SELECT VERSION FROM DBA_REGISTRY WHERE COMP_ID = 'APEX';
    Sample Result:
    SQL> SELECT VERSION FROM DBA_REGISTRY WHERE COMP_ID = 'APEX';
    VERSION
    ------------------------------
    18.1.0.00.45
  2. Create a tarball of the Oracle APEX libraries.
    Command:
    tar -czvf apex.tar.gz <apex_version_seen_above>/
    Sample Result:
    
    cd /u01/app/oracle/product/apex/
      
    tar -czvf apex.tar.gz <apex_version_seen_above>/
    Eg: tar -czvf apex.tar.gz 18.1.0.00.45/
  3. Copy the Oracle APEX tarball to the SHELL DB provisioned in the Task 2 above.
    Command:
    scp -i <private_key> apex.tar.gz oracle@<ip_address_of_target_db>:~/

Task 5: Restore SOURCE DB backup and Oracle APEX images directory in TARGET DB

Perform the following steps in TARGET DB:
  1. Update dbaastools rpm on the TARGET DB instance to the dbaastools-1.0-1+19.1.1.1.0_210119.1615.x86_64 version, at a minimum. See Updating the Cloud Tooling by Using the dbaascli Utility for more details.
  2. Run IBackup restore to restore the backup of SOURCE DB taken in Task 1 above.
    1. Unzip and validate if the source tde wallet is accessible to the oracle user.
      Sample Result:
      [oracle@targetdbhost ~]$ unzip tde_wallet_1586094212.zip
      Archive:  tde_wallet_1586094212.zip
         creating: tde_wallet/
       extracting: tde_wallet/ewallet_2020120422401272.p12
       extracting: tde_wallet/ewallet.p12
         creating: tde_wallet/tde_seps/
       extracting: tde_wallet/cwallet.sso
        
         
      [oracle@targetdbhost ~]$ ls -ltr tde_wallet
      total 20
      drwxr-x---. 2 oracle oinstall    6 Dec  4 22:40 tde_seps
      -rw-------. 1 oracle oinstall 2555 Dec  4 22:40 ewallet_2020120422401272.p12
      -rw-------. 1 oracle oinstall 5467 Dec  4 22:40 ewallet.p12
      -rw-------. 1 oracle oinstall 5512 Dec  4 22:40 cwallet.sso
        
        
      [oracle@targetdbhost ~]$
    2. Untar and validate if the source APEX tarball is accessible to the oracle user.
      Sample Result:
      [oracle@targetdbhost ~]$ cp apex.tar.gz /u01/app/oracle/product/apex/
        
      [oracle@targetdbhost ~]$ cd /u01/app/oracle/product/apex/
        
      [oracle@targetdbhost apex]$ ls
      19.1.0.00.15  apex.tar.gz
      [oracle@targetdbhost apex]$ tar -xzvf apex.tar.gz
    3. Create a JSON configuration file named begin.json as the root user.
      Example begin.json File Contents:
      {
        "object": "db",
        "action": "begin",
        "operation": "ibkp",
        "params": {
          "dbname": "ORCL",
          "dbid": "1586094212",
          "oss_url": "https://example.com/v1/Storage-testaccount/dbcs-new-18c-2-clone-2",
          "oss_user": "testuser@oracle.com",
          "oss_passwd": "***",
          "decrypt_wallet": "/home/oracle/tde_wallet",
          "passwd": "Welcome_1",
          "rman_tag": "JAAS20201205T194812",
          "spfile_handle": "31vhbb1b_1_1-ORCL---EE-12-1587550697-20201221",
          "controlfile_handle": "32vhbb1e_1_1-ORCL---EE-12-1587550697-20201221"
        },
        "outputfile": "/home/oracle/ibkp/begin.out",
        "FLAGS": ""
      }
      Where:
      Parameter Description
      dbname Database name for the TARGET DB.
      dbid The dbidof SOURCE DB that you got from Step 4 of Task 2.
      oss_url The complete oss url of the cloud storage container being used. We specify it in Task 2 while provisioning the SHELL DB instance. This value must be same for the source and target.
      oss_user The cloud storage user specified in Task 2 while provisioning the SHELL DB instance.
      oss_passwd The cloud storage password specified in Task 2 while provisioning the SHELL DB instance.
      decrypt_wallet Complete path where you unzipped the tde_wallet in the target machine in Step 2-a above.
      passwd The admin password of TARGETDB specified in Task 2 while provisioning the SHELL DB instance.
      rman_tag The TAG value that you got from Step 3 of Task 1 while checking the status of SOURCE DB backup.
      spfile_handle The spfile handle obtained from Step 1-b of Task 3.
      controlfile_handle The controlfile handle obtained from Step 2 of Task 3.
      outputfile Fully qualified path where you want the output file to be created.
      FLAGS To be left empty.
    4. Start ibkp as a root user.
      Command:
      dbaasapi -i begin.json
    5. Create a file named status.json as shown in the example below.
      Example:
      [root@targetdbhost ibkp]# cat status.json
      {
        "object": "db",
        "action": "status",
        "operation": "ibkp",
        "id": "5",
        "params": {
          "dbname": "ORCL"
        },
        "outputfile": "/home/oracle/ibkp/status.out",
        "FLAGS": ""
      }
      [root@targetdbhost ibkp]#
    6. Check the ibackup status. The restore activity is complete when status shows Success or Failed. Proceed to the next step if status is Success. In case of a failure, contact the Oracle Support team at support.oracle.com.
      Commands:
      dbaasapi -i status.json
      cat <output_dbaasapi_status_output_json_file>
      Sample Result:
      [root@targetdbhost ibkp]# dbaasapi -i status.json
      [root@targetdbhost ibkp]# cat <output_dbaasapi_status_output_json_file>
      {
         "msg" : "WARN : Parameter real_application_testing is not a valid parameter. Please check the usage\\n\\nWARN : Parameter partitioning is not a valid parameter. Please check the usage\\n\\nWARN : Parameter oracle_label_security is not a valid parameter. Please check the usage\\n\\nWARN : Parameter data_vault is not a valid parameter. Please check the usage\\nRemoved all entries from cfg file : /var/opt/oracle/ocde/ocde.cfg matching passwd\\n\\n##Invoking assistant dbda\\nUsing cmd : /var/opt/oracle/ocde/assistants/dbda/dbda -out /var/opt/oracle/ocde/res/dbda.out -sid=\"ORCL\" -fra=\"ext4\" -bundle=\"basic\" -hostname=\"targetdbhost.compute-500128980.us18.internal\" -dbname=\"ORCL\" -sga_target=\"3800\" -psu=\"default\" -data_mnt=\"/u02\" -pga_target=\"2500\" -lsnr_port=\"1521\" -grid_sid=\"+ASM\" -redo_mnt=\"/u04\" -flashback_minutes=\"1440\" -pdb_name=\"PDB1\" -archlog=\"yes\" -charset=\"AL32UTF8\" -oracle_base=\"/u01/app/oracle\" -em=\"yes\" -cdb=\"yes\" -bp=\"default\" -oneoff_oss_store=\"none\" -flashback=\"no\" -automem=\"yes\" -nid=\"yes\" -em_port=\"5500\" -dbtype=\"sifs\" -grid_dbname=\"+ASM\" -edition=\"enterprise\" -flashback_days=\"1\" -ncharset=\"AL16UTF16\" -version=\"18000\" -build=\"no\" -asm=\"false\" -dbtemplate=\"multi\" -fra_mnt=\"/u03\" -grid_home=\"/u01/app/grid/product/12.1.0/grid\" -action=\"ibkp\" -redo_log_size=\"1024M\" -dbca_vars=\"-characterSet AL32UTF8 -initParams filesystemio_options=setall,db_files=500\" -action=ibkp \\n",
         "object" : "db",
         "status" : "InProgress",
         "errmsg" : "",
         "outputfile" : "/home/oracle/ibkp/begin.out",
         "pid" : "6638",
         "action" : "begin",
         "id" : "5",
         "operation" : "ibkp"
      }
      [root@targetdbhost ibkp]#
  3. Only for SOURCE DB versions 12.1, 12.2, or 18c, execute datapatch as the oracle user.

    WARNING:

    You must execute this step only:
    • For SOURCE DB versions 12.1, 12.2, or 18c.
    • In asynchronous mode.
    Commands:
    su oracle
    cd /home/oracle
    nohup $ORACLE_HOME/OPatch/datapatch > some_file 2>&1 &

    Note:

    For help with determining the success or failure of datapatch or to resolve any errors with datapatch, see the Problems with Single Instance Upgrades to Oracle Cloud Database 19c on OCC 20.4 in the Troubleshooting section.
    Sample Result:
    [root@targetdbhost ibkp]# su oracle
    [oracle@targetdbhost ibkp]$ cd /home/oracle
    [oracle@targetdbhost ~]$ nohup $ORACLE_HOME/OPatch/datapatch > some_file 2>&1 &
      
    [oracle@targetdbhost ~]$ cat some_file
    SQL Patching tool version 18.0.0.0.0 Production on Sat Dec  5 21:36:39 2020
    Copyright (c) 2012, 2020, Oracle.  All rights reserved.
    Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_17386_2020_12_05_21_36_39/sqlpatch_invocation.log
    Connecting to database...OK
    Gathering database info...done
    [...]
    Please refer to MOS Note 1609718.1 and/or the invocation log
    /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_17386_2020_12_05_21_36_39/sqlpatch_invocation.log
    for information on how to resolve the above errors.
      
    SQL Patching tool complete on Sat Dec  5 21:47:17 2020
      
      
    [oracle@targetdbhost ~]$
  4. Only for SOURCE DB version 11g, mark APS, XOQ, and AMD components as valid.

    WARNING:

    You must execute this step only if SOURCE DB version is 11g.
    Commands:
    exec dbms_registry.valid('APS');
    exec dbms_registry.valid('XOQ');
    exec dbms_registry.valid('AMD');
    Sample Result:
    SQL> select comp_name, comp_id from dba_registry where status ='INVALID';
    COMP_NAME
    --------------------------------------------------------------------------------
    COMP_ID
    ------------------------------
    OLAP Analytic Workspace
    APS
    Oracle OLAP API
    XOQ
    OLAP Catalog
    AMD
      
    SQL> exec dbms_registry.valid('APS');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_registry.valid('XOQ');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_registry.valid('AMD');
    PL/SQL procedure successfully completed.
      
    SQL> select comp_name, comp_id from dba_registry where status ='INVALID';
    no rows selected
    SQL> exit
  5. Create the 19c database home.
    Command:
    dbaascli dbhome create --version 19000 --noprompt yes
    Sample Result:
    [root@targetdbhost ibkp]# dbaascli dbhome create --version 19000 --noprompt yes
      
    DBAAS CLI version 19.1.1.1.0
    Executing command dbhome create --version 19000 --noprompt yesINFO: OSS details are not provided, Restoring from local acfs image
    INFO: Logfile for this activity => /var/opt/oracle/log/ohome_createlocal INFO : Creating Oracle Home from Local Image
    INFO: Restoring home from image /scratch/db/db19000_eebits.tar.gz for version 19000
        -------- Clone.pl completed -------
    dbopts relink_vsn suc : Success : relinking libvsn for bundle : extreme-perfINFO: create home is successful, new home => /u01/app/oracle/product/19.0.0.0/dbhome_1
    [root@targetdbhost ibkp]#
  6. Check the dbhome information to make sure Oracle Home is created successfully.
    Command:
    dbaascli dbhome info
    Sample Result:
    [root@targetdbhost ibkp]# dbaascli dbhome info
    DBAAS CLI version 19.1.1.1.0
    Executing command dbhome info
    Enter a homename or just press enter if you want details of all homes
      
    1.HOME_NAME=OraDB19Home1
      HOME_LOC=/u01/app/oracle/product/19.0.0/dbhome_1
      PATCH_LEVEL=19800_dbru200714
      DBs installed=
      OH Backup = NOT Configured
      
    2.HOME_NAME=OraDB18Home1
      HOME_LOC=/u01/app/oracle/product/18.0.0/dbhome_1
      PATCH_LEVEL=181100_dbru200714
      DBs installed= ORCL
      OH Backup = NOT Configured
      
    [root@targetdbhost ibkp]#
  7. Run the database upgrade script to upgrade the database to 19c.
    Command:
    nohup dbaascli database upgrade --dbname <dbname> --targetHome <19c_dbhome_path> > db_upgrade.out 2>&1 &
    Sample Result:
    [root@targetdbhost oracle]# nohup dbaascli database upgrade --dbname <dbname> --targetHome <19c_dbhome_path> > db_upgrade.out 2>&1 &
      
    [root@targetdbhost oracle]# cat db_upgrade.out
    DBAAS CLI version 19.1.1.1.0
    Executing command database upgrade --targetHome /u01/app/oracle/product/19.0.0.0/dbhome_1
    INFO : Review log file => /var/opt/oracle/log/ORCL/dbupgrade/dbupgrade_2020-12-05_22:27:18.78043919889.log
    INFO : Source ohome is /u01/app/oracle/product/18.0.0/dbhome_1
    INFO : Source version is 18.11.0.0.0
    INFO : Target version is 19.8.0.0.0
    INFO : Executing Pre-upgrade steps
    INFO : running pre-checks before upgrading source non-cdb
    INFO : Ensure all components are valid in the source database
    INFO : Pre-check for source components passed
    INFO : Ensure source metadata objects are valid
    INFO : Pre-check for source metadata object status passed
    INFO : Collecting pre-upgrade diagnostics
    INFO : Begin DB upgrade diagnostic capture
    INFO : End DB upgrade diagnostic capture
    INFO : Pre-upgrade diagnostics gathered
    INFO : Ensure there are no active DDL triggers
    INFO : Pre-check for DDL triggers passed
    INFO : Ensure the read write status of PDBs.
    INFO : PDB1 is in READ WRITE Mode.
    INFO : Ensure MV refreshes have completed
    INFO : Pre-check for MV refreshes passed
    INFO : Ensure no file need media recovery
    INFO : Pre-check for media recovery passed
    INFO : Ensure no files are in backup mode
    INFO : Pre-check for files backup mode passed
    INFO : Ensure no outstanding distributed transactions
    INFO : Pre-check for distributed transactions passed
    INFO : Ensure XDB ACLs have start_date and end_date ACE attributes
    INFO : Pre-check for XDB ACLs passed
    INFO : Precheck for TDE wallet. TDE wallet should be auto login.
    INFO : Pre-check for TDE wallet passed
    INFO : Precheck for temp tablespaces without a tempfile.
    INFO : Pre-check for temp_tablespaces_check  passed
    INFO : Ensure EM Database Control repository has been removed
    INFO : Pre-check for EM Database Control repository removal passed
    INFO : Verify hidden and deprecated parameters
    INFO : Pre-check for hidden and deprecated parameters passed
    INFO : Running Pre-Upgrade information script
     INFO : Pre-Upgrade information script executed
    INFO : Pre-upgrade steps executed
    INFO : Executing upgrade steps
    INFO : Ensure database recycle bin is empty
    INFO : Pre-check for recycle bin passed
    INFO : To decrease the amount of downtime, gather statistics.  Oracle recommends that
    INFO : Gather statistics completed
    INFO : Ensure that all batch and cron jobs are Disabled
    INFO : There are scheduled jobs that are still enabled.
    INFO : Press 'D' to Disable them or 'E' to Exit : INFO : Thank you for confirmation, disabling ...
    INFO : Pre-check for jobs status passed
    INFO : Ensure SYS and SYSTEM have SYSTEM as their default tablespace
    INFO : Pre-check for default tablespace passed
    INFO : Ensure source metadata objects are valid
    INFO : source metadata objects are valid.
    INFO : Guaranteed Restore Point created successfully, restore point name: BEFORE#UPGRADE#5418641687461321453#
    INFO : Backup of creg, env, spfile and pfile to /var/opt/oracle/log/ORCL/dbupgrade/upgrade_backup
    INFO : Shuting down all instances of source
    INFO : Stopping Source instance(s)
    INFO : All instances of database shutdown
    INFO : Starting source instance on current host
    INFO : Current instance started
    INFO : Dropping profile DBAASSECURE
    INFO : Profile dropped
    INFO : Disabling concurrent stats gathering
    INFO : stats param CONCURRENT set to OFF
    INFO : Concurrent stats gathering disabled
    INFO : Executing Oracle Label Security preprocess script
    INFO : Copying olspreupgrade.sql from Target to Source
    INFO : As Database Vault is installed. Grant DV_PATCH_ADMIN to SYS.
    INFO : Executing script olspreupgrade.sql at Source
    INFO : Script olspreupgrade.sql executed
    INFO : OLS preprocess script executed
    INFO : pfile /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initORCL.ora, creating one.
    INFO : Shutting down source instance
    INFO : Stopping Source instance(s)
    INFO : Shutdown completed
    INFO : Modifing source creg
    INFO : Adding original env values in Source creg
    INFO : Updating Source env values with values of Target
    INFO : Creg modified
    INFO : Copy tnsname.ora and sqlnet.ora from /u01/app/oracle/product/18.0.0/dbhome_1/network/admin to /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin
    INFO : Copied tnsname.ora and sqlnet.ora from /u01/app/oracle/product/18.0.0/dbhome_1 to /u01/app/oracle/product/19.0.0.0/dbhome_1
    INFO : Starting source instance in upgrade mode
    INFO : Source instance started
    INFO : Cleaning the previous upgrade logs
    INFO : Running upgrade
    INFO : Error is 0
    INFO : Upgrade completed
    INFO : Starting source instance in read write mode
    INFO : Source instance started
    INFO : Executing post-upgrade status script
    INFO : Executing script utlusts.sql
    INFO : Output shall be spooled to /u01/app/oracle/cfgtoollogs/ORCL/upgrade//utlu122s0.log
    INFO : All db components have been upgraded successfully
    INFO : Script executed
    INFO : Executing catuppst.sql
    INFO : Script executed
    INFO : Executing utlrp.sql script
    INFO : Executing script /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utlrp.sql
    INFO : Output shall be spooled to /u01/app/oracle/cfgtoollogs/ORCL/upgrade/
    INFO : Script executed
    INFO : Collecting post-upgrade diagnostics
    INFO : Begin DB upgrade diagnostic capture
    INFO : End DB upgrade diagnostic capture
    INFO : Post-upgrade diagnostics gathered
    INFO : Upgrade steps executed
    INFO : Executing post-upgrade steps
    INFO : Post upgrade precheck, verify DB and all pdbs upgraded to target version
    INFO : Post upgrade version check passed
    Running postupgrade_fixups
    INFO : Executing script /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utlrp.sql
    INFO : Output shall be spooled to /u01/app/oracle/cfgtoollogs/ORCL/upgrade/
    INFO : postupgrade.log review completed
    INFO : DST upgrade is running
    INFO : Review DST log files => /u01/app/oracle/cfgtoollogs/ORCL/dst_upgrade/2020-12-06002347/
    INFO : /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utltz_upg_check.sql is running for CDB$ROOT and pdb$seed
     INFO : /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utltz_upg_apply.sql is running for CDB$ROOT and pdb$seed
     INFO : upgradeTimezone completed for CDB$ROOT and pdb$seed
    INFO : /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utltz_upg_check.sql is running for all pdbs
    INFO : /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/admin/utltz_upg_apply.sql is running for all pdbs
    INFO : upgradeTimezone completed for PDBs
    INFO : Re-starting source instance
    INFO : Re-start completed
    INFO : Modifying oratab entry to all nodes
    INFO : Oratab entry modified
    INFO : Modifying oraenv entry to all nodes
    INFO : Oraenv entry modified
    INFO : Update creg file
    INFO : Updated creg file
    INFO : Sync tnsnames.ora
    INFO : Sync of tnsnames.ora file completed.
    INFO : Running bkup assistant for dbname: ORCL
    INFO : Bkup assistant completed for dbname: ORCL
    INFO : Post-upgrade steps executed
    INFO : Database upgrade end
      
      
    [root@targetdbhost oracle]#

Task 6: Update PSM Metadata

Execute the following PSM REST API to update the version:

Note:

The following commands are not available from the PSM UI. You must execute them using PSM REST API only.
  1. Create a JSON file called payload.json with the following content:
    Sample payload for SOURCE DB versions 12.1, 12.2, or 18c:
    {
      "action": "syncproperties",
      "DBVersion": "19.0.0.0.0"
    }
    Sample payload for SOURCE DB version 11g alone:
    {
      "action": "syncproperties",
      "DBVersion": "19.0.0.0.0",
      "PDBName": "<dbname_of_source_db>"
    }
  2. Execute the following curl command.
    curl Command:
    curl -i -X PUT \
    -u <username>:<password> \
    -H "X-ID-TENANT-NAME:<tenant_name>" \
    -H Content-Type:application/json \
    -H Accept:application/json \
    -d @payload.json https://<psm_host>/paas/service/dbcs/api/v1.1/instances/<identity_domain>/<target_db_service_name_in_psm>/synch
    Sample Result:
    curl -i -X PUT \
    -u testuser@oracle.com:password \
    -H "X-ID-TENANT-NAME:idcs-67260f80472b4fb48ec01630f420ec45" \
    -H Content-Type:application/json \
    -H Accept:application/json \
    -d @x https://example.com/paas/service/dbcs/api/v1.1/instances/idcs-67260f80472b4fb48ec01630f420ec45/new-service/synch