DEV Community

Cong Li
Cong Li

Posted on

GBASE数据库 | Introduction to GBase 8a Cluster Transparent Gateway and DBLINK Usage

The GBase 8a cluster transparent gateway service is an independently running process. Its main function is to obtain and process DBLINK request information, allowing GBase 8a clusters to directly access other GBase databases or heterogeneous data sources. This enables data extraction into the GBase 8a cluster or data pushing from the GBase 8a cluster to other clusters.

DBLINK is a remote database connection function provided within the GBase 8a cluster. Through collaboration with the transparent gateway service, it enables querying remote databases and performing associative operations between remote and local data.

Working Principle of the Transparent Gateway

Homogeneous Data Sources

For clusters where the target and source are the same version of the GBase 8a cluster, data interoperability is achieved via DBLINK.

Image description

Working Principle Overview:
1) The target cluster sends a data request from the gcluster’s port 5258 to DBLINK’s port 9898.
2) DBLINK forwards the request from port 9898 to the source cluster’s port 5258.
3) The source database generates an execution plan from the received request, which is then distributed to each gnode’s port 5050 from the gcluster’s port 5258.
4) Each gnode at the source end performs the query based on the execution plan and communicates the results directly to the target cluster’s gnode’s port 5050.
5) The Gnode on the target side aggregates the query results to the gcluster layer.

Open Ports:

  • DBLINK: Port 9898
  • Ports 5258 on both the source and target sides should be accessible to DBLINK's port 9898.
  • Ensure that the gnode nodes on the source and target clusters can access each other’s port 5050 to facilitate data exchange in step 4.

Heterogeneous Data Sources

The diagram below illustrates data interaction between GBase 8a and Oracle via DBLINK.

Image description

Working Principle Overview:
1) The target cluster sends a data request from gcluster’s port 5258 to DBLINK’s port 9898.
2) DBLINK forwards the request from port 9898 to the source cluster’s port 1521.
3) The source database processes the request and sends the results back to DBLINK’s port 9898.
4) DBLINK sends the results from the source database to a random gnode node in the target cluster.
5) The target Gnode returns the query results to gcluster.

Open Ports:

  • DBLINK: Port 9898
  • Ports 5258 on both the source and target sides should be accessible to DBLINK’s port 9898.
  • Ensure all gnode nodes in the target cluster can access DBLINK's port 9898 to allow the return of query results to a random gnode node in the target cluster.

Transparent Gateway Configuration and Management

Installing the Transparent Gateway

1) After obtaining the GBase 8a cluster transparent gateway tar package, copy it to the installation path and extract it with tar -xvf [package_name].tar.
2) The extracted directory, named after the tar package, is the installation directory of the transparent gateway.
3) Use chmod -R +x [installation_directory_name] to grant appropriate permissions to the files and subdirectories under the transparent gateway installation directory.

Configuring the Transparent Gateway

The gateway service configuration files are located in the conf folder under the transparent gateway installation directory and include:
1) Gateway parameter configuration file: conf.properties
2) Gateway data source configuration file: dataSource/dblink_name.properties
3) Gateway target database configuration file: gcluster/gbase8a_gcluster.properties

Configuring Gateway Parameters

The gateway configuration file is conf.properties.

Example:

gbase.gt.port=9898
gbase.gt.encode=utf8
gbase.gt.pagesize=10000
#load data type : batch=1, insert values=0
gbase.gt.load.data.type=1
gbase.gt.table.use.decimal=1
#paging query : not=0, yes=1;default=0
gbase.gt.gc.paging.query=0
gbase.gt.st.paging.query=0
gbase.gt.orcl.paging.query=0
gbase.gt.mysql.paging.query=0
gbase.gt.tera.paging.query=0
gbase.gt.hive.paging.query=0
gbase.gt.oceanbaseoracle.paging.query=0
gbase.gt.gbase8c.paging.query=0
#commit type : transaction commit=0, paging commit=1
gbase.gt.commit.type=0
#timeout
gbase.gt.wait.timeout=7200
#timeout to fetch gcluster datasource(second) : default=108000
gbase.gt.gc.fetch.timeout=108000
#thread pool type: 0-fixed thread pool 1-thread pool executor
gbase.gt.thread.pool.type=0
#thread pool size(gbase.gt.thread.pool.type=0 effect)
gbase.gt.thread.pool.size=1000
#core pool size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.core.pool.size=200
#maximum pool size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.maximum.pool.size=5000
#keep alive time(gbase.gt.thread.pool.type=1 effect)
gbase.gt.keep.alive.time=0
#queue size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.queue.size=10
#encryption 0 false 1 true
#gbase.gt.passwd.encryption=1
Enter fullscreen mode Exit fullscreen mode

