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

ORACLE11.2.0.4 RAC+ ASM installation method (operating system CENTOS7.6)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Preface

After trying all kinds of articles on the Internet, I found that there were many mistakes and omissions, there were still many details left unwritten, or how to deal with all kinds of errors were not written.

Here are my own installation steps and ways to solve the error report, because some of them are screenshots taken from my previous notes, so everyone will take care of those replaceable places by themselves, ha. It's really cute and new, and there's nothing I can do about it. I groped for myself, after all, this note was written for myself, in case I would use it again in the future, this time because in the new operating system environment. It takes me a lot of time to step on more than N pit. Don't step on it again next time.

My ASM configuration here is a storage bare device.

Operating system CENTOS7.6

Database ORACLE11.2.0.4

I. ASM disk configuration

1. Edit / etc/scsi_id.config file

Vi / etc/scsi_id.configo

Options=-g

2. Partition the disk and check the uuid of the disk (the disk partition can only be executed on one node)

Fdisk / dev/sda

N

P

one

Enter by default

Enter by default

W

Fidk / dev/sdb

N

P

one

Enter by default

Enter by default

W

View UUID

/ usr/lib/udev/scsi_id-g-u-d / dev/sda1

/ usr/lib/udev/scsi_id-g-u-d / dev/sdb1

Of course, which disk is the disk? you have to fix it by yourselves when you mount it. Lsblk will check the disk.

Forget to create users and groups before that

/ usr/sbin/groupadd-g 501 oinstall

/ usr/sbin/groupadd-g 502 dba

/ usr/sbin/groupadd-g 503 oper

/ usr/sbin/groupadd-g 504 asmadmin

/ usr/sbin/groupadd-g 505 asmoper

/ usr/sbin/groupadd-g 506 asmdba

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

/ usr/sbin/useradd-g oinstall-G asmadmin,asmdba,asmoper,oper,dba grid

3. Edit the binding file, using the following rules

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

KERNEL== "sd* [! 0-9]", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "3628408eff0495d08ef004912d7d6b386", RUN+= "/ bin/sh-c 'mknod / dev/asmocrdisk b $major $minor; chown grid:asmadmin / dev/asmocrdisk; chmod 0660 / dev/asmocrdisk'"

KERNEL== "sd* [! 0-9]", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "361c104516049770bef80026911671d80", RUN+= "/ bin/sh-c 'mknod / dev/asmdatadisk1 b $major $minor; chown grid:asmadmin / dev/asmdatadisk1; chmod 0660 / dev/asmdatadisk1'"

4. Start binding

test

/ sbin/partprobe / dev/sda1

/ sbin/udevadm test / block/sda/sda1

/ sbin/partprobe / dev/sdb1

/ sbin/udevadm test / block/sdb/sdb1

Perform the bind command:

/ sbin/udevadm control-- reload-rules

5. The binding is complete. You can use ls-l / dev/asm* to view it.

Lrwxrwxrwx. 1 root root 4 June 6 16:14 / dev/asm-datadisk1-> sdb1

Lrwxrwxrwx. 1 root root 4 June 6 16:05 / dev/asm-ocrdisk-> sda1

Note: at this time you may find that there is nothing under ll / dev/asm*.

Remember to turn off the firewall, setenforce 0 iptables-F

Then change the / etc/selinux/config permanent shutdown, vi / dev/udev/rules.d/ 99-oracle-asmdevices.rules configuration

After logging in to 2 nodes, lsblk finds out why there is no / dev/sda1 and / dev/sdb1, directly fdisk / dev/sda and fdisk / dev/sdb, and then Q exit directly without operation.

Lsblk again, and you will find that there is a mapping between ll and dev/asm*.

Then back to Node 1, ll / dev/asm* finds that there is still no mapping, which is the same as Node 2, fdisk / dev/sda and fdisk / dev/sdb and then directly Q exit without operation. Lsblk again, and you will find that there is a mapping between ll and dev/asm*.

If ll / dev/asm* is still not visible, you should be able to see it by simply reboot rebooting the operating system.

II. Environmental preparation

1. Host file configuration

# vi / etc/hosts

192.168.159.6 testdb1

192.168.159.7 testdb2

192.168.159.24 testdb1-vip

192.168.159.25 testdb2-vip

10.1.22.6 testdb1-pri

10.1.22.7 testdb2-pri

192.168.159.26 testdb-scan

