本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
以下代码示例向您展示了如何使用with来执行操作和实现常见场景 AWS DMS。 AWS Command Line Interface
操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景的上下文查看操作。
每个示例都包含一个指向完整源代码的链接,您可以在其中找到有关如何在上下文中设置和运行代码的说明。
主题
操作
以下代码示例显示了如何使用add-tags-to-resource
。
- AWS CLI
-
为资源添加标签
以下
add-tags-to-resource
示例为复制实例添加标签。aws dms add-tags-to-resource \ --resource-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
\ --tagsKey=Environment,Value=PROD
Key=Project,Value=dbMigration
此命令不生成任何输出。
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的标记资源。
-
有关API详细信息,请参阅 “AddTagsToResource AWS CLI
命令参考”。
-
以下代码示例显示了如何使用create-endpoint
。
- AWS CLI
-
创建终端节点
以下
create-endpoint
示例为 Amazon S3 源创建了一个终端节点。aws dms create-endpoint \ --endpoint-type
source
\ --engine-names3
\ --endpoint-identifiersrc-endpoint
\ --s3-settingsfile://s3-settings.json
s3-settings.json
的内容:{ "BucketName":"my-corp-data", "BucketFolder":"sourcedata", "ServiceAccessRoleArn":"arn:aws:iam::123456789012:role/my-s3-access-role" }
输出:
{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "bucketFolder=sourcedata;bucketName=my-corp-data;compressionType=NONE;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "sourcedata", "BucketName": "my-corp-data", "CompressionType": "NONE", "EnableStatistics": true } } }
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的使用 AWS DMS端点。
-
有关API详细信息,请参阅 “CreateEndpoint AWS CLI
命令参考”。
-
以下代码示例显示了如何使用create-event-subscription
。
- AWS CLI
-
列出活动订阅
以下
create-event-subscription
示例创建了对 Amazon SNS 主题的事件订阅 (my-sns-topic)。aws dms create-event-subscription \ --subscription-name
my-dms-events
\ --sns-topic-arnarn:aws:sns:us-east-1:123456789012:my-sns-topic
输出:
{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "creating", "SubscriptionCreationTime": "2020-05-21 21:58:38.598", "Enabled": true } }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “CreateEventSubscription AWS CLI
命令参考”。
-
以下代码示例显示了如何使用create-replication-instance
。
- AWS CLI
-
创建复制实例
以下
create-replication-instance
示例创建了一个复制实例。aws dms create-replication-instance \ --replication-instance-identifier
my-repl-instance
\ --replication-instance-classdms.t2.micro
\ --allocated-storage5
输出:
{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "creating", "AllocatedStorage": 5, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "sat:12:35-sat:13:05", "PendingModifiedValues": {}, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:ZK2VQBUWFDBAWHIXHAYG5G2PKY", "PubliclyAccessible": true } }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “CreateReplicationInstance AWS CLI
命令参考”。
-
以下代码示例显示了如何使用create-replication-subnet-group
。
- AWS CLI
-
创建子网组
以下
create-replication-subnet-group
示例创建了一个由 3 个子网组成的组。aws dms create-replication-subnet-group \ --replication-subnet-group-identifier
my-subnet-group
\ --replication-subnet-group-description"my subnet group"
\ --subnet-idssubnet-da327bf6
subnet-bac383e0
subnet-d7c825e8
输出:
{ "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" } ] } }
有关更多信息,请参阅 Dat AWS abase Migration Service 用户指南中的为复制实例设置网络。
-
有关API详细信息,请参阅 “CreateReplicationSubnetGroup AWS CLI
命令参考”。
-
以下代码示例显示了如何使用create-replication-task
。
- AWS CLI
-
创建复制任务
以下
create-replication-task
示例创建了一个复制任务。aws dms create-replication-task \ --replication-task-identifier
movedata
\ --source-endpoint-arnarn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA
\ --target-endpoint-arnarn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U
\ --replication-instance-arn$RI_ARN
\ --migration-typefull-load
\ --table-mappingsfile://table-mappings.json
table-mappings.json
的内容:{ "rules": [ { "rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "prodrep", "table-name": "%" }, "rule-action": "include", "filters": [] } ] }
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "creating", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “CreateReplicationTask AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-connection
。
- AWS CLI
-
删除连接
以下
delete-connection
示例取消终端节点与复制实例的关联。aws dms delete-connection \ --endpoint-arn
arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA
\ --replication-instance-arnarn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
输出:
{ "Connection": { "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "Status": "deleting", "EndpointIdentifier": "src-database-1", "ReplicationInstanceIdentifier": "my-repl-instance" } }
有关更多信息,请参阅《数据库AWS 迁移服务用户指南》https://docs.aws.amazon.com/dms/latest/userguide/CHAP中的 _endpoints.creat ing.html。
-
有关API详细信息,请参阅 “DeleteConnection AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-endpoint
。
- AWS CLI
-
删除终端节点
以下
delete-endpoint
示例删除终端节点。aws dms delete-endpoint \ --endpoint-arn
arn:aws:dms:us-east-1:123456789012:endpoint:OUJJVXO4XZ4CYTSEG5XGMN2R3Y
输出:
{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "bucketFolder=sourcedata;bucketName=my-corp-data;compressionType=NONE;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "deleting", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:OUJJVXO4XZ4CYTSEG5XGMN2R3Y", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "sourcedata", "BucketName": "my-corp-data", "CompressionType": "NONE", "EnableStatistics": true } } }
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的使用 AWS DMS端点。
-
有关API详细信息,请参阅 “DeleteEndpoint AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-event-subscription
。
- AWS CLI
-
删除活动订阅
以下
delete-event-subscription
示例删除了对 Amazon SNS 主题的订阅。aws dms delete-event-subscription \ --subscription-name
"my-dms-events"
输出:
{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "deleting", "SubscriptionCreationTime": "2020-05-21 21:58:38.598", "Enabled": true } }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “DeleteEventSubscription AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-replication-instance
。
- AWS CLI
-
删除复制实例
以下
delete-replication-instance
示例删除复制实例。aws dms delete-replication-instance \ --replication-instance-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
输出:
{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "deleting", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "AvailabilityZone": "us-east-1e", "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "wed:11:42-wed:12:12", "PendingModifiedValues": {}, "MultiAZ": true, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "ReplicationInstancePublicIpAddress": "54.225.120.92", "ReplicationInstancePrivateIpAddress": "172.31.30.121", "ReplicationInstancePublicIpAddresses": [ "54.225.120.92", "3.230.18.248" ], "ReplicationInstancePrivateIpAddresses": [ "172.31.30.121", "172.31.75.90" ], "PubliclyAccessible": true, "SecondaryAvailabilityZone": "us-east-1b" } }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “DeleteReplicationInstance AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-replication-subnet-group
。
- AWS CLI
-
删除子网组
以下
delete-replication-subnet-group
示例删除子网组。aws dms delete-replication-subnet-group \ --replication-subnet-group-identifier
my-subnet-group
输出:
(none)
有关更多信息,请参阅 Dat AWS abase Migration Service 用户指南中的为复制实例设置网络。
-
有关API详细信息,请参阅 “DeleteReplicationSubnetGroup AWS CLI
命令参考”。
-
以下代码示例显示了如何使用delete-replication-task
。
- AWS CLI
-
删除复制任务
以下
delete-replication-task
示例删除了复制任务。aws dms delete-replication-task \ --replication-task-arn
arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "deleting", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789988.677, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “DeleteReplicationTask AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-account-attributes
。
- AWS CLI
-
描述账户属性
以下
describe-account-attributes
示例列出了您的 AWS 账户的属性。aws dms describe-account-attributes
输出:
{ "AccountQuotas": [ { "AccountQuotaName": "ReplicationInstances", "Used": 1, "Max": 20 }, { "AccountQuotaName": "AllocatedStorage", "Used": 5, "Max": 10000 }, ...remaining output omitted... ], "UniqueAccountIdentifier": "cqahfbfy5xee" }
-
有关API详细信息,请参阅 “DescribeAccountAttributes AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-certificates
。
- AWS CLI
-
列出可用证书
以下
describe-certificates
示例列出了您 AWS 账户中的可用证书。aws dms describe-certificates
输出:
{ "Certificates": [ { "CertificateIdentifier": "my-cert", "CertificateCreationDate": 1543259542.506, "CertificatePem": "-----BEGIN CERTIFICATE-----\nMIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQ ...U" ... remaining output omittted ... } ] }
有关更多信息,请参阅 AWS Database Migration Service 用户指南SSL中的使用。
-
有关API详细信息,请参阅 “DescribeCertificates AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-connections
。
- AWS CLI
-
描述连接
以下
describe-connections
示例列出了您在复制实例和终端节点之间测试的连接。aws dms describe-connections
输出:
{ "Connections": [ { "Status": "successful", "ReplicationInstanceIdentifier": "test", "EndpointArn": "arn:aws:dms:us-east-arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE", "EndpointIdentifier": "testsrc1", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ" } ] }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的创建源端点和目标端点。
-
有关API详细信息,请参阅 “DescribeConnections AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-endpoint-types
。
- AWS CLI
-
列出可用的端点类型
以下
describe-endpoint-types
示例列出了可用的我的SQL终端节点类型。aws dms describe-endpoint-types \ --filters
"Name=engine-name,Values=mysql"
输出:
{ "SupportedEndpointTypes": [ { "EngineName": "mysql", "SupportsCDC": true, "EndpointType": "source", "EngineDisplayName": "MySQL" }, { "EngineName": "mysql", "SupportsCDC": true, "EndpointType": "target", "EngineDisplayName": "MySQL" } ] }
有关更多信息,请参阅《数据库迁移服务用户指南》中的使用 AWS DMS端点 < https://docs.aws.amazon.com/dms/ latest/userguide/CHAP _endpoints.html>`__。AWS
-
有关API详细信息,请参阅 “DescribeEndpointTypes AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-endpoints
。
- AWS CLI
-
描述端点
以下
describe-endpoints
示例列出了您 AWS 账户中的终端节点。aws dms describe-endpoints
输出:
{ "Endpoints": [ { "Username": "dms", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:SF2WOFLWYWKVEOHID2EKLP3SJI", "ServerName": "ec2-52-32-48-61.us-west-2.compute.amazonaws.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/94d5c4e7-4e4c-44be-b58a-c8da7adf57cd", "DatabaseName": "test", "EngineName": "mysql", "EndpointIdentifier": "pri100", "Port": 8193 }, { "Username": "admin", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:TJJZCIH3CJ24TJRU4VC32WEWFR", "ServerName": "test.example.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/2431021b-1cf2-a2d4-77b2-59a9e4bce323", "DatabaseName": "EMPL", "EngineName": "oracle", "EndpointIdentifier": "test", "Port": 1521 } ] }
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的使用 AWS DMS端点。
-
有关API详细信息,请参阅 “DescribeEndpoints AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-event-categories
。
- AWS CLI
-
描述事件类别
以下
describe-event-categories
示例列出了可用的事件类别。aws dms describe-event-categories
输出:
{ "EventCategoryGroupList": [ { "SourceType": "replication-instance", "EventCategories": [ "low storage", "configuration change", "maintenance", "deletion", "creation", "failover", "failure" ] }, { "SourceType": "replication-task", "EventCategories": [ "configuration change", "state change", "deletion", "creation", "failure" ] } ] }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “DescribeEventCategories AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-event-subscriptions
。
- AWS CLI
-
描述活动订阅
以下
describe-event-subscriptions
示例列出了对 Amazon SNS 主题的事件订阅。aws dms describe-event-subscriptions
输出:
{ "EventSubscriptionsList": [ { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "deleting", "SubscriptionCreationTime": "2020-05-21 22:28:51.924", "Enabled": true } ] }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “DescribeEventSubscriptions AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-events
。
- AWS CLI
-
列出DMS事件
以下
describe-events
示例列出了源自复制实例的事件。aws dms describe-events \ --source-type
"replication-instance"
输出:
{ "Events": [ { "SourceIdentifier": "my-repl-instance", "SourceType": "replication-instance", "Message": "Replication application shutdown", "EventCategories": [], "Date": 1590771645.776 } ] }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “DescribeEvents AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-orderable-replication-instances
。
- AWS CLI
-
描述可订购的复制实例
以下
describe-orderable-replication-instances
示例列出了您可以订购的复制实例类型。aws dms describe-orderable-replication-instances
输出:
{ "OrderableReplicationInstances": [ { "EngineVersion": "3.3.2", "ReplicationInstanceClass": "dms.c4.2xlarge", "StorageType": "gp2", "MinAllocatedStorage": 5, "MaxAllocatedStorage": 6144, "DefaultAllocatedStorage": 100, "IncludedAllocatedStorage": 100, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ] }, { "EngineVersion": "3.3.2", "ReplicationInstanceClass": "dms.c4.4xlarge", "StorageType": "gp2", "MinAllocatedStorage": 5, "MaxAllocatedStorage": 6144, "DefaultAllocatedStorage": 100, "IncludedAllocatedStorage": 100, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ] }, ...remaining output omitted... }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “DescribeOrderableReplicationInstances AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-refresh-schemas-status
。
- AWS CLI
-
列出终端节点的刷新状态
以下
describe-refresh-schemas-status
示例返回先前刷新请求的状态。aws dms describe-refresh-schemas-status \ --endpoint-arn
arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA
输出:
{ "RefreshSchemasStatus": { "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "Status": "successful", "LastRefreshDate": 1590786544.605 } }
-
有关API详细信息,请参阅 “DescribeRefreshSchemasStatus AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-replication-instances
。
- AWS CLI
-
描述复制实例
以下
describe-replication-instances
示例列出了您 AWS 账户中的复制实例。aws dms describe-replication-instances
输出:
{ "ReplicationInstances": [ { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "available", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "AvailabilityZone": "us-east-1e", "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "wed:11:42-wed:12:12", "PendingModifiedValues": { "MultiAZ": true }, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "ReplicationInstancePublicIpAddress": "3.230.18.248", "ReplicationInstancePrivateIpAddress": "172.31.75.90", "ReplicationInstancePublicIpAddresses": [ "3.230.18.248" ], "ReplicationInstancePrivateIpAddresses": [ "172.31.75.90" ], "PubliclyAccessible": true, "FreeUntil": 1590194829.267 } ] }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “DescribeReplicationInstances AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-replication-subnet-groups
。
- AWS CLI
-
显示可用的子网组
以下
describe-replication-subnet-groups
示例列出了可用的子网组。aws dms describe-replication-subnet-groups \ --filter
"Name=replication-subnet-group-id,Values=my-subnet-group"
输出:
{ "ReplicationSubnetGroups": [ { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" } ] } ] }
有关更多信息,请参阅 Dat AWS abase Migration Service 用户指南中的为复制实例设置网络。
-
有关API详细信息,请参阅 “DescribeReplicationSubnetGroups AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-replication-task-assessment-results
。
- AWS CLI
-
列出复制任务评估的结果
以下
describe-replication-task-assessment-results
示例列出了先前任务评估的结果。aws dms describe-replication-task-assessment-results
输出:
{ "ReplicationTaskAssessmentResults": [ { "ReplicationTaskIdentifier": "moveit2", "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII", "ReplicationTaskLastAssessmentDate": 1590790230.0, "AssessmentStatus": "No issues found", "AssessmentResultsFile": "moveit2/2020-05-29-22-10" } ] }
有关更多信息,请参阅《D AWS atabase Migration Service 用户指南》中的创建任务评估报告。
-
有关API详细信息,请参阅 “DescribeReplicationTaskAssessmentResults AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-replication-tasks
。
- AWS CLI
-
描述复制任务
以下
describe-replication-tasks
示例描述了当前的复制任务。aws dms describe-replication-tasks
输出:
{ "ReplicationTasks": [ { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "stopped", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590619805.212, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII", "ReplicationTaskStats": { "FullLoadProgressPercent": 100, "ElapsedTimeMillis": 0, "TablesLoaded": 0, "TablesLoading": 0, "TablesQueued": 0, "TablesErrored": 0, "FreshStartDate": 1590619811.528, "StartDate": 1590619811.528, "StopDate": 1590619842.068 } } ] }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “DescribeReplicationTasks AWS CLI
命令参考”。
-
以下代码示例显示了如何使用describe-schemas
。
- AWS CLI
-
描述数据库架构
以下
describe-schemas
示例列出了终端节点上的可用表。aws dms describe-schemas \ --endpoint-arn
"arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA"
输出:
{ "Schemas": [ "prodrep" ] }
有关更多信息,请参阅《D AWS atabase Migration Service 用户指南》中的主题标题
。 -
有关API详细信息,请参阅 “DescribeSchemas AWS CLI
命令参考”。
-
以下代码示例显示了如何使用list-tags-for-resource
。
- AWS CLI
-
列出资源的标签
以下
list-tags-for-resource
示例列出了复制实例的标签。aws dms list-tags-for-resource \ --resource-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
输出:
{ "TagList": [ { "Key": "Project", "Value": "dbMigration" }, { "Key": "Environment", "Value": "PROD" } ] }
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的标记资源。
-
有关API详细信息,请参阅 “ListTagsForResource AWS CLI
命令参考”。
-
以下代码示例显示了如何使用modify-endpoint
。
- AWS CLI
-
修改终端节点
以下
modify-endpoint
示例向终端节点添加了额外的连接属性。aws dms modify-endpoint \ --endpoint-arn
"arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U"
\ --extra-connection-attributes"compressionType=GZIP"
输出:
{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "compressionType=GZIP;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "", "BucketName": "", "CompressionType": "GZIP", "EnableStatistics": true } } }
有关更多信息,请参阅《数据库迁移服务用户指南》中的使用 AWS DMS端点 < https://docs.aws.amazon.com/dms/ latest/userguide/CHAP _endpoints.html>`__。AWS
-
有关API详细信息,请参阅 “ModifyEndpoint AWS CLI
命令参考”。
-
以下代码示例显示了如何使用modify-event-subscription
。
- AWS CLI
-
修改活动订阅
以下
modify-event-subscription
示例更改了事件订阅的来源类型。aws dms modify-event-subscription \ --subscription-name
"my-dms-events"
\ --source-typereplication-task
输出:
{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "modifying", "SubscriptionCreationTime": "2020-05-29 17:04:40.262", "SourceType": "replication-task", "Enabled": true } }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的处理事件和通知。
-
有关API详细信息,请参阅 “ModifyEventSubscription AWS CLI
命令参考”。
-
以下代码示例显示了如何使用modify-replication-instance
。
- AWS CLI
-
修改复制实例
以下
modify-replication-instance
示例修改复制实例,使其使用多可用区部署。aws dms modify-replication-instance \ --replication-instance-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
\ --multi-az输出:
{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "available", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, ...output omitted... "PendingModifiedValues": { "MultiAZ": true }, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", ...output omitted... } }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “ModifyReplicationInstance AWS CLI
命令参考”。
-
以下代码示例显示了如何使用modify-replication-subnet-group
。
- AWS CLI
-
修改子网组
以下
modify-replication-subnet-group
示例更改了与子网组关联的子网列表。aws dms modify-replication-subnet-group \ --replication-subnet-group-identifier
my-subnet-group
\ --subnet-idsubnet-da327bf6
subnet-bac383e0
输出:
{ "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" } ] } }
有关更多信息,请参阅《Dat AWS abase Migration Service 用户指南》中的为复制实例设置网络。
-
有关API详细信息,请参阅 “ModifyReplicationSubnetGroup AWS CLI
命令参考”。
-
以下代码示例显示了如何使用modify-replication-task
。
- AWS CLI
-
修改复制任务
以下
modify-replication-task
示例更改了任务的表映射。aws dms modify-replication-task \ --replication-task-arn
"arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII"
\ --table-mappingsfile://table-mappings.json
table-mappings.json
的内容:{ "rules": [ { "rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "prodrep", "table-name": "ACCT_%" }, "rule-action": "include", "filters": [] } ] }
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "modifying", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789424.653, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “ModifyReplicationTask AWS CLI
命令参考”。
-
以下代码示例显示了如何使用reboot-replication-instance
。
- AWS CLI
-
重启复制实例
以下
reboot-replication-instance
示例重启复制实例。aws dms reboot-replication-instance \ --replication-instance-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
输出:
{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "rebooting", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, ... output omitted ... } }
有关更多信息,请参阅 Dat AWS abase Migr AWS DMS ation Service 用户指南中的使用复制实例。
-
有关API详细信息,请参阅 “RebootReplicationInstance AWS CLI
命令参考”。
-
以下代码示例显示了如何使用refresh-schemas
。
- AWS CLI
-
刷新数据库架构
以下
refresh-schemas
示例请求 AWS DMS刷新终端节点上的架构列表。aws dms refresh-schemas \ --replication-instance-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
\ --endpoint-arn"arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA"
输出:
{ "RefreshSchemasStatus": { "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "Status": "refreshing", "LastRefreshDate": 1590019949.103 } }
-
有关API详细信息,请参阅 “RefreshSchemas AWS CLI
命令参考”。
-
以下代码示例显示了如何使用reload-tables
。
- AWS CLI
-
刷新终端节点上可用表的列表
以下
reload-tables
示例重新加载终端节点上的可用表列表。aws dms reload-tables \ --replication-task-arn
"arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII"
\ --tables-to-reload"SchemaName=prodrep,TableName=ACCT_BAL"
输出:
{ "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" }
-
有关API详细信息,请参阅 “ReloadTables AWS CLI
命令参考”。
-
以下代码示例显示了如何使用remove-tags-from-resource
。
- AWS CLI
-
从复制实例中移除标签
以下
remove-tags-from-resource
示例从复制实例中删除标签。aws dms remove-tags-from-resource \ --resource-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
\ --tag-keysEnvironment
Project
此命令不生成任何输出。
有关更多信息,请参阅 AWS Database Migration Service 用户指南中的标记资源。
-
有关API详细信息,请参阅 “RemoveTagsFromResource AWS CLI
命令参考”。
-
以下代码示例显示了如何使用start-replication-task-assessment
。
- AWS CLI
-
开始任务评估
以下
start-replication-task-assessment
示例启动复制任务评估。aws dms start-replication-task-assessment \ --replication-task-arn
arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "testing", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789988.677, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《D AWS atabase Migration Service 用户指南》中的创建任务评估报告。
-
有关API详细信息,请参阅 “StartReplicationTaskAssessment AWS CLI
命令参考”。
-
以下代码示例显示了如何使用start-replication-task
。
- AWS CLI
-
启动复制任务
以下
command-name
示例列出了您 AWS 账户中可用的微件。aws dms start-replication-task \ --replication-task-arn
arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII
\ --start-replication-task-typereload-target
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "starting", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590619805.212, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “StartReplicationTask AWS CLI
命令参考”。
-
以下代码示例显示了如何使用stop-replication-task
。
- AWS CLI
-
停止任务
以下
stop-replication-task
示例停止任务。aws dms stop-replication-task \ --replication-task-arn
arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII
输出:
{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "stopping", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789424.653, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }
有关更多信息,请参阅《AWS Database Migration Service 用户指南》中的 AWS DMS处理任务。
-
有关API详细信息,请参阅 “StopReplicationTask AWS CLI
命令参考”。
-
以下代码示例显示了如何使用test-connection
。
- AWS CLI
-
测试与端点的连接
以下
test-connection
示例测试是否可以从复制实例访问终端节点。aws dms test-connection \ --replication-instance-arn
arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE
\ --endpoint-arnarn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA
输出:
{ "Connection": { "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "Status": "testing", "EndpointIdentifier": "src-database-1", "ReplicationInstanceIdentifier": "my-repl-instance" } }
有关更多信息,请参阅 D AWS atabase Migration Service 用户指南中的创建源端点和目标端点。
-
有关API详细信息,请参阅 “TestConnection AWS CLI
命令参考”。
-