Help Center/ Database and Application Migration UGO/ FAQs/ Database Connections/ How Do I Create GaussDB Databases Compatible with Source Databases?
Updated on 2024-11-07 GMT+08:00

How Do I Create GaussDB Databases Compatible with Source Databases?

Oracle as the Source

  1. Log in to your GaussDB instance as a user who has the permission to create databases.
  2. Create a GaussDB database compatible with Oracle.

    Primary/Standby:

    create database databasename dbcompatibility = 'A';

    Distributed:

    create database databasename dbcompatibility = 'ORA';

  3. Check whether the database is created.

    select * from pg_database where datname = 'databasename';

    • Primary/standby: If the value of datcompatibility is A, the database is created.
    • Distributed: If the value of datcompatibility is ORA, the database is created.

MySQL as the Source

  1. Log in to your GaussDB instance as a user who has the permission to create databases.
  2. Create a GaussDB database compatible with MySQL.

    Primary/Standby (B-compatible)

    create database databasename dbcompatibility = 'B';

    Primary/Standby (M-compatible)

    create database databasename dbcompatibility = 'M';

    Distributed:

    create database databasename dbcompatibility = 'MySQL';

  3. Check whether the database is created.

    select * from pg_database where datname = 'databasename';

    • Primary/standby (B-compatible): If the value of datcompatibility is B, the MySQL-compatible database is created.
    • Primary/standby (M-compatible): If the value of datcompatibility is M, the M-compatible database is created.
    • Distributed: If the value of datcompatibility is MySQL, the database is created.

PostgreSQL as the Source Database

  1. Log in to your GaussDB instance as a user who has the permission to create databases.
  2. Create a GaussDB database compatible with PostgreSQL.

    Primary/Standby:

    create database databasename dbcompatibility = 'A';

    Distributed:

    create database databasename dbcompatibility = 'ORA';

  3. Check whether the database is created.

    select * from pg_database where datname = 'databasename';

    • Primary/standby: If the value of datcompatibility is A, the database is created.
    • Distributed: If the value of datcompatibility is ORA, the database is created.

SQL Server as the Source Database

  1. Log in to your GaussDB instance as a user who has the permission to create databases.
  2. Create a GaussDB database compatible with SQL Server.

    Primary/Standby:

    create database databasename dbcompatibility = 'A' ;

    Distributed:

    create database databasename dbcompatibility = 'ORA';

  3. Check whether the database is created.

    select * from pg_database where datname = 'databasename';

    • Primary/standby: If the value of datcompatibility is A, the database is created.
    • Distributed: If the value of datcompatibility is ORA, the database is created.