1. Home
  2. Knowledge Base
  3. ZDM 21.4.3 patch apply – Support for Sequences

ZDM 21.4.3 patch apply – Support for Sequences

One of the issues associated with a ZDM online Logical Migration was that the database Sequences were not replicated as part of the ZDM migration process.

Sequences had to manually advanced as part of the outage window in order to avoid the ORA-00001 unique constraint violation error once the application was switched over to the migrated environment.

This bug 33365050 has now been fixed in ZDM version 21.4.3 which is available via patch 33509650.

Download patch 33509650 and unzip it in a location outside the ZDMHOME directory.

[root@zdmhublis opc]# cp p33509650_214100_Linux-x86-64.zip /u02/zdmuser

[root@zdmhublis opc]# cd /u02/zdmuser

[root@zdmhublis zdmuser]# chown zdmuser:zdm p33509650_214100_Linux-x86-64.zip

[root@zdmhublis zdmuser]# su – zdmuser

[zdmuser@zdmhublis ~]$ cd /u02/zdmuser

[zdmuser@zbm-hub zdmuser]$ unzip p33509650_214100_Linux-x86-64.zip
Archive:  p33509650_214100_Linux-x86-64.zip
   creating: zdm21.4.3/
  inflating: zdm21.4.3/README
  inflating: zdm21.4.3/schema_operations.sh
  inflating: zdm21.4.3/CredentialsDriver.class
 extracting: zdm21.4.3/zdm_home.zip

  inflating: zdm21.4.3/README.txt
   creating: zdm21.4.3/rhp/
 extracting: zdm21.4.3/rhp/zdm.build
  inflating: zdm21.4.3/zdminstall.sh
[zdmuser@zbm-hub zdmuser]$

Apply the 21.4.3 patch to the existing ZDM 21.4.1. home.

Execute the command:

./zdminstall.sh update oraclehome=/u02/zdmuser/zdmhome ziploc=/u02/zdmuser/zdm21.4.3/zdm_home.zip -zdm

[zdmuser@zbm-hub zdmuser]$ cd zdm21.4.3

[zdmuser@zbm-hub zdm21.4.3]$ echo $ZDMHOME
/u02/zdmuser/zdmhome


[zdmuser@zbm-hub zdm21.4.3]$ pwd
/u02/zdmuser/zdm21.4.3

[zdmuser@zbm-hub zdm21.4.3]$ ls
CredentialsDriver.class  README  README.txt  rhp  schema_operations.sh  zdm_home.zip  zdminstall.sh

[zdmuser@zbm-hub zdm21.4.3]$
[zdmuser@zbm-hub zdm21.4.3]$ ./zdminstall.sh update oraclehome=/u02/zdmuser/zdmhome ziploc=/u02/zdmuser/zdm21.4.3/zdm_home.zip  -zdm


ZDM kit home: /u02/zdmuser/zdm21.4.3
/u02/zdmuser/zdm21.4.3
---------------------------------------
Validating zip file...
---------------------------------------
       25  12-08-2023 06:12   rhp/zdm.build
rhp home is: /u02/zdmuser/zdmhome
rhp base is: /u02/zdmuser/zdmbase
label_date is: 221207.25
label_date is: 221207.25
OLDHOME_MAJOR_VERSION: 21
OLDHOME_MINOR_VERSION: 4
OLDHOME_GRID_VERSION: 21
OLDHOME_LABEL_DATE: 221207.25
Attempting to back up the existing ZDM home and ZDM base ...
-rw-r--r--. 1 zdmuser zdm 858438522 Jan 23 01:21 /u02/zdmuser/zdm21.4.3/oldhome.zip
zip warning: No such device or address
-rw-r--r--. 1 zdmuser zdm 9115362 Jan 23 01:21 /u02/zdmuser/zdm21.4.3/oldbase.zip
Attempting to stop the service ...
spawn /u02/zdmuser/zdmhome/mysql/server/bin/mysqladmin --defaults-file=/u02/zdmuser/zdmbase/crsdata/zdmhublis/rhp/conf/my.cnf -u root -p shutdown
 WARNING: oracle.jwc.jmx does not exist in the configuration file. It will be TRUE by default.