(you'd better write only one name for the IP of the hosts file, not redundant)

The following is very important. If you do not modify it, you will get an error when installing grid.

Node 1

Vi / etc/hostname

Testdb1

Temporarily modify hostname

Hostname testdb1

Node 2

Vi / etc/hostname

Testdb2

Temporarily modify hostname

Hostname testdb2

The configuration of the network card does not need me to say, a public network card, a private network card, the configuration is very simple.

2. Install the environment package required by ORACLE11G

Yum-y install compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-headers libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel libcap.so.1

Yum-y install binutils compat-db compat-libcap1 compat-libstdc++-33 control-center elfutils-libelf-devel gcc gcc-c++ glibc glibc-common gnome-libs libaio-devel libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21 smartmontools

May there be an error when installing the Yum source? What's wrong with the YUM source? (ignore those using local YUM sources)

Check your configuration file at this time

Vi / etc/resolv.conf

Nameserver 114.114.114.114

3. Parameter configuration

Vi / etc/sysctl.conf

Configuration of the production library: add the last line and remove it repeatedly

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

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 = 1048576

Vm.nr_hugepages = 2100

Kernel.shmall = 4194304

Kernel.shmmax = 17179869183

I have 16G physical memory here. SGA is given 4G, so it is the above parameter setting.

Configuration size of huge

If your total SGA is 10G

Then your hugepage should take a value larger than the number of 10 '1024 pounds, 2' 5120, for example, 5200. Here is the 2100 given by 4G.

Note that to set up huge, you need to first look at whether the memory management of the database is AMM or ASMM, and if it is AMM, you cannot use huge.

There are also some settings for kernel parameters. The recommended values are as follows:

Kernel.shmmax

When the memory is 12g, the value is 1284901887.

When the memory is 16G, the value is 16,1024,1024,1024-1 = 17179869183.

When the memory is 32 GB, the value is 32 "1024" 1024 "1024-1 = 34359738367.

When the memory is 64g, the value is 641024102410241024-1 = 68719476735

When the memory is 128 GB, the value is 128 "1024" 1024 "1024-1 = 137438953471.

Kernel.shmall

When the memory is 12g, kernel.shmall = 3145728

When the memory is 16GB, kernel.shmall = 4194304

When the inner time is 32G, kernel.shmall = 8388608

When the memory is 64GB, kernel.shmall = 16777216

When the memory is 128 GB, kernel.shmall = 33554432

As for the settings of those other parameters, there are a lot of suggested values and instructions on the Internet, just look at them for yourself, and the default values are generally sufficient.

(note here that it is best to set up a large page hugepages in the production environment, otherwise the system will easily encounter some memory problems after running for a long time, personal experience.)

Want to view a large page of huge

Grep Huge / proc/meminfo

Make the parameter effective immediately

Sysctl-p

Vi / etc/security/limits.conf

Configuration of the production library: add the last line and remove it repeatedly

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 10240

Oracle hard nofile 65536

Oracle soft stack 10240

Grid soft nproc 2047

Grid hard nproc 16384

Grid soft nofile 1024

Grid hard nofile 65536

Grid soft stack 10240

Note that the 10240 here is related to the number of connections to the operating system. Ulimit-n can check the number of connections, and configure the number of connections corresponding to the database.

Vi / etc/pam.d/login

Session required pam_limits.so

4. Turn off the firewall

(my environment here is generally in the cloud, so there is no need to consider security issues such as firewalls. There is a physical firewall on the cloud, which is blocked by N multi-policies.)

If you don't turn off the firewall, you will have trouble configuring the cluster later.

Service iptables stop

Chkconfig iptables off

Setenforce 0

Getenforce

Iptables-F

Vi / etc/selinux/config

SELINUX=disabled

SELINUXTYPE=targeted

5. Disable NTP service

Service ntpd stop

Chkconfig ntpd off

Mv / etc/ntp.conf / etc/ntp.conf.bak

Rm-rf / etc/ntp.conf

6. Users and user groups, permission directory creation

/ usr/sbin/groupadd-g 501 oinstall

/ usr/sbin/groupadd-g 502 dba

/ usr/sbin/groupadd-g 503 oper

/ usr/sbin/groupadd-g 504 asmadmin

/ usr/sbin/groupadd-g 505 asmoper

/ usr/sbin/groupadd-g 506 asmdba

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

/ usr/sbin/useradd-g oinstall-G asmadmin,asmdba,asmoper,oper,dba grid

Passwd oracle

Passwd grid

Mkdir-p / home/u01/app/grid

Mkdir-p / home/u01/app/11.2.0/grid

Chown-R grid:oinstall / home/u01

Mkdir-p / home/u01/app/oracle

Chown oracle:oinstall / home/u01/app/oracle

Chmod-R 775 / home/u01

7. Oracle and grid environment variable configuration

Log in as an oracle user (the two nodes are the same) (don't always think about copy and paste, note that there may be more spaces between some paths, this is the BUG of the blog, I don't know why there are more spaces for no reason, anyway, I often encounter their own editing without spaces, others will copy and paste them. )

Node one

Vi .bash _ profile

Export PATH

Umask 022

Export ORACLE_BASE=/ home/ u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export ORACLE_SID=testdb1

Export LANG=en_US.UTF-8

Export NLS_DATE_FORMAT= "yyyy-mm-dd hh34:mi:ss"

Export PATH=.:$ {PATH}: $HOME/bin:$ORACLE_HOME/bin

Export PATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/bin

Export PATH=$ {PATH}: $ORACLE_BASE/common/oracle/bin

Export ORACLE_PATH=$ {PATH}: $ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin

Export ORACLE_TERM=xterm

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Export LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/lib

Export LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/lib

Export CLASSPATH=$ORACLE_HOME/JRE

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlib

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlib

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlib

Export THREADS_FLAG=native

Export TEMP=/tmp

Export TMPDIR=/tmp

Oracle users, Node 2

Vi .bash _ profile

Export PATH

Umask 022

Export ORACLE_BASE=/ home/ u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export ORACLE_SID=testdb2

Export LANG=en_US.UTF-8

Export NLS_DATE_FORMAT= "yyyy-mm-dd hh34:mi:ss"

Export PATH=.:$ {PATH}: $HOME/bin:$ORACLE_HOME/bin

Export PATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/bin

Export PATH=$ {PATH}: $ORACLE_BASE/common/oracle/bin

Export ORACLE_PATH=$ {PATH}: $ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin

Export ORACLE_TERM=xterm

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Export LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/lib

Export LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/lib

Export CLASSPATH=$ORACLE_HOME/JRE

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlib

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlib

Export CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlib

Export THREADS_FLAG=native

Export TEMP=/tmp

Export TMPDIR=/tmp

Log in as grid user

Node one:

Vi .bash _ profile

ORACLE_SID=+ASM1; export ORACLE_SID

JAVA_HOME=/usr/local/java;export JAVA_HOME

ORACLE_BASE=/ home/ u01amp appplet grid; export ORACLE_BASE

ORACLE_HOME=/ home/ u01Applink 11.2.0 Universe grid; export ORACLE_HOME

ORACLE_PATH=/ home/ u01 export ORACLE_PATH export ORACLE_PATH

ORACLE_TERM=xterm;export ORACLE_TERM

NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:$ {JAVA_HOME} / bin:$ {PATH}: $HOME/bin:$ORACLE_HOME/bin

PATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=$ {PATH}: / home/ u01/app/common/oracle/bin

Export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/lib

Export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlib

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlib

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlib

Export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

Export TEMP=/tmp

Export TMPDIR=/tmp

Export LANG=en_US.UTF-8

Alias sqlplus= "rlwrap sqlplus"

Umask 022

Node 2:

Vi .bash _ profile

ORACLE_SID=+ASM2; export ORACLE_SID

JAVA_HOME=/usr/local/java;export JAVA_HOME

ORACLE_BASE=/ home/ u01amp appplet grid; export ORACLE_BASE

ORACLE_HOME=/ home/ u01Applink 11.2.0 Universe grid; export ORACLE_HOME

ORACLE_PATH=/ home/ u01 export ORACLE_PATH export ORACLE_PATH

ORACLE_TERM=xterm;export ORACLE_TERM

NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:$ {JAVA_HOME} / bin:$ {PATH}: $HOME/bin:$ORACLE_HOME/bin

PATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=$ {PATH}: / home/ u01/app/common/oracle/bin

Export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/lib

Export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlib

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlib

CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlib

Export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

Export TEMP=/tmp

Export TMPDIR=/tmp

Export LANG=en_US.UTF-8

Alias sqlplus= "rlwrap sqlplus"

Umask 022

8. Ssh key mutual trust configuration

Set the mutual trust relationship. Remember here that both oracle and grid users should set mutual trust, and root should also set mutual trust. During the test, both nodes should be tested.

Su-oracle

Mkdir / .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

The following operations can be performed on a node

Cat ~ / .ssh/id_rsa.pub > >. / .ssh / authorized_keys-the public key is stored in the authorized_keys file and written to the local machine

Cat ~ / .ssh/id_dsa.pub > >. / .ssh / authorized_keys

Ssh testdb2 cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys-the public key of the second node is written to the local machine

Ssh testdb2 cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys testdb2:~/.ssh/authorized_keys

Verification on both nodes

Ssh testdb1 date

Ssh testdb2 date

Ssh testdb1-PRI date

Ssh testdb2-PRI date

Su-grid

Mkdir / .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

The following operations can be performed on a node

Cat ~ / .ssh/id_rsa.pub > >. / .ssh / authorized_keys-the public key is stored in the authorized_keys file and written to the local machine

Cat ~ / .ssh/id_dsa.pub > >. / .ssh / authorized_keys

Ssh testdb2 cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys-the public key of the second node is written to the local machine

Ssh testdb2 cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys testdb2:~/.ssh/authorized_keys

Verification on both nodes

Ssh testdb1 date

Ssh testdb2 date

Ssh testdb1-PRI date

Ssh testdb2-PRI date

If you want to make a cluster patch or something, root users also come to verify it.

III. GRID/ASM installation

1) use oracle users to extract the installation package (in fact, the same goes for root decompression)

