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

MAC Vmware Fusion+OracleLinux+Oracle11gRAC

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

Share

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

This article is dedicated to students who have just used the mac system and are learning how to install oracle rac under a virtual machine. A large number of screenshots took me a lot of time, I hope it can help you!

Environment introduction:

Host operating system: OS X 10.9.4

Virtual machine software: VMware Fusion Professional 6.0.3

Virtual machine system: Oracle Linux 5.7

Database version: Oracle 11g R2 11.2.0.3

If you also use a laptop to install a virtual machine to run Oracle, and you want to use the same network segment in your home or office wireless network, setting up host only on the virtual network card will reduce a lot of switching trouble. If you don't know what a virtual network card is, just refer to this article.

After starting the Fusion virtual machine, enter ifconfi in the terminal to view the virtual network card

Ifconfig

Vmnet1: flags=8863 mtu 1500

Ether 00:50:56:c0:00:01

Inet 172.16.228.1 netmask 0xffffff00 broadcast 172.16.228.255

Vmnet8: flags=8863 mtu 1500

Ether 00:50:56:c0:00:08

Inet 172.16.150.1 netmask 0xffffff00 broadcast 172.16.150.255

Where vmnet1 is in host only mode, and our virtual machines public IP, vip and scanip need to be set within this IP address range. The above information will not be output if you do not start the Fusion software.

Configure virtual machine resourc

More options.

Create a custom virtual machine

RAC1, RAC2 and rawdisks directories need to be created manually and have random names.

Load the iso file of the OracleLinux operating system-connect CD/DVD

Install the operating system

Add the second network card for the rac1 master

Set the network adapter and network adapter 2 to "host-only mode", that is, host only mode. Note: if your network environment does not change often, do not switch network segments, you can set the first network adapter to "bridging mode"

Start the virtual machine to install the operating system

Note: in order to quickly deploy the installation, the step of dividing the disk is omitted here.

Etho is public IP, and the virtual network card has a network segment 172.16.228.x

Eth0 customizes for privateIP,IP addresses

Disable IPv6 settings

Gateway is set to a virtual network card address, which is easy to use.

Ice city Harbin Asia/Harbin

No project is selected here, and a better method will be used later to supplement the package yum install oracle-validated required for installation

The test environment turns off the firewall

Test environment shuts down SELinux

Do not create users here, but create users later

Clone a virtual machine

Exit the CD of the current virtual machine-create a full clone

The method of cloning can greatly shorten the time to create a second virtual machine.

Clone path is RAC2

RAC2 cloning completed

Modify rac2 hostname and IP address

Since rac2 is a cloned host, the hostname and IP address need to be changed manually

Create a shared disk

Add a new hard drive to the rac1 host

Ocr_vote_disk

Ocr_vote_disk2

Ocr_vote_disk3

Data_disk1

Data_disk2

Data_disk3

Data_disk4

Arch_disk

Pre-allocation of disk space must be checked, which is one of the necessary conditions for shared disks

Create a new disk on the rac2 host

You only need to share the disk just created by the rac1 host.

Share this virtual disk with the virtual machine that created it

After the creation is completed, the host configuration of rac1 and rac2

Use the FTP tool to upload installation media to the rac1 host

Set up rac1, rac2 / etc/hosts files

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

:: 1 localhost6.localdomain6 localhost6

172.16.228.101 rac1

172.16.228.201 rac1-vip

172.16.228.102 rac2

172.16.228.202 rac2-vip

172.16.228.91 cluster-scan

172.16.228.92 cluster-scan

172.16.228.93 cluster-scan

182.168.1.101 rac1-priv

182.168.1.102 rac2-priv

Create users and groups

[root@rac1 ~] # groupadd-g 5000 asmadmin

[root@rac1 ~] # groupadd-g 5001 asmdba

[root@rac1 ~] # groupadd-g 5002 asmoper

[root@rac1 ~] # groupadd-g 6000 oinstall

[root@rac1 ~] # groupadd-g 6001 dba

[root@rac1 ~] # groupadd-g 6002 oper

[root@rac1] # useradd-g oinstall-G asmadmin,asmdba,asmoper grid

[root@rac1 ~] # echo "grid" | passwd-- stdin grid

[root@rac1] # useradd-g oinstall-G dba,asmdba oracle

[root@rac1 ~] # echo "oracle" | passwd-- stdin oracle

Create a directory

[root@rac1 ~] # mkdir / grid_base

[root@rac1 ~] # mkdir / grid_home

[root@rac1 ~] # chown grid:oinstall / grid_base

[root@rac1 ~] # chown grid:oinstall / grid_home

[root@rac1 ~] # mkdir / oracle

[root@rac1 ~] # chown oracle:oinstall / oracle

Close ntpd

[root@rac1 ~] # chkconfig ntpd off

[root@rac1 ~] # mv / etc/ntp.conf / etc/ntp.conf.bak

Mount the CD

[root@rac1 ~] # mount / dev/cdrom / mnt

Mount: block device / dev/cdrom is write-protected, mounting read-only

Various packages required to install the operating system

Note: this is more convenient than graphically installing the system dependency package.

Echo "[oel5]

Name = Enterprise Linux 5.7DVD

Baseurl= file:///mnt/Server/

Gpgcheck=0

Enabled=1 "> > / etc/yum.repos.d/public-yum-el5.repo

[root@rac1 ~] # yum install oracle-validated

Supplement the configuration of grid users

Echo "grid soft nofile 131072

Grid hard nofile 131072

Grid soft nproc 131072

Grid hard nproc 131072

Grid soft core unlimited

Grid hard core unlimited

Grid soft memlock 50000000

Grid hard hemlock 50000000 "> > / etc/security/limits.conf

Shut down rac1 and rac2 hosts

[root@rac1 ~] # init 0

[root@rac2 ~] # init 0

Remove the restriction that VMware Fusion does not support shared disks

Locate the virtual machine file rac1 under the RAC1 installation path, right-click rac1, and select "Show package contents"

Open rac1.vmx with the text tool and add the following configuration information

# shared disks configure

Disk.locking= "false"

DiskLib.dataCacheMaxSize= "0"

DiskLib.dataCacheMaxReadAheadSize= "0"

DiskLib.DataCacheMinReadAheadSize= "0"

DiskLib.dataCachePageSize= "4096"

DiskLib.maxUnsyncedWrites= "0"

Scsi0:1.deviceType= "disk"

Scsi0:1.mode = "independent-persistent"

Scsi0.sharedBus = "VIRTUAL"

Also find the rac2 file under the RAC2 path to perform the same operation

# shared disks configure

Disk.locking= "false"

DiskLib.dataCacheMaxSize= "0"

DiskLib.dataCacheMaxReadAheadSize= "0"

DiskLib.DataCacheMinReadAheadSize= "0"

DiskLib.dataCachePageSize= "4096"

DiskLib.maxUnsyncedWrites= "0"

Scsi0:1.deviceType= "disk"

Scsi0:1.mode = "independent-persistent"

Scsi0.sharedBus = "VIRTUAL"

Restart rac1, rac2

View shared disk

[root@rac1 ~] # ls-l / dev/sd*

Brw-r- 1 root disk 8, 0 Sep 11 22:52 / dev/sda

Brw-r- 1 root disk 8, 1 Sep 11 22:53 / dev/sda1

Brw-r- 1 root disk 8, 2 Sep 11 22:52 / dev/sda2

Brw-r- 1 root disk 8, 16 Sep 11 22:52 / dev/sdb

Brw-r- 1 root disk 8, 32 Sep 11 22:52 / dev/sdc

Brw-r- 1 root disk 8, 48 Sep 11 22:52 / dev/sdd

Brw-r- 1 root disk 8, 64 Sep 11 22:52 / dev/sde

Brw-r- 1 root disk 8, 80 Sep 11 22:52 / dev/sdf

Brw-r- 1 root disk 8, 96 Sep 11 22:52 / dev/sdg

Brw-r- 1 root disk 8, 112 Sep 11 22:52 / dev/sdh

Brw-r- 1 root disk 8, 128 Sep 11 22:52 / dev/sdi

Udev configuration shared disk

For i in b c d e f g h i

Do

Echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-g-u-s% p\ ", RESULT==\" `scsi_id-g-u-s / block/sd$ i`\ ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "> > / etc/udev/rules.d/99-oracle-asmdevices.rules

Done

[root@rac1 ~] # start_udev

Starting udev: [OK]

View configuration results

[root@rac1 ~] # ls-l / dev/asm*

Brw-rw---- 1 grid asmadmin 8, 16 Sep 11 23:08 / dev/asm-diskb

Brw-rw---- 1 grid asmadmin 8, 32 Sep 11 23:08 / dev/asm-diskc

Brw-rw---- 1 grid asmadmin 8, 48 Sep 11 23:08 / dev/asm-diskd

Brw-rw---- 1 grid asmadmin 8, 64 Sep 11 23:08 / dev/asm-diske

Brw-rw---- 1 grid asmadmin 8, 80 Sep 11 23:08 / dev/asm-diskf

Brw-rw---- 1 grid asmadmin 8, 96 Sep 11 23:08 / dev/asm-diskg

Brw-rw---- 1 grid asmadmin 8, 112 Sep 11 23:08 / dev/asm-diskh

Brw-rw---- 1 grid asmadmin 8, 128 Sep 11 23:08 / dev/asm-diski

Configure udev for a rac2 host

[root@rac1 ~] # scp / etc/udev/rules.d/99-oracle-asmdevices.rules rac2:/etc/udev/rules.d/99-oracle-asmdevices.rules

