Explain how to install Oracle RAC in Linux

Source: Internet
Author: User

Here we will introduce the installation of Oracle RAC in Linux. Oracle Real Application Server, Real Application cluster, Oracle RAC for short, is an Oracle Parallel cluster, oracle instances in Different server systems access the same Oracle database at the same time, and nodes communicate with each other over a private network. All control files, online logs, and data files are stored on shared devices, it can be read and written by all nodes in the cluster at the same time.

System Configuration

1. Create users and group oinstall dba users

 
 
  1. oracle  -g oinstall -G dba 

Anonymous user: confirm that the anonymous user nobody exists in the system. After the installation is complete, the nobody user must execute some extension tasks extjob.) check whether the nobody user exists:

 
 
  1. #id nobody 

If the user does not exist, add the user.

Note: Set the password for oracle users.

2. Configure the network

IP address planning by modifying/etc/sysconf/network-script/ifcfg-ethx

Configure Permanent modification of the Host Name of the static IP address of the NIC:/etc/network

Local DNS configuration:/etc/hosts

Configure the/etc/host. conf file to specify the order of domain name resolution methods:

 
 
  1. order  hosts,bind 

It indicates that it is first parsed through the/etc/hosts file. If there is no correspondence between the host name and the IP address in the file, it is then parsed through the Domain Name Server bind.

3. Configure the Secure SSH channel. For ORACLE users, create rsa and dsa keys on each node.

 
 
  1. rac1#su - oracle  
  2. rac1#mkdir .ssh  
  3. rac1#chmod 700 .ssh  
  4. rac1#cd .ssh   

Rac1 # create an ssh-keygen-t rsa key pair.

Perform the same operation on another host.

 
 
  1. Rac2 # su-oracle
  2. Rac2 # mkdir. ssh
  3. Rac2 # chmod 700. ssh
  4. Rac2 # cd. ssh
  5. Rac2 # create an ssh-keygen-t rsa key pair.

Rac1 # ssh rac1 cat/home/oracle /. ssh/id_rsa.pub> authorized_keys directs the master key of Node 1 to a file. Because no key pair exists, a password is prompted. Just enter the password.

 
 
  1. Rac1 # ssh rac2 cat/home/oracle/. ssh/id_rsa.pub> authorized_keys directs the master key of Node 2 to a file
  2. Rac1 # cat authorized_keys view the contents of the common keys of Node 1 and node 2, and copy them to node 2.
  3. Rac1 # scp authorized_keys rac2:/home/oracle/. ssh/enter the password of Node 2

Change the permission

 
 
  1. rac1#chmod 600 authorized-keys 

The same is true for the DSA key settings.

 
 
  1. Rac1 # remote execution of the date command using ssh rac1 date to test the common key connection. You do not need to enter a password.
  2. Rac1 # remote execution of the date command using ssh rac2 date to test the common key connection. You do not need to enter a password.

In this case, the security channel is successfully configured.

4. Check Required Software

# Rpm-qa | software package required by grep

5. Configure Kernel Parameters 

 
 
  1. vi /etc/sysctl.conf  
  2. kernel.sem=250 32000 100 128  
  3. kernel.shmmni=4096 
  4. kernel.shmall=2097152 
  5. kernel.shmmax=2147483648 
  6. net.ipv4.ip_local_port_range=1024 65000  
  7. net.core.rmem_default=1048576 
  8. net.core.rmem_max=1048576 
  9. net.core.wmem_default=262144 
  10. net.core.wmem_max=262144 

Then run: # sysctl-p

6. Set shell restrictions on oracle users

Vi/etc/security/limits. conf perform the same operation on each node: edit/etc/security/limits. conf and add the following content:

 
 
  1. oracle    soft  nproc    2047  
  2. oracle    hard  nproc    16384  
  3. oracle    soft  nofile   1024  
  4. oracle    hard  nofilw   65536 

Edit/etc/pam. d/login and add the following content: session required/lib/security/pam_limits.so

Edit/etc/profile and add the following content:

 
 
  1. if[$USER="ORACLE"]; THEN  
  2.       if[$SHELL="/bin/ksh"];then  
  3.             ulimit -p 16384  
  4.             ulimit -n 65536  
  5.       else  
  6.             ulimit -u 16384 -n 65536  
  7.      fi  
  8. fi 

Disk configuration

Install CRS

Install true RAC

Storage Options:

Project Storage System Storage location
Clusterware Local (EXT3) or NFS Local or NFS
Voting disk OCFS2 Raw device NFS Shared disk NFS
OCR OCFS2 Raw device NFS Shared disk NFS
Database Software OCFS2 local NFS Local or shared disk NFS
Database OCFS2 ASM Raw device NFS Shared disk NFS
Restore Files OCFS2 ASM NFS Shared disk NFS

