Centos 7下安装Oracle 12c
SQL Server玩了有些年,最近想玩玩Oracle,于是想到装一台Oracle server来玩玩。第一次在Linux下安装Oracle,整个过程参考了一篇文章:http://blog.csdn.net/huangyanlong/article/details/45021171
环境:VMWare Workstatrion 8.0.3
操作系统:CentOS 7 x64
数据库:Oracle 12c x64
1)安装好Centos 7,这一步跳过
2)从Oracle官网下载12c的安装包,也跳过
3)把软件从本地上传到VM的linux服务器上
这一步的做法是:把虚机的网络连接方式设置成桥接>>在linux服务器上配置ip地址和本机处在同一个网络>>把本地机器上的包含Oracle 12c安装包的目录共享出来>>确保可以在linux服务器上Ping通本地机器>>用mount命令把共享目录挂载到linux服务器上>>解压linuxamd64_12102_database_1of2.zip,linuxamd64_12102_database_2of2.zip这两个zip包到linux服务器上
挂载:mount -t cifs -o username=Jerry,password=password,ip=192.168.1.100 //192.168.1.100/Oracle /mnt/oracle
解压:unzip ./linuxamd64_12102_database_1of2.zip -d /usr/Oracle; unzip ./linuxamd64_12102_database_2of2.zip -d /usr/Oracle;
禁用一些服务,用脚本来做
[root@localhost Oracle Installation]# cat servicestop.sh
chkconfig iptables off
chkconfig ip6tables off
chkconfig cups off
chkconfig firstboot off
chkconfig wpa_supplicant off
chkconfig postfix off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
这一步本来应该要去参考Oracle官方安装文档准备好要事先安装的安装包,不过由于上面参考的文章中作者已经列出,这里我直接借鉴那份列表
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
ksh
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
libXext-1.1 (x86_64)
libXtst-1.0.99.2 (x86_64)
libX11-1.3 (x86_64)
libXau-1.0.5 (x86_64)
libxcb-1.5 (x86_64)
libXi-1.3 (x86_64)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
这些rpm包估计都在iso镜像中,要我去一个一个找我觉得太浪费时间,要是下次我要再装一台岂不是要再找多一次。于是我有了一个想法,就是用一个文件存储这份列表,然后写个shell通过关键字在安装盘上查找我们可能需要安装的包,然后拷贝到某个文件夹下
[root@localhost Oracle Installation]# vi cppkg
binutils
compat-libcap
compat-libstdc
gcc-
gcc-c++
glibc-
glibc-devel
ksh
libgcc
libstdc++
libstdc++-devel
libaio
libaio-devel
libXext
libXtst
libX11
libXau
libxcb
libXi-
make
sysstat
保存离开
建立bash_loop_test来拷贝rpm包到本地目录
[root@localhost Oracle Installation]# cat bash_loop_test
#!/bin/bash
cat /home/jerry/Desktop/'Oracle Installation'/cppkg | while read line
do
find /mnt/cdrom/Packages/ -name ${line}'*' -exec cp {} /home/jerry/Desktop/'Oracle Installation'/ \;
echo $line
done
[root@localhost Oracle Installation]# sh bash_loop_test
生成安装包脚本
[root@localhost Oracle Installation]# echo /dev/null > rpm.sh; find . -name '*.rpm'|xargs -i echo 'rpm -ivh '{} >> rpm.sh ;
不过经过实践发现其实这个方法也不好,因为很多dependency在,所以其实还是要手动去安装这个包。不过至少自己知道去思考一些方法,算是练习练习shell吧
安装调用图形化需要的包,注意这里需要机器可以连接到Internet
[root@localhost Packages]# yum -y install unixODBC
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB :
extras | 3.4 kB :
updates | 3.4 kB :
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors..com
Resolving Dependencies
--> Running transaction check
---> Package unixODBC.x86_64 :2.3.-.el7 will be installed
--> Finished Dependency Resolution
省略
Installed:
unixODBC.x86_64 0:2.3.1-10.el7
Complete!
[root@localhost Packages]# yum -y install unixODBC-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors..com
省略
Installed:
unixODBC-devel.x86_64 0:2.3.1-10.el7
Complete!
[root@localhost Packages]# yum install -y xterm
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors..com
省略
Installed:
xterm.x86_64 :-.el7 Dependency Installed:
libXaw.x86_64 :1.0.-6.1.el7 Complete!
添加用户和用户组,建立主目录
[root@localhost Packages]# groupadd oinstall
groupadd: group 'oinstall' already exists
[root@localhost Packages]# groupadd dba
groupadd: group 'dba' already exists
[root@localhost Packages]# useradd -g oinstall -G dba oracle
useradd: user 'oracle' already exists
[root@localhost Packages]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost Packages]# id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
[root@localhost Packages]# mkdir -p /u01/app/oracle/product/12.1.0/db_1
[root@localhost Packages]# mkdir -p /u01/app/oraInventory
[root@localhost Packages]# chown -R oracle:oinstall /u01/app
[root@localhost Packages]# chmod -R 775 /u01/app
[root@localhost Packages]# vi /etc/sysctl.conf
[root@localhost Packages]# vi /etc/sysctl.conf
[root@localhost Packages]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
[jerry@localhost Desktop]$ cat /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
[root@localhost Packages]# vi /etc/security/limits.conf
把下面的内容添加到文件尾部
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@localhost Packages]# vi /etc/pam.d/login
把下面的内容添加到文件尾部
session required /lib/security/pam_limits.so
session required pam_limits.so
[root@localhost Packages]# 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
切换到oracle用户,修改.bash_profile文件
[root@localhost database]# su oracle
[oracle@localhost ~]$vi .bash_profile
[oracle@localhost ~]$ cat .bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs #PATH=$PATH:$HOME/.local/bin:$HOME/bin #export PATH ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/12.1./db_1
ORACLE_SID=jerrychen
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH
[oracle@localhost ~]$ source .bash_profile
然而似乎一切顺利可以进入安装阶段时
[oracle@localhost database]$ ./runInstaller
./runInstaller: line : [: /usr/oracle/Oracle: binary operator expected
./runInstaller: line : [: too many arguments
./runInstaller: line : /usr/oracle/Oracle: No such file or directory
一时搞不懂出了什么情况。Google了一下有了头绪,原因是安装目录的名字叫Oracle \Installation。这个命名包含了\符号,就是这个原因导致了runInstaller安装脚本报错,我把目录的名称修改了一下,去除空格和特殊符号好就没报这个错误了。但是,出现了另一个错误,Display变量相关
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than MB. Actual MB Passed
Checking swap space: must be greater than MB. Actual MB Passed
Checking monitor: must be configured to display at least colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation, Continue? (y/n) [n] n
用[oracle@localhost database]$ export DISPLAY=192.168.1.120:0.0设置一下这个变量,然后开启另一个终端来运行runInstaller
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than MB. Actual MB Passed
Checking swap space: must be greater than MB. Actual MB Passed
Checking monitor: must be configured to display at least colors. Actual Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015--21_10--42PM. Please wait ...[oracle@localhost database]$
终于进入安装阶段了
有个包前面漏安装了。查了一下安装光盘没有找到这个包。原来linux 7上没有,要到linux 6上才有。但是我不可能跑去download一个linux 6的镜像嘛。用yum来安装咯。至于swap文件和oracle建议的2.8G差了800mb,我想这个不影响整个安装过程,可以等安装完再修改swap文件的大小。跳过(忽略)这项检查。
[root@localhost Packages]# yum -y install compat-libstdc++-
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-.x86_64 :3.2.-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
compat-libstdc++- x86_64 3.2.-.el7 base k Transaction Summary
================================================================================
Install Package Total download size: k
Installed size: k
Downloading packages:
compat-libstdc++--3.2.-.el7.x86_64.rpm | kB :
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : compat-libstdc++--3.2.-.el7.x86_64 /
Verifying : compat-libstdc++--3.2.-.el7.x86_64 / Installed:
compat-libstdc++-.x86_64 :3.2.-.el7 Complete!
Centos 7下安装Oracle 12c的更多相关文章
- Windows 下安装 Oracle 12c 教程
原文 Windows 下安装 Oracle 12c 教程 申明:本文原作者:Jmq 本文给大家带来的是 Oracle 12C 的安装教程. 1.准备 1.1 下载 Oracle 12c 安装程序 ...
- Centos 6下安装Oracle 11gR2
一.安装环境 CentOS release 6.7 (Final) Oracle Database 11g Release 2 二.安装前准备 #修改主机名 修改/etc/sysconfig/netw ...
- centos 7 中安装Oracle 12c
今天有需要在centos 7上安装oracle 12 所以上网查了一下安装流程,原贴转自:https://blog.csdn.net/github_39294367/article/details/7 ...
- CentOS 7.6 安装Oracle 12c
下载地址: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html https://www ...
- 最小安装的centos7下安装oracle 12c
下载 oracal 安装包 进入https://www.oracle.com/index.html 依次选择-->Menu -->Downloads and trials -->D ...
- Redhat 6环境下安装Oracle 12c的方法
Step 1: 要在Linux上安装Oracle,需要在安装Oracle之前安装好相应的软件包,在不同操作系统环境下,对软件包的要求各不相同.具体对应的软件包,见官网文档:https://docs.o ...
- 在Window下安装Oracle 12C Cloud Control Agent
① 准备好安装源,这个ORACLE普通账号无法下载到,有需要的可以联系我 p14570373_112000_Generic.zip,用于Windows 64位操作系统 ② 解压p14570373_ ...
- CentOS 7 下安装oracle 11g碰到的一些问题
OUI预检查时会报错,安装时会报两个不符合项目 1 compat-libstdc++ 提示未安装 奇怪这个,yum install compat-libstdc++ 老是提示找不到包,其实正确的安装方 ...
- win10 x64下安装oracle 12c出现[INS-30131]报错的解决方案
解决方案: 第一步:控制面板>所有控制面板项>管理工具>服务>SERVER 启动 第二步:控制面板>所有控制面板项>管理工具>计算机管理>系统工具> ...
随机推荐
- SpringMVC核心类DispatcherServlet
配置DispatcherServlet 要使用SpringMVC,必须在web.xml中配置好这个DispatcherServlet类 <!-- spring框架必须定义ContextLoade ...
- makefile常用函数
标签(空格分隔): makefile 1.字符串替换和分析函数 $(subst from,to,text) #在文本"text"中使用"to"替换每一处&quo ...
- 【POJ】【2699】The Maximum Number of Strong Kings
网络流/最大流/二分or贪心 题目大意:有n个队伍,两两之间有一场比赛,胜者得分+1,负者得分+0,问最多有几只队伍打败了所有得分比他高的队伍? 可以想到如果存在这样的“strong king”那么一 ...
- JavaScript + HTML DOM (keep for myself)
1.改变 HTML 输出流 JavaScript 能够创建动态的 HTML 内容 eg. <script>document.write(Date());</script> 绝对 ...
- 好用到没朋友的大数模板(c++) 2014-10-01 15:06 116人阅读 评论(0) 收藏
#include <iostream> #include <cstring> using namespace std; #define DIGIT 4 //四位隔开,即万进制 ...
- Codeforces Round #204 (Div. 2)->C. Jeff and Rounding
C. Jeff and Rounding time limit per test 1 second memory limit per test 256 megabytes input standard ...
- .NET设计模式(5):工厂方法模式(Factory Method)(转)
工厂方法模式(Factory Method) ——.NET设计模式系列之五 Terrylee,2004年1月2日 概述 在软件系统中,经常面临着“某个对象”的创建工作,由于需求的变化,这个对象的具体实 ...
- ubuntu安装后没有root密码
新安装的ubuntu没有设置root密码,也就不能登录到root账户下.要想设置root密码需要在当前账户下输入sudo passwd,然后输入当前用户的密码,然后输入两次root的新密码,即可完成r ...
- BZOJ1502: [NOI2005]月下柠檬树
Simpson法相当好用啊!神奇的骗分算法! /************************************************************** Problem: 1502 ...
- 斌哥的 Docker 进阶指南—监控方案的实现
过去的一年中,关于 Docker 的话题从未断过,而如今,从尝试 Docker 到最终决定使用 Docker 的转化率依然在逐步升高,关于 Docker 的讨论更是有增无减.另一方面,大家的注意力也渐 ...