如何快速部署Oracle Database

Oracle Database在Linux系统上的安装是每一个初学者都必须面临的问题,只有正确的配置好了环境,才能进行后续的深入学习。本文旨在说明如何快速的部署Oracle的单实例环境,对于初学者,还是推荐阅读官方文档的快速安装向导来进行安装

http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm),这有助于让你了解完整的安装过程。

先说明一下我使用的操作系统平台:

  • Oracle Enterprise Linux 5u8
  • Oracle Enterprise Linux 6u8

上述ISO镜像可以去Oracle software delivery cloud下载。

在Oracle Linux 5中,可以使用使用Oracle validated Configuration 来加速部署Oracle环境,Oracle Validated Configurations致力于为企业提供更简易、更快捷、成本更低的基于Linux和Oracle VM的解决方案。该计划向我们提供经过测试和验证的体系架构,其附

带的文档揭示了相关硬件、软件、存储、网络原件的最佳配置实践,以帮助系统提升性能和可收缩性并降低成本。从行业角度来说Oracle Validated Configurations所验证的配置及提供的最佳实践文档受到Oracle合作伙伴的接受和认可,Oracle Validated

Configurations提供了推荐使用的软硬件组合的部署方案细节,这些方案已被证明是十分有益的。

Oracle validated Configuration包可以实现如下功能:

  1. Causing the download and installation of various software packages and specific versions needed for database installation, with package dependencies resolved via yum or up2date capabilities
  2. Creating the user oracle and the groups oinstall and dba, which are used during database installation
  3. Modifying kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on
  4. Setting hard and soft shell resource limits in /etc/security/limits.conf, such as the locked-in memory address space, the number of open files, the number of processes, and core file size
  5. Setting numa=off in the kernel for x86_64 machines

####################

NUMA,非统一内存访问(Non-uniform Memory Access),介于SMP和MPP之间。在NUMA架构中,每一颗CPU被称为一个node,每个node之间的内存使用的独立的。在SMP架构中,每个CPU之间是绝对平等的,没有优先级之分,访问内存都必须通过系统总线。同时CPU之间的访问也是需要经过系统总线的,系统的总线将成为整个系统的瓶颈。在NUMA架构中,每颗CPU之间是独立的,相互之间的内存是不影响的,每一颗CPU访问属于自己的内存,延迟是最小的。
关闭NUMA的几种方法:

  1. BIOS中关闭NUMA设置
  2. 在操作系统kernel层面关于numa,例如:/etc/grub.conf的kernel行最后添加: numa=off
  3. 数据库层面关闭:_enable_NUMA_optimization=false(11g中参数为_enable_NUMA_support)

该部分内容引用自:http://www.killdb.com/2014/08/15/linux-numa%E5%BC%95%E5%8F%91%E7%9A%84%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%EF%BC%9F.html

####################

Oracle Validated Configuration的安装配置方法

(1)使用root账户登录,检索本地的yum源文件

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-el5.repo

如果没有连接外网的条件,可以配置本地yum源,见第(2)节,创建本地yum源。

(2)使用文本编辑器,将repository文件中的enable=0修改为enable=1

[ol5_u7_base]
name=Oracle Linux $releasever - U7 - $basearch - base
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

[el5_addons]
name=Enterprise Linux $releasever - $basearch - addons
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/addons/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=0

创建本地yum源

# mkdir /mnt/cdrom  
# mount /dev/cdrom /mnt/cdrom
# touch /etc/yum.repos.d/localyum.repo
# vi /etc/yum.repos.d/localyum.repo

[ol5u8]
name = Enterprise Linux 5.8 DVD 
baseurl=file:///mnt/cdrom/Server/ 
gpgcheck=0 
enabled=1

(3)安装Oracle Validated Configuration

yum install oracle-validated -y

 

在Oracle Linux 6的发行版中,没有oracle validate包(oracle-validated被取消的主要原因之一是,“oracle-validated”名字听起来仿佛它会创建一个验证任何Oracle产品的环境。这变得越来越难以管理,因此甲骨文决定重新启动它与Oracle预安装RPM,预期将要安

装的产品包含在RPM名称中的名称),而是推出了oracle-rdbms-server-11gR2-preinstall包。在Oracle Linux 6下安装Oracle 11gR2之前,Pre-install包可以帮助我们完成大部分的配置工作。在Oracle Linux 6下,oracle-rdbms-server-11gR2-preinstall包只

有64位版本,使用这个包可以实现如下功能:

  1. 自动下载和安装,安装Oracle Grid Infrastructure和Oracle Database所需的对应版本的软件包,并负责解决包之间的依赖问题。
  2. 自动创建在安装期间所需的oracle用户及oinstall(OraInventory)和dba(OSDBA)组。出于安全角度的考虑,oracle用户没有密码而且不能远程登陆,为了可以使其远程登陆,需要使用passwd命令为其设置密码。
  3. 自动修改内核参数(/etc/sysctl.conf)。诸如共享内存,信号量、最大打开文件描述符等方面。
  4. 自动设置在硬件和软件资源方面的限制(/etc/security/limits.conf),诸如locked-in memory address space,最大打开文件数,进程数量,内核文件的大小等方面。
  5. 自动设置numa=off(x86_64内核)

安装oracle-rdbms-server-11gR2-preinstall

(1)使用root账户登录,检索本地的yum源文件

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo

如果没有连接外网的条件,可以配置本地yum源,见第(2)节,创建本地yum源。

(2)使用文本编辑器,将repository文件中的enable=0修改为enable=1

[ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1

[ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1

注:
# gpgcheck:表示是否进行gpg(GNU Private Guard) 校验,以确定rpm 包的来源是有效和安全的。0为禁用,1为启用
# enabled: 表示是否启用该yum源,0为禁用,1为启用

创建本地yum源

# cd /etc/yum.repos.d
# vi pubilic-yum-ol6.repo
# mount /dev/cdrom /mnt/cdrom

[ol6u8]
name=Oracle Enterprise Linux 6.8 DVD
baseurl=file:///mnt/cdrom/Server
gpgcheck=0
enabled=1

(3)安装preinstall包

yum install oracle-rdbms-server-11gR2-preinstall -y

最后,别忘了为oracle用户设置密码。

参考文章:
http://www.oracle.com/technetwork/articles/servers-storage-admin/ginny-dbinstallonlinux-2111493.html
http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html

posted @ 2016-08-18 14:36  运维苦旅  阅读(948)  评论(0编辑  收藏  举报