一、安装VNC (无法直接输出图形化界面)
二、安装rlwrap (提前安装了,用于sqlplus历史记录)
三、查看系统信息
查看及修改主机名
hostname
sed -i "s/localhost.localdomain/node1/g" /etc/sysconfig/network
echo 192.168.1.100 node1 >> /etc/hosts
查看系统信息
[root@gz-rlxt-vm2 ~]# uname -a Linux gz-rlxt-vm2 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@gz-rlxt-vm2 ~]# cat /proc/version
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010
[root@gz-rlxt-vm2 ~]# cat /etc/redhat-release
CentOS release 6.8 (Final)
[root@gz-rlxt-vm2 ~]# lsb_release -a LSB
Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga
操作系统要求
Oracle Database 11g Release 1 (11.1) 要求安装在下面版本的操作系统或后续版本中。安装Oracle数据库是必须检查目前操作系统版本是否支持。
■ Asianux Server 3 SP2
■ Asianux Server 4 SP3
■ Oracle Linux 4 Update 7
■ Oracle Linux 5 Update 2 (with Red Hat Compatible Kernel)
■ Oracle Linux 5 Update 5
■ Oracle Linux 6
■ Oracle Linux 6 (with Red Hat Compatible Kernel)
■ Oracle Linux 7
■ Oracle Linux 7 (with the Red Hat Compatible Kernel)
■ Red Hat Enterprise Linux 4 Update 7
■ Red Hat Enterprise Linux 5 Update 2
■ Red Hat Enterprise Linux 6
■ Red Hat Enterprise Linux 7
■ SUSE Linux Enterprise Server 10 SP2
■ SUSE Linux Enterprise Server 11
■ SUSE Linux Enterprise Server 12 SP1
■ NeoKylin Linux Advanced Server 6
操作系统内核要求
下面仅仅列举了部分内容,更多请见官方文档
■On Oracle Linux 4 and Red Hat Enterprise Linux 4
2.6.9 or later
■ On Oracle Linux 5 Update 2 with Red Hat Compatible Kernel
2.6.18 or later
■ On Oracle Linux 5 Update 5 with Red Hat Compatible Kernel
2.6.18 or later
■ On Oracle Linux 5 Update 5 with Unbreakable Enterprise Kernel
2.6.32-100.0.19 or later
■ On Oracle Linux 6
2.6.32-100.28.5.el6.x86_64 or later
■ On Oracle Linux 6 with Red Hat Compatible Kernel
2.6.32-71.el6.x86_64 or later
■ On Oracle Linux 7
3.8.13-33.el7uek.x86_64 or later
■ On Oracle Linux 7 with Red Hat Compatible Kernel
3.10.0-54.0.1.el7.x86_64 or later
■ On Red Hat Enterprise Linux 5 Update 2
2.6.18 or later
■ On Red Hat Enterprise Linux 5 Update 5
2.6.18 or later
■ On Red Hat Enterprise Linux 6
2.6.32-71.el6.x86_64 or later
■ On Red Hat Enterprise Linux 7
3.10.0-54.0.1.el7.x86_64 or later
■ On Asianux Server 3
2.6.18 or later
■ On Asianux Server 4
2.6.32-71.el6.x86_64 or later
查看硬件配置
官方文档中,要求物理内存至少需要1G,推荐2G或以上配置,如果是服务器的话,配置肯定比这个高。查看系统内存配置,可以使用下面命令:
检查物理内存
Swap空间要求内存小于2G,swap空间至少1.5倍的内存;内存2G-16G Swap>=系统内存;>16G Swap=16G即可
[root@DB-Server ~]# grep MemTotal /proc/meminfo
MemTotal: 3968144 kB
[root@DB-Server ~]# free -m
total used free shared buffers cached
Mem: 3875 710 3164 0 85 317
-/+ buffers/cache: 307 3567
Swap: 5887 0 5887
如果没有swap,或者不够,添加
dd if=/dev/zero of=/u01/swaphaha bs=1M count=2048
mkswap /u01/swaphaha
swapon /u01/swaphaha
vi /etc/fstab 添加
/u01/swaphaha swap swap defaults 0 0
------------------------------------------------------------------------------------
查看磁盘空间
/dev/shm (从Oracle Database 11g开始,自动内存管理(Automatic Memory Management)要求更多的共享内存(/dev/shm)和文件描述符(file descriptors),共享内存的大小应该只是比MEMROY_MAX_TARGET 和MEMROY_TARGET大。
[root@DB-Server ~]# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.9G 927M 1012M 48% /dev/shm
修改tmpfs
vi /etc/fstab
在 tmpfs 后面的 defaults 加上,size=2G
cat /etc/fstab
然后
mount -o remount /dev/shm
关闭防火墙
[root@gz-rlxt-vm2 ~]# chkconfig iptables off
[root@gz-rlxt-vm2 ~]# service iptables stop
或
[root@gz-rlxt-vm2 ~]# systemctl stop firewalld.service
操作系统语言
[root@gz-rlxt-vm2 ~]# more /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
四、安装oracle依赖包
配置yum(没有配置的情况下)
mount /dev/cdrom /media
cd /etc/yum.repos.d/
cp rhel-debuginfo.repo yum.repo
vi yum.repo
标签改成任意,比如[haha]
修改 baseurl 为 file:///media/Server 注意大小写。
enable 改成 1
安装oracle依赖包
yum install -y binutils-* compat-libstdc++-* elfutils-libelf-* elfutils-libelf-devel-* gcc-* gcc-c++-* glibc-* glibc-common-* glibc-devel-* glibc-headers-* ksh-* libaio-* libaio-devel-* libgcc-* libstdc++-* make-* sysstat-* expat-* pdksh-* unixODBC-* libXp-*
# rpm -q package_name
rpm -q --qf '%{name}-%{VERSION}-%{RELEASE} (%{ARCH})\n' \
binutils \
compat-libstdc++-33-3.2.3 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel
创建oracle用户
groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper
useradd -u 500 -g oinstall -G dba,oper oracle
passwd oracle
创建安装目录
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/cfgtoollogs
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory/
chmod -R 775 /u01/app/oraInventory/
修改参数文件
cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 8589934592
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 = 1048576
EOF
[root@DB-Server ~]# sysctl -p
注:
kernel.shmall = 内存大小/4k=8G*1024*1024/4k = 2097152
kernel.shmmax = 20*1024*1024=20971520 而默认的为68719476736,那么使用默认值
fs.file-max = 6815744 #设置最大打开文件数
kernel.shmall = 2097152 #共享内存的总量,8G内存设置:8G*1024*1024/4k = 2097152
kernel.shmmax = 8589934592 #最大共享内存的段大小
kernel.shmmni = 4096 #整个系统共享内存端的最大数
net.ipv4.ip_local_port_range = 9000 65500 #可使用的IPv4端口范围
Oracle 11g新增了fixup脚本,在安装过程中,安装程序将会检查推荐的操作系统内核参数设置以及必须的软件包,对于不符合要求的部分将会自动生成runfixup.sh,只需要手动以root用户执行该脚本即可,不需要手动调整配置了
------------------------------------------------------------------------------------
将配置文件加入登陆验证模块
cat >>/etc/pam.d/login << EOF
session required pam_limits.so
EOF
------------------------------------------------------------------------------------
修改操作系统对oracle用户资源的限制
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF
------------------------------------------------------------------------------------
更改环境变量文件
cat >> /etc/profile << EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
[root@DB-Server ~]# source /etc/profile
------------------------------------------------------------------------------------
修改oracle环境变量
cat >> /home/oracle/.bash_profile << EOF
export EDITOR=vi
export ORACLE_SID=PROD
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib
export PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
umask 022
EOF
su - oracle
source .bash_profile
cat .bash_profile
解压安装
vnc启动是在oracle用户下
netca
dbca