📣

TiDB Cloud Serverless 现已更名为
Starter
!此页面由 AI 自动翻译,英文原文请见
此处。

ticloud serverless export create

从 TiDB Cloud Serverless 集群导出数据:

ticloud serverless export create [flags]

示例

以交互模式从 TiDB Cloud Serverless 集群导出数据:

ticloud serverless export create

以非交互模式将 TiDB Cloud Serverless 集群的数据导出到本地文件:

ticloud serverless export create -c <cluster-id> --filter <database.table>

以非交互模式将 TiDB Cloud Serverless 集群的数据导出到 Amazon S3:

ticloud serverless export create -c <cluster-id> --s3.uri <uri> --s3.access-key-id <access-key-id> --s3.secret-access-key <secret-access-key> --filter <database.table>

以非交互模式将 TiDB Cloud Serverless 集群的数据导出到 Google Cloud Storage:

ticloud serverless export create -c <cluster-id> --gcs.uri <uri> --gcs.service-account-key <service-account-key> --filter <database.table>

以非交互模式将 TiDB Cloud Serverless 集群的数据导出到 Azure Blob Storage:

ticloud serverless export create -c <cluster-id> --azblob.uri <uri> --azblob.sas-token <sas-token> --filter <database.table>

以非交互模式将 TiDB Cloud Serverless 集群的数据导出到阿里云 OSS:

ticloud serverless export create -c <cluster-id> --oss.uri <uri> --oss.access-key-id <access-key-id> --oss.access-key-secret <access-key-secret> --filter <database.table>

以非交互模式将数据导出为 Parquet 文件并使用 SNAPPY 压缩:

ticloud serverless export create -c <cluster-id> --file-type parquet --parquet.compression SNAPPY --filter <database.table>

以非交互模式通过 SQL 语句导出数据:

ticloud serverless export create -c <cluster-id> --sql 'select * from database.table'

参数

在非交互模式下,你需要手动输入所需的参数。在交互模式下,你只需按照 CLI 提示填写即可。

参数描述是否必需备注
-c, --cluster-id string指定你要导出数据的集群 ID。仅在非交互模式下生效。
--file-type string指定导出文件类型。可选值为 ["SQL" "CSV" "PARQUET"]。(默认值为 "CSV")仅在非交互模式下生效。
--target-type string指定导出目标。可选值为 ["LOCAL" "S3" "GCS" "AZURE_BLOB" "OSS"]。默认值为 "LOCAL"仅在非交互模式下生效。
--s3.uri string指定 S3 URI,格式为 s3://<bucket>/<file-path>。当目标类型为 S3 时必填。仅在非交互模式下生效。
--s3.access-key-id string指定 Amazon S3 的访问密钥 ID。你只需设置 s3.role-arn 和 [s3.access-key-id, s3.secret-access-key] 其中之一。仅在非交互模式下生效。
--s3.secret-access-key string指定 Amazon S3 的访问密钥 Secret。你只需设置 s3.role-arn 和 [s3.access-key-id, s3.secret-access-key] 其中之一。仅在非交互模式下生效。
--s3.role-arn string指定 Amazon S3 的角色 ARN。你只需设置 s3.role-arn 和 [s3.access-key-id, s3.secret-access-key] 其中之一。仅在非交互模式下生效。
--gcs.uri string指定 GCS URI,格式为 gcs://<bucket>/<file-path>。当目标类型为 GCS 时必填。仅在非交互模式下生效。
--gcs.service-account-key string指定 GCS 的 base64 编码服务账号密钥。仅在非交互模式下生效。
--azblob.uri string指定 Azure Blob URI,格式为 azure://<account>.blob.core.windows.net/<container>/<file-path>。当目标类型为 AZURE_BLOB 时必填。仅在非交互模式下生效。
--azblob.sas-token string指定 Azure Blob 的 SAS token。仅在非交互模式下生效。
--oss.uri string指定阿里云 OSS URI,格式为 oss://<bucket>/<file-path>。当导出 target-type"OSS" 时必填。仅在非交互模式下生效。
--oss.access-key-id string指定访问阿里云 OSS 的 AccessKey ID。仅在非交互模式下生效。
--oss.access-key-secret string指定访问阿里云 OSS 的 AccessKey Secret。仅在非交互模式下生效。
--csv.delimiter string指定 CSV 文件中字符串类型变量的定界符。(默认值为 "\"")仅在非交互模式下生效。
--csv.null-value string指定 CSV 文件中 null 值的表示方式。(默认值为 "\N")仅在非交互模式下生效。
--csv.separator string指定 CSV 文件中每个值的分隔符。(默认值为 ",")仅在非交互模式下生效。
--csv.skip-header导出表的 CSV 文件时不包含表头。仅在非交互模式下生效。
--parquet.compression string指定 Parquet 的压缩算法。可选值为 ["GZIP" "SNAPPY" "ZSTD" "NONE"]。默认值为 "ZSTD"仅在非交互模式下生效。
--filter strings通过表过滤模式指定要导出的表。不要与 --sql 一起使用。更多信息参见 Table Filter仅在非交互模式下生效。
--sql string通过 SQL SELECT 语句过滤导出数据。仅在非交互模式下生效。
--where string通过 WHERE 条件过滤导出表。不要与 --sql 一起使用。仅在非交互模式下生效。
--compression string指定导出文件的压缩算法。支持的算法包括 GZIPSNAPPYZSTDNONE。默认值为 GZIP仅在非交互模式下生效。
--force无需确认直接创建导出任务。当你在非交互模式下导出整个集群时需要确认。仅在非交互模式下生效。
-h, --help显示该命令的帮助信息。在非交互和交互模式下均可用。

继承参数

参数描述是否必需备注
--no-color禁用输出中的颜色。仅在非交互模式下生效。在交互模式下,禁用颜色可能会影响部分 UI 组件的显示。
-P, --profile string指定该命令使用的活动 用户配置文件在非交互和交互模式下均可用。
-D, --debug启用调试模式。在非交互和交互模式下均可用。

反馈

如果你对 TiDB Cloud CLI 有任何问题或建议,欢迎创建 issue。我们也欢迎任何贡献。

文档内容是否有帮助?