设为首页
加入收藏夹

在Redhat 7.2上安装Oracle 8.1.7
浏览选项:

  作者:吴阿亭
  一 文章简介
  本文主要介绍如何在redhat 7.2中一步步安装oracle 8.1.7.0.1,如何解决安装过程中遇
  二 操作环境
  Redhat 7.2, Oracle 8.1.7.0.1; DELL PC 128M RAM , 9G硬盘, 1G SWAP分区
  三 安装步骤
  1. 准备软硬件环境
  做Redhat 7.2 完全安装是最容易的方法,否则你需要确认下面的兼容包被安装在系统中
  所有的compat开头的包。
  compat-libstdc++-6.2-2.9.0.16
  compat-glibc-6.2-2.1.3.2
  compat-egcs-c++-6.2-1.1.2.16
  compat-libs-6.2-3
  compat-egcs-6.2-1.1.2.16
  compat-egcs-objc-6.2-1.1.2.16
  下载Oracle 8.1.7.0.1, glibc-2.1.3-stubs.tar.gz, JDK-1.1.
8(http://www.blackdown.org)(jdk118_v3-glibc-2.1.3.tar.bz2)
  2. 安装JAVA环境
  cd /usr/local
  bunzip2 jdk118_v3-glibc-2.1.3.tar.bz2
  tar xvf jdk118_v3-glibc-2.1.3.tar
  ln -s /usr/local/jdk118_v3 /usr/local/java
  3. 准备oracle 用户,组和环境变量
  groupadd oinstall
  groupadd dba
  groupadd oper
  useradd oracle -g oinstall -G dba,oper
  passwd oracle (改变oracle用户的密码)
  mkdir /u01
  chown oracle.dba /u01
  chmod 775 /u01
  然后放下面的行到/home/oracle/.bash_profile.
  ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

  ORACLE_HOME=/u01/app/oracle/product/8.1.7; export ORACLE_HOME
  ORACLE_SID=ora1; export ORACLE_SID
  PATH=$PATH:/u01/app/oracle/product/8.1.7/bin; export PATH
  CLASSPATH=.:/u01/app/oracle/product/8.1.7/jdbc/lib/classes111.zip; export
  LD_LIBRARY_PATH=/u01/app/oracle/product/8.1.7/lib; export LD_LIBRARY_PATH
  ORA_NLS33=/u01/app/oracle/product/8.1.7/ocommon/nls/admin/data; export
  NLS_LANG=american; export NLS_LANG
  umask 022
  然后退出所有终端,重新登录确保环境变量生效,用env检查所有变量,最方便地是重新
  4. 开始安装Oracle
  a. 登录作为用户oracle,进入KDE界面,解开下载的文件在/usr/src下并开始安装。
  LD_ASSUME_KERNEL=2.2.5; export LD_ASSUME_KERNEL

  . /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh
  cd /usr/src
  tar xvfz linux81701.tar.gz
  cd Disk1
  ./runInstaller
  b. 在Unix组名提示时,填入oinstall,然后按next,会弹出让你在另一个终端窗口运行
orainstRoot.sh的提示,在另一终端登录作为root,做下面的
  cd /u01/app/oracle/product/8.1.7/
  ./orainstRoot.sh
  Creating Oracle Inventory pointer file (/etc/oraInst.loc)
  Changing groupname of /u01/app/oracle/oraInventory to oinstall.
  JDK HOME中接受默认/usr/local/java, 给oracle global database 取名。
  c. 在安装到最后Linking Oracle8i Enterprise Edition 8.1.7.0.1 , 97%时,会有一错
  Error in invoking target install of makefile /u01/app/oracle/pro
  则需要在另一终端窗口下运行glibc修补文件glibc-2_1_3-stubs_tar.gz, 在另一终端下
  cd /u01/app/oracle/product/8.1.7
  tar xvfz /usr/src/glibc-2_1_3-stubs_tar.gz
  ./setup_stubs.sh
  出现如下的提示:
  Setting up patch files...done.
  Patching makefiles as necessary:
  checking file '/u01/app/oracle/product/8.1.7/rdbms/demo/demo_rdb
  checking file '/u01/app/oracle/product/8.1.7/rdbms/demo/ociucb.mk'...patched.
  checking file '/u01/app/oracle/product/8.1.7/rdbms/lib/ins_rdbms.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/rdbms/lib/env_rdbms
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_net
  checking file '/u01/app/oracle/product/8.1.7/network/lib
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_cman.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_names.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_oem
  checking file '/u01/app/oracle/product/8.1.7/network/lib/env_oem
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_net
  checking file '/u01/app/oracle/product/8.1.7/network/lib/ins_nau.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/plsql/lib/e
  checking file '/u01/app/oracle/product/8.1.7/plsql/lib/ins_plsql.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/plsql/demo/demo_pls
  checking file '/u01/app/oracle/product/8.1.7/precomp/lib/ins_precomp.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/precomp/lib/env_pre
  checking file '/u01/app/oracle/product/8.1.7/ldap/lib/env_ldap.mk'...patched.
  checking file '/u01/app/oracle/product/8.1.7/ldap/lib/ins_ldap.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/ldap/demo/demo_ldap
  checking file '/u01/app/oracle/product/8.1.7/sqlplus/lib
  checking file '/u01/app/oracle/product/8.1.7/sqlplus/lib/ins_sqlplus.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/ord/im/lib/
  checking file '/u01/app/oracle/product/8.1.7/ord/img/dem
  checking file '/u01/app/oracle/product/8.1.7/ord/ts/demo/oci/src
  checking file '/u01/app/oracle/product/8.1.7/ord/ts/demo
  checking file '/u01/app/oracle/product/8.1.7/ord/ts/lib/
  checking file '/u01/app/oracle/product/8.1.7/md/demo/exa
  checking file '/u01/app/oracle/product/8.1.7/md/demo/uni
  checking file '/u01/app/oracle/product/8.1.7/md/demo/uni
x/motif/src/db_src/demo_dbsrc.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/md/demo/unix/motif/
  checking file '/u01/app/oracle/product/8.1.7/otrace/demo/atmoci.mk'...patched.
  checking file '/u01/app/oracle/product/8.1.7/otrace/lib/
  checking file '/u01/app/oracle/product/8.1.7/otrace/lib/ins_otrace.mk'...OK.
  checking file '/u01/app/oracle/product/8.1.7/ctx/lib/env_ctx.mk'...patched.
  checking file '/u01/app/oracle/product/8.1.7/ctx/lib/ins_ctx.mk'...OK.
  Rebuilding client shared library...done.

  Relinking executables:
  running 'ins_rdbms.mk'...done.
  running 'ins_net_client.mk'...done.
  running 'ins_cman.mk'...done.
  running 'ins_names.mk'...done.
  running 'ins_oemagent.mk'...done.
  running 'ins_net_server.mk'...done.
  running 'ins_nau.mk'...done.
  running 'ins_plsql.mk'...done.
  running 'ins_precomp.mk'...done.
  running 'ins_ldap.mk'...done.
  running 'ins_sqlplus.mk'...done.
  running 'ins_otrace.mk'...done.
  running 'ins_ctx.mk'...done.
  还没有完,然后再做下面的
  cd /u01/app/oracle/product/8.1.7/ctx/lib
  vi env_ctx.mk
  更改1374行 (vi 文件,然后打入1374 G 直接跳到该行 )
  CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS)
  在最后加上 -ldl 变成
  CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS) -ldl
  再回到安装界面击retry.
  d. 弹出窗口要运行root.sh,提示如下:
  A configuration script needs to be run as root before installation can
