11gracrhel6asm安装.docx
《11gracrhel6asm安装.docx》由会员分享,可在线阅读,更多相关《11gracrhel6asm安装.docx(30页珍藏版)》请在冰豆网上搜索。
![11gracrhel6asm安装.docx](https://file1.bdocx.com/fileroot1/2022-12/13/4c81c1d3-f209-498e-8354-f55a1989db8a/4c81c1d3-f209-498e-8354-f55a1989db8a1.gif)
11gracrhel6asm安装
11goracleracforrhel6
一、查看系统所需的补丁包
rpm-qcloog-pplcompat-libcap1compat-libstdc++-33cppgccgcc-c++glibc-develglibc-headerskernel-headerskshlibXmulibXtlibXvlibXxf86dgalibXxf86misclibXxf86vmlibaio-devellibdmxlibstdc++-develmpfrmakepplxorg-x11-utilsxorg-x11-xauth
二、IP规划
vi/etc/hosts
127.0.0.1localhost.localdomainlocalhost
#本地IP地址
192.168.56.103rac103
192.168.56.104rac104
#vip地址
192.168.56.105rac103-vip
192.168.56.106rac104-vip
#心跳地址
10.0.0.103rac-priv
10.0.0.104rac-priv
#scanip地址
192.168.56.107scan
三、创建组
groupadd-g501oinstall
groupadd-g502dba
groupadd-g503oper
groupadd-g504asmadmin
groupadd-g505asmoper
groupadd-g506asmdba
四、创建用户
useradd-goinstall-Gdba,asmdba,oper,asmoperoracle
useradd-goinstall-Gasmadmin,asmdba,asmoper,oper,dbagrid
五、设置用户密码
passwdgrid
passwdoracle
六、修改文件夹权限、属主
mkdir-p/oracle/app/grid
mkdir-p/oracle/app/11.2/grid
chown-Rgrid:
oinstall/oracle
mkdir-p/oracle/app/oracle/11.2/db_1
chown-Roracle:
oinstall/oracle/app/oracle
chmod-R755/oracle
七、查看操作系统版本
lsb_release-a
Version:
:
base-4.0-amd64:
base-4.0-noarch:
core-4.0-amd64:
core-4.0-noarch:
graphics-4.0-amd64:
graphics-4.0-noarch:
printing-4.0-amd64:
printing-4.0-noarch
DistributorID:
RedHatEnterpriseServer
Description:
RedHatEnterpriseLinuxServerrelease6.5(Santiago)
Release:
6.5
Codename:
Santiago
八、修改系统参数
1、在/etc/security/limits.d下创建99-grid-oracle-limits.conf
oraclesoftnproc2047
oraclehardnproc16384
oraclesoftnofile1024
oraclehardnofile65536
oraclesoftstack10240
oraclehardstack32768
gridsoftnproc2047
gridhardnproc16384
gridsoftnofile1024
gridhardnofile65536
gridsoftstack10240
gridhardstack32768
2、在/etc/profile.d下创建oracle-grid.sh脚本
#Settingtheappropriateulimitsfororacleandgriduser
if[$USER="oracle"];then
if[$SHELL="/bin/ksh"];then
ulimit-u16384
ulimit-n65536
else
ulimit-u16384-n65536
fi
fi
if[$USER="grid"];then
if[$SHELL="/bin/ksh"];then
ulimit-u16384
ulimit-n65536
else
ulimit-u16384-n65536
fi
fi
3、vi/etc/sysctl.conf
vm.swappiness=0
vm.dirty_background_ratio=3
vm.dirty_ratio=80
vm.dirty_expire_centisecs=500
vm.dirty_writeback_centisecs=100
#getconfPAGE_SIZE,当系统中所设置值大于计算出来值时,请不要修改
kernel.shmmax=“TOTALRAMINBYTES/PAGE_SIZE”(echo“r*1024^3/4096”|bc)
kernel.shmall=“HALFOFTOTALRAMINBYTES”(echo“r*1024^3/2”|bc)
##在110204版本中,如果设置为4K,在第二台机器执行root.sh时会报内存溢出
##kernel.shmmni=8192
kernel.shmmni=4096
kernel.sem=25032000100128
#fs.file-maxneedstobesettoatleast6815744fortheOracleRACInstallation.
fs.file-max=6815744
fs.aio-max-nr=1048576
net.ipv4.ip_local_port_range=900065500
net.core.rmem_max=4194304
net.core.wmem_max=1048576
net.core.rmem_default=262144
net.core.wmem_default=262144
#settotheappropriateprivateethdevices
net.ipv4.conf.em3.rp_filter=2
net.ipv4.conf.em4.rp_filter=2
使/etc/sysctl.conf更改立即生效
sysctl–p
4、gird时间同步所需要的设置(11gR2新增检查项,可以忽略不用)
#NetworkTimeProtocolSetting
/sbin/servicentpdstop
chkconfigntpdoff
rm/etc/ntp.conf
mv/etc/ntp.confto/etc/ntp.conf.org
servicentpdrestart
chkconfigntpdon
5、Grid用户环境变量:
su-grid
vi.bash_profile
umask022
exportORACLE_BASE=/oracle/app/grid#需手工创建
exportORACLE_HOME=/oracle/app/11.2/grid#需手工创建
exportORACLE_SID=+ASM1#节点2是+ASM2
exportNLS_DATE_FORMAT="yyyy-mm-ddhh24:
mi:
ss"
exportPATH=${PATH}:
$ORACLE_HOME/bin
exportPATH=${PATH}:
/usr/bin/X11
exportORACLE_PATH=${PATH}$ORACLE_HOME/rdbms/admin
exportORACLE_TERM=xterm
exportTNS_ADMIN=$ORACLE_HOME/network/admin
exportORA_NLS11=$ORACLE_HOME/nls/data
exportLD_LIBRARY_PATH=$ORACLE_HOME/lib
exportLD_LIBRARY_PATH=${LD_LIBRARY_PATH}:
/lib:
/usr/lib:
/usr/local/lib
exportCLASSPATH=$ORACLE_HOME/JRE
exportCLASSPATH=${CLASSPATH}:
$ORACLE_HOME/jlib
exportCLASSPATH=${CLASSPATH}:
$ORACLE_HOME/rdbms/jlib
exportCLASSPATH=${CLASSPATH}:
$ORACLE_HOME/network/jlib
exportTHREADS_FLAG=native
exportTEMP=/tmp
exportTMPDIR=/tmp
exportNLS_LANG=AMERICAN_AMERICA.UTF8
#exportPS1=`hostname`:
'$PWD'"$"
6、ORACLE用户环境变量:
su-oracle
vi.bash_profile
umask022
exportORACLE_BASE=/oracle/app/oracle
exportORACLE_HOME=$ORACLE_BASE/product/11.2/db_1
exportORACLE_OWNER=oracle
exportORACLE_SID=rac1#节点2为rac2
exportORACLE_UNQNAME=rac
exportPATH=$ORACLE_HOME/bin:
/usr/bin/X11:
${PATH}
exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:
$ORACLE_HOME/rdbms/lib:
/lib:
/usr/lib:
/usr/local/lib
exportCLASSPATH=$ORACLE_HOME/JRE:
$ORACLE_HOME/jlib:
$ORACLE_HOME/rdbms/jlib:
$ORACLE_HOME/network/jlib
exportORA_NLS11=$ORACLE_HOME/nls/data
exportTEMP=/tmp
exportTMPDIR=/tmp
exportNLS_LANG="American_america.zhs16gbk"数据库为英文时设置
#exportNLS_LANG="SIMPLIFIEDCHINESE_CHINA.ZHS16CGB231280"
#exportNLS_LANG="SIMPLIFIEDCHINESE_CHINA.ZHS16GBK"
exportNLS_DATE_FORMAT="yyyy-mm-ddhh24:
mi:
ss"
#exportPS1=`hostname`:
'$PWD'"$"
九、配置信任关系
oracle配置SSH,可以在安装时再oracle内配置
十、安装ASM
1、rhel6.4以后使用kmod-oracleasm,需要通过RHN帐号下载
kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64.rpm
2、
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.8-1.el5.x86_64.rpm
###############################################################################
1、安装软件包
[root@rac103~]#rpm-qa|greporacle
oracleasmlib-2.0.4-1.el6.x86_64
oracleasm-support-2.1.8-1.el5.x86_64
kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64
2、格式化硬盘(CRS要求1G)
[root@rac103~]#fdisk-l/dev/sdc
Disk/dev/sdc:
1073MB,1073741824bytes
255heads,63sectors/track,130cylinders
Units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):
512bytes/512bytes
I/Osize(minimum/optimal):
512bytes/512bytes
Diskidentifier:
0xc34cc1be
DeviceBootStartEndBlocksIdSystem
/dev/sdc111301044193+83Linux
[root@rac103~]#fdisk-l/dev/sdd
Disk/dev/sdd:
8589MB,8589934592bytes
255heads,63sectors/track,1044cylinders
Units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):
512bytes/512bytes
I/Osize(minimum/optimal):
512bytes/512bytes
Diskidentifier:
0x20c689ab
DeviceBootStartEndBlocksIdSystem
/dev/sdd1110448385898+83Linux
3、初始化asm(两边都要操作)
[root@rac103~]#/etc/init.d/oracleasmconfigure
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets('[]').Hittingwithouttypingan
answerwillkeepthatcurrentvalue.Ctrl-Cwillabort.
Defaultusertoownthedriverinterface[]:
grid
Defaultgrouptoownthedriverinterface[]:
asmadmin
StartOracleASMlibrarydriveronboot(y/n)[n]:
y
ScanforOracleASMdisksonboot(y/n)[y]:
y
WritingOracleASMlibrarydriverconfiguration:
done
InitializingtheOracleASMLibdriver:
[OK]
ScanningthesystemforOracleASMLibdisks:
[OK]
4、创建asm
[root@rac104~]#/etc/init.d/oracleasmcreatediskCRS1/dev/sdc1
Markingdisk"CRS1"asanASMdisk:
[OK]
[root@rac104~]#/etc/init.d/oracleasmcreatediskDATA1/dev/sdd1
Markingdisk"DATA1"asanASMdisk:
[OK]
[root@rac104~]#/etc/init.d/oracleasmlistdisks
CRS1
DATA1
在第二台机器直接执行以下命令
[root@rac103~]#/etc/init.d/oracleasmscandisks
ScanningthesystemforOracleASMLibdisks:
[OK]
[root@rac103~]#/etc/init.d/oracleasmlistdisks
CRS1
DATA1
十一、安装grid软件
1、/oracle/grid/runcluvfy.shstage-precrsinst-nrac103,rac104–verbose
对系统进行检查,由于未配置DNS,DNS会报错。
2、两节点安装rpm-ivh/oracle/grid/rpm/cvuqdisk-1.0.9-1.rpm软件包
scanname为:
scan
这里点击setup,配置grid用户ssh等效性
如果没有设置ntp,可以忽略。
出现这两个错误可以忽略不计,直接下一步退出。
集群的OracleGridInfrastructure的安装后任务:
(1)、验证oracleclusterware的安装
以grid身份运行以下命令:
crs_stat–t检查crs状态
十二、安装oracle软件
1、为数据创建asm磁盘组
使用grid用户,执行asmca
在DiskGroups选项卡中,单击Create按钮,在出现的画面中创建DATA卷
使用oracle用户,在数据库安装文件中执行./runInstaller
为oracle用户配置ssh等效性
十三、建立数据库
sid为:
rac。
选择所有节点
分别在两台oracle数据库中,执行:
altersystemsetLOCAL_LISTENER="(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=1521))"scope=bothsid='SID1';
altersystemsetLOCAL_LISTENER="(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=1521))"scope=bothsid='SID2';