1 修改内核参数 /etc/sysctl.conf 加上如下内容
vi /etc/sysctl.conf
[root@localhost ~]# sysctl -p
net.ipv4.ip_forward = 0
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
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
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
kernel.shmall = 268435456
fs.file-max = 6815744
原则:按照上面的数值应该能够安装成功,若是失败的话,在用OUI安装的时候会提示期望值和当前值,修改即可
然后使用
sysctl -p 更新内核参数
/root/Desktop/sendpix0.jpg
2 创建oracle用户和组及安装目录(OFA准则创建安装目录和数据文件及闪回恢复区的位置,以及保证
日志和控制文件的多路复用,以及数据文件的负载均衡)
mkdir -p /u01/app/oracle/pruduct/11.2.0/db_1
chmod -R 744 /u01
groupadd oinstall (创建用户组oinstall)
groupadd dba (创建用户组dba)
useradd -g oinstall -G dba -d /u01/app/oracle -p oracle oracle(这个地方设置的帐号密码似乎不可用 使用passwd username 然后修改设置的密码即可)
chown -R oracle:oinstall /u01/app/oracle
[root@localhost ~]# mkdir -p /boot/u01/app/oracle/product/11.2.0/db_1
[root@localhost ~]# mkdir -p /boot/u02/oradata/recovery_area
[root@localhost ~]# mkdir -p /boot/u03/oradata/
[root@localhost ~]# mkdir -p /boot/u04/oradata/
[root@localhost ~]# mkdir -p /boot/u05/oradata/
[root@localhost u01]# chmod -R 744 /boot/u01
[root@localhost u01]# chmod -R 744 /boot/u02
[root@localhost u01]# chmod -R 744 /boot/u03
[root@localhost u01]# chmod -R 744 /boot/u04
[root@localhost u01]# chmod -R 744 /boot/u05
[root@localhost u01]# chown -R oracle:oinstall /boot/u01
[root@localhost u01]# chown -R oracle:oinstall /boot/u02
[root@localhost u01]# chown -R oracle:oinstall /boot/u03
[root@localhost u01]# chown -R oracle:oinstall /boot/u04
[root@localhost u01]# chown -R oracle:oinstall /boot/u05
3 修改用户的环境变量
su – oracle
vi .profile 添加
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/bin:/usr/css/bin:/etc:/usr/binx11:/usr/local/bin
export ORACLE_BASE=/boot/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=orcl
export ORAENV_ASK=./usr/local/bin/oraenv
umask 022
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
使用export $name 查看相应变量是否设置正确,这个地方由于自己一时不注意少设置了PATH变量
使用不了SQLPLUS 因为系统找不到PATH路径
修改如下
[oracle@localhost ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@localhost ~]$ export $PATH
-bash: export: `/boot/u01/app/oracle/product/11.2.0/db_1/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/bin:/usr/bin:/usr/css/bin:/etc:/usr/binx11:/usr/local/bin': not a valid identifier
[oracle@localhost ~]$ sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 2 19:59:47 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: scott
Enter password:
4 为oracle用户设置shell的限制
1、gedit /etc/security/limits.conf 加入如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 10240
2、gedit /etc/pam.d/login 加入
session required /lib/security/pam_limits.so
3、gedit /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@localhost oracle]#
xhost local:oracle non-network local connections being added to access control list
non-network local connections being added to access control list
xhost: bad hostname "non-network"
xhost: bad hostname "local"
xhost: bad hostname "connections"
xhost: bad hostname "being"
xhost: bad hostname "added"
xhost: bad hostname "to"
xhost: bad hostname "access"
xhost: bad hostname "control"
xhost: bad hostname "list"
[root@localhost oracle]#
su - oracle
-bash: [oracle=oracle]: command not found
[oracle@localhost ~]$ cd ~/database
[oracle@localhost database]$
./runInstaller
正在启动 Oracle Universal Installer...
检查临时空间: 必须大于 80 MB。 实际为 3459 MB 通过
检查交换空间: 必须大于 150 MB。 实际为 4031 MB 通过
检查监视器: 监视器配置至少必须显示 256 种颜色。 实际为 16777216 通过
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2011-04-01_10-38-09PM. 请稍候...[oracle@localhost database]$
过程中会提示执行两个脚本
[root@localhost ~]# cd /boot/u01/app/oraInventory/
[root@localhost oraInventory]# sh orainstRoot.sh
更改权限/boot/u01/app/oraInventory.
添加组的读取和写入权限。
删除全局的读取, 写入和执行权限。
更改组名/boot/u01/app/oraInventory 到 oinstall.
脚本的执行已完成。
[root@localhost oraInventory]# cd /boot/u01/app/oracle/product/11.2.0/db_1/
[root@localhost db_1]# sh root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /boot/u01/app/oracle/product/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost db_1]#
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24890594/viewspace-691553/,如需转载,请注明出处,否则将追究法律责任。