ORACLE 11.2.0.3配置ASM

wzq609發表於2016-03-01

【環境說明】本文件介紹在OEL6.3的環境下安裝基於ASM 11.2.0.3的ORACLE資料庫的安裝;

虛擬機器:VMware 10

OS:Oracle Linux Server release 6.3

DB:11.2.0.3

 

【一】作業系統的安裝:這邊省略

 

【二】準備工作

1、執行環境包的安裝,掛載系統盤

[root@idbtcsv1222 Packages]# cd /media/OL6.3 x86_64 Disc 1 20120626/Packages

rpm -ivh compat-libcap1-1.10-1.x86_64.rpm

rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh libgcc-4.4.6-4.el6.i686.rpm
rpm -ivh kernel-headers-2.6.32-279.el6.x86_64.rpm
rpm -ivh glibc-headers-2.12-1.80.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.80.el6.x86_64.rpm
rpm -ivh libgomp-4.4.6-4.el6.x86_64.rpm
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
rpm -ivh cpp-4.4.6-4.el6.x86_64.rpm
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-4.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
rpm -ivh xinetd-2.3.14-34.el6.x86_64.rpm
rpm -ivh rsh-server-0.17-60.el6.x86_64.rpm
rpm -ivh ksh-20100621-16.el6.x86_64.rpm
rpm -ivh tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64.rpm

 

2、修改引數檔案

在/etc/sysctl.conf配置檔案中新增如下:

kernel.shmall = 4294967296

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.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586

net.ipv4.ip_local_port_range = 9000 65500

 

然後執行以下生效:
[root@db01 ~]# sysctl -p 

 

在/etc/security/limits.conf配置檔案中新增如下:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

在/etc/pam.d/login配置檔案中新增:

session required pam_limits.so

在/etc/profile配置檔案中新增:

if [ $USER = "oracle" ] || [ $USER = "grid" ]; then

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

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

fi

 

關閉防火牆:service iptables stop

3、建立目錄

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

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

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

 

4、建立使用者和角色

[root@db01 Packages]# groupadd oinstall

[root@db01 Packages]# groupadd dba

[root@db01 Packages]# groupadd asmadmin

[root@db01 Packages]# groupadd asmdba

[root@db01 Packages]# useradd -g oinstall -G asmdba,asmadmin,dba grid

[root@db01 Packages]# useradd -g oinstall -G dba,asmdba oracle

[root@db01 Packages]# passwd grid

oracle如下:

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

export ORACLE_BASE=/u01/app/oracle

export ORACLE_SID=rac

export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin:/u01/app/oracle/product/11.2.0/dbhome_1/OPatch

4

grid如下

export ORACLE_BAS=/u01/app/grid

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

export ORACLE_SID=+ASM

export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/grid/product/11.2.0/grid/bin:/u01/app/grid/product/11.2.0/grid/OPatch

 

5、建立硬碟,用於做ASM

虛擬機器新增三塊磁碟,不需要做其他操作

27b1869e-263b-4a1c-889e-ee429906b5ea

 

[root@db01 Packages]# fdisk -l

Disk /dev/sdb: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sda: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0005e624

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64        5222    41430016   8e  Linux LVM

Disk /dev/sdc: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdd: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

顯示系統已有三塊硬碟

 

[root@db01 Packages]# vi /etc/udev/rules.d/60-raw.rules

新增如下:

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

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

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

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

 

【三】安裝GRID,ORACLE從11G開始,當需要使用ASM、RAC功能的時候就需要安裝單獨的GRID,ORACLE Patchset有7個檔案

第一二個包表示database,升級和安裝資料庫,只需要這2個檔案即可。

第三個包表示grid,用來升級RAC 的CRS。安裝RAC和ASM需要這個檔案

第四個表示客戶端,

第五個表示gateways,

第六個表示 examples, 這個是我們的示例檔案安裝包。

第七個表示deinstall

安裝截圖:

9a8b15d7-5f8d-41be-9bb3-1fc11c252b59

1a0fae2a-64d8-423b-b10d-aa55c4f0ba26

6f163c9b-519a-4004-8841-a5cb1d3c0d42

778e38f8-6419-4fc5-a484-538869d6007c

6583781b-1ab8-458e-b69c-c5b407a2e56d

22c2d7ec-7d61-411e-aa5f-f4e3aa7f5308

da7b0bb0-17dd-4d80-b3be-b42c0d676cd7

2c330e8c-6163-44ce-9eeb-67620f0d0173

[grid@db01 ~]$ sqlplus / as sysasm

SQL> select instance_name,status from v$instance;

 

INSTANCE_NAME STATUS

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

+ASM MOUNT

 

【四】安裝資料庫,安裝的步驟跟普通安裝的步驟是一樣的,主要是以下這個截圖需要注意

127160034

127023002

 

【五】ASM常用SQL語句

SQL> select file_name from dba_data_files;

 

FILE_NAME

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

+DATA/rac/datafile/users.259.896831997

+DATA/rac/datafile/undotbs1.258.896831997

+DATA/rac/datafile/sysaux.257.896831997

+DATA/rac/datafile/system.256.896831997

SQL> select name,total_mb,state from v$asm_diskgroup;

 

NAME TOTAL_MB STATE

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

DATA 92160 CONNECTED

SQL> select instance_name,db_name,status from v$asm_client;

 

INSTANCE_NAME B_NAME STATUS

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

+ASM rac CONNECTED

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

相關文章