温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

bayaim_linuxRedHat5_install_oracle11gR2.txt

发布时间:2020-06-07 05:08:09 来源:网络 阅读:440 作者:baipingyang520 栏目:关系型数据库

bayaim_linuxRedHat5_install_oracle11gR2

 

 
linux_install_oracle_11g:

 


检查服务器的内存,可以通过下列命令:
[]#grep MemTotal /proc/meminfo

检查内存及交换空间:Oracle 要求内存至少为1G,。当内存为1G—2G时,交换空间要

求为
内存的1.5 倍:
[]#free

查看当前服务器swap交换分区大小,可以通过下列命令:
[]#grep SwapTotal /proc/meminfo

查看系统当前共享内存,可以通过df命令,例如:
[root@jssnode1~]#df -h /dev/shm

查看系统架构
[root@jssnode1~]#uname -m

首先/tmp至少要有1g的空闲空间,查看/tmp的磁盘空间,也可以通过df命令查看,例
如:
[root@jssnode1~]#df -h /tmp

软件环境检查
[root@jssnode1~]#cat /etc/issue

查看内核版本可以通过uname命令,例如:
[root@jssnode1~]#uname -r

从CD的“server”目录下找到缺少的软件包,将其复制到新创建的目录/rpms 下:
重新挂载:

