RedHat As 5.5 安装 Oracle 10g数据库

简介: 一、安装环境 System : RedHat As 5.5 Oracle Version : Oracle 10g
一、安装环境

System : RedHat As 5.5
Oracle Version : Oracle 10g

二、准备安装

1.修改/etc/redhat-release内容为
redhat-4

2.创建Oracle相关的用户及目录
将用户切换到root帐号,进行登录
# su -
创建oracle相关的用户组,用户
# groupadd oinstall
# groupadd dba
# useradd oracle -g oinstall -G dba
修改oracle用户的密码
#passwd oracle

3.创建安装oracle相关的目录,并进行相应的授权操作
# mkdir -p /opt/oracle/oracle10g
# chown -R oracle:oinstall /opt/oracle
# chmod -R 755 /opt/oracle

4.修改安装oracle的相关参数
使用编辑器修改/etc/sysctl.conf文件的相关参数
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144  
net.core.rmem_max=262144  
net.core.wmem_default=262144  
net.core.wmen_max=262144  

运行下面的命令应用以上OS参数
# /sbin/sysctl -p

5.添加以下行到/etc/security/limits.conf文件中

*               soft    nproc   2047  
*               hard    nproc   16384  
*               soft    nofile 1024  
*               hard    nofile 65536  

6.如果/etc/pam.d/login文件中没有以下行,则添加以下内容:
session    required     /lib/security/pam_limits.so

7.修改/etc/selinux/config文件来关闭linux防火墙,确保SELINUX设置如下:
SELINUX=disabled

检查是否具备以下安装包:

  1. make-3.79.1  
  2. gcc-3.2.3-34  
  3. glibc-2.3.2-95.20  
  4. compat-db-4.0.14-5  
  5. compat-gcc-7.3-2.96.128  
  6. compat-gcc-c++-7.3-2.96.128  
  7. compat-libstdc++-7.3-2.96.128  
  8. compat-libstdc++-devel-7.3-2.96.128  
  9. libXp   
  10. openmotif21-2.1.30-8  
  11. setarch-1.3-1  
查询所需安装包是否完整(缺啥补啥)
rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel libXp  

用以下命令安装以下包:
rpm -Uvh [包名称]
或:yum install [包名称]

5.使用oracle用户登录进行登录

修改主目录下的.bash_prifile
在文件的末尾添加如下内容
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/oracle10g
export ORACLE_SID=wenin819
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

6.将oracle用户的环境变量立刻生效
$ source  ~/.bash_profile

三、安装Oracle10g数据库

1.解压Oracle10g安装压缩包,进行授权操作
$ unzip 10201_database_linux32.zip
或64位 $ $ zcat 10201_database_linux_x86_64.cpio.gz | cpio -idmv

如果担心安装界面中文乱码设置环境变量(使用英文环境安装)
export LANG=C  

2.进入该目录执行安装操作
$ cd database
$ ./runinstall

1.   选择安装方式,选择高级安装
2.  选择安装目录
3.   选择安装类型, 在选择安装类型时,选择产品语言,把中文选上,不选的话,数据库默认为支持的语言只有英文。
4.   安装详细路径
5.   软件要求检查
6.   配置选项 一般选择“创建数据库(C)”
7.   数据库配置 一般选择“一般用途(G)”
8.   数据库配置详情,字符集根据实际情况选择,可以选择AL32UTF8/ZHS16GBK,这样可以支持中文
9.   数据库管理选项 一般选择“使用Database Control管理数据库”
10.  数据库文件存储选项 一般选择“文件系统”
11.  备份和恢复选项 一般选择“不启用自动备份”
12.  设置密码 根据个人情况设置密码
14.  配置Assistants
15.  数据库配置助手
16.  密码管理
17.  运行脚本, 必须在root用户下运行。
18.  结束安装


3.切换到root账户下,执行root.sh文件
# cd /opt/oracle/oracle10g
# ./root.sh

4.安装成功后,修改/etc/oratab文件
设置每个实例的重启标志为“Y”
     wenin819:/opt/oracle/oracle10g:Y

补充:需要oracle用户运行orca命令,进行相关的配置
[oracle@localhost db_1]$ orca

(-c:5895): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
Welcome to Orca setup.
Select desired speech system:
1. Emacspeak Speech Services
2. GNOME Speech Services
Enter choice: 2
Select desired voice:
1. kal_diphone
2. ked_diphone
Enter choice: 1
Enable echo by word?  Enter y or n: y
Enable key echo?  Enter y or n: y
Enable alphanumeric and punctuation keys?  Enter y or n: y
Enable modifier keys?  Enter y or n: y
Enable locking keys?  Enter y or n: y
Enable function keys?  Enter y or n: y
Enable action keys?  Enter y or n: y
Enable Braille?  Enter y or n: y
Enable Braille Monitor?  Enter y or n: y
Accessibility support for GNOME has just been enabled.
You need to log out and log back in for the change to take effect.
Setup complete.  Press Return to continue. 

5.修改$ORACLE_HOME/bin/dbstart
$ cd $ORACLE_HOME
$ cd bin
使用vi 编辑器对dbstart文件进行修改
$vi dbstart
将以下内容:
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
更改为:
ORACLE_HOME_LISTNER=$ORACLE_HOME

6.测试Oracle 10g 数据库:

启动Oracle10g 数据库sqlplus
$ sqlplus "/as sysdba" 

