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

10G ORACLE RAC sets up the actual combat environment configuration

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

Share

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

one。 User creation

Each node user name and user group must be the same, and create the oracle installation directory and the clustercrs directory

[root@rac1] # groupadd-g 500dba

[root@rac1] # groupadd-g 501 oinstall

[root@rac1] # useradd-u 500-g oinstall-G dba oracle

[root@rac1] # passwd oracle

Changing passwordfor user oracle.

New UNIX password:

BAD PASSWORD: itis based ona dictionary word

Retype new UNIXpassword:

Passwd: allauthentication tokens updated successfully.

[root@rac1] # chmod-R 755 / home/oracle

(note: this step involves ssh equivalent configuration)

[root@rac1] # mkdir-p / oraapp/oracle/10g/db_1

[root@rac1] # mkdir-p / oraapp/oracle/10g/db_1

[root@rac1] # mkdir-p / oraapp/oracle/10g/crs

[root@rac1] # chown-R oracle:oinstall / oraapp

[root@rac1] # chmod-R 755 / oraapp

two。 IP allocation and hosts file configuration

Hostname

Saprac1

Saprac2

Public ip (eth3)

133.160.130.18

133.160.130.19

Virtual ip (eth0)

192.168.1.18

192.168.1.19

Private ip (eth5)

10.10.10.18

10.10.10.19

ORACLE_SID

Xgxrac1

Xgxrac2

Hosts file configuration (same for both nodes)

[oracle@rac1 ~] $cat / etc/hosts

# Do not removethe following line, or various programs

# that requirenetwork functionality will fail.

127.0.0.1 localhost.localdomain localhost

:: 1 localhost6.localdomain6 localhost6

133.160.130.18 rac1

133.160.130.19 rac2

192.168.1.18 rac1_vip

192.168.1.19 rac2_vip

10.10.10.18 rac1_priv

10.10.10.19 rac2_priv

III. Adjustment of system parameters

Modify the following files:

1. Add the following to / etc/security/limits.conf

# vi/etc/security/limits.conf

# oracle limits

Oracle softnproc 2047

Oracle hardnproc 16384

Oracle softnofile 1024

Oracle hardnofile 65536

2. Add the following to / etc/pam.d/login

# vi / etc/pam.d/login

Session required pam_limits.so

3. Add the following to / etc/profile

# vi / etc/profile

If [$USER = "oracle"]; then

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

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi

4. Modify system kernel parameters

# vi / etc/sysctl.conf

Fs.file-max = 6815744

Kernel.shmall = 2097152

Kernel.shmmax = 53687091200 (memory allocation is > PGA+SGA)

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100 128

Net.ipv4.ip_local_port_range = 1024 65500

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max= 1048576

After modifying the kernel parameters, execute the following command to make the new settings take effect

# / sbin/sysctl-p

Modify the system version information (change it back after installation)

Edit / etc/redhat-release file to replace the current version information (Red Hat Enterprise Linux Server release 3 (Tikanga))

four。 Modify environment variabl

Modify each node in turn, pay attention to SID, ORACLE_BASE,ORACLE_HOME

[oracle@rac1] $vi ~ / .bash_profile

Export PATH

Unset USERNAME

Alias ll= "ls-la"

ExportORACLE_BASE=/oraapp/oracle/10g

Export ORACLE_HOME=$ORACLE_BASE/db_1

ExportORA_CRS_HOME=$ORACLE_BASE/crs

ExportORACLE_SID=sapora1

ExportPATH=.:$ {PATH}: $HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin

ExportPATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/bin

ExportSPFILE_PATH=$ORACLE_HOME/dbs

ExportTNS_ADMIN=$ORACLE_HOME/network/admin

ExportORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

ExportLD_LIBRARY_PATH=$ORACLE_HOME/lib

ExportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/lib

ExportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/lib

ExportCLASSPATH=$ORACLE_HOME/JRE

ExportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/JRE/lib

ExportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlib

ExportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlib

ExportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlib

ExportTHREADS_FLAG=native

Export TEMP=/tmp

Export TMPDIR=/tmp

ExportLIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

ExportORACLE_TERM=xterm

ExportLC_CTYPE=en_US.AL16UTF16

ExportNLS_LANG=AMERICAN_AMERICA.US7ASCII

~

~

~

~

".bash _ profile" 39L, 1244C written

Make the changes take effect immediately

[oracle@rac1] $source ~ / .bash_profile

five。 Development package inspection

