Help Center/ Data Replication Service/ Troubleshooting/ Solutions to Failed Check Items/ Database Parameters/ Checking Whether the time_zone Values of the Source and Destination Databases Are the Same
Updated on 2024-05-09 GMT+08:00

Checking Whether the time_zone Values of the Source and Destination Databases Are the Same

If the time_zone values of the source and destination databases are different, the migration may fail.

Failure Cause

The time_zone or system_time_zone values of the source and destination databases must be the same.

Handling Suggestion

Change the value of time_zone (timezone) or system_time_zone of the source database to be the same as that of the destination database.

  • To change the value of time_zone in the MySQL database, perform the following steps:
    • If the database is a self-managed database, run commands to change the time zone.
      1. Run the following command to check the time zone of the database:
        SHOW VARIABLES LIKE "%time_zone%";
      2. Run the following command to change the time zone:
        SET time_zone = 'Timezone';
    • If the database is an RDS for MySQL DB instance, change the time zone by following the instructions provided in How Can I Change the Time Zone?
  • To change the value of time_zone in the Oracle database, perform the following steps:
    1. Run the following statement to query the value of time_zone in the database:
      SELECT DBTIMEZONE FROM DUAL;
    2. Run the following statement to change the value of time_zone in the database:
      ALTER DATABASE SET TIME_ZONE='Time zone';

      Example of changing the time zone to GMT+8:

      ALTER DATABASE SET TIME_ZONE='+08:00';
    3. Restart the database after changing the value of time_zone.
      SQL> shutdown immediate
      SQL> startup
  • To change the value of time_zone in the DDM database, perform the following steps:

    Log in to the DDM console and change the time zone.

For details about how to change the time zone for other types of databases, see the usage guide of the corresponding database.