附註:
- 此教學課程需要存取 Oracle Cloud。若要註冊免費帳戶,請參閱開始使用 Oracle Cloud Infrastructure Free Tier 。
- 其使用 Oracle Cloud Infrastructure 證明資料、租用戶以及區間的範例值。完成實驗室時,請將這些值替代為雲端環境特定的值。
簡化 Oracle Database@Google Cloud 和 Google Cloud Filestore 上 Oracle Autonomous Database Serverless 之間的資料共用
簡介
多雲端和混合雲端策略的時代已完全轉變,企業尋求來自不同供應商的頂尖服務來推動創新並最佳化成本。Oracle 與 Google Cloud 之間開創性的合作關係,提供 Oracle Database@Google Cloud 顯現了此趨勢。此方案可讓組織直接在 Google Cloud 資料中心內執行 Oracle 資料庫服務,包括熱門的 Oracle Autonomous Database Serverless (Autonomous Database Serverless),以低延遲的方式存取 Google Cloud 的豐富服務生態系統。
在這類環境中,常見的需求是能夠基於各種目的存取共用檔案系統,例如儲存應用程式二進位檔、擷取暫存資料、轉換、載入 (ETL) 處理作業、共用大型資料集以進行分析,或是進行備份與復原作業。這裡是 Google Cloud Filestore,這是一項完全託管的高效能網路檔案系統 (NFS) 檔案儲存服務。在 Oracle Database@Google Cloud 上將 Google Cloud Filestore 與您的 Autonomous Database Serverless 整合,可發揮顯著的營運效率和新的架構可能性。
在 Oracle Database@Google Cloud 上從 Oracle Autonomous Database Serverless 存取 Google Cloud Filestore,可提供強大的解決方案來管理和共用您整合雲端環境中的檔案型資料。藉由仔細規劃網路架構、DNS 和資料庫組態,您可以順暢地銜接這兩項頂尖服務,進而實現更具彈性且高效率的資料作業。此整合強調了 Oracle 和 Google Cloud 的承諾,為客戶提供在多雲端環境中選擇和強大的功能。
為什麼要使用 Google Cloud Filestore 來連接 Autonomous Database Serverless?
結合 Autonomous Database Serverless 的強大功能與 Google Cloud Filestore 的彈性,提供了多項優勢:
-
簡化資料共用:輕鬆在 Google Cloud 資源和 Oracle 資料庫之間共用檔案。這對於需要通用檔案儲存庫的應用程式特別有用。
-
高效資料暫存:使用 Google Cloud Filestore 作為暫存區,使用熟悉的 NFS 通訊協定將資料載入至您的 Autonomous Database Serverless,並補充現有的 Oracle Cloud Infrastructure (OCI) Object Storage 整合功能。
-
簡化的應用軟體架構:對於依賴檔案系統儲存的應用程式,Google Cloud Filestore 提供可從 Google Cloud 上執行之資料庫層存取的永久共用檔案層。
-
高效能:Google Cloud Filestore 提供多個效能層,確保您的資料庫能夠以低延遲和高傳輸量存取檔案型資料,適用於高要求的工作負載。
-
可擴充性和管理:Autonomous Database Serverless 和 Google Cloud Filestore 都是託管服務,可降低管理負荷。您可以隨著需求的發展,獨立擴展儲存和運算資源。
架構概要
將 Oracle Database@Google Cloud 上的 Autonomous Database Serverless 與 Google Cloud Filestore 整合,涉及安全且有效率的網路設定。
注意事項
-
安全性:確保您的 Google Cloud Filestore 執行個體存取控制已正確設定 (例如,以 IP 為基礎的匯出規則限制對 Autonomous Database Serverless VCN CIDR 範圍的存取)。運用 Google Cloud Filestore 和 Oracle Database 使用者權限的 Google Cloud IAM 權限進行微點存取。
-
NFS 版本:驗證 Google Cloud Filestore 和 Autonomous Database Serverless 版本所支援的 NFS 版本,並據此進行設定。
-
延遲:雖然相同區域中的共置服務將延遲降到最低,但請務必測試效能,以確保其符合您的應用程式需求。
-
備份與復原:將 Google Cloud Filestore 的備份與快照功能與 Autonomous Database Serverless 備份策略搭配使用,以提供全方位的資料保護。
-
成本:請謹記與 Google Cloud Filestore 使用量、網路流量 (雖然通常在相同區域 / 互連內最佳化) 及 Autonomous Database Serverless 資源相關的成本。
-
文件:Oracle 和 Google Cloud 文件會不斷更新。請務必參閱最新的官方指南,瞭解最新的程序和最佳實務。
目標
- 在 Oracle Database@Google Cloud 上搭配使用 Google Cloud Filestore 與 Autonomous Database Serverless。
備註:即使特定指令可能隨時間變更,在 Autonomous Database Serverless 內設定網路組態、DNS 解析、資料庫存取控制清單 (ACL) 和目錄等整體方法通常會相同。
工作 1:佈建 Google Cloud Filestore
-
在與 Oracle Database@Google Cloud 部署相同的 Google Cloud 區域中建立 Google Cloud Filestore 執行處理,將延遲降到最低。
-
根據您的效能和可用性需求,選取適當的服務層 (例如基本、區域、企業 )。
-
請注意 Google Cloud Filestore 執行處理專用 IP 位址和 NFS 共用路徑 (例如,
10.85.174.250:/nfsshare
)。
工作 2:設定網路連線
請確定 Google Cloud Filestore 所在的 Google Cloud Virtual Private Cloud (VPC) 具有 Oracle Database@Google Cloud 自治式資料庫所使用之 OCI VCN 的專用網路連線 (例如 VPC 網路對等)。這是安全且低延遲通訊的基礎。
工作 3:設定 DNS 解析 (適用於 Autonomous Database Serverless 的 Crucial)
Autonomous Database Serverless 使用 OCI 專用 DNS 進行名稱解析。依照預設,OCI 專用 DNS 不會與 Google Cloud DNS 整合。在此設定中,有兩種方法可以為 Autonomous Database Serverless 啟用 DNS 解析。
-
將 OCI 專用 DNS 與 Google Cloud DNS 監聽端點整合。請參閱下列主題以取得詳細資訊:
-
使用指向 NFS 共用的 A 記錄,在 OCI 中建立本機專用 DNS 區域。
在本教學課程中,我們將使用第二個選項在 OCI 中建立本機專用 DNS 區域。
無 Autonomous Database Serverless 通常需要完整網域名稱 (FQDN) 來存取網路資源,而不是直接存取 NFS 掛載的 IP 位址。
-
在 Google Cloud 主控台中,按一下在 OCI 中管理。
-
瀏覽至 VCN 的 DNS 解析器。
-
建立專用 DNS 區域 (例如,
nfs.gcp
)。 -
在此區域內新增將所選 FQDN (例如
nfs-server.nfs.gcp
) 對應至您 Google Cloud Filestore 執行處理的專用 IP 位址的 A 記錄。
工作 4:授予 Autonomous Database Serverless 中的網路 ACL
-
以
ADMIN
使用者身分連線至您的 Autonomous Database Serverless。 -
將
ROUTE_OUTBOUND_CONNECTIONS
資料庫特性設為PRIVATE_ENDPOINT
值,以強制目標主機的所有外送連線受專用端點的傳出規則規範和限制。ALTER DATABASE PROPERTY SET ROUTE_OUTBOUND_CONNECTIONS = 'PRIVATE_ENDPOINT';
-
您可以使用
DBMS_NETWORK_ACL_ADMIN
套裝程式,將 Google Cloud Filestore 執行處理之 FQDN 的必要連線和解析權限授與您的資料庫使用者 (或ADMIN
使用者)。BEGIN DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE( host => 'nfs-server.nfs.gcp', -- Your Filestore FQDN ace => xs$ace_type( privilege_list => xs$name_list('connect', 'resolve'), principal_name =>'YOUR_DB_USER', -- Or 'ADMIN' principal_type => xs_acl.ptype_db ) ); END; /
工作 5:在 Autonomous Database Serverless 中建立目錄物件
設定 ACL 之後,請在 Autonomous Database Server 中建立目錄物件,以指向 NFS 掛載。
CREATE or replace DIRECTORY FSS_DIR AS 'fss';
工作 6:將 NFS 連附至 Autonomous Database Serverless
請在參數 params => JSON_OBJECT('nfs_version' value <value>)
中設定 NFS 版本。
BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
file_system_name => 'GCPNFS',
file_system_location => 'nfs-server.nfs.gcp:/nfsshare',
directory_name => 'FSS_DIR',
description => 'Attach GCP NFS',
params => JSON_OBJECT('nfs_version' value 3)
);
END;
/
此程序會有效地建立資料庫目錄物件 (例如,GCPNFS
) 或連結至指定的 NFS 路徑。
工作 7:存取檔案
執行 SQL 陳述式,以驗證您可存取目錄下的檔案。
SELECT object_name FROM DBMS_CLOUD.LIST_FILES('FSS_DIR');
建立目錄物件並與 Google Cloud Filestore NFS 掛載關聯後,您就可以在 PL/SQL (例如 UTL_FILE
)、Oracle SQL*Loader、資料汲取) 中使用該目錄物件,或建立外部表格以讀取或寫入 Google Cloud Filestore 共用上的檔案 (受目錄物件的資料庫使用者權限約束)。
確認
- 作者 - Vivek Verma (北美雲端工程首席雲端架構師)
其他學習資源
在 docs.oracle.com/learn 上探索其他實驗室,或在 Oracle Learning YouTube 頻道上存取更多免費學習內容。此外,請造訪 education.oracle.com/learning-explorer 以成為 Oracle Learning Explorer。
如需產品文件,請造訪 Oracle Help Center 。
Simplify Data Sharing Between Oracle Autonomous Database Serverless on Oracle Database@Google Cloud and Google Cloud Filestore
G36906-01
Copyright ©2025, Oracle and/or its affiliates.