Oracle11G for Linux 的安装(RHEL5)

发表于:2009-8-17 10:07

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:未知    来源:网络转载

分享:

  四.正式安装

  以root身份打开另一个终端窗口

  --这步至关重要,不执行这步在以oracle用户运行 # ./runInstaller时会启动不了图型安装界面

  (经本人验证,不做这一步亦可,只需用oracle用户的桌面来启动安装程序。)

  xhost

  xhost localhost

  用oracle用户登录。如果用的是X模式,要把DISPLAY设置如下:

  DISPLAY=:0.0; export DISPLAY

  # export DISPLAY=192.168.1.170:0.0

  如果远程安装,需要启动cygwin

  执行

  # startx

  方式一:

  以root身份mount光驱

  #mount /dev/cdrom /mnt

  以oracle用户登录系统,进行Oracle的安装

  #su – oracle

  unzip linux_x86_11gR1_database.zip

  cd database/

  ./runInstaller

  ./runInstaller -ignoreSysprereqs #低版本检测(可选)

  方式二:

  1、解压命令:unzip 10201_database_linux32.zip

  2、解压后产生一个包含安装文件的目录database

  注:,最好在根上建立一个文件夹,这个文件夹专门用来存放ORACLE的安装文件。但是需要注意的是,在安装ORACLE前,需要把这个文件夹的所有者修改成用户oracle,文件夹权限最好是修改成777,以免在安装过程中出现问题。

  3、定制Oracle安装文件及权限(可选)

  chmod 777 /oracle

  chown -R oracle.oinstall /oracle

  mount /media/cdrom

  /media/cdrom/runInstaller

  安装过程中:

  在安装过程中输入合适的ORACLE_HOME和实例名。

  完成后的画面中会有管理端入口地址和sqlplus入口地址。

  选择高级安装

  在选择安装类型中,选择定制

  安装过程中需要以root身份运行

  #/oracle/oraInventory/orainstRoot.sh

  /opt/oracle/product/OraHome/root.sh

  安装完毕后。

  五.启动脚本生成和设置:

  1.补充:

  开机时让 RedHat Linux 自动启动Oracle,需要完成以下步骤:

  运行 $ORACLE_HOME 下的 root.sh,会生成一个文件 /etc/oratab 。

  编辑 /etc/oratab ,把所有的 instance 的重启动标志设置成 'Y',如:

  ora10g:/home/oracle/OraHome_1:Y

  做一个启动脚本 /etc/init.d/dbora ,如下所示:

  #!/bin/sh
  # description: Oracle auto start-stop script.
  # chkconfig: - 20 80
  #
  # 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=/home/oracle/OraHome_1
  ORA_OWNER=oracle
  if [ ! -f $ORA_HOME/bin/dbstart ]
  then
  echo "Oracle startup: cannot start"
  exit
  fi
  case "$1" in
  'start')
  # Start the Oracle databases:
  # The following command assumes that the oracle login
  # will not prompt the user for any values
  su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
  su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
  ;;
  'stop')
  # Stop the Oracle databases:
  # The following command assumes that the oracle login
  # will not prompt the user for any values
  su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
  su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
  ;;
  'restart')
  $0 stop
  $0 start
  ;;
  esac

  赋予执行权限

  chown root.root /etc/rc.d/init.d/dbora
  chmod 750 /etc/init.d/dbora
  Initialize new service:
  chkconfig dbora reset
  chkconfig --list dbora
  dbora 0:off 1:off 2:off 3:on 4:off 5:on 6:off

  注意:当系统不在 runlevels 3 and 5时,使用

  service dbora start 启动服务

  service dbora stop 停止服务。

  作成以下链接:

  ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora

  ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora

  执行以下命令:

  chkconfig --level 345 dbora on

  2.vi $ORACLE_HOME/bin/dbstart

  # Set this to bring up Oracle Net Listener

  ORACLE_HOME_LISTNER=$ORACLE_HOME

  如果没有ASM(自动存储),就把那一节内容删除,ASM要在加载实例前,先加载.

  3.重新启动计算机 ,就可以了,启动会比较慢,因为要自动启动em,database,listener,agent

  这样就OK了。下次开关机的时候,Oracle也会随之启动/停止。

33/3<123
重磅发布,2022软件测试行业现状调查报告~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2023
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号