linux 下oracle10g安装
第一次用linux,昨天配置一下java环境,以及oracle的安装,问题多多,特此记录一下。
环境:
RedHat Enterprise Linux 4U7 64位
oracle10g
jdk1.6
详细安装步骤请参与oracle官方指南
http://www.oracle.com/technology/global/cn/pub/articles/smiley_10gdb_install.html
?
1.安装前检测oracle10g 所需的包组件
rpm -q? binutils?compat-db? control-center? gcc?gcc-c++? glibc-common? gnome-?????libs? libstdc++ libstdc++-develmake? pdksh? xscreensaver?libaio openmotif21 sysstat
?
2.修改/etc/hosts文件,设置主机名和ip
vi/etc/hosts ?
?? ?then
?? ? ? ?echo "oracle10g is not running."
?? ? ? ?exit 1
?? ?else
?? ? ? ?echo "oracle10g is running."
?? ? ? ?exit 0
?? ?fi
}
case "$1" in?
?? ?start)?
?? ? ? ?#startup the listener and instance?
?? ? ? ?echo -n "oracle begin to startup: "?
?? ? ? ?su - oracle -c "lsnrctl start"?
?? ? ? ?su - oracle -c dbstart?
echo "oracle10g started"?
su - oracle ?$ORA_HOME/bin/emctl start dbconsole
?? ? ? ?echo "oracle10g em started"?
?? ? ? ?;;?
?? ?stop)?
?? ? ? ?# stop listener, apache and database?
?? ? ? ?echo -n "oracle begin to shutdown:"?
?? ? ? ?su - oracle -c "lsnrctl stop"?
?? ? ? ?su - oracle -c dbshut?
?? ? ? ?echo "oracle10g shutdowned"?
su - oracle ?$ORA_HOME/bin/emctl stop dbconsole
?? ? ? ?echo "oracle10g stop started"?
?? ? ? ?;;?
?? ?reload|restart)?
?? ? ? ?$0 stop?
?? ? ? ?$0 start?
?? ? ? ?;;?
?? ?'status')
?? ? ? ?status
?? ? ? ?;;
?? ? *)?
?? ? ? ?echo "Usage: ora10g [start|stop|reload|restart]"?
?? ? ? ?exit 1?
esac?
exit 0?
#存为ora10g.sh后,放在/etc/rc.d/init.d/目录 然后?
?
?
chmod a+x ora10g.sh
#在/etc/rc.d/rc.local中加入如下:
/etc/rc.d/init.d/ora10g.sh start?
#保存后,reboot后,应该可以看到oracle 监听器,实例,em已经启动。(linux启动后可能要稍等,em才能访问,em启动比较慢,我当初reboot后访问em,结果不能访问,以为脚本有问题,狂Google,未果。reboot n次后无意发现 em启动慢,需要稍等才能访问,汗..............)
另外一个可能遇到的问题是linux防火墙端口没有开启导致内网其他电脑无法访问em或者链接数据库需要关闭防火墙或者添加端口设置
#需reboot?
#关闭防火墙
chkconfig iptables off
#开启防火墙
chkconfig iptables on?
#或者修改/etc/sysconfig/iptables 文件,根据/$ORACLE_HOME/install/portlist.ini 添加对应端口,比如1158端口:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT?
?
?
?
?