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

[RAC] Virtual machine linux7.0 + oracle12cr2 RAC + asm installation

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

Share

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

1. Host name planning

Vps+3nZEm+sFS5WD4dGxwiwvZtf6bREdK/xxAZgDogXmgGiBOeARA6ZwOS08YsAShUcsbhy8d8Pt2CV2td8W8bG6Qf8HdZh7RPvzWmsAAAAASUVORK5CYII= ">

2.OS installation (skip the specific process)

Swap rule: memory 8 GB, 16 GB physical memory half

3.OS preparation work

(1)。 Turn off the firewall

Systemctl status firewalld View Firewall status

Systemctl stop firewalld, turn off the firewall

Disable Firewall in systemctl disable firewalld

(2)。 Close selinux

Getenforce looks at the mode of selinux

Modify / etc/selinux/config file, SELINUX=enforce-> disable

# setenforce 0 configuration takes effect

(3)。 Set up FTP

Check getsebool-a | grep ftp

Modify permissions

Setsebool ftpd_use_nfs on

Setsebool ftp_home_dir on

Setsebool ftpd_full_access on

Setsebool ftpd_use_passive_mode on

Allow root to log in to FTP

Comment out the root line in ftpusers and user_list

Restart the service systemctl restart vsftpd.service

(4)。 Configure yum

Delete rm / etc/yum.repos.d/packagekit-media.repo

Create a local.repo file

[test]

Name=test

Baseurl= "file:///run/media/root/RHEL-7.0 Server.x86_64"

Gpgcheck=0

Enable=1

# yum clean all

# yum list

(5)。 Patch according to official documents

The following packages (or later versions) must be installed:

Binutils-2.23.52.0.1-12.el7 (x86 / 64)

Compat-libcap1-1.10-3.el7 (x86x64)

Compat-libstdc++-33-3.2.3-71.el7 (i686)

Compat-libstdc++-33-3.2.3-71.el7 (x86x64)

Glibc-2.17-36.el7 (i686)

Glibc-2.17-36.el7 (x86 / 64)

Glibc-devel-2.17-36.el7 (i686)

Glibc-devel-2.17-36.el7 (x86 / 64)

Ksh

Libaio-0.3.109-9.el7 (i686)

Libaio-0.3.109-9.el7 (x86 / 64)

Libaio-devel-0.3.109-9.el7 (i686)

Libaio-devel-0.3.109-9.el7 (x86 / 64)

Libgcc-4.8.2-3.el7 (i686)

Libgcc-4.8.2-3.el7 (x86 / 64)

Libstdc++-4.8.2-3.el7 (i686)

Libstdc++-4.8.2-3.el7 (x86 / 64)

Libstdc++-devel-4.8.2-3.el7 (i686)

Libstdc++-devel-4.8.2-3.el7 (x86 / 64)

Libxcb-1.9-5.el7 (i686)

Libxcb-1.9-5.el7 (x86 / 64)

LibX11-1.6.0-2.1.el7 (i686)

LibX11-1.6.0-2.1.el7 (x86x64)

LibXau-1.0.8-2.1.el7 (i686)

LibXau-1.0.8-2.1.el7 (x86 / 64)

LibXi-1.7.2-1.el7 (i686)

LibXi-1.7.2-1.el7 (x86 / 64)

LibXtst-1.2.2-1.el7 (i686)

LibXtst-1.2.2-1.el7 (x86 / 64)

Make-3.82-19.el7 (x86 / 64)

Net-tools-2.0-0.17.20131004git.el7 (x86 / 64) (for Oracle RAC and Oracle Clusterware)

Nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)

Smartmontools-6.2-4.el7 (x86 / 64)

Sysstat-10.1.5-1.el7 (x86 / 64)

Yum install binutils-y

Yum install compat-libcap1.x86_64-y

Yum install glibc.i686-y

Yum install glibc.x86_64-y

Yum install glibc-devel.i686-y

Yum install glibc-devel.x86_64-y

Yum install libaio.i686-y

Yum install libaio.x86_64-y

Yum install libaio-devel.i686-y

Yum install libaio-devel.x86_64-y

Yum install libX11.i686-y

Yum install libX11.x86_64-y

Yum install libXau.i686-y

Yum install libXau.x86_64-y

Yum install libXi.x86_64-y

Yum install libXi.i686-y

Yum install libXtst.i686-y

Yum install libXtst.x86_64-y

