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

How to install 2-node RAC

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces how to install the 2-node RAC, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.

1. Security related (2 nodes execute)

Close selinux

# vim / etc/sysconfig/selinux

# SELINUX=enabled

SELINUX=disabled

Save exit

: wq

No need to restart to take effect, root users

# setenforce 0

Stop the firewall

# service iptables stop

# service ip6tables stop

Do not start up.

# chkconfig iptables off

# chkconfig ip6tables off

Configure IP addr

# setup

Graphic configuration

Second, check the hardware requirements

1) memory requirements

# grep MemTotal / proc/meminfo

View memory

# grep SwapTotal / proc/meminfo

(# free)

View swap space, require "= memory"

2) system architecture

# uname-m

3) disk space

# df-h

/ tmp at least 1G

Third, check the software patch requirements and install (2 nodes installation)

# cd / media/RHEL_6.3_x86_64_Disc_1/packages/

Binutils-2.20.51.0.2-5.34.el6.x86_64

Compat-libcap1-1.10-1.x86_64

Compat-libstdc++-33-3.2.3-69.el6.i686

Compat-libstdc++-33-3.2.3-69.el6.x86_64

Gcc-4.4.6-4.el6.x86_64

Gcc-c++-4.4.6-4.el6.x86_64

Glibc-2.12-1.80.el6.i686

Glibc-2.12-1.80.el6.x86_64

Glibc-devel-2.12-1.80.el6.i686

Glibc-devel-2.12-1.80.el6.x86_64

Ksh-20100621-16.el6.x86_64

Libgcc-4.4.6-4.el6.i686

Libgcc-4.4.6-4.el6.x86_64

Libstdc++-4.4.4-13.el6.x86_64

Libstdc++-4.4.4-13.el6.i686

Libstdc++-devel-4.4.6-4.el6.x86_64

Libstdc++-devel-4.4.6-4.el6.i686

Libaio-0.3.107-10.el6.x86_64

Libaio-0.3.107-10.el6.i686

Libaio-devel-0.3.107-10.el6.x86_64

Libaio-devel-0.3.107-10.el6.i686

Make-3.81-20.el6.x86_64

Sysstat-9.0.4-20.el6.x86_64

Elfutils-0.152-1.el6.x86_64

Elfutils-devel-0.152-1.el6.i686

Elfutils-devel-0.152-1.el6.x86_64

UnixODBC-2.2.14-11.el6.i686

UnixODBC-2.2.14-11.el6.x86_64

UnixODBC-devel-2.2.14-11.el6.i686

UnixODBC-devel-2.2.14-11.el6.x86_64

Install the fix pack using linux's native file manager graphics or use the yum command to resolve the dependency package problem, but yum needs to be configured, as detailed in the word documentation

# yum-y install binutils compat-libcap1 ccompat-libstdc++ gcc glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat elfutils elfutils-devel unixODBC unixODBC-devel

Create groups, users and directories (2 nodes execute)

1) check whether it has been saved

# more / etc/oraInst.loc

# grep oinstall / etc/group

2) create a Base directory

Mkdir-p / u01/app/11.2.0/grid

Mkdir-p / u01/app/grid

Mkdir-p / u01/app/oracle

Mkdir-p / u01/soft/db

Mkdir-p / u01/soft/gi

Mkdir-p / u01/soft/psu

Mkdir-p / u01/soft/OPatch

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

Chown grid:oinstall / u01/app/11.2.0/grid

Chown grid:oinstall / u01/app/grid

Chown oracle:oinstall / u01/app/oracle

Chown oracle:oinstall / u01/app/oracle/product/11.2.0/dbhome_1

Chmod-R 775 / u01 /

Chown-R grid:oinstall / U01

Modify permissions and belonging groups after the last file in the installation package directory and decompressed

3) create operating system permission groups and users with separation of tasks and roles

# / usr/sbin/groupadd-g 1000 oinstall

# / usr/sbin/groupadd-g 1020 asmadmin

# / usr/sbin/groupadd-g 1021 asmdba

