一、環境準備
1.1 軟體下載
下載地址:https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
其中client的是需要圖形介面安裝的,client_home是靜默安裝的,可自行選擇,本文采用圖形介面安裝
1.2 基礎環境配置
- 修改主機名
# hostnamectl set-hostname node1
- 關閉防火牆與SELinux
# systemctl stop firewalld
# systemctl disable firewalld
##如果開啟防火牆的話,需放開Oracle1521埠
##firewall-cmd --zone=public --add-port=1521/tcp --permanent
##firewall-cmd --reload
# setenforce 0
# sed -ri '/^[^#]*SELINUX=/s#=.+$#=disabled#' /etc/selinux/config
# cat /etc/sysconfig/selinux
# getenforce
- 配置本地yum源,如果有網際網路這一步可以省略
- 安裝依賴包
dnf -y install gcc automake autoconf libtool make
- 建立Oracle相關的使用者和組
# /usr/sbin/groupadd -g 54321 oinstall
# /usr/sbin/groupadd -g 54322 dba
# /usr/sbin/groupadd -g 54323 oper
# /usr/sbin/useradd -u 54321 -g oinstall -G dba oracle
# echo "Gistack123" |passwd --stdin oracle
# /usr/sbin/usermod -g oinstall -G dba,oper oracle
# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper)
- 建立資料夾並賦權
# mkdir -p /u01/app/oracle/product/19.0.0/client_1
# mkdir -p /u01/soft
# chown -R oracle:oinstall /u01/
# chmod -R 775 /u01
- 配置環境變數
# su - oracle
$ vim ~/.bash_profile
umask 022
export HOST=`hostname | cut -f1 -d"."`
export LANG=en_US
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3/client_1
export ORACLE_SID=oratestdb
export ORACLE_TERM=xterm;
export PATH=.:$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_CHINA.ZHS16GBK
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
$ source ~/.bash_profile
- 解壓安裝包
# unzip /software/LINUX.X64_193000_client.zip -d /u01/soft/
# chown -R oracle:oinstall /u01/
- 配置DISPLAY環境變數
$ export DISPLAY=192.168.88.112:0.0
二、安裝client
- 執行安裝程式
$ cd /u01/soft/
$ ./runInstaller
用的管理員模式安裝,安裝過程省略。
2. 配置客戶端登入
$ vim /u01/app/oracle/product/19.3/client_1/network/admin/tnsnames.ora
ORATESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.75)(PORT = 1521))
)
(CONNECT_DATA =
(SID = oratestdb)
(SERVER = DEDICATED)
)
)
## 其中ORATESTDB可以隨便取,後面sqlplus的連線名用這個
## 測試登入
$ sqlplus system/Gistack123@ORATESTDB
三、報錯整理
- 執行
./runInstaller
報錯沒有swap,建立swap
# dd if=/dev/zero of=/swapfile bs=1024MB count=4
# mkswap /swapfile
# chmod 0600 /swapfile
# swapon /swapfile
# swapon -s
- 執行
./runInstaller
報錯:libXext.so.6
找不到
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-03-24_05-37-07PM. Please wait ...[oracle@vm088078 client]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2023-03-24_05-37-07PM/jdk/jre/lib/amd64/libawt_xawt.so: libXext.s
o.6: cannot open shared object file: No such file or directory
##解決辦法
# dnf -y install libXext.so.6
- 執行
./runInstaller
報錯無法執行xdpyinfo
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
## 解決辦法
# dnf -y install xdpyinfo
- 圖形化安裝報錯:INS-08101
[INS-08101] Unexpected error while executing the action at state: 'clientSupportedOSCheck'
## 解決辦法
$ export CV_ASSUME_DISTID=RHEL7.6