8. 设置sar
默认sar记录为10分钟一次,改为1分钟一次
日志保存目录为/var/log/sa
运行频率修改,把时间*/10改为*/1,出下面
# vi /etc/cron.d/sysstat
# run system activity accounting tool every 10 minutes
*/1 * * * * root /usr/lib64/sa/sa1 1 1
如果没有配置文件则需要安装sysstat-7.0.2-3.el5_5.1.x86_64.rpm包
日志保存时间,改为30天
# vi /etc/sysconfig/sysstat
HISTORY=30
9. 安装HDS多路径软件
RHEL 5.X可以使用6.3版本的多路径软件,RHEL 6.X要使用7版本的多路径软件
软件在/u07/software/hds目录
# unzip hdlm7.3_linux.zip
# cd hdlm6.3_linux
# chmod -R 777 *
把license拷贝到/var/tmp
# cp hdlm_license /var/tmp
安装
# ./installhdlm
重启服务器
# reboot
修改心跳的参数
# cd /opt/DynamicLinkManager/bin/
# ./dlnkmgr view -sys
# ./dlnkmgr set -pchk on -intvl 5 //Path Health Checking : on(1)
# ./dlnkmgr set -afb on -intvl 1 //Auto Failback : on(1)
六、 安装Oracle GI和DB前的配置
1. 创建oracle用户
groupadd -g 500 oinstall
groupadd -g 501 dba
useradd -g oinstall -G dba oracle
passwd oracle
2. 创建相关目录
创建存放GI和DB软件的目录
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01
su - oracle
mkdir -p /u01/app/oracle/product/11.2.0/db
3. 设置环境变量
bdcadb、oracle用户
$ vi .bash_profile
umask 022
set –o vi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=bdcadb
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:
export TMP=/tmp
export TMPDIR=/tmp
export LD_LIBRARY_PATH=$ORACLE_BASE/product/11.2.0/db/lib:/usr/lib
export LC_TYPE=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export SQLPATH=/home/oracle/sqlpath
alias sql='sqlplus / as sysdba'
alias bdump='cd /u02/app/oracle/diag/rdbms/bdcadb/bdcadb1/trace'
bdcadg、oracle用户
$ vi .bash_profile
umask 022
set –o vi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=bdcadg
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:
export TMP=/tmp
export TMPDIR=/tmp
export LD_LIBRARY_PATH=$ORACLE_BASE/product/11.2.0/db/lib:/usr/lib
export LC_TYPE=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export SQLPATH=/home/oracle/sqlpath
alias sql='sqlplus / as sysdba'
alias jdb='export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db;export ORACLE_SID=bdcadg'
alias bdump='cd /u02/app/oracle/diag/rdbms/bdcadb/bdcadb2/trace'
bdcadb、bdcadg、root用户
# vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
4. 设置SQLPATH目录
sqlpath目录中的login.sql设置了登录sqlplus的环境变量
$ mkdir -p /home/oracle/sqlpath
$ cat > sqlpath/login.sql
set TERM OFF
define_editor=vim
define loginname=idle
column global_name new_value loginname
select lower(USER||'@'
||substr(global_name,1,decode(dot,0,length(global_name),dot-1))) global_name
from
(select global_name, instr(global_name,'.') dot
from global_name);
set sqlprompt '&loginname> '
alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
SET TIMING ON
SET TIME ON
SET SERVEROUTPUT ON
SET LINESIZE 130
SET TERM ON
SET NUMWIDTH 13
SET PAGESIZE 1000
SET ECHO ON
5. session登录安全设置
# vi /etc/pam.d/login #增加以下一行
session required pam_limits.so
6. 相关RPM包的安装
根据Oralce官方文档,在RHEL 5.6 x86_64中安装GI和DB,需要安装以下RPM包
unixODBC-devel-2.2.14-12.el6_3.x86_64
expat-2.0.1-11.el6_2.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64-
elfutils-libelf-0.152-1.el6.x86_64
glibc-devel-2.12-1.132.el6.x86_64
libgcc-4.4.7-4.el6.i686
glibc-common-2.12-1.132.el6.x86_64
binutils-2.20.51.0.2-5.36.el6.x86_64
unixODBC-2.2.14-12.el6_3.x86_64
elfutils-libelf-devel-0.152-1.el6.x86_64
gcc-4.4.7-4.el6.x86_64
gcc-c++-4.4.7-4.el6.x86_64
libgcc-4.4.7-4.el6.x86_64
libstdc++-4.4.7-4.el6.x86_64
libaio-0.3.107-10.el6.x86_64
libaio-devel-0.3.107-10.el6.x86_64
sysstat-9.0.4-22.el6.x86_64
pdksh-5.2.14-1.i386
glibc-2.12-1.132.el6.x86_64
glibc-headers-2.12-1.132.el6.x86_64
glibc-2.12-1.132.el6.i686
make-3.81-20.el6.x86_64
libstdc++-devel-4.4.7-4.el6.x86_64
其他RPM包安装
rpm -ivh unzip-5.52-3.el5.x86_64.rpm
rpm -ivh lrzsz-0.12.20-22.1.x86_64.rpm
在包已经全部装好以后,我们可以通过如下的命令来检测rpm包的安装情况:
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat \
unixODBC unixODBC-devel | grep "not installed"
对于缺包,我们可以通过两种方法来配置yum源
1) 安装本地镜像的yum源
cd /etc/yum.repos.d
[root@node1 yum.repos.d]# cp rhel-debuginfo.repo yum.repo
[root@node1 yum.repos.d]# mv rhel-debuginfo.repo rhel-debuginfo.repo.bk
[root@node1 yum.repos.d]#vi yum.repo
[base]
name=Red Hat Enterprise Linux
baseurl=file:///media/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release