# / usr/sbin/groupadd-g 1022 asmoper

# / usr/sbin/groupadd-g 1031 dba

# / usr/sbin/groupadd-g 1032 oper

# / usr/sbin/useradd-u 1100-g oinstall-G asmadmin,asmdba,asmoper,dba grid

# / usr/sbin/useradd-u 1101-g oinstall-G asmdba,dba,oper oracle

4) set user password

# passwd grid

# passwd oracle

5) 2 nodes set oracle and grid user environment variables

1 node

# su-oracle

$vi .bash _ profile

Umask 022

Export TMP=/tmp

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=host1

Export ORACLE_SID=oradb1

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export ORACLE_UNQNAME=oradb

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH

Export LANG=en_US

Save exit

Effective $. . / .bash _ profile returns the root user

$exit

# su-gird

$vi .bash _ profile

Umask 022

Export TMP=/tmp

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=host1

Export ORACLE_SID=+ASM1

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/11.2.0/grid

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH

Export LANG=en_US

Effective $. . / .bash _ profile

2 nodes

# su-oracle

$vi .bash _ profile

Umask 022

Export TMP=/tmp

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=host2

Export ORACLE_SID=oradb2

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export ORACLE_UNQNAME=oradb

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH

Export LANG=en_US

Save exit

Effective $. . / .bash _ profile returns the root user

$exit

# su-gird

$vi .bash _ profile

Umask 022

Export TMP=/tmp

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=host2

Export ORACLE_SID=+ASM2

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/11.2.0/grid

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH

Export LANG=en_US

Save and exit

Effective $. . / .bash _ profile

5. Modify / etc/hosts file (2 nodes modify)

# vim / etc/hosts

Add address resolution

192.168.a.1 host1

192.168.b.1 host1-priv

192.168.a.2 host1-vip

192.168.a.3 host2

192.168.b.2 host2-priv

192.168.a.4 host2-vip

192.168.a.5 host-scan

6. Modify network and kernel parameters (2 nodes)

# vi / etc/sysctl.conf

Add the following line:

Kernel.sem = 250 32000 100 128

Kernel.shmmax = 4294967295 (actual memory size-1)

Fs.file-max = 6815744

Fs.aio-max-nr = 1048576

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048576

Net.ipv4.ip_local_port_range = 9000 65500

Kernel.shmmni = 4096

Save exit

: wq

Take effect

# / etc/rc.d/init.d/network restart

# / sbin/sysctl-p

Confirm the modification:

# / sbin/sysctl-a

7. Modify the resource limits of software installation users (2 nodes execute)

# vim / etc/security/limits.conf

Trailing join

# oracle soft nofile 1024

Oracle hard nofile 65536

Oracle soft nproc 2047

# oracle hard nproc 16384

# oracle soft stack 10240

Oracle hard stack 32768

# grid soft nofile 1024

Grid hard nofile 65536

Grid soft nproc 2047

# grid hard nproc 16384

# grid soft stack 10240

Grid hard stack 32768

Save exit

: wq

8. Configure NTP (2 nodes are modified)

1) stop the system ntp

# / sbin/service ntpd stop

# chkconfig ntpd off

# mv / etc/ntp.conf / etc/ntp.conf.org

# rm / var/run/ntpd.pid

2) check the Oracle cluster clock synchronization service (after installation is complete)

$crsctl check ctss

IX. Upload software

Upload p13390677_112040_Linux-x86-64_1of7 and p13390677_112040_Linux-x86-64_2of7 to / u01/soft/db

Upload p13390677_112040_Linux-x86-64_3of7 to / u01/soft/gi

Upload p18139609_112040_Linux-x86-64 to / u01/soft/psu

Upload p6880880_112000_Linux-x86-64 to 2 nodes under / u01/soft/OPatch

Root user decompression

Db software

# unzip / u01/soft/db/p13390677_112040_Linux-x86-64_1of7

# unzip / u01/soft/db/p13390677_112040_Linux-x86-64_2of7

Gi software