[jwcctl debug] Environment ready to start JWC
[jwcctl debug] Return code of initialization: [0]

[jwcctl debug] ... BEGIN_DEBUG [Action= stop] ...
Stop JWC
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC Container (pid=2454110) ...
[jwcctl debug]     Stop command:-Dcatalina.base=/u02/zdmuser/zdmbase/crsdata/zdmhublis/rhp -Doracle.tls.enabled=false -Doracle.wlm.dbwlmlogger.logging.level=FINEST -Doracle.jwc.client.logger.file.name=/u02/zdmuser/zdmbase/crsdata/zdmhublis/rhp/logs/jwc_shutter_stdout_err_%g.log -Doracle.jwc.client.logger.file.number=10 -Doracle.jwc.client.logger.file.size=1048576 -Doracle.jwc.wallet.path=/u02/zdmuser/zdmbase/crsdata/zdmhublis/security -Doracle.jmx.login.credstore=WALLET -classpath /u02/zdmuser/zdmhome/jlib/jwc-logging.jar:/u02/zdmuser/zdmhome/jlib/jwc-client.jar:/u02/zdmuser/zdmhome/jlib/jwc-security.jar:/u02/zdmuser/zdmhome/jdk/lib/tools.jar:/u02/zdmuser/zdmhome/tomcat/lib/tomcat-juli.jar oracle.cluster.jwc.tomcat.client.ShutdownContainer 2454110
[jwcctl debug] Get JWC shutter PIDs
[jwcctl debug] Done getting JWC shutter PIDs
[jwcctl debug] ... JWC shutter command (pid=2464530) ...
[jwcctl debug] ... Initial Check - JWC Shutter JVM waiting (pid=2464530) ...
[jwcctl debug] ... Sleep for 1 seconds ...
[jwcctl debug] ... Iteration 0 Check for JWC Shutter ...
[jwcctl debug] Get JWC shutter PIDs
[jwcctl debug] Done getting JWC shutter PIDs
[jwcctl debug] ... JWC shutter command (pid=2464530) ...
[jwcctl debug] ... Iteration 0 JWC Shutter  waiting (pid=2464530) ...
[jwcctl debug] ... Sleep for 1 seconds ...
[jwcctl debug] ... Iteration 1 Check for JWC Shutter ...
[jwcctl debug] Get JWC shutter PIDs
[jwcctl debug] Done getting JWC shutter PIDs
[jwcctl debug] ... JWC shutter command not found ...
[jwcctl debug] ... Iteration 1 Check for JWC Container ...
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC containers not found ...
[jwcctl debug] ... JWC Container is stopped ...
[jwcctl debug] ... STOP - Return code = 0 ...
[jwcctl debug]  ... END_DEBUG [Action=stop] ...
[jwcctl debug] Return code of AGENT: [0]

Return code is 0
zdmservice stopped successfully.
---------------------------------------
Running update steps ...
---------------------------------------
DB_TYPE is: MYSQL
update is: 1
cleanup is: 0
Executing detachHome...
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4095 MB    Passed
The inventory pointer is located at /u02/zdmuser/zdmhome/oraInst.loc
You can find the log of this install session at:
 /u02/zdmuser/zdmhome/inventory/logs/DetachHome2024-01-23_01-21-17AM.log
'DetachHome' was successful.
Deleting oracle home folder
Deinstall finished successfully
nogi.enabled file found. Setup was performed before.
Removing nogi.enabled file ...

