rhel6.3 install oracle 11g(11.2.0.3)

根据官方文档+自己看资料总结

Os:rhel6.3

oracle:oracle 11G (11.2.0.3)

selinux disabled,iptables stopped

HOSTNAME=oracle

IPADDR=192.168.122.11

1.Host files

       vi /etc/hosts

           127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

           ::1

           localhost localhost.localdomain localhost6 localhost6.localdomain6

           192.168.122.11 oracle

           要将主机名对应到真实 IP 地址,否则 oracle 有可能把监听程序只建立在 127.0.0.1 上

2.Install Packages

       yum groupinstall -y "Compatibility libraries"

       yum install -y binutils-2*x86_64* glibc-2*x86_64* nss-softokn-freebl-3*x86_64* glibc-

       2*i686* nss-softokn-freebl-3*i686* compat-libstdc++-33*x86_64* glibc-common-2*x86_64* glibc-

       devel-2*x86_64* glibc-devel-2*i686* glibc-headers-2*x86_64* elfutils-libelf-0*x86_64* elfutils-

       libelf-devel-0*x86_64* gcc-4*x86_64* gcc-c++-4*x86_64* ksh-*x86_64* libaio-0*x86_64* libaio-

       devel-0*x86_64* libaio-0*i686* libaio-devel-0*i686* libgcc-4*x86_64* libgcc-4*i686* libstdc++-

       4*x86_64* libstdc++-4*i686* libstdc++-devel-4*x86_64* make-3.81*x86_64* numactl-devel-

       2*x86_64* sysstat-9*x86_64* compat-libstdc++-33*i686* compat-libcap*

       在 oracle 安装过程中会提示缺失 pdksh-5.2.14

       解决办法,网上下载 pdksh-5.2.14-1.i386.rpm

       rpm -ivh pdksh-5.2.14-1.i386.rpm

       提示:pdksh conflicts with ksh-20100621-16.el6.x86_64

       rpm -e ksh-20100621-16.el6.x86_64

       rpm -ivh pdksh-5.2.14-1.i386.rpm

       //Oracle check succeed

3.kernel parameter settings(配置内核参数)

       vi /etc/sysctl.conf

           #kernel settings for oracle

           fs.suid_dumpable = 1

           fs.aio-max-nr = 1048576

           fs.file-max = 6815744

           kernel.shmall = 2097152

           kernel.shmmax = 536870912

           kernel.shmmni = 4096

           # semaphores: semmsl, semmns, semopm, semmni

           kernel.sem = 250 32000 100 128

           net.ipv4.ip_local_port_range = 9000 65500

           net.core.rmem_default=4194304

           net.core.rmem_max=4194304

           net.core.wmem_default=262144

           net.core.wmem_max=1048586

run the following command to change the current kernel parameter

       /sbin/sysctl -pvi /etc/security/limits.conf

           oracle        soft nproc 2047

           oracle        hard nproc 16384

           oracle        soft nofile 4096

           oracle        hard nofile 65536

           oracle        soft stack 10240

           vi /etc/pam.d/login

           #pam for oracle

           session required pam_limits.so

4.add user and groups

       groupadd -g 501 oinstall

       groupadd -g 502 dba

       groupadd -g 503 oper

       groupadd -g 504 asmadmin

       groupadd -g 505 asmdba

       groupadd -g 506 asmoper

       useradd -u 501 -g oinstall -G dba,asmdba,oper oracle

       passwd oracle

5.create the directory in which Oracle software will be installed

       mkdir -p /u01/app/oracle/product/11.2.0/db_1

       chown -R oracle:oinstall /u01

       chmod -R 775 /u01

6.oracle environment settings

       vi /etc/profile

       #profile settings for oracle

       if [ $USER = "oracle" ]

       then

       if [ $SHELL = "/bin/ksh" ]

       then

       ulimit -p 16384

       ulimit -n 65536

       else

       ulimit -u 16384 -n 65536

       fi

       fi

       Login as oracle user

       su �C oracle

       vi ~/.bash_profile

       #.bash_profile setting for oracle

       TMP=/tmp; export TMP

       TMPDIR=$TMP; export TMPDIR

       ORACLE_HOSTNAME=oracle; export ORACLE_HOSTNAME

       ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME

       ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

       ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

       ORACLE_SID=DB11G; export ORACLE_SIDPATH=/usr/sbin:$PATH; export PATH

       PATH=$ORACLE_HOME/bin:$PATH; export PATH

       LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

       CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

       上述步骤完成重启系统

7.Start Oracle software installation

       以下步骤在图形用户界面下执行

       Login as oracle user

       su �C oracle

       Unzip the files

#11.2.0.3

       unzip p10404530_112030_Linux-x86-64_1of7.zip

       unzip p10404530_112030_Linux-x86-64_2of7.zip

       cd database/

       ./runInstaller

8.about configuration

       $ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

       Login as root

       修改$ORACLE_HOME/bin/dbstart 和$ORACLE_HOME/bin/dbshut,将

       ORACLE_HOME_LISTNER=$1 改为 ORACLE_HOME_LISTNER=$ORACLE_HOME

       vi /etc/oratab

       orcl:/u01/app/oracle/product/11.2.0/db_1:N 修改为 orcl:/u01/app/oracle/product/11.2.0/db_1:Y

       如果为 Y 则实例可以通过 dbstart 启动,sqlplus 连接后数据库即为 open 状态,如果为 N 则实例不能通

       过 dbstart 启动,sqlplus 连接实例时显示”Connected to an idle instance”

       修改.bash_profile 下的 ORACLE_SID 使其与你设置的 ORACLE_SID 相匹配

9.START and SHUT UP oracle database

       Login as oracle user

       START:

           方法1:

           emctl start dbconsole

           sqlplus / as sysdba

           SQL>startup

           方法2:

           emctl start dbconsole

           dbstart

           sqlplus / as sysdba

       SHUT UP:

           sqlplus / as sysdba

           SQL>shutdown abort

           lsnrctl stop

           emctl stop dbconsole

                                                                                                                                           [email protected]

本文出自 “VnlyZhang的博客” 博客,转载请与作者联系!

你可能感兴趣的:(oracle,database,rhel6.3)