centos6 x86 安装 oracle 11g2r 日志

一.安装centos 6.5

二.安装ora所需的库

三.修改centos内核

四.建用户组和目录结构等

五.安装ora11g2r

六.安装sqlplus的翻页程序和help补丁

七.自启动脚本

八.常用命令

################################################################

一. 安装centos6.5 x86

安装centos 6 x86,选择desktop ,选择 “开发” 勾选 “开发工具”和“附加开发” 两项。内存2G,swap分区4200M

二. 安装补丁包

1.安装系统包

查询缺少的包

rpm -q binutils-2.20.51.0.2  compat-libcap1 compat-libstdc++-33-3.2.3  gcc-4.4.7  gcc-c++-4.4.7  glibc-2.12 glibc-devel-2.12 libgcc libstdc++- libstdc++-devel  libgcc libstdc++- libstdc++-devel libaio-0.3.107 libaio-devel-0.3.107  make-3.81 sysstat-9.0.4

如果按照前面的勾选,此时会缺少三个包,安装包,将光盘挂接,进入光盘目录,安装

rpm -ivh compat-libcap1-1.10-1.i686.rpm compat-libstdc++-33-3.2.3-69.el6.i686.rpm libaio-devel-0.3.107-10.el6.i686.rpm

2. 安装unix数据驱动包

查询 rpm -q unixODBC-2.2.14 unixODBC-devel-2.2.14

安装

rpm -ivh unixODBC-2.2.14*.rpm unixODBC-devel-2.2.14*.rpm

3. 安装ksh

按照oracle的官方文档,安装ksh时,报错。怀疑为版本高,不兼容。后安装低版本解决

wget ftp://sdgtxuyong:xxxxx@192.168.7.66/tools/database/oracle11/ksh-20100621-18.el5.i386.rpm

wget ftp://sdgtxuyong:xxxxx@192.168.7.66/tools/database/oracle11/pdksh-5.2.14-37.el5_8.1.i386.rpm

 

rpm -ivh ksh-20100621-18.el5.i386.rpm

rpm -ivh pdksh-5.2.14-37.el5_8.1.i386.rpm

 

4. 解决安装时的中文乱码

缺少 "中易宋体18030" v2.01

mkdir -p /usr/share/fonts/zh_CN/TrueType

cd /usr/share/fonts/zh_CN/TrueType

wget ftp://sdgtxuyong:xxxxx@192.168.7.66/tools/database/oracle11/zysong.ttf

5. 关闭 iptables

chkconfig iptables off

chkconfig ip6tables off

三. 修改linux内核参数

1.修改控制文件

vim /etc/sysctl.conf

kernel.shmmni = 8192

kernel.sem =250 32000 100 128

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000  65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576

2.修改许可文件

vim  /etc/security/limits.conf

*  soft  nproc  2047

*  hard  nproc  16384

*  soft  nofile 1024

*  hard  nofile 65536

3.修改登陆安全文件

vim /etc/pam.d/login

session  required  pam_limits.so

4.修改selinux

vim /etc/selinux/config

SELINUX=disabled

5.修改主机名

vim /etc/hosts 

删除掉所有其他的条目 只留一条

192.168.7.72            ora.tralinhotel.cn    ora

三.建用户组和目录结构等

1.建用户和组,并设置密码

groupadd oinstall

groupadd dba

groupadd oper

groupadd asmadmin

useradd -g oinstall -G dba,oper,asmadmin oracle

passwd oracle

2.建目录结构

mkdir -p /u01/app/oracle/product/11.2.0/

mkdir /u01/oradata

chmod -R 755 /u01

chown -R oracle.oinstall /u01

3.修改环境变量

vim /home/oracle/.bash_profile

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/

export ORACLE_SID=ora

export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/sbin:/usr/local/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib

export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export LANG="zh_CN.UTF-8"

export ORACLE_TERM=vt100

if [ $USER = "oracle" ] ;

  then  if [ $SHELL = "/bin/ksh" ] ;

    then    ulimit -p 16384

         ulimit -n 65536  

    else  

        ulimit -u 16384 -n 65536  

      fi

    fi

4.即时生效 在终端运行 

/sbin/sysctl -p

五.安装oracle 11g2r

1.下载ora11g2r

su - oracle

wget ftp://sdgtxuyong:xxxxx@192.168.7.66/tools/database/oracle11/linux_11gR2_database_1of2.zip

wget ftp://sdgtxuyong:xxxxx@192.168.7.66/tools/database/oracle11/linux_11gR2_database_2of2.zip

unzip  linux_11gR2_database_1of2.zip

unzip  linux_11gR2_database_2of2.zip

2.到ui界面,用root开启xhost+

xhost +

3.安装ora11g2r

su - oracle

cd database

./runInstaller

4.修改tmpfs的分区大小 ( 在centos6下,安装了3次无报错,但是在centos5下,报bug)

vim /etc/fstab

tmpfs           default,size=6g 0 0

六.安装sqlplus的翻页程序和help补丁

1.sqlplus翻页程序

wget ftp://sdgtxuyong:xxxxxx@192.168.7.66/tools/database/oracle11/rlwrap-0.37.tar.gz

tar zxvf rlwrap-0.37.tar.gz

./configure

make && make install

写入用户环境变量

# echo 'alias sqlplus="rlwrap sqlplus"'>> /home/oracle/.bash_profile

2.安装帮助help

用 system登陆

@?/sqlplus/admin/help/hlpbld.sql helpus.sql

用法:help shutdown

3.证书bug 浏览器会报证书秘钥长度过短错误。

certutil -setreg chain\minRSAPubKeyBitLength 512

七. 自启动脚本(###待续)

八. 常用命令 

sqlplus / as sysdba

1.开启关闭

startup nomount | mount | open

alter database mount | open

shutdown immediate

2.监听服务

lsnrctl

3.当前用户名和表空间

select username,default_tablespace from user_users;

4.开启oem监控命令

emctl start|stop dbconsole

5.用户

创建 create user 用户名 identified by 口令 [account lock|unlock]

解锁 alter user 用户名 account lock|unlock;

授权 grant CONNECT, RESOURCE TO 用户名;

回收 revoke CONNECT, RESOURCE FROM 用户名;

 

posted @ 2014-04-10 15:40  琴声清幽  阅读(430)  评论(0编辑  收藏  举报