1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
在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++-devel  make   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 password  for  user 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
oraclesoftnproc2048
oraclehardnproc20480
oraclesoftnofile65535
oraclehardnofile65535
[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] #
11.创建..磁盘问题 权限问题
[root@stu49 etc] # mkdir /oracle/app/dbhome -p
[root@stu49 etc] # chown -R oracle:oinstall /oracle/app/dbhome/
[root@stu49 etc] # chmod -R 755 /oracle/app/dbhome/
[root@stu49 etc] # mkdir /u01/app/oracle -p
[root@stu49 etc] # chown -R oracle:oinstall /u01/app/oracle/
[root@stu49 etc] # chmod 755 -R /u01/app/oracle/
[root@stu49 etc] # mkdir /oracle/tmp
[root@stu49 etc] # chmod a+wr /oracle/tmp/
[root@stu49 etc] # chown oracle:oinstall /oracle/tmp/
[root@stu49 etc] #
[root@stu49 ~] # mkdir /oracle/app/dbhome -p && chown -R oracle:oinstall /oracle/app/dbhome/ && chmod -R 755 /oracle/app/dbhome/
[root@stu49 ~] # mkdir /u01/app/oracle -p && chown -R oracle:oinstall /u01/app/oracle/ && chmod 755 -R /u01/app/oracle/
[root@stu49 ~] # mkdir /oracle/tmp && chmod a+wr /oracle/tmp/ && chown oracle:oinstall /oracle/tmp/
[root@stu49 ~] #
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=oracle2
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支持图形化的来安装

本文转自devilangel 51CTO博客,原文链接:http://blog.51cto.com/devliangel/1284704,如需转载请自行联系原作者