使用 SQL*Plus 連線至專用 Exadata 基礎架構上的 Autonomous Database

秘訣:

For a "try it out" alternative that demonstrates these instructions, run Task 4: Connect to your autonomous DB using SQL Worksheets from Database Actions, SQLCL and SQL Plus from Lab 2: Configure a Development System in the Oracle Autonomous Database Dedicated Workshop.
SQL*Plus 是用來輸入 SQL 命令的命令行介面。SQL*Plus 會連線至 Oracle 資料庫。
若要將 SQL*Plus 連線至 Autonomous Database ,執行 SQL*Plus 的系統必須能夠存取 Autonomous Database 的網路。您可以使用下列其中一種方式來達成此目標:
  • 設定開發系統以存取資料庫
  • 使用 VPN (快速連線或 VPN 即服務) 或任何 VCN 對等互連設定適當的網路路由 (如果運算主機位於另一個 VCN 中)。

如果要使用 SQL*Plus 安裝和設定從屬端並使用 Autonomous Database 連線,請執行下列動作:

  1. 請依照準備 ODBC 和 JDBC Oracle Call Interface (OCI) 連線中的指示進行連線。
  2. 使用 tnsnames.ora 檔案中提供的資料庫使用者、密碼和資料庫服務名稱進行連線。

    舉例而言:

    sqlplus sales_trans@atpc1_low  
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Mon Jan 18 09:50:13 2021
    Version 18.5.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    Enter password:
    Last Successful login time: Mon Jan 18 2021 09:33:57 +00:00
    
    Connected to:
    Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
    Version 19.0.0.0.0
    
    SQL>

    附註:

    Oracle Wallet 在 SQL*Plus 中是通透的,因為公事包位置是在 sqlnet.ora 檔案中指定。這適用於任何 Oracle Call Interface (OCI)、ODBC 或 JDBC OCI 連線。