oracle单机数据库搭建巨详细文档
规划
环境:redhat6.9
安装包:p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
数据库配置
ORACLE_SID=csk;
ORACLE_BASE=/home/app/oracle;
ORACLE_HOME= $ORACLE_BASE/product/11.2.0/dbhome_1;
ORACLE IP = 192.168.17.133
ORACLE 端口= 1521、1158
具体过程

配置网卡
[root@database ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
添加如下内容:
+++++++++++++++ETH0++++++++++++++++++++++
DEVICE=eth0
HWADDR=00:0C:29:0C:1F:38
TYPE=Ethernet
UUID=3e6bd021-df81-40e1-a4c5-e8215fa9ec95
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.17.133
NETMASK=255.255.255.0
GATEWAY=192.168.17.2
++++++++++++++++++++++++++++++++++++++++
关闭selinux
[root@database ~]# vim /etc/sysconfig/selinux
修改如下内容:
SELINUX=disabled
开放防火墙1521、1158端口
配置防火墙
[root@database ~]# vim /etc/sysconfig/iptables
在端口号22后添加如下内容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT
##1521是Oracle默认开放的远程端口;1158则是OME端口。##
重启防火墙
[root@database ~]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
iptables:应用防火墙规则: [确定]
查看防火墙状态
[root@database ~]# service iptables status
表格:filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:1521
6 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:1158
7 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
修改hosts文件
[root@database ~]# vim /etc/hosts
添加如下内容:
192.168.17.133 database
添加YUM源
1、挂载ISO镜像
[root@database ~]# mount /dev/sr0 /media
2、配置repo文件
[root@database ~]# vim /etc/yum.repos.d/rhel-source.repo
添加如下内容:
[rhel-source]
name=rhel-source
baseurl=file:///media
enabled=1
gpgcheck=0
3、更新yum源
[root@database ~]# yum clean all
[root@database ~]# yum list
安装数据库所需依赖软件包
1、检查还有哪些依赖包没有安装
[root@database ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) \n' binutils \compat-libstdc++ \elfutils-libelf \elfutils-libelf-devel \gcc \gcc-c++ \glibc \glibc-common \glibc-devel \glibc-headers \ksh \libaio \libaio-devel \libgcc \libstdc++ \libstdc++-devel \make\sysstat \unixODBC \unixODBC-devel
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
binutils-2.20.51.0.2-5.36.el6 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.152-1.el6 (x86_64)
package elfutils-libelf-devel is not installed
package gcc is not installed
package gcc-c++ is not installed
glibc-2.12-1.132.el6 (x86_64)
glibc-common-2.12-1.132.el6 (x86_64)
glibc-devel-2.12-1.132.el6 (x86_64)
glibc-headers-2.12-1.132.el6 (x86_64)
package ksh is not installed
libaio-0.3.107-10.el6 (x86_64)
package libaio-devel is not installed
libgcc-4.4.7-4.el6 (x86_64)
libstdc++-4.4.7-4.el6 (x86_64)
package libstdc++-devel is not installed
package makesysstat is not installed
package unixODBC is not installed
package unixODBC-devel is not installed
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2、安装
[root@database ~]# yum install -y compat-libstdc++* elfutils-libelf-devel* gcc* gcc-c++* ksh* libaio-devel* libstdc++-devel* libstdc++-devel* makesysstat* unixODBC* unixODBC-devel*
修改内核参数
[root@database ~]# vim /etc/sysctl.conf
添加如下内容:
kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
##########################################################################
注意: kernel.shmmax 的值是物理内存的一半。 我的是2G内存,所以是1073741824。
参数说明: kernel.shmmni:整个系统共享内存段的最大数目
fs.file-max:系统中所允许的文件句柄最大数目
net.core.rmem_default:套接字接收缓冲区大小的缺省值
net.core.rmem_max:套接字接收缓冲区大小的最大值
net.core.wmem_default:套接字发送缓冲区大小的缺省值
net.core.wmem_max:套接字发送缓冲区大小的最大值
net.ipv4.ip_local_port_range:应用程序可使用的IPv4端口范围
使内核参数立即生效
[root@database ~]# sysctl -p
添加如下内容:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
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.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
修改/etc/security/limits.conf文件
限制Oracle用户资源
[root@database ~]# vim /etc/security/limits.conf
添加如下内容:
oracle soft nproc 2047 #oracle用户进程告警值
oracle hard nproc 16384 #oracle用户进程最大阈值
oracle soft nofile 1024 #oracle用户文件使用量告警值
oracle hard nofile 65536 #oracle用户文件使用量最大阈值
修改/etc/pam.d/login文件
将配置文件加入到登录验证模块中
[root@database ~]# vim /etc/pam.d/login
添加如下内容:
session required pam_limits.so #调用pam_limits.so模块
修改/etc/profile文件
限制oracle用户使用的系统资源
[root@database ~]# 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
umask 022
fi
创建用户和用户组
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
查看是否创建成功
[root@database ~]# id oracle
uid=500(oracle) gid=502(oinstall) 组=502(oinstall),501(dba)
新建安装目录并设置目录所有者和权限
mkdir -p /home/app/oracle
mkdir -p /home/app/oraInventory
mkdir -p /home/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /home/app/oracle/
chown -R oracle:oinstall /home/app/oraInventory/
chown -R oracle:oinstall /home/app/oracle/product/11.2.0/dbhome_1
chmod -R 775 /home/app/
修改oracle用户环境变量,并限制Oracle用户系统资源使用
[root@database ~]# su - oracle
[root@database ~]# vim .bash_profile
添加如下内容:
export TMP=/tmp;
export TMPDIR=$TMP;
export LANG=en_us;
export ORACLE_BASE=/home/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1;
export ORACLE_SID=orcl;
export ORACLE_TERM=xterm;
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
umask 022
使Oracle用户下的环境变量文件立即生效
[oracle@database ~]$ source .bash_profile
上传Oracle单机安装包
补丁集1和2
解压并修改权限
[root@database oracle_rj]# unzip p13390677_112040_Linux-x86-64_1of7.zip && unzip p13390677_112040_Linux-x86-64_2of7.zip
[root@database oracle_rj]# chmod 775 -R database/
Oracle用户下运行runInstaller开始安装Oracle
[oracle@database ~]$ /oracle_rj/database/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 25657 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3999 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-01-20_04-10-49AM. Please wait ...
Step01.配置安全更新
取消勾选,不接收安全更新,然后点击【Next】,弹出提示窗口,选择【Yes】


step02.选择跳过更新

tep03.选择安装选项
包含3个安装选项:
1. 创建和配置数据库
2. 仅安装数据库软件
3. 升级现有数据库
这里我们选择【仅安装数据库软件】,然后点击【Next】:

Step04.节点选择
包含3个选项:
1. 单实例数据库安装
2. Real Application Clusters数据库安装
3. ORACLE RAC 单节点安装
选择【单实例数据库安装】,然后点击【Next】:

Step05.选择产品语言
默认已添加了【English】,在左侧语言列表中找到简体中文【Simplified Chinese】,并添加到右侧,然后点击【Next】:

Step06.选择数据库版本
包含3个选项:
1. 企业版:具有可伸缩性、高性能、高可用性和安全功能的自行管理的数据库,能够满足大多数高标准的关键任务应用程序的需求。
2. 标准版:标准版是寻求低成本解决方案的工作组、部门和中小企业的理想选择。
3. 标准版1:标准版1是寻求低成本解决方案的工作组、部门和中小企业的理想选择。
选择【企业版】,然后点击【Next】:

Step07.指定安装位置
设置Oracle基目录为新建的目录:/home/app/oracle,则软件位置会自动为:/home/app/oracle/product/11.2.0/dbhome_1,然后点击【Next】:

Step08.创建产品清单
设置Oracle清单目录为新建的目录:/home/app/ oraInventory,选择组"oinstall",然后点击【Next】:


Step09.特权操作系统组
设置数据库管理员组为【dba】,数据库操作者组为【oinstall】。然后点击【Next】:


Step10.执行先决条件检查
若提示有程序包不存在,是因为Linux6之后,pdksh依赖包被ksh包替代,所有可选择【忽略全部】,然后点击【Next】:




Step12.运行配置脚本

软件及数据库配置完成后,需要运行配置脚本:
打开命令终端,切换到root用户,并执行脚本:

按照提示运行这两脚本
[root@database oraInventory]# ./orainstRoot.sh
Changing permissions of /home/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /home/app/oraInventory to oinstall.
The execution of the script is complete.
[root@database oraInventory]# cd /home/app/oracle/product/11.2.0/dbhome_1/
[root@database dbhome_1]# ./root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /home/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: 【默认就好,直接回车】
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
创建监听
netca








点击 Finish,完成创建。
创建数据库
dbca


选择数据库模板
选择定制数据库










询问数据库创建后有没有SQL脚本运行,选择不运行。











oracle单机数据库搭建巨详细文档的更多相关文章
- MongoDB数据库、集合、文档的操作
MongoDB系列第一课:MongDB简介 MongoDB系列第二课:MongDB环境搭建 MongoDB系列第三课:MongDB用户管理 MongoDB系列第四课:MongoDB数据库.集合.文档的 ...
- DBImport v3.44 中文版发布:数据库数据互导及文档生成工具(IT人员必备)
前言: 距离上一个版本V3.3版本的文章发布,已经是1年10个月前的事了. 其实版本一直在更新,但也没什么大的功能更新,总体比较稳定,所以也不怎么写文介绍了. 至于工作上的事,之前有半年时间跑去学英语 ...
- 传智播客C/C++各种开发环境搭建视频工具文档免费教程
传智播客作为中国IT培训的领军品牌,一直把握技术趋势,给大家带来最新的技术分享!传智播客C/C++主流开发环境免费分享视频文档中,就有写一个helloworld程序的示范.火速前来下载吧 所谓&quo ...
- Docker最全教程之使用Node.js搭建团队技术文档站(二十三)
前言 各种编程语言均有其优势和生态,有兴趣的朋友完全可以涉猎多门语言.在平常的工作之中,也可以尝试选择相对适合的编程语言来完成相关的工作. 在团队技术文档站搭建这块,笔者尝试了许多框架,最终还是选择了 ...
- Oracle client客户端简易安装网上文档一
Oracle client客户端简易安装网上文档一-------------------------------------------------------------------------一. ...
- CM5(Cloudera Manager 5) + CDH5(Cloudera's Distribution Including Apache Hadoop 5)的安装详细文档
参考 :http://www.aboutyun.com/thread-9219-1-1.html Cloudera Manager5及CDH5在线(cloudera-manager-installer ...
- 在Linux 安装Python3.5.6详细文档!!!!
在Linux 安装Python3.5.6详细文档!!!! 1.安装相关依赖库(工具包) yum install gcc patch libffi-devel python-devel zlib-de ...
- 关于PowerDesigner导出数据库表到word文档
关于PowerDesigner导出数据库表到word文档 一.查看全部模板: powerdesigner默觉得我们提供了非常多的模版,在工具栏中选择[Report(报告)--->Report T ...
- Win10环境下,告别MarkdownPad,用Notepad++搭建编写md文档的环境
1. 为什么抛弃MarkdownPad 2 ? MarkdownPad坊间号称 Windows 环境下最好用的markdown编辑器-EXO me??? 博主入MarkdownPad 2 坑就是因为这 ...
随机推荐
- WebSecurityConfig
package me.zhengjie.core.config; import me.zhengjie.core.security.JwtAuthenticationEntryPoint; impor ...
- MAYA 卸载工具,完美彻底卸载清除干净maya各种残留注册表和文件
是不是遇到MAYA/CAD/3DSMAX/INVENTOR安装失败?AUTODESK系列软件着实令人头疼,MAYA/CAD/3DSMAX/INVENTOR安装失败之后不能完全卸载!!!(比如maya, ...
- 关于文件下载Header设置
常见的媒体格式类型如下: text/html : HTML格式text/plain :纯文本格式 text/xml : XML格式image/gif :gif图片格式 image/jpeg :jpg图 ...
- Nginx笔记总结十八:nginx统计响应的http状态码信息(ngx-http-status-code-counter)
编译:./configure --prefix=/usr/local/nginx --add-module=../ngx_http_status_code_counter-master make &a ...
- 挑战中英实时语音翻译——Skype Translator 中文预览版登陆中国
Translator 中文预览版登陆中国" title="挑战中英实时语音翻译--Skype Translator 中文预览版登陆中国"> 今天,我们正式宣布在中国 ...
- [洛谷P4549] [模板] 裴蜀定理
18.10.03模拟赛T1. 出题人xcj(Mr.Handsome)十分良心,给了一道送分题...... 互测题好久没有出现送分题了.xcj真棒. 题目传送门 幸亏之前看过,否则真的是送分题都拿不到. ...
- js 函数的防抖(debounce)与节流(throttle)
原文:函数防抖和节流: 序言: 我们在平时开发的时候,会有很多场景会频繁触发事件,比如说搜索框实时发请求,onmousemove, resize, onscroll等等,有些时候,我们并不能或者不想频 ...
- 在JavaScript里的“对象字面量”是什么意思?
字面量表示如何表达这个值,一般除去表达式,给变量赋值时,等号右边都可以认为是字面量.字面量分为字符串字面量(string literal ).数组字面量(array literal)和对象字面量(ob ...
- 猫头鹰的深夜翻译:核心JAVA并发一
简介 从创建以来,JAVA就支持核心的并发概念如线程和锁.这篇文章会帮助从事多线程编程的JAVA开发人员理解核心的并发概念以及如何使用它们. (博主将在其中加上自己的理解以及自己想出的例子作为补充) ...
- 6. Go 语言中结构体的使用
1. 结构体的定义格式 在go语言中结果的定义格式如下: 123 type structName struct { filedList} 列子如下: 1234 type Person struct { ...