Skip to main content
Version: V1.0.0

MODULE DATA

Description

The MODULE DATA statement has the following two functions:

  • ALTER SYSTEM LOAD MODULE DATA ...: This statement is used to import a specified feature.
  • ALTER SYSTEM CHECK MODULE DATA ...: This statement is used to check whether a specified feature has been imported.

Limitations and Considerations

  • Only the REDIS module feature can be imported in the current version.
  • Only the CHECK MODULE DATA function can be used to check whether the REDIS module feature has been imported in the current version.

Privileges

The user who executes this statement must have the ALTER SYSTEM privilege. For more information about the privileges of seekdb, see Privilege classification of seekdb.

Syntax

ALTER SYSTEM {LOAD | CHECK} MODULE DATA
MODULE = module_value
[INFILE = file_path];

module_value:
REDIS
| GIS
| TIMEZONE

Parameters

ParameterDescription
LOAD | CHECKSpecifies whether to import or check the feature. Valid values:
  • LOAD: specifies to import the feature.
  • CHECK: specifies to check whether the feature has been imported.
module_valueSpecifies the feature to be operated on. For more information, see module_value.
file_pathSpecifies the path of the SQL file to be imported.
Because TIMEZONE and GIS may have multiple versions, you must specify the SQL file of the corresponding version. Currently, TIMEZONE and GIS have only one version, so the default INFILE parameter is supported. The INFILE parameter is not supported for the REDIS module feature in the current version. If you specify the INFILE parameter for the REDIS module feature, an error will be returned.

module_value

  • REDIS: specifies the REDIS module feature.
  • GIS: specifies the GIS module feature.
  • TIMEZONE: specifies the TIMEZONE module feature.

Examples

Example of LOAD MODULE DATA

  1. Import the REDIS module feature using the INFILE path. However, the INFILE path is not supported for the REDIS module feature in the current version. An error will be returned.

    ALTER SYSTEM LOAD MODULE DATA
    MODULE = REDIS
    INFILE = '/home/admin/test.sql';

    The return result is as follows:

    ERROR 4025 (HY000): loading redis module does not need to specify infile
  2. Import the REDIS module feature.

    ALTER SYSTEM LOAD MODULE DATA
    MODULE = REDIS

    The return result is as follows:

    Query OK, 0 rows affected
  3. Import the GIS module feature. The INFILE parameter is optional. The default value is etc/, and the corresponding file is located in the etc directory under the deployment directory.

    ALTER SYSTEM LOAD MODULE DATA
    MODULE = GIS
    INFILE = 'etc/';

    The return result is as follows:

    Query OK, 0 rows affected
  4. Import the TIMEZONE module feature. The INFILE parameter is optional. The default value is etc/, and the corresponding file is located in the etc directory under the deployment directory.

    ALTER SYSTEM LOAD MODULE DATA
    MODULE = TIMEZONE
    INFILE = 'etc/';

    The return result is as follows:

    Query OK, 0 rows affected

Example of CHECK MODULE DATA

tip

Only the CHECK MODULE DATA function can be used to check whether the REDIS module feature has been imported in the current version.

  • If no feature has been imported, an error will be returned when you execute the CHECK MODULE DATA statement. Check whether the REDIS module feature has been imported.

    ALTER SYSTEM CHECK MODULE DATA
    MODULE = REDIS

    The return result is as follows:

    ERROR 4025 (HY000): redis info is not complete,please retry loading
  • First import the feature and then check whether the feature has been imported.

    1. Import the REDIS module feature.

      ALTER SYSTEM LOAD MODULE DATA
      MODULE = REDIS

      The return result is as follows:

      Query OK, 0 rows affected
    2. Check whether the REDIS module feature has been imported.

      ALTER SYSTEM CHECK MODULE DATA
      MODULE = REDIS

      The return result is as follows:

      Query OK, 0 rows affected