在 Debian 上安裝 SQL*Plus 的步驟如下:
安裝依賴包:
打開終端,使用以下命令安裝必需的依賴項:
sudo apt-get update
sudo apt-get install libaio1 libaio-dev
下載 Oracle Instant Client:
從 Oracle 官方網站下載適用于 Debian 的 Instant Client 軟件包。您需要下載基本包和 SQL*Plus 包。例如:
wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip
wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip
解壓 Instant Client 軟件包:
將下載的 Instant Client 軟件包解壓縮到目標文件夾,例如 /opt/oracle
目錄。使用以下命令進行解壓縮:
sudo unzip instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip -d /opt/oracle
sudo unzip instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip -d /opt/oracle
設置環境變量:
編輯 ~/.bashrc
或 ~/.profile
文件,添加以下內容:
export ORACLE_HOME=/opt/oracle/instantclient_21_5
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$ORACLE_HOME:$PATH
使環境變量生效:
source ~/.bashrc
驗證安裝:
打開終端并運行以下命令,如果顯示 SQL*Plus 的版本號,則表示安裝成功:
sqlplus -v
現在,您已成功在 Debian 系統上安裝了 SQL*Plus 命令行工具。
請注意,以上步驟是基于特定版本的 Oracle Instant Client 的安裝過程,具體版本可能會有所不同。建議參考 Oracle 官方網站上的最新文檔以獲取適用于您所使用的 Instant Client 版本的安裝指南。