Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Ansicht ASSIGNMENTS
Die Ansicht INFORMATION_SCHEMA.ASSIGNMENTS enthält eine Liste aller aktuellen Zuweisungen im Administrationsprojekt nahezu in Echtzeit. Jede Zeile steht für eine einzelne aktuelle Zuweisung. Eine aktuelle Zuweisung ist entweder ausstehend oder aktiv und wurde nicht gelöscht. Weitere Informationen zur Reservierung finden Sie unter Einführung in Reservierungen.
Erforderliche Berechtigung
Zum Abfragen der INFORMATION_SCHEMA.ASSIGNMENTS-Ansicht benötigen Sie die IAM-Berechtigung (Identity and Access Management) bigquery.reservationAssignments.list für das Projekt.
Jede der folgenden vordefinierten IAM-Rollen enthält die erforderliche Berechtigung:
Die Ansicht INFORMATION_SCHEMA.ASSIGNMENTS hat das folgende Schema:
Spaltenname
Datentyp
Wert
ddl
STRING
Die DDL-Anweisung, die zum Erstellen dieser Zuweisung verwendet wird.
project_id
STRING
ID des Administrationsprojekts.
project_number
INTEGER
Nummer des Administrationsprojekts.
assignment_id
STRING
ID, die die Zuweisung eindeutig kennzeichnet.
reservation_name
STRING
Name der Reservierung, die die Zuweisung verwendet.
job_type
STRING
Die Art des Jobs, der die Reservierung verwenden kann. Kann
PIPELINE, QUERY, CONTINUOUS,
ML_EXTERNAL oder BACKGROUND sein.
assignee_id
STRING
ID, die die Ressource des Empfängers der Zuweisung eindeutig identifiziert.
assignee_number
INTEGER
Zahl, die die Ressource des Empfängers der Zuweisung eindeutig identifiziert.
assignee_type
STRING
Typ der zugewiesenen Ressource. Kann organization, folder oder project sein.
Bereich und Syntax
Für Abfragen dieser Ansicht muss ein Regions-Qualifier verwendet werden.
Wenn Sie keinen regionalen Qualifier angeben, werden Metadaten aus allen Regionen abgerufen. In der folgenden Tabelle wird der Regionsbereich für diese Ansicht erläutert:
Im folgenden Beispiel werden die aktuell zugewiesene Reservierung und die Slotkapazität des Projekts abgerufen. Diese Informationen sind nützlich für das Debugging der Jobleistung. Dazu vergleichen Sie die Slotnutzung des Projekts mit der Slotkapazität der Reservierung.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-17 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.ASSIGNMENTS\u003c/code\u003e view provides a real-time list of all current, non-deleted assignments within the administration project.\u003c/p\u003e\n"],["\u003cp\u003eQuerying this view requires the \u003ccode\u003ebigquery.reservationAssignments.list\u003c/code\u003e IAM permission, which is included in several predefined roles like \u003ccode\u003eroles/bigquery.resourceAdmin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach row in the view represents a single assignment and contains details such as \u003ccode\u003eassignment_id\u003c/code\u003e, \u003ccode\u003ereservation_name\u003c/code\u003e, \u003ccode\u003ejob_type\u003c/code\u003e, and \u003ccode\u003eassignee_id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view must include a region qualifier to specify the region from which metadata is retrieved, such as \u003ccode\u003eregion-us\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe view is useful for comparing a project's current slot usage against the slot capacity of its assigned reservation, by showing information such as the \u003ccode\u003ereservation_name\u003c/code\u003e and \u003ccode\u003eslot_capacity\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ASSIGNMENTS view\n================\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view contains a near real-time list of all\ncurrent assignments within the administration project. Each row represents a\nsingle, current assignment. A current assignment is either pending or active and\nhas not been deleted. For more information about reservation, see [Introduction\nto Reservations](/bigquery/docs/reservations-intro).\n\nRequired permission\n-------------------\n\nTo query the `INFORMATION_SCHEMA.ASSIGNMENTS` view, you need the\n`bigquery.reservationAssignments.list` Identity and Access Management (IAM) permission for\nthe project.\nEach of the following predefined IAM roles includes the required\npermission:\n\n- `roles/bigquery.resourceAdmin`\n- `roles/bigquery.resourceEditor`\n- `roles/bigquery.resourceViewer`\n- `roles/bigquery.user`\n- `roles/bigquery.admin`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view has the following\nschema:\n\nScope and syntax\n----------------\n\nQueries against this view must include a [region qualifier](/bigquery/docs/information-schema-intro#syntax).\nIf you do not specify a regional qualifier, metadata is retrieved from all\nregions. The following table explains the region scope for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nExample\n-------\n\nTo run the query against a project other than your default project, add the\nproject ID in the following format: \n\n```bash\n`PROJECT_ID`.`region-REGION_NAME`.INFORMATION_SCHEMA.ASSIGNMENTS\n```\n.\n\n\u003cbr /\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project to which you have assigned reservations.\n- \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: the name of the region.\n\nFor example, ```myproject`.`region-us`.INFORMATION_SCHEMA.ASSIGNMENTS``.\n\nThe following example gets a project's currently assigned reservation and its\nslot capacity. This information is useful for debugging job performance by\ncomparing the project's slot usage with the slot capacity of the reservation\nassigned to that project. \n\n```googlesql\nSELECT\n reservation.reservation_name,\n reservation.slot_capacity\nFROM\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.ASSIGNMENTS_BY_PROJECT assignment\nINNER JOIN\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.RESERVATIONS_BY_PROJECT AS reservation\nON\n (assignment.reservation_name = reservation.reservation_name)\nWHERE\n assignment.assignee_id = \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\"\n AND job_type = \"QUERY\";\n```"]]