Oracle11g linux6 图形界面安装
2020年10月12日
16:32
环境检查:
1、硬件配置最低需求如下:
grep MemTotal /proc/meminfo 查看内存相关信息
grep SwapTotal /proc/meminfo 查看swap相关信息
df -k /tmp 查看分区tmp的相关信息
df -k 查看磁盘分区的相关信息
grep “model name” /proc/cpuinfo 查看cpu相关信息
uname -a 查看内核信息
uname -r 查看内核版本号
cat /proc/version 查看系统版本信息
lsb_release -a 查看特定系统版本信息
2、磁盘配置:
Oracle软件安装目录、数据文件目录、日志目录以及备份归档目录设计尽可能区别开来(对于数据库读写性能要求较高业务系统),避免单个磁盘IO负载过高。
3、IP地址、主机名配置以及本地域名解析配置
4、防火墙规则:
尽可能关闭防火墙,如不能关闭请仔细做好防火墙规则配置(未尝试)
5、关闭Selinux以及NetworkManager服务
6、配置Yum源:
compat-libcap1.x86_64
binutils-2.17.50.0.6-14.el5.x86_64.rpm
compat-libstdc+±33-3.2.3-61.x86_64.rpm
elfutils-libelf-0.137-3.el5.x86_64.rpm
elfutils-libelf-devel-0.137-3.el5.x86_64.rpm
gcc-4.1.2-48.el5.x86_64.rpm
glibc-devel-2.5-49.x86_64.rpm
libgomp-4.4.0-6.el5.x86_64.rpm
glibc-headers-2.5-49.x86_64.rpm
kernel-headers-2.6.18-194.el5.x86_64.rpm
gcc-c+±4.1.2-48.el5.x86_64.rpm
libstdc+±devel-4.1.2-48.el5.x86_64.rpm
glibc-2.5-49.x86_64.rpm
glibc-common-2.5-49.x86_64.rpm
ksh-20100202-1.el5.x86_64.rpm
libaio-0.3.106-5.x86_64.rpm
libaio-devel-0.3.106-5.x86_64.rpm
libgcc-4.1.2-48.el5.x86_64.rpm
libstdc+±4.1.2-48.el5.x86_64.rpm
libstdc+±devel-4.1.2-48.el5.x86_64.rpm
make-3.81-3.el5.x86_64.rpm
sysstat-7.0.2-3.el5.x86_64.rpm
unixODBC-2.2.11-7.1.x86_64.rpm
unixODBC-devel-2.2.11-7.1.x86_64.rpm
(企业级操作系统版本一般为64位而不是32位,原因:32位操作系统最大支持4G内存,有局限性,
所以通常都是64位的操作系统,装包时也要装与其对应的64位的包)
7、Oracle安装包准备
系统环境准备:
Tips: 实操部分
1、系统内核参数配置:
vim /etc/sysctl.conf
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
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
kernel.shmmax = 68719476736 单个共享内存段的最大值,单位:字节
kernel.shmall = 4294967296 可用共享内存的总量(单位:页)
kernel.shmmni = 4096 共享内存段的最大数量
kernel.sem = 250 32000 100 128 内核信号量的设置
fs.aio-max-nr = 1048576 同时可以拥有的异步IO请求数目
fs.file-max = 6815744 文件句柄的最大值
net.ipv4.ip_local_port_range = 9000 65500 oracle本地端口号范围
net.core.rmem_default = 262144 默认的接收窗口大小
net.core.rmem_max = 4194304 最大的TCP数据发送缓冲
net.core.wmem_default = 262144 默认的发送窗口大小
net.core.wmem_max = 1048576 接收窗口的最大大小
sysctl -p 更新新内核配置文件,使参数生效
2、Oracle依赖包安装:
yum install binutils compat-libstdc+±33 elfutils-libelf elfutils-libelf-d-static elfutils-libelf-devel gcc glibc libgomp glibc-headers kernel-headers gcc-c++ libstdcevel glibc-devel glibc-common ksh libaio libaio-devel libgcc libstdc++ libstdc+±devel makestat unixODBC unixODBC-devel -y
3、创建相关用户组:
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
useradd -g oinstall -G dba,oper oracle
echo oracle | passwd --stdin oracle
tips:根据需要是否制定用户组id
4、配置oracle系统用户环境变量以及配置
配置oracle用户限制参数
vim /etc/security/limits.conf
tail -5 /etc/security/limits.conf
End of file
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047 oracle用户可以开启进程的软限制是2047
oracle hard nproc 16384 oracle用户可以开启进程的硬限制是16384
oracle soft nofile 1024 oracle用户可以打开文件的软限制是1024
oracle hard nofile 65536 oracle用户可以打开文件的硬限制是65536
因为/etc/pam.d/system-auth里已经存在session required pam_limits.so
所以如下操作不用执行
#vim /etc/pam.d/login
session required pam_limits.so
设置oracle的环境变量
vim /home/oracle/.bash_profile
cat /home/oracle/.bash_profile
.bash_profile
Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
User specific environment and startup programs
PATH=HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=ORACLE_HOME/bin:$PATH
export ORACLE_BASE=/u01/app/oracle 最佳灵活体系结构(OFA)基础目录
export ORACLE_HOME=ORACLE_BASE/product/11.2.0/db_home1 oracle数据库软件目录,位于ORACLE_BASE下
export TEMP=/tmp
export TEPDIR=/tmp
export ORACLE_SID=prod 默认访问的实例名
export PATH=ORACLE_HOME/bin:$PATH
Tips:
OFA: Optimal Flexible Architecture 最佳灵活体系结构,是如何设置Oracle软件所在的目录以及数据库相关文件所在目录的指导。如果一个DBA遵循该指导,那么新DBA接受也很容易了解到物理文件的分布情况;在同一个OS上安装不同版本的数据库也方便。
5、创建安装所需目录并解压oracle安装包
mkdir /u01/app/oracle -p
mkdir /u01/app/oracle/product/11.2.0/db_home1 -p
chown oracle.oinstall -R /u01
unzip p10404530_112030_Linux-x86-64_1of7.zip -d /usr/local/src/
unzip p10404530_112030_Linux-x86-64_2of7.zip -d /usr/local/src/
6、图形界面(按需,Linux操作)
root登陆后需xhost+后切换至oracle用户,如果上述没能正常启动图形界面可尝试直接使用oracle用户登陆,不从root切到oracle
Oracle软件图形界面安装
1、启动图形界面安装
目录切换至oracle安装包解压目录
cd /usr/local/src/database/
./runInstaller
2、图形界面安装步骤(请按需配置)
指定oracle基目录位置和oracle数据库软件的家目录位置
指定清单目录,在产品清单目录中,安装程序自动设置每个产品的子目录来包含产品的清单数据。
指定具有sysdba权限和sysoper权限的组
sysoper只允许启停数据库和管理参数文件
新开终端, 运行如下脚本:
[root@oracle ~]# /u01/app/oraInventory/orainstRoot.sh
Tips:
(包含设置清单目录权限等信息)
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@oracle ~]# /u01/app/oracle/product/11.2.0/db_home1/root.sh
Tips(包含oracle一些命令信息)
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_home1
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.
致辞oracle软件安装已大功告成!
Oracle网络服务配置
[root@memory ~]# xhost +
[root@memory ~]# su - oracle
[oracle@memory ~]$ netca
Tips:
1521标准端口号
[root@memory ~]# netstat -antp | grep :1521
tcp 0 0 172.16.6.16:15522 172.16.6.16:1521 ESTABLISHED 2577/ora_pmon_prod
tcp 0 0 :::1521 ::😗 LISTEN 2353/tnslsnr
tcp 0 0 ::ffff:172.16.6.16:1521 ::ffff:172.16.6.16:15522 ESTABLISHED 2353/tnslsnr
[oracle@memory ~]$ lsnrctl status 监听器状态 (监听器控制命令)
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-OCT-2015 11:09:03
Copyright © 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle.up.com)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-OCT-2015 10:36:27
Uptime 0 days 0 hr. 32 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_home1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.up.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
[oracle@memory ~]$ lsnrctl start 启动监听