Configuring Data Sources

The data source configuration file is dataSource/dblink_name.properties. Multiple data sources can be configured, with each data source corresponding to a configuration file named after the data source, e.g., dblink_name.properties for the data source dblink_name.

Example:

[ds1]
dataSource_dbtype=gcluster
dataSource_url=jdbc:gbase://192.168.190.201/test
dataSource_IP=192.168.190.201
dataSource_port=5258
dataSource_dbname=test
dataSource_user=gbase
dataSource_pwd=gbase20110531
dataSource_charset=utf8
Enter fullscreen mode Exit fullscreen mode

Configuring Coordinator Connection Parameters

The conf/gcluster path under the gateway directory includes gbase8a_gcluster.properties, which contains connection parameters for all local gcluster coordinators and gnodes.

Example:

[gc1]
gcluster_IP=192.168.8.102 -- local IP
gcluster_port=5258        -- port
gcluster_user=root        -- user
gcluster_pwd=root         -- user password
gcluster_encode=utf-8     -- gcluster charset
[gn1]
gcluster_IP=192.168.8.103 -- local IP
gcluster_port=5050        -- port
gcluster_user=root        -- user
gcluster_pwd=root         -- user password
gcluster_encode=utf-8     -- gcluster charset
Enter fullscreen mode Exit fullscreen mode

High Availability (HA) Deployment of the Gateway

For high availability, two identical configurations of the gateway service can be deployed—one primary and one standby. Both are online, and if the gcluster connection to the primary gateway fails, it will attempt to connect to the standby gateway.

Starting and Stopping the Transparent Gateway

Navigate to the gbaseGateway installation directory and execute the following commands to manage the transparent gateway:

$ sh gbaseGatewayServer.sh --help
Usage: gbaseGatewayServer.sh {start|stop|restart|status}
$ sh gbaseGatewayServer.sh start
Enter fullscreen mode Exit fullscreen mode

Uninstalling the Transparent Gateway

The GBase 8a cluster transparent gateway is a non-intrusive software that doesn’t require an uninstaller. Simply delete the entire installation directory after stopping the transparent gateway service by running rm -r [installation_directory_name] from the parent directory.

DBLINK Configuration and Management

DBLINK management includes configuring gateway information for the target cluster, creating, deleting, querying, and using DBLINK.

Configuring Gateway Information

Configure the gateway information to be used by the GBase 8a cluster (local).

Parameters required in gbase_8a_gcluster.cnf:

  • gbase_dblink_gateway_ip = [Transparent Gateway IP, e.g., 192.18.16.11]
  • gbase_dblink_gateway_port = [Transparent Gateway service port, e.g., 9898]

Optional parameters in gbase_8a_gcluster.cnf:

  • gcluster_dblink_direct_data_exchange:
    • Default is 1
    • 1: Data is sent directly from the data source cluster to the target cluster.
    • 0: Data is sent from the data source cluster to the gateway, which then forwards it to the target cluster.

HA Deployment of the Gateway

The DBLINK function supports HA deployment. Add the following parameters to the target cluster:

  • gbase_dblink_standby_gateway_ip: IP address of the standby DBLINK gateway service.
  • gbase_dblink_standby_gateway_port: Port of the standby DBLINK gateway service.

Creating a DBLINK

Syntax:

CREATE DATABASE LINK dblink_name CONNECT TO username IDENTIFIED BY password USING 'TG_config_name';
Enter fullscreen mode Exit fullscreen mode

