從 SQL*Plus 連線至 Oracle AI Database
SQL*Plus 是一種從屬端程式,可以從中存取 Oracle AI Database。本主題說明如何啟動 SQL*Plus 並連線至 Oracle AI Database。
注意:對於下列程序的步驟 3 和步驟 4,您需要使用者名稱和密碼。
若要從 SQL*Plus 連線至 Oracle AI Database:
-
如果您是在 Windows 系統上,請開啟 Windows 指令提示。
-
在命令提示字元中,鍵入 sqlplus ,然後按 Enter 鍵。
-
在使用者名稱提示下,輸入您的使用者名稱,然後按 Enter 鍵。
-
在密碼提示下輸入您的密碼,然後按 Enter 鍵。
注意:為了安全起見,您的密碼不會在畫面上顯示。
系統會將您連接至 Oracle AI Database 實例。
您目前在 SQLPlus 環境。在
SQL>提示下,您可以輸入並執行 SQLPlus 命令、SQL 敘述句、PL/SQL 敘述句,以及作業系統命令。若要結束 SQL*Plus,請輸入 exit 並按 Enter 鍵。
注意:結束 SQLPlus 會結束 SQLPlus 階段作業,但不會關閉資料庫執行處理。
範例 2-1 會啟動 SQLPlus、連線至 Oracle AI Database、執行 SQL
SELECT敘述句並結束 SQLPlus。使用者輸入為粗體。
範例 2-1 從 SQL*Plus 連線至 Oracle Database 12c
> sqlplus
SQL*Plus: Release 12.1.0.1.0 Production on Thu Dec 27 07:43:41 2012
Copyright (c) 1982, 2012, Oracle. All rights reserved.
Enter user-name: your_user_name
Enter password: your_password
Connected to:
Oracle Database 12c Enterprise Edition Release - 12.1.0.1.0 64bit Production
SQL> select count(*) from employees;
COUNT(*)
----------
107
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release - 12.1.0.1.0 64bit Production
>
另請參閱:
-
如需 SQLPlus 的簡短說明,請參閱關於 SQLPlus
-
SQL*Plus User's Guide and Reference,瞭解啟動 SQL*Plus 並連線到資料庫的詳細資訊。