CentOS 6.0 (Final) 安裝Oracle 11gR2

來源:互聯網
上載者:User

一、安裝Oracle 11g R2 database 前系統內容準備

 

1、查看系統版本、核心版本、作業系統位元,記憶體及交換分區大小、檔案系統空間、主機名稱、IP地址等。

[root@localhost ~]# cat /etc/RedHat-release  #系統版本

CentOS Linux release 6.0 (Final)

 

[root@localhost ~]# uname -a    #核心版本

Linux localhost.localdomain 2.6.32-71.el6.i686 #1 SMP Fri Nov 12 04:17:17 GMT 2010 i686 i686 i386 GNU/Linux

 

[root@localhost ~]# getconf LONG_BIT   #作業系統位元

32

[root@localhost ~]# free -m    #查看記憶體及交換分區大小,官方要求記憶體至少1G,建議2G以上;此處記憶體為1203M

 

                  total       used       free     shared     buffers     cached

Mem:          1203        515        687          0         41        297

-/+ buffers/cache:        176       1026

Swap:         2247          0       2247     #交換分區大小,官方要求為記憶體的1.5倍以上。記憶體大小為2-16G時,交換分區空間等於記憶體大小;超過16G記憶體,交換分區只設定為16G

 

[root@localhost ~]# df -hT /tmp   # 查看/tmp分區空間,官方要求至少1G

Filesystem    Type    Size  Used Avail Use% Mounted on

/tmp          none     16G  5.9G  9.1G  40% /tmp

 

[root@localhost ~]# hostname  #主機名稱,主機名稱可通過修改/etc/hosts和/etc/sysconfig/network進行修改

localhost.localdomain

 

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0  #IP地址配置

DEVICE="eth0"

HWADDR="00:0C:29:4D:E6:3D"

ONBOOT="yes"

BOOTPROTO="static"

IPADDR="192.168.163.44"

NETMASK="255.255.255.0"

GATEWAY="192.168.163.1"

DNS1="202.96.134.133"

DNS2="8.8.8.8"

 

2、關閉防火牆、禁用SELinux

   [root@localhost /]#service iptables stop

   [root@localhost /]#chkconfig iptables off

 

   [root@localhost /]#vi/etc/selinux/config   將SELINUX=disabled

 

3、確認以下包全部安裝

 

[root@localhost ~]# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++- libXp ksh sysstat libaio glibc elfutils unixODBC

 

4、配置系統核心參數,以root使用者登入,修改在/etc/sysctl.conf檔案,在該檔案中添加以下參數:使用sysctl -p 生效

#use for ora11g

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

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 = 1048586

 

5、建立安裝資料庫時所需要使用的使用者組dba及ora11使用者,並將ora11使用者加入到dba組

[root@localhost /]# groupadd dba            #建立dba組

[root@localhost /]# useradd -m -g dba ora11 #設定ora11使用者為dba使用者組的成員

[root@localhost /]# passwd ora11           #設定ora11使用者的密碼

 

6、以root使用者身份登入系統建立Oracle系統的安裝目錄和資料庫檔案存放的目錄。例如:/ora11,及改變以上目錄的屬性命令參考如

[root@localhost /]# mkdir -p /ora11/product/       #建立資料目錄

[root@localhost /]# chown -R ora11:dba /ora11     #設定目錄所屬的使用者組和使用者

[root@localhost /]# chmod -R 775 /ora11            #設定目錄的讀寫權限

 

7、以ora11使用者身份登入系統,配置ora11使用者環境變數,修改ora11使用者下的 .bash_profile 檔案

[root@localhost /]# su - ora11

[ora11@localhost ~]$vi .bash_profile  #執行vi命令來修改.bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

 

export PATH

 

export ORACLE_BASE=/ora11/product

export ORACLE_HOME=$ORACLE_BASE/11.2.0/db_1

export ORACLE_SID=ora11

export LD_LIBRARY_PATH=$ORACLE_HOME/jdk/fre/lib/i386:$ORACLE_HOME/jdk/jre/lib/i386/server:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH

export PATH=$ORACLE_HOME/bin:$PATH

export NLS_LANG=American_America.ZHS16GBK

 

[ora11@localhost ~]$ source .bash_profile  #使用source命令使環境變數檔案生效

 

8、以root使用者修改/etc/security/limits.conf,否則資料庫安裝時系統檢查不能通過

[root@localhost ~]# vi /etc/security/limits.conf

#@student        -       maxlogins       4

ora11           hard    nproc          16384

ora11           soft    nofile         1024

ora11           hard    nofile         65536

ora11           soft    stack          10240

ora11           soft    nproc         10240

 

9、以root使用者編輯/etc/redhat-release,redhat-release為系統版本標誌檔案,在啟動oracle安裝程式時,會對作業系統版本進行檢測,預設不支援redhat-4以上以及CentOs系統,可查看/ora11/database/install/oraparamsilent.ini。需將版本改為redhat-3或者redhat-4,待安裝完成後再改回來( 在安裝時若使用./runInstaller -ignoreSysPrereqs,則可跳過版本檢測 )

[root@localhost ora11]# cp /etc/redhat-release /etc/redhat-release.bk

[root@localhost /]#vi /etc/redhat-release 

將CentOS Linux release 6.0 (Final) 替換成 redhat-4

備忘:安裝完ora11gR2後,可再修改回原版本CentOS Linux release 6.0 (Final)

 

10、到oracle 官網註冊一個帳號,下載ora11gR2安裝介質(linux.x64_11gR2_database_1of2,linux.x64_11gR2_database_2of2,均為免費下載),並拷貝到/ora11下解壓,修改解壓後的database安裝檔案目錄許可權及屬組屬主

[root@localhost ora11]# unzip linux_11gR2_database_1of2.zip

[root@localhost ora11]# unzip linux_11gR2_database_2of2.zip

[root@localhost ora11]# chmod -R 775 database/

[root@localhost ora11]# chown -R ora11:dba database/

備忘:安裝包上傳到伺服器上可通過ftp或者samba進行操作

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.