Yum install libgcc.i686-y

Yum install libgcc.x86_64-y

Yum install libstdc++.i686-y

Yum install libstdc++.x86_64-y

Yum install libstdc++-devel.i686-y

Yum install libstdc++-devel.x86_64-y

Yum install libxcb.i686-y

Yum install libxcb.x86_64-y

Yum install make.x86_64-y

Yum install net-tools.x86_64-y

Yum install smartmontools.x86_64-y

Yum install sysstat.x86_64-y

Yum install ksh.x86_64-y

(6)。 Modify the hosts file

# public ip

Xxx.xxx.xxx.xxx rac1

Xxx.xxx.xxx.xxx rac2

# priv ip

Xxx.xxx.xxx.xxx rac1-priv

Xxx.xxx.xxx.xxx rac2-priv

# vip ip

Xxx.xxx.xxx.xxx rac1-vip

Xxx.xxx.xxx.xxx rac2-vip

# scan ip

Xxx.xxx.xxx.xxx rac-scan

(7)。 Add groups and users

Groupadd-g 60001 oinstall

Groupadd-g 60002 dba

Groupadd-g 60003 oper

Groupadd-g 60004 backupdba

Groupadd-g 60005 dgdba

Groupadd-g 60006 kmdba

Groupadd-g 60007 asmdba

Groupadd-g 60008 asmoper

Groupadd-g 60009 asmadmin

Useradd-u 61001-g oinstall-G asmadmin,asmdba,dba,asmoper grid

Useradd-u 61002-g oinstall-G dba,backupdba,oper,dgdba,kmdba,asmdba,asmadmin oracle

(8)。 Create a software installation directory

Mkdir-p / oracle/app/grid

Mkdir-p / oracle/app/12.2.0.1/grid

Chown-R grid:oinstall / oracle

Mkdir-p / oracle/app/oraInventory

Chown-R grid:oinstall / oracle/app/oraInventory

Mkdir-p/oracle / app/oracle

Chown-R oracle:oinstall / oracle/app/oracle

Chmod-R 775 / oracle

(9). Vi / etc/security/limits.conf

# ORACLE SETTING

Grid soft nproc 2047

Grid hard nproc 16384

Grid soft nofile 1024

Grid hard nofile 65536

Grid soft stack 10240

Grid hard stack 32768

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Oracle soft stack 10240

Oracle hard stack 32768

(10). / etc/security/limits.d/20-nproc.conf

Note * soft nproc 4096

Add *-nproc 16384

(11). / etc/pam.d/login

Add

# ORACLE SETTING

Session required pam_limits.so

(12)。 Modify kernel parameters

# vi / etc/sysctl.conf

# ORACLE SETTING

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

Kernel.shmall = 524288

Kernel.shmmax = 1610612736

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100 128

Kernel.panic_on_oops = 1

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048576

Net.ipv4.ip_local_port_range = 9000 65500

# sysctl-p configuration takes effect

Refer to the official documentation

Https://docs.oracle.com/database/122/LADBI/minimum-parameter-settings-for-installation.htm#LADBI-GUID-CDEB89D1-4D48-41D9-9AC2-6AD9B0E944E3

Kernel indicates the maximum value of a separate shared memory segment that can be allocated by the SHMMAXLinux process. It is generally set to half the total memory size. The setting of this value should be greater than the value of SGA_MAX_TARGET or MEMORY_MAX_TARGET SHMMIN the size of the minimum memory segment shmall setting the total number of pages of shared memory SHMMAX/4K

(13)。 Configure environment variables

Grid

PS1= "[`whoami` @ `hostname`:"'$PWD] $'

Export PS1

Umask 022

Export TMP=/tmp

Export LANG=en_US

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=rac1

Export ORACLE_SID=+ASM1

Export ORACLE_TERM=xterm

Export ORACLE_BASE=/oracle/app/grid

Export ORACLE_HOME=/oracle/app/12.2.0.1/grid

Export NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"

PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH

Export THREADS_FLAG=native

Oracle

PS1= "[`whoami` @ `hostname`:"'$PWD] $'

Export PS1

Umask 022

Export TMP=/tmp

Export LANG=en_US

Export TMPDIR=$TMP

Export ORACLE_HOSTNAME=rac1

Export ORACLE_UNQNAME=racdb12c

Export ORACLE_BASE=/oracle/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1

