CentOs5上安装Oracle 10g R2

[不指定 2008/07/13 22:14 | by askwan ]
应网友要求,把我安装部署oracle的文档发出来,仅供参考!        
    
                                                    
一. 需要的必须的软件包:

默认安装情况下,可能有些已经安装了
Quotation
[root@server ~]# yum -y install binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs


Quotation
[root@server ~]# yum -y install libstdc++ make  libstdc++.so.5 libXp


二.建立oracle用户和组

Quotation
[root@server ~]# groupadd oinstall
[root@server ~]# groupadd dba
[root@server ~]# useradd -g oinstall -G dba oracle
[root@server ~]# passwd oracle



三.建立oracle目录结构
Quotation
[root@server ~]#su - oracle
[root@server ~]#mkdir db_home

//作为建oracle实例用的目录
Quotation
[root@server ~]#mkdir oracle10gr2

//oracle安装目录


四.设置内核参数

Quotation
[root@server ~]#vi /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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144



五. 调整oracle使用者的环境限制
Quotation
[root@server ~]#vi /etc/security/limits.conf

增加:

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536


Quotation
[root@server ~]#vi /etc/pam.d/login

增加:

session required /lib/security/pam_limits.so
session required pam_limits.so


Quotation
[root@server ~]#vi /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


六.设置环境变量

Quotation
[root@server ~]#su - oracle
[root@server ~]#vi .bash_profile

增加:

# oracle 10g
umask 022
export ORACLE_BASE=/home/oracle/oracle10gr2
export ORACLE_SID=askwandb
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LC_CTYPE=en_US.UTF-8

让环境变量生效:
Quotation
[root@server ~]#source .bash_profile


七.正式安装oracle
先解压软件包
安装时忽略版本检查:
Quotation
[root@server ~]#./runInstaller -ignoreSysPreReqs


安装是需要更改的为:
指定合适的数据库字符集,如: Simplified Chinese ZHS16CGB231280
指定数据库的目录为: /home/oracle/db_home
其他的根据需要来更改。

安装过程中提示执行的脚本,以root用户
/home/oracle/oracle10gr2/oraInventory/orainstRoot.sh
/home/oracle/oracle10gr2/product/10.2.0/db_1/root.sh


安装后显示:
Quotation
The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL:
http://server:5560/isqlplus

iSQL*Plus DBA URL:
http://server:5560/isqlplus/dba

Enterprise Manager 10g Database Control URL:
http://server:1158/em

八. 建立oracle启动脚本
修改/etc/oratab ,把所有的 instance 的重启动标志设置成 'Y',如:
askwandb:/home/oracle/database/product/10.2.0/db_1:Y
建立一个启动脚本 /etc/init.d/oraclestart,如下所示:

ORACLE_HOME=/home/oracle/database/product/10.2.0/db_1/
ORACLE_OWNER=oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
;;
'stop')
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
;;
'restart')
$0 stop
$0 start
;;
esac

九.设置开机自动运行
Quotation
[root@server ~]#chmod 750 /etc/init.d/runora
[root@server ~]#ln -s /etc/init.d/oraclestart /etc/rc0.d/K10oraclestart
[root@server ~]#ln -s /etc/init.d/oraclestart /etc/rc3.d/S99oraclestart
[root@server ~]#chkconfig --add oracletstart
[root@server ~]#chkconfig --level 345 oraclestart on
[root@server ~]#reboot


that'all

作者:askwan@『AskWan』
地址:http://www.askwan.com/post/71/
可以转载,转载时请以链接形式注明作者和原始出处及本声明!

DataBase | Comments(2) | Trackbacks(0) | Reads(1674)
收藏到网摘:百度搜藏 Google书签 Yahoo收藏 新浪ViVi收藏夹 365天天网摘 天极网摘 我摘·网摘·网络书签 POCO网摘 和讯网摘 Bolaa博拉博客收录中心 天下图摘
kinshen
2008/07/15 16:04
[root@server ~]#./runInstaller -ignoreSysPreReqs

写的不错,不过这步我是通过更改linux内核版本实现的。
vi /etc/redhat-release
把Red Hat  release 5 改成:   redhat-3
kinshen Email
2008/07/17 10:11
下面我写的把Red Hat  release 5 改成:   redhat-3 方法是有错误的,安装完后由于几个包版本不匹配,导致oracle无法启动。

./runInstaller -ignoreSysPreReqs 这个比较好用。
pig
askwan replied on 2008/07/17 10:31
Oracle10gR2出来的时候,官方厂商测试支持的是RHEL2-4系列的update版本,那时候,Centos5 也就是 RHEL5还没有出现,而5系列版本对内核和很多相关的软件包都做了较大的升级,虽然安装上去是没有问题,普通使用也没有问题,但是某些Oracle高级特性使用可能会出现兼容性和不稳定等等问题,如果是生产系统,建议还是使用Oracle厂商支持的linux版本,不然,出了不兼容等问题,就比较难搞定
Pages: 1/1 First page 1 Final page
Add a comment
Emots
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
Enable HTML
Enable UBB
Enable Emots
Hidden
Remember
Nickname   Password   Optional
Site URI   Email   [Register]