[[["容易理解","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-04 (世界標準時間)。"],[[["\u003cp\u003eThis document outlines the management of materialized view replicas in BigQuery, covering listing, retrieving information, and deletion operations.\u003c/p\u003e\n"],["\u003cp\u003eListing materialized view replicas can be done through the Google Cloud console, requiring the \u003ccode\u003ebigquery.tables.list\u003c/code\u003e IAM permission.\u003c/p\u003e\n"],["\u003cp\u003eInformation about a materialized view replica can be obtained using SQL, the \u003ccode\u003ebq\u003c/code\u003e command-line tool, or the BigQuery API, which requires a set of specific IAM permissions including \u003ccode\u003ebigquery.tables.get\u003c/code\u003e and \u003ccode\u003ebigquery.tables.list\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDeleting materialized view replicas, an irreversible action, is performed via the Google Cloud console and necessitates the \u003ccode\u003ebigquery.tables.delete\u003c/code\u003e IAM permission.\u003c/p\u003e\n"],["\u003cp\u003eThe document includes instructions and necessary permissions for each operation, referencing additional resources for creating and managing materialized views.\u003c/p\u003e\n"]]],[],null,["# Manage materialized view replicas\n=================================\n\nThis document describes how to manage materialized view replicas in\nBigQuery.\n\nBigQuery management of materialized view replicas includes\nthe following operations:\n\n- [List materialized view replicas](#list)\n- [Get information about materialized view replicas](#get-info)\n- [Delete materialized view replicas](#delete)\n\nFor more information about materialized view replicas, see the following:\n\n- [Materialized view replicas](/bigquery/docs/materialized-views-intro#materialized_view_replicas)\n- [Create materialized view replicas](/bigquery/docs/materialized-views-create)\n\nBefore you begin\n----------------\n\nGrant Identity and Access Management (IAM) roles that give users the necessary permissions\nto perform each task in this document. The permissions required to perform a\ntask (if any) are listed in the \"Required permissions\" section of the task.\n\nList materialized view replicas\n-------------------------------\n\nYou can list materialized view replicas through the Google Cloud console.\n\n### Required permissions\n\nTo list materialized view replicas in a dataset, you need the\n`bigquery.tables.list` IAM permission.\n\nEach of the following predefined IAM roles includes the\npermissions that you need in order to list materialized view replicas in\na dataset:\n\n- `roles/bigquery.user`\n- `roles/bigquery.metadataViewer`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.dataOwner`\n- `roles/bigquery.dataEditor`\n- `roles/bigquery.admin`\n\nFor more information on IAM roles and permissions in\nIAM, see [Predefined roles and permissions](/bigquery/docs/access-control).\n\nTo list the materialized view replicas in a dataset:\n\n1. In the **Explorer** panel, expand your project and select a dataset.\n\n2. Scroll through the list to see the tables in the dataset. Tables,\n views, and materialized views are identified by different icons.\n Materialized view replicas have the same icon as materialized views.\n\nGet information about materialized view replicas\n------------------------------------------------\n\nYou can get information about a materialized view replica by using SQL, the\nbq command-line tool, or the BigQuery API.\n\n### Required permissions\n\nTo query information about a materialized view replica, you need the following\nIdentity and Access Management (IAM) permissions:\n\n- `bigquery.tables.get`\n- `bigquery.tables.list`\n- `bigquery.routines.get`\n- `bigquery.routines.list`\n\nEach of the following predefined IAM roles includes the preceding\npermissions:\n\n- `roles/bigquery.metadataViewer`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.admin`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nTo get information about a materialized view replica, including the source\n[materialized view](/bigquery/docs/materialized-views-intro): \n\n### SQL\n\nTo get information about materialized view replicas, query the\n[`INFORMATION_SCHEMA.TABLES` view](/bigquery/docs/information-schema-tables):\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the query editor, enter the following statement:\n\n ```googlesql\n SELECT * FROM PROJECT_ID.DATASET_ID.INFORMATION_SCHEMA.TABLES\n WHERE table_type = 'MATERIALIZED VIEW';\n ```\n\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the name of the project that contains the materialized view replicas\n - \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the name of the dataset that contains the materialized view replicas\n\n \u003cbr /\u003e\n\n3. Click play_circle **Run**.\n\n \u003cbr /\u003e\n\nFor more information about how to run queries, see [Run an interactive query](/bigquery/docs/running-queries#queries).\n\n### bq\n\nUse the\n[`bq show` command](/bigquery/docs/reference/bq-cli-reference#bq_show): \n\n```bash\nbq show --project=project_id --format=prettyjson dataset.materialized_view_replica\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e: the project ID. You only need to include this flag to get information about a materialized view replica in a different project than the default project.\n- \u003cvar translate=\"no\"\u003edataset\u003c/var\u003e: the name of the dataset that contains the materialized view replica.\n- \u003cvar translate=\"no\"\u003ematerialized_view_replica\u003c/var\u003e: the name of the materialized view replica that you want information about.\n\nExample:\n\nEnter the following command to show information about the materialized\nview replica `my_mv_replica` in the `report_views` dataset in the\n`myproject` project. \n\n bq show --project=myproject --format=prettyjson report_views.my_mv_replica\n\n### API\n\nTo get materialized view replica information by using the API, call the\n[`tables.get`](/bigquery/docs/reference/rest/v2/tables/get) method.\n\nDelete materialized view replicas\n---------------------------------\n\nYou can delete a materialized view replica through the Google Cloud console.\n| **Caution:** Deleting a materialized view replica can't be undone.\n\n### Required permissions\n\nTo delete materialized view replicas, you need the `bigquery.tables.delete`\nIAM permission.\n\nEach of the following predefined IAM roles includes the\npermissions that you need in order to delete a materialized view replica:\n\n- `bigquery.dataEditor`\n- `bigquery.dataOwner`\n- `bigquery.admin`\n\nFor more information about\nBigQuery Identity and Access Management (IAM), see\n[Predefined roles and permissions](/bigquery/docs/access-control).\n\n1. In the **Explorer** pane, expand your project and select the materialized\n view replica.\n\n2. Expand the\n more_vert\n **Actions** option and click **Delete**.\n\n3. In the **Delete materialized view?** dialog, type `delete` into the field,\n and then click **Delete**."]]