RHEL 6.5 64位安裝ORACLE 11G R2 Grid Infrastructure for a Standalone Server

stonebox1122發表於2015-06-06

 

1 系統環境

VMWARE下建立Linux虛擬機器,具體配置如下圖:

clip_image002

1.1 主機名及地址

[root@oragrid ~]# hostname

oragrid

[root@oragrid ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.230.133         oragrid

 

1.2 作業系統及版本

[root@oragrid ~]# cat /etc/issue

Red Hat Enterprise Linux Server release 6.5 (Santiago)

 

1.3 記憶體大小

[root@oragrid ~]# free -m

             total       used       free     shared    buffers     cached

Mem:          1998        511       1487          0         25        183

-/+ buffers/cache:        301       1696

Swap:         1999          0       1999

#記憶體至少1Gswap至少為1.5倍記憶體,此處的記憶體為2Gswap也為2G,安裝時會提示不滿足安裝條件,可以忽略也可以增加swap

 

1.4 安裝版本及安裝包

版本為:11.2.0.4

需要三個安裝包,分別為:

p13390677_112040_Linux-x86-64_1of7.zip

p13390677_112040_Linux-x86-64_2of7.zip

p13390677_112040_Linux-x86-64_3of7.zip

 

2 安裝GI環境準備

2.1 建立使用者和組及設定密碼

[root@oragrid ~]# groupadd oinstall                                                                                                         [root@oragrid ~]# groupadd dba

[root@oragrid ~]# useradd -g oinstall -G dba oracle

[root@oragrid ~]# useradd -g oinstall -G dba grid

[root@oragrid ~]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is too simplistic/systematic

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

[root@oragrid ~]# passwd grid

Changing password for user grid.

New password:

BAD PASSWORD: it is too simplistic/systematic

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

 

2.2 建立安裝目錄及設定許可權

[root@oragrid ~]# mkdir -p /u01/oraInventory

[root@oragrid ~]# mkdir -p /u01/app/grid

[root@oragrid ~]# mkdir -p /u01/app/oracle

[root@oragrid ~]# chown -R grid:oinstall /u01

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

[root@oragrid ~]# chmod -R 775 /u01/

 

2.3 環境變數設定

Grid使用者:

[root@oragrid ~]# su - grid

[grid@oragrid ~]$ vim .bash_profile

[grid@oragrid ~]$ tail -5 .bash_profile

ORACLE_BASE=/u01/app/grid

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

ORACLE_SID=+ASM

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

[grid@oragrid ~]$ source .bash_profile

[grid@oragrid ~]$ env | grep ORACLE

ORACLE_SID=+ASM

ORACLE_BASE=/u01/app/grid

ORACLE_HOME=/u01/app/grid/product/11.2.0/grid

 

Oracle使用者:

[grid@oragrid ~]$ su - oracle

Password:

[oracle@oragrid ~]$ vim .bash_profile

[oracle@oragrid ~]$ tail -5 .bash_profile

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

ORACLE_SID=stone

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

[oracle@oragrid ~]$ source .bash_profile

[oracle@oragrid ~]$ env | grep ORACLE

ORACLE_SID=stone

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

 

2.4 磁碟分割槽

[root@oragrid ~]# cat /proc/partitions

major minor  #blocks  name

 

   8        0   52428800 sda

   8        1     204800 sda1

   8        2    2048000 sda2

   8        3   50174976 sda3

   8       16   10485760 sdb

   8       32   10485760 sdc

   8       48    5242880 sdd

   8       64    5242880 sde

   8       80    5242880 sdf

#總共6塊磁碟,/dev/sda為系統所在磁碟,/dev/sdb/dev/sdc/dev/sdd/dev/sde/dev/sdf為沒有使用的磁碟,提供給ASM用。下面對以上5塊磁碟進行分割槽。

[root@oragrid ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xfc089d2c.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):

Using default value 1305

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

對剩餘磁碟進行同樣操作。

[root@oragrid ~]# partprobe

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.

[root@oragrid ~]# cat /proc/partitions

major minor  #blocks  name

 

   8        0   52428800 sda

   8        1     204800 sda1

   8        2    2048000 sda2

   8        3   50174976 sda3

   8       16   10485760 sdb

   8       17   10482381 sdb1

   8       32   10485760 sdc

   8       33   10482381 sdc1

   8       48    5242880 sdd

   8       49    5237158 sdd1

   8       64    5242880 sde

   8       65    5237158 sde1

   8       80    5242880 sdf

   8       81    5237158 sdf1

將分割槽對映為raw裝置:

[root@oragrid ~]# vim /etc/udev/rules.d/60-raw.rules

[root@oragrid ~]# tail -6 /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"

KERNEL=="raw*", OWNER="grid" GROUP="dba", MODE="0660"

[root@oragrid ~]# ls /dev/raw/

rawctl

[root@oragrid ~]# start_udev

Starting udev:                                             [  OK  ]
[root@oragrid ~]# ls /dev/raw/

raw1  raw2  raw3  raw4  raw5  rawctl

 

3 安裝GI及建立磁碟組

3.1 安裝GI

grid使用者的home目錄下解壓GI安裝包。

[grid@oragrid ~]$ unzip /mnt/hgfs/11204/p13390677_112040_Linux-x86-64_3of7.zip

[grid@oragrid ~]$ ls grid/

install  readme.html  response  rpm  runcluvfy.sh  runInstaller  sshsetup  stage  welcome.html

在宿主機(IP192.168.230.1)上啟動Xmanager Passive。然後在虛擬機器上設定DISPLAY環境變數。

[grid@oragrid ~]$ export DISPLAY=192.168.230.1:0.0

[grid@oragrid ~]$ cd grid/

[grid@oragrid grid]$ ./runInstaller

Starting Oracle Universal Installer...

 

Checking Temp space: must be greater than 120 MB.   Actual 38607 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 1999 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-06-04_12-55-52PM. Please wait ...

clip_image004

clip_image006

clip_image008

clip_image010

clip_image012

clip_image014

clip_image016

clip_image018

clip_image020

clip_image022

clip_image024

clip_image025

[root@oragrid ~]# /tmp/CVU_11.2.0.4.0_grid/runfixup.sh

Response file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.response

Enable file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.enable

Log file location: /tmp/CVU_11.2.0.4.0_grid/orarun.log

Setting Kernel Parameters...

The value for shmmni in response file is not greater than value of shmmni for current session. Hence not changing it.

The value for semmsl in response file is not greater than value of semmsl for current session. Hence not changing it.

The value for semmns in response file is not greater than value of semmns for current session. Hence not changing it.

The value for semmni in response file is not greater than value of semmni for current session. Hence not changing it.

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

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

uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba)