Parameters:

  • dblink_name: The name of the DBLink to be created.
  • username: Username in the database service the DBLink will connect to.
  • password: Password for the database user.
  • TG_config_name: Name of the transparent gateway configuration file.

Example:

CREATE DATABASE LINK dblink_pub
CONNECT TO 'sysdba' IDENTIFIED BY 'sys'
USING 'tg_config1';
Enter fullscreen mode Exit fullscreen mode

Deleting a DBLink

Syntax:

DROP DATABASE LINK dblink_name;
Enter fullscreen mode Exit fullscreen mode

Example:

DROP DATABASE LINK dblink_pub;
Enter fullscreen mode Exit fullscreen mode

Querying DBLinks

To view all existing DBLinks, use the following SQL:

SELECT * FROM gbase.db_links;
Enter fullscreen mode Exit fullscreen mode

Using a DBLink

In GBase 8a clusters, you can query tables through an existing DBLink using the syntax table@dblinkname.

Example:

SELECT * FROM table@dblink_pub;
Enter fullscreen mode Exit fullscreen mode

Heterogeneous Data Sources

DBLink gateways support various heterogeneous data sources, including Oracle, MySQL, Hive, Teradata, Sybase, and more.

Configuring Gateway Data Sources

To configure a DBLink gateway for Oracle, MySQL, or Teradata data sources:

cp [Gateway_Installation_Dir]/conf/dataSource/sample/oracle_link1.properties [Gateway_Installation_Dir]/conf/dataSource/oracle_link1.properties
cat oracle_link1.properties
[ds1]
dataSource_IP=192.168.6.124       # IP address of the Oracle/MySQL/Teradata server
dataSource_port=1521              # Port number the service listens on
dataSource_dbname=orcl            # Database name
dataSource_dbtype=oracle/mysql/teradata   # Data source type
dataSource_user=myora             # Username
dataSource_pwd=myora              # Password

# cd sample/
# ll
total 32
-rw-rw-r-- 1 gbase gbase 161 Sep  12 17:51 gbase8c_dblink1.properties
-rw-rw-r-- 1 gbase gbase 234 Sep  12 17:51 gbase_dblink1.properties
-rw-rw-r-- 1 gbase gbase 241 Sep  12 17:51 hive_dblink1.properties
-rw-rw-r-- 1 gbase gbase 215 Sep  12 17:51 mysql_dblink1.properties
-rw-rw-r-- 1 gbase gbase 217 Sep  12 17:51 oceanbaseoracle_dblink1.properties
-rw-rw-r-- 1 gbase gbase 211 Sep  12 17:51 oracle_dblink1.properties
-rw-rw-r-- 1 gbase gbase 227 Sep  12 17:51 sybase_dblink1.properties
-rw-rw-r-- 1 gbase gbase 253 Sep  12 17:51 teradata_dblink1.properties

# cat gbase8c_dblink1.properties
[ds1]
dataSource_dbtype=gbase8c
dataSource_IP=192.168.3.83
dataSource_port=5432
dataSource_dbname=postgres
dataSource_user=gateway
dataSource_pwd=gbase@123

# cat gbase_dblink1.properties
[ds1]
dataSource_dbtype=gcluster
dataSource_url=jdbc:gbase://192.168.190.201/test
dataSource_IP=192.168.190.201
dataSource_port=5258
dataSource_dbname=test
dataSource_user=gbase
dataSource_pwd=gbase20110531
dataSource_charset=utf8

# cat hive_dblink1.properties
[ds1]
dataSource_dbtype=hive
dataSource_url=jdbc:hive2://192.168.103.142/default
dataSource_IP=192.168.103.142
dataSource_port=10000
dataSource_dbname=default
dataSource_user=gbase
dataSource_pwd=gbase20110531
dataSource_charset=utf8

# cat mysql_dblink1.properties
[ds1]
dataSource_dbtype=mysql
dataSource_url=jdbc:mysql://192.168.199.129:3306/sk_test
dataSource_IP=192.168.199.129
dataSource_port=3306
dataSource_dbname=sk_test
dataSource_user=rtsync
dataSource_pwd=rtsync

