Google משתמשת בטכנולוגיית AI כדי לתרגם תוכן לשפה המועדפת עליך. בתרגומים כאלו עשויות להיות שגיאות.
ביטול הייבוא והייצוא של נתונים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדף הזה מוסבר איך לבטל את הייבוא והייצוא של נתונים למכונות Cloud SQL. הנתונים האלה נמצאים בקובצי SQL מוכנים לשימוש או בקובצי BAK.
לפני שמתחילים
ביטול פעולת הייבוא או הייצוא
כדי לבטל פעולת ייבוא או ייצוא, אפשר להשתמש בפקודות של gcloud או של API בארכיטקטורת REST.
gcloud
משתמשים בפקודה gcloud sql operations cancel כדי לבטל את הפעולה.
gcloud sql operations cancel operation-ID
מחליפים את המשתנה operation-ID במזהה של הפעולה. מידע נוסף זמין בקטע לפני שמתחילים.
REST v1
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- project-ID: מזהה הפרויקט.
- operation-ID: המזהה של פעולת הייבוא או הייצוא. מידע נוסף מופיע בקטע לפני שמתחילים.
ה-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 שדומה לזו:
הקריאה הזו ל-API בארכיטקטורת REST לא מחזירה תשובה. למידע נוסף על בדיקת סטטוס הביטול של פעולת הייבוא או הייצוא, ראו בדיקת סטטוס הביטול.
REST v1beta4
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- project-ID: מזהה הפרויקט.
- operation-ID: המזהה של פעולת הייבוא או הייצוא. מידע נוסף מופיע בקטע לפני שמתחילים.
ה-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 שדומה לזו:
הקריאה הזו ל-API בארכיטקטורת REST לא מחזירה תשובה. למידע נוסף על בדיקת סטטוס הביטול של פעולת הייבוא או הייצוא, ראו בדיקת סטטוס הביטול.
בדיקת הסטטוס "בוטל"
אפשר להשתמש בפקודות של gcloud או של API בארכיטקטורת REST כדי לבדוק את הסטטוס של פעולת ייבוא או ייצוא שבוטלה.
REST v1
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- project-ID: מזהה הפרויקט.
- operation-ID: המזהה של פעולת הייבוא או הייצוא. מידע נוסף מופיע בקטע לפני שמתחילים.
ה-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
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- project-ID: מזהה הפרויקט.
- operation-ID: המזהה של פעולת הייבוא או הייצוא. מידע נוסף מופיע בקטע לפני שמתחילים.
ה-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-11-12 (שעון UTC).
[null,null,["עדכון אחרון: 2026-11-12 (שעון UTC)."],[],[]]