【2017/4/12】RHEL7下安装oracle11.2.0.4软件

来源:互联网 发布:手机淘宝店怎么申请 编辑:程序博客网 时间:2024/05/22 03:22

linux安装可以参考:http://blog.csdn.net/ssrmygod/article/details/70037780


修改IP和hosts

[root@xiaopengfei17-2-21 ~]# cat /etc/hostname 
mygod
[root@xiaopengfei17-2-21 ~]# 

[root@xiaopengfei17-2-21 ~]# ifconfig 
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.111  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::20c:29ff:fe61:5007  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:61:50:07  txqueuelen 1000  (Ethernet)
        RX packets 1059  bytes 153984 (150.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 968  bytes 114393 (111.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@xiaopengfei17-2-21 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.111 mygod

[root@xiaopengfei17-2-21 ~]# 



关闭selinux和防火墙

[root@xiaopengfei17-2-21 ~]# vi /etc/selinux/config 
[root@xiaopengfei17-2-21 ~]# cat /etc/selinux/config


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 




[root@xiaopengfei17-2-21 ~]# 

[root@xiaopengfei17-2-21 ~]# systemctl stop iptables
[root@xiaopengfei17-2-21 ~]# systemctl stop firewalld.service 
[root@xiaopengfei17-2-21 ~]# systemctl disable firewalld.servicere 
[root@xiaopengfei17-2-21 ~]# systemctl disable iptables
[root@xiaopengfei17-2-21 ~]# 

root@xiaopengfei17-2-21 ~]# reboot



修改用户的SHELL的限制,修改/etc/security/limits.conf文件

[root@mygod ~]# vi /etc/security/limits.conf
[root@mygod ~]# tail -6 /etc/security/limits.conf
# End of file
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240
[root@mygod ~]# 

修改/etc/pam.d/login 文件

[root@mygod ~]# tail -2 /etc/pam.d/login
session   required    /lib/security/pam_limits.so 
session   required    pam_limits.so
[root@mygod ~]# 


修改linux内核‘

[root@mygod ~]# vi  /etc/sysctl.conf
[root@mygod ~]# cat /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586


[root@mygod ~]# sysctl  -p
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586
[root@mygod ~]# 



设置oracle用户或者oracle用户在ksh解释器环境下的资源限制使用

[root@mygod ~]# tail -8 /etc/profile
if [ $USER = "oracle" ]; then 
if [ $SHELL = "/bin/ksh" ]; then 
  ulimit -p 16384 
  ulimit -n 65536 
else 
  ulimit -u 16384 -n 65536 
fi
fi
[root@mygod ~]# 

[root@mygod ~]# source /etc/profile
[root@mygod ~]# 



检查是否缺少rpm包

[root@mygod ~]# yum -y install binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-C++glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel


创建相关用户和组

[root@mygod ~]# groupadd oinstall
[root@mygod ~]# groupadd dba
[root@mygod ~]# 
[root@mygod ~]# useradd -g oinstall -G dba oracle
[root@mygod ~]# echo redhat |passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@mygod ~]# 

[root@mygod ~]# mkdir /home/oracle/app/oracle
[root@mygod ~]# mkdir /home/oracle/app/oradata
[root@mygod ~]# mkdir /home/oracle/app/oracle/product
[root@mygod ~]# mkdir /home/oracle/app
[root@mygod ~]# chown -R oracle:oinstall /home/oracle/app


配置oracle用户的环境变量

[root@mygod ~]# su - oracle 
[oracle@mygod ~]$ vi .bash_profile 
[oracle@mygod ~]$ source .bash_profile
[oracle@mygod ~]$ cat .bash_profile
# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi


# User specific environment and startup programs


PATH=$PATH:$HOME/.local/bin:$HOME/bin


export PATH
export ORACLE_BASE=/home/oracle/app
 
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
 
export ORACLE_SID=mygod
 
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib


[oracle@mygod ~]$ 


解压p13390677_112040_Linux-x86-64_1of7.zip和p13390677_112040_Linux-x86-64_2of7.zip

unzip p13390677_112040_Linux-x86-64_1of7.zip

unzip p13390677_112040_Linux-x86-64_2of7.zip

[oracle@mygod app]$ ll 
total 2487200
drwxr-xr-x 7 oracle oinstall        128 Aug 27  2013 database
drwxr-xr-x 3 oracle oinstall         20 Apr 12 12:52 oracle
drwxr-xr-x 2 oracle oinstall          6 Apr 12 12:52 oradata
-rw-r--r-- 1 root   root     1395582860 Apr 12 13:06 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 root   root     1151304589 Apr 12 13:06 p13390677_112040_Linux-x86-64_2of7.zip
[oracle@mygod app]$ cd database/
[oracle@mygod database]$ ls
install  readme.html  response  rpm  runInstaller  sshsetup  stage  welcome.html
[oracle@mygod database]$ ./runInstaller 

接下来安装,报错!!!

[oracle@mygod database]$ ./runInstaller 
Starting Oracle Universal Installer...


Checking Temp space: must be greater than 120 MB.   Actual 9391 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2047 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-04-12_01-29-30PM. 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
[oracle@mygod database]$ 



解决方法:

首先这个包先装上

[root@mygod ~]# yum -y install  xorg-x11-apps.x86_64

正确的登录方式:在字符界面,使用 oracle 用户通过 start x登录 Xwindow,即可进行安装。或者以图形界面启动系统,再使用 oracle 用户登陆,即可进行安装。  
      
失败的登陆方式:以root用户登录Xwindow,然后su - oralce,这样在进行安装时,就会提示上述那些错误了。  


接下来的过程参考:http://blog.csdn.net/ssrmygod/article/details/69944691

这篇写的也很详细:http://www.jb51.net/article/53769.htm

到这里发现少一些包,还有一些警告





官方对swap是有要求的:


[root@mygod ~]# grep SwapTotal /proc/meminfo 
SwapTotal:       2097148 kB
[root@mygod ~]# grep MemTotal /proc/meminfo 
MemTotal:        2035648 kB
[root@mygod ~]# 

这里我就增加一点swap:

[root@mygod ~]# dd if=/dev/zero of=/swap.img count=1000 bs=1M
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 16.8757 s, 62.1 MB/s
[root@mygod ~]# mkswap /swap.img 
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=18e9b6ef-728f-465b-bda4-a770b0c005af
[root@mygod ~]# swapon /swap.img
swapon: /swap.img: insecure permissions 0644, 0600 suggested.
[root@mygod ~]# echo "/swap.img swap swap defaults 0 0" >>/etc/fstab 
[root@mygod ~]# grep SwapTotal /proc/meminfo 
SwapTotal:       3121144 kB
[root@mygod ~]# grep MemTotal /proc/meminfo 
MemTotal:        2035648 kB
[root@mygod ~]# 


再去yum install -y 所有缺失的包就行




















0 0
原创粉丝点击