Cette page décrit l'outil de recommandation Cloud SQL d'activation des sauvegardes automatiques, qui vous aide à détecter les instances critiques et qui présentent un risque de perte de données.
L'outil de recommandation d'activation des sauvegardes automatiques de Cloud SQL analyse les métadonnées des instances et recommande de configurer des sauvegardes automatiques pour les instances de production sur lesquelles aucune sauvegarde automatique n'est activée.
Les recommandations sont générées quotidiennement.
Afin de pouvoir afficher les recommandations et les insights, procédez comme suit :
Pour obtenir les autorisations permettant d'afficher et d'utiliser les insights et les recommandations, assurez-vous de disposer des rôles IAM (Identity and Access Management) requis.
Tasks
Rôles
Afficher les recommandations
L'un des rôles suivants : recommender.cloudsqlViewer ou cloudsql.viewer.
Appliquer les recommandations
L'un des rôles suivants : recommender.cloudsqlAdmin, cloudsql.editor ou cloudsql.admin.
Lister les recommandations de fiabilité pour l'activation des sauvegardes automatiques
Vous pouvez répertorier les recommandations d'activation des sauvegardes automatiques à l'aide de la console Google Cloud , de gcloud CLI ou de l'API Recommender.
Console
Pour lister les recommandations d'activation des sauvegardes automatiques à l'aide de la consoleGoogle Cloud , procédez comme suit :
Dans la fiche Augmenter la fiabilité des instances Cloud SQL, cliquez sur Tout afficher.
Sélectionnez les instances associées à la recommandation Activer les sauvegardes automatiques.
CLI gcloud
Pour lister les recommandations d'activation des sauvegardes automatiques à l'aide de gcloud CLI, exécutez la commande gcloud recommender recommendations list comme suit :
LOCATION : région où se trouvent vos instances, par exemple us-central1.
API
Pour lister les recommandations d'activation des sauvegardes automatiques à l'aide de l'API Recommender, appelez la méthode recommendations.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.ReliabilityRecommender/recommendations
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : région où se trouvent vos instances, par exemple us-central1.
Si l'outil de recommandation détecte des instances pour la recommandation d'activation des sauvegardes automatiques, il les répertorie dans une table. Chaque ligne indique le nom de l'instance, une brève recommandation, le type de machine actuel, le type de machine recommandé, l'emplacement et la date de la dernière actualisation.
Afficher les insights et les recommandations détaillées
Vous pouvez afficher des insights et des recommandations détaillées sur les instances nécessitant l'activation des sauvegardes automatiques à l'aide de la console Google Cloud , de gcloud CLI ou de l'API Recommender.
Console
Pour afficher des insights et des recommandations détaillées sur les instances nécessitant l'activation des sauvegardes automatiques, cliquez sur le lien de recommandation dans la liste des instances.
CLI gcloud
Pour afficher des insights et des recommandations détaillées sur les instances nécessitant l'activation des sauvegardes automatiques, exécutez la commande gcloud recommender insights list comme suit :
LOCATION : région où se trouvent vos instances, par exemple us-central1.
API
Pour afficher des insights et des recommandations détaillées sur les instances nécessitant l'activation des sauvegardes automatiques, utilisez l'API Recommendations, appelez la méthode insights.list comme suit:
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.ReliabilityInsight/insights
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : région où se trouvent vos instances, par exemple us-central1.
Appliquer la recommandation
Procédez comme suit pour appliquer cette recommandation :
Cliquez sur Activer les sauvegardes automatiques dans la colonne Problèmes.
Une fenêtre Activer les sauvegardes automatiques s'affiche et fournit une recommandation.
Pour continuer, cliquez sur Modifier l'instance > Protection des données > Automatiser les sauvegardes quotidiennes.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Prevent data loss for your instance by enabling automated backups\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/recommender-enable-automated-backups \"View this page for the MySQL database engine\") \\| PostgreSQL \\| [SQL Server](/sql/docs/sqlserver/recommender-enable-automated-backups \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes the Cloud SQL enable automated backups [recommender](/recommender/docs/overview) which helps you detect instances which are critical and have a risk of data loss.\n\nThe Cloud SQL enable automated backups recommender analyzes instance metadata and recommends to configure automated backups for production instances that have no automated backups enabled.\n\nRecommendations are generated daily.\n\nPricing\n-------\n\nThe Cloud SQL enable automated backups recommender is in the *Standard* [Recommender pricing tier](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- To get the permissions to view and work with insights and recommendations, ensure that you have the required [Identity and Access Management (IAM) roles](/sql/docs/postgres/project-access-control#roles).\n\n For more information about IAM roles, see [IAM basic and predefined roles reference](/iam/docs/understanding-roles) and [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n-\n\n\n Enable the Recommender API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com)\n\nList reliability recommendations for enabling automated backups\n---------------------------------------------------------------\n\nYou can list the enable automated backups recommendations by\nusing the Google Cloud console, [gcloud CLI](/sdk/gcloud), or the Recommender API. \n\n### Console\n\nTo list enable automated backups recommendations using the\nGoogle Cloud console, follow these steps:\n\n1. Go to the **Recommendation Hub**.\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n\n For more information, see\n [Getting started with Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n2. In the **Increase Cloud SQL instance reliability** card, click **View all**.\n\n3. Select instances with the **Enable automated backups** recommendation.\n\n### gcloud CLI\n\nTo list enable automated backups recommendations using gcloud CLI, run the\n[`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list)\ncommand as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.ReliabilityRecommender \\\n--filter=recommenderSubtype=ENABLE_AUTO_BACKUP\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\n### API\n\nTo list enable automated backups recommendations using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`recommendations.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.recommenders.recommendations/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.ReliabilityRecommender/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nIf the recommender detects instances for the enable automated backups recommendation, it lists them in a table. Each row shows the instance name, a brief recommendation, the current machine type, the recommended machine type, the location, and the last refresh date.\n\nView insights and detailed recommendations\n------------------------------------------\n\nYou can view insights and detailed recommendations about instances\nthat require enabling automated backups using the Google Cloud console,\n`gcloud CLI`, or the Recommender API. \n\n### Console\n\nTo view insights and detailed recommendations about instances that require enabling automated backups, click the recommendation link in the list of instances.\n\n### gcloud CLI\n\nTo view insights and detailed recommendations about instances that require enabling automated backups, run the\n[`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list)\ncommand as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT-ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.ReliabilityInsight \\\n--filter=insightSubtype=CRITICAL_INSTANCE_AUTO_BACKUP_NOT_ENABLED\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\n### API\n\nTo view insights and detailed recommendations about instances that require enabling automated backups, use the\n[Recommendations API](/recommender/docs/using-api), call the\n[`insights.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes.insights/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.ReliabilityInsight/insights\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nApply recommendation\n--------------------\n\nTo apply this recommendation, do the following:\n\n- Click **Enable automated backups** in the **Issues** column. An **Enable automated backups** window displays providing a recommendation.\n- Click **Edit instance** \\\u003e **Data Protection** \\\u003e **Automate daily backups** to proceed.\n\n For more information, see [Automated backup and transaction log retention](/sql/docs/postgres/backup-recovery/backups#automated-backups).\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)\n- [About database observability](/sql/docs/postgres/observability)"]]