1

我必须尝试使用/load_jobs​​ API 调用将数据从 IBM Cloud Object Storage (Softlayer) 加载到 DB2 WoC(以前称为 dashDB)。

总是得到错误响应:SQL3025N,A parameter specifying a filename or path is not valid.,0,n/a

尝试不同的键格式path,如下所示: us-south/woctestdata/data_example.csv /woctestdata/data_example.csv woctestdata/data_example.csv woctestdata::data_example.csv

还尝试从评论中获得建议: us-south::woctestdata\data_example.csv us-south::woctestdata::data_example.csv

所以没有更多的想法。应该如何正确输入路径?

有我的请求的例子:

curl -X POST \
  https://dashdb-mpp.services.dal.bluemix.net/dashdb-api/v2/load_jobs \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
    "load_source": "SOFTLAYER",
    "load_action": "INSERT",
    "schema": "MKT_ATBTN",
    "table": "TRANSMISSIN_TABLE1",
    "max_row_count": 0,
    "max_warning_count": 0,
    "cloud_source": {
      "endpoint": "https://tor01.objectstorage.softlayer.net/auth/v1.0",
      "path": "woctestdata/data_example.csv",
      "auth_id": "<auth_id>",
      "auth_secret": "<auth_secret>"
    },
    "server_source": {
      "file_path": "string"
    },
    "stream_source": {
      "file_name": "string"
    },
    "file_options": {
      "code_page": "1208",
      "column_delimiter": ";",
      "string_delimiter": "",
      "date_format": "YYYY-MM-DD",
      "time_format": "HH:MM:SS",
      "timestamp_format": "YYYY-MM-DD HH:MM:SS",
      "cde_analyze_frequency": 0
    }
  }'

我还尝试使用 db2 load 命令从 IBM Cloud 对象存储中加载数据。但也没有运气:

db2 load from Softlayer::https://tor01.objectstorage.softlayer.net/auth/v1.0::IBM:<ibm_email_address>::<password>::woctestdata::data_example.csv of del insert into MKT_ATBTN.TRANSMISSIN_TABLE1;

结果:

      Agent Type     Node     SQL Code     Result
_______________________________________________________________________
  PRE_PARTITION  000      -00003025    Error.
_______________________________________________________________________
  RESULTS:       0 of 0 LOADs completed successfully.
_______________________________________________________________________

Summary of LOAD Agents:
Number of rows read         = 0
Number of rows skipped      = 0
Number of rows loaded       = 0
Number of rows rejected     = 0
Number of rows deleted      = 0
Number of rows committed    = 0

SQL3025N  A parameter specifying a filename or path is not valid.
4

1 回答 1

0

要下载或访问该文件,您需要获取X-Auth-Token或通过网页将其容器设置为静态 URL。

X-Auth-Token

我建议查看管理对象存储softlayer-object-storage-auth-endpoint

当你运行命令时

curl -i -H "X-Auth-User: SLOS300001-10:rcuellar" -H "X-Auth-Key: 231222489e90646678364kjsdfhytwterd0259" https://tor01.objectstorage.softlayer.net/auth/v1.0

响应是这样的:

X-Auth-Token: AUTH_tkb26239d441d6401d9482b004d45f7259 – the token we need
X-Storage-Url: https://tor01.objectstorage.softlayer.net/v1/AUTH_df0de35c-d00a-40aa-b697-2b7f1b9331a6

现在您应该能够使用类似如下的 URL 访问该文件:

https://tor01.objectstorage.softlayer.net/v1/AUTH_df0de35c-d00a-40aa-b697-2b7f1b9331a6/woctestdata/data_example.csv

通过网页的静态 URL

在门户页面中转到:

存储>>对象存储>>选择对象存储>>选择集群(例如多伦多)>>选择您的容器

并选中启用静态站点复选框,见下图。

在此处输入图像描述

于 2018-04-18T23:03:24.387 回答