Centos利用xmanager安装oracle 11g

centOS x64系统上安装 oracle 11g R2 x64

1、首先到官网上下载oracle 11g x64位软件包

下载地址:

     http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

     http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

2、安装包检测及安装

[root@struggle ~]# rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh tcl
 其中要安装几个32位的包:

    binutils
  compat-libstdc++
  compat-libstdc++(32 bit)
  elfutils-libelf
  elfutils-libelf-devel
  gcc
  gcc-c++
  glibc
  glibc(32 bit)
  glibc-common
  glibc-devel
  glibc-devel(32 bit)
  libaio
  libaio(32 bit)
  libaio-devel
  libgcc
  libgcc (32 bit)
  libstdc++
  libstdc++ (32 bit)
  libstdc++-devel
  make
  sysstat 
 

 3、查看内在及swap,对于服务器来说,肯定是没有问题的(如果安装系统时分了swap分区则可以免去这一步)

[root@struggle ~]#  grep MemTotal /proc/meminfo
 

[root@struggle ~]# grep SwapTotal /proc/meminfo
 

(1)创建/home/swap分区文件。文件的大小是5120000个block,1个block为1K。

dd if=/dev/zero of=/home/swap bs=1024 count=5120000
  (2)把这个分区变成swap分区。

mkswap /home/swap
  (3)把它加到fstab里面

echo "/home/swap swap swap defaults 0 0" >> /etc/fstab
 

 4、配置内核

[root@struggle ~]#  vim  /etc/sysctl.conf

# Kernel paramaters required by Oracle 11gR1 
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
保存并使之生效: [root@struggle ~]# /sbin/sysctl -p

如果有如下提示错误,忽略!

error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key

error: "net.bridge.bridge-nf-call-iptables" is an unknown key

error: "net.bridge.bridge-nf-call-arptables" is an unknown key

注意: kernel.shmmax's 的值是物理内存的一半。

5、对oracle 帐号进行资源限制

[root@struggle ~]# vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

6、登录认证配置pam模块

[root@struggle ~]# vim /etc/pam.d/login

session required pam_limits.so
session required /lib/security/pam_limits.so (如果是32位系统则要加上这一句)
 

7、为oracle用户在bash和ksh中设定资源限制编辑文件

[root@struggle ~]# 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
8、 创建操作系统用户,作为软件安装和支持组的拥有者

[root@struggle ~]# groupadd oinstall 
[root@struggle ~]# groupadd dba 
[root@struggle ~]# useradd -g oinstall -G dba oracle 
[root@struggle ~]# passwd oracle
 

9、创建软件安装目录

[root@struggle ~]# mkdir -p /usr/u01/app/
[root@struggle ~]# chown -R oracle:oinstall /usr/u01/
[root@struggle ~]# chmod -R 755 /usr/u01/
 

10、设置环境变量

[root@struggle ~]# vi /home/oracle/.bash_profile

# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/bin
 
export PATH
 
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/usr/u01/app; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$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
umask 022
 

11、将下载的oracle 11g 安装包解压到/home/oracle目录下

[root@struggle ~]# unzip linux.x64_11gR2_database_1of2.zip -d /home/oracle
 
[root@struggle ~]# unzip linux.x64_11gR2_database_2of2.zip -d /home/oracle
 

12、进入/home/oracle/database目录下检查文件是否都在

[root@struggle database]# cd /home/oracle/database

[root@struggle database]# ls -al

总用量 44
drwxr-xr-x.  8 root   root     4096  8月 21 2009 .
drwx------.  5 oracle oinstall 4096 12月  5 14:19 ..
drwxr-xr-x. 12 root   root     4096  8月 17 2009 doc
drwxr-xr-x.  4 root   root     4096  8月 15 2009 install
drwxrwxr-x.  2 root   root     4096  8月 15 2009 response
drwxr-xr-x.  2 root   root     4096  8月 15 2009 rpm
-rwxr-xr-x.  1 root   root     3226  8月 15 2009 runInstaller
drwxrwxr-x.  2 root   root     4096  8月 15 2009 sshsetup
drwxr-xr-x. 14 root   root     4096  8月 15 2009 stage
-rw-r--r--.  1 root   root     5402  8月 18 2009 welcome.html
 

13、关闭防火墙

[root@struggle database]#  service iptables stop

13.1 设置颜色
su - root
xhost +
================================================================================================
# 解决问题
[root@localhost ~]# export DISPLAY=localhost:1     #  必须以root身份

[root@localhost ~]# xhost +

access control disabled, clients can connect from any host

在设置xhost时,出现了unable的问题。
yum -y install tigervnc-server
vncserver   # 会提示输入两次密码

================================================================================================
设置语言,否则乱码
export LANG=en_US.UTF-8
设置DISPLAY
export DISPLAY=192.168.1.105:0.0

准备:

yum -y install xorg-x11-apps-7.7-7.el7.x86_64

yum grouplist

yum groupinstall "X Window System"

yum groupinstall Desktop

14、xmanager安装oracle

打开xstart 输入连接信息(oracle用户登录),小三角选择linux

登录运行 ./runInstaller

安装步骤介绍:

第一步:填写email信息,以便得到支持(需要联网)

第二步:选择创建并配置一个数据库

第三步:选择服务端(看自己情况)

第四步:选择单实例数据库安装

第五步:选择自定义安装

第六步:选择产品语言

第七步:选择要安装的版本

第八步:选择安装路径(配置环境变量进的路径)

第九步:选择数据库实例名:orcl

第十步:选择数据字符集:ZHS16GBK

一路默认安装下去,到十七步的时候oracle检测必须组件,选择ignore all,这样选择安装完oracle后,oracle是可以正常工作的。

猜你喜欢

转载自blog.csdn.net/weixin_39845407/article/details/81189516