clip_image027

配置YUM

[root@oragrid ~]# cd /etc/yum.repos.d/

[root@oragrid yum.repos.d]# wget

[root@oragrid yum.repos.d]# yum makecache

安裝需要的軟體包:

[root@oragrid yum.repos.d]# yum install gcc compat-libstdc++-33 elfutils-libelf-devel gcc-c++ libaio-devel libstdc++-devel pdksh -y

clip_image029

clip_image031

clip_image033

clip_image035

clip_image036

clip_image038

clip_image040

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

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@oragrid ~]# /u01/app/grid/product/11.2.0/grid/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/grid/product/11.2.0/grid

 

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

Now product-specific root actions will be performed.

Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

/u01/app/grid/product/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory

Failed to create keys in the OLR, rc = 127, Message:

 

Failed to create keys in the OLR at /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_lib.pm line 7660.

/u01/app/grid/product/11.2.0/grid/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid/perl/lib -I/u01/app/grid/product/11.2.0/grid/crs/install /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl execution failed

執行這個指令碼報錯error while loading shared libraries: libcap.so.1,解決方法如下:

[root@oragrid ~]# yum install -y compat-libcap1

[root@oragrid ~]# /u01/app/grid/product/11.2.0/grid/crs/install/rootcrs.pl -verbose -deconfig -force

Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params

