doc-exports/docs/dws/tool/dws_07_8312.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

3.5 KiB

Databases

In MySQL, DATABASE is a schema object, which is equivalent to the SCHEMA of Oracle and GaussDB(DWS). DSC supports the following two scenarios:

  1. Database creation

    Input

    create database IF NOT EXISTS dbname1 CHARACTER SET=utf8 COLLATE=utf8_unicode_ci;
    create database IF NOT EXISTS dbname2;
    
    drop database if exists dbname1;
    drop database if exists dbname2;

    Output

    CREATE SCHEMA "dbname1";
    CREATE SCHEMA "dbname2";
    
    DROP SCHEMA IF EXISTS "dbname1";
    DROP SCHEMA IF EXISTS "dbname2";
  2. Database use

    Input

    drop database if exists test;
    create database if not exists test;
    use test;

    Output

    DROP SCHEMA IF EXISTS "test";
    CREATE SCHEMA "test";
    SET CURRENT_SCHEMA = "test";