---------------------------------------
Unzipping shiphome to home...
---------------------------------------
Unzipping shiphome...
Shiphome unzipped successfully..
---------------------------------------
##### Performing GridHome Software Only Installation #####
---------------------------------------
Installation log location: /u02/zdmuser/zdmbase/crsdata/zdmhublis/rhp/logs/runInstaller_1705972896.out
---------------------------------------
Restoring Preference file
---------------------------------------
/u02/zdmuser/zdmbase/crsdata/zdmhublis/rhp/conf/rhp.pref
Set REPOS=MYSQL in rhp.pref
Set CONN_DESC=jdbc:mysql:\/\/localhost:8899\/ in rhp.pref
Set MODE= in rhp.pref
Set CHECKPOINT_DIR= in rhp.pref
Set SHARD= in rhp.pref
Set MYSQL_PORT= in rhp.pref
Set TRANSFERPORT_RANGE= in rhp.pref
Set ISSTAGGER_ENABLED= in rhp.pref
Set ALLOW_HTTP_REST=FALSE in rhp.pref
Set IDCS_CLIENT_ID= in rhp.pref
Set IDCS_CLIENT_TENANT= in rhp.pref
Set IDCS_TOKEN_CLAIM_SCOPE= in rhp.pref
Set IDCS_SERVICE_URL= in rhp.pref
Set IDCS_CLIENT_SECRET_WALLET= in rhp.pref
Resetting default MySQL port
Editing MySQL port...
Set port=8899 in my.cnf
Set \1jdbc:mysql:\/\/localhost:8899\/ in rhp.pref
---------------------------------------
Generating Root Certificate
---------------------------------------
Cluster root certificate generated successfully.
---------------------------------------
Generating CA CERTS file
---------------------------------------
spawn /u02/zdmuser/zdmhome/bin/crskeytoolctl -copycacerts -filestore /u02/zdmuser/zdmbase/crsdata/zdmhublis/security
Enter JRE cacerts truststore password:
JRE cacerts copied to file [/u02/zdmuser/zdmbase/crsdata/zdmhublis/security/cacerts].
---------------------------------------
Generating nogi.enabled file
---------------------------------------
nogi.enabled file generated sucessfully
---------------------------------------
Generating standalone_config.properties file
---------------------------------------
Setting base folder permissions
---------------------------------------
Copying service script to bin folder in Oracle Home
label_date is: 221207.25
Updating NOGI home ...
current node is active node
---------------------------------------
Adding Certs to ZDM
---------------------------------------
ZDM service update finished successfully...

Verify that the ZDM version is now 21.4.3 via the zdmcli -build command.

[zdmuser@zbm-hub zdm21.4.3]$ cd $ZDMHOME/bin
[zdmuser@zbm-hub bin]$ ./zdmcli -build
version: 21.0.0.0.0
full version: 21.4.0.0.0
patch version: 21.4.3.0.0
label date: 221207.25
ZDM kit build date: Dec 08 2023 06:12:25 UTC
CPAT build version: 23.9.0

Start the ZDM service.

[zdmuser@zbm-hub bin]$ ./zdmservice start
No instance detected, starting zdmservice
spawn /u02/zdmuser/zdmhome/mysql/server/bin/mysqladmin --defaults-file=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/conf/my.cnf -u root -p ping

 WARNING: oracle.jwc.jmx does not exist in the configuration file. It will be TRUE by default.
[jwcctl debug] Environment ready to start JWC
[jwcctl debug] Return code of initialization: [0]

