我的机器:
Linux xbfye7l02 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
安装的oracle版本11.2.0.1 64位
1.创建组和oracle用户
[root@xbfye7l02 oracle]# /usr/sbin/groupadd oinstall
[root@xbfye7l02 oracle]# /usr/sbin/groupadd dba
[root@xbfye7l02 oracle]# id oracle
id: oracle: No such user
[root@xbfye7l02 oracle]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@xbfye7l02 oracle]# passwd oracle
2.创建需要的目录
[root@xbfye7l02 oracle]# mkdir -p /apps/oracle
[root@xbfye7l02 oracle]# chown -R oracle:dba /apps/oracle
[root@xbfye7l02 oracle]# chmod -R 775 /apps/oracle
[root@xbfye7l02 oracle]# chown -R oracle:oinstall /apps/soft/oracle/
[root@xbfye7l02 oracle]# chmod -R 775 /apps/soft/oracle/
[root@xbfye7l02 oracle]# mkdir -p /apps/oraInventory
[root@xbfye7l02 oracle]# chown -R oracle:oinstall /apps/oraInventory/
3.修改内核参数
[root@localhost ~]# vi /etc/sysctl.conf
kernel.shmall = 4294967296
kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
# semaphores:semmsl,semmns,semopm,semmni
kernel.sem=250 32000 100 128
fs.file-max=6815744
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=1048576
fs.aio-max-nr=1048576
让修改的参数马上生效
[root@localhost ~]# /sbin/sysctl -p
4.修改oracle用户的资源限制
[root@localhost ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
5.在系统光盘中找到下面几个包并进行安装
root@localhost rpm]# ls
--以下只是我机器中缺的包,可按实际情况安装。
libaio-devel-0.3.106-5.i386.rpm unixODBC-2.2.11-7.1.i386.rpm unixODBC-devel-2.2.11-7.1.x86_64.rpm
libaio-devel-0.3.106-5.x86_64.rpm unixODBC-2.2.11-7.1.x86_64.rpm
sysstat-7.0.2-3.el5_5.1.x86_64.rpm unixODBC-devel-2.2.11-7.1.i386.rpm
6.修改oracle用户参数
[oracle@localhost ~]$ vi .bash_profile
export EDITOR=vi
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_home
export ORACLE_SID=
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
stty erase ^H
umask 022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7.安装
[root@xbfye7l02 oracle]# mkdir -p /apps/oraInventory
[root@xbfye7l02 oracle]# chown -R oracle:oinstall /apps/oraInventory/
[root@xbfye7l02 oracle]# /apps/oraInventory/orainstRoot.sh
Changing permissions of /apps/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /apps/oraInventory to oinstall.
The execution of the script is complete.
[root@xbfye7l02 oracle]# /apps/oracle/product/11.2.0/db_home/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /apps/oracle/product/11.2.0/db_home
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@xbfye7l02 oracle]#
8.安装rlwrap(可选)
参见文章:
http://blog.csdn.net/tanqingru/article/details/7448128
如果不安装就注释掉步骤6中的下面两行
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"