• 欢迎访问金笔头博客,这是一个菜鸟(伪)程序员的自留地,欢迎访问我的github:点击进入

CentOS6.5 X64安装oracle 11g(一)

Centos eason 4202次浏览 13个评论 扫描二维码

软件环境如下

操作系统:CentOs6.5(64位系统,阿里云云主机)

数据库版本:oracle 11g 64位

硬件配置如下:

CPU: 2核

内存: 4096 MB

操作系统: CentOS 6.5 64位

硬盘:120G

准备工作

1.设置交换空间,参照oracle官方文档,确定swap space的大小http://docs.oracle.com/cd/B28359_01/install.111/b32002/pre_install.htm

CentOS6.5 X64安装oracle 11g(一)

2.查看本机总内存

#grep MemTotal /proc/meminfo

CentOS6.5 X64安装oracle 11g(一)

3.查看交换空间大小:

#grep SwapTotal /proc/meminfo

CentOS6.5 X64安装oracle 11g(一)

4.确认一下,确实没有swap分区

[root@iZ280lgtt2jZ ~]# swapon -s

CentOS6.5 X64安装oracle 11g(一)

发现交换空间大小为0,所以先要设置swap分区,根据上图要求,这里我设置交换区大小为内存的1倍,即4096000

[root@iZ280lgtt2jZ ~]# dd if=/dev/zero of=/swapfile bs=1024 count=4096000

CentOS6.5 X64安装oracle 11g(一)

命令中选项解释:

   ---of:输出的交换文件的路径及名称;
   ---bs:块大小,单位byte,一般为1k即1024个byte;
   ---count:总块数即空间总大小;  

5.将swapfile设置为swap空间

[root@iZ280lgtt2jZ ~]# mkswap /swapfile

CentOS6.5 X64安装oracle 11g(一)

6.开启swap分区

[root@iZ280lgtt2jZ ~]# swapon /swapfile

7.设置开机自启动

[root@iZ280lgtt2jZ ~]# echo "/swapfile swap swap defaults 0 0" >>/etc/fstab

8.检查是否设置成功

[root@iZ280lgtt2jZ ~]# swapon -s

CentOS6.5 X64安装oracle 11g(一)

至此,交换分区已经设定成功!

9.修改主机名

[root@iZ280lgtt2jZ opt]# sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=oracledb/" /etc/sysconfig/network
[root@iZ280lgtt2jZ opt]# hostname oracledb

10.添加主机名与IP对应记录

[root@iZ280lgtt2jZ opt]# vi /etc/hosts

CentOS6.5 X64安装oracle 11g(一)

11.关闭Selinux

[root@iZ280lgtt2jZ opt]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
[root@iZ280lgtt2jZ opt]# setenforce 0

12.安装依赖包

[root@iZ280lgtt2jZ opt]# yum -y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel

13.创建用户和组

[root@iZ280lgtt2jZ opt]# sysctl -p
[root@iZ280lgtt2jZ opt]# groupadd -g 200 oinstall
[root@iZ280lgtt2jZ opt]# groupadd -g 201 dba
[root@iZ280lgtt2jZ opt]# useradd -u 440 -g oinstall -G dba oracle

14.更改oracle用户密码

[root@iZ280lgtt2jZ opt]# passwd oracle

15.修改内核参数

[root@iZ280lgtt2jZ opt]# vi /etc/sysctl.conf
   #在末尾新添加以下内容
   #新添加
   net.ipv4.ip_local_port_range= 9000 65500
   fs.file-max = 6815744
   kernel.shmall = 10523004
   kernel.shmmax = 6465333657
   kernel.shmmni = 4096
   kernel.sem = 250 32000 100128
   net.core.rmem_default=262144
   net.core.wmem_default=262144
   net.core.rmem_max=4194304
   net.core.wmem_max=1048576
   fs.aio-max-nr = 1048576

16.修改系统资源限制

[root@iZ280lgtt2jZ opt]# vi /etc/security/limits.conf
   #新添加
   oracle soft nproc 2047
   oracle hard nproc 16384
   oracle soft nofile 1024
   oracle hard nofile 65536
CentOS6.5 X64安装oracle 11g(一)

编辑/etc/pam.d/login,在session required pam_namespace.so下面添加一条session required pam_limits.so