[jwcctl debug] ... BEGIN_DEBUG [Action= start] ...
Start JWC
[jwcctl debug] Loading configuration file: /u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/conf/jwc.properties
[jwcctl debug]     oracle.jmx.login.credstore = CRSCRED
[jwcctl debug]     oracle.jmx.login.args = DOMAIN=rhp CACHE_ENABLED=true CACHE_EXPIRATION=180
[jwcctl debug]     oracle.rmi.url = service:jmx:rmi://{0}:{1,number,#}/jndi/rmi://{0}:{1,number,#}/jmxrmi
[jwcctl debug]     oracle.http.url = http://{0}:{1,number,#}/rhp/gridhome
[jwcctl debug]     oracle.jwc.tls.clientauth = false
[jwcctl debug]     oracle.jwc.tls.rmi.clientfactory = RELOADABLE
[jwcctl debug]     oracle.jwc.lifecycle.start.log.fileName = JWCStartEvent.log
[jwcctl debug]     oracle.jwc.http.connector.ssl.protocols = TLSv1.2,TLSv1.3
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC containers not found ...
[jwcctl debug]     Start command:-server -Xms2048M -Xmx4096M -Djava.awt.headless=true -Ddisable.checkForUpdate=true -Djava.util.logging.config.file=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -DTRACING.ENABLED=true -DTRACING.LEVEL=2 -Doracle.wlm.dbwlmlogger.logging.level=FINEST -Duse_scan_IP=true -Djava.rmi.server.hostname=localhost -Doracle.http.port=8898 -Doracle.jmx.port=8897 -Doracle.tls.enabled=false -Doracle.jwc.tls.http.enabled=false -Doracle.rhp.storagebase=/u02/zdmuser/zdmbase -Djava.security.manager -Djava.security.policy=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/conf/catalina.policy -Djava.security.egd=file:/dev/urandom -Doracle.jwc.wallet.path=/u02/zdmuser/zdmbase/crsdata/zbm-hub/security -Doracle.jmx.login.credstore=WALLET -Doracle.rest.enabled=false -Doracle.jmx.enabled=true -Dcatalina.home=/u02/zdmuser/zdmhome/tomcat -Dcatalina.base=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp -Djava.io.tmpdir=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/temp -Doracle.home=/u02/zdmuser/zdmhome -Doracle.jwc.mode=STANDALONE -classpath /u02/zdmuser/zdmhome/jlib/cryptoj.jar:/u02/zdmuser/zdmhome/jlib/oraclepki.jar:/u02/zdmuser/zdmhome/jlib/osdt_core.jar:/u02/zdmuser/zdmhome/jlib/osdt_cert.jar:/u02/zdmuser/zdmhome/tomcat/lib/tomcat-juli.jar:/u02/zdmuser/zdmhome/tomcat/lib/bootstrap.jar:/u02/zdmuser/zdmhome/jlib/jwc-logging.jar org.apache.catalina.startup.Bootstrap start
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC Container (pid=359826) ...
[jwcctl debug] ... JWC Container running (pid=359826) ...
[jwcctl debug]     Check command:-Djava.net.preferIPv6Addresses=true -Dcatalina.base=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp -Doracle.wlm.dbwlmlogger.logging.level=FINEST -Doracle.jwc.client.logger.file.name=/u02/zdmuser/zdmbase/crsdata/zbm-hub/rhp/logs/jwc_checker_stdout_err_%g.log -Doracle.jwc.client.logger.file.number=10 -Doracle.jwc.client.logger.file.size=1048576 -Doracle.jwc.wallet.path=/u02/zdmuser/zdmbase/crsdata/zbm-hub/security -Doracle.jmx.login.credstore=WALLET -Doracle.tls.enabled=false -Doracle.jwc.tls.http.enabled=false -classpath /u02/zdmuser/zdmhome/jlib/jwc-logging.jar:/u02/zdmuser/zdmhome/jlib/jwc-security.jar:/u02/zdmuser/zdmhome/jlib/jwc-client.jar:/u02/zdmuser/zdmhome/jlib/jwc-cred.jar:/u02/zdmuser/zdmhome/jlib/srvm.jar:/u02/zdmuser/zdmhome/jlib/srvmhas.jar:/u02/zdmuser/zdmhome/jlib/cryptoj.jar:/u02/zdmuser/zdmhome/jlib/oraclepki.jar:/u02/zdmuser/zdmhome/jlib/osdt_core.jar:/u02/zdmuser/zdmhome/jlib/osdt_cert.jar:/u02/zdmuser/zdmhome/tomcat/lib/tomcat-juli.jar oracle.cluster.jwc.tomcat.client.JWCChecker localhost 8898 -1

[jwcctl debug] ... JWC Container is ready ...
[jwcctl debug] ... START - Return code = 0 ...
[jwcctl debug]  ... END_DEBUG [Action=start] ...
[jwcctl debug] Return code of AGENT: [0]

Return code is 0
Server started successfully.

After the patch has been applied, when we run the ZDM Online Migration, we see a new phase being executed as part of the ZDM switchover which is the phase ZDM_ADVANCE_SEQUENCES.

