免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1055 | 回复: 0
打印 上一主题 下一主题

My experience to deploying Oracle11gR2 on RHEL6.0 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-19 13:56 |只看该作者 |倒序浏览
Here is my experience of deploying oracle 11gR2(64bits) on Red Hat Enterprise Linux Server 6.0

step1: vi /etc/sysctl.conf, add the following scripts:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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 = 1048586

saved it and run command /sbin/sysctl -p for review the changes

Notice: kernel.shmmax's value should be half of the physic memory. If your physic memory is 1G,the kernel.shmmax should be 536870912

step2: vi /etc/security/limits.conf,add the following scripts:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536


step3: vi /etc/pam.d/login,add the following scripts:
session required pam_limits.so

step4:vi /etc/profile,add the following scripts:
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi

step4: vi/etc/csh.login,add the following scripts:
if( $USER == "oracle" ) then
    limit maxproc 16384
    limit descriptors 65536
    umask 022
endif

step5: vi /etc/redhat-release,modify as the same as the followed:
Red Hat Enterprise Linux Server release 5.0 (Tikanga)

Notice:After you had deployed it, restore the original value

step6: run the following commands:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle
Passwd oracle

Step 6: Create directories, run the following commands as root: 
mkdir -p /opt/11g/oracle
chown -R oracle:oinstall /opt/11g/oracle
chmod -R 775 /opt/11g/oracle

mkdir -p /opt/11g/oraInventory
chown -R oracle:oinstall /opt/11g/oraInventory
chmod -R 775 /opt/11g/oraInventory

Step 7: Use root edit /home/oracle/.bash_profile, add the followed scripts into it
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# If /tmp doesn't have 200M space free then you can workaround it by
# pointing the variables TMP AND TMPDIR to a location where you have 
# sufficient space.
ORACLE_BASE=/opt/11g/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=ora11g; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH

if [ $USER = "oracle" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
     ulimit -p 16384
     ulimit -n 65536
   else
     ulimit -u 16384 -n 65536
   fi
fi

umask 022

step 8: reboot your sytem, and login graphical interfaces with user oracle

step 9: Now you had log in the system as graphical interfaces as oracle user,then cd the directory where the oracle 11g installation files located,and run command:
./runInstaller

step 10: Once you entered ./runInstaller, the installation process will start,just follow the installation guide, then you can got is.(In the process of deployment,I recommended you choose just to install the database software only and don't create a database(For I failed many times when I choose crated a database in the process of installation),After you had deployed oracle,you can use dbca command to create the database).After the installation finished, you should create a database.

step 11: Create a database 
start oracle11g
#su - oracle(this is optional)
$source .bash_profile(Make sure you are currently at /home/oracle)
$lsnrct start
$dbca
the create database guide will started, follow the create database guide you can got it.

step12: Create listener.ora
Go to /opt/11g/oracle/product/11.2.0/dbhome_1/network/admin, then vi listener.ora, and add the following scripts.
# listener.ora Network Configuration File: /opt/11g/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PL***tProc)
      (ORACLE_HOME = /opt/11g/oracle/product/11.2.0/dbhome_1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = devserver.com)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /opt/11g/oracle

step13 : Create tnsnames.ora
Go to /opt/11g/oracle/product/11.2.0/dbhome_1/network/admin, then vi tnsnames.ora, and add the following scripts:
# tnsnames.ora Network Configuration File: /opt/11g/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = devserver.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.com)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PL***tProc)
      (PRESENTATION = RO)
    )
  )

step 14: Start oracle(recommend reboot the linux system first0)
#su - oracle
#source .bash_profile dbstart
#sqlplus / as sysdba
>startup
>exit
#lsnrctl start
#emctl start dbconsole
#dbstart
If these commands can execute noramlly, then your oracle server has started successfully.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP