Simple installation steps for Oracle 10gR2 Clusterware

Source: Internet
Author: User

Simple installation steps for Oracle 10gR2 Clusterware

1. Install the Operating System (omitted)
Note: I use the OEL 5u5 version here. Because it comes with the environment variable installation package provided by Oracle, It is very convenient to install the Oracle software. Therefore, we recommend that you use this version.

2. Configure the local yum Source

-- Mount the installation disk to media
Mount-t iso9660/dev/cdrom/media


-- Configure repos to add the following content
Vi/etc/yum. repos. d/oel5.repos
[Oel5]
Name = oel 5 DVD
Basurl = file: // media/Server
Gpgcheck = 0
Enabled = 1 -- 1 indicates that this repos is enabled.

Iii. Configure the trust relationship (oracle user)

-- Run the following commands on node 1 and node 2:
Ssh-keygen-t rsa
Ssh-keygen-t dsa

-- Run Node 1:
Cat ~ /. Ssh/*. pub> ~ /. Ssh/authorized_keys
Ssh rac2 cat ~ /. Ssh/*. pub> ~ /. Ssh/authorized_keys
Scp ~ /. Ssh/authorized_keys rac2 :~ /. Ssh/authorized_keys

In short, the information of the two nodes is written to the public key file, and then the password is no longer required for mutual ssh, because the RAC installation requires copying files between nodes

-- Verify
Run Node 1:
Ssh rac1 date
Ssh rac2 date
Ssh rac1-priv date
Ssh rac2-priv date


Node 2 execution:
Ssh rac1 date
Ssh rac2 date
Ssh rac1-priv date
Ssh rac2-priv date

Verify it several times until you do not need to enter the password. Note that do not miss s in authorized_keys. I tried it for a long time and did not succeed. Finally, I found that the public key file name was wrong, caused by a loss of s

4. configure a shared Disk

-- Add and partition several disks
Fdisk-l
Fdisk/dev/sdb
Fdisk/dev/sdc
Fdisk/dev/sdd
Fdisk/dev/sde

If you need to restart to identify the partition information, you can use the partporbe command that comes with linux to execute the command so that the kernel can identify the new partition without restarting.
You can also execute partprobe-s to view

[Root @ rac1 ~] # Fdisk/dev/sdc

Command (m for help): n
Command action
E extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-12, default 1 ):
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-12, default 12 ):
Using default value 12

Command (m for help): w
The partition table has been altered!

Calling ioctl () to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[Root @ rac1 ~] # Partprobe-s
/Dev/sda: msdos partitions 1 2
/Dev/sdb: msdos partitions 1
/Dev/sdc: msdos partitions 1
/Dev/sdd: msdos partitions 1
/Dev/sde: msdos partitions 1
[Root @ rac2 install] #

-- Bind Disk
For systems 4.x and 5.x, the binding method is different.

4. x:
# Vi/etc/sysconfig/rawdevices

/Dev/raw/raw1/dev/sdc1
/Dev/raw/raw2/dev/sdd1
/Dev/raw/raw3/dev/sde1

# Vi/etc/udev/permissions. d/50-udev.permissions
# Raw devices
Ram *: root: disk: 0660
# Raw/*: root: disk: 0660
Raw/*: oracle: dba: 0660

5.x:

# Vi/etc/udev/rules. d/60-raw.rulesACTION = "add", KERNEL = "/dev/sdb1 ", RUN + = "/bin/raw/dev/raw/raw1% N" ACTION = "add", ENV {MAJOR} = "8 ", ENV {MINOR} = "17", RUN + = "/bin/raw/dev/raw/raw1% M % m" ACTION = "add ", KERNEL = "/dev/sdc1", RUN + = "/bin/raw/dev/raw/raw2% N" ACTION = "add ", ENV {MAJOR} = "8", ENV {MINOR} = "33 ", RUN + = "/bin/raw/dev/raw/raw2% M % m" ACTION = "add", KERNEL = "/dev/sdd1 ", RUN + = "/bin/raw/dev/raw/raw3% N" ACTION = "add", ENV {MAJOR} = "8 ", ENV {MINOR} = "49", RUN + = "/bin/raw/dev/raw/raw3% M % m" ACTION = "add ", KERNEL = "/dev/sde1", RUN + = "/bin/raw/dev/raw/raw4% N" ACTION = "add ", ENV {MAJOR} = "8", ENV {MINOR} = "65 ", RUN + = "/bin/raw/dev/raw/raw4% M % m" ACTION = "add", KERNEL = "raw *", OWNER = "oracle ", GROUP = "oinstall", MODE = "660"

You only need to add the red part, and then restart udev. If the configuration is normal, the following content is displayed:

[Root @ rac1 ~] $ Ll/dev/raw

Total 0
Crw-rw ---- 1 oracle oinstall 162, 1 Jan 15 raw1
Crw-rw ---- 1 oracle oinstall 162, 2 Jan 15 raw2
Crw-rw ---- 1 oracle oinstall 162, 3 Jan 15 raw3
Crw-rw ---- 1 oracle oinstall 162, 4 Jan 15 raw4

5. Add Environment Variables

Node 1:
[Oracle @ rac1 ~] $ Vi. bash_profile
Export ORACLE_SID = RAC1
Export ORACLE_HOME =/u01/oracle/10.2.0/db_1
Export ORA_CRS_HOME =/u01/oracle/10.2.0/crs_1
Export PATH = $ ORACLE_HOME/bin: $ ORA_CRS_HOME/bin: $ ORACLE_HOME/jdk/bin: $ PATH

Node 2:
[Oracle @ rac1 ~] $ Vi. bash_profile
Export ORACLE_SID = RAC2
Export ORACLE_HOME =/u01/oracle/10.2.0/db_1
Export ORA_CRS_HOME =/u01/oracle/10.2.0/crs_1
Export PATH = $ ORACLE_HOME/bin: $ ORA_CRS_HOME/bin: $ ORACLE_HOME/jdk/bin: $ PATH

6. Install Clusterware

-- Check before installation
Cd./clusterware/cluvfy

./Cluvfy. sh-stage pre crsinst-n rac1, rac2-verbose

Will list a lot of content, check whether it meets the conditions for installing Clusterware, where you need to install a compat_db package separately, oracle-validated package will not install this
In addition, I will report several other compat packet detection failures, so I don't need to worry about it, because the version is not correct.
If you still encounter other content without passed, you need to handle it until all the preceding errors are passed.

-- Start Installation
Cd./clusterware

./RunInstall-ignoreSysPreReqs (the parameter can be case-insensitive and the command is not allowed)

When the OUI is run to the end, two scripts are required to be executed on two nodes respectively. The order is: Script 1: RAC1-> RAC2-> Script 2: RAC1-> RAC2
There is no problem with the first three executions. When you execute root. sh on node 2 in step 1, an error is reported:

[Root @ rac2 bin] #/u01/oracle/10.2.0/crs_1/root. sh

WARNING: directory '/u01' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01' is not owned by root
Clscfg: EXISTING configuration version 3 detected.
Clscfg: version 3 is 10G Release 2.
Assigning default hostname rac1 for node 1.
Assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS = 49895 CRS = 49896 EVMC = 49898 and EVMR = 49897.
Node <nodenumber>: <nodename> <private interconnect name> Node 1: rac1 rac1-priv rac1
Node 2: rac2 rac2-priv rac2
Clscfg: Arguments check out successfully.

No keys were written. Supply-force parameter to override.
-Force is destructive and will destroy any previous cluster
Configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
Rac1
Rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init (1 M)
Running vipca (silent) for processing nodeapps
/U01/oracle/10.2.0/crs_1/jdk/jre // bin/java: error while loading shared libraries: libpthread. so.0: cannot open shared object file: No such file or directory

Wait patiently for several minutes (90 s + 600 s) and an error will be reported, which is caused by the Oracle bug in 10.2.0.1, the solution is to modify the full vipca and srvctl files under $ ORA_CRS_HOME/bin in lines 124th and 168 of the two files respectively (note that it is not the end of the file, otherwise, the change may be invalid.) add unset LD_ASSUME_KERNEL, save and exit, and then run the root command again on node 2. sh

[Root @ rac2 bin] #/u01/oracle/10.2.0/crs_1/root. sh
WARNING: directory '/u01' is not owned by root
Checking to see if Oracle CRS stack is already configured
Oracle CRS stack is already configured and will be running under init (1 M)
[Root @ rac2 bin] #./crs_stat-t
CRS-0202: No resources are registered.

At this time, because no vip is configured, no resources are registered. Run vipca on any node (provided that the vipca of this node has been modified). If the following error is reported:

[Oracle @ rac1 bin] $ vipca
Error 0 (Native: listNetInterfaces: [3])
[Error 0 (Native: listNetInterfaces: [3])]

You need to configure the NIC:
[Oracle @ rac1 bin] $./oifcfg iflist
Eth0 192.168.1.0
Eth1 10.0.0.0
[Oracle @ rac1 bin] $./oifcfg getif
[Oracle @ rac1 bin] $./oifcfg setif-global eth0/192.168.1.0: public
[Oracle @ rac1 bin] $./oifcfg setif-global eth1/10.10.10.1: cluster_interconnect
[Oracle @ rac1 bin] $./oifcfg getif
Eth0 192.168.1.0 global public
Eth1 10.10.10.1 global cluster_interconnect

Note that you must have the permission to open the graphic interface and run vipca with the root user, instead of the oracle user. Otherwise, insufficient permissions will be reported.
[Oracle @ rac1 bin] $ vipca
Insufficient privileges.
Insufficient privileges.

Then, the OUI interface of the vip configuration assistant is displayed, and the vip is configured. After the vip node alias is entered, the vip IP address is automatically filled (process omitted)
After running vipca, exit and execute crs_stat again. You will find that all resources have been registered with crs.
[Root @ rac1 bin] #./crs_stat-t
Name Type Target State Host
------------------------------------------------------------
Ora. rac1.gsd application ONLINE rac1
Ora. rac1.ons application ONLINE rac1
Ora. rac1.vip application ONLINE rac1
Ora. rac2.gsd application ONLINE rac2
Ora. rac2.ons application ONLINE rac2
Ora. rac2.vip application ONLINE rac2

Note that there is also a srvctl command in the ORACLE_HOME/bin path, which also needs to be solved by setting unset LD_ASSUME_KERNEL, otherwise, the Database File Link error will be reported in the same way as the srvctl in ORA_CRS_HOME/bin. If you do not want to change it, it is not impossible. You need to adjust the ORA_CRS_HOME and ORACLE_HOME locations in the PATH environment variable, this is because the srvctl command file in ORACLE_HOME/bin will not be used until the last path is searched by default during command execution, put ORA_CRS_HOME at the beginning, as follows:
Export PATH = $ ORA_CRS_HOME/bin: $ ORACLE_HOME/jdk/bin: $ PATH

Either method (2nd recommended) can solve the problem that oracle users cannot execute commands such as srvctl and crsctl.

Related Article

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.