zbm-hub: 2024-01-12T09:30:29.144Z : Status of Oracle GoldenGate replicat process "RU4H1" : STOPPED
zbm-hub: 2024-01-12T09:30:29.665Z : Execution of phase ZDM_PREPARE_SWITCHOVER_APP completed
zbm-hub: 2024-01-12T09:30:30.853Z : Executing phase ZDM_ADVANCE_SEQUENCES
zbm-hub: 2024-01-12T09:30:32.782Z : altering sequences in target database "DB19C_PDB1.SUB12080317360.VCNGAV.ORACLEVCN.COM"
zbm-hub: 2024-01-12T09:30:33.631Z : Execution of phase ZDM_ADVANCE_SEQUENCES completed
zbm-hub: 2024-01-12T09:30:33.805Z : Executing phase ZDM_SWITCHOVER_APP

View the log file under $ZDMBASE directory location – /u02/zdmuser/zdmbase/crsdata/zdm-hub/rhp/zdmserver.log.0.

We can see the various sequences in the HR schema being altered.

[AdvanceSequencesPhase.execute:270]  querying sequences in source DB
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:32.355Z] [DEBUG] [OracleDbClient.querySequences:2781]  querying DBA_SEQUENCES ...
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:32.365Z] [DEBUG] [DbClient.executeQuery:299]  executing SELECT statement SELECT * FROM DBA_SEQUENCES  WHERE SEQUENCE_OWNER IN ('HR') AND SEQUENCE_NAME NOT IN (select name||'_SEQ' from sys.dba_queues where sharded='TRUE') AND SEQUENCE_NAME NOT IN (select name||'_SHSEQ' from sys.dba_queues where sharded='TRUE') AND sequence_name not like 'AQ$_%' AND SEQUENCE_NAME NOT IN (select object_name from dba_objects where object_type = 'SEQUENCE' and (secondary = 'Y' OR object_name like 'ISEQ$$_%') )  for DB jdbc:oracle:thin:@(description=(address=(protocol=tcp)(port=1521)(host=db12c.sub12080317360.vcngav.oraclevcn.com))(connect_data=(service_name=db12c_pdb1.sub12080317360.vcngav.oraclevcn.com))) ...
...
...
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.165Z] [DEBUG] [OracleDbClient.advanceSequence:1281]  altered sequence EMPLOYEES_SEQ
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.165Z] [DEBUG] [AdvanceSequencesPhase.execute:302]  advancing sequence HR.DEPARTMENTS_SEQ to 311
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.167Z] [DEBUG] [OracleDbClient.advanceSequence:1279]  altering sequence DEPARTMENTS_SEQ
...
...
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.447Z] [DEBUG] [OracleDbClient.advanceSequence:1281]  altered sequence DEPARTMENTS_SEQ
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.447Z] [DEBUG] [AdvanceSequencesPhase.execute:302]  advancing sequence HR.LOCATIONS_SEQ to 3701
[UID:-1173759801] [jobid-23] [2024-01-12T09:30:33.447Z] [DEBUG] [OracleDbClient.advanceSequence:1279]  altering sequence LOCATIONS_SEQ

We can compare the Sequence START WITH value on both the source as well as target databases and find that the START WITH value of the sequences in the target database have been incremented by the value 1.

Note the Sequence START WITH values in the source database.


CREATE SEQUENCE  "HR"."DEPARTMENTS_SEQ"  MINVALUE 1 MAXVALUE 9990 INCREMENT BY 10 START WITH 310 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;

   CREATE SEQUENCE  "HR"."EMPLOYEES_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 207 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;

   CREATE SEQUENCE  "HR"."LOCATIONS_SEQ"  MINVALUE 1 MAXVALUE 9900 INCREMENT BY 100 START WITH 3700 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;

Note the Sequence START WITH values in the target database which is now the ‘live’ database as ZDM has completed the switchover.

  CREATE SEQUENCE  "HR"."DEPARTMENTS_SEQ"  MINVALUE 1 MAXVALUE 9990 INCREMENT BY 10 START WITH 311 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;

   CREATE SEQUENCE  "HR"."EMPLOYEES_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 208 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;

   CREATE SEQUENCE  "HR"."LOCATIONS_SEQ"  MINVALUE 1 MAXVALUE 9900 INCREMENT BY 100 START WITH 3701 NOCACHE  NOORDER  NOCYCLE  NOKEEP  NOSCALE  GLOBAL ;
Updated on January 31, 2024

Was this article helpful?

Leave a Comment