Export ORACLE_SID=racdb12c1

Export ORACLE_TERM=xterm

Export NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS"

Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH

Export THREADS_FLAG=native

(14)。 Configure SSH

Generate public and private keys as grid,oracle on the primary node

Mkdir / .ssh

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Perform the same operation on another node

On Node 1, use the oracle (grid) user to do the following

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

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

Ssh rac2 cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys

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

Scp / .ssh/authorized_keys rac2:~/.ssh/authorized_keys

Test ssh on the 1BI 2 node

Ssh rac1 date

Ssh rac2 date

Ssh rac1-priv date

Ssh rac2-priv date

4. Modify the virtual machine configuration file (.vmx) to add the following

Disk.locking = "FALSE"

DiskLib.dataCacheMaxSize = "0"

DiskLib.dataCacheMaxReadAheadSize = "0"

DiskLib.dataCacheMinReadAheadSize = "0"

DiskLib.dataCachePageSize = "4096"

DiskLib.maxUnsyncedWrites = "0"

Disk.EnableUUID = "TRUE"

Scsi1.sharedBus = "VIRTUAL"

5. Configure shared storage

Name

Size

Dggrid1

40GB

Dggrid2

10GB

Dgsystem

21GB

Dgrecover

22GB

Dgdata1

23GB

Dgdata2

24GB

(1)。 Edit / etc/scsi_id.config and add the following

Options=--whitelisted-replace-whitespace

(2)。 Get the uuid that needs to be bound to an ASM Disk disk

For i in b c d e f g

Do

Echo "sd$i"`/ usr/lib/udev/scsi_id-whitelisted-replace-whitespace-device=/dev/sd$ i`"

Done

Sdb 36000c29b0e11cfc09873aa3dc45baf3e

Sdc 36000c293313041c3f662d837263cbef3

Sdd 36000c2908886e8ba4e0e6b410b456616

Sde 36000c29cb127c1af8c28efd8af0d92d4

Sdf 36000c29ecd42be581ecb6d8f2b37e2f1

Sdg 36000c29e8abe980615022c02a11960d1

(3)。 Write udev rules files

For i in b c d e f g

Do

Echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / usr/lib/udev/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ usr/lib/udev/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i` ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ ""

Done

Redhat 7

For i in b c d e f g

Do

Echo "KERNEL==\" sd*\ ", ENV {DEVTYPE} = =\" disk\ ", SUBSYSTEM==\" block\ ", PROGRAM==\" / usr/lib/udev/scsi_id-g-u-d\ $devnode\ ", RESULT==\" `/ usr/lib/udev/scsi_id-g-u / dev/sd$ i`\ ", RUN+=\" / bin/sh-c 'mknod / dev/asmdisk$i b\ $major\ $minor; chown grid:asmadmin / dev/asmdisk$i; chmod 0660 / dev/asmdisk$i'\ ""

Done

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c2952c880a7bd3b532de2be6e7c1", RUN+= "/ bin/sh-c 'mknod / dev/asm-dggrid1 b $major $minor; chown grid:asmadmin / dev/asm-dggrid1; chmod 0660 / dev/asm-dggrid1'"

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c29d8069ccccdc4254861e4de50a", RUN+= "/ bin/sh-c 'mknod / dev/asm-dggrid2 b $major $minor; chown grid:asmadmin / dev/asm-dggrid2; chmod 0660 / dev/asm-dggrid2'"

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c29228ddf02cfb4e980a4a06fbdc", RUN+= "/ bin/sh-c 'mknod / dev/asm-dgsystem b $major $minor; chown grid:asmadmin / dev/asm-dgsystem; chmod 0660 / dev/asm-dgsystem'"

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c29f3195a284faae34072f347a93", RUN+= "/ bin/sh-c 'mknod / dev/asm-dgrecover b $major $minor; chown grid:asmadmin / dev/asm-dgrecover; chmod 0660 / dev/asm-dgrecover'"

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c298e69bb4ea5bf85d9b9b49fd02", RUN+= "/ bin/sh-c 'mknod / dev/asm-dgdata1 b $major $minor; chown grid:asmadmin / dev/asm-dgdata1; chmod 0660 / dev/asm-dgdata1'"

KERNEL== "sd*", ENV {DEVTYPE} = = "disk", SUBSYSTEM== "block", PROGRAM== "/ usr/lib/udev/scsi_id-g-u-d $devnode", RESULT== "36000c2918d25c19177895d053c751663", RUN+= "/ bin/sh-c 'mknod / dev/asm-dgdata2 b $major $minor; chown grid:asmadmin / dev/asm-dgdata2; chmod 0660 / dev/asm-dgdata2'"

# vi / etc/udev/rules.d/99-oracle-asmdevices.rules

# / sbin/udevadm trigger-type=devices-action=change

(4)。 Restart the udev device

/ sbin/udevadm control-reload-rules

/ sbin/start_udev # redhat7 integrated into systemctl restart systemd-udev-trigger.service

Ll / dev/asm*

6. Install VNC

# yum install libvncserver.x86_64-y

# yum install tigervnc.x86_64-y

# yum install tigervnc-server.x86_64-y

# vncserver enable the service and set the password

7. Install the cvuqdisk package and verify (all nodes are installed)

# cd / tmp/wwj/GI/cv/rpm

# export CVUQDISK_GRP=oinstall

# rpm-ivh cvuqdisk-1.0.10-1.rpm

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

. / runcluvfy.sh stage-post hwos-n rac1,rac2-verbose

8. Install GI

Su-grid

Cd $ORACLE_HOME

Unzip-Q download_location/grid.zip

Execute the installation script

GridSetup.sh

Check after installation

[root@rac1 ~] # crsctl status res-t

Name Target State Server State details

Local Resources

Ora.ASMNET1LSNR_ASM.lsnr

ONLINE ONLINE rac1 STABLE

ONLINE ONLINE rac2 STABLE

Ora.DGGRID1.dg

ONLINE ONLINE rac1 STABLE

ONLINE ONLINE rac2 STABLE

Ora.LISTENER.lsnr

ONLINE ONLINE rac1 STABLE

ONLINE ONLINE rac2 STABLE

Ora.net1.network

ONLINE ONLINE rac1 STABLE

ONLINE ONLINE rac2 STABLE

Ora.ons

ONLINE ONLINE rac1 STABLE

ONLINE ONLINE rac2 STABLE

Ora.proxy_advm

OFFLINE OFFLINE rac1 STABLE

OFFLINE OFFLINE rac2 STABLE

Cluster Resources

Ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE rac1 STABLE

Ora.MGMTLSNR

1 OFFLINE OFFLINE STABLE

Ora.asm

1 ONLINE ONLINE rac1 Started,STABLE

2 ONLINE ONLINE rac2 Started,STABLE

3 OFFLINE OFFLINE STABLE

Ora.cvu

1 ONLINE ONLINE rac1 STABLE

Ora.qosmserver

1 ONLINE ONLINE rac1 STABLE

Ora.rac1.vip

1 ONLINE ONLINE rac1 STABLE

Ora.rac2.vip

1 ONLINE ONLINE rac2 STABLE

Ora.scan1.vip

1 ONLINE ONLINE rac1 STABLE

[root@rac1 ~] # ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 4

Total space (kbytes): 409568

Used space (kbytes): 1848

Available space (kbytes): 407720

ID: 1005996313

Device/File Name: + DGGRID1

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check succeeded

[root@rac1 ~] # crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 90f6afc163534f18bf96e54a9bf239db (/ dev/asm-grid1) [DGGRID1]

Located 1 voting disk (s).

9. Create an ASM disk group

Su-grid

$asmca

Add an OCR disk group

[root@rac1 ~] # ocrconfig-add + dggrid2

[root@rac1 ~] # ocrcheck

10. Install database software

Su-oracle

Export LANG=en_US

. / runInstaller

11. Create a database

$dbca

SGA size is set to 45% to 55% of physical memory

PGA size set to 20% of 80% of physical memory

Data files should not exceed 30g

Set 20g per tablespace to cancel automatic extension

Log file

At least 8 groups each redo 200m

twelve。 Adjust archiving

SQL > alter system set cluster_database=FALSE scope=spfile

System altered.

Shut down the database

Srvctl stop database-d racdb12c-o immediate

Start the 1-node database

SQL > startup mount

SQL > alter system set log_archive_dest_1='location=+DGRECOVER' scope=spfile

System altered.

SQL > alter database archivelog

Restart the database

Srvctl start database-d racdb12c

Modify sqlnet.ora so that other versions of clients can connect to 12c databases

SQLNET.ALLOWED_LOGON_VERSION_SERVER=10

SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10

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