通过 SSH 从 Oracle Database@Google Cloud 中的 Google Cloud Compute Engine Linux VM 连接到 Oracle Exadata Database Service
简介
为了验证 Oracle Database@Google Cloud 服务中的 Oracle Exadata Database Service 连接并快速在本地测试数据库查询,开发人员可以访问命令行并连接到 Exadata 计算节点。
在本教程中,我们将指导您如何将安全 Shell (SSH) 置于 Google Cloud 中的 Oracle Exadata Cloud Infrastructure 中构成 Exadata 虚拟机 (VM) 集群的 Oracle Exadata Database Service 中。
目标
-
SSH 到 Exadata VM。
-
向 Exadata VM 集群添加新的 SSH 密钥。
先决条件
-
访问 Google Cloud Console、Oracle Cloud Infrastructure 控制台 (OCI) 控制台和 Oracle Database@Google Cloud。
-
访问部署在所需 Exadata VM 集群的同一虚拟专用云 (Virtual Private Cloud,VPC) 中的 Google Cloud Compute Engine。
-
访问在 Exadata VM 集群部署期间提供的 SSH 密钥对。
任务 1:以跳转主机身份连接到 Google Cloud Compute Engine
可以从部署过程中选择的 Google Cloud VPC 访问 Exadata VM 集群计算节点。要通过 SSH 访问 Exadata VM 集群,请在同一 VPC 中以跳转主机身份连接到 Google Cloud Compute Engine VM。
要连接到计算实例,请单击 SSH 以打开 SSH-in-browser 窗口。
任务 2:授权 Google Cloud Compute Engine VM 访问 Oracle Exadata Database Service VM 集群
-
在 SSH-in-browser 中,单击 UPLOAD FILE 上载为访问 Exadata VM 集群计算节点而提供的 SSH 密钥。
-
运行以下命令以将 SSH 密钥文件
exadata-private-key-file
移动到本地 SSH 文件夹并更改权限。mv exadata-private-key-file .ssh chmod 600 .ssh/exadata-private-key-file
或者
您可以生成新的 SSH 密钥并将 SSH 密钥添加到 Exadata VM 集群。
按照以下步骤生成新的 SSH 密钥:
-
在 Google Cloud VM 中,运行
ssh-keygen
命令以创建新的 SSH 验证密钥对。 -
使用以下命令复制生成的公共密钥的内容。
cat .ssh/id_rsa.pub
-
转到 Google Cloud Console,然后单击 MANAGE IN OCI 以打开 OCI 控制台。
-
在 Exadata VM 集群详细信息页中,单击添加 SSH 密钥以添加 SSH Rivest – Shamir – Adleman (RSA) 公共密钥。
-
选择粘贴 SSH 密钥,粘贴从上一步复制的 SSH 密钥,然后单击保存更改。
任务 3:连接到 Oracle Exadata Database Service VM 集群
-
转到 Google Cloud Console,单击 MANAGE IN OCI 以打开 OCI 控制台,并记下两个数据库服务器中每个服务器的专用 IP 地址。
从同一 VPC 中的 Google Cloud Compute Engine VM 启动与 Oracle Exadata Database Service 的连接。
默认情况下,Oracle Exadata Database Service 配置为使用
opc
操作系统用户帐户启用 SSH 连接。 -
运行以下命令。
$ ssh -i opc@node-ip-address
您现在已登录到 Exadata VM。
相关链接
确认
- 作者 — Julien Silverston(OCI 多云解决方案架构师)
更多学习资源
浏览 docs.oracle.com/learn 上的其他实验室,或者访问 Oracle Learning YouTube 渠道上的更多免费学习内容。此外,请访问 education.oracle.com/learning-explorer 成为 Oracle Learning Explorer。
有关产品文档,请访问 Oracle 帮助中心。
SSH to Oracle Exadata Database Service from a Google Cloud Compute Engine Linux VM in Oracle Database@Google Cloud
G25807-01
February 2025
Copyright ©2025, Oracle and/or its affiliates.