设为首页
加入收藏夹

RedHat 6.0 上 安装Oracle 8
浏览选项:

  RedHat Linux 6.0 上 Oracle 8(8.0.5)标准版 安装实例
  开始安装:
  1、首先安装RedHat,以server方式安装。
  2、安装Oracle 8。
  [root@oradb /root]# #以root系统用户登录
  [root@oradb /root]# groupadd dba  #创建dba组
  [root@oradb /root]# useradd oracle -g dba  #在dba组中建新用户oracle
  [root@oradb /root]# passwd oracle#修改oracle用户口令
  [root@oradb /root]# mount /mnt/cdrom #挂上光驱
  [root@oradb /root]# cd /mnt/cdrom  #
  [root@oradb cdrom]# ls -l
  [root@oradb cdrom]# cd RedHat #
  [root@oradb RedHat]# cd RPMS #到光驱/mnt/cdrom/RedHat/RPMS目录[root@oradb
  本例把oracle系统安装在/home/app目录下检查Oracle 8.0.5所需的Redhat的兼容库是否
  [root@oradb RPMS]# rpm -q compat-binutils

  compat-binutils
  [root@oradb RPMS]# rpm -q compat-glibc
  compat-glibc
  [root@oradb RPMS]# rpm -q compat-egcs
  compat-egcs
  [root@oradb RPMS]# rpm -q compat-egcs-c++
  compat-egcs-c++
  [root@oradb RPMS]# rpm -q compat-libs
  compat-libs
  如果没有安装好上述这些兼容库,可从RedHat 6.0光盘的/RedHat/RPMS目录中找到这些文
  [root@oradb RPMS]# rpm -ivh compat-binutils-5.2-2.9.1.0.23.1.i386.rpm
  compat-binutils #################################################
  [root@oradb RPMS]# rpm -ivh compat-glibc-5.2-2.0.7.1.i386.rpm
  compat-glibc #################################################
  [root@oradb RPMS]# rpm -ivh compat-egcs-5.2-1.0.3a.1.i386.rpm
  compat-egcs #################################################
  [root@oradb RPMS]# rpm -ivh compat-egcs-c++-5.2-1.0.3a.1.i386.rpm
  compat-egcs-c++ #################################################
  [root@oradb RPMS]# rpm -ivh compat-libs-5.2-1.i386.rpm
  compat-libs #################################################
  [root@oradb RPMS]# cd #回到root根目录
  [root@oradb /root]# umount /mnt/cdrom  #解除光驱挂载
  或[root@oradb /root]# eject #直接弹出光驱
  [root@oradb /root]# mkdir /home/app#在/home下建立app目录
  [root@oradb /root]# chown oracle.dba /home/app #把/home/app目录的权限赋给dba组
  [root@oradb /root]# mkdir /home/app/805 #在/home/app下建立805目录,用来
  [root@oradb /root]# mkdir /home/app/patch#在/home/app下建立patch目录,用
  将805ship_tar.gz拷贝到/home/app/805
  [root@oradb /root]# cd /home/app/805   #转到/home/app/805目录
  [root@oradb 805]# tar zxvf 805ship_tar.gz#在当前目录下解压缩
  将glibcpatch.tgz拷贝到/home/app/patch
  [root@oradb 805]# cd /home/app/patch   #转到/home/app/patch目录
  [root@oradb patch]# tar zxvf glibcpatch.tgz  #在当前目录下解压缩
  [root@oradb patch]# cd /home/app/805/orainst  #转到/home/app/805/orainst目录
  [root@oradb orainst]# ORACLE_OWNER=oracle;   #定义ORACLE_OWNER环境变量
  [root@oradb orainst]# export ORACLE_OWNER#输出ORACLE_OWNER
  或
  [root@oradb orainst]# export ORACLE_OWNER=oracle

  [root@oradb orainst]# sh oratab.sh #以root权限执行oratab.sh文件
  运行oratab.sh的条件是
  1、需要root权限
  2、需要设置ORACLE_OWNER环境变量给安装此产品的系统用户
  3、ORACLE_OWNER所赋予的用户必须属于dba组
  接受默认参数后,系统创建/etc/oratab文件,屏幕提示见下
  if any of these conditions are not met, please re-run alter satisfying
  these conditions.
  **************************************************************************
  Is it OK to continue (Y/N)? [Y]: y
  The ORACLE_OWNER is set as: oracle
  Are these settings correct (T/N)? [Y]: y
  Checking for "oracle" user id...
  Creating /etc/oratab file...
  [root@oradb orainst]#
  [root@oradb orainst]# exit  #退出,以oracle用户重新登录
  [oracle@oradb oracle]$
  键入umask回车,检查其结果是否为“022”,
  如果不是,则在下面的“.bash_profile”中加入“umask 022”
  在oracle用户的根目录“/home/oracle”(或~)下创建“.bash_profile”脚本:
  [oracle@oradb oracle]$ cd ~
  [oracle@oradb oracle]$ ls -a #“.bash_profile”文件是隐藏属
  [oracle@oradb oracle]$ more .bash_profile#查看“.bash_profile”文件内容
  注:每个用户下都有一个自动执行脚本,类似于dos下的autoexec.bat文件,每一次用户
