ubuntu9.04
10201_database_linux32.zip
下载地址:http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linuxsoft.html
1、安装必须的包
sudo apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio1 libstdc++5 alien
2、修改用户文件夹下.bashrc文件例:/home/ubuntu/.bashrc(否则报错Error in invoking target'utilities ctx_on' )
export ORACLE_HOME=/home/ubuntu/oracle(chown -R ubuntu /opt/oracle10g)
#export ORACLE_OWNER=oracle
#export ORACLE_SID=ora1
#export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
3、创建RedHat的版本声明文件
在/etc/redhat-release中添加以下语句,以使安装程序认为正在一个RedHat的系统上安装:
Red Hat Linux release 3.1 (drupal)
sudo touch redhat-release
sudo gedit redhat-release
4、解压:
unzip 10201_database_linux32.zip
5、开始安装
./runInstaller
出现安装界面,但显示中文乱码。这是因为jdk缺少中文字体。
a、用英文安装
export LANG=en_US
./runInstaller
b、解决乱码问题:http://wangrusheng5200.iteye.com/admin/blogs/457969 还是有部分乱码
./runInstaller -jreLoc /usr/java/jdk/jre/(我指定了使用我安装的jdk)
6、设置自启动
创建自启动脚本
创建 oracledb 脚本到/etc/init.d/oracledb,内容如下
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_HOME=/home/ubuntu/oracle
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
ORA_OWNR="ubuntu"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c "$ORACLE_HOME/bin/dbstart"
touch /var/lock/oracle
su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
rm -f /var/lock/oracle
su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
设置权限,放到启动脚本中去
chmod 755 /etc/init.d/oracledb
update-rc.d oracledb defaults 99
我的 oralce 的安装盘中可能有些问题,所以如果只用上述的脚本是不能启动 listener的,要修改一下:
修改 /opt/ora10/bin/dbstart文件
查找:
# Set this to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
将其改为:
# Set this to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=$ORACLE_HOME
设置后,测试一下
/etc/init.d/./oracledb reload
如果一切正常的话,会关闭一次Oracle又再重新打开。
参考:
在 Ubuntu7.04 上安装 Oracle 10g
http://flexitime.blog.sohu.com/67242747.html
oracle服务之安装指南
ubuntu 8.10 安装Oracle 10G 企业版综合指南
http://forum.ubuntu.org.cn/viewtopic.php?f=44&t=170399
Oracle 10g for ubuntu 安装指南
http://hi.baidu.com/gengjie/blog/item/11053d2a6ac8ae3d5343c194.html
ubuntu 8.10 安装Oracle 10G 企业版综合指南
http://hi.baidu.com/ubuntu2me/blog/item/678236f1bb519fa6a40f528b.html
ubuntu下安装oracle 10g
http://hi.baidu.com/wy975740772/blog/item/285a97d199a61886a1ec9c4a.html
本文提供在Ubuntu系统中安装Oracle 10g的详细步骤,包括安装前的准备、配置环境变量、创建自启动脚本及解决乱码问题等。适用于希望在Ubuntu平台上部署Oracle数据库的读者。
302

被折叠的 条评论
为什么被折叠?



