1.root身份安装依赖包
登录图像界面,在yast-software management中搜索oracle ,把相关的包安装上就可以了。反正如果安装oracle提示还有依赖包,找到关键字在这里搜索安装就OK。
2.修改文件打开限制
vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
3.修改内核参数
vim /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2062557184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
# /sbin/sysctl –p 生效配置
4.创建Oracle账号
groupadd -g 2001 oracleinst
groupadd -g 2002 dba
groupadd -g 2003 oper
useradd -m oracle -u 2001 -g oracleinst -G dba,oper
passwd oracle
5.修改环境变量
vim /home/oracle/.bash_profile
ORACLE_BASE=/usr/app/oracle
ORACLE_SID=sales
ORACLE_HOME=/usr/app/oracle/product/12.2.0/db/
export ORACLE_BASE ORACLE_SID ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
6.创建oracle安装目录
mkdir -p /usr/app/oracle
chown -R oracle:oraclinstall /usr/app
chmod -R 755 /usr/app
防备出现runInstaller: line 97: /usr/app/oracle/database/install/.oui: Permission denied
7.安装
#切换用户oracle,进入安装目录
[oracle@o2 data]$ su oracle
[oracle@o2 data]$ cd database/
可能遇到问题
问题一:./runInstaller.sh: line 5: ./runInstaller: No such file or directory
[oracle@o2 database]$ ./runInstaller
千万不要自作多情,运行如下:
database/install/runInstaller.sh
而应该直接运行:
database/runInstaller
问题二:
cannot connect to X11 window server using ':0' as the value of the DISPLAY variable
这是因为没有赋予oracle运行图形界面的权限,这时只要在root下运行xhost + 然后回车即可解决问题。
[root@oracle ~]# xhost local:oracle
后面就点点鼠标,到最后按提示运行两个脚本就可以了。
这里要注意如果你前面的安装配置过程还没有完成,就点下一步就会提示:ins-32091错误,你就前面的安装过程完成。
问题三:运行sqlplus 提示找不到这个命令
即便使用ln -s $ORACLE_HOME/bin/sqlplus /usr/bin 也不行
检查发现是自己的.bash_profile中ORACLE_HOME=/USR/APP/ORACLE/PRODUCT/12C/DB/ 最后多了一个/
导致path应用此环境变量就成了//bin/sqlplus
如果没有遇到这些问题,就顺利完成安装。