登录的时候,设置系统环境,RedHat Linux 6.0中的脚本名为.bash_profile。可用env命令查
 .bash_profile文件如果是以root用户登录时生成的,则组和用户都属于root,对
  [oracle@oradb oracle]$ vi .bash_profile #编辑“.bash_profile”文件,并
  ORACLE_BASE=/home/app/oracle;
  ORACLE_HOME=$ORACLE_BASE/oracle805
  LD_LIBRARY_PATH=$ORACLE_HOME/lib
  ORACLE_DOC=$ORACLE_HOME/doc;
  ORACLE_SID=ORCL;
  ORACLE_TERM=386;
  PATH=$PATH:$ORACLE_HOME/bin
  TMPDIR=/var/tmp;
  export ORACLE_BASE ORACLE_HOME ORACLE_DOC LD_LIBRARY_PATH ORACLE_SID
  也可以把这个文件在Windows机器上写好,如a.txt,然后用FTP把a.txt拷到/home/oracle
  mv a.txt .bash_profile
  按y覆盖
  [oracle@oradb oracle]$ exit  #退出,以oracle用户重新登录
  [oracle@oradb oracle]$ env   #用“env”命令检查上述的设置
  [oracle@oradb oracle]$ cd /home/app/805/orainst #转到/home/app/805/orainst目
  [oracle@oradb orainst]$ ./orainst  #执行orainst命令开始安装
  1、在 "Install Type", 选择 "Default Install" ,按“OK”
  2、阅读 preamble.txt 屏幕后 ,按“OK”
  3、阅读 "/home/app/805/orainst/README.FIRST" 屏幕后 ,按“OK”
  4、在 "Installation Activity Choice", 选择 "Install, Upgrade, or De-Install
  5、在 "Installation Options", 选择 "Install New Product - Do Not Create DB
  6、在 "Environment Variables", ORACLE_BASE 和 ORACLE_HOME 的值应该
  和 .bash_profile 文件中设置的一样,取默认值,按“OK”(也可以修改)
  7、显示你所有设置的值,按“OK”
  8、"Software Asset Manager" 屏幕,左面是可安装产品列表,右面是已安装产品列表
  9、滚动上下箭头,找到 "Oracle8 Standard (RDBMS) 8.0.5.0.0" ,按空格键选中它,
  10、如果遇到 ULIMIT not being set窗口 , 按“OK”忽略它
  11、安装完毕,按“OK”返回到"Software Asset Manager" 屏幕,点“Exit”退出
  Result: Success.
  [oracle@oradb orainst]$
  [oracle@oradb orainst]$ cd /home/app/patch

  [oracle@oradb patch]$ ./glibcpatch.sh
  运行数分钟,(视你的机器配置而定)后,
  看到“Applied glibc patch for Oracle 8.0.5.x successfully”,表明补丁安装成功
  回到installer,创建数据库
  [oracle@oradb patch]$ cd /home/app/805/orainst

  [oracle@oradb orainst]$ ./orainst
  1、在 "Install Type", 选择 "Default Install" ,按“OK”
  2、阅读 preamble.txt 屏幕后 ,按“OK”
  3、阅读 "/home/app/805/orainst/README.FIRST" 屏幕后 ,按“OK”
  4、在 "Installation Activity Choice", 选择 "Create/Upgrade Database Objects"
  5、在 "Database Options", 选择 "Create Database Objects" ,按“OK”
  6、在 "Environment Variables", ORACLE_BASE 和 ORACLE_HOME 的值应该
  和 .bash_profile 文件中设置的一样,取默认值,按“OK”(不可以修改)
  7、显示你所有设置的值,按“OK”
  8、"Software Asset Manager" 屏幕,左面是可安装产品列表,右面是已安装产品列表
  9、滚动上下箭头,找到 "Oracle8 Standard (RDBMS) 8.0.5.0.0" ,按空格键再一次选
  按TAB键,光标落在Install上,按回车开始安装
  10、这时,会再一次安装它,出现“Database Action”,选择 "Create Product DB
  11、提示输入三个database mount points,“/home/app/oracle/db1”,
  “/home/app/oracle/db2”,“/home/app/oracle/db3”
  12、开始安装,需一定时间,请耐心等待
  13、安装完毕,按“OK”返回到"Software Asset Manager" 屏幕,点“Exit”退出
  至此,Oracle基本部分安装成功
  注意:
  如果你想用Oracle installer继续安装其他组件,如SQL*Plus,
  安装到 "Installation Options" 屏幕时, 请选择"Add/Upgrade Software,
  并且安装完以后,一定要重新安装“glibc补丁”,
  否则会出现Segmentation fault (core dumped)提示。
  [oracle@oradb orainst]$ exit
  [root@oradb /root]# #重新以
  [root@oradb /root]# mv /root/.bash_profile /root/.bash_profile_bak #备份/root
  [root@oradb /root]# cp ~oracle/.bash_profile ~root#将
  [root@oradb /root]# exit #以root重
  [root@oradb /root]# env  #用env命
  [root@oradb /root]# cd $ORACLE_HOME/orainst #转到
  [root@oradb orainst]# sh root.sh#执行
  Running Oracle8 root.sh script...
  The following enviroment variables are set as:
  ORACLE_OWNER= oracle
  ORACLE_HOME= /home/app/oracle/oracle805
  ORACLE_SID= ORCL
  Are these settings correct (Y/N)? [Y]: y

  Enter the full pathname of the local bin directory [/usr/lbin]: /usr/local/bin
  Checking for "oracle" user id...
  ORACLE_HOME does not match the home directory for oracle
  Okay to continue? [N]: y
  Updating /etc/oratab file...
  Leaving common section of Oracle8 root.sh
  检查ORACLE_OWNER、ORACLE_HOME和ORACLE_SID的设置是否正确,如果正确,按“Y”。
  当提示本地bin目录时,输入“/usr/local/bin”,
  该脚本会提示你ORACLE_HOME与orcale的主目录不匹配,不用担心,键入“Y”继续下去。
  此时,oracle数据库已经安装成功,并且数据库已经启动运行,可以试一下
  [oracle@oradb oracle]$ sqlplus system/manager
  出现以下信息:
  SQL*Plus: Release 8.0.5.0.0 - Production on Tue Nov 21 20:20:56 2000
  (c) Copyright 1998 Oracle Corporation. ALL rights reserved.
  Connected to:
  Oracle8 Release 8.0.5.0.0 - Production
  PL/SQL Release 8.0.5.0.0 - Production
  SQL> show user
  USER is "SYSTEM"   SQL>
  SQL> exit
  启动数据库:
  [oracle@oradb oracle]$ svrmgrl   SVRMGR> connect internal
  Connected.   SVRMGR> startup
  ORACLE instance started.
  显示SGA状态
  Database mounted.
  Database opened.   SVRMGR>
  关闭数据库:
  [oracle@oradb oracle]$ svrmgrl   SVRMGR> connect internal
  Connected.   SVRMGR> stutdown
  Database closed.
  Database dismounted.
  ORACLE instance shut down.   SVRMGR>
  修改TNS Listener,默认安装后TNS Listener无法启动
  [oracle@oradb oracle]$ su root
  [root@oradb oracle]$
  [root@oradb oracle]# vi /etc/services
  加入以下内容,存盘退出
  listener 1521/tcp #Oracle Net8 listener
  [root@oradb oracle]# vi $ORACLE_HOME/network/admin/listener.ora
  也就是/home/app/oracle/oracle805/network/admin/listener.ora
  第8行,把修改成ORCL
  存盘退出
  [root@oradb oracle]$ exit
  [oracle@oradb oracle]$
  启动监听器
  [oracle@oradb oracle]$ lsnrctl   LSNRCTL> start
  LSNRCTL> exit
  停止监听器
  [oracle@oradb oracle]$ lsnrctl   LSNRCTL> stop
  LSNRCTL> exit
  查看监听器状态
  [oracle@oradb oracle]$ lsnrctl   LSNRCTL> status
  LSNRCTL> exit









Copyright © 2004 wanxu.com All Rights Reserved