2) use the grid user to log in and install grid

Install graphical

Yum-y groupinstall "X Window System"

Yum-y install compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-headers libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel

Yum install-y compat-libcap1-1.10 libcap.so.1 libstdc++-devel-4.4.4 gcc-c++-4.4.4 smartmontools libaio-devel-0.3.107

Unpack all the installation packages you downloaded. I usually put the installation packages in the / opt/ directory (just operate on one of the nodes).

Cd / opt/

Unzip p13390677_112040_Linux-x86-64_1of7.zip

Unzip p13390677_112040_Linux-x86-64_2of7.zip

Unzip p13390677_112040_Linux-x86-64_3of7.zip

After decompression, two directories database and grid will appear.

Rpm-ivh / opt/grid/rpm/cvuqdisk-1.0.9-1.rpm (you can find it in the unzipped grid installation package. If you cannot install it, please install yum install smartmontools first)

Rpm-ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm (this version must be installed here)

Note: when installing GRID, the VIP should be set in all lowercase, and the IP of VIP is not allowed.

Root user xhost + enter

Su-grid

Export DISPLAY=192.168.159.6:0.0

Cd / opt/grid/

. / runInstaller

(1) step 1

(2) step 2

(3) step 3

(4) step 4

(5) step 5

(6) step 6

