{"id":39954,"date":"2025-08-05T14:05:06","date_gmt":"2025-08-05T12:05:06","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=39954"},"modified":"2025-08-05T14:05:08","modified_gmt":"2025-08-05T12:05:08","slug":"zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/","title":{"rendered":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption"},"content":{"rendered":"\n<p>The ZDM 21.5 version brings some new functions like encrypting automatically now the TEMP, SYSTEM, SYSAUX and UNDO tablespaces. There is no need to do it manually any more after the ZDM migration, ZDM will take care of it on its own. Little problem, this is adding a new bug because the temporary database needs to be restarted to drop the previous TEMP tablespace. Let&#8217;s see how to resolve the problem and move forward with the ZDM migration.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3>Problem description<\/h3>\n\n\n\n<p>After switchover is run by ZDM, the TEMP, SYSTEM, SYSAUX and UNDO tablespaces are now encrypted by ZDM during the ZDM_POST_DATABASE_OPEN_TGT step. In my case described here, I was doing a dry run, so I manually ran a failover to the target environment to avoid any impact and downtime to the source database. It was currently a dry run and not the final migration.  Thus, after having paused the ZDM migration once the Data Guard configuration was setup (ZDM_CONFIGURE_DG_SRC step), I manually ran the failover and then moved forward with the ZDM Migration using the <code>-skip SWITCHOVER<\/code> option. I have explained this in one of my previous ZDM blog if you want more details.<\/p>\n\n\n\n<p>I&#8217;m running same kind of migration I was doing with 21.4 version, non-cdb as source and including conversion to pdb during ZDM migration.<\/p>\n\n\n\n<p>So, after failover has been run manually, I resumed the ZDM migration till the end.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\n[exauser@zdm-host ~]$ zdmcli resume job -jobid 580 -skip SWITCHOVER\nzdm-host.domain.com: Audit ID: 6963\n<\/pre>\n<\/br>\n\n\n\n<p>As we can see, the ZDM job failed on the ZDM_POST_DATABASE_OPEN_TGT step.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,9,35]\">\n[exauser@zdm-host ~]$ zdmcli query job -jobid 580\nzdm-host.domain.com: Audit ID: 6966\nJob ID: 580\nUser: exauser\nClient: zdm-host\nJob Type: \"MIGRATE\"\nScheduled job command: \"zdmcli migrate database -sourcesid SRCSID -rsp \/home\/exauser\/migration\/zdm_SRCSID_physical_online.rsp -sourcenode dbsource-host -srcauth dbuser -srcarg1 user:oracle -srcarg2 identity_file:\/home\/exauser\/.ssh\/id_rsa -targetnode exacc-cl01n1 -tgtauth zdmauth -tgtarg1 user:opc -tgtarg2 identity_file:\/home\/exauser\/.ssh\/id_rsa -tgtarg3 sudo_location:\/usr\/bin\/sudo -tdekeystorepasswd -tgttdekeystorepasswd -pauseafter ZDM_COPYFILES\"\nScheduled job execution start time: 2025-06-11T17:09:40+02. Equivalent local time: 2025-06-11 17:09:40\nCurrent status: FAILED\nResult file path: \"\/u01\/app\/oracle\/chkbase\/scheduled\/job-580-2025-06-11-17:10:06.log\"\nMetrics file path: \"\/u01\/app\/oracle\/chkbase\/scheduled\/job-580-2025-06-11-17:10:06.json\"\nJob execution start time: 2025-06-11 17:10:07\nJob execution end time: 2025-06-12 10:04:40\nJob execution elapsed time: 2 hours 52 minutes 48 seconds\nZDM_GET_SRC_INFO .............. COMPLETED\nZDM_GET_TGT_INFO .............. COMPLETED\nZDM_PRECHECKS_SRC ............. COMPLETED\nZDM_PRECHECKS_TGT ............. COMPLETED\nZDM_SETUP_SRC ................. COMPLETED\nZDM_SETUP_TGT ................. COMPLETED\nZDM_PREUSERACTIONS ............ COMPLETED\nZDM_PREUSERACTIONS_TGT ........ COMPLETED\nZDM_VALIDATE_SRC .............. COMPLETED\nZDM_VALIDATE_TGT .............. COMPLETED\nZDM_DISCOVER_SRC .............. COMPLETED\nZDM_COPYFILES ................. COMPLETED\nZDM_PREPARE_TGT ............... COMPLETED\nZDM_SETUP_TDE_TGT ............. COMPLETED\nZDM_RESTORE_TGT ............... COMPLETED\nZDM_RECOVER_TGT ............... COMPLETED\nZDM_FINALIZE_TGT .............. COMPLETED\nZDM_CONFIGURE_DG_SRC .......... COMPLETED\nZDM_SWITCHOVER_SRC ............ COMPLETED\nZDM_SWITCHOVER_TGT ............ COMPLETED\nZDM_POST_DATABASE_OPEN_TGT .... FAILED\nZDM_DATAPATCH_TGT ............. PENDING\nZDM_NONCDBTOPDB_PRECHECK ...... PENDING\nZDM_NONCDBTOPDB_CONVERSION .... PENDING\nZDM_POST_MIGRATE_TGT .......... PENDING\nZDM_POSTUSERACTIONS ........... PENDING\nZDM_POSTUSERACTIONS_TGT ....... PENDING\nZDM_CLEANUP_SRC ............... PENDING\nZDM_CLEANUP_TGT ............... PENDING\n[exauser@zdm-host ~]$\n<\/pre>\n<\/br>\n\n\n\n<p>ZDM log file would show the problem coming from the TEMP tablespace encryption.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,46]\">\n[exauser@zdm-host ~]$ tail -f \/u01\/app\/oracle\/chkbase\/scheduled\/job-580-2025-06-11-17:10:06.log\n####################################################################\nzdm-host: 2025-06-12T08:01:48.268Z : Resuming zero downtime migrate operation ...\nzdm-host: 2025-06-12T08:01:52.847Z : Skipping phase ZDM_PRECHECKS_SRC on resume\nzdm-host: 2025-06-12T08:01:53.255Z : Skipping phase ZDM_PRECHECKS_TGT on resume\nzdm-host: 2025-06-12T08:01:53.273Z : Executing phase ZDM_SETUP_SRC\nzdm-host: 2025-06-12T08:01:53.274Z : Setting up ZDM on the source node dbsource-host ...\ndbsource-host: 2025-06-12T08:02:23.476Z : TNS aliases successfully setup on the source node source-hostname...\ndbsource-host: 2025-06-12T08:02:34.101Z : successfully registered ZDM with the database SRCSID\nzdm-host: 2025-06-12T08:02:34.106Z : Execution of phase ZDM_SETUP_SRC completed\nzdm-host: 2025-06-12T08:02:34.123Z : Executing phase ZDM_SETUP_TGT\nzdm-host: 2025-06-12T08:02:34.123Z : Setting up ZDM on the target node exacc-cl01n1 ...\nexacc-cl01n1: 2025-06-12T08:03:00.739Z : TNS aliases successfully setup on the target node exacc-cl01n1...\nzdm-host: 2025-06-12T08:03:00.742Z : Execution of phase ZDM_SETUP_TGT completed\nzdm-host: 2025-06-12T08:03:00.754Z : Skipping phase ZDM_VALIDATE_SRC on resume\nzdm-host: 2025-06-12T08:03:00.765Z : Skipping phase ZDM_VALIDATE_TGT on resume\nzdm-host: 2025-06-12T08:03:00.779Z : Skipping phase ZDM_DISCOVER_SRC on resume\nzdm-host: 2025-06-12T08:03:00.789Z : Skipping phase ZDM_COPYFILES on resume\nzdm-host: 2025-06-12T08:03:00.802Z : Skipping phase ZDM_PREPARE_TGT on resume\nzdm-host: 2025-06-12T08:03:00.813Z : Skipping phase ZDM_SETUP_TDE_TGT on resume\nzdm-host: 2025-06-12T08:03:00.823Z : Skipping phase ZDM_RESTORE_TGT on resume\nzdm-host: 2025-06-12T08:03:00.833Z : Skipping phase ZDM_RECOVER_TGT on resume\nzdm-host: 2025-06-12T08:03:00.843Z : Skipping phase ZDM_FINALIZE_TGT on resume\nzdm-host: 2025-06-12T08:03:00.844Z : resuming job execution from phase \"ZDM_CONFIGURE_DG_SRC\"\nzdm-host: 2025-06-12T08:03:00.859Z : Skipping phase ZDM_CONFIGURE_DG_SRC on resume\nzdm-host: 2025-06-12T08:03:00.880Z : Executing phase ZDM_SWITCHOVER_SRC\nzdm-host: 2025-06-12T08:03:00.881Z : Switching database null on the source node dbsource-host to standby role ...\ndbsource-host: 2025-06-12T08:03:11.403Z : Switchover actions in the source environment executed successfully\nzdm-host: 2025-06-12T08:03:11.407Z : Execution of phase ZDM_SWITCHOVER_SRC completed\n####################################################################\nzdm-host: 2025-06-12T08:03:11.445Z : Executing phase ZDM_SWITCHOVER_TGT\nzdm-host: 2025-06-12T08:03:11.445Z : Switching database SRCSID_CHZ1 on the target node exacc-cl01n1 to primary role ...\nexacc-cl01n1: 2025-06-12T08:03:23.137Z : Switchover actions in the target environment executed successfully\nzdm-host: 2025-06-12T08:03:23.241Z : Execution of phase ZDM_SWITCHOVER_TGT completed\n####################################################################\nzdm-host: 2025-06-12T08:03:23.279Z : Executing phase ZDM_POST_DATABASE_OPEN_TGT\nzdm-host: 2025-06-12T08:03:23.280Z : Executing post database open actions at the target ...\nexacc-cl01n1: 2025-06-12T08:03:34.667Z : Restoring pluggable database state ...\nexacc-cl01n1: 2025-06-12T08:03:35.368Z : Creating SSO for keystore location \/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/TDE\/tde\/ ...\nexacc-cl01n1: 2025-06-12T08:03:35.569Z : Restoring RMAN configuration ...\nexacc-cl01n1: 2025-06-12T08:03:40.374Z : Encrypting unencrypted temp tablespaces...\n####################################################################\nzdm-host: 2025-06-12T08:04:40.845Z : Oracle ZDM ONLINE PHYSICAL migration failed\nzdm-host: 2025-06-12T08:04:40.845Z : Failed at phase: ZDM_POST_DATABASE_OPEN_TGT\nzdm-host: 2025-06-12T08:04:40.846Z : Job duration: 2 minutes and 56 seconds\nPRGZ-3727 : Re-creation of temporary tablespace \"TEMP\" as encrypted for database \"PDB001P\" failed.\n<\/pre>\n<\/br>\n\n\n\n<h3>Troubleshooting<\/h3>\n\n\n\n<p>Let&#8217;s investigate the issue.<\/p>\n\n\n\n<p>The ZDM step log, named zdm_post_database_open_tgt, would show exactly the issue and the command that are expected to be run.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,12,13,14,15,32,35]\">\noracle@exacc-cl01n1:\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/ [PDB001P1 (CDB$ROOT)] view zdm_post_database_open_tgt_7924.log\n...\n...\n...\n[jobid-580][2025-06-12T08:03:41Z][mZDM_Queries.pm:655]:[DEBUG] Will be running following sql statements as user: oracle:\n\n        export ORACLE_HOME=\/u02\/app\/oracle\/product\/19.0.0.0\/dbhome_1,\n        export ORACLE_SID=PDB001P1,\n        \/u02\/app\/oracle\/product\/19.0.0.0\/dbhome_1\/bin\/sqlplus -L \/ as sys ******\n\n        set pagesize 0 feedback off verify off heading off echo off tab off linesize 32767 trimspool on trimout on wrap off\nCREATE BIGFILE TEMPORARY TABLESPACE TEMP_ENCRYPTED TEMPFILE ENCRYPTION ENCRYPT\nALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP_ENCRYPTED\nDROP TABLESPACE TEMP INCLUDING CONTENTS\nALTER TABLESPACE TEMP_ENCRYPTED RENAME TO TEMP\n\n[jobid-580][2025-06-12T08:03:41Z][mZDM_Utils.pm:3438]:[DEBUG] run_as_user2: Running \/*******@\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/out\/sql\/tmpsql_2025-06-12-08-03-41_7924.sql '\n[jobid-580][2025-06-12T08:04:41Z][mZDM_Utils.pm:3460]:[DEBUG] Remove \/tmp\/xE6e9fcUzC\n[jobid-580][2025-06-12T08:04:41Z][mZDM_Utils.pm:3468]:[DEBUG] \/bin\/su successfully executed\n\n[jobid-580][2025-06-12T08:04:41Z][mZDM_Queries.pm:678]:[DEBUG] Output is :\n SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 12 08:03:41 2025\n Version 19.26.0.0.0\n\n Copyright (c) 1982, 2024, Oracle.  All rights reserved.\n\n\n Connected to:\n Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production\n Version 19.26.0.0.0\n\n DROP TABLESPACE TEMP INCLUDING CONTENTS\n *\n ERROR at line 1:\n ORA-60100: dropping temporary tablespace with tablespace ID number (tsn) 3 is blocked due to sort segments\n\n\n ALTER TABLESPACE TEMP_ENCRYPTED RENAME TO TEMP\n *\n ERROR at line 1:\n ORA-02154: a tablespace with the name 'TEMP' is found\n\n\n Disconnected from Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production\n Version 19.26.0.0.0\n\n[jobid-580][2025-06-12T08:04:41Z][mZDM_Queries.pm:11791]:[ERROR] SQL Error recreating temp tablespace TEMP as encrypted for database 'PDB001P'\n[jobid-580][2025-06-12T08:04:41Z][mZDM_Utils.pm:4632]:[ERROR] Reporting  error :\n<\/pre>\n<\/br>\n\n\n\n<p>The TEMP tablespace can not be dropped, the database needs to be restarted.<\/p>\n\n\n\n<h3>Resolution<\/h3>\n\n\n\n<p>Let&#8217;s first create a pfile for the temporary non-CDB database ZDM created for the migration. Reminder, this temporary database will have as instance name and db_unique_name the name of the final PDB. And of course as DB_NAME the same than our source database, mandatory, when using HA primary and standby databases. I will create a pfile just in case&#8230;<\/p>\n\n\n\n<p>I created a pfile from memory:<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,13]\">\noracle@exacc-cl01n1:\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/ [PDB001P1 (CDB$ROOT)] sqh\n\nSQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 12 10:14:20 2025\nVersion 19.26.0.0.0\n\nCopyright (c) 1982, 2024, Oracle.  All rights reserved.\n\n\nConnected to:\nOracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production\nVersion 19.26.0.0.0\n\nSQL&gt; create pfile='\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/init_PDB001P1.ora.bck.before.restart' from memory;\n\nFile created.\n<\/pre>\n<\/br>\n\n\n\n<p>And a pfile from spfile:<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,9]\">\nSQL&gt; show parameter spfile\n\nNAME                                 TYPE                              VALUE\n------------------------------------ --------------------------------- ------------------------------\nspfile                               string                            \/u02\/app\/oracle\/product\/19.0.0\n                                                                       .0\/dbhome_1\/dbs\/spfileAVQPZ_AP\n                                                                       P_001P1.ora\n\nSQL&gt; create pfile='\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/init_PDB001P1.ora.bck.before.restart.from.spfile' from spfile='\/u02\/app\/oracle\/product\/19.0.0.0\/dbhome_1\/dbs\/spfilePDB001P1.ora';\n\nFile created.\n\nSQL&gt;\n<\/pre>\n<\/br>\n\n\n\n\n<p>I restarted the temporary non-CDB<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,6,15]\">\nSQL&gt; shutdown immediate\nDatabase closed.\nDatabase dismounted.\nORACLE instance shut down.\n\nSQL&gt; startup\nORACLE instance started.\n\nTotal System Global Area 8577884400 bytes\nFixed Size                 13693168 bytes\nVariable Size            3439329280 bytes\nDatabase Buffers         5100273664 bytes\nRedo Buffers               24588288 bytes\nDatabase mounted.\nORA-28374: typed master key not found in wallet\n<\/pre>\n<\/br>\n\n\n\n<p>ORA-28374 Failure. Would be the same if I start with the pfile, so there was some missing parameter into the spfile.<\/p>\n\n\n\n<p>Confirmed, there is no wallet_root instance parameter configured.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; show parameter wallet\n\nNAME                                 TYPE                              VALUE\n------------------------------------ --------------------------------- ------------------------------\nssl_wallet                           string\nwallet_root                          string\n<\/pre>\n<\/br>\n\n\n\n<p>And confirmed it was not in the pfile.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; !grep -i wallet \/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/init_PDB001P1.ora.bck.before.restart\n\nSQL&gt;\n<\/pre>\n<\/br>\n\n\n\n<p>We can easily find the directory where ZDM copied the wallet&#8230;<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\noracle@exacc-cl01n1:\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/ [PDB001P1 (CDB$ROOT)] ls -ltrh \/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/TDE\/tde\ntotal 92K\n-rw-r----- 1 oracle oinstall 2.5K Jun 27  2024 ewallet_2024062706422567.p12\n-rw-r----- 1 oracle oinstall    0 Jun 27  2024 ewallet.p12.lck\n-rw-r----- 1 oracle oinstall    0 Jun 27  2024 cwallet.sso.lck\n-rw-r----- 1 oracle oinstall 4.0K Sep 19  2024 ewallet_2024091909561990_pre-refresh-AVQZZ_APP_001T.p12\n-rw-r----- 1 oracle oinstall 5.2K Jan 16 10:54 ewallet_2025011609540081_pre-refresh-AVQZZ_APP_001T-20250116.p12\n-rw-r----- 1 oracle oinstall 6.4K Feb 27 09:28 ewallet_2025022708284959_pre-refresh-AVQZZ_APP_001T-20250227.p12\n-rw-r----- 1 oracle oinstall 7.7K Mar 31 14:10 ewallet_2025033112100549_pre-refresh-AVQZZ_APP_001T-20250331.p12\n-rw-r----- 1 oracle oinstall 8.9K Jun 11 13:58 ewallet_2025061111581822_chg_password_to_prod.p12\n-rw-r----- 1 oracle oinstall  11K Jun 11 14:00 ewallet.p12\n-rw-r----- 1 oracle oinstall 8.9K Jun 11 14:00 ewallet_2025061112003957_pre-dryrun-SRCSID-to-prodAVAPCl.p12\n-rw-r----- 1 oracle oinstall  11K Jun 11 14:00 cwallet.sso.back\n-rw------- 1 oracle asmdba    11K Jun 12 10:03 cwallet.sso\noracle@exacc-cl01n1:\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/ [PDB001P1 (CDB$ROOT)]\n<\/pre>\n<\/br>\n\n\n\n<p>Let&#8217;s configure it!<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,13]\">\noracle@exacc-cl01n1:\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/log\/ [PDB001P1 (CDB$ROOT)] sqh\n\nSQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 12 12:34:45 2025\nVersion 19.26.0.0.0\n\nCopyright (c) 1982, 2024, Oracle.  All rights reserved.\n\n\nConnected to:\nOracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production\nVersion 19.26.0.0.0\n\nSQL&gt; alter system set WALLET_ROOT='\/u02\/app\/oracle\/zdm\/zdm_SRCSID_CHZ1_580\/zdm\/TDE' scope=spfile;\n\nSystem altered.\n<\/pre>\n<\/br>\n\n\n\n<p>Let&#8217;s restart the database again.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,8,17]\">\nSQL&gt; shutdown immediate\nORA-01109: database not open\n\n\nDatabase dismounted.\nORACLE instance shut down.\n\nSQL&gt; startup\nORACLE instance started.\n\nTotal System Global Area 8577884400 bytes\nFixed Size                 13693168 bytes\nVariable Size            3439329280 bytes\nDatabase Buffers         5100273664 bytes\nRedo Buffers               24588288 bytes\nDatabase mounted.\nORA-28365: wallet is not open\n<\/pre>\n<\/br>\n\n\n\n<p>Wallet is recognised but not opened.<\/p>\n\n\n\n<p>Confirmed:<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,2,3,4,5,6]\">\nSQL&gt; set lines 300\nSQL&gt; col WRL_PARAMETER for a30\nSQL&gt; col WRL_TYPE for a30\nSQL&gt; col WALLET_TYPE for a30\nSQL&gt; col status for a40\nSQL&gt; select WRL_PARAMETER, WRL_TYPE,WALLET_TYPE, status from V$ENCRYPTION_WALLET;\n\nWRL_PARAMETER                  WRL_TYPE                       WALLET_TYPE                    STATUS\n------------------------------ ------------------------------ ------------------------------ ----------------------------------------\n                               FILE                           UNKNOWN                        NOT_AVAILABLE\n\n<\/pre>\n<\/br>\n\n\n\n<p>tde_configuration parameter is not configured.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; show parameter tde_configuration\n\nNAME                                 TYPE                              VALUE\n------------------------------------ --------------------------------- ------------------------------\ntde_configuration                    string\n<\/pre>\n<\/br>\n\n\n\n<p>Let&#8217;s configure it.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; alter system set tde_configuration='keystore_configuration=FILE' scope=both;\n\nSystem altered.\n<\/pre>\n<\/br>\n\n\n\n<p>Checking, we can see that the wallet is now opened.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; select WRL_PARAMETER, WRL_TYPE,WALLET_TYPE, status from V$ENCRYPTION_WALLET;\n\nWRL_PARAMETER                    WRL_TYPE                       WALLET_TYPE                    STATUS\n------------------------------   ------------------------------ ------------------------------ ----------------------------------------\n\/u02\/app\/oracle\/zdm\/zdm_SRCSID_C FILE                           AUTOLOGIN                      OPEN\nHZ1_580\/zdm\/TDE\/tde\/\n<\/pre>\n<\/br>\n\n\n\n<p>And we can open the database now.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\nSQL&gt; alter database open;\n\nDatabase altered.\n\nSQL&gt;\n<\/pre>\n<\/br>\n\n\n\n<p>And completed the command for the TEMP tablespace encryption.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,5]\">\nSQL&gt; DROP TABLESPACE TEMP INCLUDING CONTENTS;\n\nTablespace dropped.\n\nSQL&gt; ALTER TABLESPACE TEMP_ENCRYPTED RENAME TO TEMP;\n\nTablespace altered.\n\nSQL&gt;\n<\/pre>\n<\/br>\n\n\n\n<p>We can now resume the ZDM job. As the TEMP tablespace is now encrypted, ZDM will move forward with the next actions from the ZDM_POST_DATABASE_OPEN_TGT phase. Which is good because updating the ZDM XML metadata file to consider the phase as successful would have as consequence some missing steps and actions. <\/p>\n\n\n\n<p>Resume ZDM job again:<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1]\">\n[exauser@zdm-host ~]$ zdmcli resume job -jobid 580 -skip SWITCHOVER\nzdm-host.domain.com: Audit ID: 6969\n<\/pre>\n<\/br>\n\n\n\n<p>And we can see that the ZDM migration is now completed successfully.<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,9]\">\n[exauser@zdm-host ~]$ zdmcli query job -jobid 580\nzdm-host.domain.com: Audit ID: 6970\nJob ID: 580\nUser: exauser\nClient: zdm-host\nJob Type: \"MIGRATE\"\nScheduled job command: \"zdmcli migrate database -sourcesid SRCSID -rsp \/home\/exauser\/migration\/zdm_SRCSID_physical_online.rsp -sourcenode dbsource-host -srcauth dbuser -srcarg1 user:oracle -srcarg2 identity_file:\/home\/exauser\/.ssh\/id_rsa -targetnode exacc-cl01n1 -tgtauth zdmauth -tgtarg1 user:opc -tgtarg2 identity_file:\/home\/exauser\/.ssh\/id_rsa -tgtarg3 sudo_location:\/usr\/bin\/sudo -tdekeystorepasswd -tgttdekeystorepasswd -pauseafter ZDM_COPYFILES\"\nScheduled job execution start time: 2025-06-11T17:09:40+02. Equivalent local time: 2025-06-11 17:09:40\nCurrent status: SUCCEEDED\nResult file path: \"\/u01\/app\/oracle\/chkbase\/scheduled\/job-580-2025-06-11-17:10:06.log\"\nMetrics file path: \"\/u01\/app\/oracle\/chkbase\/scheduled\/job-580-2025-06-11-17:10:06.json\"\nJob execution start time: 2025-06-11 17:10:07\nJob execution end time: 2025-06-12 16:02:54\nJob execution elapsed time: 4 hours 37 minutes 44 seconds\nZDM_GET_SRC_INFO .............. COMPLETED\nZDM_GET_TGT_INFO .............. COMPLETED\nZDM_PRECHECKS_SRC ............. COMPLETED\nZDM_PRECHECKS_TGT ............. COMPLETED\nZDM_SETUP_SRC ................. COMPLETED\nZDM_SETUP_TGT ................. COMPLETED\nZDM_PREUSERACTIONS ............ COMPLETED\nZDM_PREUSERACTIONS_TGT ........ COMPLETED\nZDM_VALIDATE_SRC .............. COMPLETED\nZDM_VALIDATE_TGT .............. COMPLETED\nZDM_DISCOVER_SRC .............. COMPLETED\nZDM_COPYFILES ................. COMPLETED\nZDM_PREPARE_TGT ............... COMPLETED\nZDM_SETUP_TDE_TGT ............. COMPLETED\nZDM_RESTORE_TGT ............... COMPLETED\nZDM_RECOVER_TGT ............... COMPLETED\nZDM_FINALIZE_TGT .............. COMPLETED\nZDM_CONFIGURE_DG_SRC .......... COMPLETED\nZDM_SWITCHOVER_SRC ............ COMPLETED\nZDM_SWITCHOVER_TGT ............ COMPLETED\nZDM_POST_DATABASE_OPEN_TGT .... COMPLETED\nZDM_DATAPATCH_TGT ............. COMPLETED\nZDM_NONCDBTOPDB_PRECHECK ...... COMPLETED\nZDM_NONCDBTOPDB_CONVERSION .... COMPLETED\nZDM_POST_MIGRATE_TGT .......... COMPLETED\nZDM_POSTUSERACTIONS ........... COMPLETED\nZDM_POSTUSERACTIONS_TGT ....... COMPLETED\nZDM_CLEANUP_SRC ............... COMPLETED\nZDM_CLEANUP_TGT ............... COMPLETED\n[exauser@zdm-host ~]$\n<\/pre>\n<\/br>\n\n\n\n<p>In the migrated PDB we can see that all tablespaces are encrypted!<\/p>\n\n\n\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [1,7,14,21]\">\nSQL&gt; show pdbs\n\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         3 PDB001P                 READ WRITE NO\n\nSQL&gt; select count(*) from  cdb_tablespaces a, (select x.con_id, y.ENCRYPTIONALG, x.name from V$TABLESPACE x,  V$ENCRYPTED_TABLESPACES y\n  2    where x.ts#=y.ts# and x.con_id=y.con_id) b where a.con_id=b.con_id(+) and a.tablespace_name=b.name(+) and b.ENCRYPTIONALG='AES128';\n\n  COUNT(*)\n----------\n      2803\n\nSQL&gt; select count(*) from  cdb_tablespaces a, (select x.con_id, y.ENCRYPTIONALG, x.name from V$TABLESPACE x,  V$ENCRYPTED_TABLESPACES y\n  2    where x.ts#=y.ts# and x.con_id=y.con_id) b where a.con_id=b.con_id(+) and a.tablespace_name=b.name(+) and b.ENCRYPTIONALG is null;\n\n  COUNT(*)\n----------\n         0\n\nSQL&gt; select a.con_id, a.tablespace_name, nvl(b.ENCRYPTIONALG,'NOT ENCRYPTED') from  cdb_tablespaces a, (select x.con_id, y.ENCRYPTIONALG, x.name from V$TABLESPACE x,  V$ENCRYPTED_TABLESPACES y\n  2    where x.ts#=y.ts# and x.con_id=y.con_id) b where a.con_id=b.con_id(+) and a.tablespace_name=b.name(+) and b.ENCRYPTIONALG is null;\n\nno rows selected\n\nSQL&gt;\n<\/pre>\n<\/br>\n\n\n\n<h3>To wrap up&#8230;<\/h3>\n\n\n\n<p>As explained in my previous blog, ZDM 21.5 version brings some correction, new functionnalities but also some new bug that I could easily mitigate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ZDM 21.5 version brings some new functions like encrypting automatically now the TEMP, SYSTEM, SYSAUX and UNDO tablespaces. There is no need to do it manually any more after the ZDM migration, ZDM will take care of it on its own. Little problem, this is adding a new bug because the temporary database needs [&hellip;]<\/p>\n","protected":false},"author":48,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[59],"tags":[2562,1575],"type_dbi":[],"class_list":["post-39954","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-migration-2","tag-zero-downtime-migration"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption\" \/>\n<meta property=\"og:description\" content=\"The ZDM 21.5 version brings some new functions like encrypting automatically now the TEMP, SYSTEM, SYSAUX and UNDO tablespaces. There is no need to do it manually any more after the ZDM migration, ZDM will take care of it on its own. Little problem, this is adding a new bug because the temporary database needs [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-05T12:05:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-05T12:05:08+00:00\" \/>\n<meta name=\"author\" content=\"Marc Wagner\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marc Wagner\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\"},\"author\":{\"name\":\"Marc Wagner\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628\"},\"headline\":\"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption\",\"datePublished\":\"2025-08-05T12:05:06+00:00\",\"dateModified\":\"2025-08-05T12:05:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\"},\"wordCount\":609,\"commentCount\":0,\"keywords\":[\"migration\",\"zero downtime migration\"],\"articleSection\":[\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\",\"name\":\"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2025-08-05T12:05:06+00:00\",\"dateModified\":\"2025-08-05T12:05:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628\",\"name\":\"Marc Wagner\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g\",\"caption\":\"Marc Wagner\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/marc-wagner\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/","og_locale":"en_US","og_type":"article","og_title":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption","og_description":"The ZDM 21.5 version brings some new functions like encrypting automatically now the TEMP, SYSTEM, SYSAUX and UNDO tablespaces. There is no need to do it manually any more after the ZDM migration, ZDM will take care of it on its own. Little problem, this is adding a new bug because the temporary database needs [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/","og_site_name":"dbi Blog","article_published_time":"2025-08-05T12:05:06+00:00","article_modified_time":"2025-08-05T12:05:08+00:00","author":"Marc Wagner","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marc Wagner","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/"},"author":{"name":"Marc Wagner","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628"},"headline":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption","datePublished":"2025-08-05T12:05:06+00:00","dateModified":"2025-08-05T12:05:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/"},"wordCount":609,"commentCount":0,"keywords":["migration","zero downtime migration"],"articleSection":["Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/","url":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/","name":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2025-08-05T12:05:06+00:00","dateModified":"2025-08-05T12:05:08+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/zdm-21-5-physical-online-migration-failing-during-temp-tablespace-encryption\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"ZDM 21.5 Physical Online Migration failing during TEMP tablespace encryption"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/225d9884b8467ead9a872823acb14628","name":"Marc Wagner","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a873cc6e7fbdbbcbdbcaf5dbded14ad9a77b2ec2c3e03b4d724ed33d35d5f328?s=96&d=mm&r=g","caption":"Marc Wagner"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/marc-wagner\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/48"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=39954"}],"version-history":[{"count":15,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39954\/revisions"}],"predecessor-version":[{"id":39971,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39954\/revisions\/39971"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=39954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=39954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=39954"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=39954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}