Centos 6.5安装oracle 11g
admin
2023-04-30 08:04:22
0

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip?AuthParam=1479527366_c5c6af19e54f7eed218aafe6914b194e  (下载地址)

安装时内存不要低于2G

1. 使用root用户登录操作系统

2. yum 安装 unzip 软件用来解压上传的Oracle安装文件

[root@CentOS ~]# yum install unzip –y

3. 解压Oracle 安装程序

[root@CentOS ~]# cd /tmp

[root@CentOS tmp]# unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip

(这里有俩个包,1跟2都要下载)

 

4. Yum 安装vim软件,用于编辑配置文件(个人习惯,不安装vim,使用vi也可以)。

[root@CentOS tmp]# yum install vim -y

5. /etc/hosts文件中添加主机名

[root@CentOS tmp]# vim /etc/hosts

添加192.168.206.135 CentOS

 Centos 6.5安装oracle 11g

6. 关闭selinux

[root@CentOS tmp]# vim /etc/selinux/config

设置SELINUX=disabled

 Centos 6.5安装oracle 11g

[root@CentOS tmp]# setenforce 0

 

7. 关闭防火墙

[root@CentOS tmp]# service iptables stop


8. 安装Oracle 11g依赖包

[root@CentOS tmp]# yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl sysstat libXp unixODBC unixODBC-devel -y



9. 添加安装用户和用户组

 

[root@CentOS tmp]# groupadd oinstall

[root@CentOS tmp]# groupadd dba

[root@CentOS tmp]# useradd -g oinstall -G dba oracle

[root@CentOS tmp]# passwd oracle

[root@CentOS tmp]# id oracle

uid=1001(oracle) gid=1001(oinstall) =1001(oinstall),1002(dba)

 

10. 修改内核参数配置文件

[root@CentOS ~]# vim /etc/sysctl.conf

 

添加以下内容

 

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

kernel.shmall = 2097152

kernel.shmmax = 1073741824

 

 

[root@CentOS ~]# sysctl -p

 

其中kernel.shmmax = 1073741824本机物理内存2G)的一半,单位为byte


这里会有个错误:



Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g



11. 修改用户的限制文件


[root@CentOS ~]# vim /etc/security/limits.conf

 

添加以下内容

 

oracle           soft    nproc           2047

oracle           hard    nproc           16384

oracle           soft    nofile          1024

oracle           hard    nofile          65536

oracle           soft    stack           10240

 

修改/etc/pam.d/login文件

[root@CentOS ~]# vim /etc/pam.d/login

 

添加以下内容

 

session  required   /lib64/security/pam_limits.so

session        required               pam_limits.so

 

修改/etc/profile文件

[root@CentOS ~]# vim /etc/profile

 

添加以下内容

 

if [ $USER = "oracle" ]; then

  if [ $SHELL = "/bin/ksh" ]; then

   ulimit -p 16384

   ulimit -n 65536

  else

   ulimit -u 16384 -n 65536

  fi

fi

 

12. 创建安装目录和设置文件权限

 

[root@CentOS ~]# mkdir -p /u01/app/oracle/product/11.2.0

[root@CentOS ~]# mkdir /u01/app/oracle/oradata

[root@CentOS ~]# mkdir /u01/app/oracle/inventory

[root@CentOS ~]# mkdir /u01/app/oracle/flash_recovery_area

[root@CentOS ~]# chown -R oracle:oinstall /u01/app/oracle

[root@CentOS ~]# chmod -R 775 /u01/app/oracle

 

 

13. 设置oracle用户环境变量

 

[root@CentOS ~]# su - oracle

[oracle@CentOS ~]$ vim .bash_profile

添加如下内容

 

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0

ORACLE_SID=orcl

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH



[root@oracle11g ~]# xhost +

access control disabled, clients can connect from any host

[root@oracle11g ~]# su - oracle

[oracle@oracle11g ~]$ unzip linux.x64_11gR2_database_1of2.zip 

[oracle@oracle11g ~]$ unzip linux.x64_11gR2_database_2of2.zip 

[oracle@oracle11g ~]$ cd database/

[oracle@oracle11g database]$ ./runInstaller 

这里要在图形化界面安装 下运行./runlnstaller,不然会出错,

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

注意,这里./runInstaller会出现错误,需要安装yum groupinstall "KDE Desktop" 然后在图形界下重启服务器,就可以了



Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g


Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

Centos 6.5安装oracle 11g

[root@oracle11g ~]# sh /u01/oraInventory/orainstRoot.sh 

执行/u01/有个root.sh的脚本


Running Oracle 11g root.sh script...


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/oracle/product/11.2.0.1/db_1


Enter 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 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.

Finished product-specific root actions.


.登陆oracle数据库


[oracle@oracle11g database]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 12 23:22:35 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from dual;

D

-

X

SQL> select instance_name from v$instance;

INSTANCE_NAME

----------------

orac11g

SQL> 


相关内容

热门资讯

国台办:买再多的武器都是螳臂当... 5月13日,国务院台办举行例行新闻发布会。总台记者就台湾军购费用引发舆论质疑提问。发言人张晗表示,我...
豫篮联赛:赛场劲吹“文旅风” 汉服小姐姐在看台上翩翩起舞。胡斌 摄洛阳队球员上篮。胡斌 摄“五一”小长假后,豫篮联赛伴随着初夏的热...
凡星闪耀丨《武林外传》中小米扮... 张清(右)在免费餐厅为大家服务。张清在《武林外传》中饰演“丐帮弟子”小米(右)。在郑州的城市烟火气中...
卫华:做走向世界的“起重管家” 卫华集团智能生产车间。常晶晶 摄作为全省服务业大会的参会企业,河南卫华重型机械股份有限公司(以下简称...
在加快国际消费中心城市建设中彰... “服务业是推动经济高质量发展的重要引擎,也是强化国家中心城市核心竞争力的重要支柱。”5月12日,省委...
坚定不移沿着习近平总书记指引的... 壮美的郑州黄河文化公园。河南日报资料图片 河南日报全媒体记者 聂冬晗 摄来郑州,到哪里慢赏大河风光?...
双庆同辉映初心——黄河科技学院... 2026年5月12日,黄河科技学院附属医院迎来开诊七周年纪念日,恰逢第115个国际护士节。当天,医院...
驻美大使谢锋回应中美热点问题 据中国驻美国大使馆5月13日消息,5月5日,中国驻美国大使谢锋就美国总统特朗普访华和中美关系接受美国...
邻妹妹帮办 | 占地1.2万㎡... “杞县有个婚礼庄园,6 大主题特色宴会厅,可同时容纳2000人聚餐,在未变更工业用地用途、未经消防验...
国台办:和平统一后,台湾同胞民... 5月13日,国务院台办举行例行新闻发布会。有记者问,国务院台办发言人在之前发布会上已分别阐释了和平统...