שליחת משוב
ביטול הייבוא והייצוא של נתונים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדף הזה מוסבר איך לבטל ייבוא וייצוא של נתונים למכונות Cloud SQL. הנתונים האלה נמצאים בקובצי SQL מוכנים לשימוש או בקובצי CSV .
לפני שמתחילים
כדי לבטל את הייבוא והייצוא של נתונים, צריך את המזהה של פעולת הייבוא או הייצוא. צריך לציין את המזהה הזה בפקודה של gcloud או של API בארכיטקטורת REST כדי שמערכת Cloud SQL תדע איזו פעולה לבטל.
מזהה הפעולה מוחזר בשדה name של התשובה. כדי לקבל את המזהה הזה, אפשר לעיין במאמר ייצוא וייבוא באמצעות קובצי SQL dump .
אפשר גם למצוא את מזהה הפעולה על ידי ביצוע קריאה של operations.list במכונה של Cloud SQL.
אם מבטלים את פעולת הייבוא, לא תמיד מתבצעת ב-MySQL נסיגה מלאה של הנתונים. יכול להיות שתראו בבסיסי הנתונים שלכם נתונים שייובאו באופן חלקי.
ביטול פעולת הייבוא או הייצוא
אפשר להשתמש בפקודות gcloud או בפקודות של API בארכיטקטורת REST כדי לבטל פעולת ייבוא או ייצוא.
gcloud
כדי לבטל את הפעולה, משתמשים בפקודה gcloud sql operations cancel.
gcloud sql operations cancel operation-ID
מחליפים את המשתנה operation-ID במזהה הפעולה. מידע נוסף מופיע במאמר לפני שמתחילים .
REST v1
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
ה-method של ה-HTTP וכתובת ה-URL:
POST https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID /cancel
כדי לשלוח את הבקשה צריך להרחיב אחת מהאפשרויות הבאות:
Curl (Linux, macOS או Cloud Shell)
מריצים את הפקודה הבאה:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID /cancel"
PowerShell (Windows)
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID /cancel" | Select-Object -Expand Content
אתם אמורים לקבל תגובת JSON שדומה לזו:
קריאת ה-REST API הזו לא מחזירה תגובה. מידע נוסף על בדיקת סטטוס הביטול של פעולת הייבוא או הייצוא זמין במאמר בנושא בדיקת סטטוס הביטול .
REST v1beta4
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
ה-method של ה-HTTP וכתובת ה-URL:
POST https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID /cancel
כדי לשלוח את הבקשה צריך להרחיב אחת מהאפשרויות הבאות:
Curl (Linux, macOS או Cloud Shell)
מריצים את הפקודה הבאה:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID /cancel"
PowerShell (Windows)
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID /cancel" | Select-Object -Expand Content
אתם אמורים לקבל תגובת JSON שדומה לזו:
קריאת ה-REST API הזו לא מחזירה תגובה. מידע נוסף על בדיקת סטטוס הביטול של פעולת הייבוא או הייצוא זמין במאמר בנושא בדיקת סטטוס הביטול .
בדיקת סטטוס הביטול
אפשר להשתמש בפקודות gcloud או בפקודות של API בארכיטקטורת REST כדי לבדוק את הסטטוס של פעולת ייבוא או ייצוא שבוטלה.
REST v1
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
ה-method של ה-HTTP וכתובת ה-URL:
GET https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID
כדי לשלוח את הבקשה צריך להרחיב אחת מהאפשרויות הבאות:
Curl (Linux, macOS או Cloud Shell)
מריצים את הפקודה הבאה:
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID "
PowerShell (Windows)
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method GET ` -Headers $headers ` -Uri "https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID " | Select-Object -Expand Content
אתם אמורים לקבל תגובת JSON שדומה לזו:
תשובה
{
"kind": "sql#operation",
"targetLink": "https://sqladmin.googleapis.com/v1/projects/project-ID ",
"status": "DONE",
"user": "user@example.com",
"insertTime": "2022-11-08T22:12:58.199Z",
"startTime": "2022-11-08T22:13:04.798Z",
"endTime": "2022-11-08T22:13:45.862Z",
"error": {
"kind": "sql#operationErrors",
"errors": [
{
"kind": "sql#operationError",
"code": "CANCEL_SUCCESSFUL",
"message": "Operation successfully cancelled"
}
]
},
"operationType": "EXPORT",
"exportContext": {
"uri": "gs://replica-bucket/source-database.sql",
"kind": "sql#exportContext",
"sqlExportOptions": {
"schemaOnly": false,
"mysqlExportOptions": {
"masterData": 0
}
},
"fileType": "SQL"
},
"name": "operation-ID ",
"targetId": "cloud-sql-instance-display-name ",
"selfLink": "https://sqladmin.googleapis.com/v1/projects/project-ID /operations/operation-ID ",
"targetProject": "project-ID ",
"instanceUid": "cloud-sql-instance-ID "
}
REST v1beta4
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
ה-method של ה-HTTP וכתובת ה-URL:
GET https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID
כדי לשלוח את הבקשה צריך להרחיב אחת מהאפשרויות הבאות:
Curl (Linux, macOS או Cloud Shell)
מריצים את הפקודה הבאה:
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID "
PowerShell (Windows)
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method GET ` -Headers $headers ` -Uri "https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID " | Select-Object -Expand Content
אתם אמורים לקבל תגובת JSON שדומה לזו:
תשובה
{
"kind": "sql#operation",
"targetLink": "https://sqladmin.googleapis.com/v1beta4/projects/project-ID ",
"status": "DONE",
"user": "user@example.com",
"insertTime": "2022-11-08T22:12:58.199Z",
"startTime": "2022-11-08T22:13:04.798Z",
"endTime": "2022-11-08T22:13:45.862Z",
"error": {
"kind": "sql#operationErrors",
"errors": [
{
"kind": "sql#operationError",
"code": "CANCEL_SUCCESSFUL",
"message": "Operation successfully cancelled"
}
]
},
"operationType": "EXPORT",
"exportContext": {
"uri": "gs://replica-bucket/source-database.sql",
"kind": "sql#exportContext",
"sqlExportOptions": {
"schemaOnly": false,
"mysqlExportOptions": {
"masterData": 0
}
},
"fileType": "SQL"
},
"name": "operation-ID ",
"targetId": "cloud-sql-instance-display-name ",
"selfLink": "https://sqladmin.googleapis.com/v1beta4/projects/project-ID /operations/operation-ID ",
"targetProject": "project-ID ",
"instanceUid": "cloud-sql-instance-ID "
}
פתרון בעיות
שגיאה
פתרון בעיות
הודעת שגיאה: You can't cancel operation [operation-ID] because
this operation isn't in progress.
אתם מנסים לבטל פעולת ייבוא או ייצוא שהסתיימה, נכשלה או בוטלה. אם הפעולה פועלת, אפשר לבטל אותה.
הודעת שגיאה: You can't cancel operation [operation-ID] because
Cloud SQL doesn't support the cancellation of an [operation-type]
operation.
Cloud SQL
לא תומך בביטול הפעולה כי סוג הפעולה שלה הוא לא IMPORT
או EXPORT.
הודעת שגיאה: The [operation-type] operation isn't cancelled. Wait
and retry in a few seconds.
בשלב הזה, אי אפשר לבטל את פעולת הייבוא או הייצוא ב-Cloud SQL.
כדאי לנסות שוב בעוד כמה שניות. אם הבעיה נמשכת, אפשר לפנות אל Google Cloud התמיכה .
המאמרים הבאים
שליחת משוב
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0 . לפרטים, ניתן לעיין במדיניות האתר Google Developers . Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-03-05 (שעון UTC).
רוצה לתת לנו משוב?
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["התוכן קשה להבנה","hardToUnderstand","thumb-down"],["שגיאות בקוד לדוגמה או במידע","incorrectInformationOrSampleCode","thumb-down"],["חסרים לי פרטים או דוגמאות","missingTheInformationSamplesINeed","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-03-05 (שעון UTC)."],[],[]]