In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How Oracle RAC works:
For a single-node database, if the instance goes down, if a business link is on the instance, then the business will be interrupted. At this time, the system does not have availability, so the availability of a single node is very poor at this time.
For RAC, it is the same as a single instance, it is still a data file, it is the same storage with the oracle file on it, but the same data file is shared by three instances. The advantage of this is that there is redundancy between the three instances. If any two of the above three instances fail, the business can be linked to the remaining one, and all will work properly. RAC provides redundancy at the instance level.
RAC cannot solve the problem of data security, although there are multiple instances, there is only one data file, so as long as the data file is corrupted, then the entire database is corrupted.
What is RAC?
Generally, each instance is placed on a different server, which can play a redundant role. All database files are placed on shared storage, but some files are placed on each instance's own local disk, such as parameter files, and each instance can have its own parameter file. this parameter file can be placed locally or on shared storage, and multiple instances use the same parameter file.
In RAC, the most important thing is the interaction between instances and instances. Even if it is a separate instance, the data read is the same. RAC is not a distributed system, because it has only one storage. Distributed system means that the data is published on different databases, and then the query is coordinated by middleware. RAC is also a database, multiple instances.
RAC architecture:
There are at least two physically different networks for RAC, and private networks are dedicated to data exchange between instances. If the private network, all the data is under the same network, then it will affect the data and seriously affect the performance of RAC. There is a physical separation between the networks provided by VPC and external services for data transfer between instances. Therefore, RAC has at least two networks, one is the data transmission between instances, the other is the public network, which provides external services, and the external business provides the IP of the public network to link to the database.
RAC features:
How does RAC tolerate faults?
Using SAN storage, storage and server are not together, but separated from the server, is a network storage system, the server is the server, storage is storage, completely separate.
When node 1 is broken, not only the business is switched to node 2, but also the problems left over from node 1 are dealt with. Mainly committed and uncommitted transactions. For example, if instance 1 is broken, instance 2 should read the information after the last checkpoint from the redo of instance 1, that is, all the redo applications generated after instance 1 finally writes all the data to disk, the rollback of the rollback and the recovery of the recovery. That is, the redo generated by both committed and uncommitted transactions will be applied first, because it is the information after the last checkpoint, and the previous information has been written to the disk. The so-called recovery is to recover the information that has not been written to the disk. (although the instance is broken, the redo of the instance is not bad, and its redo is still accessible to other instances when it is placed on shared storage.) instance 2 reads the redo of instance 1, then applies it all over again, and then rolls back the uncommitted transaction modified data blocks, which is a bit like instance recovery.
Actual combat part:
Construction background:
The purpose of this document is to sort out the process of 12c RAC graphical installation in detail, to explain the principles of various operations in the installation process as far as possible, to provide different storage configuration methods and parameter modification methods, and finally to form a complete set of 12c RAC graphical installation steps for future reference.
Installation process:
I. Software download
Http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html
Just download linuxx64_12201_database.zip and linuxx64_12201_grid_home.zip and upload them to any directory in Node 1.
II. Hardware and network environment
Check memory (at least 8GB), Swap, hard disk size, etc., and refer to Server Hardware Checklist for Oracle Database Installation in the installation documentation of GRID's official website.
What needs to be explained is the installation of 12c RAC, and the OCR disk needs to be at least 40GB size, because 12c has added MGMTDB instances for cluster management. If you do not create a disk group for him separately, this information will enter the OCR disk. As a result, the OCR disk needs 40GB space, in which OCR and votefiles need about 2GB 38GB, and if the number of RAC nodes is greater than 2, then you need to add more MGMT space. For example, the 5 nodes need to add more MGMT space. Of course, the values here are calculated under the condition of external redundancy.
To check the operating system version, refer to Operating System Checklist for Oracle Database Installation on Linux in the installation document of GRID's official website.
The system environment of this paper is Oracle Enterprise Linux 6.9.
Tmpfs must ensure that it is at least half of the maximum memory.
If you need a larger SGA, at least set tmpfs to a value greater than SGA, because the shared memory consumed by Oracle on OEL systems cannot be greater than tmpfs.
Check the network environment.
Seven IP need to be applied for, including two as Public IP,2 and two as VIP,1 Scan-IP. These five IP should be of the same network segment, and finally two different network segments of Private IP are required. Although the private network IP can be customized, when it is not clear whether the private network is directly connected through the public network or through a separate switch (in fact, oracle requires that the interconnect of private ip use a separate switch and the bandwidth should be at least GB level). It is best to apply for an independent private network IP. Each node needs at least 2 network cards, one for Public IP and one for Private.
* the editor of the installation environment uses shared storage of a piece of 2TB. After formatting with oracleasm, scan instance 1 on two instances and scan instance 2 after formatting.
Third, install the software package
1 、 oracleasm
The disk used to configure asm. If you put the oracle data file on a regular disk, skip it.
Wget http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
Wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
Yum install-y kmod-oracleasm
Rpm-ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm oracleasm-support-2.1.11-2.el7.x86_64.rpm
Configure the ASM properties:
Oracleasm configure-I
Default user to own the driver interface []: grid
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (yzone) [n]: y
Scan for Oracle ASM disks on boot (yzone) [y]: y
Writing Oracle ASM library driver configuration: done
Create Partition
Note: you can restart the server before doing the following steps to make the previous settings take effect. After restarting here, problems may occur in the creation of oracleasm createdisk myasm01 / dev/sdb1 that can be solved by oracleasm init. Remember that if you do not restart, oracleasm sometimes will not take effect.
Reboot # restart
Fdisk-l # View disk
# partition / dev/sdb1,/dev/sdc1, / dev/sdd1
Fdisk / dev/sdb
Oracleasm createdisk myasm01 / dev/sdb1
Oracleasm createdisk myasm02 / dev/sdc1
Oracleasm createdisk myasm03 / dev/sdd1
Oracleasm scandisks
Oracleasm listdisks
# editor, only one disk is used here, so remember that the path of oracleam disk will be used later.
Deployment officially begins:
Basic package installation
Oracle-database-server-12cR2-preinstall won't pack these bags for you either, so this step must be done by hand.
Yum-y install binutils.x86_64 compat-libcap1.x86_64 compat-libstdc* e2fsprogs.x86_64 libaio* libXau* libXi* libXtst* libstdc* glibc* libgcc* ksh gcc-c++*
-- the above command is my own simplified installation statement. Generally speaking, it is enough to execute the above installation, and it is okay to install grid. If there is a missing Detail when installing Detail, it is good to install it again according to the error report.
-- A complete list of packages required for different Linux versions can be found in section 4.7 of the official GI installation documentation-- Operating System Requirements for x86-64 LinuxPlatforms.
Vi / etc/sysctl.conf
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 10485760
Kernel.shmmax = 42949672960
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
Time synchronization Settings
You can refer to the documentation related to configuring ntp online, or you can set the time manually. During the installation process, the time of the two instances is the same, which can be ignored in the later installation.
Disable firewall and selinux
Since a large number of UDP ports are used for data exchange in the private network, the official website requires that the firewall be turned off for RAC, so:
Other pre-installation requirements I think are no longer needed, if there are higher performance requirements, you can check the official documentation for more detailed settings, but in line with the principle of simple installation and simple management, that's it! Systemctl stop firewalld; Selinux: vim / sysconfig/selinux is available for CentOS7 version
Users, groups, and directories
Groupadd-g 501 oinstall
Groupadd-g 502 dbagroupadd-g 503 asmadmingroupadd-g 504 asmdbagroupadd-g 505 asmopergroupadd-g 506 operuseradd-u 501-g oinstall-G asmadmin,asmdba,asmoper,dba griduseradd-u 502-g oinstall-G dba,asmdba,oper oracle
Mkdir-p / u01/app/oracle/product/12.2.0/db_1mkdir-p / u01/app/gridmkdir-p / u01/12.2.0/gridmkdir-p / u01/app/oraInventorychown-R oracle.oinstall / u01/app/oracle/chown-R oracle.oinstall / u01/app/oracle/*chown-R grid.oinstall / u01/app/grid/chown-R grid.oinstall / u01/app/oraInventory/chown-R grid.oinstall / u01/12.2.0/grid/
After giving permission, set the password to the grid&oracle user: passwd grid passwd oracle; password customization
-- modify user security restrictions:
If you don't use oracle-database-server-12cR2-preinstall, just copy the following into the / etc/security/limits.conf file
If you are using oracle-database-server-12cR2-preinstall, just copy the following to / etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf (clear the previous content)
Just fill in vim / etc/security/limits.conf
Oracle soft nofile 2048oracle hard nofile 65536oracle soft nproc 16384oracle hard nproc 16384oracle soft stack 10240oracle hard stack 32768oracle hard memlock 134217728
Oracle soft memlock 134217728
Grid soft nofile 2048grid hard nofile 65536grid soft nproc 16384grid hard nproc 16384grid soft stack 10240grid hard stack 32768grid hard memlock 134217728grid soft memlock 134217728
Session required pam_limits.so
Su-grid
Vi .bash _ profileexport ORACLE_BASE=/u01/app/gridexport ORACLE_HOME=/u01/12.2.0/gridexport ORACLE_SID=+ASM1/+ASM2export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
Su-oracle
Vi .bash _ profile
Export ORACLE_BASE=/u01/app/oracle
Export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
Export ORACLE_SID=orcl1/orcl2
Export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
You can put your two compressed packages in the directory you just created, linuxx64_12201_database.zip / home/oracle; linuxx64_12201_grid_home.zip / u01ax 12.2.0; and then give relevant permissions.
# chown oracle.oinstall linuxx64_12201_database.zip
# chown oracle.oinstall linuxx64_12201_grid_home.zip # it's not in the above picture, but it's all given in advance. You have to give it back when you decompress it later. Just remember to go to the relevant directory and give it directly.
# su-oracle$ unzip linuxx64_12201_database.zip$ cd database/sshsetup/$. / sshUserSetup.sh-user oracle-hosts "node1 node2"-advanced-noPromptPassphrase # own hostname, editor is rac-1&rac-2
$. / sshUserSetup.sh-user grid-hosts "node1 node2"-advanced-noPromptPassphrase
-- finally, use both oracle and grid users on node 1 to verify mutual trust:
$ssh node2 date # the host name here is rac-1, so ssh rac-1 date is fine.
$ssh node2-priv date
VI. GRID installation
Here is a small pit, the 12c GRID installation will no longer use the $ORACLE_HOME variable of the grid user you set as the GI home directory, but directly use the unzipped directory of your GRID software as the home directory.
Of course, this small pit may also lead to another big pit. When you try to install grid many times, you will find that the bound disk cannot be found even if the dd is formatted and cannot be found when installing grid. At this point, just delete the unzipped grid directory and unzip the installation again. (MMP 12c, and bullshit like PDB, who told you to lift 12c from 11g to your legs directly.)
You need to copy the linuxx64_12201_grid_home.zip to the grid user's $ORACLE_HOME, which is / u01/12.2.0/grid in this article, and then:
# chown grid.oinstall linuxx64_12201_grid_home.zip# su-grid$ unzip linuxx64_12201_grid_home.zip
# cp / home/oracle/database/rpm/cvuqdisk-1.0.10-1.rpm / root# rpm-ivh cvuqdisk-1.0.10-1.rpm
# cd / u01/12.2.0/grid/
#. / gridSetup.sh # problems may occur during execution
The faults are as follows:
[grid@lsl crs] $. / gridSetup.sh ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.Can't connect to X11 window server using '10.138.135.167 as the value of the DISPLAY variable.
Solution:
[root@lsl Desktop] # xdpyinfo # switch under the root directory; name of display:: 1version number: 11.0vendor string: The X.Org Foundationvendor release number: 11500000. Omit. Just record the value of name of display: [root@lsl] $export DISPLAY=:1 (then set to the value of name of display: 1) # look at the value of xdpyinfo here, the editor is export DISPLAY=:0; [root@lsl] # xhost + access control disabled, clients can connect from any host [root@jytest3 Desktop] # su-gridLast login: Tue Mar 7 17:50:40 CST 2017 on pts/0; su-grid cd / u01/12.2.0/grid. / gridSetup.sh
Note: the name of scan needs to be the same as the name of scan in / etc/hosts, otherwise an error will occur.
Note: the host name and virtual host name here need to be the same as the name of / etc/hosts
Note: when executing remote, do not have files from the installation directory of the service (instance 2&rac-2). If there is a prompt for remote failure, you need to clear the files in the files.
Note: here the editor suggests that you save yourself to execute the script directly on √.
Note: successful execution here will display the host names of all nodes (rac-1 rac-2); if there is no need to check the shared storage
Note: if you follow the editor's method of √ to execute by yourself, the following file will not appear. Note that the script is executed on example 1 (rac-1) first. / oracle/app/oraInventory/orainstROOt.sh
Then execute / oracle/app/oraInventory/orainstROOt.sh; on instance 2 (rac-2) and then execute instance 1 (rac-1) / data/grid/root.sh instance 2 (rac-2).
Be careful! Here, there are generally no problems in the execution of the script in example 1 (rac-1) and in instance 2 (rac-2). The problems are summarized as follows.
Basically, this problem is the problem of oracleasm permissions. You need to give the corresponding permissions, and you need to compare them. If different, you can modify them.
The modification method is as follows: chown grid.asmadmin MYASM01 chmod 642MYASM01
Note: 90% of the execution process will prompt that the error can be ignored directly.
Echo "oracle soft memlock 3145728" > > / etc/security/limits.conf
Echo "oracle hard memlock 3145728" > > / etc/security/limits.conf
At this point, partners who like to continue to install after the editor's installation is over can download pdf from my Baidu cloud disk.
Https://pan.baidu.com/s/1AiDlKVz77-mhpkHpf9F2OA extraction code 9s5z
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.