====添加IP条目
/etc/hosts
vi /etc/hosts
192.168.90.158 demodb
==== YUM源配置
1. 将光盘mount到/media目录
mount /dev/cdrom /media
2. 重命名其他的repo,创建一个rhel-base.repo
(1). cd /etc/yum.repos.d/
### 重命名此目录底下存在的repo文件(例如:mv rhel-source.repo rhel-source.repo.bak)
(2). 创建rhel-base.repo
vi rhel-base.repo
[base]
name=base
baseurl=file:///media
enabled=1
gpgcheck=0
3. (非必须,构建资料库,可作为验证)
yum makecache
==== 安装必要LIB包
1. 第一类包
(1). 检查下列包是否存在
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) '
binutils
glibc
ksh
libaio
libgcc
libstdc++
make
(2). 安装缺少的包
#### 如果提示 is not installed. 使用yum -y install 进行安装
2. 第二类包
(1). 检查下列包是否存在
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})" | grep compat-libstdc++ ### 默认没有安装
(2). 安装缺少的包
### 如果不存在,使用下述命令进行安装 yum install compat-libstdc++* -y
3. 第三类包
(1). 检查下列包是否存在
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) '
compat-libcap1
gcc
gcc-c++
glibc-devel
libaio-devel
libstdc++-devel
sysstat
(2). 安装缺少的包
#### 如果提示 is not installed. 使用yum -y install 进行安装
=== 系统参数调整(针对Oracle数据库)
(1). 配置文件修改
cat >> /etc/sysctl.conf <
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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=1048576
EOF
(2). 使配置生效
sysctl -p
==== 数据库用户组&目录创建
1. 创建Oracle安装目录
mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
2. 创建用户跟组
(1). 创建组
groupadd -g 1100 oinstall
groupadd -g 1101 dba
groupadd -g 1102 oper
(2). 创建用户
useradd -u 1100 -g oinstall -G dba,oper -d /home/oracle -m oracle
(3). 修改密码(统一改为Oracle_888)
echo -n Oracle_888 | passwd --stdin oracle
(4). 修改安装目录属主
chown -R oracle:oinstall /u01/app
=== 配置SHELL Limits 限制
1. Create a file labeled 99-grid-oracle-limits.conf within /etc/security/limits.d/ as follows
(1). 创建个空文件
touch /etc/security/limits.d/99-grid-oracle-limits.conf
(2). 文件中输入以下内容
cat >> /etc/security/limits.d/99-grid-oracle-limits.conf <
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
EOF
2. create a shell script labeled oracle-grid.sh within /etc/profile.d/ to create the ulimits for the oracle and grid user.
(1). 创建个空文件
touch /etc/profile.d/oracle-grid.sh
(2). 编辑文件
vi /etc/profile.d/oracle-grid.sh
#Setting the appropriate ulimits for oracle and grid user
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
==== 配置用户环境变量
[root@demodb oracle]# su - oracle
[oracle@demodb ~]$ vi .bash_profile
###########################
# Set the variables required
############################
ORACLE_BASE="/u01/app/oracle"
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_HOME
ORACLE_SID="demodb"
export ORACLE_SID
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export LD_LIBRARY_PATH
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
NLS_LANG="American_America.ZHS16GBK"
export NLS_LANG
NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export NLS_DATE_FORMAT
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH
==== 禁用selinux以及其他不必要的服务随机启动
1. 检查下列服务自启动状况
su - root
chkconfig --list iptables
chkconfig --list kdump
chkconfig --list NetworkManager
2. 停止下列服务
service iptables stop
service NetworkManager stop
3. 禁止随机启动
chkconfig iptables off
chkconfig kdump off
chkconfig NetworkManager off
4. 禁用SELinux
vi /etc/selinux/config
### 将SELINUX=enforcing 改成SELINUX=disabled
=== 完成此步后,重启SERVER验证 上述所有配置
reboot