# cat oceanbaseoracle_dblink1.properties
[ds1]
dataSource_dbtype=oceanbaseoracle
dataSource_url=jdbc:oceanbase://192.168.3.57:1521/orcl
dataSource_IP=192.168.3.57
dataSource_port=1521
dataSource_dbname=orcl
dataSource_user=gbase
dataSource_pwd=erris

# cat oracle_dblink1.properties
[ds1]
dataSource_dbtype=oracle
dataSource_url=jdbc:oracle:thin:@//192.168.3.57:1521/orcl
dataSource_IP=192.168.3.57
dataSource_port=1521
dataSource_dbname=orcl
dataSource_user=gbase
dataSource_pwd=erris

# cat sybase_dblink1.properties
[ds1]
dataSource_dbtype=sybaseAse
dataSource_url=jdbc:jtds:sybase://192.168.15.204:5000/mydatabase
dataSource_IP=192.168.15.204
dataSource_port=5000
dataSource_dbname=mydatabase
dataSource_user=gbase
dataSource_pwd=gbase

# cat teradata_dblink1.properties
[ds1]
dataSource_dbtype=teradata
dataSource_url=jdbc:teradata://192.168.3.194/TMODE=ANSI,CHARSET=UTF8,database=srctera
dataSource_IP=192.168.3.194
dataSource_port=1025
dataSource_dbname=srctera
dataSource_user=gbase
dataSource_pwd=gbase20110531
Enter fullscreen mode Exit fullscreen mode

DBLink Query Syntax Constraints

For heterogeneous data sources, new syntax constraints have been introduced:

Except for UNION (including MINUS, UNION ALL, and INTERSECT) queries, DBLink tables from heterogeneous data sources are only allowed in subqueries in the FROM clause. For instance, assume olink is a DBLink object from a heterogeneous data source. Here are some examples:

select * from t1@olink;     -- Not allowed
-- Error: DBLink table from heterogeneous data source must belong to the relation subquery.

select * from (select * from t1@olink);  -- Allowed

select * from t1@olink tt1 join t2@olink tt2 on tt1.a=tt2.a  -- Not allowed
-- Error: DBLink table from heterogeneous data source must belong to the relation subquery.

select * from (select * from t1@olink tt1 join t2@olink tt2 on tt1.a=tt2.a) ttt; -- Allowed

select * from t1@olink tt1 union select * from t1@olink tt2;  -- Allowed

select * from (select * from t1@olink tt1 union select * from t1@olink tt2) ttt; -- Allowed

select tt1.a from t1 tt1 join (select a from t1@o_link) tt2 on tt1.a=tt2.a; -- Allowed

select * from (select a from t1@o_link) tt1 
join (select a from t1@o_link) tt2 on tt1.a=tt2.a; -- Allowed

select tt1.a from t1@o_link tt1 join (select a from t1@o_link) tt2 on tt1.a=tt2.a; -- Not allowed
-- Error: DBLink table join with (normal table || from subquery) is forbidden

select * from t1 where a in (select a from t1@o_link);    -- Not allowed
-- Error: the position of DBLink table in a subquery of normal table is forbidden

select * from t1 where a in (select a from (select a from t1@o_link)tt); -- Allowed

select * from t1@o_link tt1 union all select * from t1@o_link tt2; -- Allowed

select * from t1@o_link tt1 minus select * from t1@o_link tt2; -- Allowed

select * from t1 tt1 union select * from t1@o_link tt2; -- Allowed

select * from t1@o_link tt2 intersect select * from t1 tt1; -- Allowed
Enter fullscreen mode Exit fullscreen mode

Compatibility with Oracle/MySQL/Teradata Syntax

For Oracle, MySQL, and Teradata dialects and proprietary functions, support is not provided.

