[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Plan maintenance windows\n\nGoogle Distributed Cloud (GDC) air-gapped offers you the ability to configure maintenance\nwindows to schedule times for automatic updates. Maintenance windows are\ndesigned to target times where a brief downtime causes the lowest impact to your\ndatabase clusters. You can schedule maintenance windows based on day of the week\nand hour, and length in which the maintenance window is open. For example, you\ncould set a maintenance window to start at 3:00 AM on Tuesdays that spans eight\nhours.\n\nYou can also plan maintenance exclusions, which prevents disruptions to your\nworkloads during date ranges where, due to unique circumstances, you don't\nwant to allow the set maintenance window.\n\nCreate a maintenance window\n---------------------------\n\nTo create a maintenance window for your database cluster, complete the\nfollowing steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to plan maintenance settings\n for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. Select the **Start time** and **Length** for the maintenance window. Also\n select the days of the week to apply the maintenance window for.\n\n | **Important:** Due to other possible processes running when the maintenance window opens for your database cluster, automatic updates for your database cluster could have a delayed start. The maintenance window length defines when the maintenance processes can start. After maintenance on the database cluster starts, the process runs until completion, possibly running past the defined maintenance window.\n\n5. To apply a maintenance exclusion, click **Add Maintenance Exclusion**.\n\n6. Give the exclusion a name and define the time window to exclude for\n your maintenance window.\n\n7. Click **Save**.\n\n### gdcloud\n\n1. To create a maintenance window for your database cluster, run:\n\n gdcloud maintenance policies create \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --weekly-cycle-days \u003cvar translate=\"no\"\u003eDAYS_OF_WEEK\u003c/var\u003e \\\n --weekly-cycle-start-time \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --weekly-cycle-duration \u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003eDAYS_OF_WEEK\u003c/var\u003e: Comma-separated list of days of the week when maintenance can begin. Accepted values are RFC-822 formatted days of the week, such as `Mon`.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The time of the day, in UTC timezone, when maintenance can begin. The value must follow the `hh:mm` format, such as `20:36`.\n - \u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e: The maximum duration that the maintenance can last for, such as `2h3m`.\n2. To apply a maintenance exclusion to your maintenance window, run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --add-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e \\\n --add-exclusion-start \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --add-exclusion-end \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the new maintenance exclusion to add.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The start date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n - \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e: The end date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n3. Verify the maintenance policy exists and reflects your intended\n configuration:\n\n gdcloud maintenance policies list --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n4. To attach the maintenance policy to your database cluster, run:\n\n gdcloud maintenance policy-bindings create \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --policy-name \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --resource-name \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e: The name of the policy binding resource.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy created in the previous step.\n - \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e: The resource name to bind to.\n For example, for a database cluster name `my-cluster`, the resource\n name for each of the available database engines would be the following:\n\n - AlloyDB Omni: `DBCluster.alloydbomni.dbadmin.gdc.goog/my-cluster`\n - Oracle: `DBCluster.oracle.dbadmin.gdc.goog/my-cluster`\n - PostGreSQL: `DBClusters.postgresql.dbadmin.gdc.goog/my-cluster`\n5. Verify the policy binding exists, and its `Valid` condition is `True`:\n\n gdcloud maintenance policy-bindings list --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of the project in\n which to create the maintenance policy.\n\nRemove a maintenance window\n---------------------------\n\nTo remove a maintenance window for your database cluster, complete the\nfollowing steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to plan maintenance settings\n for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. In the **Length** field, select **24h**.\n\n5. Select all the days of the week.\n\n6. Click **Save**.\n\nThis removes the defined maintenance window and allows maintenance updates\nto start at any time.\n\n### gdcloud\n\n1. To remove a maintenance window from your database cluster, run:\n\n gdcloud maintenance policies delete \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n2. Remove the maintenance policy binding from the database cluster:\n\n gdcloud maintenance policy-bindings delete \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e: The name of the maintenance policy binding.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n\nManage maintenance exclusions\n-----------------------------\n\nIf you created a maintenance exclusion for your maintenance window, you can edit\nor remove the exclusion without affecting the maintenance window. To edit or\nremove a maintenance exclusion, complete the following steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to manage a maintenance\n exclusion for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. Edit the date ranges and start times of the exclusion. If you want to\n delete the exclusion, click\n delete **Delete**.\n\n5. Click **Save** to save your maintenance exclusion modifications to the\n maintenance window.\n\n### gdcloud\n\nThe gdcloud CLI only supports adding and deleting maintenance\nexclusions. Therefore, you must delete the existing exclusion and add a new\none if you want to modify your exclusion date range or times.\n\n1. To delete a maintenance exclusion, run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --remove-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to delete the maintenance policy's exclusion.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the maintenance exclusion to delete.\n2. To add a new maintenance exclusion to apply any previous exclusion edits,\n run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --add-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e \\\n --add-exclusion-start \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --add-exclusion-end \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the new maintenance exclusion to add.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The start date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n - \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e: The end date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`."]]