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++-devel
make? pdksh? xscreensaver?
libaio openmotif21 sysstat
?
2.修改/etc/hosts文件,设置主机名和ip
vi
/etc/hosts ?
#添加如下两行
?? ? ? 127.0.0.1????????
localhost
IP地址????? 主机名称
?? 不添加的话,安装进行不下去,em无法打开。
3.设置ORACLE_HOME环境变量
?? ? ???vi
.bash_profile
?? ? #将以下加到文件末尾:
?export ORACLE_SID=oracl
?export
PATH=$PATH:$HOME/bin:/u01/orahome/ bin
?export
ORACLE_BASE=/u01/orahome
?export ORACLE_HOME=/u01/orahome
4.安装后自启动脚本
以root身份进入,编写以下脚本:?
#!/bin/bash?
ORA_HOME=/u01/app/oracle/oracle/product/10.2.0/
?
status() {
?? ?pid=`ps -ef | grep ora_pmon | grep -v grep | awk ‘{print $8}’`
?? ?if [ “X$pid” = “X” ]
?? ?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”?
<span style="