您好,欢迎来到爱问旅游网。
搜索
您的当前位置:首页rac实战项目上线安装后总结

rac实战项目上线安装后总结

来源:爱问旅游网
5.4 linux 安装 oracle 总结:

Redhat5.4 x安装ORACLE10G 修改 /etc/vsftpd>>>>ftpusers and user__ 开启FTP

1.首先安装以下包:

rpm -q glibc glibc-common compat-glibc- glibc-devel libXp binutils binutils compat-db control-center gcc gcc-c++ libstdc++ libstdc++-devel make ksh sysstat gnome-screensaver libaio-devel libaio openmotif22

用以下命令检查是否全部成功:

$ rpm -qa |grep glibc-2 glibc-2.3.4-2.13

compat-glibc-2.3.2-95.30 compat-glibc-2.3.2-95.30 glibc-2.3.4-2.13

$ rpm -qa |grep glibc-devel glibc-devel-2.3.4-2.13

glibc-devel-2.3.4-2.13 32(32位)

rpm -qa --queryformat \"%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\\n\"|grep 终极

查看法

2.以root用户身份执行,在两节点上做如下配置。

编辑/etc/sysctl.conf文件 # vi /etc/sysctl.conf

在文件尾部添加下述内容

kernel.shmall = 2097152

kernel.shmmax = 4294967297 kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

// 物理内存的一半

vm.min_free_kbytes=409600 vm.vfs_cache_pressure=200 vm.swappiness =40

fs.file-max = 101365

net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 1048576 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 1048576

Sysctl -p生效

// 256K // 1M

