redhat6.8 + oracle 11g - 2020-12

2020-12-05  本文已影响0人  stevenlyb

1、系统基本信息

# 2020年12月5日  虚拟机测试安装
host:r6811g
192.168.1.183
192.168.1.1
10.10.10.20
root密码:123456
oracle: oracle


#时间
date -s 2019-05-13
date -s 14:15:00
hwclock 查看硬件时间

#防火墙、selinux
service iptables stop
chkconfig iptables off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak

2、配置源-安装依赖包

#yum源
#有两种方式:第一、使用163源,经过测试国内163源,centos6已经没有了;第二、使用光盘作为源
#第一种方式如下:
1.切换到yum源存放目录
[root@r6811g  ~]# cd /etc/yum.repos.d/

2.wget方式下载网易Centos yum源
[root@r6811g yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

3.修改文件名,备份自带redhat源
[root@r6811g yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak
[root@r6811g yum.repos.d]# mv CentOS6-Base-163.repo rhel-source.repo

4.修改repo文件中的版本号
[root@r6811g yum.repos.d]# sed -i "s;\$releasever;6;g" rhel-source.repo

5.清除原有缓存
[root@r6811g yum.repos.d]# yum clean all

6.获取yum列表
[root@r6811g yum.repos.d]# yum makecache

#yum安装  rpm -Uvh *  使用此命令安装下边的包
python-urlgrabber-3.9.1-11.el6.noarch.rpm 
yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm 
yum-3.2.29-81.el6.centos.noarch.rpm 
yum-updateonboot-1.1.30-40.el6.noarch.rpm 
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 
yum-utils-1.1.30-40.el6.noarch.rpm

#依赖包
yum -y install gcc
yum -y install elfutils-libelf-devel
yum -y install gcc-c++
yum -y install libstdc++-devel
yum install -y binutils-* compat-db* compat-db-* control-center* gcc-* gcc-c++-* glibc-* glibc-common-* gnome-libs-* make-* pdksh* sysstat-* xscreensaver-* make-* gdb-6.1post-* glibc-* glibc-common-* glibc-devel-* glibc-devel-* compat-gcc-* compat-gcc-c++-* compat-libstdc++-* compat-libstdc++-devel-* gnome-libs-* libstdc++-* libstdc++-devel-* openmotif-* sysstat-* setarch-* libaio-* libaio-devel-* libXp* libXp-devel* elfutils-libelf-devel* unixODBC-* unixODBC-devel-* compat-libcap1.x86_64 libcap.so.1 sg3_utils


#第二种方式:以光盘为源
df -h     #查看光盘挂载路径
mkdir /yum   #创建yum文件夹
cp -r /media/RHEL-6.8\ Server.x86_64/* /yum    #将光盘内文件拷贝到yum
etc/yum.repos.d     #到源配置目录 
touch yum_repo.repo    #新建文件
vim yum_repo.repo     #编辑文件
#写入:
[yum_repo]
name=yum_repo
baseurl=file:///yum
enable=1
gpgcheck=1
gpgkey=file:///yum/RPM-GPG-KEY-redhat-release

yum clean all   #清理缓存
yum makecache   #建立新缓存
yum repolist    #查看仓库

#安装依赖包
yum -y install gcc
yum -y install elfutils-libelf-devel
yum -y install gcc-c++
yum -y install libstdc++-devel
yum install -y binutils-* compat-db* compat-db-* control-center* gcc-* gcc-c++-* glibc-* glibc-common-* gnome-libs-* make-* pdksh* sysstat-* xscreensaver-* make-* gdb-6.1post-* glibc-* glibc-common-* glibc-devel-* glibc-devel-* compat-gcc-* compat-gcc-c++-* compat-libstdc++-* compat-libstdc++-devel-* gnome-libs-* libstdc++-* libstdc++-devel-* openmotif-* sysstat-* setarch-* libaio-* libaio-devel-* libXp* libXp-devel* elfutils-libelf-devel* unixODBC-* unixODBC-devel-* compat-libcap1.x86_64 libcap.so.1 sg3_utils

3、资源限制修改

#修改用户的shell限制,新增(在 #End of file 之前)
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536


vi /etc/pam.d/login   #新增
session required /lib/security/pam_limits.so
session required pam_limits.so


vi /etc/sysctl.conf   #新增
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1054504960
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni   
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=1048586
sysctl -p       #执行


vi /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

4、 安装oracle

#上传oracle11g安装包
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip


#oracle用户环境变量
创建用户,root下执行:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle  #输入密码

#创建文件目录
mkdir /home/oracle/app
mkdir /home/oracle/app/oracle
mkdir /home/oracle/app/oradata
mkdir /home/oracle/app/oracle/product
chown -R oracle:oinstall /home/oracle/app

#环境变量
su - oracle
vi .bash_profile
新增
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=/home/oracle/app/product/11.2.0/dbhome_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$ORACLE_HOME/bin:$PATH


#图形界面安装
解压文件
su - root
cd /home/oracle
unzip /mnt/linux.x64_11gR2_database_1of2.zip  #根据个人目录调整
unzip /mnt/linux.x64_11gR2_database_2of2.zip  #根据个人目录调整

#登陆主机界面(非远程)
su - oracle   #最好注销root,重新用oracle登陆,否则可能报错
cd database
./runInstaller   
export LANG=en_US.UTF-8   #出现乱码执行

5、图形界面安装

image-20200221105320492.png image-20200221105405058.png image-20200221105414989.png image-20200221105423382.png image-20200221105433586.png image-20200221105439286.png image-20200221105444481.png image-20200221105449109.png image-20200221105453115.png image-20200221105457756.png image-20200221105501776.png image-20200221105506193.png image-20200221105510356.png image-20200221105514712.png image-20200221105518619.png image-20200221105522602.png image-20200221105526535.png image-20200221105532957.png image-20200221105536734.png image-20200221105540785.png image-20200221105545972.png image-20200221105550799.png image-20200221105554684.png image-20200221105558736.png image-20200221105605159.png image-20200221105609479.png
上一篇下一篇

猜你喜欢

热点阅读