When an error is reported:

If you encounter the above error, you need to modify scan name to the existing name of scan under / etc/hosts, such as testdb-scan

192.168.159.6 testdb1

192.168.159.7 testdb2

192.168.159.24 testdb1-vip

192.168.159.25 testdb2-vip

10.1.22.6 testdb1-pri

10.1.22.7 testdb2-pri

192.168.159.26 testdb-scan

Step 7 is the same problem, with the corresponding name consistent with the / etc/hosts setting (note that if / etc/hosts is modified during installation, you need to reopen the installer to recognize it)

(7) step 7

If an error is reported here, check whether the IP address of ifconfig is occupied, and check whether the mutual trust between grid and oracle is normal.

Public hostname must fill in the hostname of the physical node

Virtual hostname can enter the hostname under / etc/hosts

Note: the two nodes must trust each other with keys, including hostname and virtual hostname. After mutual trust, if there is an error and mutual trust, restart the installer to identify it after the mutual trust has been configured.

Trusted users include grid,oracle

Note that you and yourself should also trust each other.

If the above error occurs, you should check whether VIP is used and occupied.

Ifconfig

Whether the Ping vip address is connected.

If it is found to be occupied, only one IP address can be changed.

(8) step 8

(9) step 9

Note that there must be a dual network card, a public network and a private network

(10) step 10

(11) step 11

Note that if there is a situation like the following figure, it is possible that your / etc/udev/rules.d/ 99-oracle-asmdevices.rules file is not configured correctly, which will cause the final grid installation to fail. You must check it clearly.

The correct figure is as follows:

(12) step 12

(13) step 13 (if you set a 16-bit uppercase and lowercase letter + number + special character, this step will not occur)

(14) step 14