3.为 oracle 用户设置 Shell .

Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置,ROOT登录.( /etc/profile file (or the file on SUSE systems)/etc/profile.local: if [ $USER = \"oracle\" ]; then if [ $SHELL = \"/bin/ksh\" ]; then ulimit -p 16384 ulimit -n 65536 else

ulimit -u 16384 -n 65536 fi fi

■ For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on SUSE systems)/etc/csh.login.local: if ( $USER == \"oracle\" ) then limit maxproc 16384 limit descriptors 65536 endif

Add the following lines to the /etc/security/limits.conf file:

oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536

修改/etc/pam.d/login,增加以下内容

session required /lib/security/pam_limits.so

配置hangcheck-timer内核模块

以root用户身份执行,在两节点上做如下配置。 查看模块是否存在

# find /lib/modules -name \"hangcheck-timer.ko\" 编辑/etc/modprobe.conf # vi /etc/modprobe.conf 在文件的末尾加入一行

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180 配置为自启动 vi /etc/rc.d/rc.local 在文件的末尾加入一行 /sbin/modprobe hangcheck_timer 启动hangcheck

# modprobe hangcheck_timer 检查hangcheck是否成功启动

# grep hangcheck /var/log/messages | tail -2 如果显示下述信息说明已经成功启动hangcheck

Mar 16 12:52:32 node2 kernel: Hangcheck: starting hangcheck timer 0.5.0 (tick is 180 seconds, margin is 60 seconds).

4.创建ORACLE用户及文件夹权限等

新增组和用户:

groupadd oinstall groupadd dba

useradd -g oinstall -G dba oracle passwd oracle

创建Oracle的安装目录,并把权限付给oracle用户:

mkdir oracle

chown -R oracle:oinstall /oracle

解压database

修改database目录权限,用户和用户组

chown -R oracle:oinstall database/

chmod -R 775 database/

5.修改/etc/hosts文件及oracle用户里的.bash_profile文件

# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin

export PATH unset USERNAME

ORA_CRS_BASE=/oracle/crs

ORA_CRS_HOME=$ORA_CRS_BASE/product/10.2.0/crs_1 ORACLE_BASE=/oracle/app

#ORACLE_BASE=$ORA_CRS_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 #ORACLE_HOME=$ORA_CRS_HOME ORACLE_SID=oradb1

PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/usr/local/bin:$PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORA_CRS_HOME/lib:$ORA_CRS_HOME/lib32

NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export ORA_CRS_BASE ORA_CRS_HOME PATH NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH

6.安装一些RAC_的必要包

compat-binutils215-2.15.92.0.2-24.i386.rpm

oracleasm-2.6.18-1.el5-2.0.5-1.el5.x86_.rpm

oracleasm-2.6.18-1.el5debug-2.0.5-1.el5.x86_.rpm oracleasm-2.6.18-1.el5-debuginfo-2.0.5-1.el5.x86_.rpm oracleasm-2.6.18-1.el5xen-2.0.5-1.el5.x86_.rpm oracleasmlib-2.0.4-1.el5.x86_.rpm

oracleasm-support-2.1.3-1.el5.x86_.rpm

7.配置SSH

用ORACLE用户执行

分别在2台机上运行 mkdir ~/.ssh chmod 700 ~/.ssh cd .ssh

/usr/bin/ssh-keygen -t rsa (回车就OK)

#/usr/bin/ssh-keygen -t dsa (回车就OK) 这可以不做

在RAC1 机上运行

ssh raca cat /home/oracle/.ssh/id_rsa.pub>>authorized_keys

#ssh raca cat /home/oracle/.ssh/id_dsa.pub>>authorized_keys这可以不做 ssh racb cat /home/oracle/.ssh/id_rsa.pub>>authorized_keys

#ssh racb cat /home/oracle/.ssh/id_dsa.pub>>authorized_keys这可以不做 把authorized_keys cp 到RAC2中/home/oracle/.ssh/ scp authorized_keys racb:/home/oracle/.ssh/ (分别在2台机上运行)

chmod 600 authorized_keys

ssh rac2 date

exec /usr/bin/ssh-agent $SHELL /usr/bin/ssh-add

确定ForwardX11置为no

编辑或创建 $ vi ~oracle/.ssh/config 内容如下: Host *

ForwardX11 no

8.Ntpdate .... IP 时间同步

vi /etc/ntp.conf 服务端

restrict 0.0.0.0 mask 0.0.0.0 nomodify server 127.127.1.0

fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008 authenticate no keys /etc/ntp/keys

运行 chkconfig ntpd on /etc/init.d/ntpd restart

客务端

restrict 0.0.0.0 mask 0.0.0.0 nomodify server 127.127.1.0 server 服务端ip

fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008

authenticate no keys /etc/ntp/keys

运行ntpdate db1出现信息调整的信息表示成功,一般要5分钟走左右

如果是把内核时间更新到当前时间,就用下面的命令: hwclock --hctosys

检查ntp的版本,如果你使用的是ntp4.2(包括4.2)之后的版本,在restrict的定义中使用了notrust的话,会导致以上错误。

使用以下命令检查ntp的版本:ntpd -c version 如何去掉notrust?

9.磁盘分区

10.配置裸设备

vi /etc/udev/rules.d/60-raw.rules

ACTION==\"add\ACTION==\"add\ACTION==\"add\ACTION==\"add\ACTION==\"add\KERNEL==\"raw[1-5]\

用 RAW -QA 查看裸设备情况

11.配置asm

注意:必须以root 身份进行 首先在node1 执行:

[root@node1 ~]# /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 []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y

Fix permissions of Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: [ OK ] Loading module \"oracleasm\": [ OK ]

Mounting ASMlib driver filesystem: [ OK ]

Scanning system for ASM disks: [ OK ]

提示:如果本步执行出错(可能出错机率最高的是在Scanning system for ASM),不妨将转换一下命令行

[三思笔记]-手把手教你用VMware 在linux 下安装Oracle10g RAC http://www.5ienet.com/ QQ:5 君三思群:596662

的执行方式,改成:

[root@node1 ~]# sh /etc/init.d/oracleasm configure 有可能解决你的问题! 然后切换至node2 执行

[root@node2 ~]# /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 []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y Fix permissions of Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: [ OK ] Loading module \"oracleasm\": [ OK ]

Mounting ASMlib driver filesystem: [ OK ] Scanning system for ASM disks: [ OK ] 再切换回node1 执行

[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1 Marking disk \"/dev/sdd1\" as an ASM disk: [ OK ]

[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1 Marking disk \"/dev/sde1\" as an ASM disk: [ OK ]

[root@node1 linux-patch]# /etc/init.d/oracleasm scandisks Scanning system for ASM disks: [ OK ] 查看一下当前的磁盘组:

Scanning system for ASM disks: [ OK ]

[root@node1 ~]# /etc/init.d/oracleasm listdisks VOL1 VOL2

Node2 上也查看一下当前磁盘组:

[root@node2 ~]# /etc/init.d/oracleasm scandisks Scanning system for ASM disks: [ OK ]

[root@node2 ~]# /etc/init.d/oracleasm listdisks VOL1 VOL2

[三思笔记]-手把手教你用VMware 在linux 下安装Oracle10g RAC http://www.5ienet.com/ QQ:5 君三思群:596662

Ok,配置完成,准备进入到crs 的安装阶段

一些命令

netstat -rn 查看网卡状态

Etc/grub.conf 修改内核 enforcing=0 --------------------------------- -------------------- Xhost +

Xclock 确认介面

Export DISPLAY=:0.0

Export LNAG=en_US 调整语言

在oracel用户下查看 crs_stat -t 则显示集群状态 打补丁前要 Crs_stop -all停止集群.

Netca

创建数据库 dbca

当未成功时完全卸载RAC

rm -f /etc/init.d/init.cssd rm -f /etc/init.d/init.crs rm -f /etc/init.d/init.crsd rm -f /etc/init.d/init.evmd rm -f /etc/rc2.d/K96init.crs rm -f /etc/rc2.d/S96init.crs rm -f /etc/rc3.d/K96init.crs rm -f /etc/rc3.d/S96init.crs rm -f /etc/rc5.d/K96init.crs rm -f /etc/rc5.d/S96init.crs rm -Rf /etc/oracle/scls_scr

rm -f /etc/inittab.crs

cp /etc/inittab.orig /etc/inittab

关于ASM失败

oracle asmlib的版本与操作系统kernel版本一致,安装过程也没有出错,最后根据oracle工程师建议disable SELINUX解决问题。

方法:修改/etc/sysconfig/selinux文件配置SELINUX=disabled

总结,使用oracle asmlib管理disk设备,安装配置asmlib时要注意: 1. oracle asmlib版本与系统kernel版本一致 2. 确定系统的SELINUX=disabled

另外,在网上也找到一些相关的知识点:

1. 修改SELINUX=disabled后,如果不想重启系统,可以使用\"# setenforce 0”命令

2. 搭建RAC环境时,安装oracle的OCFS2文件系统也需要将SELINUX disable掉。大概RAC节点之间互相通信,需要降低系统的安全级别吧。

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- awee.cn 版权所有 湘ICP备2023022495号-5

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务