ASM单实例(Oracle 11.2.0.4)环境(二)

五.安装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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24486203/viewspace-2142209/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值