這個服務帳戶會專門指派給目的地 Cloud SQL for SQL Server 執行個體,目的地執行個體建立後即會建立。您可以在 Cloud SQL 執行個體詳細資料頁面,查看與這個服務帳戶相關聯的電子郵件地址。請參閱 Cloud SQL for SQL Server 說明文件中的「
查看執行個體資訊」一文。
資料遷移程序中涉及的每個帳戶都需要不同的角色和權限。
權限與角色
如要取得使用資料庫遷移服務執行同類 SQL Server 遷移作業所需的權限,請管理員為下列帳戶授予專案的必要 IAM 角色:
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eThis document outlines the necessary Identity and Access Management (IAM) roles for users and service accounts involved in homogeneous Cloud SQL migrations using Database Migration Service.\u003c/p\u003e\n"],["\u003cp\u003eThere are three types of accounts involved in the migration process: the user account performing the migration, the Database Migration Service service account, and the Cloud SQL instance service account.\u003c/p\u003e\n"],["\u003cp\u003eEach account involved in the migration requires distinct IAM roles, such as Database Migration Admin, Storage Admin, Cloud SQL Editor, Cloud SQL Studio User, and Storage Object Viewer.\u003c/p\u003e\n"],["\u003cp\u003eSpecific permissions, like \u003ccode\u003edatamigration.*\u003c/code\u003e, \u003ccode\u003ecloudsql.instances.create\u003c/code\u003e, and \u003ccode\u003estorage.objects.list\u003c/code\u003e, are necessary for each account type to carry out the migration successfully.\u003c/p\u003e\n"],["\u003cp\u003eYou can also create custom roles or use other predefined roles to carry out the same permissions.\u003c/p\u003e\n"]]],[],null,["# Access control with IAM\n\nTo limit access for users within a project or organization, you can use\nIdentity and Access Management (IAM) roles for Database Migration Service and your relevant\ndestination database product. You can control\naccess to Database Migration Service-related resources, as opposed to granting users\nthe Viewer, Editor, or Owner role to the entire Google Cloud project.\n\nThis page focuses details all of the roles that user and service accounts need\nduring a homogeneous Cloud SQL migration with Database Migration Service.\nFor more information about when you use these permissions during the migration process, see\n[Migrate your SQL Server databases to Cloud SQL for SQL Server](/database-migration/docs/sqlserver/guide).\n\nAccounts involved in performing migration jobs\n----------------------------------------------\n\nThere are three accounts involved in data migrations performed with\nDatabase Migration Service:\n\nUser account that performs the migration\n: This is the\n [Google Account](/iam/docs/overview#google_account) that you sign in with to create the connection profiles,\n upload the backup files to the Cloud Storage storage, create and run the migration\n job.\n\nDatabase Migration Service service account\n: This is the service account that is created for you when you enable the\n Database Migration Service API. The email address associated with this account is generated\n automatically and can't be changed. This email address uses the following\n format: \n\n ```\n service-PROJECT_NUMBER@gcp-sa-datamigration.iam.gserviceaccount.com\n ```\n\nCloud SQL instance service account\n: This is a service account assigned specifically to your destination\n Cloud SQL for SQL Server instance. It is created after you create the destination\n instance. You can view the email address associated with this service account\n on the Cloud SQL instance detail page.\n See [View instance information](/sql/docs/sqlserver/instance-info#service_account) in the Cloud SQL for SQL Server documentation.\n\nEach account involved in the data migration process requires a different\nset of roles and permissions.\n\nPermissions and roles\n---------------------\n\nTo get the permissions that you need to perform homogeneous SQL Server\nmigrations with Database Migration Service, ask your administrator to grant the\nrequired IAM roles on your project for the following accounts:\n\n- User account that performs the migration:\n - [Database Migration Admin](/iam/docs/roles-permissions/datamigration#datamigration.admin) (`roles/datamigration.admin`)\n - [Storage Admin](/iam/docs/roles-permissions/storage#storage.admin) (`roles/storage.admin`)\n - [Cloud SQL Editor](/iam/docs/roles-permissions/cloudsql#cloudsql.editor) (`roles/cloudsql.editor`)\n- Database Migration Service service account:\n - [Database Migration Admin](/iam/docs/roles-permissions/datamigration#datamigration.admin) (`roles/datamigration.admin`)\n - [Storage Admin](/iam/docs/roles-permissions/storage#storage.admin) (`roles/storage.admin`)\n - [Cloud SQL Editor](/iam/docs/roles-permissions/cloudsql#cloudsql.editor) (`roles/cloudsql.editor`)\n - [Cloud SQL Studio User](/iam/docs/roles-permissions/cloudsql#cloudsql.studioUser) (`roles/cloudsql.studioUser`)\n- Cloud SQL instance service account: [Storage Object Viewer](/iam/docs/roles-permissions/storage#storage.objectViewer) (`roles/storage.objectViewer`)\n\nFor more information about granting roles, see\n[Manage access](/iam/docs/granting-changing-revoking-access).\n\nThese predefined roles contain the permissions required to perform homogeneous\nSQL Server migrations with Database Migration Service. To see the exact permissions\nthat are required, expand the **Required permissions** section: \n\n#### Required permissions\n\nThe following permissions are required to perform homogeneous SQL Server\nmigrations with Database Migration Service:\n\n- User account that performs the migration:\n - `datamigration.* `\n - `resourcemanager.projects.get`\n - `resourcemanager.projects.list`\n - `cloudsql.operations.get`\n - `cloudsql.instances.create`\n - `cloudsql.instances.get`\n - `cloudsql.instances.list`\n - `cloudsql.instances.import`\n - `cloudsql.databases.get`\n - `cloudsql.databases.list`\n - `cloudsql.databases.delete`\n - `compute.machineTypes.list`\n - `compute.machineTypes.get`\n - `compute.projects.get`\n - `storage.buckets.create`\n - `storage.buckets.list`\n- Database Migration Service service account:\n - `datamigration.* `\n - `resourcemanager.projects.get`\n - `resourcemanager.projects.list`\n - `cloudsql.instances.create`\n - `cloudsql.instances.get`\n - `cloudsql.instances.list`\n - `cloudsql.instances.executeSql`\n - `storage.objects.create`\n - `storage.objects.list`\n- Cloud SQL instance service account:\n - `storage.objects.list`\n - `storage.objects.get`\n\nYou might also be able to get these permissions with\n[custom roles](/iam/docs/creating-custom-roles) or other\n[predefined roles](/iam/docs/roles-permissions)."]]