现在的位置: 首页 > 数据库 > 正文

oracle11g rac for linux 7.3 安装笔记

2019年09月29日 数据库 ⁄ 共 5848字 ⁄ 字号 暂无评论

mkdir -p /u01/app/
chown -R grid:oinstall /u01/app/
chmod -R 775 /u01/app/
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
chmod -R 775 /u01/app/grid

grid环境变量:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/11.2.0/grid
export ORACLE_SID=+ASM1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

oracle环境变量:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_UNQNAME=orcl
export ORACLE_SID=orcl1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
#export NLS_LANG=american_america.al32utf8

配置redhat 7.3的udev:
#查看设备的uuid:
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowera
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerb
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerc
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerd
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowere
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerf
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerg
/usr/lib/udev/scsi_id -g -u -d /dev/emcpowerh
/usr/lib/udev/scsi_id -g -u -d /dev/emcpoweri

redaht 7 没start_udev:
vi /usr/lib/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee0440007dd4359bc49e2c8", RUN+="/bin/sh -c 'mknod /dev/asmdata0 b $major $minor; chown grid:asmadmin /dev/asmdata0 ; chmod 0660 /dev/asmdata0 '"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee0440008dd4359a0ee68e1", RUN+="/bin/sh -c 'mknod /dev/asmdata1 b $major $minor; chown grid:asmadmin /dev/asmdata1; chmod 0660 /dev/asmdata1'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee0440008dd4359ffa9ffac", RUN+="/bin/sh -c 'mknod /dev/asmdata2 b $major $minor; chown grid:asmadmin /dev/asmdata2; chmod 0660 /dev/asmdata2'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee0440009dd4359d3d67973", RUN+="/bin/sh -c 'mknod /dev/asmdata3 b $major $minor; chown grid:asmadmin /dev/asmdata3; chmod 0660 /dev/asmdata3'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400b0dd4359c93f97ef", RUN+="/bin/sh -c 'mknod /dev/asmfra0 b $major $minor; chown grid:asmadmin /dev/asmfra0; chmod 0660 /dev/asmfra0'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400b1dd43598a5416cc", RUN+="/bin/sh -c 'mknod /dev/asmfra1 b $major $minor; chown grid:asmadmin /dev/asmfra1; chmod 0660 /dev/asmfra1'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400e7dc43598ab015c6", RUN+="/bin/sh -c 'mknod /dev/asmocrvot0 b $major $minor; chown grid:asmadmin /dev/asmocrvot0; chmod 0660 /dev/asmocrvot0'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400e7dc435950e00918", RUN+="/bin/sh -c 'mknod /dev/asmocrvot1 b $major $minor; chown grid:asmadmin /dev/asmocrvot1; chmod 0660 /dev/asmocrvot1'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400e8dc4359fe67faca", RUN+="/bin/sh -c 'mknod /dev/asmocrvot2 b $major $minor; chown grid:asmadmin /dev/asmocrvot2; chmod 0660 /dev/asmocrvot2'"

KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400bcb5485970b5b391", RUN+="/bin/sh -c 'mknod /dev/asmfra0 b $major $minor; chown grid:asmadmin /dev/asmfra0; chmod 0660 /dev/asmfra0'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400bbb548593df7fe5e", RUN+="/bin/sh -c 'mknod /dev/asmfra1 b $major $minor; chown grid:asmadmin /dev/asmfra1; chmod 0660 /dev/asmfra1'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400bbb54859895617ee", RUN+="/bin/sh -c 'mknod /dev/asmfra2 b $major $minor; chown grid:asmadmin /dev/asmfra2; chmod 0660 /dev/asmfra2'"
KERNEL=="emcpower*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="3600601604ee04400bcb54859bb16af96", RUN+="/bin/sh -c 'mknod /dev/asmfra3 b $major $minor; chown grid:asmadmin /dev/asmfra3; chmod 0660 /dev/asmfra3'"

扫描udev:
for i in a b c d e f g h i
do
/sbin/partprobe /dev/emcpower$i
done

for i in a b c d e f g h i
do
/sbin/udevadm test /block/emcpower$i
done

for i in j k l m
do
/sbin/partprobe /dev/emcpower$i
done

for i in j k l m
do
/sbin/udevadm test /block/emcpower$i
done

认盘:
cd /dev
ls -l | grep asm

在redhat 7中:
/u01/11.2.0/grid/root.sh 后会报错:
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2017-06-20 12:18:53.388:
[client(61989)]CRS-2101:The OLR was formatted using version 3.
这里中断,执行以下命令(记住先执行root.sh报错中断后在执行以下命令):
1、
#touch /usr/lib/systemd/system/ohas.service
#chmod 777 /usr/lib/systemd/system/ohas.service
2、添加如下内容:
#cat /usr/lib/systemd/system/ohas.service
[Unit]
Description=Oracle High Availability Services
After=syslog.target

[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always

[Install]
WantedBy=multi-user.target
3、用户运行下面的命令

systemctl daemon-reload
systemctl enable ohas.service
systemctl start ohas.service

4、查看运行状态:

systemctl status ohas.service

Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2017-06-20 12:27:55 CST; 48s ago
Main PID: 64881 (init.ohasd)
CGroup: /system.slice/ohas.service
└─64881 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple

6月 20 12:27:55 rac1.localdomain systemd[1]: Started Oracle High Availability Services.
6月 20 12:27:55 rac1.localdomain systemd[1]: Starting Oracle High Availability Services...

给我留言

留言无头像?