For heterogeneous data sources using Oracle:

  • With parameter _t_gcluster_dblink_clear_syntax_constraints = 2: the group_concat function is not supported in DBLink queries.
  • With parameter _t_gcluster_dblink_clear_syntax_constraints = 1: the group_concat function is supported in DBLink queries.

Metadata Compatibility

The following data types from Oracle/MySQL/Teradata are not supported in this release: large objects (e.g., BLOB, CLOB), binary, and long data types. Basic Oracle data types (character, numeric, date types) are supported.

  • GBase decimal type decimal(p, s) supports a precision (p) up to 65 digits and a scale (s) up to 30. For Oracle's number(p, s), when s exceeds 30, the DBLink gateway maps it to the GBase double type, which may cause precision loss since double is an approximate data type.
  • Since Oracle's date type can store hours, minutes, and seconds, it is mapped to GCluster's datetime type for heterogeneous data sources. When querying Oracle's date type through DBLink, the output includes time information. You can use the to_date function to format the output to exclude time.

Character Set

Supports Oracle/MySQL/Teradata sources in UTF8, GBK, and GB2312 character sets, with support for Chinese data sources.

Supported SQL Function Scenarios

The SQL functions supported in heterogeneous data sources align with those for homogeneous sources:

  • Supports SELECT statements querying DBLink tables.
  • Supports CREATE…SELECT…, where the SELECT part uses a DBLink query.
  • Supports INSERT…SELECT…, where the SELECT part uses a DBLink query.
  • Supports multi-table DELETE where the source part uses a DBLink query.
  • Supports using DBLink queries in stored procedures.
  • Supports PREPARE statements for preprocessing DBLink queries.

Example:

set @sql_str='select id2 from x1@gc_dblink where id2=1';
prepare stmt from @sql_str;
execute stmt;
deallocate prepare stmt;
Enter fullscreen mode Exit fullscreen mode

Unsupported SQL Function Scenarios

The following SQL functions are currently unsupported, similar to homogeneous data sources:

  • DDL operations on DBLink tables (e.g., DROP TABLE, ALTER TABLE).
  • Creating views with DBLink queries.
  • Using DBLink tables or queries as the source for UPDATE to update local tables.
  • Using MERGE statements where the USING source part includes DBLink queries.
  • Using DBLink queries in functions.

Examples:

1) DDL Operations on DBLink Tables Not Supported:
DDL operations like DROP TABLE and ALTER TABLE are not allowed on DBLink tables.

   drop table x1@gc_dblink;
   ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your GBase server version for the correct syntax to use near '@gc_dblink' at line 1
Enter fullscreen mode Exit fullscreen mode

2) Update/Delete/Insert/Merge Operations on DBLink Tables Not Supported:
Update, delete, insert, and merge operations are not supported on DBLink tables.

   update x1@gc_dblink set id2 =1;
   ERROR 1105 (HY000): DBLink-Table does not support update operation.

   delete from x1@gc_dblink;
   ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your GBase server version for the correct syntax to use near '@gc_dblink' at line 1
Enter fullscreen mode Exit fullscreen mode

3) Creating Views with DBLink Queries Not Supported:
Creating views using DBLink queries is unsupported.

   create view v1 as select * from t1@testlink;
   ERROR 1235 (42000): This version of GBase doesn't yet support 'use dblink table in a FUNCTION/TRIGGER/VIEW.'
Enter fullscreen mode Exit fullscreen mode

4) Using DBLink Tables or Queries as Update Sources for Local Table Updates Not Supported:
Updating a local table using a DBLink table or query as the source is not allowed.

   update t1, t1@o_link tt1 set t1.b = tt1.b where t1.a = tt1.a;

   update t1 join t1@_link tt1 on t1.a = tt1.a set t1.b = tt1.b;

   update t1 join (select a, b from t1@_link) tt1 on t1.a = tt1.a set t1.b = tt1.b;

   ERROR 1105 (HY000): DBLink-Table does not support update operation.
Enter fullscreen mode Exit fullscreen mode

