对于Centos安装不多做说明一般开发工具都要装
安装完还需要安装补丁包sysstat-5.0.5-14.rhel4.i386.rpm 和 libaio-0.3.105-2.i386.rpm 即可。
创建oracle账号
su - root
groupadd dba
groupadd oinstall
useradd -c oracle -g dba -G oinstall oracle
passwd oracle
创建oralce安装目录
su - root
mkdir -p /u01/app/oracle
chown -R oracle.dba /u01
mkdir /var/opt/oracle
chown oracle.oinstall /var/opt/oracle
chmod 755 /var/opt/oracle
1.修改/etc/sysctl.conf 文件,增加如下内容:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
sem 4 个参数依次为 SEMMSL(每个用户拥有信号量最大数);SEMMNS(系统信号量最大数);
SEMOPM(每次 semopm 系统调用操作数);SEMMNI(系统辛苦量集数最大数).
shmmax 最大共享内存 2GB 物理内存如果小的话可以设置成 536870912.
shmmni 最小共享内存 4096KB.
shmall 所有内存大小.
运行/sbin/sysctl -p设置核心参数
2修改/etc/security/limits.conf加入
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
3.修改/etc/pam.d/login ,加入
session required pam_limits.so
4.修改/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
5.oracle登录 修改.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9,
# RHEL AS 3, and RHEL AS 4 !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.6.9-55.EL # for RHEL AS 4
# Oracle Environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.0.2/db_1
export ORACLE_SID=your'sSID
# export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $ORACLE_HOME/network/admin
export NLS_LANG=American_America.UTF8;
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths
export PATH=$PATH:$ORACLE_HOME/bin
5
5.1 修改 /etc/oratab 文件
修改$ORACLE_HOME dbstart
$ cd $ORACLE_HOME/dbs
$ sqlplus /nolog
SQL>connect / as sysdba
connected
SQL>Create pfile from spfile
dbora内容
# Set ORA_HOME to be equivalent to the ORACLE_HOME
# from which you wish to execute dbstart and
# dbshut
# set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME
ORA_HOME=/u01/app/oracle/product/10.0.2/db_1
ORA_OWNER=oracle
case "$1" in
'start_msg')
echo "startup oracle10g database and listener"
;;
'stop_msg')
echo "shutdown oracle10g database and listener"
;;
'start')
# Start the Oracle database:
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
# start the Oracle dbconsole:
;;
'stop')
# Stop the Oracle database:
su - $ORA_OWNER -c "emctl stop dbconsole"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
# Stop the Oracle listener:
su - $ORA_OWNER -c "lsnrctl stop listener"
;;
esac
1 #cp dbora /etc/init.d
2 #cd /etc/init.d
3 #chmod 777 dbora
4 #cd rc2.d
#ln –s ../init.d/dbora S80ora
5 #cd ../rc3.d
#ln –s ../init.d/dbora S80ora
6 #cd ../rc0.d
#ln –s ../init.d/dbora K80ora
7 #cd ../rc4.d
#ln –s ../init.d/dbora S80ora
#ln –s ../init.d/dbora K80ora
8 #cd ../rc5.d
#ln –s ../init.d/dbora S80ora
#ln –s ../init.d/dbora K80ora
来源:https://www.cnblogs.com/lenny/archive/2010/03/29/1699251.html