1. 配置機器名
[root@SAMPLE ~]# hostname
---------------------------------------------------------------------------------------
XAG102.COM
---------------------------------------------------------------------------------------
[root@SAMPLE ~]# cat /etc/sysconfig/network
---------------------------------------------------------------------------------------
# Created by anaconda
NETWORKING=yes
HOSTNAME=XAG102
---------------------------------------------------------------------------------------
[root@SAMPLE ~]# cat /etc/hosts
---------------------------------------------------------------------------------------
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.40.140 XAG140 XAG140.COM
---------------------------------------------------------------------------------------
[root@SAMPLE ~]# cat /etc/hostname
---------------------------------------------------------------------------------------
XAG102.COM
---------------------------------------------------------------------------------------
[root@SAMPLE ~]# reboot
3.关闭防火墙
service iptables stop
chkconfig iptables off
setenforce 0
4.关闭SELINUX
cd /etc/selinux/
vi config
把参数SELINUX改为disabled
/*
yum install automake-1.11.1-4.el6.noarch -y
yum install binutils* -y
yum install compat* -y
yum install control* -y
yum install gcc* -y
yum install glibc* -y
yum install gnome* -y
yum install libstdc* -y
yum install make* -y
yum install ksh* -y
yum install sysstat* -y
yum install libXp.i686 libXp-devel.i686 libXt.i686 libXt-devel.i686 -y
yum install libXtst.i686 -y
yum install libXtst-devel.i686 make.x86_64 gcc.x86_64 libaio.x86_64 glibc-devel.i686 libgcc.i686 -y
yum install glibc-devel.x86_64 compat-libstdc++-33 -y
yum install glibc* gcc* make* compat-db* libstdc* libXp* libXtst*-y
yum install compat-libstdc++* -y
*/
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp
yum install libXp.i686 libXp-devel.i686 libXt.i686 libXt-devel.i686 -y
yum install libXtst.i686 -y
yum install libXtst-devel.i686 make.x86_64 gcc.x86_64 libaio.x86_64 glibc-devel.i686 libgcc.i686 -y
-----------------------------for 11G-----------------------------------------------------------------------------------
1.2.4 安装pdksh-5.2.14和rlwrap
复制代码
wget https://files.cnblogs.com/files/llill/pdksh-5.2.14-30.x86_64.rpm.tar.gz
--tar zxvf pdksh-5.2.14-30.x86_64.rpm.tar.gz
rpm -qa | grep ks
rpm -e ksh*
rpm -ivh pdksh-5.2.14-37.el5_8.1.i386.rpm
wget https://files.cnblogs.com/files/llill/rlwrap-0.42.tar.gz
yum -y install readline*
tar -xvf rlwrap-0.42.tar.gz
cd rlwrap-0.42
./configure
make && make install
Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'.
----------------------------------------------------
vim $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
---------------------------------------------------------------------------------------------------------
5.然后修改内核参数:
修改内核参数vim /etc/sysctl.conf,添加:
复制代码
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1610612736
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
vm.hugetlb_shm_group=1002 #这里1002是oracle用户组dba的gid,原文这里没有配置,这里一定要配置,要不然后面每次重启后,启动oracle实例都会碰到一个错误,具体的在下文会说到
上面的kernel.shmmax = 内存的一半(如3G=3*0.5*1024*1024*1024=1610612736)。
改好后,使之生效:
sysctl -p
重新调整内核参数以适应11.2.0.4
vi /etc/sysctl.conf 增加以下内容
net.ipv4.ip_local_port_range = 9000 65500
6.修改系统限制
vim /etc/security/limits.conf
末尾加上:
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 16384
oracle hard nofile 65536
oracle soft stack 10240
7.实现可插入认证:
vi /etc/pam.d/login
末尾加上:
session required /lib/security/pam_limits.so
8.建立oracle用户与组,并修改oracle用户的密码
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo "123456" | passwd --stdin oracle #oracle用户的登录密码,后续登录要用,记着。
echo 1002 >/proc/sys/vm/hugetlb_shm_group #(这个在这里执行可以避免后面安装时的错误,有兴趣可以网上查下哦,1002为dba组号)
9.建立相应的目录并改变拥有者和访问权限
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app
mkdir -p /u01/tmp
chown -R oracle:oinstall /u01/tmp
chmod -R 775 /u01/tmp
10.修改版本标识,以安装相对rhel6而言较老的oracle
可以先保存一份:
cp /etc/redhat-release /etc/redhat-release.bak
vi /etc/redhat-release
原:CentOS Linux release 7.3.1611 (Core)
修改为: redhat-4
修改ulimit:vim /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
11.切换到oracle用户(注意空格)
su - oracle
建立相应的环境变量
vim ~/.bash_profile
最后行加入:
#Oracle Settings
export DISPLAY=10.0.0.85:0.0
TMP=/u01/tmp
TMPDIR=/u01/tmp
export TMP TMPDIR
ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=MPACC
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
PATH=/usr/sbin:$PATH
PATH=$ORACLE_HOME/bin:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1;export LD_ASSUME_KERNEL
export LANG=en_US.utf8
export LANGUAGE=en_US.utf8
export NLS_LANG="AMERICAN_AMERICA.UTF8"
export LC_ALL=en_US.utf8
保存,并使参数生效
source .bash_profile
14.新开一个终端窗口,切换到oracle用户,进入到安装目录,开始安装
su - oracle
cd /tmp/oracle/database
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -idmv < 10201_database_linux_x86_64.cpio
./runInstaller
开始安装,不出意外的就可以看到安装的图形界面啦
我们选择高级安装
安装过程中选择character set时选择 simplified chinese ZHS16GBK,
其他基本都是直接下一步就好
15.安装结束,恢复版本信息
vi /etc/redhat-release
改回:Red Hat Enterprise Linux Server release 6.6 (Santiago)
cp /etc/redhat-release.bak /etc/redhat-release
-------------------------------------------------------
dd if=/dev/zero of=/swapfile bs=1k count=100000000
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >>/etc/fstab
---------------------------------------------------------
根据提示查看日志,并没发现帮助信息,如下所示:
复制代码 代码如下:
[root@hyl ~]# tail -f /u01/app/oracle/oraInventory/logs/installActions2014-09-20_02-43-00PM.log
INFO: make[1]: Leaving directory `/u01/app/oracle/product/10.2.0/db_1/sysman/lib'
INFO: make: *** [nmccollector] Error 2
INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'collector' of makefile '/u01/app/oracle/product/10.2.0/db_1/sysman/lib/ins_emdb.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2014-09-20_02-43-00PM.log' for details.
Exception Severity: 1
处理方法:
这里继续点击“continue”即可,待Oracle完成安装后,再手工执行相应脚本完成链接即可。
当oracle完成安装后,如下操作
[oracle@hyl bin]$ /u01/app/oracle/product/10.2.0/db_1/bin/relink all
--执行脚本后,会自动完成重链接操作
--注意:该脚本放置在脚本目录下,实际根据规划的oracle根目录进行查找即可
--------------------------------------------------------------------------
1.修改jdk 下面的字体。
[root@Eleven ~]# su - oracle
[oracle@ www.linuxidc.com ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@ www.linuxidc.com lib]$ mv font.properties font.properties_bak
[oracle@ www.linuxidc.com lib]$ cp font.properties.zh_TW.Redhat font.properties cp font.properties.zh_CN.Redhat font.properties
[oracle@ www.linuxidc.com lib]$ vim font.properties
最后一行修改为:
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/zysong.ttf
2.修改jre 下面的字体
[oracle@ www.linuxidc.com lib]$ cd $ORACLE_HOME/jre/1.4.2/lib
[oracle@ www.linuxidc.com lib]$ mv font.properties font.properties_bak
[oracle@ www.linuxidc.com lib]$ cp font.properties.zh_CN.Redhat font.properties
3.清除em的cache
[oracle@ www.linuxidc.com lib]$ cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
[oracle@ www.linuxidc.com lib]$ rm *.gif
4. 重新启动em
[oracle@ www.linuxidc.com zhs]$ emctl stop dbconsole
[oracle@ www.linuxidc.com zhs]$ emctl start dbconsole
再次登录页面就正常了:
root用户执行
mkdir -p /usr/share/fonts/zh_CN/TrueType/
將 zysong.ttf 文件放到 此目錄下1.修改jdk 下面的字体。
[root@Eleven ~]# su - oracle
[oracle@ www.linuxidc.com ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@ www.linuxidc.com lib]$ mv font.properties font.properties_bak
[oracle@ www.linuxidc.com lib]$ cp font.properties.zh_TW.Redhat font.properties
[oracle@ www.linuxidc.com lib]$ vim font.properties
最后一行修改为:
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/zysong.ttf
2.修改jre 下面的字体
[oracle@ www.linuxidc.com lib]$ cd $ORACLE_HOME/jre/1.4.2/lib
[oracle@ www.linuxidc.com lib]$ mv font.properties font.properties_bak
[oracle@ www.linuxidc.com lib]$ cp font.properties.zh_CN.Redhat font.properties
3.清除em的cache
[oracle@ www.linuxidc.com lib]$ cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
[oracle@ www.linuxidc.com lib]$ rm *.gif
4. 重新启动em
[oracle@ www.linuxidc.com zhs]$ emctl stop dbconsole
[oracle@ www.linuxidc.com zhs]$ emctl start dbconsole
再次登录页面就正常了:
root用户执行
mkdir -p /usr/share/fonts/chinese/TrueType/
將 zysong.ttf 文件放到 此目錄下
-----------------------------------------------------------------------------------------------------------------------------------
[root@XAG105 ~]# id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba),1003(oper)
进入root用户
修改内核参数vim /etc/sysctl.conf
#
加入如下的内容,其中1002为dba组号,需要根据你实际的情况进行改变。
vm.hugetlb_shm_group = 1002
# sysctl -p