Oracle To Google Cloud Storage Operator (Oracle 至 Google Cloud Storage 運算子)¶
The Google Cloud Storage (GCS) 服務用於儲存來自各種應用程式的大量資料。本頁說明如何將資料從 Oracle 複製到 GCS。
先決條件任務¶
要使用這些運算子,您必須執行以下幾項操作
使用 Cloud Console 選擇或建立 Cloud Platform 專案。
為您的專案啟用計費功能,如 Google Cloud 文件中所述。
啟用 API,如 Cloud Console 文件中所述。
透過 pip 安裝 API 函式庫。
pip install 'apache-airflow[google]'詳細資訊請參閱 安裝。
OracleToGCSOperator¶
OracleToGCSOperator
允許您將資料從 Oracle 資料庫上傳到 GCS。
當您使用此運算子時,您可以選擇性地壓縮要上傳到 gzip 格式的資料。
以下是使用此運算子將資料上傳到 GCS 的範例。
upload_oracle_to_gcs = OracleToGCSOperator(
task_id="oracle_to_gcs", sql=SQL_QUERY, bucket=BUCKET_NAME, filename=FILENAME, export_format="csv"
)
參考¶
更多資訊,請參閱: * oracledb 文件 * Google Cloud Storage 文件