(15) step 15

(16) step 16

(17) step 17 (note that the directory does not exist. Click NEXT and automatically create it on the server)

(18) step 18

(19) step 19

If there are so many problems here, solve them one by one, especially if there is a FAILED.

Swap size checked that his swap has 8G and requires 16G, which is not a big problem and can be ignored.

OS KERNEL problem, check / etc/sysctl.conf, found that shmmax is not set, add to

For the problem with pdksh, the version of pdksh-5.2.14-37.el5_8.1.x86_64.rpm must be installed.

Cvuqdisk problem, must install / opt/grid/rpm/cvuqdisk-1.0.9-1.rpm (this is the grid installation package can be found after decompression)

The normal test results are shown below:

(20) step 20

Use the root user on the new terminal to execute the following two scripts:

An error has been reported. An error was reported when the second script was executed, as follows:

# / home/u01/app/oraInventory/orainstRoot.sh

Changing permissions of / home/u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of / home/u01/app/oraInventory to oinstall.

The execution of the script is complete.

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

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME= / home/u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/ usr/local/bin]:

Copying dbhome to / usr/local/bin...

Copying oraenv to / usr/local/bin...

Copying coraenv to / usr/local/bin...

Creating / etc/oratab file...

Entries will be added to the / etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Using configuration parameter file: / home/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

User ignored Prerequisites during installation

Installing Trace File Analyzer

Failed to create keys in the OLR, rc = 127, Message:

/ home/u01/app/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory

Failed to create keys in the OLR at / home/u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 7660.

/ home/u01/app/11.2.0/grid/perl/bin/perl-I/home/u01/app/11.2.0/grid/perl/lib-I/home/u01/app/11.2.0/grid/crs/install / home/u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed

What should I do? I checked the information on the Internet and tried it.

Yum install libcap.so.1

After the installation, re-execute the second script, useless, or report an error, what to do, continue to check.

Found that there is such a solution:

Ls-lt / usr/lib64/libcap.so.2

Lrwxrwxrwx. 1 root root 14 May 9 14:20 / usr/lib64/libcap.so.2-> libcap.so.2.22

Ln-s / usr/lib64/libcap.so.2 / usr/lib64/libcap.so.1

(note that if you have a CENTOS6.5 version of the operating system

You need to install yum install libcap.so.2, and then

Find /-name libcap.so.2

Ln-s / lib64/libcap.so.2 / usr/lib64/libcap.so.1

Execute the root script again)

Re-execute the second script again, or report an error, what to do, continue to check the information

The error is as follows:

Adding Clusterware entries to inittab

Ohasd failed to start

Failed to start the Clusterware. Last 20 lines of the alert log follow:

2015-05-23 23 3715 45.460:

[client (13782)] CRS-2101:The OLR was formatted using version 3.

Follow the following URL to solve the problem:

Https://blog.csdn.net/u010692693/article/details/48374557

As follows:

Error message:

[root@rac1 ~] # / u01/app/oraInventory/orainstRoot.sh

Changing permissions of / u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of / u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@zjdb1 ~] # / u01/app/11.2.0/grid/root.sh

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME= / u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/ usr/local/bin]:

Copying dbhome to / usr/local/bin...

Copying oraenv to / usr/local/bin...

Copying coraenv to / usr/local/bin...

Creating / etc/oratab file...

Entries will be added to the / etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

User ignored Prerequisites during installation

Installing Trace File Analyzer

OLR initialization-successful

Root wallet

Root wallet cert

Root cert export

Peer wallet

Profile reader wallet

Pa wallet

Peer wallet keys

Pa wallet keys

Peer cert request

Pa cert request

Peer cert

Pa cert

Peer root cert TP

Profile reader root cert TP

Pa root cert TP

Peer pa cert TP

Pa peer cert TP

Profile reader pa cert TP

Profile reader peer cert TP

Peer user cert

Pa user cert

Adding Clusterware entries to inittabohasd failed to start

Failed to start the Clusterware. Last 20 lines of the alert log follow:

2015-05-23 23 3715 45.460:

[client (13782)] CRS-2101:The OLR was formatted using version 3.

Reason for reporting an error:

Because RHEL 7 runs and restarts processes using systemd instead of initd, root.sh runs ohasd processes through traditional initd. Solution:

In RHEL 7, ohasd needs to be set up as a service before running the script root.sh.

The steps are as follows:

1. Create a service file as a root user