# unzip / u01/soft/gi/p13390677_112040_Linux-x86-64_3of7

Psu package

# unzip / u01/soft/psu/p18139609_112040_Linux-x86-64

OPatch needs to decompress and overwrite its own directory files after installing gi and db

# chown-R oracle:oinstall / u01/soft/db

# chmod-R 775 / u01/soft/db

# chown-R grid:oinstall / u01/soft/gi

# chmod-R 775 / u01/soft/gi

# chown-R grid:oinstall / u01/soft/psu/18139609

# chmod-R 775 / u01/soft/psu/18139609

Install the cvuqdisk package

1) transfer the rpm packet to another node

Scp / u01/soft/gi/grid/rpm/cvuqdisk-1.0.9-1.rpm host2:/tmp

2) check whether it already exists

# rpm-qi cvuqdisk

3) set user group environment variables

# export CVUQDISK_GRP=oinstall

4) 2 node installation

1 node:

# rpm-ivh / u01/soft/gi/grid/rpm/cvuqdisk-1.0.9-1.rpm

2 nodes:

# rpm-ivh / tmp/cvuqdisk-1.0.9-1.rpm

11. Configure ssh

The sshUserSetup.sh file is located under 1 node: / u01/soft/gi/grid/sshsetup/; transfer sshUserSetup.sh to 2 nodes / tmp

Under the catalog

# scp / u01/soft/gi/grid/sshsetup/sshUserSetup.sh host2:/tmp

Modify / etc/ssh/sshd_config file

LoginGraceTime 0

Run the following two commands to the two nodes in the corresponding directory of the sshUserSetup.sh file:

#. / sshUserSetup.sh-user grid-hosts "Host 1, Host 2"-exverify-noPromptPassphrase-advanced

#. / sshUserSetup.sh-user oracle-hosts "Host 1, Host 2"-exverify-noPromptPassphrase-advanced

XII. Disk configuration

12.1 udev bind disk (with ASM, this step is not required)

1) get the disk uuid that needs to be bound to ASM Disk, for example, / dev/mpathc and / dev/mpathd;2 nodes respectively execute and compare whether UUID is a shared disk

Scsi_id-whitelisted-replace-whitespace-device=/dev/mpathc

Scsi_id-whitelisted-replace-whitespace-device=/dev/mpathd

2) 2 nodes write udev rules files (XXXXXX can name the uuid,NAME part itself and the rest do not need to be changed)

Vi / etc/udev/rules.d/99-oracle-asmdevices.rules

Join

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "XXXXXXXXXX", NAME= "asm-disk1", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "XXXXXXXXXX", NAME= "asm-disk2", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

3) start 2 nodes respectively

# / sbin/start_udev

4) check whether the device is bound correctly

# ls-l / dev/asm*

Brw-rw---- 1 grid asmadmin 8, 32 Oct 26 21:24 / dev/asm-disk1

Brw-rw---- 1 grid asmadmin 8, 32 Oct 26 21:24 / dev/asm-disk2

Restart 2 devices and confirm that the disk is in a normal state after reboot.

12.2 ASM performs the following steps:

1. Create an ASM Disk Volumes

[root@ora] # oracleasm configure-I

Configuringthe Oracle ASM library driver.

Thiswill configure the on-boot properties of the Oracle ASM library

Driver. The following questions will determinewhether the driver is

Loadedon boot and what permissions it will have. The current values

Willbe shown in brackets ('[]'). Hitting without typing an

Answerwill keep that current value. Ctrl-Cwill abort.

Defaultuser to own the driver interface []: grid

Defaultgroup to own the driver interface []: asmadmin

StartOracle ASM library driver on boot (yzone) [n]: y

Scanfor Oracle ASM disks on boot (yzone) [y]: y

WritingOracle ASM library driver configuration: done

[root@ora ~] # oracleasm init

Creating/dev/oracleasm mount point: / dev/oracleasm

Loadingmodule "oracleasm": oracleasm

MountingASMlib driver filesystem: / dev/oracleasm

5.2 create ASM disk