[root@iZ280lgtt2jZ opt]# vi /etc/pam.d/login

CentOS6.5 X64安装oracle 11g(一)

[root@iZ280lgtt2jZ opt]# vi /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

17、创建安装目录及设置权限

[root@iZ280lgtt2jZ opt]# mkdir /opt/oracle
[root@iZ280lgtt2jZ opt]# mkdir /opt/oracle/app/
[root@iZ280lgtt2jZ opt]# mkdir /opt/oracle/oradata/
[root@iZ280lgtt2jZ opt]# chmod 755 /opt/oracle/
[root@iZ280lgtt2jZ opt]# chmod 775 /opt/oracle/app/
[root@iZ280lgtt2jZ opt]# chown oracle.oinstall -R /opt/oracle/

18.#设置oracle环境变量

[root@iZ280lgtt2jZ opt]# vi ~/.bash_profile
   #添加oracle环境变量
   export ORACLE_BASE=/opt/oracle/app
   export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
   export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
   export ORACLE_SID=hnls

19.#立即生效

[root@iZ280lgtt2jZ opt]# source ~/.bash_profile

金笔头博客, 版权所有丨如未注明 , 均为原创, 转载请注明CentOS6.5 X64安装oracle 11g(一)
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(13)个小伙伴在吐槽
  1. Wow, great article.Thanks Again.
    50 person party bus2016-02-07 21:33 Reply Windows XP | Firefox 3.5.3
  2. This is one awesome article.Much thanks again. Will read on…
    fiverr backlinks2016-02-04 05:00 Reply 未知操作系统 | 未知浏览器
  3. I simply want to tell you that I'm newbie to blogging and site-building and actually savored this blog site. Likely I’m likely to bookmark your blog . You really have incredible writings. Thanks a bunch for sharing with us your website page.
    original site2016-01-26 06:40 Reply Windows XP | Firefox 3.0.14
  4. I rarely comment, however I looked at a few of the comments on %BLOG_TITLE%. I do have some questions for you if you do not mind. Could it be only me or does it look like like a few of these remarks come across like they are left by brain dead individuals? :-P And, if you are writing on additional online sites, I would like to follow|keep up with} anything fresh you have to post. Could you list of the complete urls of all your public pages like your linkedin profile, Facebook page or twitter feed?
    moncler ski jacket sale uk online2016-01-08 02:14 Reply Windows 7 | 未知浏览器
  5. Your method of describing all in this article is in fact good, every one be capable of effortlessly know it, Thanks a lot.
    ray ban buy2015-12-27 01:48 Reply Windows 7 | 未知浏览器
    • you are welcome
      wangyisheng2015-12-28 17:00 Reply Windows 7 | Chrome 47.0.2526.106
  6. After checking out a number of the articles on your blog, I really like your technique of writing a blog. I book-marked it to my bookmark website list and will be checking back in the near future. Please check out my website as well and tell me what you think.
    nike pas cher site securise2015-12-26 23:40 Reply Windows 7 | 未知浏览器
  7. If you wish for to take a good deal from this piece of writing then you have to apply such techniques to your won web site.
    manteau mystique canada goose femme2015-12-16 00:54 Reply Windows 7 | 未知浏览器
  8. Good day! I know this is kinda off topic nevertheless I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My site goes over a lot of the same topics as yours and I think we could greatly benefit from each other. If you are interested feel free to send me an email. I look forward to hearing from you! Great blog by the way!
    nike roshe run dames wit nijmegen2015-12-11 03:03 Reply Windows 7 | 未知浏览器
    • i'm glad to exchanging links with you.give me your links :smile:
      wangyisheng2015-12-11 21:43 Reply Windows 7 | Chrome 45.0.2454.101
  9. Hi! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?
    pjs jassen heren sale flyer2015-12-10 12:11 Reply Windows 7 | 未知浏览器
    • strong password,Last wordpress version,use the thirt-party Plugin As little as possible,backup your website and database at least once a week.
      wangyisheng2015-12-10 15:16 Reply Windows 7 | Chrome 45.0.2454.101
  10. Appreciation to my father who stated to me about this weblog, this webpage is in fact remarkable.
    nike free run 4.0 flyknit2015-12-08 18:18 Reply Windows 7 | 未知浏览器