ASM單例項(Oracle 11.2.0.4)環境(二)

shawnloong發表於2017-07-18

五.安裝grid

5.1 安裝依賴包

yum -y install binutils-* compat-libstdc++-* gcc-* gcc-c++-* glibc-* glibc-devel libaio-* libaio-devel libgcc-4.1.2 libstdc++-* libstdc++-devel make sysstat elfutils-libelf-devel unixODBC-* unixODBC-devel-* elfutils-libelf-devel

pdksh包安裝

rpm –ivh rpm -ivh pdksh-5.2.14-30.x86_64.rpm5.2修改核心引數檔案

(如果是記憶體不一樣需要修改kernel.shmall,kernel.shmmax )

修改/etc/sysctl.conf

註釋掉之前引數

sed -i '/kernel\.shmmax/s/^/#/' /etc/sysctl.conf

sed -i '/kernel\.shmall/s/^/#/' /etc/sysctl.conf

編輯/etc/sysctl.conf

echo -e "#oracle insert\n">>/etc/sysctl.conf

echo "fs.aio-max-nr = 1048576">>/etc/sysctl.conf

echo "fs.file-max = 6815744">>/etc/sysctl.conf

echo "kernel.shmall = 4194304">>/etc/sysctl.conf

echo "kernel.shmmax = 15536870912">>/etc/sysctl.conf

echo "kernel.shmmni = 4096">>/etc/sysctl.conf

echo "kernel.sem = 250 32000 100 128">>/etc/sysctl.conf

echo "net.ipv4.ip_local_port_range = 9000 65500">>/etc/sysctl.conf

echo "net.core.rmem_default = 262144">>/etc/sysctl.conf

echo "net.core.rmem_max = 4194304">>/etc/sysctl.conf

echo "net.core.wmem_default = 262144">>/etc/sysctl.conf

echo "net.core.wmem_max = 1048586">>/etc/sysctl.conf

modprobe bridge

儲存配置

sysctl –p

修改/etc/security/limits.conf

echo "grid soft nofile 1024">>/etc/security/limits.conf

echo "grid hard nofile 65536">>/etc/security/limits.conf

echo "grid soft nproc 2047">>/etc/security/limits.conf

echo "grid hard nproc 16384">>/etc/security/limits.conf

echo "grid soft stack 10240">>/etc/security/limits.conf

echo "grid hard stack 32768">>/etc/security/limits.conf

echo "oracle soft nofile 1024">>/etc/security/limits.conf

echo "oracle hard nofile 65536">>/etc/security/limits.conf

echo "oracle soft nproc 2047">>/etc/security/limits.conf

echo "oracle hard nproc 16384">>/etc/security/limits.conf

echo "oracle soft stack 10240">>/etc/security/limits.conf

修改/etc/pam.d/login

echo "oracle hard stack 32768">>/etc/security/limits.confecho "session required pam_limits.so" >> /etc/pam.d/login

新建檔案 /etc/profile.d/oracle-grid.sh,新增以下內容

if [ $USER = "oracle" ]; then

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

ulimit -u 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

if [ $USER = "grid" ]; then

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

ulimit -u 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi5.3 新增相應使用者及許可權

groupadd -g 54321 oinstall

groupadd -g 54322 dba

groupadd -g 54323 oper

groupadd -g 54324 asmadmin

groupadd -g 54325 asmdba

groupadd -g 54326 asmoper

useradd -u 54321 -g oinstall -G dba,oper,asmdba oracle

useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper grid

usermod -a -G dba grid

mkdir -p /u01/app/grid

mkdir -p /u01/app/11.2.0/grid

chown -R grid:oinstall /u01

mkdir /u01/app/oracle

chown oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/5.4 修改grid及oracle 使用者環境變數

Oracle:

PATH=$PATH:$HOME/bin

export ORACLE_SID=netdata

export ORACLE_UNQNAME=netdata

export PS1="`/bin/hostname -s`-`whoami`-> "

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'

export PATH

grid:

PATH=$PATH:$HOME/bin

export ORACLE_SID=+ASM

export PS1="`/bin/hostname -s`-`whoami`-> "

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.2.0/grid

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'

export PATH

~5.5 關閉ntp服務及刪除ntp配置檔案

mv /etc/ntp.conf /etc/ntp.conf.bak

/etc/init.d/ntpd stop

chkconfig ntpd off5.6 安裝grid軟體

上傳grid 包到/tmp下

unzip p13390677_112040_Linux-x86-64_3of7.zip

cd grid

./Runinstall.sh

執行指令碼

/u01/app/oraInventory/orainstRoot.sh

/u01/app/11.2.0/grid/root.sh5.7 netca建立監聽5.8 執行相關指令碼

/u01/app/11.2.0/grid/crs/install/roothas.pl5.9 Asmca建立磁碟組

如果找到裝置修改disk_strings

/dev/asm-*

六 安裝oracle軟體及建庫

6.1安裝oracle軟體

上傳軟體至/tmp下

解壓

unzip p13390677_112040_Linux-x86-64_1of7.zip

unzip p13390677_112040_Linux-x86-64_2of7.zip

安裝軟體選擇僅安裝軟體

Cd database

./runinstall.sh

執行指令碼

/u01/app/oracle/product/11.2.0/db_1/root.sh6.2 DBCA建庫

設定SGA ,PGA,Process,歸檔路徑,Redofile路徑及大小,字符集,dbfile路徑等相關引數6.3 新增相關服務

新增監聽 srvctl管理

srvctl add listener

srvctl add asm -l LISTENER

啟動

crsctl start resource ora.LISTENER.lsnr

修改資料庫自啟

crsctl modify resource "ora.netdata.db" -attr "AUTO_START=1"

啟動所有服務

ASM1-137-7-grid-> crs_start -all

CRS-2501: Resource 'ora.ons' is disabled

Attempting to start `ora.evmd` on member `asm1-137-7`

Attempting to start `ora.LISTENER.lsnr` on member `asm1-137-7`

Attempting to start `ora.cssd` on member `asm1-137-7`

Attempting to start `ora.diskmon` on member `asm1-137-7`

Start of `ora.diskmon` on member `asm1-137-7` succeeded.

Start of `ora.evmd` on member `asm1-137-7` succeeded.

Start of `ora.LISTENER.lsnr` on member `asm1-137-7` succeeded.

Start of `ora.cssd` on member `asm1-137-7` succeeded.

Attempting to start `ora.asm` on member `asm1-137-7`

Start of `ora.asm` on member `asm1-137-7` succeeded.

Attempting to start `ora.DATA1.dg` on member `asm1-137-7`

Start of `ora.DATA1.dg` on member `asm1-137-7` succeeded.

Attempting to start `ora.netdata.db` on member `asm1-137-7`

Start of `ora.netdata.db` on member `asm1-137-7` succeeded.

CRS-2660: Resource 'ora.ons' or all of its instances are disabled

檢視狀態

ASM1-137-7-grid-> crs_stat -t

Name Type Target State Host

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

ora.DATA1.dg ora....up.type ONLINE ONLINE asm1-137-7

ora....ER.lsnr ora....er.type ONLINE ONLINE asm1-137-7

ora.asm ora.asm.type ONLINE ONLINE asm1-137-7

ora.cssd ora.cssd.type ONLINE ONLINE asm1-137-7

ora.diskmon ora....on.type OFFLINE OFFLINE

ora.evmd ora.evm.type ONLINE ONLINE asm1-137-7

ora.netdata.db ora....se.type ONLINE ONLINE asm1-137-7

ora.ons ora.ons.type OFFLINE OFFLINE

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

相關文章