文档中心MogDBMogDB StackUqbar

文档:v2.0

支持的版本:

数据源(DSN)说明

Oracle

通常使用中,MTK配置文件中无需配置dsn键值,而是直接配置host,port,user,password键值即可。

但是如果需要从Oracle云上数据库(Oracle Cloud Autonomous Database)中进行数据迁移,也就是源数据库是位于Oracle Cloud中的Autonomous Database实例,则需要配置dsn,而其它参数可以留空。

具体操作参看Oracle官方文档 Connecting to an Autonomous Database

配置示例如下:

{
  "source": {
    "type": "oracle",
    "connect": {
      "version": "",
      "host": "",
      "user": "",
      "port": 0,
      "password": "",
      "dbName": "",
      "dsn": "connectString=db202009151510_high user=ADMIN password=your_admin_password"
    }
  }
}

or

{
  "source": {
    "type": "oracle",
    "connect": {
      "version": "",
      "host": "",
      "user": "ADMIN",
      "port": 0,
      "password": "your_admin_password",
      "dbName": "",
      "dsn": "connectString=db202009151510_high"
    }
  }
}

其中connectString指定的是 tnsnames.ora 文件中的 Oracle Net Service Name.

该 tnsnames.ora 文件需要按照Oracle Cloud的连接文档从Oracle Autonomous Database 实例相关页面中下载。

其它可参考文档:

Go DRiver for Oracle User Guide

Net Services Administrator's Guide

{
  "dsn": "user=system password=pwd connectString=\"(DESCRIPTION=(CONNECT_TIMEOUT = 5)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=mtk)))\" configDir= connectionClass=godror enableEvents=0 externalAuth=0 heterogeneousPool=0 libDir= newPassword= noTimezoneCheck=0 poolIncrement=0 poolMaxSessions=100 poolMinSessions=0 poolSessionMaxLifetime=0s poolSessionTimeout=0s poolWaitTimeout=0s prelim=0 standaloneConnection=1 sysasm=0 sysdba=0 sysoper=0 timezone="
}

openGauss/MogDB/postgres

{
  "dsn": "application_name=mtk_postgres connect_timeout=5 dbname=postgres host=127.0.0.1 min_read_buffer_size=8388608 password=pwd port=5434 sslmode=disable user=gaussdb"
}

MySQL

{
  "dsn": "root:pwd@tcp(127.0.0.1:3306)/mysql?loc=Local&multiStatements=true&timeout=30s&maxAllowedPacket=1073741824&charset=utf8mb4"
}

DB2

{
  "dsn": "ClientApplName=MTK;ConnectTimeout=5;DATABASE=testdb;HOSTNAME=127.0.0.1;PORT=50000;PWD=pwd;ProgramName=MTK;UID=db2inst1;XMLDeclaration=0"
}

SQLServer

{
  "dsn": "sqlserver://sa:pwd@127.0.0.1:1433?app+name=mtk&connection+timeout=0&database=testdb"
}
Copyright © 2011-2024 www.enmotech.com All rights reserved.