1、创建用户、组、安装目录
/usr/sbin/groupadd -g 500 oinstall
/usr/sbin/useradd -u 500 -g oinstall -md /home/oracle oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod 775 /u01/app/oracle
2、上传安装介质
官网下载安装介质并上传
linuxamd64_12102_client.zip
# unzip linuxamd64_12102_client.zip
# ls -la
total 897928
drwxr-xr-x 4 root oinstall 4096 Mar 30 14:46 .
dr-xr-xr-x. 28 root root 4096 Mar 21 11:25 ..
drwxr-xr-x 6 root oinstall 4096 Jan 18 14:49 app
drwxr-xr-x 5 root root 4096 Jul 7 2014 client
-rw-r--r-- 1 root root 918555219 Mar 30 14:46 linuxamd64_12102_client.zip
3、安装客户端软件
本次实验是xshell远程连接,在执行图形安装的时候会自动调用xmanager的图形工具
# chown -R oracle:oinstall ./client/
# su - oracle
$ cd /u01/client/
$ ls -la
total 36
drwxr-xr-x 5 oracle oinstall 4096 Jul 7 2014 .
drwxr-xr-x 4 root oinstall 4096 Mar 30 14:46 ..
drwxr-xr-x 4 oracle oinstall 4096 Jul 7 2014 install
drwxrwxr-x 2 oracle oinstall 4096 Jul 7 2014 response
-rwxr-xr-x 1 oracle oinstall 8537 Jul 7 2014 runInstaller
drwxr-xr-x 14 oracle oinstall 4096 Jul 7 2014 stage
-rwxrwxr-x 1 oracle oinstall 500 Feb 7 2013 welcome.html
[oracle@git-server client]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB. Actual 20626 MB Passed
Checking swap space: 0 MB available, 150 MB required. Failed <<<<
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
Some requirement checks failed. You must fulfill these requirements before
continuing with the installation,
Continue? (y/n) [n] y
>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-03-30_03-09-54PM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh: % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
% <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock
执行安装脚本的时候报错
a.提示temp空间需要超过415MB剩余空间
b.swap空间要求150MB
输入“y”继续,仍然报错,
提示Make sure that client users are authorized to connect to the X Server.
# xclock
bash: xclock: command not found...
Similar command is: 'clock'
很显然,这里是没有安装x11相关的包
先解决这个图形界面的问题,安装相应的x11包
yum -y install xorg-x11-apps.x86_64
实际会安装两个包:libXaw-1.0.12-5.el7.x86_64.rpm、xorg-x11-apps-7.7-6.el7.x86_64.rpm
之后再来运行安装脚本,依然报错
[oracle@git-server ~]$ /tmp/client/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB. Actual 17016 MB Passed
Checking swap space: must be greater than 150 MB. Actual 991 MB Passed
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
Some requirement checks failed. You must fulfill these requirements before
continuing with the installation,
Continue? (y/n) [n] y
>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-03-30_04-12-54PM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh: % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
% <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock
网上说的各种办法也试了,然并卵,最后看了下root用户和oracle用户默认的DISPLAY
[root@git-server ~]# echo $DISPLAY
localhost:10.0
[root@git-server ~]# su - oracle
Last login: Thu Mar 30 16:12:49 CST 2017 on pts/0
[oracle@git-server ~]$ echo $DISPLAY
[oracle@git-server ~]$
root用户的为localhost:10.0 ,oracle用户为空
然后执行了下oracle用户下执行$ export DISPLAY=localhost:10.0
这应该是环境变量的问题,或者直接用oracle用户登录,不要用root登录然后su - oracle
[oracle@git-server ~]$ export DISPLAY=localhost:10.0
[oracle@csv-ora12c-rac2 client]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB. Actual 12690 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed



安装提示缺少的包
其他的包在ISO里面都有,这个都可以到下面的链接去下载 compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
http://download.csdn.net/detail/w455742999/8788777




第一次安装的话会需要执行这个脚本
4、验证是否安装成功
进入安装目录,执行sqlplus命令,说明已安装成功
[oracle@git-server client_1]$ ./sqlplus
./sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
[oracle@git-server client_1]$
这时候没有去设置环境变量,所以直接执行会报错,报错也很明显,找不到libsqlplus.so这个文件
vi ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/client_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME:/lib:/usr/lib:/usr/local/lib
export PATH=$ORACLE_HOME:$PATH
[oracle@git-server ~]$source ~/.bash_profile
[oracle@git-server ~]$ sqlplus
SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 30 17:03:23 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name:
安装完成