5) Using DBLink Queries in the USING Clause of MERGE Statements Not Supported:
DBLink queries cannot be used in the USING clause of MERGE statements.

   merge into x1 tt1 using (select * from x1@olink) tt on (tt1.id2 = tt.id2) 
   when matched then update set tt1.id3 = tt.id3;

   ERROR 1105 (HY000): DBLink-Table does not support update operation.
Enter fullscreen mode Exit fullscreen mode

6) Using DBLink Queries in Functions Not Supported:
DBLink queries cannot be used in functions.

   delimiter //
   create function dfunc(id int) returns int
   begin
       declare fid int default 1;
       set fid = (select id2 from x1@olink where id2 = id limit 1);
       return fid;
   end //

   ERROR: This version of GBase doesn't yet support 'use dblink table in a FUNCTION/TRIGGER/VIEW.'
Enter fullscreen mode Exit fullscreen mode

Data Push and Passthrough Mode

Support is provided for insert…select statements where the target table is a DBLink remote table, enabling local data to be pushed to the remote database. When pushing local data to a remote Oracle table, it’s important to note that Oracle’s character type is byte-based, whereas GBase’s is character-based. Therefore, if the GBase source table and Oracle target table have a field with the same data type, such as char(255), data insertion may exceed limits when pushed to Oracle.

Passthrough mode is also supported. In this mode, GCluster skips SQL parsing for specified statements, forwarding the SQL directly to the remote database through the gateway. Using passthrough mode enables operations such as insert…values, delete, update, etc., on remote tables.

Data Push SQL Statement

The syntax is similar to the insert into…select… statement, where the target table can be a DBLink remote table. For example:

insert into t1@testlink select a, b from t1;
Enter fullscreen mode Exit fullscreen mode

You can specify target columns as well:

insert into t1@testlink(a, b) select a, b from t1;
Enter fullscreen mode Exit fullscreen mode

Prerequisites: The user configured in the gateway data source for the DBLink object must have insert permission on the target table. Only auto-commit mode is supported; distributed transactions are not supported. If GCluster's session state is set to non-auto-commit, an error will occur:

Can not join the distributed transaction in session
Enter fullscreen mode Exit fullscreen mode

The SQL statement should ensure atomicity, meaning all data is either successfully pushed to the remote or fails completely.

Note: Empty strings in GBase 8a MPP Cluster are stored as NULL in Oracle when pushed via DBLink. Oracle treats empty strings and NULL equivalently, so they can be queried with is null. GBase 8a MPP Cluster, however, differentiates between empty strings and NULL.

Passthrough Mode SQL Statement

The gateway forwards SQL directly to the remote database associated with the DBLink.

Syntax:

passthrough link DBLINK_NAME using SQL_STATEMENT;
Enter fullscreen mode Exit fullscreen mode

Parameters:

  • DBLINK_NAME: The name of the DBLink object.
  • SQL_STATEMENT: The SQL statement to be executed on the remote database.
  • Supported SQL Statements: Only specific types are supported. Other SQL types will result in an error. Supported types include:
    • insert into … values…
    • insert into …select …
    • delete
    • update
    • truncate
    • merge
    • create
    • drop

Examples:

passthrough link testlink using 'create table t1(a int, b int)';
passthrough link testlink using 'insert into t1 values(1,2)';
passthrough link testlink using 'update t1 set a=11 where a=1';
passthrough link testlink using 'delete from t1 where a=11';
passthrough link testlink using 'truncate table t1';
passthrough link testlink using 'drop table t1';
passthrough link testlink using 'select * from t2' -- Error: SQL command is not supported: 'select * from t2'
Enter fullscreen mode Exit fullscreen mode

Constraints and Limitations

  • The user configured in the gateway data source must have permissions to execute the specified SQL statements.
  • Only auto-commit mode is supported. If passthrough mode is executed in non-auto-commit mode, an error will occur:

    Can not join the distributed transaction in session
    
  • SQL statements should not include comments before the command.

DBLink Parameter Configurations