Storage Mechanism

Clusterware Database Restore Files
ASM No Yes Yes
OCFS2 Yes Yes Yes
Raw Device Yes Yes No
NFS Yes Yes Yes

OCFS2 install this software download 3 software packages on both sides to install OCFS2-2.6.9-22.ELsmp-1.2.3-1.i686.rpm this file corresponds to the uname-a system version ocfs2console-1.2.1-1.i386.rpm ocfs2-tools-1.2.1-1.i386.rpm

Installation sequence: tools ---- kernel module ----- console

Disk Processing

 
 
  1. # Fdisk-l view disk partitions
  2. # Fdisk/dev/sdb create a partition
  3. # Export DISPLAY = IP address of the Local Machine
  4. # Ocfs2console open the ocfs2 console for ocfs2 Configuration

Start formatting the partition under the menu Task.

Preparations before Oracle Installation

 
 
  1. # Mkdir-p/orac/mongohome
  2. # Mkdir-p/orac/oradata
  3. # Mount-t ocfs2/dev/sdb1/orac/orahome
  4. # Df-h view mounting status
  5. # Mount-t ocfs2-o datavolume, nointr/dev/sdb2 orac/oradata
  6. # Df-h
  7. # Mounted. ocfs2-f check the loading status of the ocfs2 File System

Another node, rac2

 
 
  1. #/Etc/init. d/o2cd load this module
  2. #/Etc/init. d/o2cd status view the status of the loaded Module

The status of Node 2 ocfs2 is offline.

 
 
  1. #/Etc/init. d/o2cd online to make it online
  2. #/Etc/init. d/o2cd status view the status of the loaded Module
  3. # Mount-t ocfs2/dev/sdb1/orac/orahome
  4. # Df-h
  5. # Mounted. ocfs2-f
  6. # Mount-t ocfs2-o datavolume, nointr/dev/sdb2/orac/oradata
  7. # Mounted. ocfs2-f

When the system starts, it automatically loads the ocfs2 file system and starts the corresponding module-both nodes must be configured

 
 
  1. #/Etc/init. d/o2cd configure automatically loads ocfs2 modules at startup
  2. # Vi/etc/fstab is automatically mounted to the file system
  3. /Dev/sdb1/orac/orahome ocfs2 _ netdev 0 0
  4. /Dev/sdb2/orac/oradata ocfs2 _ netdev, datavolume, nointr 0 0

Install the cluster clusterware folder crs when installing the clusterware oradata database, use orahome to install the oracle database software

Modify the primary users of these folders

 
 
  1. #cd /orac  
  2. #chown root.oinstall crs  
  3. #chown oracle.oinstall orahome  
  4. #chown oracle.oinstall oradata  
  5. #chmod -R 775 ors  
  6. #chmod -R 775 orahome  
  7. #chmod -R 775 oradata  
  8. #ls -l 

Modify the node.

Copy the cluster clusterware Installation Software

 
 
  1. # Su-oracle
  2. # Export DISPLAY = Local ip: 0.0
  3. #./RunInstaller

Install database software select the installation Type Enterprise Edition

Create a database: # dbca

Test Database: Modify the connection file of the Client: NETWORK/ADMIN/tnsnames. ora in the installation path of the Client

 
 
  1. ORATEST tns service name =
  2. (DESCRIPTION =
  3. (ADDRESS_LIST =
  4. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.116.121 node 1IP) (PORT = 1521 ))
  5. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.116.129 node 2IP) (PORT = 1521 ))
  6. )
  7. (CONNECT_DATA =
  8. (SERVICE_NAME = oratest.sinobest.com global database name)
  9. )
  10. )
  11.  
  12. EXTPROC_CONNECTION_DATA =
  13. (DESCRIPTION =
  14. (ADDRESS_LIST =
  15. (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0 ))
  16. )
  17. (CONNECT_DATA =
  18. (SID = PLSExtProc)
  19. (PRESENTATION = RO)
  20. )
  21. )

Test the SQLPLUS client: Open the command line in windows or directly open Oracle SQL * Plus

 
 
  1. > Sqlplus/nolog
  2.  
  3. SQL> conn sys/123456 @ tnsname as sysdba
  4. SQL> select * from V $ instance; view the current instance
  5. SQL> set wrap off; set the Display Mode
  6. SQL> set linesize 200;
  7. SQL> select * from V $ instance; view the current instance
  8. SQL> select * from gv $ instance; view the global instance View

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.