All Products
Search
Document Center

CREATE SCHEMA

Last Updated: Apr 24, 2019

Create schemas

Syntax

  1. CREATE SCHEMA [IF NOT EXISTS] db_name
  2. with dbproperties (
  3. CATALOG = <catalog>,
  4. LOCATION = <endpoint>
  5. )

Parameters

  • CATALOG indicates the type of the schema. Valid values are Table Store, OSS, AnalyticDB, MySQL, SQL Server, PostgreSQL, MongoDB, and Redis.

  • LOCATION indicates the connection information. The LOCATION format varies with the schema type.

Example

The following example shows how to create an OSS schema. The location is specified as the storage path of the OSS file and ended with / to indicate a directory.

  1. CREATE SCHEMA oss_log_schema with DBPROPERTIES(
  2. catalog='oss',
  3. location = 'oss://analyticdb-bucket/log/'
  4. );