将出现如下连接数据库信息:
SQL*Plus: Release 10.1.0.2.0 - Production on 星期三 3月 24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明登录数据库系统成功,运行startup命令启动数据库。
SQL> startup
ORACLE instance started.
Total System Global Area 336356520 bytes
Fixed Size 279720 bytes
Variable Size 268435456 bytes
Database Buffers 67108864 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
SQL>
表示数据库正常启动。


8. 关闭Oracle10g 数据库
$ sqlplus "/as sysdba" //以sysdba用户登录数据库

成功登录数据库系统后,运行shudown命令关闭数据库。

SQL> shutdown immediate


9. 启动Oracle10g监听程序
Oracle的监听程序主要是为客户端的连接提供接口,在控制台窗口键入如下命令:
$ lsnrctl  

将出现如下监听程序信息:

LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 24-3月 -2004 16
:59:51

Copyright (c) 1991, 2004, Oracle. All rights reserved.

欢迎来到LSNRCTL, 请键入"help"以获得信息。

LSNRCTL>

表明登录监听程序控制台成功,运行start命令启动监听程序。

LSNRCTL> start  

将出现监听程序的一系列启动和配置情况信息列表。
信息行的最后一行是“The command completed successfully”字样时,监听程序启动成功。

10. 关闭Oracle10g监听程序
运行stop命令关闭监听程序。
LSNRCTL> stop 

11.设置oracle自动启动与关闭
创建oracled服务启动脚本
在/etc/init.d目录下创建文件名称为oracled的文件
oracled文件中添加如下内容:

#! /bin/bash
# chkconfig: - 20 80
# description: oracle 10g is database. It is used to serve
# file : /etc/init.d/oracled
# author : wenin819
# date : 2012.06.29
# Run-level Startup script for the Oracle Instance, Listener, Web Interface
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/oracle10g
export ORACLE_SID=wenin819
ORA_OWNER="oracle"
#if the executables do not exist ,then display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo  "oracle startup : can't start"
exit 1
fi
# the oracle10g database depending on parameter -- start, shutdown,restart
case "$1" in
start)
echo -n "starting oracle:"
su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbstart"
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
echo "ok"
;;
stop)
echo -n "shutdown oracle:"
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbshut"
echo "ok"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage:`basename $0` start|stop|restart|reload"
exit 1
esac
exit 0

12.给文件进行授权,添加服务,启动服务
# cd /etc/init.d
# chmod 755  oracled
# chkconfig --add oracled
# service oradb start

三、安装是错误解决
ora-27125:
# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
# more /proc/sys/vm/hugetlb_shm_group
0
# echo 500 >>/proc/sys/vm/hugetlb_shm_group
不过这样设置重启后参数就丢失了,可以在/etc/sysctl.conf或/etc/sysctl.d/oracle.conf文件里面添加该参数
vm.hugetlb_shm_group=500 (500为oinstall的用户组号)


之后运行命令
#sysctl -p

#sysctl -p /etc/sysctl.d/oracle.conf


可使该参数在内核内存中立即生效


四、 参见:https://www.oratoolkit.ch/knowledge/howto/installation/seSrv-10g-R2-on-RHEL-6.0-x86_64.php

相关文章
|
14天前
|
SQL Oracle 关系型数据库
【Oracle】玩转Oracle数据库(一):装上去,飞起来!
【Oracle】玩转Oracle数据库(一):装上去,飞起来!
56 7
|
1月前
|
Oracle 关系型数据库 数据库
Oracle数据库基本概念理解(3)
Oracle数据库基本概念理解(3)
18 2
|
14天前
|
SQL Oracle 关系型数据库
【Oracle】玩转Oracle数据库(七):RMAN恢复管理器
【Oracle】玩转Oracle数据库(七):RMAN恢复管理器
41 5
|
30天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
69 0
|
1月前
|
Oracle 关系型数据库 数据库
Oracle数据库基本概念理解(2)
Oracle数据库基本概念理解(2)
13 1
|
6天前
|
存储 Oracle 关系型数据库
Oracle的模式与模式对象:数据库的“城市规划师”
【4月更文挑战第19天】在Oracle数据库中,模式是用户对象的集合,相当于数据库的城市规划,包含表、视图、索引等模式对象。模式对象是数据存储结构,如表用于存储数据,视图提供不同查看角度,索引加速数据定位。良好的模式与模式对象设计关乎数据效率、安全和稳定性。规划时需考虑业务需求、性能、安全和可扩展性,以构建高效数据库环境,支持企业业务发展。
|
14天前
|
存储 SQL Oracle
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
35 7
|
28天前
|
存储 监控 Java
InfluxDB时序数据库安装和使用
InfluxDB时序数据库安装和使用
47 2
|
6天前
|
关系型数据库 MySQL 分布式数据库
《MySQL 简易速速上手小册》第6章:MySQL 复制和分布式数据库(2024 最新版)
《MySQL 简易速速上手小册》第6章:MySQL 复制和分布式数据库(2024 最新版)
37 2
|
22天前
|
SQL 数据可视化 关系型数据库
轻松入门MySQL:深入探究MySQL的ER模型,数据库设计的利器与挑战(22)
轻松入门MySQL:深入探究MySQL的ER模型,数据库设计的利器与挑战(22)
105 0

热门文章

最新文章

推荐镜像

更多