Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The process of building Oracle11R2 RAC

2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the building process of Oracle11R2 RAC". In the daily operation, I believe many people have doubts about the building process of Oracle11R2 RAC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the building process of Oracle11R2 RAC"! Next, please follow the editor to study!

One: disable selinux

Vi / etc/sysconfig/selinux

SELINUX=enforcing # change this to SELINUX=disabled

Two: turn off the firewall

# / etc/rc.d/init.d/iptables stop

Flushing firewall rules: [OK]

Setting chains to policy ACCEPT: filter [OK]

Unloading iptables modules: [OK]

Then, turn off UDP ICMP reject (which should always be turned off) for the next server reboot:

# chkconfig iptables off

Restart the operating system

# init 6

Verification result

# / etc/rc.d/init.d/iptables status

Firewall is stopped.

# getenforce

Disabled

Cd / etc/sysconfig/network-script/

Vi ifcfg-eth0

IPADDR=192.168.56.120

NETMASK=255.255.255.0

GATEWAY=192.168.56.1

Vi ifcfg-eth2

IPADDR=192.168.0.110

NETMASK=255.255.255.0

GATEWAY=192.168.0.1

Three: edit HOSTS

# public ip

192.168.56.120 linux1

192.168.56.123 linux2

# virtual ip

192.168.56.121 linux1-vip

192.168.56.124 linux2-vip

# private ip

192.168.0.110 linux1-priv

192.168.0.111 linux2-priv

# scan ip

192.168.56.125 linux-scan

Four: Mount the yum source

Mount / dev/cdrom / media

[rhe16]

Name=rhe16

Baseurl= file:///media/Server

Enabled=1

Gpgcheck=0

Gpgkey- file:///media/RPM-GPG-KEY-redhat-release

Five: install the dependency package

Yum install compat-libstdc++-33 glibc glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh compat-libcap1 compat-libstdc++ elfutils-libelf-devel gcc-c++

Yum install binutils compat-db compat-libstdc++-296 control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make sysstat setarch glibc-devel libaio ksh glibc-headers libgnome libgcc libgnomeui libgomp openmotif libXp

Six: create users and groups

Groupadd-g 500 oinstall

Groupadd-g 501 dba

Groupadd-g 503 asmadmin

Groupadd-g 504 asmoper

Groupadd-g 505 asmdba

Useradd-u 500-g oinstall-G dba,asmdba oracle

Useradd-u 501-g oinstall-G asmadmin,asmdba,asmoper,dba grid

Seven: create a file path

(1) create an inventor path

Mkdir-p / u01/app/oraInventory

Chown-R grid:oinstall / u01/app/oraInventory

Chmod-R 775 / u01/app

(2) create GI home directory

Mkdir-p / u01/11.2.0/grid

Mkdir-p / u01/grid/11.2.0/crs_1

Chown-R grid:oinstall / u01Accord 11.2.0

Chmod-R 775 / u01 Universe 11.2.0

(3) create a database home directory

Mkdir-p / u01/app/oracle

Mkdir-p / u01/app/oracle/cfgtoollogs

Chown-R oracle:oinstall / u01/app/oracle

Chmod-R 775 / u01/app/oracle

(4) create the home directory of database software

Mkdir-p / u01/app/oracle/product/11.2.0/db_1

Chown-R oracle:oinstall / u01/app/oracle/product

Chmod-R 775 / u01/app/oracle/product

Eight: create user environment variables

Modify the. bash_profile file for gird and Oracle users

Oracle:

# Oracle DB 11g Environment

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

Export ORACLE_SID=orcl1

Export ORACLE_TERM=xterm

Export NLS_LANG=AMERICAN_AMERICA. AL32UTF8

Export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:$ORACLE_HOME/RDBMS/lib:/lib:/usr/lib

Export ORACLE_DOC=$ORACLE_HOME/doc

Export SQLPATH=$ORACLE_HOME/dbs

Export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH:/usr/vacpp/bin:/usr/ccs/bin

Export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

Export TMP=/tmp

Export TMPDIR=$TMP

Export NLS_DATE_FORMAT='yyyy-mm-dd hh34:mi:ss'

Export NLS_TIMESTAMP_FORMAT='yyyy-mm-dd hh34:mi:ss.ff'

Export NLS_TIMESTAMP_TZ_FORMAT='yyyy-mm-dd hh34:mi:ss.ff'

Export EDITOR=vi

Grid:

# Oracle DB 11g Environment

Export ORACLE_BASE=/u01/11.2.0/grid

Export ORACLE_HOME=/u01/grid/11.2.0/crs_1

Export ORACLE_SID=+ASM1

Export ORACLE_TERM=xterm

Export NLS_LANG=AMERICAN_AMERICA. AL32UTF8

Export ORA_NLS10=$ORACLE_HOME/nls/data

