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

Configure ASM and create a recovery directory

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

Share

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

This configuration ASM follows the environment configuration of building RAC, and the system chooses CENTOS6.8.

First configure YUM locally to install the RPM package required by GRID Clusterware

[root@rac01 Packages] # cd / etc/yum.repos.d/

[root@rac01 yum.repos.d] # ls

CentOS-Base.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Vault.repo

[root@rac01 yum.repos.d] # rm-rf *

[root@rac01 yum.repos.d] # vi local.repo

[kingsql]

Name=This is kingsql repo

Baseurl= file:///rpm/

Enabled=1

Gpgcheck=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[root@rac01 yum.repos.d] # mkdir-p / rpm

[root@rac01 yum.repos.d] # cd / rpm

[root@rac01 rpm] cp / root/CentOS-6.8-x86_64-bin-DVD1/Packages/* / rpm/

Rpm-ivh vsftpd-2.2.2-12.el6_5.1.x86_64.rpm

Rpm- ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

Rpm- ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

Rpm-ivh libxml2-2.7.6-14.el6_5.2.x86_64.rpm

Rpm-ivh libxml2-python-2.7.6-14.el6_5.2.x86_64.rpm

Rpm-ivh createrepo-0.9.9-22.el6.noarch.rpm

[root@rac01 rpm] # createrepo. /

[root@rac01 rpm] # yum clean all

[root@rac01 rpm] # yum makecache

[root@rac01 rpm] # yum install libXp* xterm* unixODBC* sysstat* make* libstdc++* libgomp* libgcc* libaio* kernel-headers* glibc* gcc* elfutils* binutils* bind bind-devel bind-chroot caching-nameserver compat-libcap1* compat-libstdc++-33* openssh* xdpyinfo vi unzip

This configuration ASM,DNS configuration is optional or not

Vi / etc/named.conf

Options {

Listen-on port 53 {any;}

Directory "/ var/named"

Dump-file "/ var/named/data/cache_dump.db"

Statistics-file "/ var/named/data/named_stats.txt"

Memstatistics-file "/ var/named/data/named_mem_stats.txt"

Allow-query {any;}

Recursion yes

Dnssec-enable yes

Dnssec-validation yes

/ * Path to ISC DLV key * /

Bindkeys-file "/ etc/named.iscdlv.key"

Managed-keys-directory "/ var/named/dynamic"

}

Logging {

Channel default_debug {

File "data/named.run"

Severity dynamic

}

}

Zone "." IN {

Type hint

File "/ dev/null"

}

Zone "kingsql.org" IN {

Type master

File "kingsql.org.zone"

}

Zone "56.168.192.in-addr.arpa" {

Type master

File "192.168.56.rev"

}

[root@rac01 named] # cd / var/named

[root@rac01 named] # pwd

/ var/named

[root@rac01 named] # vi kingsql.org.zone

$TTL 1D

@ IN SOA kingsql.org. Hostmaster.kingsql.org. (

0; serial

1D; refresh

1H; retry

1W; expire

3H); minimum

@ IN NS ns1.kingsql.org.

Ns1 IN A 192.168.56.101

Cluster-scan IN A 192.168.56.156

Cluster-scan IN A 192.168.56.157

Cluster-scan IN A 192.168.56.158

-

[root@rac01 named] # vi 192.168.56.rev

$TTL 1D

@ IN SOA kingsql.org. Hostmaster.kingsql.org. (

0; serial

1D; refresh

1H; retry

1W; expire

3H); minimum

@ IN NS ns1.kingsql.org.

Ns1 IN A 192.168.56.101

156 IN PTR cluster-scan.kingsql.org.

157 IN PTR cluster-scan.kingsql.org.

158 IN PTR cluster-scan.kingsql.org.

-

Service network restart

Cat / etc/resolv.conf

# Generated by NetworkManager

Nameserver 192.168.56.101

Chkconfig named on # # set Boot self-boot

Service named start

Starting named: [OK]

Nslookup cluster-scan.kingsql.org

Nslookup 192.168.56.156

Nslookup 192.168.56.157

Nslookup 192.168.56.158

-

Turn off the firewall

Chkconfig iptables off

Service iptables stop

Change selinux to disabled

Vi / etc/selinux/config

Create users and groups

Groupadd-g 1000 oinstall

Groupadd-g 1200 asmadmin

Groupadd-g 1201 asmdba

Groupadd-g 1202 asmoper

Groupadd-g 1300 dba

Groupadd-g 1301 oper

Useradd-m-u 1100-g oinstall-G asmadmin,asmdba,asmoper,dba-d / home/grid-s / bin/bash-c "Grid Infrastructure Owner" grid

Useradd-m-u 1101-g oinstall-G dba,oper,asmdba-d / home/oracle-s / bin/bash-c "Oracle Software Owner" oracle

Passwd grid

Passwd oracle

Create a directory and modify permissions

Mkdir-p / u01/app/grid

Mkdir-p / u01/app/11.2.4/grid

Chown-R grid:oinstall / U01

Mkdir-p / u01/app/oracle

Chown oracle:oinstall / u01/app/oracle

Chmod-R 775 / U01

Turn off the ntpd service

Service ntpd stop

Chkconfig ntpd off

Mv / etc/ntp.conf / etc/ntp.conf.original

Rm-rf / var/run/ntpd.pid

Modify the environment variables of grid users

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

# .bash _ profile

# Get the aliases and functions

If [- f ~ / .bashrc]; then

. ~ / .bashrc

Fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

Export PATH

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/11.2.4/grid

Export ORACLE_SID=+ASM1

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

If [$USER = "oracle"] | | [$USER = "grid"]; then

If [$SHELL = "/ bin/ksh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Umask 022

Fi

Export

Modify root user environment variables

Vi / etc/sysctl.conf

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

/ sbin/sysctl-p

Vi / etc/security/limits.conf

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

Vi / etc/pam.d/login

Session required pam_limits.so

Check the disk number

[root@rac1] # / sbin/scsi_id-u-g / dev/sdb

1ATA_VBOX_HARDDISK_VB1274608b-98003b66

[root@rac1] # / sbin/scsi_id-u-g / dev/sdc

1ATA_VBOX_HARDDISK_VBbf237514-f3435ff0

[root@rac1] # / sbin/scsi_id-u-g / dev/sdd

1ATA_VBOX_HARDDISK_VBc894130b-2f10eef0

[root@rac1] # / sbin/scsi_id-u-g / dev/sde

1ATA_VBOX_HARDDISK_VB58f6ed82-b0dc76dc

[root@rac1] # / sbin/scsi_id-u-g / dev/sdf

1ATA_VBOX_HARDDISK_VB0e0cbf34-6238f247

[root@rac1] # / sbin/scsi_id-u-g / dev/sdg

1ATA_VBOX_HARDDISK_VB98788216-29530089

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

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB1274608b-98003b66", NAME= "asm-disk1", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VBbf237514-f3435ff0", NAME= "asm-disk2", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VBc894130b-2f10eef0", NAME= "asm-disk3", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB58f6ed82-b0dc76dc", NAME= "asm-disk4", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB0e0cbf34-6238f247", NAME= "asm-disk5", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB98788216-29530089", NAME= "asm-disk6", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

[root@rac01 ~] # start_udev

Starting udev: [OK]

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

Brw-rw---- 1 grid asmadmin 8, 16 September 18 11:49 / dev/asm-disk1

Brw-rw---- 1 grid asmadmin 8, 32 September 18 11:49 / dev/asm-disk2

Brw-rw---- 1 grid asmadmin 8, 48 September 18 11:49 / dev/asm-disk3

Brw-rw---- 1 grid asmadmin 8, 64 September 18 11:49 / dev/asm-disk4

Brw-rw---- 1 grid asmadmin 8, 80 September 18 11:49 / dev/asm-disk5

Brw-rw---- 1 grid asmadmin 8, September 18, 96 11:49 / dev/asm-disk6

Install the RPM package that comes with Clusterware

[root@rac01 ~] # mv p13390677_112040_Linux-x86-64_3of7.zip / home/grid/

[grid@rac01 ~] $cd grid/

[grid@rac01 grid] $ls

Install response runInstaller sshsetup welcome.html

Readme.html rpm runcluvfy.sh stage

[grid@rac01 grid] $cd rpm/

[grid@rac01 rpm] $ls

Cvuqdisk-1.0.9-1.rpm

[grid@rac01 rpm] $su root

Password:

[root@rac1] # rpm-ivh / home/grid/grid/rpm/cvuqdisk-1.0.9-1.rpm

Preparing... # [100%]

Using default group oinstall to install package

1:cvuqdisk # # [100%]

Modify / etc/hosts

[root@rac01 ~] # vi / etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.101 rac01

192.168.56.111 rac01-vip

192.168.1.229 rac01-priv

192.168.56.156 cluster-scan

Install ASM

Cluster-scan in scan-name write / etc/hosts

Please modify the common hostname and virtual hostname. If it is a single node, you do not need to configure SSH mutual trust.

Pay attention to which is the public network card and which is the bridge network card, etho or eth2

Select ASM

Redundancy selection external redundancy

Choose not to use IPM

Execute script

Configure asmca after installation is complete

Create creates a disk group

The remaining hard drives are named DATA disk groups.

Mount all, and then launched

If you directly enable the dbca configuration at this time, you may not be able to find the disk group. We need to enter the grid home directory to execute chmod + s permissions so that ORACLE users can see the disk group.

Cd / u01/app/11.2.0/grid/bin/

Chmod + s oracle

Enable dbca

Start the process of creating a recovery catalog database using DBCA

On the database templates (database template) page, leave the default value of "General Purpose" (general purpose) or Transaction Processing (transaction handling)

In database identification (database identity), enter the name of the recovery catalog database and use rcat.example.com as the Global Database Name (global database name)

Management options (management options) uncheck configure enterprise manager (configure em)

Automatic Maintenance Tasks (automatic maintenance tasks) uncheck Enable Automatic Maintenance Tasks (enable automatic maintenance tasks)

All accounts use the same administrative password

Database file locations (database file location) Select Automatic Storage Management (ASM) as the Storage Type (storage type). Select Use common location for all database files (all database files use a common location) and then select the DATA disk group

In recovery configuration (restore configuration), select specify flash recovery (specify quick recovery area), select + FRA disk group, and make sure that Flash Recovery Area size (quick recovery area size) is 4062MB

Do not check the example scheme

In initialization parameter (initialization parameter), set the memory size to 303MB and click Use Automatic Memory Management (use automatic memory management)

Character set tab Select use unicode (AL32UTF8)

After that, create database.

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