# touch / usr/lib/systemd/system/ohas.service

# chmod 777 / usr/lib/systemd/system/ohas.service

two。 Add the following to the newly created ohas.service file

[root@rac1 init.d] # cat / usr/lib/systemd/system/ohas.service

[Unit]

Description=Oracle High Availability Services

After=syslog.target

[Service]

ExecStart=/etc/init.d/init.ohasd run > / dev/null 2 > & 1 Type=simple

Restart=always

[Install]

WantedBy=multi-user.target

3. Run the following command as the root user

Systemctl daemon-reload

Systemctl enable ohas.service

Systemctl start ohas.service

4. View running status

[root@rac1 init.d] # systemctl status ohas.service

Ohas.service-Oracle High Availability Services

Loaded: loaded (/ usr/lib/systemd/system/ohas.service; enabled)

Active: failed (Result: start-limit) since Fri 2015-09-11 16:07:32 CST; 1s ago

Process: 5734 ExecStart=/etc/init.d/init.ohasd run > / dev/null 2 > & 1 Type=simple (code=exited, status=203/EXEC)

Main PID: 5734 (code=exited, status=203/EXEC)

Sep 11 16:07:32 rac1 systemd [1]: Starting Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd [1]: Started Oracle High Availability Services.

Sep 11 16:07:32 rac1 systemd [1]: ohas.service: main process exited, code=exited, status=203/EXEC

Sep 11 16:07:32 rac1 systemd [1]: Unit ohas.service entered failed state.

Sep 11 16:07:32 rac1 systemd [1]: ohas.service holdoff time over, scheduling restart.

Sep 11 16:07:32 rac1 systemd [1]: Stopping Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd [1]: Starting Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd [1]: ohas.service start request repeated too quickly, refusing to start.

Sep 11 16:07:32 rac1 systemd [1]: Failed to start Oracle High Availability Services.

Sep 11 16:07:32 rac1 systemd [1]: Unit ohas.service entered failed state.

The status is failed at this time because there is no / etc/init.d/init.ohasd file yet.

Now you can run the script root.sh without reporting any more ohasd failed to start errors. If you still sign up for ohasd

Failed to start error. It may be that ohas.service did not start immediately after root.sh script created init.ohasd. For more information on the solution, please see the following:

When running root.sh, refresh / etc/init.d until the init.ohasd file appears, and immediately manually start the ohas.service service command: systemctl start ohas.service

[root@rac1 init.d] # systemctl status ohas.service

Ohas.service-Oracle High Availability Services

Loaded: loaded (/ usr/lib/systemd/system/ohas.service; enabled)

Active: active (running) since Fri 2015-09-11 16:09:05 CST; 3s ago

Main PID: 6000 (init.ohasd)

CGroup: / system.slice/ohas.service

6000 / bin/sh / etc/init.d/init.ohasd run > / dev/null 2 > & 1 Type=simple

6026 / bin/sleep 10

Sep 11 16:09:05 rac1 systemd [1]: Starting Oracle High Availability Services...

Sep 11 16:09:05 rac1 systemd [1]: Started Oracle High Availability Services.

Sep 11 16:09:05 rac1 su [6020]: (to grid) root on none

One question after another, execute the second script again, again and again. I just want to install a RAC quietly, why so many new questions.

The error is as follows:

Failed to create disk group OCR_DATA. The returned information is as follows:

ORA-15018:diskgroup cannot be created

ORA-15020:discovered duplicate ASM disk "OCR_DATA_0000"

Um, it was later found that there was a problem with the file under / etc/udev/rules.d/. If I followed the updated one above, it would be solved.

Oh, I forgot to mention, if the first operation is not done according to the summary I recorded, please dd the ASM disk, re-fdisk, and restart the operating system

Well, anyway, if you seriously redo the operations that configure ASM, you will OK. The most important thing is that you must restart the operating system. Be sure to restart the operating system.

Be sure to restart the operating system. Say important things three times!

Ah, it's really going crazy. Because it was wrong again, why did you say it again. Because this is the last time I made a mistake.

The error is as follows:

Entries will be added to the / etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Using configuration parameter file: / home/db/u01/app/11.2.0/grid/crs/install/crsconfig_params

User ignored Prerequisites during installation

Installing Trace File Analyzer

Adding Clusterware entries to inittab

Ohasd failed to start

Failed to start the Clusterware. Last 20 lines of the alert log follow:

2019-06-13 14 14 140 30 25 080:

[client (2314)] CRS-2101:The OLR was formatted using version 3.

2019-06-13 14 14 41 00.497:

[ohasd (8133)] CRS-0715:Oracle High Availability Service has timed out waiting for init.ohasd to be started.

All right. all right. Why did the error report of ohasd solved above appear again? What's going on? Brother?

It was later found that the status was checked through this command.

Systemctl status ohas.service

● ohas.service-Oracle High Availability Services

Loaded: loaded (/ usr/lib/systemd/system/ohas.service; enabled; vendor preset: disabled)

Active: active (running) since four 2019-06-13 11:33:05 CST; 4h 18min ago

Main PID: 4195 (init.ohasd)

CGroup: / system.slice/ohas.service

├─ 4195 / bin/sh / etc/init.d/init.ohasd run > / dev/null 2 > & 1 Type=simple

└─ 13011 / bin/sleep 10

June 13 11:33:05 localhost.localdomain systemd [1]: Started Oracle High Availability Services.

I'm dizzy. Why did I become Localhost?

Checked / etc/hosts

Uh-huh, uh, geese, the original default localhost127.0.0.1 thing was not deleted, deleted, the wrong local process kill.

Then check that the new process is the hostname systemd [1], and this time the script root.sh is finally successful.

Okay, the message after the success of Node 1:

CRS-2672: Attempting to start 'ora.mdnsd' on' testdb1'

CRS-2676: Start of 'ora.mdnsd' on' testdb1' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on' test db1'

CRS-2676: Start of 'ora.gpnpd' on' testdb1' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on' testdb1'

CRS-2672: Attempting to start 'ora.gipcd' on' testdb1'

CRS-2676: Start of 'ora.cssdmonitor' on' testdb1' succeeded

CRS-2676: Start of 'ora.gipcd' on' testdb1' succeeded

CRS-2672: Attempting to start 'ora.cssd' on' testdb1'

CRS-2672: Attempting to start 'ora.diskmon' on' testdb1'

CRS-2676: Start of 'ora.diskmon' on' testdb1' succeeded

CRS-2676: Start of 'ora.cssd' on' testdb1' succeeded

ASM was successfully created and started.

Disk group OCR_VOTE was created successfully.

Clscfg:-install mode specified

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp' root'..

Operation successful.

CRS-4256: Updating the profile

Successful addition of voting disk 34a2677d79854f78bf3ce189ea1ee690.

Successfully replaced voting disk group with + OCR_VOTE.

CRS-4256: Updating the profile

CRS-4266: Voting file (s) successfully replaced

# # STATE File Universal Id File Name Disk group

1. ONLINE 34a2677d79854f78bf3ce189ea1ee690 (/ dev/asmocrdisk) [OCR_VOTE]

Located 1 voting disk (s).

CRS-2672: Attempting to start 'ora.asm' on' testdb1'

CRS-2676: Start of 'ora.asm' on' testdb1' succeeded

CRS-2672: Attempting to start 'ora.OCR_VOTE.dg' on' testdb1'

CRS-2676: Start of 'ora.OCR_VOTE.dg' on' testdb1' succeeded

Configure Oracle Grid Infrastructure for a Cluster... Succeeded

So here comes the problem. Ben happily thought that Node 2 would be equally relaxed and freehand brushwork, and the result can be imagined. I made a mistake again, why do I have to say it again?

Because the error in executing the root footer on node 2 is as follows:

Creating / etc/oratab file...

Entries will be added to the / etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Using configuration parameter file: / home/db/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

User ignored Prerequisites during installation

Installing Trace File Analyzer

OLR initialization-successful

Adding Clusterware entries to inittab

CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node testdb1, number 1, and is terminating

An active cluster was found during exclusive startup, restarting to join the cluster

Start of resource "ora.asm" failed

CRS-2800: Cannot start resource 'ora.ctssd' as it is already in the INTERMEDIATE state on server' testdb2'

CRS-4000: Command Start failed, or completed with errors.

Failed to start Oracle Grid Infrastructure stack

Failed to start ASM at / home/db/u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 1339.

/ home/db/u01/app/11.2.0/grid/perl/bin/perl-I/home/db/u01/app/11.2.0/grid/perl/lib-I/home/db/u01/app/11.2.0/grid/crs/install / home/db/u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed

Solution:

Node 1

Vi / etc/hostname

Testdb1

Hostname testdb1

Node 2

Vi / etc/hostname

Testdb2