1) _t_gcluster_dblink_clear_syntax_constraints

  • Values: [0 | 1 | 2]
  • Default: 0
  • Description: SQL optimization for dblink.

    • Value 0: No optimization.
    • Values 1 and 2: The following dblink syntax constraints are no longer enforced, allowing automatic optimization of query syntax:
      • dblink tables are restricted from directly joining local tables, subqueries in FROM, or dblink tables with different origins.
      • For primary queries on dblink tables, subqueries (correlated, uncorrelated, scalar, FROM subqueries) are restricted from containing local or non-origin dblink tables. Heterogeneous database dblink tables can only appear in FROM subqueries.
    • Difference between 1 and 2:

      • When all tables involved in SQL are dblink tables of the same origin and are heterogeneous:
        • Value 2:
         SELECT ab FROM (SELECT a + b AS ab FROM t1@olink WHERE a > 1) opt_dblink_tmp;
      
      • Value 1:
         SELECT a + b AS ab FROM (SELECT a, b FROM t1@olink WHERE a > 1) t1;
      
      • Value 0: Error is thrown.
  • Modification: Can be changed using SET command or in the configuration file. Applicable to both session and global scope.

2) _t_gcluster_dblink_generate_interim_table_policy

  • Values: [0 | 1]
  • Default: 1
  • Description: Controls how the temporary table structure is generated for dblink pull-table steps in a cluster plan.
    • Value 0: Uses auto-assessment based on data types from projection expressions.
    • Value 1: Requests the gateway to generate the temporary table structure using CREATE ... SELECT ... LIMIT 0, which provides more accurate data type assessments.
  • Modification: Can be modified using SET or in the configuration file. Applicable to both session and global scope.

3) _t_gcluster_dblink_ignore_use_db

  • Values: [0 | 1]
  • Default: 1
  • Description: Determines whether to ignore USE DB commands in dblink connections.
    • Value 1: The execution side initializes a session based on dblink information without switching databases upon USE DB. Issues may arise when executing multiple dblink connections to different databases.
    • Value 0: The USE DB command is respected, and database switching occurs.

4) _t_gcluster_dblink_insert_select_optimization

  • Values: [0 | 1]
  • Default: 1
  • Description: Optimization for INSERT SELECT statements in dblink.
    • Value 1: Enabled, where query plans attempt to directly deliver the INSERT SELECT portion without creating a temporary table.
    • Value 0: Disabled, and temporary tables are created.
  • Modification: Can be changed using SET or in the configuration file. Applicable to both session and global scope.

5) gbase_dblink_gateway_ip

  • Values: IP
  • Default: None
  • Description: IP address of the gateway used by the dblink function.
  • Modification: Global parameter, set in the configuration file.

6) gbase_dblink_gateway_port

  • Values: PORT
  • Default: 0
  • Description: Port of the gateway used by the dblink function.
  • Modification: Global parameter, set in the configuration file.

7) gbase_dblink_standby_gateway_ip

  • Values: IP
  • Default: None
  • Description: IP address of the standby gateway for high availability.
  • Modification: Global parameter, set in the configuration file.

8) gbase_dblink_standby_gateway_port

  • Values: PORT
  • Default: None
  • Description: Port of the standby gateway for high availability.
  • Modification: Global parameter, set in the configuration file.

9) gcluster_dblink_direct_data_exchange

  • Values: [0 | 1]
  • Default: 1
  • Description: Data transfer method for the gateway. For GBase 8a clusters with significant version differences (incompatible SIS modules), set to 0.
    • Value 0: Converts SELECT results into INSERT VALUES for the target cluster; primarily used for heterogeneous environments.
    • Value 1: SIS mode.
  • Modification: Can be changed using SET or in the configuration file. Applicable to both session and global scope.

10) gcluster_dblink_orcl_case_sensitive

  • Values: [0 | 1]
  • Default: 0
  • Description: Case sensitivity control for table names.
    • Value 0: By default, Oracle object names are uppercase; table names are automatically converted to uppercase if not quoted.
    • Value 1: Case-sensitive; table names retain the case used in the SQL.
  • Modification: Can be changed using SET or in the configuration file. Applicable to both session and global scope.

For more information about GBase database (GBase数据库) or DBLINK, please refer to GBase documentations.

Top comments (0)