在redhat5.8 上安装oracle10g

时间:2023-02-03 17:06:28
在RedHat5.8上安装oracle10G之安装前期准备工作 更详细的访问:http://www.oracle.com/index.html 接下来的安装分两部分, 第一部分为前期准备工作 第二部分为oracle安装部分
第一部分:前期准备工作
1.关闭防火墙  关闭selinux [root@stu49 tmp]# /etc/rc.d/init.d/iptables stop [root@stu49 tmp]# setenforce 0
2.解压oracle10的安装包, gunzip 10201_database_linux_x86_64.cpio.gz mv 10201_database_linux_x86_64.cpio /tmp/ cd /tmp/ cpio -idmv < 10201_database_linux_x86_64.cpio [root@stu49 database]# ls doc  install response  runInstaller  stage  welcome.html [root@stu49 database]#
2.1.在解压的文件中,我们可以打开welcome.html这个网页选择Documentation-然后选择PDF;来查看详细安装信息 3.服务器内存缓存的检测,是否满足安装oracle的需求
[root@stu49 /]# grep MemTotal /proc/meminfo MemTotal:        3754408 kB [root@stu49 /]# grep SwapTotal /proc/meminfo SwapTotal:       4194296 kB [root@stu49 /]# free              total       used      free    shared    buffers     cached Mem:       3754408    3574748     179660          0      64324    2929116 -/+ buffers/cache:     581308    3173100 Swap:      4194296          0    4194296 [root@stu49 /]# df -k /tmp/ Filesystem           1K-blocks      Used Available Use% Mounted on /dev/mapper/vol0-root                       88891632   4399176  79977028   6% / [root@stu49 /]# [root@stu49 /]# df -k Filesystem           1K-blocks      Used Available Use% Mounted on /dev/mapper/vol0-root                       88891632   4399176  79977028   6% / tmpfs                  1877204       260   1876944   1%/dev/shm /dev/sda1              516040     77844    411984  16%/boot
4.查看系统版本内核 [root@stu49 /]# uname -a Linux oracle10g 2.6.32-279.el6.x86_64#1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux [root@stu49 /]# uname -r 2.6.32-279.el6.x86_64 [root@stu49 /]# cat /etc/redhat-release 这里需要我们注意,在安装的时候我们需要修改成RHEL4不然是无法安装的; Red Hat Enterprise Linux Server release 5.8 [root@stu49 /]# cat /proc/version Linux version 2.6.32-279.el6.x86_64 (mockbuild@x86-008.build.bos.redhat.com) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) )#1 SMP Wed Jun 13 18:24:36 EDT 2012 [root@stu49 /]#
5.修改计算机名字配置hosts [root@stu49 /]# hostname oracle2 [root@stu49 /]# echo "192.168.100.220oracle2" >> /etc/hosts [root@stu49 /]# cat /etc/hosts 删除/etc/hosts文件中其他的文件,直接添加如下的内容 192.168.100.220oracle2
6.安装相关依赖包 rpm -q binutils glibc-devel glib-devel compat-db control gcc gcc-c++ ld-linux.so.2 libXp.so.6 libXt.so.6  libXtst.so.6 libXp glibc glibc-common gnome-libs libstdc++ libstdc++-develmake sysstat xscreensaver
检查系统是否安装
7.创建用户和组.修改密码 [root@stu49 /]# groupadd dba [root@stu49 /]# groupadd oinstall [root@stu49 /]# useradd -g oinstall -G dba oracle [root@stu49 /]# id oracle uid=501(oracle) gid=502(oinstall)groups=502(oinstall),501(dba) [root@stu49 /]# echo 123.com | passwd --stdin oracle Changing passwordforuser oracle. passwd: all authentication tokens updated successfully. [root@stu49 /]# id nobody uid=99(nobody) gid=99(nobody)groups=99(nobody) [root@stu49 /]# 通过查看是否安装过没有 more /etc/oraInst.loc
8.修改系统参数内核 [root@stu49 etc]# sed -e '/^#/d' -e '/^$/d' /etc/sysctl.conf > 1.conf [root@stu49 etc]# mv 1.conf sysctl.conf [root@stu49 etc]# vim sysctl.conf [root@stu49 etc]# 查看 [root@stu49 etc]# cat sysctl.conf net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 ########################oracle##################### kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 [root@stu49 etc]# sysctl -p  生效
9.修改系统文件句柄的限制大小 [root@stu49 etc]# vim /etc/security/limits.conf [root@stu49 etc]# grep 'oralce' /etc/security/limits.conf [root@stu49 etc]# grep 'oracle' /etc/security/limits.conf oracle soft nproc 2048 oracle hard nproc 20480 oracle soft nofile 65535 oracle hard nofile 65535 [root@stu49 etc]#
10.修改系统pam模块 [root@stu49 etc]# vim /etc/pam.d/login [root@stu49 etc]# cat /etc/pam.d/login | grep limits session    required     pam_limits.so [root@stu49 etc]cat >>/etc/pam.d/login<<EOF   session required /lib/security/pam_limits.so
  EOF

[root@stu49 etc]#cat >>/etc/profile<<EOF
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/bash" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF


11.创建.软件安装目录 root 下 mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/

12.配置oracle用户环境变量 [root@stu49 etc]# su - oracle [oracle@oracle10g ~]$ [oracle@oracle10g ~]$ [oracle@oracle10g ~]$id uid=501(oracle) gid=502(oinstall)groups=502(oinstall),501(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [oracle@oracle10g ~]$echo$SHELL /bin/bash [oracle@oracle10g ~]$ vim .bash_profile 查看配置的环境变量 [oracle@oracle10g ~]$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/bin export PATH PATH=$ PATH:$HOME/bin export ORACLE_ALERT=/u01/app/oracle/admin/oracle2 export ORACLE_SID=orcl export ORACLE_HOME=/u01/app/oracle1 export ORACLE_DATA=/u01/app/oracle/oradata/oracle2 export TMP=/oracle/tmp export PATH=$ORACLE_HOME/bin:$PATH
[root@stu49 tmp]# cd /tmp/     [root@stu49 tmp]# chown oracle:oinstall database/ -R [root@stu49 tmp]# chmod 755 database/ -R [root@stu49 tmp]# xhost +   需要在服务器本机执行 [root@stu49 tmp]# su - oracle        以下执行必须在图形化界面下安装,远程需要VNC或者box支持图形化的来安装