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 > Database >
Share
Shulou(Shulou.com)06/01 Report--
Install oracle RAC on virtual machine
The premise of Oracle rac installation is that there must be a shared memory. Only oracle instances are installed on both computers, the database is created on shared storage, and both instances can access the database. Therefore, since there is no storage device, a virtual machine is used to virtualize several hard disks as shared storage.
The environment is as follows:
Linux operating system: Oracle Linux Server release 6.4
VMware version:Workstation 10 build-703057
Oracle version: 11G R2 oracle 64-bit 11.2.0.1.0 for linux
The installation package is as follows:
Linux: V37084-01.iso (download from oracle official website)
Oracle: linux.x64_11gR2_database_1of2.zip (downloaded from oracle's official website)
Linux.x64_11gR2_database_2of2.zip (download from oracle official website)
Oracleasmlib-2.0.12-1.el6.x86_64.rpm (downloaded from oracle's official website)
Note: ASM is used by oracle to manage disks in shared storage. Download address is provided in the following document.
Linux.x64_11gR2_grid.zip (download from oracle official website)
Note: grid is an oracle clustering tool
Step planning:
1. Install Linux operating system and configure virtual machine shared disk
2. Configure system-related network and user-related information
3, configure ASM
4, install Oracle grid
5. Install Oracle database
6, create an ASM disk group
7. Create a database instance
1. Configure virtual machine and install Linux operating system
1.1 create new virtual machines: NEWSDB01 and NEWSDB02, and install the system
Download the iso of Oracle Linux Server release 6.4. create a new virtual machine and install it. Pay attention to memory allocation, each virtual machine at least 2G memory is better, assign each virtual machine 50GB hard disk capacity, configure 2 bridge network cards. (one of the network cards is used for the host to communicate with the outside world, and the other is used for the heartbeat of two hosts. There is also "bridging" is that the ip segment of the virtual machine and the computer are in the same segment, so that the computers in the entire local area network can access the virtual machine, and the virtual machine needs to be manually set up ip. )
1.2 configure Share Disks
Create a new shared hard disk and execute it when DOS changes to the VM installation directory: pay attention to the F disk. If there is no F disk, you have to change the path behind it.
Start-- run-- CMD enter DOS
Cd F:/Software/vm10/ (that is, the installation path of your vm)
Vmware-vdiskmanager.exe-c-s 1000Mb-a lsilogic-t 2 F:\ VMDisk\ Sharedisk\ ocr.vmdk
Vmware-vdiskmanager.exe-c-s 1000Mb-a lsilogic-t 2 F:\ VMDisk\ Sharedisk\ ocr2.vmdk
Vmware-vdiskmanager.exe-c-s 1000Mb-a lsilogic-t 2 F:\ VMDisk\ Sharedisk\ votingdisk.vmdk
Vmware-vdiskmanager.exe-c-s 20000Mb-a lsilogic-t 2 F:\ VMDisk\ Sharedisk\ data.vmdk
Vmware-vdiskmanager.exe-c-s 10000Mb-a lsilogic-t 2 F:\ VMDisk\ Sharedisk\ backup.vmdk
Configure the vmx virtual machine configuration file under the virtual machine newsdb01 newsdb02 directory and add the following at the end of the line:
Scsi1.present = "TRUE"
Scsi1.virtualDev = "lsilogic"
Scsi1.sharedBus = "virtual"
Scsi1:1.present = "TRUE"
Scsi1:1.mode = "independent-persistent"
Scsi1:1.filename = "F:\ VMDisk\ Sharedisk\ ocr.vmdk"
Scsi1:1.deviceType = "plainDisk"
Scsi1:2.present = "TRUE"
Scsi1:2.mode = "independent-persistent"
Scsi1:2.filename = "F:\ VMDisk\ Sharedisk\ votingdisk.vmdk"
Scsi1:2.deviceType = "plainDisk"
Scsi1:3.present = "TRUE"
Scsi1:3.mode = "independent-persistent"
Scsi1:3.filename = "F:\ VMDisk\ Sharedisk\ data.vmdk"
Scsi1:3.deviceType = "plainDisk"
Scsi1:4.present = "TRUE"
Scsi1:4.mode = "independent-persistent"
Scsi1:4.filename = "F:\ VMDisk\ Sharedisk\ backup.vmdk"
Scsi1:4.deviceType = "plainDisk"
Scsi1:5.present = "TRUE"
Scsi1:5.mode = "independent-persistent"
Scsi1:5.filename = "F:\ VMDisk\ Sharedisk\ ocr2.vmdk"
Scsi1:5.deviceType = "plainDisk"
Disk.locking = "false"
DiskLib.dataCacheMaxSize = "0"
DiskLib.dataCacheMaxReadAheadSize = "0"
DiskLib.DataCacheMinReadAheadSize = "0"
DiskLib.dataCachePageSize = "4096"
DiskLib.maxUnsyncedWrites = "0"
Save exit.
Remind you to pay attention to memory, hard disk and network card configuration again.
Configure the virtual machine and install the Linux operating system.
2, configure OS
This color needs to be configured on both nodes and needs to be performed on both nodes at the same time.
2.1 turn off the firewall and selinux (this step is required considering that some situations will be encountered during later installation)
Close selinux
Setenforce 0
[root@newsdb01 ~] # vim / etc/selinux/config
SELINUX=disabled
Turn off the firewall
Service iptables stop
Chkconfig iptables off
2.2 configure the network
Host file, both nodes are configured
Vim / etc/hosts
192.168.0.5 newsdb01
192.168.0.6 newsdb02
192.168.0.7 newsdb01-vip
192.168.0.8 newsdb02-vip
10.10.10.10 newsdb01-priv
10.10.10.11 newsdb02-priv
192.168.0.100 scan-ip
Save exit.
After configuration, ping each other to see if they are connected.
2.3 stop NTP service and delete configuration
Service ntpd stop
Chkconfig ntpd off
Rm-rf / etc/ntpd.conf
Rm-rf / var/run/ntpd.pid
Configure SSH interworking
That is, two servers do not need a password for direct SSH access: for example, ssh newsdb02 connects directly to the newsdb02. Versions prior to oracle 11g R2 need to be manually configured, but not in oracle 11g R2.
Note:
Configuration steps are provided during grid installation, so there is no need for manual configuration.
When installing grid and oracle, you need to create SSH interworking. The main purpose of this step is to make the access between the two hosts do not need to enter a password, the installation of grid and oracle only need to run on one machine, because the installation program will automatically copy the data of node1 to node2.
2.4 configure Oracle software installation users, groups, environment variables, installation directories
# Group
Groupadd-g 1300 dba
Groupadd-g 1301 oper
Groupadd-g 1000 oinstall
Groupadd-g 1200 asmadmin
Groupadd-g 1201 asmdba
Groupadd-g 1202 asmoper
# user
Useradd-m-u 1100-g oinstall-G asmadmin,asmdba,asmoper-s / bin/bash grid
Useradd-m-u 1101-g oinstall-G dba,oper,asmdba-s / bin/bash oracle
# modify the user environment variable under home
Vim .bash _ profile
ORACLE user
Export TMP=/tmp
Export TMPDIR=$TMP
Export ORACLE_SID=netdb1 # newsdb01 (Node 1)
Export ORACLE_SID=netdb2 # newsdb02 (Node 2)
Export ORACLE_BASE=/u01/app/oracle
Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
Export TNS_ADMIN=$ORACLE_HOME/network/admin
Export PATH=/usr/sbin:$PATH
Export PATH=$ORACLE_HOME/bin:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Umask 022
GRID user
Export TMP=/tmp
Export TMPDIR=$TMP
Export ORACLE_SID=+ASM1 # newsdb01 (Node 1)
Export ORACLE_SID=+ASM2 # newsdb02 (Node 2)
Export ORACLE_BASE=/u01/app/grid
Export ORACLE_HOME=/u01/app/11.2.0/grid
Export PATH=/usr/sbin:$PATH
Export PATH=$ORACLE_HOME/bin:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Umask 022
Configuration directory
Mkdir-p / u01/app/11.2.0/grid
Mkdir-p / u01/app/grid
Mkdir-p / u01/app/oracle
Chown grid:oinstall / u01/app/11.2.0/grid
Chown grid:oinstall / u01/app/grid
Chown oracle:oinstall / u01/app/oracle
Chmod-R 775 / u01 /
Chown-R grid:oinstall / U01
2.5 configure system files
Configure shell restrictions for oracle and grid users
Vim / etc/security/limits.conf
Add
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 configuration file
Vim / etc/pam.d/login
Add session required pam_limits.so
Modify kernel configuration file / etc/sysctl.conf
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 1054472192
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
Net.ipv4.tcp_wmem = 262144 262144 262144
Net.ipv4.tcp_rmem = 4194304 4194304 4194304
Execution of sysctl-p takes effect immediately after saving and exiting.
2.6 configure shared disk (since it is shared storage, it can be executed on one node. There will be another node naturally)
View partition
Ls / dev/sd*
Use fdisk for zoning, and other districts can be divided according to their own plans, for example:
Fdisk / dev/sdb
[root@newsdb01 ~] # fdisk / dev/sdb
Command (m for help): n
Command action
E extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-1000, default 1):
Using default value 1
Last cylinder, + cylinders or + size {KMagne Mpeng} (1-1000, default 1000): + 500m
Command (m for help): n
Command action
E extended
P primary partition (1-4)
P
Partition number (1-4): 2
First cylinder (502-1000, default 502):
Using default value 502
Last cylinder, + cylinders or + size {KJM Magi G} (502-1000, default 1000):
Using default value 1000
Command (m for help): W
The partition table has been altered!
View the partition after the final configuration
Fidks-l
[root@newsdb01 ~] # ls / dev/sd* (there should be 7 partitions corresponding to the following)
/ dev/sda / dev/sda1 / dev/sda2 / dev/sdb / dev/sdb1 / dev/sdc / dev/sdc1 / dev/sdd / dev/sdd1 / dev/sdd2 / dev/sde / dev/sde1 / dev/sde2 / dev/sdf / dev/sdf1
Install the required packages such as Oracle grid (this package will indicate which packages are not installed when checking the installation environment, and install them again if you confirm that they have been installed. If you confirm that you have installed them, you will be prompted that they are not installed because the version you installed may not be consistent with the system requirements. These packages are found in the system disk. You can mount the system disk to the file system
Mount / dev/cdrom / mnt/
Cd / mnt/Packages)
These bags are on the system disk. You can mount the system disk on the
Rpm-ivh libgcc-4.4.7-3.el6.i686.rpm
Rpm-ivh libgcc-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libstdc++-4.4.7-3.el6.i686.rpm
Rpm-ivh libstdc++-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libstdc++-devel-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libaio-0.3.107-10.el6.x86_64.rpm
Rpm-ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
Rpm-ivh make-3.81-20.el6.x86_64.rpm
Rpm-ivh sysstat-9.0.4-20.el6.x86_64.rpm
Rpm-ivh ksh-20100621-19.el6.x86_64.rpm
Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
Rpm-ivh gcc-4.4.7-3.el6.x86_64.rpm
Rpm-ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
Rpm-ivh binutils-2.20.51.0.2-5.36.el6.x86_64.rpm
Rpm-ivh compat-libcap1-1.10-1.x86_64.rpm
Rpm-ivh binutils-2.20.51.0.2-5.36.el6.x86_64.rpm
Rpm-ivh binutils-2.20.51.0.2-5.36.el6.x86_64.rpm
Rpm-ivh libaio-0.3.107-10.el6.x86_64.rpm
Rpm-ivh glibc-2.12-1.107.el6.x86_64.rpm
Rpm-ivh glibc-2.12-1.107.el6.i686.rpm
Rpm-ivh glibc-2.12-1.107.el6.x86_64.rpm
Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
Rpm-ivh elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
Rpm-ivh gcc-c++-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
Rpm-ivh libgcc-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libstdc++-4.4.7-3.el6.x86_64.rpm
Rpm-ivh libaio-0.3.107-10.el6.i686.rpm
Rpm-ivh glibc-2.12-1.107.el6.x86_64.rpm
Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
Rpm-ivh libaio-devel-0.3.107-10.el6.i686.rpm
Rpm-ivh libgcc-4.4.7-3.el6.i686.rpm
Rpm-ivh libstdc++-4.4.7-3.el6.x86_64.rpm
Rpm-ivh unixODBC-2.2.14-12.el6_3.x86_64.rpm
Rpm-ivh unixODBC-devel-2.2.14-12.el6_3.x86_64.rpm
Yum-y install pdksh
3, configure ASM
3.1 check the corresponding download of the operating system kernel version
Uname-a
Download oracleasm
Http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html
Installation
Yum-y install kmod-oracleasm.x86_64
Rpm-ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm (downloaded from the official website)
Rpm-ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm (available on CD)
3.2 configure ASM disk
Execute on two nodes
[root@newsdb01 oracle] # / etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
Driver. The following questions will determine whether the driver is
Loaded on boot and what permissions it will have. The current values
Will be shown in brackets ('[]'). Hitting without typing an
Answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmdba
Start Oracle ASM library driver on boot (yzone) [n]: y
Scan for Oracle ASM disks on boot (yzone) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [OK]
Scanning the system for Oracle ASMLib disks: [OK]
Create and scan ASM disks (only need to be created on one node, scandisks directly on the other node)
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL1 / dev/sdb1
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL2 / dev/sdc1
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL3 / dev/sdd1
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL4 / dev/sdd2
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL5 / dev/sde1
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL6 / dev/sde2
[root@newsdb01 oracle] # / etc/init.d/oracleasm createdisk VOL7 / dev/sdf1
[root@newsdb01 oracle] # / etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [OK]
[root@newsdb01 ~] # / etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6
VOL7
4, install Oracle grid
Transfer the grid installation package to the server.
4.1 copy the grid package to the / U01 directory of server node 1 and extract it, unzip linux.x64_11gR2_grid.zip
Execute xhost + under root
Su-grid
Export DISPLAY=:0.0
Export LANG=en_US.UTF-8
Enter the unzipped directory to execute
. / runinstaller opens the installation image interface and starts the installation.
After the installation is complete, two shell files are generated, each of which is executed on the two nodes.
Execute if there is an error
Execute / u01/app/11.2.0/grid/crs/install/roothas.pl-deconfig-force-verbose first
Then execute / bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 simultaneously with root.sh
5. Install Oracle database software
Need to be installed with oracle user
Execute xhost + under root
Su-oracle
Export DISPLAY=:0.0
Export LANG=en_US.UTF-8
. / runInstaller
Just install the database software, just install it according to the prompts of the graphical interface, and finally follow the prompts to execute the relevant script.
6, create an ASM disk group
Additional disk groups need to be created to install data files, etc.
Su-grid
Asmca
Follow the interface prompts to create a disk group.
7. Create a database instance
Su-oracle
. / runInstaller
According to the graphical interface steps, you can select the rac option to create a new database instance.
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.