- 首先,訪問oracle官方網(wǎng)站并下載適用于Ubuntu的oracle數(shù)據(jù)庫軟件包。確保選擇與您的Ubuntu版本和體系結(jié)構(gòu)(32位或64位)相對應(yīng)的軟件包。
- 打開終端并執(zhí)行以下命令,以安裝oracle數(shù)據(jù)庫所需的依賴項(xiàng):
sudo apt update
sudo apt install alien libaio1 unixODBC
sudo groupadd -g 503dba sudo groupadd -g 504oper
sudo useradd -u 501 -g oinstall -G dba,oper -s /bin/bash -m oracle
sudo passwd oracle # 記住oracle用戶的密碼
- 創(chuàng)建目標(biāo)目錄,并將目錄的屬主設(shè)為oracle用戶:
sudo mkdir -p /u01/app/oracle/product/12/dbhome_1
sudo chown -R oracle:oinstall /u01
- 設(shè)置目錄的權(quán)限和臨時(shí)目錄的歸屬權(quán):
sudo chown -R oracle:oinstall /u01/app/oracle/product/12/dbhome_1
- 解壓下載的oracle數(shù)據(jù)庫軟件包,并進(jìn)入解壓后的目錄:
cd /path/to/oracle/database/install/dir
- 運(yùn)行oracle數(shù)據(jù)庫安裝程序:
./runInstaller
- 在安裝程序中,選擇“自定義安裝”并按照屏幕上的指示進(jìn)行操作。選擇適當(dāng)?shù)倪x項(xiàng)和配置,并完成安裝過程。請注意,安裝過程可能需要一些時(shí)間,具體取決于您的系統(tǒng)性能。
- 最后,啟動oracle數(shù)據(jù)庫實(shí)例并設(shè)置為開機(jī)自啟:
sudo systemctl start oracle-database-preinstall-12cR2-preinstall.service
sudo systemctl enable oracle-database-preinstall-12cR2-preinstall.service