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

Step by step to build the oracle 11gR2 rac+dg environment preparation (2)

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

Share

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

Step by step to build an oracle 11gR2 rac + dg environment on RHEL6.5+VMware Workstation 10 (2)

The directory structure of this article:

Linux environment preparation

I will not introduce the environment for installing linux. If you can't, go to Baidu for children's shoes. If not, download the system I have installed directly, download it and use it (http://yunpan.cn/cgkEsf8wpHC2G (extraction code: 90f5)). Make 3 copies and name them rac1, rac2 and dg, as shown in the figure:

The previous environment is ready to shut down the firewall.

Execute the following statements on the rac1 and rac2 nodes, respectively:

[root@rac01 ~] # service iptables stop

[root@rac01 ~] # chkconfig iptables off

[root@rac01] # chkconfig iptables-- list

Iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Chkconfig iptables off-permanent

Service iptables stop-temporary

/ etc/init.d/iptables status-you will get a series of messages indicating that the firewall is on.

/ etc/rc.d/init.d/iptables stop-turn off the firewall

Modify hostname

# vi / etc/sysconfig/network

HOSTNAME=rac1

# hostname rac1

Same execution on Rac 2

Modify hosts file-Network configuration (Nic configuration)

Hosts file:

[grid@rac1 ~] $more / etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

# Public IP

192.168.59.135 rac1

192.168.59.136 rac2

# Private IP

192.168.116.133 rac1-priv

192.168.116.134 rac2-priv

# Virtual IP

192.168.59.137 rac1-vip

192.168.59.138 rac2-vip

# Scan IP

192.168.59.139 rac-scan

Configure kernel parameter modification / etc/sysctl.conf file

[root@rac01 ~] # vi / etc/sysctl.conf

# for oracle 11g

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

Kernel.shmall = 2147483648

Kernel.shmmax = 68719476736

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100 128

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

Make the modified parameters take effect immediately:

[root@rac01] # / sbin/sysctl-p

Modify the limits file

[root@rac01 ~] # vi / etc/security/limits.conf

Grid soft nproc 2047

Grid hard nproc 16384

Grid soft nofile 1024

Grid hard nofile 65536

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Modify / etc/pam.d/login file

[root@rac01 ~] # vi / etc/pam.d/login

Session required pam_limits.so

Modify / etc/profile file

[root@rac01 ~] # vi / 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

Disable selinux

[root@rac01 ~] # vi / etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing-SELinux security policy is enforced.

# permissive-SELinux prints warnings instead of enforcing.

# disabled-No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

# targeted-Targeted processes are protected

# mls-Multi Level Security protection.

SELINUXTYPE=targeted

Getsebool

Getsebool: SELinux is disabled

Stop the ntp service, the new check item of 11gR2

The root user runs on two nodes:

Settings required for gird time synchronization (new check item for 11gR2)

# Network Time Protocol Setting

/ sbin/service ntpd stop

Mv / etc/ntp.conf / etc/ntp.conf.bak (when oracle automatically enables its own NTP service)

[root@node1 ~] # service ntpd status

Ntpd is stopped

[root@node1 ~] # chkconfig ntpd stop

[root@node1 ~] # cat / etc/ntp

Ntp/ ntp.conf

[root@node1 ~] # cp / etc/ntp.conf / etc/ntp.conf.bak

[root@node1 ~] # rm-rf / etc/ntp.conf

[root@node1 ~] #

/ dev/shm handling of insufficient shared memory

Solution:

For example: to increase the size of / dev/shm to 1GB, modify the line of / etc/fstab: default:

None / dev/shm tmpfs defaults 0 0

Change it to:

None / dev/shm tmpfs defaults,size=1024m 0 0

The size parameter can also be measured in G: size=1G.

Or use the command: mount-o remount,size=4G / dev/shm

Re-mount / dev/shm to make it effective:

# mount-o remount / dev/shm

Or:

# umount / dev/shm

# mount-a

You can immediately check for changes with the "df-h" command.

Add groups and users add oracle and grid users

Groupadd-g 501 oinstall

Groupadd-g 502 dba

Groupadd-g 503 oper

Groupadd-g 504 asmadmin

Groupadd-g 505 asmoper

Groupadd-g 506 asmdba

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

Useradd-g oinstall-G asmadmin,asmdba,asmoper,oper,dba grid

Set passwords for oracle and grid users:

[root@rac01 ~] # passwd oracle

[root@rac01 ~] # passwd grid

Check:

[root@ora1 ~] # id oracle

Uid=501 (oracle) gid=501 (oinstall) groups=501 (oinstall), 502,503 (oper), 506 (asmdba)

[root@ora1 ~] # id grid

Uid=502 (grid) gid=501 (oinstall)

Groups=501 (oinstall), 502 (dba), 503 (oper), 504 (asmadmin), 505 (asmoper), 506 (asmdba)

Create directories and configure environment variable files for grid and oracle users

? The ORACLE_HOME of GRID software cannot be a subdirectory of ORACLE_BASE

-- create a directory under both nodes and root user:

Mkdir-p / u01/app/oracle

Mkdir-p / u01/app/grid

Mkdir-p / u01/app/11.2.0/grid

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

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

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

Chmod-R 775 / U01

Mkdir-p / u01/app/oraInventory

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

Chmod-R 775 / u01/app/oraInventory

Modify the .bash_profile file of gird and oracle users, log in as oracle account, and edit .bash _ profile

Or edit directly in root:

Vi / home/oracle/.bash_profile

Vi / home/grid/.bash_profile

-Oracle User---- switches to Oracle users-

[root@rhel_linux_asm ~] # su-oracle

[oracle@rhel_linux_asm] $vi ~ / .bash_profile

Export ORACLE_SID=rac1

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Export NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"

Export TMP=/tmp

Export TMPDIR=$TMP

Export PATH=$PATH:$ORACLE_HOME/bin

-Grid User- switches to grid users-

[grid@rhel_linux_asm ~] $vim .bash _ profile

Export ORACLE_SID=+ASM1

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/11.2.0/grid

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Export NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"

Export PATH=$ORACLE_HOME/bin:$PATH

Note: the name of another database instance must be modified accordingly:

Oracle:export ORACLE_SID=rac2

Grid:export ORACLE_SID=+ASM2

Check of software packages

According to the official documentation, Red Hat Enterprise Linux 5 must install the following software packages

Binutils-2.17.50.0.6compat-libstdc++-33-3.2.3compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125elfutils-libelf-devel-0.125elfutils-libelf-devel-static-0.125gcc-4.1.2gcc-c++-4.1.2glibc-2.5-24glibc-2.5-24 (32 bit) glibc-common-2.5glibc-devel-2.5glibc-devel-2.5 (32 bit) glibc-headers-2.5ksh -20060214libaio-0.3.106libaio-0.3.106 (32 bit) libaio-devel-0.3.106libaio-devel-0.3.106 (32 bit) libgcc-4.1.2libgcc-4.1.2 (32 bit) libstdc++-4.1.2libstdc++-4.1.2 (32 bit) libstdc++-devel 4.1.2make-3.81sysstat-7.0.2unixODBC-2.2.11unixODBC-2.2.11 (32 bit) unixODBC-devel-2.2.11unixODBC-devel-2.2.11 (32 bit)

In general, except for some packages of compat that are not installed, all other packages have been installed. You can use the rpm-qa | grep command to query, and be sure to match the operating system version.

Rpm-qa | grep binutils-

Rpm-qa | grep compat-libstdc++-

Rpm-qa | grep elfutils-libelf-

Rpm-qa | grep elfutils-libelf-devel-

Rpm-qa | grep glibc-

Rpm-qa | grep glibc-common-

Rpm-qa | grep glibc-devel-

Rpm-qa | grep gcc-

Rpm-qa | grep gcc-c++-

Rpm-qa | grep libaio-

Rpm-qa | grep libaio-devel-

Rpm-qa | grep libgcc-

Rpm-qa | grep libstdc++-

Rpm-qa | grep libstdc++-devel-

Rpm-qa | grep make-

Rpm-qa | grep sysstat-

Rpm-qa | grep unixODBC-

Rpm-qa | grep unixODBC-devel-

Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm-- force-- nodeps

Rpm-ivh unixODBC-*-force-nodeps

Rhel6 should also install a package: compat-libcap1-1.10-1.x86_64.rpm

Turn off unwanted services

Chkconfig autofs off

Chkconfig acpid off

Chkconfig sendmail off

Chkconfig cups-config-daemon off

Chkconfig cpus off

Chkconfig xfs off

Chkconfig lm_sensors off

Chkconfig gpm off

Chkconfig openibd off

Chkconfig pcmcia off

Chkconfig cpuspeed off

Chkconfig nfslock off

Chkconfig ip6tables off

Chkconfig rpcidmapd off

Chkconfig apmd off

Chkconfig sendmail off

Chkconfig arptables_jf off

Chkconifg microcode_ctl off

Chkconfig rpcgssd off

Chkconfig ntpd off

Establish ssh equivalence with SSH mutual trust-- 11G does not need to be configured

Although oracle automatically configures SSH peer during software installation, it is recommended that you configure it manually before installing the software.

Execute on each node as oracle

Create a connection for ssh and scp and verify that it exists:

Ls-1 / usr/local/bin/ssh

Ls-1 / usr/local/bin/scp

Create if it does not exist

/ bin/ln-s / usr/bin/ssh / usr/local/bin/ssh

/ bin/ln-s / usr/bin/scp / usr/local/bin/scp

[root@rac01] # / bin/ln-s / usr/bin/ssh / usr/local/bin/ssh

[root@rac01] # / bin/ln-s / usr/bin/scp / usr/local/bin/scp

Configure SSH for oracle users:

Generate the user's public and private keys, on each node:

[root@rac01 ~] # su-oracle

[oracle@rac01] # mkdir ~ / .ssh

[oracle@rac01 ~] # cd .ssh

[oracle@rac01] # ssh-keygen-t rsa

[oracle@rac01] # ssh-keygen-t dsa

On node 1, synthesize the authorized_keys files of all nodes into one, and then use this file to overwrite the files of the same name under each node .ssh:

[oracle@rac01 ~] # touch authorized_keys

[oracle@rac01 ~] # ssh rac01 cat / home/oracle/.ssh/id_rsa.pub > > authorized_keys

[oracle@rac01 ~] # ssh rac02 cat / home/oracle/.ssh/id_rsa.pub > > authorized_keys

[oracle@rac01 ~] # ssh rac01 cat / home/oracle/.ssh/id_dsa.pub > > authorized_keys

[oracle@rac01 ~] # ssh rac02 cat / home/oracle/.ssh/id_dsa.pub > > authorized_keys

[oracle@rac01 ~] # scp authorized_keys rac02:/home/oracle/.ssh/

Perform verification operations on each node separately:

[oracle@rac01 ~] # ssh rac01 date

[oracle@rac01 ~] # ssh rac02 date

[oracle@rac01 ~] # ssh-agent $SHELL

[oracle@rac01 ~] # ssh-add

Configure SSH for grid users:

On each node:

[root@rac01 ~] # su-grid

[grid@rac01] # mkdir ~ / .ssh

[grid@rac01 ~] # cd .ssh

[grid@rac01] # ssh-keygen-t rsa

[grid@rac01] # ssh-keygen-t dsa

On Node 1

:

[grid@rac01 ~] # touch authorized_keys

[grid@rac01 ~] # ssh rac01 cat / home/grid/.ssh/id_rsa.pub > > authorized_keys

[grid@rac01 ~] # ssh rac02 cat / home/grid/.ssh/id_rsa.pub > > authorized_keys

[grid@rac01 ~] # ssh rac01 cat / home/grid/.ssh/id_dsa.pub > > authorized_keys

[grid@rac01 ~] # ssh rac02 cat / home/grid/.ssh/id_dsa.pub > > authorized_keys

[grid@rac01 ~] # scp authorized_keys rac02:/home/grid/.ssh/

On each node:

[grid@rac01 ~] # ssh rac01 date

[grid@rac01 ~] # ssh rac02 date

[grid@rac01 ~] # ssh-agent $SHELL

[grid@rac01 ~] # ssh-add

-myself:

Configure SSH for Oracle users:

Execute the following code on each node as oracle

Su-oracle

Mkdir / .ssh

Cd .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cat * rsa.pub > > authorized_keys

Cat * dsa.pub > > authorized_keys

Then under rac1:

Ssh rac2 cat / home/oracle/.ssh/authorized_keys > > authorized_keys

Scp authorized_keys rac2:/home/oracle/.ssh/

Then perform the verification operation on each node separately:

Ssh rac1 date

Ssh rac2 date

Ssh-agent $SHELL

Ssh-add

Configure SSH for grid users:

Execute on each node as grid

Su-grid

Mkdir / .ssh

Cd / .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Cat * rsa.pub > > authorized_keys

Cat * dsa.pub > > authorized_keys

Then execute under the rac1 node:

Ssh rac2 cat / home/grid/.ssh/authorized_keys > > authorized_keys

Scp authorized_keys rac2:/home/grid/.ssh/

Then perform the verification operation on each node separately:

Ssh rac1 date

Ssh rac2 date

Ssh rac1-priv date

Ssh rac2-priv date

When you are no longer prompted for a password on the second execution, and the command can be executed successfully, it indicates that the oracle user is SSH peer

The configuration is successful. At this point, the Oracle user SSH peer configuration is complete! Repeat the above steps to configure peer-to-peer for grid users.

Ssh-agent $SHELL

Ssh-add

Note: this step may not be configured and then the following interface can be used during the installation process:

Configure NTP

Execute under the root user:

Rac1 execution

A. sed-I's Universe options / etc/sysconfig/ntpd

b.

Cat > > / etc/sysconfig/ntpd / etc/ntp.conf > / etc/sysconfig/ntpd > / 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

Wechat

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

12
Report