how to run two commands in sudo?
sudo can run multiple commands via a shell, for example:
$ sudo -s -- 'whoami; whoami'rootroot
Your command would be something like:
sudo -u db2inst1 -s -- "db2 connect to ttt; db2 UPDATE CONTACT SET EMAIL_ADDRESS = 'mytestaccount@gmail.com'"
If your sudo version doesn't work with semicolons with -s (apparently, it doesn't if compiled with certain options), you can use
sudo -- sh -c 'whoami; whoami'
instead, which basically does the same thing but makes you name the shell explicitly.