Chinaunix首页 | 论坛 | 博客
  • 博客访问: 267715
  • 博文数量: 44
  • 博客积分: 1431
  • 博客等级: 上尉
  • 技术积分: 558
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 12:53
文章分类
文章存档

2012年(1)

2011年(28)

2010年(15)

分类: Oracle

2011-01-03 17:48:09

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.
阅读(2418) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~