[root@ora ~] # oracleasm createdisk CRSVOL1 / dev/sdb1

Writingdisk header: done

Instantiatingdisk: done

[root@ora ~] # oracleasm createdisk DATAVOL1 / dev/sdc1

Writingdisk header: done

Instantiatingdisk: done

[root@ora ~] # oracleasm createdisk DATAVOL2 / dev/sdd1

Writingdisk header: done

Instantiatingdisk: done

[root@ora ~] # oracleasm createdisk FRAVOL1 / dev/sde1

Writingdisk header: done

Instantiatingdisk: done

[root@ora ~] # oracleasm listdisks

CRSVOL1

DATAVOL1

DATAVOL2

FRAVOL1

Dbc uses oracleasm-discover to find ASM disks, so run oracleasm-discover first to see if you can find the four disks you just created

[root@ora ~] # oracleasm-discover

UsingASMLib from / opt/oracle/extapi/64/asm/orcl/1/libasm.so

[ASMLibrary-Generic Linux, version 2.0.4 (KABI_V2)]

Discovereddisk: ORCL:CRSVOL1 [2096753 blocks (1073537536 bytes), maxio 512]

Discovereddisk: ORCL:DATAVOL1 [41940960 blocks (2147 3771520 bytes), maxio 512]

Discovereddisk: ORCL:DATAVOL2 [41940960 blocks (2147 3771520 bytes), maxio 512]

Discovereddisk: ORCL:FRAVOL1 [62912480 blocks (32211189760 bytes), maxio 512]

13. Grid users install gi

# xhost +

# su-grid

$cd / u01/soft/gi/grid

$ll

Confirm that the permission belongs to the group correctly 775 grid:oinstall

$. / runInstaller

Install Grid Infrastructure with grid users. The installation version is 11.2.0.1 x86 installation 64-bit version. The installation process is not described in detail, but there are a few steps to pay attention to during the installation process:

Select the second 'Configure Oracle Grid Infrastructurefor a Standalone Server' in' Step 2 of 9'

Select only one ASM disk CRSVOL1 when 'Step 4 of 11'

A warning dialog box will pop up at 'Step 7 of 11'. You can ignore it and click 'Yes''.

The pdksh-XXX package cannot be found in 'Step 9 of 12'. The package has been removed from RHEL6, as long as there is a ksh-XXX package in the system. Click the "Next' button" after selecting 'IgnoreAll'.

[root@ora ~] # rpm-qa | grep ksh

Ksh-20100621-16.el6.x86_64

Finally, follow the on-screen prompts to execute two scripts with the root user, and then wait for oracle to automatically complete the final configuration, and the Grid Infrastructure installation is complete.

After installation, you can check whether the ASM instance is started.

[root@ora~] # ps-ef | grep asm

Grid 23212 1 0 17:24? 00:00:00 asm_pmon_+ASM

Grid 23214 1 0 17:24? 00:00:00 asm_psp0_+ASM

Grid 23246 1 0 17:24? 00:00:01 asm_vktm_+ASM

Grid 23250 1 0 17:24? 00:00:00 asm_gen0_+ASM

Grid 23252 1 0 17:24? 00:00:00 asm_diag_+ASM

Grid 23254 1 0 17:24? 00:00:00 asm_dia0_+ASM

Grid 23256 1 0 17:24? 00:00:00 asm_mman_+ASM

Grid 23258 1 0 17:24? 00:00:00 asm_dbw0_+ASM

Grid 23260 1 0 17:24? 00:00:00 asm_lgwr_+ASM

Grid 23262 1 0 17:24? 00:00:00 asm_ckpt_+ASM

Grid 23264 1 0 17:24? 00:00:00 asm_smon_+ASM

Grid 23266 1 0 17:24? 00:00:00 asm_rbal_+ASM

Grid 23269 1 0 17:24? 00:00:00 asm_gmon_+ASM

Grid 23271 1 0 17:24? 00:00:00 asm_mmon_+ASM

Grid 23273 1 0 17:24? 00:00:00 asm_mmnl_+ASM

Root 25068 3291 0 17:26 pts/2 00:00:00 grep asm

7. Create ASMdisk groups

Create ASM disk groups using the graphical interface of grid users, or you can create them with CREATE DISKGROUP statements in SQL*PLUS.

[grid@ora grid] $asmca

By default, you will see the CRS disk groups that have been created by the installation Grid Infrastructure as shown in figure ASM-1. Click the 'Create' button to add new disk groups DATA and FRA.

The DATA disk group contains DATAVOL1 and DATAVOL2 to hold the database files, and the FRA disk group contains FRAVOL1 to serve as a fast recovery area. The DATA disk group does not have any redundancy set here.

The results to be displayed when the settings are complete.

Oracleasm scandisks---- found the asm list of the current database

Http://blog.csdn.net/seertan/article/details/8487714

Http://blog.csdn.net/rgb_rgb/article/details/8445321

14. Oracle users install db

# xhost +

# su-oracle

$cd / u01/soft/db/database

$ll

Confirm that the permission belongs to the correct group

$. / runInstaller

Graphical installation

Fifteenth, psu patch installation

1) the update comes with OPatch (both nodes need to be executed)

Rename the original OPatch and extract the latest OPatch to the appropriate directory

# unzip p6880880_112000_Linux-x86-64.zip-d / u01/app/11.2.0/grid/

# unzip p6880880_112000_Linux-x86-64.zip-d / u01/app/oracle/product/11.2.0/dbhome_1

# chown-R grid:oinstall / u01/app/11.2.0/grid/OPatch

# chmod-R 775 / u01/app/11.2.0/grid/OPatch

# chown-R oracle:oinstall / u01/app/oracle/product/11.2.0/dbhome_1/OPatch

# chmod-R 775 / u01/app/oracle/product/11.2.0/dbhome_1/OPatch

2) create an ocm response file (both nodes need to be executed)

Grid user execution

# su-grid

$/ u01/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp-no_banner-output / tmp/ocmfile.rsp

3) decompress the psu patch

# unzip / u01/spft/psu/p18139609_112040_Linux-x86-64

# chown-R grid:oinstall 18139609

# chmod-R 775 18139609

4) the two nodes execute the following command on each node as the root user to install the patch for gi

# / u01/app/11.2.0/grid/OPatch/opatch auto / u01/soft/psu/18139609-ocmrf / tmp/ocmfile.rsp

5) modify / u01/soft/psu/18139609/18031668 group permissions

# chown-R oracle:oinstall / u01/soft/psu/18139609/18031668

# chmod-R 775 / u01/soft/psu/18139609/18031668

6) the master node installs patches for db

# su-oracle

$/ u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch napply-oh / u01/app/oracle/product/11.2.0/dbhome_1/ 20140612/PSU/18139609/18031668

7) verify the patch installation version

2 nodes execute separately

Grid user

$/ u01/app/11.2.0/grid/OPatch/opatch lsinventory

Oracle user

$/ u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory

A series of patch numbers will be displayed

The system restarts. Oracle cluster automatically restarts with the system. After completion, go to the gird user to confirm that the crs status is normal.

# su-grid

$crs_stat-t

XVI. Build a database

1) ASMCA creates a data disk

Grid user

# su-grid

$asmca

Select unused disk as ASM disk

2) build a database

Oracle user

# su-oracle

$dbca

Graphical interface configuration

XVII. Parameter modification

# su-oracle

$sqlplus / as sysdba

Sql > alter profile DEFAULT limit failed_login_attempts unlimited password_life_time unlimited; (password expiration is disabled, and expires within 180 days by default)

Sql > alter system set audit_trail=none scope=spfile; (turn off auditing)

Sql > alter system set deferred_segement_creation=false

Sql > alter system set sec_case_sensitive_logon=false; (turn off case sensitivity)

Restart 2 instances to take effect

Sql > shutdown immediate

Sql > startup

18. Confirm that the database is normal

Thank you for reading this article carefully. I hope the article "how to install 2-node RAC" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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