[root@rac2 ~] # start_udev

Starting udev: [OK]

[root@rac2 ~] # ls-l / dev/asm*

Brw-rw---- 1 grid asmadmin 8, 48 Sep 11 23:10 / dev/asm-diskb

Brw-rw---- 1 grid asmadmin 8, 32 Sep 11 23:10 / dev/asm-diskc

Brw-rw---- 1 grid asmadmin 8, 16 Sep 11 23:10 / dev/asm-diskd

Brw-rw---- 1 grid asmadmin 8, 112 Sep 11 23:10 / dev/asm-diske

Brw-rw---- 1 grid asmadmin 8, 96 Sep 11 23:10 / dev/asm-diskf

Brw-rw---- 1 grid asmadmin 8, 80 Sep 11 23:10 / dev/asm-diskg

Brw-rw---- 1 grid asmadmin 8, 64 Sep 11 23:10 / dev/asm-diskh

Brw-rw---- 1 grid asmadmin 8, 128 Sep 11 23:10 / dev/asm-diski

Configure grid user bash_pofile

[root@rac1 ~] # su-grid

[grid@rac1 ~] $vi .bash _ profile

CRS_HOME=/grid_home/11.2.0/grid

ORACLE_BASE=/grid_base

ORACLE_SID=+ASM1

Stty erase ^ h

Alias s = "sqlplus / as sysasm"

PATH=$CRS_HOME/bin:$PATH:$HOME/bin

[grid@rac1 ~] $scp .bash _ profile rac2:~/

[root@rac2 ~] # su-grid

[grid@rac2 ~] $vi .bash _ profile

CRS_HOME=/grid_home/11.2.0/grid

ORACLE_BASE=/grid_base

ORACLE_SID=+ASM2

Stty erase ^ h

Alias s = "sqlplus / as sysasm"

PATH=$CRS_HOME/bin:$PATH:$HOME/bin

Export PATH CRS_HOME ORACLE_BASE ORACLE_SID

Extract the cluster software installation package

[grid@rac1 ~] $cd / grid_base

[grid@rac1 grid_base] $mkdir 11203_grid_install

[grid@rac1 grid_base] $cd 11203_grid_install/

[grid@rac1 11203_grid_install] $unzip / tmp/p10404530_112030_Linux-x86-64_3of7.zip

Launch tool Xquartz

Xquartz does not need export DISPLAY to start a graphics installation

Connect grid users

Ssh-X grid@172.16.228.101

/ grid_base/11203_grid_install/grid/runInstaller

It is recommended to use graphical SSH mutual trust, which saves a lot of time of manual configuration.

The base directory and home directory of grid should be separated.

Task.resolv.conf Integrity errors can be ignored and do not affect installation

Execute the following script sequentially, and click ok after execution

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

[root@rac2 ~] # / grid_home/oraInventory/orainstRoot.sh

[root@rac1 ~] # / grid_home/11.2.0/grid/root.sh

[root@rac2 ~] # / grid_home/11.2.0/grid/root.sh

The following error prompts do not affect the installation

Install the ASM disk group

After entering asmca for Xquartz, the configuration is as follows

OCRVOTE:

Ocr_vote_disk

Ocr_vote_disk2

Ocr_vote_disk3

DATA:

Data_disk1

Data_disk2

Data_disk3

Data_disk4

ARCH:

Arch_disk

Set Oracle user bash_profile

[oracle@rac1 ~] $vi .bash _ profile

ORACLE_BASE=/oracle

ORACLE_HOME=/oracle/product/11.2.0/dbhome_1

ORACLE_SID=PROD1

PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH:$HOME/bin

Export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID

[oracle@rac2 ~] $vi .bash _ profile

ORACLE_BASE=/oracle

ORACLE_HOME=/oracle/product/11.2.0/dbhome_1

ORACLE_SID=PROD2

PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH:$HOME/bin

Export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID

Su-oracle

Cd / oracle

Mkdir 11203_db_install

Cd 11203_db_install

Unzip / tmp/p10404530_112030_Linux-x86-64_1of7.zip

Unzip / tmp/p10404530_112030_Linux-x86-64_2of7.zip

Install database software

Reopen XQuartz and use the oracle user connection

Ssh-X oracle@172.16.228.101

/ oracle/11203_db_install/database/runInstaller

SSH mutual trust installation is recommended, eliminating the process of manual configuration.

The verification error here can be ignored and does not affect the installation

Follow the prompts to execute the script

[root@rac1 ~] # / oracle/product/11.2.0/dbhome_1/root.sh

[root@rac2 ~] # / oracle/product/11.2.0/dbhome_1/root.sh

Create a database

Cluster database

Database installed successfully!

SQL > select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,THREAD# from gv$instance

INST_ID INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS THREAD#

--

1 1 PROD1 rac1 OPEN 1

2 2 PROD2 rac2 OPEN 2

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