Export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:$ORACLE_HOME/RDBMS/lib:/lib:/usr/lib

Export ORACLE_DOC=$ORACLE_HOME/doc

Export SQLPATH=$ORACLE_HOME/dbs

Export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH:/usr/vacpp/bin:/usr/ccs/bin

Export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

Export TMP=/tmp

Export TMPDIR=$TMP

Export NLS_DATE_FORMAT='yyyy-mm-dd hh34:mi:ss'

Export NLS_TIMESTAMP_FORMAT='yyyy-mm-dd hh34:mi:ss.ff'

Export NLS_TIMESTAMP_TZ_FORMAT='yyyy-mm-dd hh34:mi:ss.ff'

Export EDITOR=vi

Nine: modify parameters

Modify kernel parameter / etc/sysctl.conf

Sed-I's max kernel.shmmax _ max _ etc/sysctl.conf

Sed-I'sUniverse kernel.shmallGrexample kernel.shmallGrexel / etc/sysctl.conf

Cat > > / etc/sysctl.conf > / etc/security/limits.conf

< oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 EOF 修改vi /etc/pam.d/login session required /lib/security/pam_limits.so (pam.d指的是验证登陆配置,login是登陆配置文件。) 配置/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 umask 022 fi 十:增加swap空间 1.检查swap大小和硬盘空间 free -m查看内存和swap | df -h查看硬盘空间 ,得有2.7G的空间才可以 2.添加交换文件 mkdir -p /opt/temp dd if=/dev/zero of=/opt/temp/swap bs=1024 count=2048000 --这个是2G 3.创建交换空间 mkswap /opt/temp/swap 4.启动新增加的2G交换空间 swapon /opt/temp/swap 5.修改/etc/fstab,使新加的2G交换空间在系统重新启动后自动生效 echo "/opt/temp/swap swap swap defaults 0 0" >

> / etc/fstab

XII: build trust mechanism (two node operations)

Create a .ssh folder under oracle and grid users

Generate key pair

Mkdir .ssh

Chmod 755 .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Full enter key

Cat .ssh / * .pub > > .ssh/authorized_keys

Ssh oracle@lzl cat ~ / .ssh/*.pub > > ~ / .ssh/authorized_keys

Ssh oracle@yq cat ~ / .ssh/*.pub > > ~ / .ssh/authorized_keys

Ssh grid@lzl cat ~ / .ssh/*.pub > > ~ / .ssh/authorized_keys

Ssh grid@yq cat ~ / .ssh/*.pub > > ~ / .ssh/authorized_keys

Exec ssh-agent $SHELL

Ssh-add

Verify that it is successful

Mutual ssh node1 date

Mutual ssh node2 date

Mutual ssh node1-priv date

Mutual ssh node2-priv date

Thirteen: UDEV shared storage

1.

# first confirm that it is a version of Linux 6.0 or above

[root@vrh7 dev] # cat / etc/issue

Oracle Linux Server release 6.2

Kernel\ r on an\ m

two。

# add records to / etc/scsi_id.config

Echo "options=--whitelisted-- replace-whitespace" > > / etc/scsi_id.config

3.

# confirm which block devices require udev binding

[root@vrh7 dev] # ls-l sd*

Brw-rw----. 1 root disk 8, 0 Jun 30 09:29 sda

Brw-rw----. 1 root disk 8, 1 Jun 30 09:29 sda1

Brw-rw----. 1 root disk 8, 2 Jun 30 09:29 sda2

Brw-rw----. 1 root disk 8, 16 Jun 30 09:29 sdb

Brw-rw----. 1 root disk 8, 32 Jun 30 09:29 sdc

Brw-rw----. 1 root disk 8, 48 Jun 30 09:29 sdd

Brw-rw----. 1 root disk 8, 64 Jun 30 09:29 sde

Brw-rw----. 1 root disk 8, 80 Jun 30 09:29 sdf

For example, in this example, block devices with sdb- > sdf need to be bound.

4. Put the number of b-> f in the for loop, for example:

# AUTO UDEV RULE BY Maclean Liu 2012-06-30

For i in b c d e

Do

Echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i` ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ ""

Done

The RULE bound to the sdb- > sdf device is generated, and the RULE is written to / etc/udev/rules.d/99-oracle-asmdevices.rules

You can also write RULE to 99-oracle-asmdevices.rules directly using the following script

# AUTO UDEV RULE BY Maclean Liu 2012-06-30

For i in f g h

Do

Echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i` ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "> > / etc/udev/rules.d/99-oracle-asmdevices.rules

Done

5. After that, run / sbin/start_udev with root

Fourteen: install the cvuqdisk package

Rpm-ivh cvuqdisk-1.0.7-1.rpm

Cat > / etc/ntp.conf

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report