proceed. Please leave this windows up, go run /u01/app/oracl
e/product/8.1.7/root.sh as root from another window,then come back here and click
  这个root.sh script有两处错误,我们先正确它们再运行。
  更改/u01/app/oracle/product/8.1.7/root.sh的第102行
  RMF=/bin/rm -f 成为 RMF="/bin/rm -f"
  更改第156行
  RUID=`/usr/bin/id|$AWK -F( '{print $2}'|$AWK -F) '{print $1}`
  成为
  RUID=`/usr/bin/id|$AWK -F( '{print $2}'|$AWK -F) '{print $1}'`
  登录作为root,运行它,下面是运行时的信息。
  IMPORTANT NOTE: Please delete any log and trace files previously
  created by the Oracle Enterprise Manager Intelligent
  Agent. These files may be found in the directories
  you use for storing other Net8 log and trace files.
  If such files exist, the OEM IA may not restart.
  Running Oracle8 root.sh script...
   The following environment variables are set as:
  ORACLE_OWNER= oracle
  ORACLE_HOME= /u01/app/oracle/product/8.1.7
  ORACLE_SID= ora1
  Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Creating /etc/oratab file...
  Entry will be added to the /etc/oratab file by

  Database Configuration Assistant when a database is created
  Finished running generic part of root.sh script.
  Now product-specific root actions will be performed.
  ./root.sh: /u01/app/oracle/product/8.1.7/network/trace/dbsnmp*.trc: No such
  ./root.sh: /u01/app/oracle/product/8.1.7/network/trace/oratcl*.trc: No such
  ./root.sh: /u01/app/oracle/product/8.1.7/network/log/dbsnmp*.log: No such
  ./root.sh: /u01/app/oracle/product/8.1.7/network/log/nmiconf.log: No such
  ./root.sh: /u01/app/oracle/product/8.1.7/bin/dbsnmp0: No such file or
  ./root.sh: /u01/app/oracle/product/8.1.7/bin/oemevent0: No such file or
  ./root.sh: /u01/app/oracle/product/8.1.7/bin/oratclsh0: No such file or
  ./root.sh: /u01/app/oracle/product/8.1.7/network/agent/library/pkgIndex.tcl:
  ./root.sh: /u01/app/oracle/product/8.1.7/network/admin/snmp_ro.ora: No such
  ./root.sh: /snmp_ro.ora: No such file or directory
  然后再回到安装界面击OK。
  e. 在Net8 Configuration Assistant窗口下选中 Perform typical configuration.最后
  初始化数据库,最后,安装成功,并给出两个帐号的默认密码如下:
  Database creation completed
  Database information:
  global database name: 你选择的名称
  database system identifier(SID): ora1
  SYS account password: change_on_install

  SYSTEM account password: manager
  5. 安装后自动化工作
  a. 如何手动启动/关闭数据库?
  svrmgrl
  connect internal
  startup (如果是关闭用 shutdown )
  quit
  b. 如何在重启后自动启动oracle?
  首先,你必须在/etc/oratab中加入下面的行
  ora1:/u01/app/oracle/product/8.1.7:Y (也就是把原本的N改为Y)
  然后放下面的行到/etc/rc.d/init.d/oracle8i
  # !/bin/sh
  # chkconfig: 345 51 49
  # description: starts the oracle dabase deamons
  #
  ORA_HOME=/u01/app/oracle/product/8.1.7
  ORA_OWNER=oracle
  case "$1" in
  'start')
  echo -n "Starting Oracle8i: "
  su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
  touch /var/lock/subsys/oracle8i
  echo
  ;;
  'stop')
  echo -n "Shutting down Oracle8i: "
  su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
  rm -f /var/lock/subsys/oracle8i
  echo
  ;;
  'restart')
  echo -n "Restarting Oracle8i: "
  $0 stop
  $0 start
  echo
  ;;
  *)
  echo "Usage: oracle8i { start | stop | restart }"
  exit 1
  esac
  exit 0
  然后设定权限和启动级别
  # chmod 700 /etc/rc.d/init.d/oracle8i
  # whoami
  root
  # cd /etc/rc.d/init.d/
  # chkconfig --add oracle8i
  # chkconfig --list oracle8i
  oracle8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off
  现在测试命令/etc/rc.d/init.d/oracle8i stop/start看能否工作。
  c. 如果你想从另一台PC通过GUI存取Oracle服务器,你需要启动TNS listener.
  #lsnrctl start
  6. 如何手动移走Oracle?
  关闭Oracle server,做下面的
  #cd /u01
  #rm -fr app/
  # rm -f /etc/oratab /etc/oraInst.loc




Copyright © 2004 wanxu.com All Rights Reserved