不同的操作系统以及架构,所需要安装的系统包也不相同,这里仅以三思使用的64bit
OracleEnterpriseLinux5为例,需要下列系统包:(29 个包)
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3(32bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24(32bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5(32bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106(32bit)
libaio-devel-0.3.106
libaio-devel-0.3.106(32bit)
libgcc-4.1.2
libgcc-4.1.2(32bit)
libstdc++-4.1.2
libstdc++-4.1.2(32bit)
libstdc++-devel4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-2.2.11(32bit)
unixODBC-devel-2.2.11
unixODBC-devel-2.2.11(32bit)

数了数还是相当多的,要检查是否确认安装指定了系统包,可以通过rpm-q命令,例
如:
[root@jssnode1~]#rpm -aq gcc
[root@jssnode1~]#rpm -aq grep | gcc
[root@localhost /]# rpm -aq | grep compat
[root@localhost /]# rpm -aq | grep elfutils
[root@localhost /]# rpm -aq | grep libstdc
[root@localhost /]# rpm -aq | grep sysstat
[root@localhost /]# rpm -aq | grep unixODBC
[root@localhost /]# rpm -aq | grep libaio
[root@localhost /]# rpm -aq | grep libgcc
[root@localhost /]# rpm -aq | grep make
[root@localhost /]# rpm -aq | grep ksh
[root@localhost /]# rpm -aq | grep binu

…………

建放未安装的包的目录:

[root@linuxserv5 ~]# mkdir /rpms

得到未安装的包:
[root@localhost rpms]# ls
compat-libstdc++-33-3.2.3-61.i386.rpm  unixODBC-2.2.11-7.1.i386.rpm
libaio-devel-0.3.106-3.2.i386.rpm      unixODBC-devel-2.2.11-7.1.i386.rpm
sysstat-7.0.2-3.el5.i386.rpm


对于尚未安装的系统包,也可以通过rpm 命令进行安装,例如安装sysstat系统包,执
行操作如下(当然啦,rpm进行安装前首先要找到该包,一般是到操作系统的安装光盘

中找,
如果光盘中没有,也可以到操作系统网站查询):

[root@localhost rpms]# rpm -Uvh *


或者逐个安装:

[root@jssnode1Server]#rpm -ivh sysstat-7.0.2-3.el5.x86_64.rpm
warning:sysstat-7.0.2-3.el5.x86_64.rpm: HeaderV3DSAsignature: NOKEY,key ID
1e5e0159
Preparing... ###########################################[100%]
1:sysstat ###########################################[100%]


修改Linux 内核参数

使用vi命令编辑/etc/sysctl.conf 文件,例如:
按“o”字母键进入粘贴,“:wq”保存退出:

[root@jssnode1Server]#vi/etc/sysctl.conf
将下列内容加入该文件:
fs.aio-max-nr=1048576
fs.file-max=6815744
kernel.shmall=2097152
kernel.shmmax=536870912
kernel.shmmni=4096
kernel.sem=25032000100128
net.ipv4.ip_local_port_range=900065500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586


或者:
 
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
 
使内核参数立即生效:
 
[root@linuxserv7 ~]# sysctl –p

使用groupadd命令创建组,操作如下:
[root@jssnode1~]#groupadd -g 502 dba

然后创建OracleInventory组,该组组名通常定义为oinstall,创建命令如下:
[root@jssnode1~]#groupadd oinstall

创建ORACLE的owner用户,一般也命令为oracle,操作如下:
[root@jssnode1~]#useradd -u 502 -g oinstall -G dba oracle

然后为该用户设置密码,操作如下:
[root@jssnode1~]#passwd oracle

验证nobody用户:
[root@localhost rpms]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)

context=root:system_r:unconfined_t:SystemLow-SystemHigh

[root@localhost rpms]# id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

context=root:system_r:unconfined_t:SystemLow-SystemHigh

创建文件系统 /db (如果 / 空间尺寸允许,也可以直接在 / 文件系统下创建目录

/db )。 
 
改变文件系统/db 的所有者,以便以后将数据库安装在/db 文件系统上:
 
[root@localhost rpms]# cd /
[root@localhost /]# ls
bin   dev  home  lost+found  misc  net  proc  rpms  selinux  sys  usr
boot  etc  lib   media       mnt   opt  root  sbin  srv      tmp  var
[root@localhost /]# mkdir db
[root@localhost /]# ls
bin   dev   lib         misc  opt   rpms     srv  usr
boot  etc   lost+found  mnt   proc  sbin     sys  var
db    home  media       net   root  selinux  tmp
[root@localhost /]# chown oracle:oinstall /db
[root@linuxserv7 ~]# chown oracle:oinstall /db/sw
[root@localhost /]# mkdir /db/sw
[root@localhost /]#

--------------------------------------------------------------------
为oracle 用户设置环境变量 :
用文本编辑器vi 编辑.bash_profile 参数文件:
[oracle@linuxserv7 ~]$ pwd
/home/oracle 
[oracle@linuxserv7 ~]$ vi .bash_profile  
# .bash_profile
 
# Get the aliases and functions
 
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
# User specific environment and startup programs
ORACLE_SID=sdzy
ORACLE_BASE=/db/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORACLE_SID ORACLE_BASE ORACLE_HOME
 
PATH=$PATH:/$ORACLE_HOME/bin:$HOME/bin
 
export PATH
~                                    
---------------------------------------------------------------------
上一步或者可以如下设置:

/*
最后使用chown命令修改目录的所有者为oracle用户:
[root@jssnode1~]#chown-Roracle:oinstall/data/ora11g
[root@jssnode1~]#chown-Roracle:oinstall/data/software
使用vi命令编辑/home/oracle/.bash_profile,补充下列内容:
exportTMP=/tmp
exportTMPDIR=$TMP
exportORACLE_BASE=/data/ora11g
exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
exportORACLE_SID=jssdb
exportORACLE_TERM=xterm
exportPATH=/usr/sbin:$PATH
exportPATH=$ORACLE_HOME/bin:$PATH
export
LD_LIBRARY_PATH=

$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
exportLD_ASSUME_KERNEL=2.6.18
exportNLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
umask022
if[$USER="oracle"];then
if[$SHELL="/bin/ksh"];then
ulimit-p16384
ulimit-n65536
else
ulimit-u16384-n65536
fi
fi
/

-----------------------------------------------------------------------

为 Oracle  用户设置 Shell  限制 :
[oracle@localhost ~]$ su - root

[oracle@localhost ~]$ vi /etc/security/limits.conf
在文件最下方输入以下内容:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
 
[oracle@localhost ~]$ vi /etc/pam.d/login

在文件最下方输入以下内容:
 
session required /lib/security/pam_limits.so
 
[oracle@localhost ~]$ vi /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


上传数据库软件到/db/sw 目录
Xmanager
或者:VMware Tools直接拖过去:

 
以oracle 用户上传并解压数据库软件:
 
[oracle@linuxserv5 sw]$ pwd
/db/sw
[oracle@linuxserv5 sw]$ ls
linux_x86_11gR1_database.zip
[oracle@linuxserv5 sw]$ unzip linux_x86_11gR1_database.zip

/*<注意SW 目录的权限所有者
[root@linuxserv7 ~]# chown oracle:oinstall /db/sw >
/

 经过一番准备,终于正式进入到安装步骤了。这里我们使用OUI来安装ORACLE,因
此操作需要在视窗界面下进行。以oracle用户启动到视窗状态,打开一个终端。
提示:
如果是以root用户启动的话,需要首先执行:
[root@jssnode1~]#xhost+
Access control disabled,clients can connect from any host 

关闭所有连接  才能执行成功

/*
LINUX 设置 xhost access control disabled, clients can connect from any host

  第一步:用root登陆linux,启动vnc服务;


第二步:根据vnc起来的端口,设置export DISPLAY=localhost:1(1表示vnc在第一个

tty上启动的)


第三步:执行xhost +,并且提示“access control disabled, clients can connect

from any host”才正确。

linux下的操作日志如下:

New 'localhost:1 (root)' desktop is localhost:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost:1.log
/


[root@jssnode1~]#su - oracle
[oracle@jssnode1~]$
进入到oracle软件的安装目录下,执行runInstall即可:
[oracle@jssnode1~]$cd /db/sw/database/
[oracle@jssnode1database]$./runInstaller
StartingOracleUniversalInstaller...

 
  须要设置下环境变量,登录客户端的IP地址(使用SecureCRT远程登录的本机),注意

启动
  xmanager passive并在SecureCRT设置启动X11。
 
  [oracle@localhost Disk1]$ export DISPLAY=134.98.105.169:0.0
  [oracle@localhost Disk1]$

[root@jssnode1~]#su - root
[root@linuxserv7 ~]# sh /db/or acle/oraInventory/orainstRoot.sh
[root@linuxserv7 ~]# sh /db/ oracle/product/11.1.0/db_1/root.sh
$ORACLE_HOME/bin/netca
[oracle@linuxserv7 ~]$ netca
[oracle@linuxserv7 ~]$ dbca

没有用远程管理工具管理桌面,后来定位是xhost的问题,解决方法如下:
1 利用root用户登陆,查看DISPLAY变量----echo $DISPLAY,确保为“:0.0”;
2 运行xclock,确保能弹出时钟;
3 运行"xhost +",该命令的解释:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++
因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需

要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的

用户执行如下命令
        xhost +
    这个命令将允许别的用户启动的图形程序将图形显示在当前屏幕上.

xhost 是用来控制X server访问权限的。
通常当你从hostA登陆到hostB上运行hostB上的应用程序时,
做为应用程序来说,hostA是client,但是作为图形来说,
是在hostA上显示的,需要使用hostA的Xserver,所以hostA是
server.因此在登陆到hostB前,需要在hostA上运行xhost +
来使其它用户能够访问hostA的Xserver.
xhost + 是使所有用户都能访问Xserver.
xhost + ip使ip上的用户能够访问Xserver.
xhost + nis:user@domain使domain上的nis用户user能够访问
xhost + inet:user@domain使domain上的inet用户能够访问。
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++
4 切换到oracle,运行./runInstall即可安装。

 


在RedHat as5上安装Oracle11g时不能启动GUI报错如下:

[oracle@sense disk1]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 1184 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3027 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,at which time they will be rechecked.

Continue? (y/n) [n]

解决办法:
       注销登录用户,使用oracle安装用户重新登录系统即可解决,比如之前已经创

建好的安装用户oracle,使用oracle用户登录系统就可以解决问题


[oracle@sense disk1]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 1184 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3027 MB   

Passed
Checking monitor: must be configured to display at least 256 colors.   

Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-01

-03_05-06-47PM. Please wait .

 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI