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

Oracle 11g RAC with ASM installed on RHEL5 (simplified version)

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Define the task

Prepare a RHEL5 PC to act as a SAN device and a san (as both a DNS and a timing system)

Prepare two RHEL5 PCs to act as RAC nodes, R1 and R2

Install RAC on ASM disk, including OCR, VOTING, library

2. Modify kernel parameters and shell restrictions of R1 and R2

On R1 and R2, respectively.

Vim / etc/sysctl.conf

-

Kernel.shmmax = 4294967296

Kernel.shmmni = 4096

Kernel.shmall = 2097152

Kernel.sem = 250 32000 100 128

Fs.file-max = 6815744

Fs.aio-max-nr = 1048576

Net.ipv4.ip_local_port_range = 9000 65500

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048586

Sysctl-p

Vim / etc/security/limits.conf

-

# Oracle configure shell parameters

Oracle soft nofile 65536

Oracle hard nofile 65536

Oracle soft nproc 16384

Oracle hard nproc 16384

Grid soft nofile 65536

Grid hard nofile 65536

Grid soft nproc 16384

Grid hard nproc 16384

3. Configure the network of san, R1, R2

Configure on san, R1, R2, respectively

Vim/etc/hosts

127.0.0.1san localhost.localdomain localhost

:: 1localhost6.localdomain6 localhost6

192.168.33.100san

192.168.33.101 r1

192.168.33.102 r2

192.168.33.201 r1-vip# should not be configured on the network card

192.168.33.202 r2-vip# should not be configured on the network card

10.0.0.1 r1-priv

10.0.0.2 r2-priv

4. Configure DNS on san

Yum install bind bind-chroot caching-nameserver

Cd / var/named/chroot/etc

Cp-p named.caching-nameserver.conf named.conf

Vim / var/named/chroot/etc/named.conf

Options {

Listen-on port 53 {any;}

Listen-on-v6 port 53 {:: 1;}

Directory "/ var/named"

Dump-file "/ var/named/data/cache_dump.db"

Statistics-file "/ var/named/data/named_stats.txt"

Memstatistics-file "/ var/named/data/named_mem_stats.txt"

Allow-query {any;}

Allow-query-cache {any;}

}

Logging {

Channel default_debug {

File "data/named.run"

Severity dynamic

}

}

View localhost_resolver {

Match-clients {any;}

Match-destinations {any;}

Recursion yes

Include "/ etc/named.zones"

}

Cp-p named.rfc1912.zones named.zones

Vim / var/named/chroot/etc/named.zones

/ / named.rfc1912.zones:

/ /

/ / Provided by Red Hat caching-nameserver package

/ /

/ / ISC BIND named zone configuration for zones recommended by

/ / RFC 1912 section 4.1: localhost TLDs and address zones

/ /

/ / See / usr/share/doc/bind*/sample/ for example named configuration files.

/ /

Zone "." IN {

Type hint

File "named.ca"

}

Zone "localdomain" IN {

Type master

File "localdomain.zone"

Allow-update {none;}

}

Zone "localhost" IN {

Type master

File "localhost.zone"

Allow-update {none;}

}

Zone "0.0.127.in-addr.arpa" IN {

Type master

File "named.local"

Allow-update {none;}

}

Zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {

Type master

File "named.ip6.local"

Allow-update {none;}

}

Zone "255.in-addr.arpa" IN {

Type master

File "named.broadcast"

Allow-update {none;}

}

Zone "0.in-addr.arpa" IN {

Type master

File "named.zero"

Allow-update {none;}

}

Zone "ora11grac.com" IN {

Type master

File "ora11grac.com.zone"

Allow-update {none;}

}

Zone "33.168.192.in-addr.arpa" IN {

Type master

File "33.168.192.local"

Allow-update {none;}

}

Cd / var/named/chroot/var/named

Cp-p named.zero ora11grac.com.zone

Cp-p named.local 33.168.192.local

Vim / var/named/chroot/var/named/ora11grac.com.zone

$TTL 86400

@ IN SOA dns.ora11grac.com. Root.ora11grac.com. (

42; serial (d. Adams)

3H; refresh

15m; retry

1W; expiry

1D); minimum

@ IN NS dns.ora11grac.com.

R1 IN A 192.168.33.101

R2 IN A 192.168.33.102

R1-vip IN A 192.168.33.201

R2-vip IN A 192.168.33.202

Scan IN A 192.168.33.195

Scan IN A 192.168.33.196

Scan IN A 192.168.33.197

Vim / var/named/chroot/var/named/33.168.192.local

$TTL 86400

@ IN SOA dns.ora11grac.com. Root.ora11grac.com. (

1997022700; Serial

28800; Refresh

14400; Retry

3600000; Expire

86400); Minimum

@ IN NS dns.ora11grac.com.

101 IN PTR r1.ora11grac.com.

102 IN PTR r2.ora11grac.com.

201 IN PTR r1-vip.ora11grac.com.

202 IN PTR r2-vip.ora11grac.com.

195 IN PTR scan.ora11grac.com.

196 IN PTR scan.ora11grac.com.

197 IN PTR scan.ora11grac.com.

Service named restart

Chkconfig named on

Test on the client side after completion

Vim / etc/resolve.conf

Search ora11grac.com

Nameserver 192.168.33.100

And then ping scan.ora11grac.com, or nslookup scan.ora11grac.com

5. Add users and groups in R1 and R2

In R1 and R2 respectively

Groupadd-g 501 oinstall

Groupadd-g 502 dba

Groupadd-g 503 oper

Groupadd-g 504 asmadmin

Groupadd-g 505 asmdba

Groupadd-g 506 asmoper

Useradd-u 501-g oinstall-G dba,oper,asmdba oracle

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

Modify configuration files on R1 and R2

Vim / home/grid/.bashrc

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/11.2.0/grid

Export PATH=$ORACLE_HOME/bin:$PATH

Export ORACLE_OWNER=oracle

Export ORACLE_SID=+ASM1 # R2 node is export ORACLE_SID=+ASM2

Export ORACLE_TERM=vt100

Export THREADS_FLAG=native

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

Export PATH=$ORACLE_HOME/bin:$PATH

Export LANG=en_US

Alias sqlplus='rlwrap sqlplus'

Alias lsnrctl='rlwrap lsnrctl'

Alias asmcmd='rlwrap asmcmd'

Vim / home/oracle/.bashrc

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

Export PATH=$ORACLE_HOME/bin:$PATH

Export ORACLE_OWNER=oracle

Export ORACLE_SID=orcl1 # rac2 node is export ORACLE_SID=orcl2

Export ORACLE_TERM=vt100

Export THREADS_FLAG=native

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

Export PATH=$ORACLE_HOME/bin:$PATH

Export EDITOR=vi

Export SQLPATH=/home/oracle

Export LANG=en_US

Alias sqlplus='rlwrap sqlplus'

Alias lsnrctl='rlwrap lsnrctl'

Alias rman='rlwrap rman'

Alias dgmgrl='rlwrap dgmgrl'

6. Create directories in R1 and R2

In R1 and R2 respectively

Mkdir-p / u01/app/11.2.0/grid

Chown-R grid:oinstall / U01

Mkdir / u01/app/oracle

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

Chmod-R 775 / u01 /

7. Configure mutual trust between two computers under grid and oracle users (single step is required)

On R1

Su-grid

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cd .ssh

Cat * .pub > authorized_keys

On R2

Su-grid

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cd .ssh

Cat * .pub > authorized_keys

On R1

Scp authorized_keys grid@r2:/home/grid/.ssh/k1

On R2

Cat / home/grid/.ssh/k1 > > authorized_keys

Scp authorized_keys grid@r1:/home/grid/.ssh/

On R1

Su-oracle

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cd .ssh

Cat * .pub > authorized_keys

On R2

Su-oracle

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cd .ssh

Cat * .pub > authorized_keys

On R1

Scp authorized_keys oracle@r2:/home/oracle/.ssh/k1

On R2

Cat / home/oracle/.ssh/k1 > > authorized_keys

Scp authorized_keys oracle@r1:/home/oracle/.ssh/

Test dual-computer trust on R1 and R2 respectively

Ssh r1 date

Ssh r2 date

Ssh r1-priv date

Ssh r2-priv date

8. Configure the NTP server on san (you can do it on other machines if you don't do it on san)

On san

Vim / etc/sysconfig/ntpd

# Drop root to id 'ntp:ntp' by default.

OPTIONS= "- x-u ntp:ntp-p / var/run/ntpd.pid"

# Set to 'yes' to sync hw clock after successful ntpdate

SYNC_HWCLOCK=no

# Additional options for ntpdate

Vim / etc/ntp.conf

Restrict default nomodify

Restrict 127.0.0.1

Server 127.127.1.0

Fudge 127.127.1.0 stratum 8

Driftfile / var/lib/ntp/drift

Broadcastdelay 0.008

Start the ntpd service

Service ntpd restart

Chkconfig ntpd on

On the client R1, R2

Ntpdate san

Then use crontab-e

* / 5 * / usr/sbin/ntpdate san

It is recommended that you copy the configuration file to R1 and R2, and then start ntpd on R1 and R2, because grid will be verified when it is installed

9. Configure centralized storage san

On san

Yum install scsi-target-utils-y

Vim / etc/tgt/targets.conf

Backing-store / dev/sdb1

Backing-store / dev/sdc1

Backing-store / dev/sdd1

Backing-store / dev/sde1

Backing-store / dev/sdf1

Backing-store / dev/sdf2

Backing-store / dev/sdf3

Service tgtd start

Tgtadm-lld iscsi-m target-op show

Chkconfig tgtd on

On R1 and R2

Yum install iscsi-initiator-utils-y

Service iscsid start

Iscsiadm-m discovery-t st-p san

Service iscsi start

Chkconfig iscsid on

Chkconfig iscsi on

10. Configure udev to bind bare devices on R1 and R2

On R1 and R2

Ll / dev/sd*

Brw-r- 1 root disk 8,0 Jan4 19:31 / dev/sda

Brw-r- 1 root disk 8,1 Jan4 11:31 / dev/sda1

Brw-r- 1 root disk 8,2 Jan4 19:31 / dev/sda2

Brw-r- 1 root disk 8, 16 Jan4 13:31 / dev/sdb

Brw-r- 1 root disk 8, 17 Jan4 16:30 / dev/sdb1

Brw-r- 1 root disk 8, 32 Jan4 13:31 / dev/sdc

Brw-r- 1 root disk 8, 33 Jan4 16:30 / dev/sdc1

Brw-r- 1 root disk 8, 48 Jan4 13:32 / dev/sdd

Brw-r- 1 root disk 8, 49 Jan4 16:30 / dev/sdd1

Brw-r- 1 root disk 8, 64 Jan4 13:32 / dev/sde

Brw-r- 1 root disk 8, 65 Jan4 16:30 / dev/sde1

Brw-r- 1 root disk 8, 80 Jan4 13:32 / dev/sdf

Brw-r- 1 root disk 8, 81 Jan4 16:29 / dev/sdf1

Brw-r- 1 root disk 8, 96 Jan4 13:33 / dev/sdg

Brw-r- 1 root disk 8, 97 Jan4 16:29 / dev/sdg1

Brw-r- 1 root disk 8, 98 Jan4 16:29 / dev/sdg2

Vim / etc/udev/rules.d/60-raw.rules

ACTION== "add", KERNEL== "sdf1", RUN+= "/ bin/raw / dev/raw/raw1 N"

ACTION== "add", KERNEL== "sdg1", RUN+= "/ bin/raw / dev/raw/raw2 N"

ACTION== "add", KERNEL== "sdg2", RUN+= "/ bin/raw / dev/raw/raw3 N"

KERNEL== "raw1", OWNER= "grid", GROUP= "asmadmin", MODE= "660"

KERNEL== "raw2", OWNER= "grid", GROUP= "asmadmin", MODE= "660"

KERNEL== "raw3", OWNER= "grid", GROUP= "asmadmin", MODE= "660"

11. Install dependency packages

Yum install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel-y

12. Install ASM's RPM package (be sure to pay attention to the version and platform)

Rpm-ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm oracleasm-support-2.1.7-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm

13. Configure ASM

On R1

/ etc/init.d/oracleasm configure

User specified: grid

Group assignment: asmadmin

The rest are yes.

Create an oracleasm disk

/ etc/init.d/oracleasm createdisk V1 / dev/sdb1

/ etc/init.d/oracleasm createdisk V2 / dev/sdc1

/ etc/init.d/oracleasm createdisk V3 / dev/sdd1

/ etc/init.d/oracleasm createdisk V4 / dev/sde1

Scan on R2

/ etc/init.d/oracleasm scandisks

14. Use grid users to install grid check

. / runcluvfy.sh stage-pre crsinst-n R1 department R2-fixup-verbose

15. Install grid

Under grid users

. / runInstaller

Select in Instalaation Type

Install and Configure Grid Infrustructure for a Cluster

Select in Product Languages

Advanced Installation

Fill in in Grid Plug and Play Information

Cluster Name: r-cluster

SCAN Name: scan.ora11grac.com

SCAN Port: 1521

Configure GNS does not check

Fill in in Cluster Node Information

R1.ora11grac.comr1-vip.ora11grac.com

R2.ora11grac.comr2-vip.ora11grac.com

Do not use ifconfig to add this vip

Fill in the corresponding Specify Network Interface Usage.

Eth0192.168.33.0Public

Eth210.0.0.0Private

Select in Storage Option Information

Automatic Storage Management (ASM)

In Create ASM Disk Group

Select the raw1, raw2 and raw3 just recognized to form Disk Group Name as grid

In Specify ASM Password

Fill in the user password

Select in Failure Isolation Support

Do not use Intelligent Platform Management (IPMI)

In Privileged Operating System Groups, fill in:

ASM Database Administrator (OSDBA) Group: asmdba

ASM Instance Administration Operator (OSOPER) Group: asmoper

ASM Instance Administrator (OSASM) Group:asmadmin

Fill in the Specify Installation Location:

Oracle Base: / u01/app/oracle

Software Location: / u01/app/oracle/product/11.2.0/grid

Fill in the Create Inventory:

Inventory Directory: / u01/app/oraInventory

OraInventory Group Name: oinstall

After installation is complete

Run on R1

/ u01/app/oraInventory/orainstRoot.sh

Run on R2

/ u01/app/oraInventory/orainstRoot.sh

Run on R1

/ u01/app/11.2.0/grid/root.sh

Run on R2

/ u01/app/11.2.0/grid/root.sh

16. Install the database

First, make sure that all important services are ONLINE.

Crs_stat-t

Usually oc4j will not be online, so

Srvctl enable oc4j

Srvctl start oc4j

Olsnodes-n

Occurrence of R1 and R2

So it's OK.

(the absence of gsd services online does not affect the installation of library software and the establishment of libraries)

With the grid user, open asmca and create an ASM disk group + ASM

At R1 switch to

Su-oracle

. / runInstaller

In Select Installation Option

Select Install database software only to install only the database engine software

In Node Selection

Check the two nodes of R1 and R2.

Select in Select Database Edition

Enterprise Edition

Fill in in Specify Installation Location

Oracle Base: / u01/app/Oracle

Software Location: / u01/app/oracle/product/11.2.0/dbhome_1

Run after execution, run on R1 and R2

/ u01/app/oracle/product/11.2.0/db_1/root.sh

Done.

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