Usage: srvctl []

    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config|upgrade

    objects: database|service|asm|diskgroup|listener|home|ons

For detailed help on each command and object and its options use:

  srvctl -h or

  srvctl -h

PRKO-2012 : nodeapps object is not supported in Oracle Restart

CRS-4639: Could not contact Oracle High Availability Services

CRS-4000: Command Stop failed, or completed with errors.

CRS-4639: Could not contact Oracle High Availability Services

CRS-4000: Command Modify failed, or completed with errors.

CRS-4639: Could not contact Oracle High Availability Services

CRS-4000: Command Delete failed, or completed with errors.

CRS-4013: This command is not supported in a single-node configuration.

CRS-4000: Command Stop failed, or completed with errors.

################################################################

# You must kill processes or reboot the system to properly #

# cleanup the processes started by Oracle clusterware          #

################################################################

ACFS-9313: No ADVM/ACFS installation detected.

Failure in execution (rc=-1, 256, No such file or directory) for command /etc/init.d/ohasd deinstall

error: package cvuqdisk is not installed

Successfully deconfigured Oracle clusterware stack on this node

[root@oragrid ~]# /u01/app/grid/product/11.2.0/grid/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/grid/product/11.2.0/grid

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The contents of "oraenv" have not changed. No need to overwrite.

The contents of "coraenv" have not changed. No need to overwrite.

 

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

Now product-specific root actions will be performed.

Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params

LOCAL ADD MODE

Creating OCR keys for user 'grid', privgrp 'oinstall'..

Operation successful.

LOCAL ONLY MODE

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

CRS-4664: Node oragrid successfully pinned.

Adding Clusterware entries to upstart

 

oragrid     2015/06/04 23:03:35     /u01/app/grid/product/11.2.0/grid/cdata/oragrid/backup_20150604_230335.olr

Successfully configured Oracle Grid Infrastructure for a Standalone Server

clip_image042

 

3.2 建立磁碟組

由於在安裝GI的時候只能建立一個磁碟組,如果需要增加磁碟組的話,在GI安裝完成後,使用ASMCA命令增加磁碟組。

[grid@oragrid grid]$ export DISPLAY=192.168.230.1:0.0

[grid@oragrid grid]$ asmca

clip_image044

clip_image046

clip_image048

clip_image050

4 安裝資料庫

oracle使用者的home目錄下解壓database安裝包。

[root@oragrid ~]# su – oracle

[oracle@oragrid ~]$ unzip /mnt/hgfs/11204/p13390677_112040_Linux-x86-64_1of7.zip

[oracle@oragrid ~]$ unzip /mnt/hgfs/11204/p13390677_112040_Linux-x86-64_2of7.zip

[oracle@oragrid ~]$ export DISPLAY=192.168.230.1:0.0

[[oracle@oragrid ~]$ cd database/

[oracle@oragrid database]$ ./runInstaller

clip_image052

clip_image054

clip_image056

clip_image058

clip_image060

clip_image062

clip_image064

clip_image066

clip_image068

clip_image069

[root@oragrid ~]# /tmp/CVU_11.2.0.4.0_oracle/runfixup.sh

Response file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.response

Enable file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.enable

Log file location: /tmp/CVU_11.2.0.4.0_oracle/orarun.log

uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)

clip_image071

clip_image073

clip_image075

clip_image077

clip_image079

clip_image081

[root@oragrid ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The contents of "oraenv" have not changed. No need to overwrite.

The contents of "coraenv" have not changed. No need to overwrite.

 

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

Now product-specific root actions will be performed.

Finished product-specific root actions.

clip_image083

5 建立資料庫

[oracle@oragrid database]$ dbca

clip_image085

clip_image087

clip_image089

clip_image091

clip_image093

clip_image095

clip_image097

clip_image099 

clip_image101

clip_image103

clip_image105

 

clip_image107

clip_image109

clip_image111

clip_image113

clip_image115

clip_image117

clip_image119

clip_image121

clip_image123

clip_image125

clip_image127

大功告成。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28536251/viewspace-1689235/,如需轉載,請註明出處,否則將追究法律責任。

相關文章