侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

CentOS系统上安装配置Oracle数据库的详细教程

linux  /  管理员 发布于 7年前   461

一.基本配置  

1.硬盘剩余空间:10G以上
    虽然Oracle 10g的安装文件只有800多MB,但安装后的oracle+oraInventory目录会用差不多4G空间,再加上安装时Oracle生成的临时文件(/tmp目录需要至少400MB)。
2.内存1.5G以上
    官方文档说512M内存也可以安装。为了避免不必要的麻烦,请把内存加多一些。
3.Swap交换区2G

二.CenOS6 上安装Oracle 10g

1.准备安装
在安装Oracle之前执行以下命令:

yum install yum-fastestmirror -yyum install compat-db*yum install compat-libc*yum install compat-gcc*yum install libXp.so.6yum install libc-*yum install libaio*yum install openmotifyum install glibc-devel*yum install libgcc*yum install gnome-lib* 

2.安装包解压

[root@localhost ~]# cpio -idmv > 10201_database_linux_x86_64.cpio

3.创建 Oracle 组和用户帐户
创建用于安装和维护Oracle 10g 软件的账户。用户帐户将称为oracle,而组将称为oracleinstall和oracle。以root用户身份执行以下命令:

[root@localhost ~]# groupadd oracleinstall[root@localhost ~]# groupadd oracle[root@localhost ~]# useradd -m -g oracleinstall-G oracle oracle[root@localhost ~]# id oracleuid=501(oracle) gid=501(oracleinstall) groups=501(oracleinstall),502(oracle)

设置oracle帐户的口令

[root@localhost ~]# passwd oracleChanging password for user oracle.New password:Retype new password:passwd:all authentication tokens updated successfully.

4.创建目录
创建Oracle 10g及其数据库文件的目录,以root用户身份执行以下命令:

[root@localhost ~]# mkdir -p /oracledata/oracle[root@localhost ~]# mkdir -p /oracledata/oradata[root@localhost ~]# chown -R oracle:oracleinstall /oracledata/oracle /oracledata/oradata[root@localhost ~]# chmod -R 775 /oracledata/oracle /oracledata/oradata 

5.修改内核参数
安装Oracle 10g需修改内核参数,否则安装检测时会报Failed,甚至导致安装时出现Error。以root身份执行以下命令:

cat >> /etc/sysctl.conf <<EOFkernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 262144net.core.rmem_max = 262144net.core.wmem_default = 262144net.core.wmem_max = 262144EOF

如果检查没有问题后,即可以开始装Oralce 10g。

6.安装Oracle 10g
(1)先以oracle用户身份登陆XWindow。因为oracle安装会弹出界面让你配置,如果使用putty登陆安装的话,你是没有办法操作弹出框的,所以一定要登录XWindow,然后在Terminal里启动安装程序。

(2)如果你的系统语言为中文,请把他设置为英文,否则安装的时候会出现乱码。

(3)Terminal中启动Oracle 10g安装程序:

[oracle@www/]$ ./Oracle/database/runInstaller

 

如果一切正常,界面会弹出如下对话框:
 
如果在Terminal启动runInstaller时遇到“Checking operating system version: must be redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0 Failed ”这种问题,表明oracle不能识别你的系统内核,这个问题可以通过修改内核配置文件解决,如下:

cat > /etc/redhat-release << EOFRed Hat Enterprise Linux AS release 3 (Taroon)EOF 

7.Oracle 10g安装配置
修改Oralce Home Localtion,填写database password后,按“Next”。如图:

8.数据库配置
修改Inventory directory,Specify Operating System group name选:oracleinstall,然后“Next”,如图:

9.Oracle安装前检查
检查一下有什么不符合安装要求,看是否需要修改配置,如果按照上面步骤下来,这里的warning应该为0,然后“Next”。如果有警告可以搜下是什么问题。
10.Install Oracle 10g
直接按“Install”。在软件安装完成之后,会自动进行Configuration Assistant的配置。
11.以root权限运行脚本
当iSQL*Plus Configuration Assistant配置完成时,会弹出一下框,里面有两个Srcipt需要你用root权限运行。
在Terminel中以root权限执行以上两个脚本:

[root@www oradata]# ./orainstRoot.shChanging permissions of /oracledata/oradata to 770.Changing groupname of /oracledata/oradata to oracleinstall.The execution of the script is complete[root@www oracle]# ./root.shRunning Oracle10 root.sh script...The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracledata/oracleEnter the full pathname of the local bin directory: [/usr/local/bin]:  Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ...Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.

然后按界面中的“OK”。
至此Oracle 10g安装完成。按“Exit”退出安装。

三、一些常见的错误
1.[INS-06101] IP address of localhost could not be determined
图如下:

解决方法:是因为你的主机名与IP地址不一至,在/etc/hosts文件对应就行了

    vim /etc/hosts     IP地址 主机名

2.at Oracle.install.ivwdb.dirver.DBinstaller.main(DBinstaller.java:132)
图如下:

解决方法:在root用户终端下执行xhost +就行了
3.Error in invoking target 'client_sharedlib' of makefile '/oracle/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'
图如下:

解决方法:查看oracle是多少位的系统,一般32位系统装32位oracle软件,64位系统可以装32位和64位的oracle。打开下载oracle的软件包,里面有一个网页,打开那个网页就可以看到。
4.查看监听(lsnrctl)或者是命令(sqlplus)提示:

 -bash: lsnrctl: command not found

图如下:

解决方法:查找oracle的命令安装目录,我的是(/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin)添加到环境变量中。

vim ~/.bash_profile 

   --是oracle用户根目录的文件,修改这一行

    export PATH=$PATH:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin
source ~/.bash_profile 

     --配置文件生效


  • 上一条:
    详解Linux系统中Oracle数据库程序的启动和关闭方式
    下一条:
    在Linux系统上同时监控多个Oracle数据库表空间的方法
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • 在Linux系统中使用Iptables实现流量转发功能流程步骤(0个评论)
    • vim学习笔记-入门级需要了解的一些快捷键(0个评论)
    • 在centos7系统中实现分区并格式化挂载一块硬盘到/data目录流程步骤(0个评论)
    • 在Linux系统种查看某一个进程所占用的内存命令(0个评论)
    • Linux中grep命令中的10种高级用法浅析(0个评论)
    • 近期文章
    • 智能合约Solidity学习CryptoZombie第三课:组建僵尸军队(高级Solidity理论)(0个评论)
    • 智能合约Solidity学习CryptoZombie第二课:让你的僵尸猎食(0个评论)
    • 智能合约Solidity学习CryptoZombie第一课:生成一只你的僵尸(0个评论)
    • 在go中实现一个常用的先进先出的缓存淘汰算法示例代码(0个评论)
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-11
    • 2017-07
    • 2017-10
    • 2017-11
    • 2018-01
    • 2018-02
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2021-02
    • 2021-03
    • 2021-04
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-11
    • 2021-12
    • 2022-01
    • 2022-03
    • 2022-04
    • 2022-08
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-06
    • 2023-07
    • 2023-10
    • 2023-12
    • 2024-01
    • 2024-04
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客