Linux安装Oracle19c Client
2023-03-27 14:52 williamzheng 阅读(2114) 评论(0) 编辑 收藏 举报一、环境准备
1.1 软件下载
下载地址:https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
其中client的是需要图形界面安装的,client_home是静默安装的,可自行选择,本文采用图形界面安装
本文档操作系统版本为:RochyLinux 8.6
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
WilliamZheng©版权所有 转载请注明出处! 觉得对您有帮助请点个赞哟~ 运维架构师群:833329925