Yum-y install compat-libstdc++ libaio libXp compat-dbopenmotif22 binutils control-center gcc gcc-c++ glibc glibc-common gnome-libslibstdc++ libstdc++-devel make pdksh sysstat xscreensaver setarch glibc-develsetarch-2* make-3* glibc-2* libaio-0* compat-libstdc++-33-3 yum-y compatmuri GCC Murray 34-3 compatMurray 34 CMC Murray 34 catered Murray 3 * gcc-4* libXp-1* openmotif-2* compat-db-4* openmotif-2*

six。 RAW binding

The so-called bare device (bare partition, raw partition) is a character device that is not formatted and not read by the operating system through the file system. The bare device avoids passing through the Unix operating system layer, and the data is transferred directly from Disk to Oracle, so using the bare device can greatly improve the performance of the database system for the database applications that read and write frequently. Bare devices should be created by root and then assigned to Oracle users for use. At the same time, it is also included in the group in which Oracle users belong (usually DBA).

The surface difference between bare and non-naked devices is that one is a newly manufactured disk with no operation, and the other is a new disk formatted by fdisk.

LV is a bare device on aix, but needs to be created separately on linux; to prevent configuration loss after reboot, write binding settings to the / etc/sysconfig/rawdevices file

(1)。 Edit / etc/sysconfig/rawdevices add bare device corresponding to lv

[root@rac1 ~] # vi/etc/sysconfig/rawdevices

# raw devicebindings

# format:

#

# example:/dev/raw/raw1 / dev/sda1

# / dev/raw/raw2 8 5

/ dev/raw/raw1 / dev/mapper/oravg01-lvol0

/ dev/raw/raw2 / dev/mapper/oravg01-lvol1

/ dev/raw/raw3 / dev/mapper/oravg01-lvol2

/ dev/raw/raw4 / dev/mapper/oravg01-lvol3

/ dev/raw/raw5 / dev/mapper/oravg01-lvol4

/ dev/raw/raw6 / dev/mapper/oravg01-lvol5

/ dev/raw/raw7 / dev/mapper/oravg01-lvol6

/ dev/raw/raw8 / dev/mapper/oravg01-lvol7

/ dev/raw/raw9 / dev/mapper/oravg01-lvol8

/ dev/raw/raw10 / dev/mapper/oravg01-lvol9

/ dev/raw/raw11 / dev/mapper/oravg01-lvol10

/ dev/raw/raw12 / dev/mapper/oravg01-lvol11

/ dev/raw/raw13 / dev/mapper/oravg01-lvol12

/ dev/raw/raw14 / dev/mapper/oravg01-lvol13

/ dev/raw/raw15 / dev/mapper/oravg01-lvol14

/ dev/raw/raw16 / dev/mapper/oravg01-lvol15

/ dev/raw/raw17 / dev/mapper/oravg01-lvol16

/ dev/raw/raw18 / dev/mapper/oravg01-lvol17

/ dev/raw/raw19 / dev/mapper/oravg01-lvol18

/ dev/raw/raw20 / dev/mapper/oravg01-lvol19

/ dev/raw/raw21 / dev/mapper/oravg01-lvol20

/ dev/raw/raw22 / dev/mapper/oravg01-lvol21

/ dev/raw/raw23 / dev/mapper/oravg01-lvol22

/ dev/raw/raw24 / dev/mapper/oravg01-lvol23

/ dev/raw/raw25 / dev/mapper/oravg01-lvol24

/ dev/raw/raw26 / dev/mapper/oravg01-lvol25

/ dev/raw/raw27 / dev/mapper/oravg01-lvol26

/ dev/raw/raw28 / dev/mapper/oravg01-lvol27

/ dev/raw/raw29 / dev/mapper/oravg01-lvol28

/ dev/raw/raw30 / dev/mapper/oravg01-lvol29

/ dev/raw/raw31 / dev/mapper/oravg01-lvol30

/ dev/raw/raw32 / dev/mapper/oravg01-lvol31

/ dev/raw/raw33 / dev/mapper/oravg01-lvol32

/ dev/raw/raw34 / dev/mapper/oravg01-lvol33

/ dev/raw/raw35 / dev/mapper/oravg01-lvol34

/ dev/raw/raw36 / dev/mapper/oravg01-lvol35

(2)。 Execute / etc/init.d/rawdevices restart to make the bare devices in the configuration file effective.

(3) execute / sbin/chkconfig rawdevices on to ensure that the bare device can be loaded when the machine starts. (check whether to start chkconfig-- list | grep raw)

(4) authorize the bare device to the oracle user and change the owner of the bare device