Hostname testdb2

Restart the operating system

Execute the root.sh script again and install it successfully. Of course, if you don't feel stable enough, you can reinstall it.

Performing root user operation for Oracle 11g The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME= / home/db/u01/app/11.2.0/grid Enter the full pathname of the local bin directory: [/ usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The contents of "oraenv" have not changed. No need to overwrite.

The contents of "coraenv" have not changed. No need to overwrite.

Creating / etc/oratab file...

Entries will be added to the / etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Using configuration parameter file: / home/db/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

User ignored Prerequisites during installation

Installing Trace File Analyzer

OLR initialization-successful

Adding Clusterware entries to inittab

CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node yytsdb1, number 1, and is terminating

An active cluster was found during exclusive startup, restarting to join the cluster

Configure Oracle Grid Infrastructure for a Cluster... Succeeded

If you encounter an error in the following figure during installation:

Try ping scan ip, can ping, can ignore the error report

After installation, check that the cluster status is normal.

Crsctl stat res-t

At this point, the installation of GRID has been successfully completed.

4. Configure ASM disk

Use grid users to run asmca in a desktop graphical environment

Create a data disk group

Install RAC database (1) step 1

Install the xmanager software

Xshell

Configure the property SSH- tunnel

Reopen a xshell window

Xhost +

Su-oracle

Export DISPLAY=xxx.xxx.xxx.xxx:0.0

Log in using the ORACLE user,. / runInstaller

(2) step 2

(3) step 3

(4) step 4

(5) step 5

(6) step 6

(7) step 7

(8) step 8

(9) step 9

(10) step 10

(11) step 11

(12) step 12

(13) step 13

(14) step 14

(15) step 15

Attention! Because it is a CENTOS7.6 system, you will encounter the following error during installation:

Solution: (only need to change it at node 1, 2 nodes will synchronize automatically)

Error in invoking target 'agent nmhs' of makefile' / u01max oracleUniverse product 11.2.0Universe dbspur 1once sysmanActionsysmanAction.mk'

Solution: keep the installation process, open another terminal window, change the (MK_EMAGENT_NMECTL) in the ins_emagent.mk file to $(MK_EMAGENT_NMECTL)-lnnz11, and then click Retry during the installation process.

This addition-lnnz11 is the minus small letter l, two digits 1, you know.

(16) step 16

Use root users to execute root scripts on each node

(17) step 17

(16) step 16

Use root users to execute root scripts on each node

(17) step 17

6. Create an ORACLE instance (1) step 1

Log in using the oracle user and execute dbca

(2) step 2

Install RAC

(3) step 3

(4) step 4

(5) step 5

Note here that if you encounter the following error, follow the prompts to complete the LISTENER configuration of GRID

Xhost +

Su-grid

Export DISPLAY=xxx.xxx.xxx.xxx:0.0

Netca

All choose the next installation by default.

If there is no problem, just move on to the next step.

(6) step 6

(7) step 7

Here, in the subsequent installation process, I am used to setting a 16-bit uppercase and lowercase letter + number + special character password.

(8) step 8

(9) step 9

(10) step 10

(11) step 11

Here, in the production repository, it is generally necessary to put it under the ASM DATA directory of the data disk, and remember that Enable Archiving can be set up directly here. Check the box to automatically create an archive log directory in the DATA directory by default. Of course, you can set it up after the installation is complete.

(12) step 12

(13) step 13

(14) step 14

Here in the production environment, it is also necessary to communicate well with the developer and the application side, and what character set to use, otherwise, it will be more troublesome to reinstall it if it does not meet the requirements.

(15) step 15

(16) step 16

(17) step 17

(18) step 18

Start creating an instance

(19) step 19

It's installed.

(20) step 20

Test connection to the database installation is complete

Finally, after the installation is complete, remember to check the firewall getenforce and iptables, check snooping, scan snooping, and then connect to the database with your own tools.

To this basic installation, behind the construction of table space, build users and so on, look at the whole, I will not repeat here.

Remember to configure the configuration of ulimit-n after the installation is complete

Permanently effective (operating system needs to be rebooted after configuration)

Vi / etc/security/limits.conf

# End of file

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 10240

Oracle hard nofile 65536

Oracle soft stack 10240

Grid soft nproc 2047

Grid hard nproc 16384

Grid soft nofile 10240

Grid hard nofile 65536

Grid soft stack 10240

* soft memlock 56623104

* hard memlock 56623104

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