The first method: modify / etc/udev/permissions.d/50-udev.permissions file

Change the 113th line of / etc/udev/permissions.d/50-udev.permissions

From raw/*:root:disk:0660

Change to raw/*:oracle:oinstall:0660

This means that the default owner of the bare device is oracle:oinstall, and the default mode is 0660.

In this way, every time you restart to create a bare device, the default owner is oracle:oinstall.

# refresh the bare device (so that the required raw device name will be re-established the next time the system starts)

[root@myhost raw] # start_udev start udev: [OK] [root@myhost raw] # init 6

The second method: execute chown oracle:oinstall/dev/raw/raw* first

Edit startup configuration file / etc/rc.local to add chown oracle:oinstall/dev/raw/raw*

[root@rac2 etc] # vi / etc/rc.local

#! / bin/sh

#

# This script will be executed * after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

Touch / var/lock/subsys/local

# change raw owner

Chown oracle:oinstall / dev/raw/raw*

Restart the system to see if the bare device exists.

(5) switch to another node, and since all volume groups are inactive, activate the volume group: vgchange-ay oravgX, and then repeat the above.

seven。 NTP service configuration

1. Server (133.160.130.18)

Because the network cannot be connected, the upper layer time service is not modified, only the connection limit is modified; edit / etc/ntp.conf

Modify restrict default kod nomodify notrap nopeernoquery

For restrictdefault nomodify

Restart the ntp service: service ntpd restart

Set up boot boot: chkconfig ntpd on

two。 Client (133.160.130.19)

Add tasks to be executed every 5 minutes

Echo'* / 5 * root ntpdate133.160.130.18' > > / etc/crontab

eight。 Hangcheck-timer module configuration

1. View module location

[root@rac1 ~] # find / lib/modules/-name "hangcheck"

[root@rac1 ~] # find / lib/modules/-name "hangcheck-timer.ko"

/ lib/modules/2.6.18-398.el5/kernel/drivers/char/hangcheck-timer.ko

two。 Configure the module to load automatically when the system starts, adding the following

[root@rac1 ~] # modprobe hangcheck-timer

[root@rac1 ~] # vi/etc/rc.d/rc.local

Modprobehangcheck-timer

3. Configure the hangcheck-timer parameter to add the following

[root@rac1~] # vi / etc/modprobe.conf

Optionshangcheck-timer hangcheck_tick=30 hangcheck_margin=180

4. Confirm that the module is loaded successfully

[root@rac1 ~] # grep Hangcheck / var/log/messages | tail-2

Mar 27 10:45:55localhost kernel: Hangcheck: starting hangcheck timer 0.9.0 (tick is 180seconds, margin is 60 seconds).

Mar 27 10:45:55localhost kernel: Hangcheck: Using monotonic_clock ().

IX. Configure ssh equivalence

Note:

1. This step is performed by oracle users and needs to be done after configuring the hosts file

two。 You must ensure that the UID of the Oracle user is the same as the GID of the DBA group on each node.

3. Because the installation rac is installed on one of the nodes, then oracle is automatically copied to the other nodes. The final test must be able to display the date without entering a password, otherwise the installation will fail!

1. Execute on each node where the user is configured equivalent

[oracle@rac01 ~] $cd $HOME

[oracle@rac01 ~] $mkdir .ssh

[oracle@rac01 ~] $chmod 700.ssh

[oracle@rac01 ~] $cd .ssh

[oracle@rac01 .ssh] $pwd

/ home/oracle/.ssh

[oracle@rac01 .ssh] $ssh-keygen-t rsa (hit enter three times in a row, do not enter)

[oracle@rac01 .ssh] $ssh-keygen-t dsa (hit enter three times in a row, do not enter)

[oracle@rac01 .ssh] $cat * .pub > authorized_keys

[oracle@rac01 .ssh] $chmod 644 authorized_keys

two。 Copy the authorized_keys from the first node to the second node

[oracle@rac01 .ssh] $scp authorized_keys oracle@192.168.0.2:/home/oracle/.ssh/keys_ser01

3. The authorized_keys after merging the second node with the first node is copied back to the first node

[oracle@rac02 .ssh] $cat keys_ser01 > > authorized_keys

[oracle@rac02.ssh] $scp authorized_keys oracle@192.168.0.1:/home/oracle/.ssh/

4. Test ssh login to another node without entering a password

Ssh rac1 date

Ssh rac1-privdate

Ssh rac2 date

Ssh rac2-privdate

This step must be tested successfully to carry out the later installation!

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